PL_InitArenaPool:
   32|   166k|                 PRUint32 align) {
   33|       |  /*
   34|       |   * Look-up table of PR_BITMASK(PR_CeilingLog2(align)) values for
   35|       |   * align = 1 to 32.
   36|       |   */
   37|   166k|  static const PRUint8 pmasks[33] = {
   38|   166k|      0, /*  not used */
   39|   166k|      0,  1,  3,  3,  7,  7,  7,  7,
   40|   166k|      15, 15, 15, 15, 15, 15, 15, 15, /*  1 ... 16 */
   41|   166k|      31, 31, 31, 31, 31, 31, 31, 31,
   42|   166k|      31, 31, 31, 31, 31, 31, 31, 31 /* 17 ... 32 */
   43|   166k|  };
   44|       |
   45|   166k|  if (align == 0) {
  ------------------
  |  Branch (45:7): [True: 0, False: 166k]
  ------------------
   46|      0|    align = PL_ARENA_DEFAULT_ALIGN;
  ------------------
  |  |   28|      0|#define PL_ARENA_DEFAULT_ALIGN sizeof(double)
  ------------------
   47|      0|  }
   48|       |
   49|   166k|  if (align < sizeof(pmasks) / sizeof(pmasks[0])) {
  ------------------
  |  Branch (49:7): [True: 166k, False: 0]
  ------------------
   50|   166k|    pool->mask = pmasks[align];
   51|   166k|  } else {
   52|      0|    pool->mask = PR_BITMASK(PR_CeilingLog2(align));
  ------------------
  |  |  147|      0|#define PR_BITMASK(n)   (PR_BIT(n) - 1)
  |  |  ------------------
  |  |  |  |  146|      0|#define PR_BIT(n)       ((PRUint32)1 << (n))
  |  |  ------------------
  ------------------
   53|      0|  }
   54|       |
   55|   166k|  pool->first.next = NULL;
   56|       |  /* Set all three addresses in pool->first to the same dummy value.
   57|       |   * These addresses are only compared with each other, but never
   58|       |   * dereferenced. */
   59|   166k|  pool->first.base = pool->first.avail = pool->first.limit =
   60|   166k|      (PRUword)PL_ARENA_ALIGN(pool, &pool->first + 1);
  ------------------
  |  |  146|   166k|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  ------------------
   61|   166k|  pool->current = &pool->first;
   62|       |  /*
   63|       |   * Compute the net size so that each arena's gross size is |size|.
   64|       |   * sizeof(PLArena) + pool->mask is the header and alignment slop
   65|       |   * that PL_ArenaAllocate adds to the net size.
   66|       |   */
   67|   166k|  if (size > sizeof(PLArena) + pool->mask) {
  ------------------
  |  Branch (67:7): [True: 166k, False: 0]
  ------------------
   68|   166k|    pool->arenasize = size - (sizeof(PLArena) + pool->mask);
   69|   166k|  } else {
   70|      0|    pool->arenasize = size;
   71|      0|  }
   72|       |#ifdef PL_ARENAMETER
   73|       |  memset(&pool->stats, 0, sizeof pool->stats);
   74|       |  pool->stats.name = strdup(name);
   75|       |  pool->stats.next = arena_stats_list;
   76|       |  arena_stats_list = &pool->stats;
   77|       |#endif
   78|   166k|}
PL_ArenaAllocate:
   99|   102k|PR_IMPLEMENT(void*) PL_ArenaAllocate(PLArenaPool* pool, PRUint32 nb) {
  100|   102k|  PLArena* a;
  101|   102k|  char* rp; /* returned pointer */
  102|   102k|  PRUint32 nbOld;
  103|       |
  104|   102k|  PR_ASSERT((nb & pool->mask) == 0);
  ------------------
  |  |  208|   102k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 102k, False: 0]
  |  |  ------------------
  ------------------
  105|       |
  106|   102k|  nbOld = nb;
  107|   102k|  nb = (PRUword)PL_ARENA_ALIGN(pool, nb); /* force alignment */
  ------------------
  |  |  146|   102k|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  ------------------
  108|   102k|  if (nb < nbOld) {
  ------------------
  |  Branch (108:7): [True: 0, False: 102k]
  ------------------
  109|      0|    return NULL;
  110|      0|  }
  111|       |
  112|       |  /* attempt to allocate from arenas at pool->current */
  113|   102k|  {
  114|   102k|    a = pool->current;
  115|   102k|    do {
  116|   102k|      if (nb <= a->limit - a->avail) {
  ------------------
  |  Branch (116:11): [True: 0, False: 102k]
  ------------------
  117|      0|        pool->current = a;
  118|      0|        rp = (char*)a->avail;
  119|      0|        a->avail += nb;
  120|      0|        return rp;
  121|      0|      }
  122|   102k|    } while (NULL != (a = a->next));
  ------------------
  |  Branch (122:14): [True: 0, False: 102k]
  ------------------
  123|   102k|  }
  124|       |
  125|       |  /* attempt to allocate from the heap */
  126|   102k|  {
  127|   102k|    PRUint32 sz = PR_MAX(pool->arenasize, nb);
  ------------------
  |  |  159|   102k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 101k, False: 165]
  |  |  ------------------
  ------------------
  128|   102k|    if (PR_UINT32_MAX - sz < sizeof *a + pool->mask) {
  ------------------
  |  |  302|   102k|#define PR_UINT32_MAX PR_UINT32(4294967295)
  |  |  ------------------
  |  |  |  |  282|   102k|#define PR_UINT32(x) x ## U
  |  |  ------------------
  ------------------
  |  Branch (128:9): [True: 0, False: 102k]
  ------------------
  129|      0|      a = NULL;
  130|   102k|    } else {
  131|   102k|      sz += sizeof *a + pool->mask; /* header and alignment slop */
  132|   102k|      a = (PLArena*)PR_MALLOC(sz);
  ------------------
  |  |   55|   102k|#define PR_MALLOC(_bytes) (PR_Malloc((_bytes)))
  ------------------
  133|   102k|    }
  134|   102k|    if (NULL != a) {
  ------------------
  |  Branch (134:9): [True: 102k, False: 0]
  ------------------
  135|   102k|      a->limit = (PRUword)a + sz;
  136|   102k|      a->base = a->avail = (PRUword)PL_ARENA_ALIGN(pool, a + 1);
  ------------------
  |  |  146|   102k|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  ------------------
  137|   102k|      PL_MAKE_MEM_NOACCESS((void*)a->avail, a->limit - a->avail);
  138|   102k|      rp = (char*)a->avail;
  139|   102k|      a->avail += nb;
  140|   102k|      PR_ASSERT(a->avail <= a->limit);
  ------------------
  |  |  208|   102k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 102k, False: 0]
  |  |  ------------------
  ------------------
  141|       |      /* the newly allocated arena is linked after pool->current
  142|       |       *  and becomes pool->current */
  143|   102k|      a->next = pool->current->next;
  144|   102k|      pool->current->next = a;
  145|   102k|      pool->current = a;
  146|   102k|      if (NULL == pool->first.next) {
  ------------------
  |  Branch (146:11): [True: 0, False: 102k]
  ------------------
  147|      0|        pool->first.next = a;
  148|      0|      }
  149|   102k|      PL_COUNT_ARENA(pool, ++);
  150|   102k|      COUNT(pool, nmallocs);
  151|   102k|      return (rp);
  152|   102k|    }
  153|   102k|  }
  154|       |
  155|       |  /* we got to here, and there's no memory to allocate */
  156|      0|  return (NULL);
  157|   102k|} /* --- end PL_ArenaAllocate() --- */
PL_ClearArenaPool:
  173|  50.4k|PR_IMPLEMENT(void) PL_ClearArenaPool(PLArenaPool* pool, PRInt32 pattern) {
  174|  50.4k|  PLArena* a;
  175|       |
  176|   101k|  for (a = pool->first.next; a; a = a->next) {
  ------------------
  |  Branch (176:30): [True: 50.6k, False: 50.4k]
  ------------------
  177|  50.6k|    PR_ASSERT(a->base <= a->avail && a->avail <= a->limit);
  ------------------
  |  |  208|   101k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:7): [True: 50.6k, False: 0]
  |  |  |  Branch (208:7): [True: 50.6k, False: 0]
  |  |  ------------------
  ------------------
  178|  50.6k|    a->avail = a->base;
  179|  50.6k|    PL_CLEAR_UNUSED_PATTERN(a, pattern);
  ------------------
  |  |  191|  50.6k|    PR_BEGIN_MACRO \
  |  |  ------------------
  |  |  |  |  123|  50.6k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  192|  50.6k|        PR_ASSERT((a)->avail <= (a)->limit); \
  |  |  ------------------
  |  |  |  |  208|  50.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 50.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  193|  50.6k|        PL_MAKE_MEM_UNDEFINED((void*)(a)->avail, (a)->limit - (a)->avail); \
  |  |  194|  50.6k|        memset((void*)(a)->avail, (pattern), (a)->limit - (a)->avail); \
  |  |  195|  50.6k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  50.6k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  180|  50.6k|    PL_MAKE_MEM_NOACCESS((void*)a->avail, a->limit - a->avail);
  181|  50.6k|  }
  182|  50.4k|}
PL_ArenaRelease:
  207|     18|PR_IMPLEMENT(void) PL_ArenaRelease(PLArenaPool* pool, char* mark) {
  208|     18|  PLArena* a;
  209|       |
  210|     36|  for (a = &pool->first; a; a = a->next) {
  ------------------
  |  Branch (210:26): [True: 36, False: 0]
  ------------------
  211|     36|    if (PR_UPTRDIFF(mark, a->base) <= PR_UPTRDIFF(a->avail, a->base)) {
  ------------------
  |  |  188|     36|#define PR_UPTRDIFF(p,q) ((PRUword)(p) - (PRUword)(q))
  ------------------
                  if (PR_UPTRDIFF(mark, a->base) <= PR_UPTRDIFF(a->avail, a->base)) {
  ------------------
  |  |  188|     36|#define PR_UPTRDIFF(p,q) ((PRUword)(p) - (PRUword)(q))
  ------------------
  |  Branch (211:9): [True: 18, False: 18]
  ------------------
  212|     18|      a->avail = (PRUword)PL_ARENA_ALIGN(pool, mark);
  ------------------
  |  |  146|     18|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  ------------------
  213|     18|      FreeArenaList(pool, a);
  214|     18|      return;
  215|     18|    }
  216|     36|  }
  217|     18|}
PL_FreeArenaPool:
  219|   155k|PR_IMPLEMENT(void) PL_FreeArenaPool(PLArenaPool* pool) {
  220|   155k|  FreeArenaList(pool, &pool->first);
  221|   155k|  COUNT(pool, ndeallocs);
  222|   155k|}
PL_FinishArenaPool:
  224|  10.6k|PR_IMPLEMENT(void) PL_FinishArenaPool(PLArenaPool* pool) {
  225|  10.6k|  FreeArenaList(pool, &pool->first);
  226|       |#ifdef PL_ARENAMETER
  227|       |  {
  228|       |    PLArenaStats *stats, **statsp;
  229|       |
  230|       |    if (pool->stats.name) {
  231|       |      PR_DELETE(pool->stats.name);
  232|       |    }
  233|       |    for (statsp = &arena_stats_list; (stats = *statsp) != 0;
  234|       |         statsp = &stats->next) {
  235|       |      if (stats == &pool->stats) {
  236|       |        *statsp = stats->next;
  237|       |        return;
  238|       |      }
  239|       |    }
  240|       |  }
  241|       |#endif
  242|  10.6k|}
plarena.c:FreeArenaList:
  188|   166k|static void FreeArenaList(PLArenaPool* pool, PLArena* head) {
  189|   166k|  PLArena* a = head->next;
  190|   166k|  if (!a) {
  ------------------
  |  Branch (190:7): [True: 65.9k, False: 100k]
  ------------------
  191|  65.9k|    return;
  192|  65.9k|  }
  193|       |
  194|   100k|  head->next = NULL;
  195|       |
  196|   102k|  do {
  197|   102k|    PLArena* tmp = a;
  198|   102k|    a = a->next;
  199|   102k|    PL_CLEAR_ARENA(tmp);
  ------------------
  |  |  200|   102k|    PR_BEGIN_MACRO \
  |  |  ------------------
  |  |  |  |  123|   102k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  201|   102k|        PL_MAKE_MEM_UNDEFINED((void*)(a), (a)->limit - (PRUword)(a)); \
  |  |  202|   102k|        memset((void*)(a), PL_FREE_PATTERN, (a)->limit - (PRUword)(a)); \
  |  |  ------------------
  |  |  |  |  197|   102k|#define PL_FREE_PATTERN 0xDA
  |  |  ------------------
  |  |  203|   102k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|   102k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  200|   102k|    PL_COUNT_ARENA(pool, --);
  201|   102k|    PR_DELETE(tmp);
  ------------------
  |  |  110|   102k|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  202|   102k|  } while (a);
  ------------------
  |  Branch (202:12): [True: 1.65k, False: 100k]
  ------------------
  203|       |
  204|   100k|  pool->current = head;
  205|   100k|}

PL_NewHashTable:
   58|     17|                void* allocPriv) {
   59|     17|  PLHashTable* ht;
   60|     17|  PRSize nb;
   61|       |
   62|     17|  if (n <= MINBUCKETS) {
  ------------------
  |  |   22|     17|#define MINBUCKETS (1 << MINBUCKETSLOG2)
  |  |  ------------------
  |  |  |  |   21|     17|#define MINBUCKETSLOG2 4
  |  |  ------------------
  ------------------
  |  Branch (62:7): [True: 10, False: 7]
  ------------------
   63|     10|    n = MINBUCKETSLOG2;
  ------------------
  |  |   21|     10|#define MINBUCKETSLOG2 4
  ------------------
   64|     10|  } else {
   65|      7|    n = PR_CeilingLog2(n);
   66|      7|    if ((PRInt32)n < 0) {
  ------------------
  |  Branch (66:9): [True: 0, False: 7]
  ------------------
   67|      0|      return 0;
   68|      0|    }
   69|      7|  }
   70|       |
   71|     17|  if (!allocOps) {
  ------------------
  |  Branch (71:7): [True: 9, False: 8]
  ------------------
   72|      9|    allocOps = &defaultHashAllocOps;
   73|      9|  }
   74|       |
   75|     17|  ht = (PLHashTable*)((*allocOps->allocTable)(allocPriv, sizeof *ht));
   76|     17|  if (!ht) {
  ------------------
  |  Branch (76:7): [True: 0, False: 17]
  ------------------
   77|      0|    return 0;
   78|      0|  }
   79|     17|  memset(ht, 0, sizeof *ht);
   80|     17|  ht->shift = PL_HASH_BITS - n;
  ------------------
  |  |   19|     17|#define PL_HASH_BITS 32  /* Number of bits in PLHashNumber */
  ------------------
   81|     17|  n = 1 << n;
   82|     17|  nb = n * sizeof(PLHashEntry*);
   83|     17|  ht->buckets = (PLHashEntry**)((*allocOps->allocTable)(allocPriv, nb));
   84|     17|  if (!ht->buckets) {
  ------------------
  |  Branch (84:7): [True: 0, False: 17]
  ------------------
   85|      0|    (*allocOps->freeTable)(allocPriv, ht);
   86|      0|    return 0;
   87|      0|  }
   88|     17|  memset(ht->buckets, 0, nb);
   89|       |
   90|     17|  ht->keyHash = keyHash;
   91|     17|  ht->keyCompare = keyCompare;
   92|     17|  ht->valueCompare = valueCompare;
   93|     17|  ht->allocOps = allocOps;
   94|     17|  ht->allocPriv = allocPriv;
   95|     17|  return ht;
   96|     17|}
PL_HashTableDestroy:
   99|     17|PL_HashTableDestroy(PLHashTable* ht) {
  100|     17|  PRUint32 i, n;
  101|     17|  PLHashEntry *he, *next;
  102|     17|  const PLHashAllocOps* allocOps = ht->allocOps;
  103|     17|  void* allocPriv = ht->allocPriv;
  104|       |
  105|     17|  n = NBUCKETS(ht);
  ------------------
  |  |   18|     17|#define NBUCKETS(ht) (1 << (PL_HASH_BITS - (ht)->shift))
  |  |  ------------------
  |  |  |  |   19|     17|#define PL_HASH_BITS 32  /* Number of bits in PLHashNumber */
  |  |  ------------------
  ------------------
  106|  1.05k|  for (i = 0; i < n; i++) {
  ------------------
  |  Branch (106:15): [True: 1.04k, False: 17]
  ------------------
  107|  1.46k|    for (he = ht->buckets[i]; he; he = next) {
  ------------------
  |  Branch (107:31): [True: 428, False: 1.04k]
  ------------------
  108|    428|      next = he->next;
  109|    428|      (*allocOps->freeEntry)(allocPriv, he, HT_FREE_ENTRY);
  ------------------
  |  |   39|    428|#define HT_FREE_ENTRY   1               /* free value and entire entry */
  ------------------
  110|    428|    }
  111|  1.04k|  }
  112|     17|#ifdef DEBUG
  113|     17|  memset(ht->buckets, 0xDB, n * sizeof ht->buckets[0]);
  114|     17|#endif
  115|     17|  (*allocOps->freeTable)(allocPriv, ht->buckets);
  116|     17|#ifdef DEBUG
  117|     17|  memset(ht, 0xDB, sizeof *ht);
  118|     17|#endif
  119|     17|  (*allocOps->freeTable)(allocPriv, ht);
  120|     17|}
PL_HashTableRawLookup:
  128|   121k|PL_HashTableRawLookup(PLHashTable* ht, PLHashNumber keyHash, const void* key) {
  129|   121k|  PLHashEntry *he, **hep, **hep0;
  130|   121k|  PLHashNumber h;
  131|       |
  132|       |#ifdef HASHMETER
  133|       |  ht->nlookups++;
  134|       |#endif
  135|   121k|  h = keyHash * GOLDEN_RATIO;
  ------------------
  |  |  125|   121k|#define GOLDEN_RATIO 0x9E3779B9U /* 2/(1+sqrt(5))*(2^32) */
  ------------------
  136|   121k|  h >>= ht->shift;
  137|   121k|  hep = hep0 = &ht->buckets[h];
  138|   127k|  while ((he = *hep) != 0) {
  ------------------
  |  Branch (138:10): [True: 68.8k, False: 58.7k]
  ------------------
  139|  68.8k|    if (he->keyHash == keyHash && (*ht->keyCompare)(key, he->key)) {
  ------------------
  |  Branch (139:9): [True: 63.0k, False: 5.77k]
  |  Branch (139:35): [True: 63.0k, False: 2]
  ------------------
  140|       |      /* Move to front of chain if not already there */
  141|  63.0k|      if (hep != hep0) {
  ------------------
  |  Branch (141:11): [True: 1.69k, False: 61.3k]
  ------------------
  142|  1.69k|        *hep = he->next;
  143|  1.69k|        he->next = *hep0;
  144|  1.69k|        *hep0 = he;
  145|  1.69k|      }
  146|  63.0k|      return hep0;
  147|  63.0k|    }
  148|  5.78k|    hep = &he->next;
  149|       |#ifdef HASHMETER
  150|       |    ht->nsteps++;
  151|       |#endif
  152|  5.78k|  }
  153|  58.7k|  return hep;
  154|   121k|}
PL_HashTableRawLookupConst:
  161|   905k|                           const void* key) {
  162|   905k|  PLHashEntry *he, **hep;
  163|   905k|  PLHashNumber h;
  164|       |
  165|       |#ifdef HASHMETER
  166|       |  ht->nlookups++;
  167|       |#endif
  168|   905k|  h = keyHash * GOLDEN_RATIO;
  ------------------
  |  |  125|   905k|#define GOLDEN_RATIO 0x9E3779B9U /* 2/(1+sqrt(5))*(2^32) */
  ------------------
  169|   905k|  h >>= ht->shift;
  170|   905k|  hep = &ht->buckets[h];
  171|   943k|  while ((he = *hep) != 0) {
  ------------------
  |  Branch (171:10): [True: 928k, False: 15.3k]
  ------------------
  172|   928k|    if (he->keyHash == keyHash && (*ht->keyCompare)(key, he->key)) {
  ------------------
  |  Branch (172:9): [True: 889k, False: 38.7k]
  |  Branch (172:35): [True: 889k, False: 102]
  ------------------
  173|   889k|      break;
  174|   889k|    }
  175|  38.8k|    hep = &he->next;
  176|       |#ifdef HASHMETER
  177|       |    ht->nsteps++;
  178|       |#endif
  179|  38.8k|  }
  180|   905k|  return hep;
  181|   905k|}
PL_HashTableRawAdd:
  185|  21.4k|                   const void* key, void* value) {
  186|  21.4k|  PRUint32 i, n;
  187|  21.4k|  PLHashEntry *he, *next, **oldbuckets;
  188|  21.4k|  PRSize nb;
  189|       |
  190|       |  /* Grow the table if it is overloaded */
  191|  21.4k|  n = NBUCKETS(ht);
  ------------------
  |  |   18|  21.4k|#define NBUCKETS(ht) (1 << (PL_HASH_BITS - (ht)->shift))
  |  |  ------------------
  |  |  |  |   19|  21.4k|#define PL_HASH_BITS 32  /* Number of bits in PLHashNumber */
  |  |  ------------------
  ------------------
  192|  21.4k|  if (ht->nentries >= OVERLOADED(n)) {
  ------------------
  |  |   25|  21.4k|#define OVERLOADED(n) ((n) - ((n) >> 3))
  ------------------
  |  Branch (192:7): [True: 8, False: 21.4k]
  ------------------
  193|      8|    oldbuckets = ht->buckets;
  194|      8|    nb = 2 * n * sizeof(PLHashEntry*);
  195|      8|    ht->buckets =
  196|      8|        (PLHashEntry**)((*ht->allocOps->allocTable)(ht->allocPriv, nb));
  197|      8|    if (!ht->buckets) {
  ------------------
  |  Branch (197:9): [True: 0, False: 8]
  ------------------
  198|      0|      ht->buckets = oldbuckets;
  199|      0|      return 0;
  200|      0|    }
  201|      8|    memset(ht->buckets, 0, nb);
  202|       |#ifdef HASHMETER
  203|       |    ht->ngrows++;
  204|       |#endif
  205|      8|    ht->shift--;
  206|       |
  207|    616|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (207:17): [True: 608, False: 8]
  ------------------
  208|  1.14k|      for (he = oldbuckets[i]; he; he = next) {
  ------------------
  |  Branch (208:32): [True: 532, False: 608]
  ------------------
  209|    532|        next = he->next;
  210|    532|        hep = PL_HashTableRawLookup(ht, he->keyHash, he->key);
  211|    532|        PR_ASSERT(*hep == 0);
  ------------------
  |  |  208|    532|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 532, False: 0]
  |  |  ------------------
  ------------------
  212|    532|        he->next = 0;
  213|    532|        *hep = he;
  214|    532|      }
  215|    608|    }
  216|      8|#ifdef DEBUG
  217|      8|    memset(oldbuckets, 0xDB, n * sizeof oldbuckets[0]);
  218|      8|#endif
  219|      8|    (*ht->allocOps->freeTable)(ht->allocPriv, oldbuckets);
  220|      8|    hep = PL_HashTableRawLookup(ht, keyHash, key);
  221|      8|  }
  222|       |
  223|       |  /* Make a new key value entry */
  224|  21.4k|  he = (*ht->allocOps->allocEntry)(ht->allocPriv, key);
  225|  21.4k|  if (!he) {
  ------------------
  |  Branch (225:7): [True: 0, False: 21.4k]
  ------------------
  226|      0|    return 0;
  227|      0|  }
  228|  21.4k|  he->keyHash = keyHash;
  229|  21.4k|  he->key = key;
  230|  21.4k|  he->value = value;
  231|  21.4k|  he->next = *hep;
  232|  21.4k|  *hep = he;
  233|  21.4k|  ht->nentries++;
  234|  21.4k|  return he;
  235|  21.4k|}
PL_HashTableAdd:
  238|  21.5k|PL_HashTableAdd(PLHashTable* ht, const void* key, void* value) {
  239|  21.5k|  PLHashNumber keyHash;
  240|  21.5k|  PLHashEntry *he, **hep;
  241|       |
  242|  21.5k|  keyHash = (*ht->keyHash)(key);
  243|  21.5k|  hep = PL_HashTableRawLookup(ht, keyHash, key);
  244|  21.5k|  if ((he = *hep) != 0) {
  ------------------
  |  Branch (244:7): [True: 71, False: 21.4k]
  ------------------
  245|       |    /* Hit; see if values match */
  246|     71|    if ((*ht->valueCompare)(he->value, value)) {
  ------------------
  |  Branch (246:9): [True: 0, False: 71]
  ------------------
  247|       |      /* key,value pair is already present in table */
  248|      0|      return he;
  249|      0|    }
  250|     71|    if (he->value) {
  ------------------
  |  Branch (250:9): [True: 71, False: 0]
  ------------------
  251|     71|      (*ht->allocOps->freeEntry)(ht->allocPriv, he, HT_FREE_VALUE);
  ------------------
  |  |   38|     71|#define HT_FREE_VALUE   0               /* just free the entry's value */
  ------------------
  252|     71|    }
  253|     71|    he->value = value;
  254|     71|    return he;
  255|     71|  }
  256|  21.4k|  return PL_HashTableRawAdd(ht, hep, keyHash, key, value);
  257|  21.5k|}
PL_HashTableRawRemove:
  260|  21.0k|PL_HashTableRawRemove(PLHashTable* ht, PLHashEntry** hep, PLHashEntry* he) {
  261|  21.0k|  PRUint32 i, n;
  262|  21.0k|  PLHashEntry *next, **oldbuckets;
  263|  21.0k|  PRSize nb;
  264|       |
  265|  21.0k|  *hep = he->next;
  266|  21.0k|  (*ht->allocOps->freeEntry)(ht->allocPriv, he, HT_FREE_ENTRY);
  ------------------
  |  |   39|  21.0k|#define HT_FREE_ENTRY   1               /* free value and entire entry */
  ------------------
  267|       |
  268|       |  /* Shrink table if it's underloaded */
  269|  21.0k|  n = NBUCKETS(ht);
  ------------------
  |  |   18|  21.0k|#define NBUCKETS(ht) (1 << (PL_HASH_BITS - (ht)->shift))
  |  |  ------------------
  |  |  |  |   19|  21.0k|#define PL_HASH_BITS 32  /* Number of bits in PLHashNumber */
  |  |  ------------------
  ------------------
  270|  21.0k|  if (--ht->nentries < UNDERLOADED(n)) {
  ------------------
  |  |   28|  21.0k|#define UNDERLOADED(n) (((n) > MINBUCKETS) ? ((n) >> 2) : 0)
  |  |  ------------------
  |  |  |  |   22|  21.0k|#define MINBUCKETS (1 << MINBUCKETSLOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   21|  21.0k|#define MINBUCKETSLOG2 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (28:25): [True: 2, False: 21.0k]
  |  |  ------------------
  ------------------
  |  Branch (270:7): [True: 2, False: 21.0k]
  ------------------
  271|      2|    oldbuckets = ht->buckets;
  272|      2|    nb = n * sizeof(PLHashEntry*) / 2;
  273|      2|    ht->buckets =
  274|      2|        (PLHashEntry**)((*ht->allocOps->allocTable)(ht->allocPriv, nb));
  275|      2|    if (!ht->buckets) {
  ------------------
  |  Branch (275:9): [True: 0, False: 2]
  ------------------
  276|      0|      ht->buckets = oldbuckets;
  277|      0|      return;
  278|      0|    }
  279|      2|    memset(ht->buckets, 0, nb);
  280|       |#ifdef HASHMETER
  281|       |    ht->nshrinks++;
  282|       |#endif
  283|      2|    ht->shift++;
  284|       |
  285|     98|    for (i = 0; i < n; i++) {
  ------------------
  |  Branch (285:17): [True: 96, False: 2]
  ------------------
  286|     97|      for (he = oldbuckets[i]; he; he = next) {
  ------------------
  |  Branch (286:32): [True: 1, False: 96]
  ------------------
  287|      1|        next = he->next;
  288|      1|        hep = PL_HashTableRawLookup(ht, he->keyHash, he->key);
  289|      1|        PR_ASSERT(*hep == 0);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  290|      1|        he->next = 0;
  291|      1|        *hep = he;
  292|      1|      }
  293|     96|    }
  294|      2|#ifdef DEBUG
  295|      2|    memset(oldbuckets, 0xDB, n * sizeof oldbuckets[0]);
  296|      2|#endif
  297|      2|    (*ht->allocOps->freeTable)(ht->allocPriv, oldbuckets);
  298|      2|  }
  299|  21.0k|}
PL_HashTableRemove:
  302|  21.0k|PL_HashTableRemove(PLHashTable* ht, const void* key) {
  303|  21.0k|  PLHashNumber keyHash;
  304|  21.0k|  PLHashEntry *he, **hep;
  305|       |
  306|  21.0k|  keyHash = (*ht->keyHash)(key);
  307|  21.0k|  hep = PL_HashTableRawLookup(ht, keyHash, key);
  308|  21.0k|  if ((he = *hep) == 0) {
  ------------------
  |  Branch (308:7): [True: 0, False: 21.0k]
  ------------------
  309|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  310|      0|  }
  311|       |
  312|       |  /* Hit; remove element */
  313|  21.0k|  PL_HashTableRawRemove(ht, hep, he);
  314|  21.0k|  return PR_TRUE;
  ------------------
  |  |  437|  21.0k|#define PR_TRUE 1
  ------------------
  315|  21.0k|}
PL_HashTableLookup:
  318|  78.6k|PL_HashTableLookup(PLHashTable* ht, const void* key) {
  319|  78.6k|  PLHashNumber keyHash;
  320|  78.6k|  PLHashEntry *he, **hep;
  321|       |
  322|  78.6k|  keyHash = (*ht->keyHash)(key);
  323|  78.6k|  hep = PL_HashTableRawLookup(ht, keyHash, key);
  324|  78.6k|  if ((he = *hep) != 0) {
  ------------------
  |  Branch (324:7): [True: 41.9k, False: 36.7k]
  ------------------
  325|  41.9k|    return he->value;
  326|  41.9k|  }
  327|  36.7k|  return 0;
  328|  78.6k|}
PL_HashTableLookupConst:
  334|   905k|PL_HashTableLookupConst(PLHashTable* ht, const void* key) {
  335|   905k|  PLHashNumber keyHash;
  336|   905k|  PLHashEntry *he, **hep;
  337|       |
  338|   905k|  keyHash = (*ht->keyHash)(key);
  339|   905k|  hep = PL_HashTableRawLookupConst(ht, keyHash, key);
  340|   905k|  if ((he = *hep) != 0) {
  ------------------
  |  Branch (340:7): [True: 889k, False: 15.3k]
  ------------------
  341|   889k|    return he->value;
  342|   889k|  }
  343|  15.3k|  return 0;
  344|   905k|}
PL_HashTableEnumerateEntries:
  352|      4|PL_HashTableEnumerateEntries(PLHashTable* ht, PLHashEnumerator f, void* arg) {
  353|      4|  PLHashEntry *he, **hep;
  354|      4|  PRUint32 i, nbuckets;
  355|      4|  int rv, n = 0;
  356|      4|  PLHashEntry* todo = 0;
  357|       |
  358|      4|  nbuckets = NBUCKETS(ht);
  ------------------
  |  |   18|      4|#define NBUCKETS(ht) (1 << (PL_HASH_BITS - (ht)->shift))
  |  |  ------------------
  |  |  |  |   19|      4|#define PL_HASH_BITS 32  /* Number of bits in PLHashNumber */
  |  |  ------------------
  ------------------
  359|    164|  for (i = 0; i < nbuckets; i++) {
  ------------------
  |  Branch (359:15): [True: 160, False: 4]
  ------------------
  360|    160|    hep = &ht->buckets[i];
  361|    160|    while ((he = *hep) != 0) {
  ------------------
  |  Branch (361:12): [True: 0, False: 160]
  ------------------
  362|      0|      rv = (*f)(he, n, arg);
  363|      0|      n++;
  364|      0|      if (rv & (HT_ENUMERATE_REMOVE | HT_ENUMERATE_UNHASH)) {
  ------------------
  |  |   28|      0|#define HT_ENUMERATE_REMOVE     2       /* remove and free the current entry */
  ------------------
                    if (rv & (HT_ENUMERATE_REMOVE | HT_ENUMERATE_UNHASH)) {
  ------------------
  |  |   29|      0|#define HT_ENUMERATE_UNHASH     4       /* just unhash the current entry */
  ------------------
  |  Branch (364:11): [True: 0, False: 0]
  ------------------
  365|      0|        *hep = he->next;
  366|      0|        if (rv & HT_ENUMERATE_REMOVE) {
  ------------------
  |  |   28|      0|#define HT_ENUMERATE_REMOVE     2       /* remove and free the current entry */
  ------------------
  |  Branch (366:13): [True: 0, False: 0]
  ------------------
  367|      0|          he->next = todo;
  368|      0|          todo = he;
  369|      0|        }
  370|      0|      } else {
  371|      0|        hep = &he->next;
  372|      0|      }
  373|      0|      if (rv & HT_ENUMERATE_STOP) {
  ------------------
  |  |   27|      0|#define HT_ENUMERATE_STOP       1       /* stop enumerating entries */
  ------------------
  |  Branch (373:11): [True: 0, False: 0]
  ------------------
  374|      0|        goto out;
  375|      0|      }
  376|      0|    }
  377|    160|  }
  378|       |
  379|      4|out:
  380|      4|  hep = &todo;
  381|      4|  while ((he = *hep) != 0) {
  ------------------
  |  Branch (381:10): [True: 0, False: 4]
  ------------------
  382|      0|    PL_HashTableRawRemove(ht, hep, he);
  383|      0|  }
  384|      4|  return n;
  385|      4|}
PL_CompareValues:
  468|   865k|PL_CompareValues(const void* v1, const void* v2) { return v1 == v2; }
plhash.c:DefaultAllocTable:
   33|     28|static void* PR_CALLBACK DefaultAllocTable(void* pool, PRSize size) {
   34|     28|  return PR_MALLOC(size);
  ------------------
  |  |   55|     28|#define PR_MALLOC(_bytes) (PR_Malloc((_bytes)))
  ------------------
   35|     28|}
plhash.c:DefaultFreeTable:
   37|     28|static void PR_CALLBACK DefaultFreeTable(void* pool, void* item) {
   38|     28|  PR_Free(item);
   39|     28|}
plhash.c:DefaultAllocEntry:
   41|  11.0k|static PLHashEntry* PR_CALLBACK DefaultAllocEntry(void* pool, const void* key) {
   42|  11.0k|  return PR_NEW(PLHashEntry);
  ------------------
  |  |   65|  11.0k|#define PR_NEW(_struct) ((_struct *) PR_MALLOC(sizeof(_struct)))
  |  |  ------------------
  |  |  |  |   55|  11.0k|#define PR_MALLOC(_bytes) (PR_Malloc((_bytes)))
  |  |  ------------------
  ------------------
   43|  11.0k|}
plhash.c:DefaultFreeEntry:
   46|  11.1k|                                         PRUintn flag) {
   47|  11.1k|  if (flag == HT_FREE_ENTRY) {
  ------------------
  |  |   39|  11.1k|#define HT_FREE_ENTRY   1               /* free value and entire entry */
  ------------------
  |  Branch (47:7): [True: 11.0k, False: 71]
  ------------------
   48|  11.0k|    PR_Free(he);
   49|  11.0k|  }
   50|  11.1k|}

PL_strcasecmp:
   41|      3|PL_strcasecmp(const char* a, const char* b) {
   42|      3|  const unsigned char* ua = (const unsigned char*)a;
   43|      3|  const unsigned char* ub = (const unsigned char*)b;
   44|       |
   45|      3|  if ((const char*)0 == a) {
  ------------------
  |  Branch (45:7): [True: 0, False: 3]
  ------------------
   46|      0|    return ((const char*)0 == b) ? 0 : -1;
  ------------------
  |  Branch (46:12): [True: 0, False: 0]
  ------------------
   47|      0|  }
   48|      3|  if ((const char*)0 == b) {
  ------------------
  |  Branch (48:7): [True: 0, False: 3]
  ------------------
   49|      0|    return 1;
   50|      0|  }
   51|       |
   52|      3|  while ((uc[*ua] == uc[*ub]) && ('\0' != *a)) {
  ------------------
  |  Branch (52:10): [True: 0, False: 3]
  |  Branch (52:34): [True: 0, False: 0]
  ------------------
   53|      0|    a++;
   54|      0|    ua++;
   55|      0|    ub++;
   56|      0|  }
   57|       |
   58|      3|  return (PRIntn)(uc[*ua] - uc[*ub]);
   59|      3|}
PL_strncasecmp:
   62|    798|PL_strncasecmp(const char* a, const char* b, PRUint32 max) {
   63|    798|  const unsigned char* ua = (const unsigned char*)a;
   64|    798|  const unsigned char* ub = (const unsigned char*)b;
   65|       |
   66|    798|  if ((const char*)0 == a) {
  ------------------
  |  Branch (66:7): [True: 0, False: 798]
  ------------------
   67|      0|    return ((const char*)0 == b) ? 0 : -1;
  ------------------
  |  Branch (67:12): [True: 0, False: 0]
  ------------------
   68|      0|  }
   69|    798|  if ((const char*)0 == b) {
  ------------------
  |  Branch (69:7): [True: 0, False: 798]
  ------------------
   70|      0|    return 1;
   71|      0|  }
   72|       |
   73|  1.65k|  while (max && (uc[*ua] == uc[*ub]) && ('\0' != *a)) {
  ------------------
  |  Branch (73:10): [True: 1.55k, False: 99]
  |  Branch (73:17): [True: 855, False: 699]
  |  Branch (73:41): [True: 855, False: 0]
  ------------------
   74|    855|    a++;
   75|    855|    ua++;
   76|    855|    ub++;
   77|    855|    max--;
   78|    855|  }
   79|       |
   80|    798|  if (0 == max) {
  ------------------
  |  Branch (80:7): [True: 99, False: 699]
  ------------------
   81|     99|    return (PRIntn)0;
   82|     99|  }
   83|       |
   84|    699|  return (PRIntn)(uc[*ua] - uc[*ub]);
   85|    798|}

PL_strlen:
   12|      4|PL_strlen(const char* str) {
   13|      4|  size_t l;
   14|       |
   15|      4|  if ((const char*)0 == str) {
  ------------------
  |  Branch (15:7): [True: 0, False: 4]
  ------------------
   16|      0|    return 0;
   17|      0|  }
   18|       |
   19|      4|  l = strlen(str);
   20|       |
   21|       |  /* error checking in case we have a 64-bit platform -- make sure
   22|       |   * we don't have ultra long strings that overflow an int32
   23|       |   */
   24|      4|  if (sizeof(PRUint32) < sizeof(size_t)) {
  ------------------
  |  Branch (24:7): [Folded - Ignored]
  ------------------
   25|      4|    if (l > PR_INT32_MAX) {
  ------------------
  |  |  300|      4|#define PR_INT32_MAX PR_INT32(2147483647)
  |  |  ------------------
  |  |  |  |  281|      4|#define PR_INT32(x)  x
  |  |  ------------------
  ------------------
  |  Branch (25:9): [True: 0, False: 4]
  ------------------
   26|      0|      PR_Assert("l <= PR_INT32_MAX", __FILE__, __LINE__);
   27|      0|    }
   28|      4|  }
   29|       |
   30|      4|  return (PRUint32)l;
   31|      4|}

_PR_Getfd:
   43|      3|PRFileDesc* _PR_Getfd(void) {
   44|      3|  PRFileDesc* fd;
   45|       |  /*
   46|       |  ** $$$
   47|       |  ** This may look a little wasteful. We'll see. Right now I want to
   48|       |  ** be able to toggle between caching and not at runtime to measure
   49|       |  ** the differences. If it isn't too annoying, I'll leave it in.
   50|       |  ** $$$$
   51|       |  **
   52|       |  ** The test is against _pr_fd_cache.limit_high. If that's zero,
   53|       |  ** we're not doing the extended cache but going for performance.
   54|       |  */
   55|      3|  if (0 == _pr_fd_cache.limit_high) {
  ------------------
  |  Branch (55:7): [True: 0, False: 3]
  ------------------
   56|      0|    goto allocate;
   57|      3|  } else {
   58|      3|    do {
   59|      3|      if (NULL == _pr_fd_cache.head) {
  ------------------
  |  Branch (59:11): [True: 3, False: 0]
  ------------------
   60|      3|        goto allocate; /* nothing there */
   61|      3|      }
   62|      0|      if (_pr_fd_cache.count < _pr_fd_cache.limit_low) {
  ------------------
  |  Branch (62:11): [True: 0, False: 0]
  ------------------
   63|      0|        goto allocate;
   64|      0|      }
   65|       |
   66|       |      /* we "should" be able to extract an fd from the cache */
   67|      0|      PR_Lock(_pr_fd_cache.ml); /* need the lock to do this safely */
   68|      0|      fd = _pr_fd_cache.head;   /* protected extraction */
   69|      0|      if (NULL == fd)           /* unexpected, but not fatal */
  ------------------
  |  Branch (69:11): [True: 0, False: 0]
  ------------------
   70|      0|      {
   71|      0|        PR_ASSERT(0 == _pr_fd_cache.count);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   72|      0|        PR_ASSERT(NULL == _pr_fd_cache.tail);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   73|      0|      } else {
   74|      0|        _pr_fd_cache.count -= 1;
   75|      0|        _pr_fd_cache.head = fd->higher;
   76|      0|        if (NULL == _pr_fd_cache.head) {
  ------------------
  |  Branch (76:13): [True: 0, False: 0]
  ------------------
   77|      0|          PR_ASSERT(0 == _pr_fd_cache.count);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   78|      0|          _pr_fd_cache.tail = NULL;
   79|      0|        }
   80|      0|        PR_ASSERT(&_pr_faulty_methods == fd->methods);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   81|      0|        PR_ASSERT(PR_INVALID_IO_LAYER == fd->identity);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   82|      0|        PR_ASSERT(_PR_FILEDESC_FREED == fd->secret->state);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   83|      0|      }
   84|      0|      PR_Unlock(_pr_fd_cache.ml);
   85|       |
   86|      0|    } while (NULL == fd); /* then go around and allocate a new one */
  ------------------
  |  Branch (86:14): [True: 0, False: 0]
  ------------------
   87|      3|  }
   88|       |
   89|      3|finished:
   90|      3|  fd->dtor = NULL;
   91|      3|  fd->lower = fd->higher = NULL;
   92|      3|  fd->identity = PR_NSPR_IO_LAYER;
  ------------------
  |  |  454|      3|#define PR_NSPR_IO_LAYER (PRDescIdentity)0
  ------------------
   93|      3|  memset(fd->secret, 0, sizeof(PRFilePrivate));
   94|      3|  return fd;
   95|       |
   96|      3|allocate:
   97|      3|  fd = PR_NEW(PRFileDesc);
  ------------------
  |  |   65|      3|#define PR_NEW(_struct) ((_struct *) PR_MALLOC(sizeof(_struct)))
  |  |  ------------------
  |  |  |  |   55|      3|#define PR_MALLOC(_bytes) (PR_Malloc((_bytes)))
  |  |  ------------------
  ------------------
   98|      3|  if (NULL != fd) {
  ------------------
  |  Branch (98:7): [True: 3, False: 0]
  ------------------
   99|      3|    fd->secret = PR_NEW(PRFilePrivate);
  ------------------
  |  |   65|      3|#define PR_NEW(_struct) ((_struct *) PR_MALLOC(sizeof(_struct)))
  |  |  ------------------
  |  |  |  |   55|      3|#define PR_MALLOC(_bytes) (PR_Malloc((_bytes)))
  |  |  ------------------
  ------------------
  100|      3|    if (NULL == fd->secret) {
  ------------------
  |  Branch (100:9): [True: 0, False: 3]
  ------------------
  101|      0|      PR_DELETE(fd);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  102|      0|    }
  103|      3|  }
  104|      3|  if (NULL != fd) {
  ------------------
  |  Branch (104:7): [True: 3, False: 0]
  ------------------
  105|      3|    goto finished;
  106|      3|  } else {
  107|      0|    return NULL;
  108|      0|  }
  109|       |
  110|      3|} /* _PR_Getfd */
_PR_InitFdCache:
  166|      1|void _PR_InitFdCache(void) {
  167|       |  /*
  168|       |  ** The fd caching is enabled by default for DEBUG builds,
  169|       |  ** disabled by default for OPT builds. That default can
  170|       |  ** be overridden at runtime using environment variables
  171|       |  ** or a super-wiz-bang API.
  172|       |  */
  173|      1|  const char* low = PR_GetEnv("NSPR_FD_CACHE_SIZE_LOW");
  174|      1|  const char* high = PR_GetEnv("NSPR_FD_CACHE_SIZE_HIGH");
  175|       |
  176|       |  /*
  177|       |  ** _low is allowed to be zero, _high is not.
  178|       |  ** If _high is zero, we're not doing the caching.
  179|       |  */
  180|       |
  181|      1|  _pr_fd_cache.limit_low = 0;
  182|      1|#if defined(DEBUG)
  183|      1|  _pr_fd_cache.limit_high = FD_SETSIZE;
  184|       |#else
  185|       |  _pr_fd_cache.limit_high = 0;
  186|       |#endif /* defined(DEBUG) */
  187|       |
  188|      1|  if (NULL != low) {
  ------------------
  |  Branch (188:7): [True: 0, False: 1]
  ------------------
  189|      0|    _pr_fd_cache.limit_low = atoi(low);
  190|      0|  }
  191|      1|  if (NULL != high) {
  ------------------
  |  Branch (191:7): [True: 0, False: 1]
  ------------------
  192|      0|    _pr_fd_cache.limit_high = atoi(high);
  193|      0|  }
  194|       |
  195|      1|  if (_pr_fd_cache.limit_low < 0) {
  ------------------
  |  Branch (195:7): [True: 0, False: 1]
  ------------------
  196|      0|    _pr_fd_cache.limit_low = 0;
  197|      0|  }
  198|      1|  if (_pr_fd_cache.limit_low > FD_SETSIZE) {
  ------------------
  |  Branch (198:7): [True: 0, False: 1]
  ------------------
  199|      0|    _pr_fd_cache.limit_low = FD_SETSIZE;
  200|      0|  }
  201|       |
  202|      1|  if (_pr_fd_cache.limit_high > FD_SETSIZE) {
  ------------------
  |  Branch (202:7): [True: 0, False: 1]
  ------------------
  203|      0|    _pr_fd_cache.limit_high = FD_SETSIZE;
  204|      0|  }
  205|       |
  206|      1|  if (_pr_fd_cache.limit_high < _pr_fd_cache.limit_low) {
  ------------------
  |  Branch (206:7): [True: 0, False: 1]
  ------------------
  207|      0|    _pr_fd_cache.limit_high = _pr_fd_cache.limit_low;
  208|      0|  }
  209|       |
  210|      1|  _pr_fd_cache.ml = PR_NewLock();
  211|      1|  PR_ASSERT(NULL != _pr_fd_cache.ml);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  212|       |
  213|      1|} /* _PR_InitFdCache */

PR_Close:
   94|  8.85k|PR_IMPLEMENT(PRStatus) PR_Close(PRFileDesc* fd) {
   95|  8.85k|  return (fd->methods->close)(fd);
   96|  8.85k|}
PR_Read:
   98|  1.10k|PR_IMPLEMENT(PRInt32) PR_Read(PRFileDesc* fd, void* buf, PRInt32 amount) {
   99|  1.10k|  return ((fd->methods->read)(fd, buf, amount));
  100|  1.10k|}
PR_Write:
  103|    419|PR_Write(PRFileDesc* fd, const void* buf, PRInt32 amount) {
  104|    419|  return ((fd->methods->write)(fd, buf, amount));
  105|    419|}
PR_GetSocketOption:
  219|  13.3k|PR_GetSocketOption(PRFileDesc* fd, PRSocketOptionData* data) {
  220|  13.3k|  return ((fd->methods->getsocketoption)(fd, data));
  221|  13.3k|}

pl_FDDestructor:
   21|  17.7k|void PR_CALLBACK pl_FDDestructor(PRFileDesc* fd) {
   22|  17.7k|  PR_ASSERT(fd != NULL);
  ------------------
  |  |  208|  17.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 17.7k, False: 0]
  |  |  ------------------
  ------------------
   23|  17.7k|  if (NULL != fd->lower) {
  ------------------
  |  Branch (23:7): [True: 0, False: 17.7k]
  ------------------
   24|      0|    fd->lower->higher = fd->higher;
   25|      0|  }
   26|  17.7k|  if (NULL != fd->higher) {
  ------------------
  |  Branch (26:7): [True: 0, False: 17.7k]
  ------------------
   27|      0|    fd->higher->lower = fd->lower;
   28|      0|  }
   29|  17.7k|  PR_DELETE(fd);
  ------------------
  |  |  110|  17.7k|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
   30|  17.7k|}
PR_GetDefaultIOMethods:
  403|      1|PR_IMPLEMENT(const PRIOMethods*) PR_GetDefaultIOMethods(void) {
  404|      1|  return &pl_methods;
  405|      1|} /* PR_GetDefaultIOMethods */
PR_CreateIOLayerStub:
  408|  17.7k|PR_CreateIOLayerStub(PRDescIdentity ident, const PRIOMethods* methods) {
  409|  17.7k|  PRFileDesc* fd = NULL;
  410|  17.7k|  PR_ASSERT((PR_NSPR_IO_LAYER != ident) && (PR_TOP_IO_LAYER != ident));
  ------------------
  |  |  208|  35.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:7): [True: 17.7k, False: 0]
  |  |  |  Branch (208:7): [True: 17.7k, False: 0]
  |  |  ------------------
  ------------------
  411|  17.7k|  if ((PR_NSPR_IO_LAYER == ident) || (PR_TOP_IO_LAYER == ident)) {
  ------------------
  |  |  454|  17.7k|#define PR_NSPR_IO_LAYER (PRDescIdentity)0
  ------------------
                if ((PR_NSPR_IO_LAYER == ident) || (PR_TOP_IO_LAYER == ident)) {
  ------------------
  |  |  453|  17.7k|#define PR_TOP_IO_LAYER (PRDescIdentity)-2
  ------------------
  |  Branch (411:7): [True: 0, False: 17.7k]
  |  Branch (411:38): [True: 0, False: 17.7k]
  ------------------
  412|      0|    PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
  413|  17.7k|  } else {
  414|  17.7k|    fd = PR_NEWZAP(PRFileDesc);
  ------------------
  |  |   99|  17.7k|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  415|  17.7k|    if (NULL == fd) {
  ------------------
  |  Branch (415:9): [True: 0, False: 17.7k]
  ------------------
  416|      0|      PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
  ------------------
  |  |   16|      0|#define PR_OUT_OF_MEMORY_ERROR                   (-6000L)
  ------------------
  417|  17.7k|    } else {
  418|  17.7k|      fd->methods = methods;
  419|  17.7k|      fd->dtor = pl_FDDestructor;
  420|  17.7k|      fd->identity = ident;
  421|  17.7k|    }
  422|  17.7k|  }
  423|  17.7k|  return fd;
  424|  17.7k|} /* PR_CreateIOLayerStub */
PR_PushIOLayer:
  467|  8.85k|PR_PushIOLayer(PRFileDesc* stack, PRDescIdentity id, PRFileDesc* fd) {
  468|  8.85k|  PRFileDesc* insert = PR_GetIdentitiesLayer(stack, id);
  469|       |
  470|  8.85k|  PR_ASSERT(fd != NULL);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  471|  8.85k|  PR_ASSERT(stack != NULL);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  472|  8.85k|  PR_ASSERT(insert != NULL);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  473|  8.85k|  PR_ASSERT(PR_IO_LAYER_HEAD != id);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  474|  8.85k|  if ((NULL == stack) || (NULL == fd) || (NULL == insert)) {
  ------------------
  |  Branch (474:7): [True: 0, False: 8.85k]
  |  Branch (474:26): [True: 0, False: 8.85k]
  |  Branch (474:42): [True: 0, False: 8.85k]
  ------------------
  475|      0|    PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
  476|      0|    return PR_FAILURE;
  477|      0|  }
  478|       |
  479|  8.85k|  if (stack == insert) {
  ------------------
  |  Branch (479:7): [True: 8.85k, False: 0]
  ------------------
  480|       |    /* going on top of the stack */
  481|       |    /* old-style stack */
  482|  8.85k|    PRFileDesc copy = *stack;
  483|  8.85k|    *stack = *fd;
  484|  8.85k|    *fd = copy;
  485|  8.85k|    fd->higher = stack;
  486|  8.85k|    if (fd->lower) {
  ------------------
  |  Branch (486:9): [True: 0, False: 8.85k]
  ------------------
  487|      0|      PR_ASSERT(fd->lower->higher == stack);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  488|      0|      fd->lower->higher = fd;
  489|      0|    }
  490|  8.85k|    stack->lower = fd;
  491|  8.85k|    stack->higher = NULL;
  492|  8.85k|  } else {
  493|       |    /*
  494|       |     * going somewhere in the middle of the stack for both old and new
  495|       |     * style stacks, or going on top of stack for new style stack
  496|       |     */
  497|      0|    fd->lower = insert;
  498|      0|    fd->higher = insert->higher;
  499|       |
  500|      0|    insert->higher->lower = fd;
  501|      0|    insert->higher = fd;
  502|      0|  }
  503|       |
  504|  8.85k|  return PR_SUCCESS;
  505|  8.85k|}
PR_PopIOLayer:
  507|  8.85k|PR_IMPLEMENT(PRFileDesc*) PR_PopIOLayer(PRFileDesc* stack, PRDescIdentity id) {
  508|  8.85k|  PRFileDesc* extract = PR_GetIdentitiesLayer(stack, id);
  509|       |
  510|  8.85k|  PR_ASSERT(0 != id);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  511|  8.85k|  PR_ASSERT(NULL != stack);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  512|  8.85k|  PR_ASSERT(NULL != extract);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  513|  8.85k|  if ((NULL == stack) || (0 == id) || (NULL == extract)) {
  ------------------
  |  Branch (513:7): [True: 0, False: 8.85k]
  |  Branch (513:26): [True: 0, False: 8.85k]
  |  Branch (513:39): [True: 0, False: 8.85k]
  ------------------
  514|      0|    PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
  515|      0|    return NULL;
  516|      0|  }
  517|       |
  518|  8.85k|  if (extract == stack) {
  ------------------
  |  Branch (518:7): [True: 8.85k, False: 0]
  ------------------
  519|       |    /* popping top layer of the stack */
  520|       |    /* old style stack */
  521|  8.85k|    PRFileDesc copy = *stack;
  522|  8.85k|    extract = stack->lower;
  523|  8.85k|    *stack = *extract;
  524|  8.85k|    *extract = copy;
  525|  8.85k|    stack->higher = NULL;
  526|  8.85k|    if (stack->lower) {
  ------------------
  |  Branch (526:9): [True: 0, False: 8.85k]
  ------------------
  527|      0|      PR_ASSERT(stack->lower->higher == extract);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  528|      0|      stack->lower->higher = stack;
  529|      0|    }
  530|  8.85k|  } else if ((PR_IO_LAYER_HEAD == stack->identity) &&
  ------------------
  |  |  451|      0|#define PR_IO_LAYER_HEAD (PRDescIdentity)-3
  ------------------
  |  Branch (530:14): [True: 0, False: 0]
  ------------------
  531|      0|             (extract == stack->lower) && (extract->lower == NULL)) {
  ------------------
  |  Branch (531:14): [True: 0, False: 0]
  |  Branch (531:43): [True: 0, False: 0]
  ------------------
  532|       |    /*
  533|       |     * new style stack
  534|       |     * popping the only layer in the stack; delete the stack too
  535|       |     */
  536|      0|    stack->lower = NULL;
  537|      0|    _PR_DestroyIOLayer(stack);
  538|      0|  } else {
  539|       |    /* for both kinds of stacks */
  540|      0|    extract->lower->higher = extract->higher;
  541|      0|    extract->higher->lower = extract->lower;
  542|      0|  }
  543|  8.85k|  extract->higher = extract->lower = NULL;
  544|  8.85k|  return extract;
  545|  8.85k|} /* PR_PopIOLayer */
PR_GetUniqueIdentity:
  557|      2|PR_IMPLEMENT(PRDescIdentity) PR_GetUniqueIdentity(const char* layer_name) {
  558|      2|  PRDescIdentity identity, length;
  559|      2|  char **names = NULL, *name = NULL, **old = NULL;
  560|       |
  561|      2|  if (!_pr_initialized) {
  ------------------
  |  Branch (561:7): [True: 0, False: 2]
  ------------------
  562|      0|    _PR_ImplicitInitialization();
  563|      0|  }
  564|       |
  565|      2|  PR_ASSERT((PRDescIdentity)((1UL << ((sizeof(PRDescIdentity) * 8) - 1)) - 1)
  ------------------
  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  566|      2|            > identity_cache.ident);
  567|       |
  568|      2|  if (NULL != layer_name) {
  ------------------
  |  Branch (568:7): [True: 2, False: 0]
  ------------------
  569|      2|    name = (char*)PR_Malloc(strlen(layer_name) + 1);
  570|      2|    if (NULL == name) {
  ------------------
  |  Branch (570:9): [True: 0, False: 2]
  ------------------
  571|      0|      PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
  ------------------
  |  |   16|      0|#define PR_OUT_OF_MEMORY_ERROR                   (-6000L)
  ------------------
  572|      0|      return PR_INVALID_IO_LAYER;
  ------------------
  |  |  452|      0|#define PR_INVALID_IO_LAYER (PRDescIdentity)-1
  ------------------
  573|      0|    }
  574|      2|    strcpy(name, layer_name);
  575|      2|  }
  576|       |
  577|       |  /* this initial code runs unsafe */
  578|      2|retry:
  579|      2|  PR_ASSERT(NULL == names);
  ------------------
  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  580|       |  /*
  581|       |   * In the initial round, both identity_cache.ident and
  582|       |   * identity_cache.length are 0, so (identity_cache.ident + 1) is greater
  583|       |   * than length.  In later rounds, identity_cache.ident is always less
  584|       |   * than length, so (identity_cache.ident + 1) can be equal to but cannot
  585|       |   * be greater than length.
  586|       |   */
  587|      2|  length = identity_cache.length;
  588|      2|  if ((identity_cache.ident + 1) >= length) {
  ------------------
  |  Branch (588:7): [True: 1, False: 1]
  ------------------
  589|      1|    length += ID_CACHE_INCREMENT;
  ------------------
  |  |  547|      1|#define ID_CACHE_INCREMENT 16
  ------------------
  590|      1|    names = (char**)PR_CALLOC(length * sizeof(char*));
  ------------------
  |  |   88|      1|#define PR_CALLOC(_size) (PR_Calloc(1, (_size)))
  ------------------
  591|      1|    if (NULL == names) {
  ------------------
  |  Branch (591:9): [True: 0, False: 1]
  ------------------
  592|      0|      if (NULL != name) {
  ------------------
  |  Branch (592:11): [True: 0, False: 0]
  ------------------
  593|      0|        PR_DELETE(name);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  594|      0|      }
  595|      0|      PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
  ------------------
  |  |   16|      0|#define PR_OUT_OF_MEMORY_ERROR                   (-6000L)
  ------------------
  596|      0|      return PR_INVALID_IO_LAYER;
  ------------------
  |  |  452|      0|#define PR_INVALID_IO_LAYER (PRDescIdentity)-1
  ------------------
  597|      0|    }
  598|      1|  }
  599|       |
  600|       |  /* now we get serious about thread safety */
  601|      2|  PR_Lock(identity_cache.ml);
  602|      2|  PR_ASSERT(identity_cache.length == 0 ||
  ------------------
  |  |  208|      3|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:7): [True: 1, False: 1]
  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  603|      2|            identity_cache.ident < identity_cache.length);
  604|      2|  identity = identity_cache.ident + 1;
  605|      2|  if (identity >= identity_cache.length) /* there's no room */
  ------------------
  |  Branch (605:7): [True: 1, False: 1]
  ------------------
  606|      1|  {
  607|       |    /* we have to do something - hopefully it's already done */
  608|      1|    if ((NULL != names) && (identity < length)) {
  ------------------
  |  Branch (608:9): [True: 1, False: 0]
  |  Branch (608:28): [True: 1, False: 0]
  ------------------
  609|       |      /* what we did is still okay */
  610|      1|      if (identity_cache.length != 0) {
  ------------------
  |  Branch (610:11): [True: 0, False: 1]
  ------------------
  611|      0|        memcpy(names, identity_cache.name,
  612|      0|               identity_cache.length * sizeof(char*));
  613|      0|      }
  614|      1|      old = identity_cache.name;
  615|      1|      identity_cache.name = names;
  616|      1|      identity_cache.length = length;
  617|      1|      names = NULL;
  618|      1|    } else {
  619|      0|      PR_Unlock(identity_cache.ml);
  620|      0|      if (NULL != names) {
  ------------------
  |  Branch (620:11): [True: 0, False: 0]
  ------------------
  621|      0|        PR_DELETE(names);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  622|      0|      }
  623|      0|      goto retry;
  624|      0|    }
  625|      1|  }
  626|      2|  if (NULL != name) /* there's a name to be stored */
  ------------------
  |  Branch (626:7): [True: 2, False: 0]
  ------------------
  627|      2|  {
  628|      2|    identity_cache.name[identity] = name;
  629|      2|  }
  630|      2|  identity_cache.ident = identity;
  631|      2|  PR_ASSERT(identity_cache.ident < identity_cache.length);
  ------------------
  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  632|      2|  PR_Unlock(identity_cache.ml);
  633|       |
  634|      2|  if (NULL != old) {
  ------------------
  |  Branch (634:7): [True: 0, False: 2]
  ------------------
  635|      0|    PR_DELETE(old);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  636|      0|  }
  637|      2|  if (NULL != names) {
  ------------------
  |  Branch (637:7): [True: 0, False: 2]
  ------------------
  638|      0|    PR_DELETE(names);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  639|      0|  }
  640|       |
  641|      2|  return identity;
  642|      2|} /* PR_GetUniqueIdentity */
PR_GetIdentitiesLayer:
  670|   909k|PR_GetIdentitiesLayer(PRFileDesc* fd, PRDescIdentity id) {
  671|   909k|  PRFileDesc* layer = fd;
  672|       |
  673|   909k|  if (PR_TOP_IO_LAYER == id) {
  ------------------
  |  |  453|   909k|#define PR_TOP_IO_LAYER (PRDescIdentity)-2
  ------------------
  |  Branch (673:7): [True: 17.7k, False: 892k]
  ------------------
  674|  17.7k|    if (PR_IO_LAYER_HEAD == fd->identity) {
  ------------------
  |  |  451|  17.7k|#define PR_IO_LAYER_HEAD (PRDescIdentity)-3
  ------------------
  |  Branch (674:9): [True: 0, False: 17.7k]
  ------------------
  675|      0|      return fd->lower;
  676|      0|    }
  677|  17.7k|    return fd;
  678|  17.7k|  }
  679|       |
  680|   892k|  for (layer = fd; layer != NULL; layer = layer->lower) {
  ------------------
  |  Branch (680:20): [True: 892k, False: 0]
  ------------------
  681|   892k|    if (id == layer->identity) {
  ------------------
  |  Branch (681:9): [True: 892k, False: 0]
  ------------------
  682|   892k|      return layer;
  683|   892k|    }
  684|   892k|  }
  685|      0|  for (layer = fd; layer != NULL; layer = layer->higher) {
  ------------------
  |  Branch (685:20): [True: 0, False: 0]
  ------------------
  686|      0|    if (id == layer->identity) {
  ------------------
  |  Branch (686:9): [True: 0, False: 0]
  ------------------
  687|      0|      return layer;
  688|      0|    }
  689|      0|  }
  690|      0|  return NULL;
  691|      0|} /* PR_GetIdentitiesLayer */
_PR_InitLayerCache:
  693|      1|void _PR_InitLayerCache(void) {
  694|      1|  memset(&identity_cache, 0, sizeof(identity_cache));
  695|      1|  identity_cache.ml = PR_NewLock();
  696|      1|  PR_ASSERT(NULL != identity_cache.ml);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  697|      1|} /* _PR_InitLayerCache */
prlayer.c:pl_DefGetsocketoption:
  341|  13.3k|                                                  PRSocketOptionData* data) {
  342|  13.3k|  PR_ASSERT(fd != NULL);
  ------------------
  |  |  208|  13.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 13.3k, False: 0]
  |  |  ------------------
  ------------------
  343|  13.3k|  PR_ASSERT(fd->lower != NULL);
  ------------------
  |  |  208|  13.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 13.3k, False: 0]
  |  |  ------------------
  ------------------
  344|       |
  345|  13.3k|  return (fd->lower->methods->getsocketoption)(fd->lower, data);
  346|  13.3k|}

_PR_InitLog:
  186|      1|void _PR_InitLog(void) {
  187|      1|  char* ev;
  188|       |
  189|      1|  _pr_logLock = PR_NewLock();
  190|       |
  191|      1|  ev = PR_GetEnv("NSPR_LOG_MODULES");
  192|      1|  if (ev && ev[0]) {
  ------------------
  |  Branch (192:7): [True: 0, False: 1]
  |  Branch (192:13): [True: 0, False: 0]
  ------------------
  193|      0|    char module[64]; /* Security-Critical: If you change this
  194|       |                      * size, you must also change the sscanf
  195|       |                      * format string to be size-1.
  196|       |                      */
  197|      0|    PRBool isSync = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  198|      0|    PRIntn evlen = strlen(ev), pos = 0;
  199|      0|    PRInt32 bufSize = DEFAULT_BUF_SIZE;
  ------------------
  |  |  139|      0|#define DEFAULT_BUF_SIZE 16384
  ------------------
  200|      0|    while (pos < evlen) {
  ------------------
  |  Branch (200:12): [True: 0, False: 0]
  ------------------
  201|      0|      PRIntn level = 1, count = 0, delta = 0;
  202|      0|      count = sscanf(
  203|      0|          &ev[pos],
  204|      0|          "%63[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"
  205|      0|          "]%n:%d%n",
  206|      0|          module, &delta, &level, &delta);
  207|      0|      pos += delta;
  208|      0|      if (count == 0) {
  ------------------
  |  Branch (208:11): [True: 0, False: 0]
  ------------------
  209|      0|        break;
  210|      0|      }
  211|       |
  212|       |      /*
  213|       |      ** If count == 2, then we got module and level. If count
  214|       |      ** == 1, then level defaults to 1 (module enabled).
  215|       |      */
  216|      0|      if (strcasecmp(module, "sync") == 0) {
  ------------------
  |  Branch (216:11): [True: 0, False: 0]
  ------------------
  217|      0|        isSync = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  218|      0|      } else if (strcasecmp(module, "bufsize") == 0) {
  ------------------
  |  Branch (218:18): [True: 0, False: 0]
  ------------------
  219|      0|        if (level >= LINE_BUF_SIZE) {
  ------------------
  |  |  138|      0|#define LINE_BUF_SIZE 512
  ------------------
  |  Branch (219:13): [True: 0, False: 0]
  ------------------
  220|      0|          bufSize = level;
  221|      0|        }
  222|      0|      } else if (strcasecmp(module, "timestamp") == 0) {
  ------------------
  |  Branch (222:18): [True: 0, False: 0]
  ------------------
  223|      0|        outputTimeStamp = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  224|      0|      } else if (strcasecmp(module, "append") == 0) {
  ------------------
  |  Branch (224:18): [True: 0, False: 0]
  ------------------
  225|      0|        appendToLog = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  226|      0|      } else {
  227|      0|        PRLogModuleInfo* lm = logModules;
  228|      0|        PRBool skip_modcheck =
  229|      0|            (0 == strcasecmp(module, "all")) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                          (0 == strcasecmp(module, "all")) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (229:13): [True: 0, False: 0]
  ------------------
  230|       |
  231|      0|        while (lm != NULL) {
  ------------------
  |  Branch (231:16): [True: 0, False: 0]
  ------------------
  232|      0|          if (skip_modcheck) {
  ------------------
  |  Branch (232:15): [True: 0, False: 0]
  ------------------
  233|      0|            lm->level = (PRLogModuleLevel)level;
  234|      0|          } else if (strcasecmp(module, lm->name) == 0) {
  ------------------
  |  Branch (234:22): [True: 0, False: 0]
  ------------------
  235|      0|            lm->level = (PRLogModuleLevel)level;
  236|      0|            break;
  237|      0|          }
  238|      0|          lm = lm->next;
  239|      0|        }
  240|      0|      }
  241|       |      /*found:*/
  242|      0|      count = sscanf(&ev[pos], " , %n", &delta);
  243|      0|      pos += delta;
  244|      0|      if (count == EOF) {
  ------------------
  |  Branch (244:11): [True: 0, False: 0]
  ------------------
  245|      0|        break;
  246|      0|      }
  247|      0|    }
  248|      0|    PR_SetLogBuffering(isSync ? 0 : bufSize);
  ------------------
  |  Branch (248:24): [True: 0, False: 0]
  ------------------
  249|       |
  250|      0|    ev = PR_GetEnvSecure("NSPR_LOG_FILE");
  251|      0|    if (ev && ev[0]) {
  ------------------
  |  Branch (251:9): [True: 0, False: 0]
  |  Branch (251:15): [True: 0, False: 0]
  ------------------
  252|      0|      if (!PR_SetLogFile(ev)) {
  ------------------
  |  Branch (252:11): [True: 0, False: 0]
  ------------------
  253|       |#ifdef XP_PC
  254|       |        char* str = PR_smprintf("Unable to create nspr log file '%s'\n", ev);
  255|       |        if (str) {
  256|       |          OutputDebugStringA(str);
  257|       |          PR_smprintf_free(str);
  258|       |        }
  259|       |#else
  260|      0|        fprintf(stderr, "Unable to create nspr log file '%s'\n", ev);
  261|      0|#endif
  262|      0|      }
  263|      0|    } else {
  264|       |#ifdef _PR_USE_STDIO_FOR_LOGGING
  265|       |      logFile = stderr;
  266|       |#else
  267|      0|      logFile = _pr_stderr;
  268|      0|#endif
  269|      0|    }
  270|      0|  }
  271|      1|}
PR_NewLogModule:
  353|     11|PR_IMPLEMENT(PRLogModuleInfo*) PR_NewLogModule(const char* name) {
  354|     11|  PRLogModuleInfo* lm;
  355|       |
  356|     11|  if (!_pr_initialized) {
  ------------------
  |  Branch (356:7): [True: 0, False: 11]
  ------------------
  357|      0|    _PR_ImplicitInitialization();
  358|      0|  }
  359|       |
  360|     11|  lm = PR_NEWZAP(PRLogModuleInfo);
  ------------------
  |  |   99|     11|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  361|     11|  if (lm) {
  ------------------
  |  Branch (361:7): [True: 11, False: 0]
  ------------------
  362|     11|    lm->name = strdup(name);
  363|     11|    lm->level = PR_LOG_NONE;
  364|     11|    lm->next = logModules;
  365|     11|    logModules = lm;
  366|     11|    _PR_SetLogModuleLevel(lm);
  367|     11|  }
  368|     11|  return lm;
  369|     11|}
prlog.c:_PR_SetLogModuleLevel:
  311|     11|static void _PR_SetLogModuleLevel(PRLogModuleInfo* lm) {
  312|     11|  char* ev;
  313|       |
  314|     11|  ev = PR_GetEnv("NSPR_LOG_MODULES");
  315|     11|  if (ev && ev[0]) {
  ------------------
  |  Branch (315:7): [True: 0, False: 11]
  |  Branch (315:13): [True: 0, False: 0]
  ------------------
  316|      0|    char module[64]; /* Security-Critical: If you change this
  317|       |                      * size, you must also change the sscanf
  318|       |                      * format string to be size-1.
  319|       |                      */
  320|      0|    PRIntn evlen = strlen(ev), pos = 0;
  321|      0|    while (pos < evlen) {
  ------------------
  |  Branch (321:12): [True: 0, False: 0]
  ------------------
  322|      0|      PRIntn level = 1, count = 0, delta = 0;
  323|       |
  324|      0|      count = sscanf(
  325|      0|          &ev[pos],
  326|      0|          "%63[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-"
  327|      0|          "]%n:%d%n",
  328|      0|          module, &delta, &level, &delta);
  329|      0|      pos += delta;
  330|      0|      if (count == 0) {
  ------------------
  |  Branch (330:11): [True: 0, False: 0]
  ------------------
  331|      0|        break;
  332|      0|      }
  333|       |
  334|       |      /*
  335|       |      ** If count == 2, then we got module and level. If count
  336|       |      ** == 1, then level defaults to 1 (module enabled).
  337|       |      */
  338|      0|      if (lm != NULL) {
  ------------------
  |  Branch (338:11): [True: 0, False: 0]
  ------------------
  339|      0|        if ((strcasecmp(module, "all") == 0) ||
  ------------------
  |  Branch (339:13): [True: 0, False: 0]
  ------------------
  340|      0|            (strcasecmp(module, lm->name) == 0)) {
  ------------------
  |  Branch (340:13): [True: 0, False: 0]
  ------------------
  341|      0|          lm->level = (PRLogModuleLevel)level;
  342|      0|        }
  343|      0|      }
  344|      0|      count = sscanf(&ev[pos], " , %n", &delta);
  345|      0|      pos += delta;
  346|      0|      if (count == EOF) {
  ------------------
  |  Branch (346:11): [True: 0, False: 0]
  ------------------
  347|      0|        break;
  348|      0|      }
  349|      0|    }
  350|      0|  }
  351|     11|} /* end _PR_SetLogModuleLevel() */

_PR_InitMW:
  171|      1|void _PR_InitMW(void) {
  172|       |#ifdef WINNT
  173|       |  /*
  174|       |   * We use NT 4's InterlockedCompareExchange() to operate
  175|       |   * on PRMWStatus variables.
  176|       |   */
  177|       |  PR_ASSERT(sizeof(LONG) == sizeof(PRMWStatus));
  178|       |  TimerInit();
  179|       |#endif
  180|      1|  mw_lock = PR_NewLock();
  181|      1|  PR_ASSERT(NULL != mw_lock);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  182|      1|  mw_state = PR_NEWZAP(_PRGlobalState);
  ------------------
  |  |   99|      1|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  183|      1|  PR_ASSERT(NULL != mw_state);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  184|      1|  PR_INIT_CLIST(&mw_state->group_list);
  ------------------
  |  |  100|      1|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|      1|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|      1|    (_l)->next = (_l); \
  |  |  102|      1|    (_l)->prev = (_l); \
  |  |  103|      1|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      1|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|      1|  max_polling_interval = PR_MillisecondsToInterval(MAX_POLLING_INTERVAL);
  ------------------
  |  |   15|      1|#define MAX_POLLING_INTERVAL 100
  ------------------
  186|      1|} /* _PR_InitMW */

PR_smprintf:
 1166|  17.1k|PR_IMPLEMENT(char*) PR_smprintf(const char* fmt, ...) {
 1167|  17.1k|  va_list ap;
 1168|  17.1k|  char* rv;
 1169|       |
 1170|  17.1k|  va_start(ap, fmt);
 1171|  17.1k|  rv = PR_vsmprintf(fmt, ap);
 1172|  17.1k|  va_end(ap);
 1173|  17.1k|  return rv;
 1174|  17.1k|}
PR_smprintf_free:
 1179|  17.1k|PR_IMPLEMENT(void) PR_smprintf_free(char* mem) { PR_DELETE(mem); }
  ------------------
  |  |  110|  17.1k|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
PR_vsmprintf:
 1181|  17.1k|PR_IMPLEMENT(char*) PR_vsmprintf(const char* fmt, va_list ap) {
 1182|  17.1k|  SprintfState ss;
 1183|  17.1k|  int rv;
 1184|       |
 1185|  17.1k|  ss.stuff = GrowStuff;
 1186|  17.1k|  ss.base = 0;
 1187|  17.1k|  ss.cur = 0;
 1188|  17.1k|  ss.maxlen = 0;
 1189|  17.1k|  rv = dosprintf(&ss, fmt, ap);
 1190|  17.1k|  if (rv < 0) {
  ------------------
  |  Branch (1190:7): [True: 0, False: 17.1k]
  ------------------
 1191|      0|    if (ss.base) {
  ------------------
  |  Branch (1191:9): [True: 0, False: 0]
  ------------------
 1192|      0|      PR_DELETE(ss.base);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
 1193|      0|    }
 1194|      0|    return 0;
 1195|      0|  }
 1196|  17.1k|  return ss.base;
 1197|  17.1k|}
PR_snprintf:
 1220|  1.69k|PR_snprintf(char* out, PRUint32 outlen, const char* fmt, ...) {
 1221|  1.69k|  va_list ap;
 1222|  1.69k|  PRUint32 rv;
 1223|       |
 1224|  1.69k|  va_start(ap, fmt);
 1225|  1.69k|  rv = PR_vsnprintf(out, outlen, fmt, ap);
 1226|  1.69k|  va_end(ap);
 1227|  1.69k|  return rv;
 1228|  1.69k|}
PR_vsnprintf:
 1231|  1.69k|PR_vsnprintf(char* out, PRUint32 outlen, const char* fmt, va_list ap) {
 1232|  1.69k|  SprintfState ss;
 1233|  1.69k|  PRUint32 n;
 1234|       |
 1235|  1.69k|  PR_ASSERT(outlen != 0 && outlen <= PR_INT32_MAX);
  ------------------
  |  |  208|  3.38k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:7): [True: 1.69k, False: 0]
  |  |  |  Branch (208:7): [True: 1.69k, False: 0]
  |  |  ------------------
  ------------------
 1236|  1.69k|  if (outlen == 0 || outlen > PR_INT32_MAX) {
  ------------------
  |  |  300|  1.69k|#define PR_INT32_MAX PR_INT32(2147483647)
  |  |  ------------------
  |  |  |  |  281|  1.69k|#define PR_INT32(x)  x
  |  |  ------------------
  ------------------
  |  Branch (1236:7): [True: 0, False: 1.69k]
  |  Branch (1236:22): [True: 0, False: 1.69k]
  ------------------
 1237|      0|    return 0;
 1238|      0|  }
 1239|       |
 1240|  1.69k|  ss.stuff = LimitStuff;
 1241|  1.69k|  ss.base = out;
 1242|  1.69k|  ss.cur = out;
 1243|  1.69k|  ss.maxlen = outlen;
 1244|  1.69k|  (void)dosprintf(&ss, fmt, ap);
 1245|       |
 1246|       |  /* If we added chars, and we didn't append a null, do it now. */
 1247|  1.69k|  if ((ss.cur != ss.base) && (*(ss.cur - 1) != '\0')) {
  ------------------
  |  Branch (1247:7): [True: 1.69k, False: 0]
  |  Branch (1247:30): [True: 0, False: 1.69k]
  ------------------
 1248|      0|    *(ss.cur - 1) = '\0';
 1249|      0|  }
 1250|       |
 1251|  1.69k|  n = ss.cur - ss.base;
 1252|  1.69k|  return n ? n - 1 : n;
  ------------------
  |  Branch (1252:10): [True: 1.69k, False: 0]
  ------------------
 1253|  1.69k|}
prprf.c:dosprintf:
  677|  18.8k|static int dosprintf(SprintfState* ss, const char* fmt, va_list ap) {
  678|  18.8k|  char c;
  679|  18.8k|  int flags, width, prec, radix, type;
  680|  18.8k|  union {
  681|  18.8k|    char ch;
  682|  18.8k|    int i;
  683|  18.8k|    long l;
  684|  18.8k|    PRInt64 ll;
  685|  18.8k|    double d;
  686|  18.8k|    const char* s;
  687|  18.8k|    int* ip;
  688|       |#ifdef WIN32
  689|       |    const WCHAR* ws;
  690|       |#endif
  691|  18.8k|  } u;
  692|  18.8k|  const char* fmt0;
  693|  18.8k|  static char* hex = "0123456789abcdef";
  694|  18.8k|  static char* HEX = "0123456789ABCDEF";
  695|  18.8k|  char* hexp;
  696|  18.8k|  int rv, i;
  697|  18.8k|  struct NumArg* nas = NULL;
  698|  18.8k|  struct NumArg* nap = NULL;
  699|  18.8k|  struct NumArg nasArray[NAS_DEFAULT_NUM];
  700|  18.8k|  char pattern[20];
  701|  18.8k|  const char* dolPt = NULL; /* in "%4$.2f", dolPt will point to . */
  702|       |#ifdef WIN32
  703|       |  char* pBuf = NULL;
  704|       |#endif
  705|       |
  706|       |  /*
  707|       |  ** build an argument array, IF the fmt is numbered argument
  708|       |  ** list style, to contain the Numbered Argument list pointers
  709|       |  */
  710|       |
  711|  18.8k|  nas = BuildArgArray(fmt, ap, &rv, nasArray);
  712|  18.8k|  if (rv < 0) {
  ------------------
  |  Branch (712:7): [True: 0, False: 18.8k]
  ------------------
  713|       |    /* the fmt contains error Numbered Argument format, jliu@netscape.com */
  714|      0|    PR_ASSERT(0);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  ------------------
  ------------------
  715|      0|    return rv;
  716|      0|  }
  717|       |
  718|   162k|  while ((c = *fmt++) != 0) {
  ------------------
  |  Branch (718:10): [True: 144k, False: 18.8k]
  ------------------
  719|   144k|    if (c != '%') {
  ------------------
  |  Branch (719:9): [True: 112k, False: 31.8k]
  ------------------
  720|   112k|      rv = (*ss->stuff)(ss, fmt - 1, 1);
  721|   112k|      if (rv < 0) {
  ------------------
  |  Branch (721:11): [True: 0, False: 112k]
  ------------------
  722|      0|        return rv;
  723|      0|      }
  724|   112k|      continue;
  725|   112k|    }
  726|  31.8k|    fmt0 = fmt - 1;
  727|       |
  728|       |    /*
  729|       |    ** Gobble up the % format string. Hopefully we have handled all
  730|       |    ** of the strange cases!
  731|       |    */
  732|  31.8k|    flags = 0;
  733|  31.8k|    c = *fmt++;
  734|  31.8k|    if (c == '%') {
  ------------------
  |  Branch (734:9): [True: 0, False: 31.8k]
  ------------------
  735|       |      /* quoting a % with %% */
  736|      0|      rv = (*ss->stuff)(ss, fmt - 1, 1);
  737|      0|      if (rv < 0) {
  ------------------
  |  Branch (737:11): [True: 0, False: 0]
  ------------------
  738|      0|        return rv;
  739|      0|      }
  740|      0|      continue;
  741|      0|    }
  742|       |
  743|  31.8k|    if (nas != NULL) {
  ------------------
  |  Branch (743:9): [True: 0, False: 31.8k]
  ------------------
  744|       |      /* the fmt contains the Numbered Arguments feature */
  745|      0|      i = 0;
  746|      0|      while (c && c != '$') { /* should improve error check later */
  ------------------
  |  Branch (746:14): [True: 0, False: 0]
  |  Branch (746:19): [True: 0, False: 0]
  ------------------
  747|      0|        i = (i * 10) + (c - '0');
  748|      0|        c = *fmt++;
  749|      0|      }
  750|       |
  751|      0|      if (nas[i - 1].type == TYPE_UNKNOWN) {
  ------------------
  |  |   88|      0|#define TYPE_UNKNOWN 20
  ------------------
  |  Branch (751:11): [True: 0, False: 0]
  ------------------
  752|      0|        if (nas && (nas != nasArray)) {
  ------------------
  |  Branch (752:13): [True: 0, False: 0]
  |  Branch (752:20): [True: 0, False: 0]
  ------------------
  753|      0|          PR_DELETE(nas);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  754|      0|        }
  755|      0|        return -1;
  756|      0|      }
  757|       |
  758|      0|      nap = &nas[i - 1];
  759|      0|      dolPt = fmt;
  760|      0|      c = *fmt++;
  761|      0|    }
  762|       |
  763|       |    /*
  764|       |     * Examine optional flags.  Note that we do not implement the
  765|       |     * '#' flag of sprintf().  The ANSI C spec. of the '#' flag is
  766|       |     * somewhat ambiguous and not ideal, which is perhaps why
  767|       |     * the various sprintf() implementations are inconsistent
  768|       |     * on this feature.
  769|       |     */
  770|  31.8k|    while ((c == '-') || (c == '+') || (c == ' ') || (c == '0')) {
  ------------------
  |  Branch (770:12): [True: 0, False: 31.8k]
  |  Branch (770:26): [True: 0, False: 31.8k]
  |  Branch (770:40): [True: 0, False: 31.8k]
  |  Branch (770:54): [True: 0, False: 31.8k]
  ------------------
  771|      0|      if (c == '-') {
  ------------------
  |  Branch (771:11): [True: 0, False: 0]
  ------------------
  772|      0|        flags |= FLAG_LEFT;
  ------------------
  |  |   90|      0|#define FLAG_LEFT 0x1
  ------------------
  773|      0|      }
  774|      0|      if (c == '+') {
  ------------------
  |  Branch (774:11): [True: 0, False: 0]
  ------------------
  775|      0|        flags |= FLAG_SIGNED;
  ------------------
  |  |   91|      0|#define FLAG_SIGNED 0x2
  ------------------
  776|      0|      }
  777|      0|      if (c == ' ') {
  ------------------
  |  Branch (777:11): [True: 0, False: 0]
  ------------------
  778|      0|        flags |= FLAG_SPACED;
  ------------------
  |  |   92|      0|#define FLAG_SPACED 0x4
  ------------------
  779|      0|      }
  780|      0|      if (c == '0') {
  ------------------
  |  Branch (780:11): [True: 0, False: 0]
  ------------------
  781|      0|        flags |= FLAG_ZEROS;
  ------------------
  |  |   93|      0|#define FLAG_ZEROS 0x8
  ------------------
  782|      0|      }
  783|      0|      c = *fmt++;
  784|      0|    }
  785|  31.8k|    if (flags & FLAG_SIGNED) {
  ------------------
  |  |   91|  31.8k|#define FLAG_SIGNED 0x2
  ------------------
  |  Branch (785:9): [True: 0, False: 31.8k]
  ------------------
  786|      0|      flags &= ~FLAG_SPACED;
  ------------------
  |  |   92|      0|#define FLAG_SPACED 0x4
  ------------------
  787|      0|    }
  788|  31.8k|    if (flags & FLAG_LEFT) {
  ------------------
  |  |   90|  31.8k|#define FLAG_LEFT 0x1
  ------------------
  |  Branch (788:9): [True: 0, False: 31.8k]
  ------------------
  789|      0|      flags &= ~FLAG_ZEROS;
  ------------------
  |  |   93|      0|#define FLAG_ZEROS 0x8
  ------------------
  790|      0|    }
  791|       |
  792|       |    /* width */
  793|  31.8k|    if (c == '*') {
  ------------------
  |  Branch (793:9): [True: 0, False: 31.8k]
  ------------------
  794|      0|      c = *fmt++;
  795|      0|      width = va_arg(ap, int);
  796|  31.8k|    } else {
  797|  31.8k|      width = 0;
  798|  31.8k|      while ((c >= '0') && (c <= '9')) {
  ------------------
  |  Branch (798:14): [True: 31.8k, False: 0]
  |  Branch (798:28): [True: 0, False: 31.8k]
  ------------------
  799|      0|        width = (width * 10) + (c - '0');
  800|      0|        c = *fmt++;
  801|      0|      }
  802|  31.8k|    }
  803|       |
  804|       |    /* precision */
  805|  31.8k|    prec = -1;
  806|  31.8k|    if (c == '.') {
  ------------------
  |  Branch (806:9): [True: 0, False: 31.8k]
  ------------------
  807|      0|      c = *fmt++;
  808|      0|      if (c == '*') {
  ------------------
  |  Branch (808:11): [True: 0, False: 0]
  ------------------
  809|      0|        c = *fmt++;
  810|      0|        prec = va_arg(ap, int);
  811|      0|      } else {
  812|      0|        prec = 0;
  813|      0|        while ((c >= '0') && (c <= '9')) {
  ------------------
  |  Branch (813:16): [True: 0, False: 0]
  |  Branch (813:30): [True: 0, False: 0]
  ------------------
  814|      0|          prec = (prec * 10) + (c - '0');
  815|      0|          c = *fmt++;
  816|      0|        }
  817|      0|      }
  818|      0|    }
  819|       |
  820|       |    /* size */
  821|  31.8k|    type = TYPE_INTN;
  ------------------
  |  |   76|  31.8k|#define TYPE_INTN 2
  ------------------
  822|  31.8k|    if (c == 'h') {
  ------------------
  |  Branch (822:9): [True: 0, False: 31.8k]
  ------------------
  823|      0|      type = TYPE_INT16;
  ------------------
  |  |   74|      0|#define TYPE_INT16 0
  ------------------
  824|      0|      c = *fmt++;
  825|  31.8k|    } else if (c == 'L') {
  ------------------
  |  Branch (825:16): [True: 0, False: 31.8k]
  ------------------
  826|       |      /* XXX not quite sure here */
  827|      0|      type = TYPE_INT64;
  ------------------
  |  |   80|      0|#define TYPE_INT64 6
  ------------------
  828|      0|      c = *fmt++;
  829|  31.8k|    } else if (c == 'l') {
  ------------------
  |  Branch (829:16): [True: 18.9k, False: 12.9k]
  ------------------
  830|  18.9k|      type = TYPE_INT32;
  ------------------
  |  |   78|  18.9k|#define TYPE_INT32 4
  ------------------
  831|  18.9k|      c = *fmt++;
  832|  18.9k|      if (c == 'l') {
  ------------------
  |  Branch (832:11): [True: 446, False: 18.4k]
  ------------------
  833|    446|        type = TYPE_INT64;
  ------------------
  |  |   80|    446|#define TYPE_INT64 6
  ------------------
  834|    446|        c = *fmt++;
  835|    446|      }
  836|  18.9k|    } else if (c == 'z') {
  ------------------
  |  Branch (836:16): [True: 0, False: 12.9k]
  ------------------
  837|      0|      if (sizeof(size_t) == sizeof(PRInt32)) {
  ------------------
  |  Branch (837:11): [Folded - Ignored]
  ------------------
  838|      0|        type = TYPE_INT32;
  ------------------
  |  |   78|      0|#define TYPE_INT32 4
  ------------------
  839|      0|      } else if (sizeof(size_t) == sizeof(PRInt64)) {
  ------------------
  |  Branch (839:18): [Folded - Ignored]
  ------------------
  840|      0|        type = TYPE_INT64;
  ------------------
  |  |   80|      0|#define TYPE_INT64 6
  ------------------
  841|      0|      }
  842|      0|      c = *fmt++;
  843|      0|    }
  844|       |
  845|       |    /* format */
  846|  31.8k|    hexp = hex;
  847|  31.8k|    switch (c) {
  848|      0|      case 'd':
  ------------------
  |  Branch (848:7): [True: 0, False: 31.8k]
  ------------------
  849|      0|      case 'i': /* decimal/integer */
  ------------------
  |  Branch (849:7): [True: 0, False: 31.8k]
  ------------------
  850|      0|        radix = 10;
  851|      0|        goto fetch_and_convert;
  852|       |
  853|      0|      case 'o': /* octal */
  ------------------
  |  Branch (853:7): [True: 0, False: 31.8k]
  ------------------
  854|      0|        radix = 8;
  855|      0|        type |= 1;
  856|      0|        goto fetch_and_convert;
  857|       |
  858|  18.9k|      case 'u': /* unsigned decimal */
  ------------------
  |  Branch (858:7): [True: 18.9k, False: 12.9k]
  ------------------
  859|  18.9k|        radix = 10;
  860|  18.9k|        type |= 1;
  861|  18.9k|        goto fetch_and_convert;
  862|       |
  863|      0|      case 'x': /* unsigned hex */
  ------------------
  |  Branch (863:7): [True: 0, False: 31.8k]
  ------------------
  864|      0|        radix = 16;
  865|      0|        type |= 1;
  866|      0|        goto fetch_and_convert;
  867|       |
  868|      0|      case 'X': /* unsigned HEX */
  ------------------
  |  Branch (868:7): [True: 0, False: 31.8k]
  ------------------
  869|      0|        radix = 16;
  870|      0|        hexp = HEX;
  871|      0|        type |= 1;
  872|      0|        goto fetch_and_convert;
  873|       |
  874|  18.9k|      fetch_and_convert:
  875|  18.9k|        switch (type) {
  ------------------
  |  Branch (875:17): [True: 0, False: 18.9k]
  ------------------
  876|      0|          case TYPE_INT16:
  ------------------
  |  |   74|      0|#define TYPE_INT16 0
  ------------------
  |  Branch (876:11): [True: 0, False: 18.9k]
  ------------------
  877|      0|            u.l = nas ? nap->u.i : va_arg(ap, int);
  ------------------
  |  Branch (877:19): [True: 0, False: 0]
  ------------------
  878|      0|            if (u.l < 0) {
  ------------------
  |  Branch (878:17): [True: 0, False: 0]
  ------------------
  879|      0|              u.l = -u.l;
  880|      0|              flags |= FLAG_NEG;
  ------------------
  |  |   94|      0|#define FLAG_NEG 0x10
  ------------------
  881|      0|            }
  882|      0|            goto do_long;
  883|      0|          case TYPE_UINT16:
  ------------------
  |  |   75|      0|#define TYPE_UINT16 1
  ------------------
  |  Branch (883:11): [True: 0, False: 18.9k]
  ------------------
  884|      0|            u.l = (nas ? nap->u.i : va_arg(ap, int)) & 0xffff;
  ------------------
  |  Branch (884:20): [True: 0, False: 0]
  ------------------
  885|      0|            goto do_long;
  886|      0|          case TYPE_INTN:
  ------------------
  |  |   76|      0|#define TYPE_INTN 2
  ------------------
  |  Branch (886:11): [True: 0, False: 18.9k]
  ------------------
  887|      0|            u.l = nas ? nap->u.i : va_arg(ap, int);
  ------------------
  |  Branch (887:19): [True: 0, False: 0]
  ------------------
  888|      0|            if (u.l < 0) {
  ------------------
  |  Branch (888:17): [True: 0, False: 0]
  ------------------
  889|      0|              u.l = -u.l;
  890|      0|              flags |= FLAG_NEG;
  ------------------
  |  |   94|      0|#define FLAG_NEG 0x10
  ------------------
  891|      0|            }
  892|      0|            goto do_long;
  893|      0|          case TYPE_UINTN:
  ------------------
  |  |   77|      0|#define TYPE_UINTN 3
  ------------------
  |  Branch (893:11): [True: 0, False: 18.9k]
  ------------------
  894|      0|            u.l = (long)(nas ? nap->u.ui : va_arg(ap, unsigned int));
  ------------------
  |  Branch (894:26): [True: 0, False: 0]
  ------------------
  895|      0|            goto do_long;
  896|       |
  897|      0|          case TYPE_INT32:
  ------------------
  |  |   78|      0|#define TYPE_INT32 4
  ------------------
  |  Branch (897:11): [True: 0, False: 18.9k]
  ------------------
  898|      0|            u.l = nas ? nap->u.i32 : va_arg(ap, PRInt32);
  ------------------
  |  Branch (898:19): [True: 0, False: 0]
  ------------------
  899|      0|            if (u.l < 0) {
  ------------------
  |  Branch (899:17): [True: 0, False: 0]
  ------------------
  900|      0|              u.l = -u.l;
  901|      0|              flags |= FLAG_NEG;
  ------------------
  |  |   94|      0|#define FLAG_NEG 0x10
  ------------------
  902|      0|            }
  903|      0|            goto do_long;
  904|  18.4k|          case TYPE_UINT32:
  ------------------
  |  |   79|  18.4k|#define TYPE_UINT32 5
  ------------------
  |  Branch (904:11): [True: 18.4k, False: 446]
  ------------------
  905|  18.4k|            u.l = (long)(nas ? nap->u.ui32 : va_arg(ap, PRUint32));
  ------------------
  |  Branch (905:26): [True: 0, False: 18.4k]
  ------------------
  906|  18.4k|          do_long:
  907|  18.4k|            rv = cvt_l(ss, u.l, width, prec, radix, type, flags, hexp);
  908|  18.4k|            if (rv < 0) {
  ------------------
  |  Branch (908:17): [True: 0, False: 18.4k]
  ------------------
  909|      0|              return rv;
  910|      0|            }
  911|  18.4k|            break;
  912|       |
  913|  18.4k|          case TYPE_INT64:
  ------------------
  |  |   80|      0|#define TYPE_INT64 6
  ------------------
  |  Branch (913:11): [True: 0, False: 18.9k]
  ------------------
  914|      0|            u.ll = nas ? nap->u.ll : va_arg(ap, PRInt64);
  ------------------
  |  Branch (914:20): [True: 0, False: 0]
  ------------------
  915|      0|            if (!LL_GE_ZERO(u.ll)) {
  ------------------
  |  |   78|      0|#define LL_GE_ZERO(a)       ((a) >= 0)
  ------------------
  |  Branch (915:17): [True: 0, False: 0]
  ------------------
  916|      0|              LL_NEG(u.ll, u.ll);
  ------------------
  |  |  104|      0|#define LL_NEG(r, a)        ((r) = -(a))
  ------------------
  917|      0|              flags |= FLAG_NEG;
  ------------------
  |  |   94|      0|#define FLAG_NEG 0x10
  ------------------
  918|      0|            }
  919|      0|            goto do_longlong;
  920|    446|          case TYPE_UINT64:
  ------------------
  |  |   81|    446|#define TYPE_UINT64 7
  ------------------
  |  Branch (920:11): [True: 446, False: 18.4k]
  ------------------
  921|    446|            u.ll = nas ? nap->u.ull : va_arg(ap, PRUint64);
  ------------------
  |  Branch (921:20): [True: 0, False: 446]
  ------------------
  922|    446|          do_longlong:
  923|    446|            rv = cvt_ll(ss, u.ll, width, prec, radix, type, flags, hexp);
  924|    446|            if (rv < 0) {
  ------------------
  |  Branch (924:17): [True: 0, False: 446]
  ------------------
  925|      0|              return rv;
  926|      0|            }
  927|    446|            break;
  928|  18.9k|        }
  929|  18.9k|        break;
  930|       |
  931|  18.9k|      case 'e':
  ------------------
  |  Branch (931:7): [True: 0, False: 31.8k]
  ------------------
  932|      0|      case 'E':
  ------------------
  |  Branch (932:7): [True: 0, False: 31.8k]
  ------------------
  933|      0|      case 'f':
  ------------------
  |  Branch (933:7): [True: 0, False: 31.8k]
  ------------------
  934|      0|      case 'g':
  ------------------
  |  Branch (934:7): [True: 0, False: 31.8k]
  ------------------
  935|      0|        u.d = nas ? nap->u.d : va_arg(ap, double);
  ------------------
  |  Branch (935:15): [True: 0, False: 0]
  ------------------
  936|      0|        if (nas != NULL) {
  ------------------
  |  Branch (936:13): [True: 0, False: 0]
  ------------------
  937|      0|          i = fmt - dolPt;
  938|      0|          if (i < sizeof(pattern)) {
  ------------------
  |  Branch (938:15): [True: 0, False: 0]
  ------------------
  939|      0|            pattern[0] = '%';
  940|      0|            memcpy(&pattern[1], dolPt, i);
  941|      0|            rv = cvt_f(ss, u.d, pattern, &pattern[i + 1]);
  942|      0|          }
  943|      0|        } else {
  944|      0|          rv = cvt_f(ss, u.d, fmt0, fmt);
  945|      0|        }
  946|       |
  947|      0|        if (rv < 0) {
  ------------------
  |  Branch (947:13): [True: 0, False: 0]
  ------------------
  948|      0|          return rv;
  949|      0|        }
  950|      0|        break;
  951|       |
  952|      0|      case 'c':
  ------------------
  |  Branch (952:7): [True: 0, False: 31.8k]
  ------------------
  953|      0|        u.ch = nas ? nap->u.i : va_arg(ap, int);
  ------------------
  |  Branch (953:16): [True: 0, False: 0]
  ------------------
  954|      0|        if ((flags & FLAG_LEFT) == 0) {
  ------------------
  |  |   90|      0|#define FLAG_LEFT 0x1
  ------------------
  |  Branch (954:13): [True: 0, False: 0]
  ------------------
  955|      0|          while (width-- > 1) {
  ------------------
  |  Branch (955:18): [True: 0, False: 0]
  ------------------
  956|      0|            rv = (*ss->stuff)(ss, " ", 1);
  957|      0|            if (rv < 0) {
  ------------------
  |  Branch (957:17): [True: 0, False: 0]
  ------------------
  958|      0|              return rv;
  959|      0|            }
  960|      0|          }
  961|      0|        }
  962|      0|        rv = (*ss->stuff)(ss, &u.ch, 1);
  963|      0|        if (rv < 0) {
  ------------------
  |  Branch (963:13): [True: 0, False: 0]
  ------------------
  964|      0|          return rv;
  965|      0|        }
  966|      0|        if (flags & FLAG_LEFT) {
  ------------------
  |  |   90|      0|#define FLAG_LEFT 0x1
  ------------------
  |  Branch (966:13): [True: 0, False: 0]
  ------------------
  967|      0|          while (width-- > 1) {
  ------------------
  |  Branch (967:18): [True: 0, False: 0]
  ------------------
  968|      0|            rv = (*ss->stuff)(ss, " ", 1);
  969|      0|            if (rv < 0) {
  ------------------
  |  Branch (969:17): [True: 0, False: 0]
  ------------------
  970|      0|              return rv;
  971|      0|            }
  972|      0|          }
  973|      0|        }
  974|      0|        break;
  975|       |
  976|      0|      case 'p':
  ------------------
  |  Branch (976:7): [True: 0, False: 31.8k]
  ------------------
  977|      0|        if (sizeof(void*) == sizeof(PRInt32)) {
  ------------------
  |  Branch (977:13): [Folded - Ignored]
  ------------------
  978|      0|          type = TYPE_UINT32;
  ------------------
  |  |   79|      0|#define TYPE_UINT32 5
  ------------------
  979|      0|        } else if (sizeof(void*) == sizeof(PRInt64)) {
  ------------------
  |  Branch (979:20): [Folded - Ignored]
  ------------------
  980|      0|          type = TYPE_UINT64;
  ------------------
  |  |   81|      0|#define TYPE_UINT64 7
  ------------------
  981|      0|        } else if (sizeof(void*) == sizeof(int)) {
  ------------------
  |  Branch (981:20): [Folded - Ignored]
  ------------------
  982|      0|          type = TYPE_UINTN;
  ------------------
  |  |   77|      0|#define TYPE_UINTN 3
  ------------------
  983|      0|        } else {
  984|      0|          PR_ASSERT(0);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  ------------------
  ------------------
  985|      0|          break;
  986|      0|        }
  987|      0|        radix = 16;
  988|      0|        goto fetch_and_convert;
  989|       |
  990|      0|#ifndef WIN32
  991|      0|      case 'S':
  ------------------
  |  Branch (991:7): [True: 0, False: 31.8k]
  ------------------
  992|       |        /* XXX not supported I suppose */
  993|      0|        PR_ASSERT(0);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  ------------------
  ------------------
  994|      0|        break;
  995|      0|#endif
  996|       |
  997|       |#if 0
  998|       |            case 'C':
  999|       |            case 'E':
 1000|       |            case 'G':
 1001|       |                /* XXX not supported I suppose */
 1002|       |                PR_ASSERT(0);
 1003|       |                break;
 1004|       |#endif
 1005|       |
 1006|       |#ifdef WIN32
 1007|       |      case 'S':
 1008|       |        u.ws = nas ? nap->u.ws : va_arg(ap, const WCHAR*);
 1009|       |
 1010|       |        /* Get the required size in rv */
 1011|       |        rv = WideCharToMultiByte(CP_ACP, 0, u.ws, -1, NULL, 0, NULL, NULL);
 1012|       |        if (rv == 0) {
 1013|       |          rv = 1;
 1014|       |        }
 1015|       |        pBuf = PR_MALLOC(rv);
 1016|       |        WideCharToMultiByte(CP_ACP, 0, u.ws, -1, pBuf, (int)rv, NULL, NULL);
 1017|       |        pBuf[rv - 1] = '\0';
 1018|       |
 1019|       |        rv = cvt_s(ss, pBuf, width, prec, flags);
 1020|       |
 1021|       |        /* We don't need the allocated buffer anymore */
 1022|       |        PR_Free(pBuf);
 1023|       |        if (rv < 0) {
 1024|       |          return rv;
 1025|       |        }
 1026|       |        break;
 1027|       |
 1028|       |#endif
 1029|       |
 1030|  12.9k|      case 's':
  ------------------
  |  Branch (1030:7): [True: 12.9k, False: 18.9k]
  ------------------
 1031|  12.9k|        u.s = nas ? nap->u.s : va_arg(ap, const char*);
  ------------------
  |  Branch (1031:15): [True: 0, False: 12.9k]
  ------------------
 1032|  12.9k|        rv = cvt_s(ss, u.s, width, prec, flags);
 1033|  12.9k|        if (rv < 0) {
  ------------------
  |  Branch (1033:13): [True: 0, False: 12.9k]
  ------------------
 1034|      0|          return rv;
 1035|      0|        }
 1036|  12.9k|        break;
 1037|       |
 1038|  12.9k|      case 'n':
  ------------------
  |  Branch (1038:7): [True: 0, False: 31.8k]
  ------------------
 1039|      0|        u.ip = nas ? nap->u.ip : va_arg(ap, int*);
  ------------------
  |  Branch (1039:16): [True: 0, False: 0]
  ------------------
 1040|      0|        if (u.ip) {
  ------------------
  |  Branch (1040:13): [True: 0, False: 0]
  ------------------
 1041|      0|          *u.ip = ss->cur - ss->base;
 1042|      0|        }
 1043|      0|        break;
 1044|       |
 1045|      0|      default:
  ------------------
  |  Branch (1045:7): [True: 0, False: 31.8k]
  ------------------
 1046|       |        /* Not a % token after all... skip it */
 1047|       |#if 0
 1048|       |                PR_ASSERT(0);
 1049|       |#endif
 1050|      0|        rv = (*ss->stuff)(ss, "%", 1);
 1051|      0|        if (rv < 0) {
  ------------------
  |  Branch (1051:13): [True: 0, False: 0]
  ------------------
 1052|      0|          return rv;
 1053|      0|        }
 1054|      0|        rv = (*ss->stuff)(ss, fmt - 1, 1);
 1055|      0|        if (rv < 0) {
  ------------------
  |  Branch (1055:13): [True: 0, False: 0]
  ------------------
 1056|      0|          return rv;
 1057|      0|        }
 1058|  31.8k|    }
 1059|  31.8k|  }
 1060|       |
 1061|       |  /* Stuff trailing NUL */
 1062|  18.8k|  rv = (*ss->stuff)(ss, "\0", 1);
 1063|       |
 1064|  18.8k|  if (nas && (nas != nasArray)) {
  ------------------
  |  Branch (1064:7): [True: 0, False: 18.8k]
  |  Branch (1064:14): [True: 0, False: 0]
  ------------------
 1065|      0|    PR_DELETE(nas);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
 1066|      0|  }
 1067|       |
 1068|  18.8k|  return rv;
 1069|  18.8k|}
prprf.c:BuildArgArray:
  384|  18.8k|                                    struct NumArg* nasArray) {
  385|  18.8k|  int number = 0, cn = 0, i;
  386|  18.8k|  const char* p;
  387|  18.8k|  char c;
  388|  18.8k|  struct NumArg* nas;
  389|       |
  390|       |  /*
  391|       |  **  first pass:
  392|       |  **  determine how many legal % I have got, then allocate space
  393|       |  */
  394|       |
  395|  18.8k|  p = fmt;
  396|  18.8k|  *rv = 0;
  397|  18.8k|  i = 0;
  398|   182k|  while ((c = *p++) != 0) {
  ------------------
  |  Branch (398:10): [True: 163k, False: 18.8k]
  ------------------
  399|   163k|    if (c != '%') {
  ------------------
  |  Branch (399:9): [True: 131k, False: 31.8k]
  ------------------
  400|   131k|      continue;
  401|   131k|    }
  402|  31.8k|    if ((c = *p++) == '%') { /* skip %% case */
  ------------------
  |  Branch (402:9): [True: 0, False: 31.8k]
  ------------------
  403|      0|      continue;
  404|      0|    }
  405|       |
  406|  31.8k|    while (c != 0) {
  ------------------
  |  Branch (406:12): [True: 31.8k, False: 0]
  ------------------
  407|  31.8k|      if (c > '9' || c < '0') {
  ------------------
  |  Branch (407:11): [True: 31.8k, False: 0]
  |  Branch (407:22): [True: 0, False: 0]
  ------------------
  408|  31.8k|        if (c == '$') { /* numbered argument case */
  ------------------
  |  Branch (408:13): [True: 0, False: 31.8k]
  ------------------
  409|      0|          if (i > 0) {
  ------------------
  |  Branch (409:15): [True: 0, False: 0]
  ------------------
  410|      0|            *rv = -1;
  411|      0|            return NULL;
  412|      0|          }
  413|      0|          number++;
  414|  31.8k|        } else { /* non-numbered argument case */
  415|  31.8k|          if (number > 0) {
  ------------------
  |  Branch (415:15): [True: 0, False: 31.8k]
  ------------------
  416|      0|            *rv = -1;
  417|      0|            return NULL;
  418|      0|          }
  419|  31.8k|          i = 1;
  420|  31.8k|        }
  421|  31.8k|        break;
  422|  31.8k|      }
  423|       |
  424|      0|      c = *p++;
  425|      0|    }
  426|  31.8k|  }
  427|       |
  428|  18.8k|  if (number == 0) {
  ------------------
  |  Branch (428:7): [True: 18.8k, False: 0]
  ------------------
  429|  18.8k|    return NULL;
  430|  18.8k|  }
  431|       |
  432|      0|  if (number > NAS_DEFAULT_NUM) {
  ------------------
  |  |   67|      0|#define NAS_DEFAULT_NUM 20 /* default number of NumberedArgument array */
  ------------------
  |  Branch (432:7): [True: 0, False: 0]
  ------------------
  433|      0|    nas = (struct NumArg*)PR_MALLOC(number * sizeof(struct NumArg));
  ------------------
  |  |   55|      0|#define PR_MALLOC(_bytes) (PR_Malloc((_bytes)))
  ------------------
  434|      0|    if (!nas) {
  ------------------
  |  Branch (434:9): [True: 0, False: 0]
  ------------------
  435|      0|      *rv = -1;
  436|      0|      return NULL;
  437|      0|    }
  438|      0|  } else {
  439|      0|    nas = nasArray;
  440|      0|  }
  441|       |
  442|      0|  for (i = 0; i < number; i++) {
  ------------------
  |  Branch (442:15): [True: 0, False: 0]
  ------------------
  443|      0|    nas[i].type = TYPE_UNKNOWN;
  ------------------
  |  |   88|      0|#define TYPE_UNKNOWN 20
  ------------------
  444|      0|  }
  445|       |
  446|       |  /*
  447|       |  ** second pass:
  448|       |  ** set nas[].type
  449|       |  */
  450|       |
  451|      0|  p = fmt;
  452|      0|  while ((c = *p++) != 0) {
  ------------------
  |  Branch (452:10): [True: 0, False: 0]
  ------------------
  453|      0|    if (c != '%') {
  ------------------
  |  Branch (453:9): [True: 0, False: 0]
  ------------------
  454|      0|      continue;
  455|      0|    }
  456|      0|    c = *p++;
  457|      0|    if (c == '%') {
  ------------------
  |  Branch (457:9): [True: 0, False: 0]
  ------------------
  458|      0|      continue;
  459|      0|    }
  460|       |
  461|      0|    cn = 0;
  462|      0|    while (c && c != '$') { /* should improve error check later */
  ------------------
  |  Branch (462:12): [True: 0, False: 0]
  |  Branch (462:17): [True: 0, False: 0]
  ------------------
  463|      0|      cn = cn * 10 + c - '0';
  464|      0|      c = *p++;
  465|      0|    }
  466|       |
  467|      0|    if (!c || cn < 1 || cn > number) {
  ------------------
  |  Branch (467:9): [True: 0, False: 0]
  |  Branch (467:15): [True: 0, False: 0]
  |  Branch (467:25): [True: 0, False: 0]
  ------------------
  468|      0|      *rv = -1;
  469|      0|      break;
  470|      0|    }
  471|       |
  472|       |    /* nas[cn] starts from 0, and make sure nas[cn].type is not assigned */
  473|      0|    cn--;
  474|      0|    if (nas[cn].type != TYPE_UNKNOWN) {
  ------------------
  |  |   88|      0|#define TYPE_UNKNOWN 20
  ------------------
  |  Branch (474:9): [True: 0, False: 0]
  ------------------
  475|      0|      continue;
  476|      0|    }
  477|       |
  478|      0|    c = *p++;
  479|       |
  480|       |    /* width */
  481|      0|    if (c == '*') {
  ------------------
  |  Branch (481:9): [True: 0, False: 0]
  ------------------
  482|       |      /* not supported feature, for the argument is not numbered */
  483|      0|      *rv = -1;
  484|      0|      break;
  485|      0|    }
  486|       |
  487|      0|    while ((c >= '0') && (c <= '9')) {
  ------------------
  |  Branch (487:12): [True: 0, False: 0]
  |  Branch (487:26): [True: 0, False: 0]
  ------------------
  488|      0|      c = *p++;
  489|      0|    }
  490|       |
  491|       |    /* precision */
  492|      0|    if (c == '.') {
  ------------------
  |  Branch (492:9): [True: 0, False: 0]
  ------------------
  493|      0|      c = *p++;
  494|      0|      if (c == '*') {
  ------------------
  |  Branch (494:11): [True: 0, False: 0]
  ------------------
  495|       |        /* not supported feature, for the argument is not numbered */
  496|      0|        *rv = -1;
  497|      0|        break;
  498|      0|      }
  499|       |
  500|      0|      while ((c >= '0') && (c <= '9')) {
  ------------------
  |  Branch (500:14): [True: 0, False: 0]
  |  Branch (500:28): [True: 0, False: 0]
  ------------------
  501|      0|        c = *p++;
  502|      0|      }
  503|      0|    }
  504|       |
  505|       |    /* size */
  506|      0|    nas[cn].type = TYPE_INTN;
  ------------------
  |  |   76|      0|#define TYPE_INTN 2
  ------------------
  507|      0|    if (c == 'h') {
  ------------------
  |  Branch (507:9): [True: 0, False: 0]
  ------------------
  508|      0|      nas[cn].type = TYPE_INT16;
  ------------------
  |  |   74|      0|#define TYPE_INT16 0
  ------------------
  509|      0|      c = *p++;
  510|      0|    } else if (c == 'L') {
  ------------------
  |  Branch (510:16): [True: 0, False: 0]
  ------------------
  511|       |      /* XXX not quite sure here */
  512|      0|      nas[cn].type = TYPE_INT64;
  ------------------
  |  |   80|      0|#define TYPE_INT64 6
  ------------------
  513|      0|      c = *p++;
  514|      0|    } else if (c == 'l') {
  ------------------
  |  Branch (514:16): [True: 0, False: 0]
  ------------------
  515|      0|      nas[cn].type = TYPE_INT32;
  ------------------
  |  |   78|      0|#define TYPE_INT32 4
  ------------------
  516|      0|      c = *p++;
  517|      0|      if (c == 'l') {
  ------------------
  |  Branch (517:11): [True: 0, False: 0]
  ------------------
  518|      0|        nas[cn].type = TYPE_INT64;
  ------------------
  |  |   80|      0|#define TYPE_INT64 6
  ------------------
  519|      0|        c = *p++;
  520|      0|      }
  521|      0|    } else if (c == 'z') {
  ------------------
  |  Branch (521:16): [True: 0, False: 0]
  ------------------
  522|      0|      if (sizeof(size_t) == sizeof(PRInt32)) {
  ------------------
  |  Branch (522:11): [Folded - Ignored]
  ------------------
  523|      0|        nas[cn].type = TYPE_INT32;
  ------------------
  |  |   78|      0|#define TYPE_INT32 4
  ------------------
  524|      0|      } else if (sizeof(size_t) == sizeof(PRInt64)) {
  ------------------
  |  Branch (524:18): [Folded - Ignored]
  ------------------
  525|      0|        nas[cn].type = TYPE_INT64;
  ------------------
  |  |   80|      0|#define TYPE_INT64 6
  ------------------
  526|      0|      } else {
  527|      0|        nas[cn].type = TYPE_UNKNOWN;
  ------------------
  |  |   88|      0|#define TYPE_UNKNOWN 20
  ------------------
  528|      0|      }
  529|      0|      c = *p++;
  530|      0|    }
  531|       |
  532|       |    /* format */
  533|      0|    switch (c) {
  534|      0|      case 'd':
  ------------------
  |  Branch (534:7): [True: 0, False: 0]
  ------------------
  535|      0|      case 'c':
  ------------------
  |  Branch (535:7): [True: 0, False: 0]
  ------------------
  536|      0|      case 'i':
  ------------------
  |  Branch (536:7): [True: 0, False: 0]
  ------------------
  537|      0|      case 'o':
  ------------------
  |  Branch (537:7): [True: 0, False: 0]
  ------------------
  538|      0|      case 'u':
  ------------------
  |  Branch (538:7): [True: 0, False: 0]
  ------------------
  539|      0|      case 'x':
  ------------------
  |  Branch (539:7): [True: 0, False: 0]
  ------------------
  540|      0|      case 'X':
  ------------------
  |  Branch (540:7): [True: 0, False: 0]
  ------------------
  541|      0|        break;
  542|       |
  543|      0|      case 'e':
  ------------------
  |  Branch (543:7): [True: 0, False: 0]
  ------------------
  544|      0|      case 'f':
  ------------------
  |  Branch (544:7): [True: 0, False: 0]
  ------------------
  545|      0|      case 'g':
  ------------------
  |  Branch (545:7): [True: 0, False: 0]
  ------------------
  546|      0|        nas[cn].type = TYPE_DOUBLE;
  ------------------
  |  |   83|      0|#define TYPE_DOUBLE 9
  ------------------
  547|      0|        break;
  548|       |
  549|      0|      case 'p':
  ------------------
  |  Branch (549:7): [True: 0, False: 0]
  ------------------
  550|       |        /* XXX should use cpp */
  551|      0|        if (sizeof(void*) == sizeof(PRInt32)) {
  ------------------
  |  Branch (551:13): [Folded - Ignored]
  ------------------
  552|      0|          nas[cn].type = TYPE_UINT32;
  ------------------
  |  |   79|      0|#define TYPE_UINT32 5
  ------------------
  553|      0|        } else if (sizeof(void*) == sizeof(PRInt64)) {
  ------------------
  |  Branch (553:20): [Folded - Ignored]
  ------------------
  554|      0|          nas[cn].type = TYPE_UINT64;
  ------------------
  |  |   81|      0|#define TYPE_UINT64 7
  ------------------
  555|      0|        } else if (sizeof(void*) == sizeof(PRIntn)) {
  ------------------
  |  Branch (555:20): [Folded - Ignored]
  ------------------
  556|      0|          nas[cn].type = TYPE_UINTN;
  ------------------
  |  |   77|      0|#define TYPE_UINTN 3
  ------------------
  557|      0|        } else {
  558|      0|          nas[cn].type = TYPE_UNKNOWN;
  ------------------
  |  |   88|      0|#define TYPE_UNKNOWN 20
  ------------------
  559|      0|        }
  560|      0|        break;
  561|       |
  562|      0|      case 'S':
  ------------------
  |  Branch (562:7): [True: 0, False: 0]
  ------------------
  563|       |#ifdef WIN32
  564|       |        nas[cn].type = TYPE_WSTRING;
  565|       |        break;
  566|       |#endif
  567|      0|      case 'C':
  ------------------
  |  Branch (567:7): [True: 0, False: 0]
  ------------------
  568|      0|      case 'E':
  ------------------
  |  Branch (568:7): [True: 0, False: 0]
  ------------------
  569|      0|      case 'G':
  ------------------
  |  Branch (569:7): [True: 0, False: 0]
  ------------------
  570|       |        /* XXX not supported I suppose */
  571|      0|        PR_ASSERT(0);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  ------------------
  ------------------
  572|      0|        nas[cn].type = TYPE_UNKNOWN;
  ------------------
  |  |   88|      0|#define TYPE_UNKNOWN 20
  ------------------
  573|      0|        break;
  574|       |
  575|      0|      case 's':
  ------------------
  |  Branch (575:7): [True: 0, False: 0]
  ------------------
  576|      0|        nas[cn].type = TYPE_STRING;
  ------------------
  |  |   82|      0|#define TYPE_STRING 8
  ------------------
  577|      0|        break;
  578|       |
  579|      0|      case 'n':
  ------------------
  |  Branch (579:7): [True: 0, False: 0]
  ------------------
  580|      0|        nas[cn].type = TYPE_INTSTR;
  ------------------
  |  |   84|      0|#define TYPE_INTSTR 10
  ------------------
  581|      0|        break;
  582|       |
  583|      0|      default:
  ------------------
  |  Branch (583:7): [True: 0, False: 0]
  ------------------
  584|      0|        PR_ASSERT(0);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  ------------------
  ------------------
  585|      0|        nas[cn].type = TYPE_UNKNOWN;
  ------------------
  |  |   88|      0|#define TYPE_UNKNOWN 20
  ------------------
  586|      0|        break;
  587|      0|    }
  588|       |
  589|       |    /* get a legal para. */
  590|      0|    if (nas[cn].type == TYPE_UNKNOWN) {
  ------------------
  |  |   88|      0|#define TYPE_UNKNOWN 20
  ------------------
  |  Branch (590:9): [True: 0, False: 0]
  ------------------
  591|      0|      *rv = -1;
  592|      0|      break;
  593|      0|    }
  594|      0|  }
  595|       |
  596|       |  /*
  597|       |  ** third pass
  598|       |  ** fill the nas[cn].ap
  599|       |  */
  600|       |
  601|      0|  if (*rv < 0) {
  ------------------
  |  Branch (601:7): [True: 0, False: 0]
  ------------------
  602|      0|    if (nas != nasArray) {
  ------------------
  |  Branch (602:9): [True: 0, False: 0]
  ------------------
  603|      0|      PR_DELETE(nas);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  604|      0|    }
  605|      0|    return NULL;
  606|      0|  }
  607|       |
  608|      0|  cn = 0;
  609|      0|  while (cn < number) {
  ------------------
  |  Branch (609:10): [True: 0, False: 0]
  ------------------
  610|      0|    if (nas[cn].type == TYPE_UNKNOWN) {
  ------------------
  |  |   88|      0|#define TYPE_UNKNOWN 20
  ------------------
  |  Branch (610:9): [True: 0, False: 0]
  ------------------
  611|      0|      cn++;
  612|      0|      continue;
  613|      0|    }
  614|       |
  615|      0|    switch (nas[cn].type) {
  616|      0|      case TYPE_INT16:
  ------------------
  |  |   74|      0|#define TYPE_INT16 0
  ------------------
  |  Branch (616:7): [True: 0, False: 0]
  ------------------
  617|      0|      case TYPE_UINT16:
  ------------------
  |  |   75|      0|#define TYPE_UINT16 1
  ------------------
  |  Branch (617:7): [True: 0, False: 0]
  ------------------
  618|      0|      case TYPE_INTN:
  ------------------
  |  |   76|      0|#define TYPE_INTN 2
  ------------------
  |  Branch (618:7): [True: 0, False: 0]
  ------------------
  619|      0|        nas[cn].u.i = va_arg(ap, int);
  620|      0|        break;
  621|       |
  622|      0|      case TYPE_UINTN:
  ------------------
  |  |   77|      0|#define TYPE_UINTN 3
  ------------------
  |  Branch (622:7): [True: 0, False: 0]
  ------------------
  623|      0|        nas[cn].u.ui = va_arg(ap, unsigned int);
  624|      0|        break;
  625|       |
  626|      0|      case TYPE_INT32:
  ------------------
  |  |   78|      0|#define TYPE_INT32 4
  ------------------
  |  Branch (626:7): [True: 0, False: 0]
  ------------------
  627|      0|        nas[cn].u.i32 = va_arg(ap, PRInt32);
  628|      0|        break;
  629|       |
  630|      0|      case TYPE_UINT32:
  ------------------
  |  |   79|      0|#define TYPE_UINT32 5
  ------------------
  |  Branch (630:7): [True: 0, False: 0]
  ------------------
  631|      0|        nas[cn].u.ui32 = va_arg(ap, PRUint32);
  632|      0|        break;
  633|       |
  634|      0|      case TYPE_INT64:
  ------------------
  |  |   80|      0|#define TYPE_INT64 6
  ------------------
  |  Branch (634:7): [True: 0, False: 0]
  ------------------
  635|      0|        nas[cn].u.ll = va_arg(ap, PRInt64);
  636|      0|        break;
  637|       |
  638|      0|      case TYPE_UINT64:
  ------------------
  |  |   81|      0|#define TYPE_UINT64 7
  ------------------
  |  Branch (638:7): [True: 0, False: 0]
  ------------------
  639|      0|        nas[cn].u.ull = va_arg(ap, PRUint64);
  640|      0|        break;
  641|       |
  642|      0|      case TYPE_STRING:
  ------------------
  |  |   82|      0|#define TYPE_STRING 8
  ------------------
  |  Branch (642:7): [True: 0, False: 0]
  ------------------
  643|      0|        nas[cn].u.s = va_arg(ap, char*);
  644|      0|        break;
  645|       |
  646|       |#ifdef WIN32
  647|       |      case TYPE_WSTRING:
  648|       |        nas[cn].u.ws = va_arg(ap, WCHAR*);
  649|       |        break;
  650|       |#endif
  651|       |
  652|      0|      case TYPE_INTSTR:
  ------------------
  |  |   84|      0|#define TYPE_INTSTR 10
  ------------------
  |  Branch (652:7): [True: 0, False: 0]
  ------------------
  653|      0|        nas[cn].u.ip = va_arg(ap, int*);
  654|      0|        break;
  655|       |
  656|      0|      case TYPE_DOUBLE:
  ------------------
  |  |   83|      0|#define TYPE_DOUBLE 9
  ------------------
  |  Branch (656:7): [True: 0, False: 0]
  ------------------
  657|      0|        nas[cn].u.d = va_arg(ap, double);
  658|      0|        break;
  659|       |
  660|      0|      default:
  ------------------
  |  Branch (660:7): [True: 0, False: 0]
  ------------------
  661|      0|        if (nas != nasArray) {
  ------------------
  |  Branch (661:13): [True: 0, False: 0]
  ------------------
  662|      0|          PR_DELETE(nas);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  663|      0|        }
  664|      0|        *rv = -1;
  665|      0|        return NULL;
  666|      0|    }
  667|       |
  668|      0|    cn++;
  669|      0|  }
  670|       |
  671|      0|  return nas;
  672|      0|}
prprf.c:cvt_l:
  228|  18.4k|                 int type, int flags, const char* hexp) {
  229|  18.4k|  char cvtbuf[100];
  230|  18.4k|  char* cvt;
  231|  18.4k|  int digits;
  232|       |
  233|       |  /* according to the man page this needs to happen */
  234|  18.4k|  if ((prec == 0) && (num == 0)) {
  ------------------
  |  Branch (234:7): [True: 0, False: 18.4k]
  |  Branch (234:22): [True: 0, False: 0]
  ------------------
  235|      0|    return 0;
  236|      0|  }
  237|       |
  238|       |  /*
  239|       |  ** Converting decimal is a little tricky. In the unsigned case we
  240|       |  ** need to stop when we hit 10 digits. In the signed case, we can
  241|       |  ** stop when the number is zero.
  242|       |  */
  243|  18.4k|  cvt = cvtbuf + sizeof(cvtbuf);
  244|  18.4k|  digits = 0;
  245|  45.9k|  while (num) {
  ------------------
  |  Branch (245:10): [True: 27.4k, False: 18.4k]
  ------------------
  246|  27.4k|    int digit = (((unsigned long)num) % radix) & 0xF;
  247|  27.4k|    *--cvt = hexp[digit];
  248|  27.4k|    digits++;
  249|  27.4k|    num = (long)(((unsigned long)num) / radix);
  250|  27.4k|  }
  251|  18.4k|  if (digits == 0) {
  ------------------
  |  Branch (251:7): [True: 666, False: 17.8k]
  ------------------
  252|    666|    *--cvt = '0';
  253|    666|    digits++;
  254|    666|  }
  255|       |
  256|       |  /*
  257|       |  ** Now that we have the number converted without its sign, deal with
  258|       |  ** the sign and zero padding.
  259|       |  */
  260|  18.4k|  return fill_n(ss, cvt, digits, width, prec, type, flags);
  261|  18.4k|}
prprf.c:fill_n:
  138|  18.9k|                  int prec, int type, int flags) {
  139|  18.9k|  int zerowidth = 0;
  140|  18.9k|  int precwidth = 0;
  141|  18.9k|  int signwidth = 0;
  142|  18.9k|  int leftspaces = 0;
  143|  18.9k|  int rightspaces = 0;
  144|  18.9k|  int cvtwidth;
  145|  18.9k|  int rv;
  146|  18.9k|  char sign;
  147|       |
  148|  18.9k|  if ((type & 1) == 0) {
  ------------------
  |  Branch (148:7): [True: 0, False: 18.9k]
  ------------------
  149|      0|    if (flags & FLAG_NEG) {
  ------------------
  |  |   94|      0|#define FLAG_NEG 0x10
  ------------------
  |  Branch (149:9): [True: 0, False: 0]
  ------------------
  150|      0|      sign = '-';
  151|      0|      signwidth = 1;
  152|      0|    } else if (flags & FLAG_SIGNED) {
  ------------------
  |  |   91|      0|#define FLAG_SIGNED 0x2
  ------------------
  |  Branch (152:16): [True: 0, False: 0]
  ------------------
  153|      0|      sign = '+';
  154|      0|      signwidth = 1;
  155|      0|    } else if (flags & FLAG_SPACED) {
  ------------------
  |  |   92|      0|#define FLAG_SPACED 0x4
  ------------------
  |  Branch (155:16): [True: 0, False: 0]
  ------------------
  156|      0|      sign = ' ';
  157|      0|      signwidth = 1;
  158|      0|    }
  159|      0|  }
  160|  18.9k|  cvtwidth = signwidth + srclen;
  161|       |
  162|  18.9k|  if (prec > 0) {
  ------------------
  |  Branch (162:7): [True: 0, False: 18.9k]
  ------------------
  163|      0|    if (prec > srclen) {
  ------------------
  |  Branch (163:9): [True: 0, False: 0]
  ------------------
  164|      0|      precwidth = prec - srclen; /* Need zero filling */
  165|      0|      cvtwidth += precwidth;
  166|      0|    }
  167|      0|  }
  168|       |
  169|  18.9k|  if ((flags & FLAG_ZEROS) && (prec < 0)) {
  ------------------
  |  |   93|  18.9k|#define FLAG_ZEROS 0x8
  ------------------
  |  Branch (169:7): [True: 0, False: 18.9k]
  |  Branch (169:31): [True: 0, False: 0]
  ------------------
  170|      0|    if (width > cvtwidth) {
  ------------------
  |  Branch (170:9): [True: 0, False: 0]
  ------------------
  171|      0|      zerowidth = width - cvtwidth; /* Zero filling */
  172|      0|      cvtwidth += zerowidth;
  173|      0|    }
  174|      0|  }
  175|       |
  176|  18.9k|  if (flags & FLAG_LEFT) {
  ------------------
  |  |   90|  18.9k|#define FLAG_LEFT 0x1
  ------------------
  |  Branch (176:7): [True: 0, False: 18.9k]
  ------------------
  177|      0|    if (width > cvtwidth) {
  ------------------
  |  Branch (177:9): [True: 0, False: 0]
  ------------------
  178|       |      /* Space filling on the right (i.e. left adjusting) */
  179|      0|      rightspaces = width - cvtwidth;
  180|      0|    }
  181|  18.9k|  } else {
  182|  18.9k|    if (width > cvtwidth) {
  ------------------
  |  Branch (182:9): [True: 0, False: 18.9k]
  ------------------
  183|       |      /* Space filling on the left (i.e. right adjusting) */
  184|      0|      leftspaces = width - cvtwidth;
  185|      0|    }
  186|  18.9k|  }
  187|  18.9k|  while (--leftspaces >= 0) {
  ------------------
  |  Branch (187:10): [True: 0, False: 18.9k]
  ------------------
  188|      0|    rv = (*ss->stuff)(ss, " ", 1);
  189|      0|    if (rv < 0) {
  ------------------
  |  Branch (189:9): [True: 0, False: 0]
  ------------------
  190|      0|      return rv;
  191|      0|    }
  192|      0|  }
  193|  18.9k|  if (signwidth) {
  ------------------
  |  Branch (193:7): [True: 0, False: 18.9k]
  ------------------
  194|      0|    rv = (*ss->stuff)(ss, &sign, 1);
  195|      0|    if (rv < 0) {
  ------------------
  |  Branch (195:9): [True: 0, False: 0]
  ------------------
  196|      0|      return rv;
  197|      0|    }
  198|      0|  }
  199|  18.9k|  while (--precwidth >= 0) {
  ------------------
  |  Branch (199:10): [True: 0, False: 18.9k]
  ------------------
  200|      0|    rv = (*ss->stuff)(ss, "0", 1);
  201|      0|    if (rv < 0) {
  ------------------
  |  Branch (201:9): [True: 0, False: 0]
  ------------------
  202|      0|      return rv;
  203|      0|    }
  204|      0|  }
  205|  18.9k|  while (--zerowidth >= 0) {
  ------------------
  |  Branch (205:10): [True: 0, False: 18.9k]
  ------------------
  206|      0|    rv = (*ss->stuff)(ss, "0", 1);
  207|      0|    if (rv < 0) {
  ------------------
  |  Branch (207:9): [True: 0, False: 0]
  ------------------
  208|      0|      return rv;
  209|      0|    }
  210|      0|  }
  211|  18.9k|  rv = (*ss->stuff)(ss, src, srclen);
  212|  18.9k|  if (rv < 0) {
  ------------------
  |  Branch (212:7): [True: 0, False: 18.9k]
  ------------------
  213|      0|    return rv;
  214|      0|  }
  215|  18.9k|  while (--rightspaces >= 0) {
  ------------------
  |  Branch (215:10): [True: 0, False: 18.9k]
  ------------------
  216|      0|    rv = (*ss->stuff)(ss, " ", 1);
  217|      0|    if (rv < 0) {
  ------------------
  |  Branch (217:9): [True: 0, False: 0]
  ------------------
  218|      0|      return rv;
  219|      0|    }
  220|      0|  }
  221|  18.9k|  return 0;
  222|  18.9k|}
prprf.c:cvt_ll:
  267|    446|                  int type, int flags, const char* hexp) {
  268|    446|  char cvtbuf[100];
  269|    446|  char* cvt;
  270|    446|  int digits;
  271|    446|  PRInt64 rad;
  272|       |
  273|       |  /* according to the man page this needs to happen */
  274|    446|  if ((prec == 0) && (LL_IS_ZERO(num))) {
  ------------------
  |  |   75|      0|#define LL_IS_ZERO(a)       ((a) == 0)
  ------------------
  |  Branch (274:7): [True: 0, False: 446]
  |  Branch (274:22): [True: 0, False: 0]
  ------------------
  275|      0|    return 0;
  276|      0|  }
  277|       |
  278|       |  /*
  279|       |  ** Converting decimal is a little tricky. In the unsigned case we
  280|       |  ** need to stop when we hit 10 digits. In the signed case, we can
  281|       |  ** stop when the number is zero.
  282|       |  */
  283|    446|  LL_I2L(rad, radix);
  ------------------
  |  |  149|    446|#define LL_I2L(l, i)        ((l) = (PRInt64)(i))
  ------------------
  284|    446|  cvt = cvtbuf + sizeof(cvtbuf);
  285|    446|  digits = 0;
  286|  4.77k|  while (!LL_IS_ZERO(num)) {
  ------------------
  |  |   75|  4.77k|#define LL_IS_ZERO(a)       ((a) == 0)
  ------------------
  |  Branch (286:10): [True: 4.32k, False: 446]
  ------------------
  287|  4.32k|    PRInt32 digit;
  288|  4.32k|    PRInt64 quot, rem;
  289|  4.32k|    LL_UDIVMOD(&quot, &rem, num, rad);
  ------------------
  |  |  164|  4.32k|    (*(qp) = ((PRUint64)(a) / (b)), \
  |  |  165|  4.32k|     *(rp) = ((PRUint64)(a) % (b)))
  ------------------
  290|  4.32k|    LL_L2I(digit, rem);
  ------------------
  |  |  144|  4.32k|#define LL_L2I(i, l)        ((i) = (PRInt32)(l))
  ------------------
  291|  4.32k|    *--cvt = hexp[digit & 0xf];
  292|  4.32k|    digits++;
  293|  4.32k|    num = quot;
  294|  4.32k|  }
  295|    446|  if (digits == 0) {
  ------------------
  |  Branch (295:7): [True: 0, False: 446]
  ------------------
  296|      0|    *--cvt = '0';
  297|      0|    digits++;
  298|      0|  }
  299|       |
  300|       |  /*
  301|       |  ** Now that we have the number converted without its sign, deal with
  302|       |  ** the sign and zero padding.
  303|       |  */
  304|    446|  return fill_n(ss, cvt, digits, width, prec, type, flags);
  305|    446|}
prprf.c:cvt_s:
  351|  12.9k|                 int flags) {
  352|  12.9k|  int slen;
  353|       |
  354|  12.9k|  if (prec == 0) {
  ------------------
  |  Branch (354:7): [True: 0, False: 12.9k]
  ------------------
  355|      0|    return 0;
  356|      0|  }
  357|       |
  358|       |  /* Limit string length by precision value */
  359|  12.9k|  if (!str) {
  ------------------
  |  Branch (359:7): [True: 0, False: 12.9k]
  ------------------
  360|      0|    str = "(null)";
  361|      0|  }
  362|  12.9k|  if (prec > 0) {
  ------------------
  |  Branch (362:7): [True: 0, False: 12.9k]
  ------------------
  363|       |    /* this is:  slen = strnlen(str, prec); */
  364|      0|    register const char* s;
  365|       |
  366|      0|    for (s = str; prec && *s; s++, prec--);
  ------------------
  |  Branch (366:19): [True: 0, False: 0]
  |  Branch (366:27): [True: 0, False: 0]
  ------------------
  367|      0|    slen = s - str;
  368|  12.9k|  } else {
  369|  12.9k|    slen = strlen(str);
  370|  12.9k|  }
  371|       |
  372|       |  /* and away we go */
  373|  12.9k|  return fill2(ss, str, slen, width, flags);
  374|  12.9k|}
prprf.c:fill2:
  100|  12.9k|                 int flags) {
  101|  12.9k|  char space = ' ';
  102|  12.9k|  int rv;
  103|       |
  104|  12.9k|  width -= srclen;
  105|  12.9k|  if ((width > 0) && ((flags & FLAG_LEFT) == 0)) { /* Right adjusting */
  ------------------
  |  |   90|      0|#define FLAG_LEFT 0x1
  ------------------
  |  Branch (105:7): [True: 0, False: 12.9k]
  |  Branch (105:22): [True: 0, False: 0]
  ------------------
  106|      0|    if (flags & FLAG_ZEROS) {
  ------------------
  |  |   93|      0|#define FLAG_ZEROS 0x8
  ------------------
  |  Branch (106:9): [True: 0, False: 0]
  ------------------
  107|      0|      space = '0';
  108|      0|    }
  109|      0|    while (--width >= 0) {
  ------------------
  |  Branch (109:12): [True: 0, False: 0]
  ------------------
  110|      0|      rv = (*ss->stuff)(ss, &space, 1);
  111|      0|      if (rv < 0) {
  ------------------
  |  Branch (111:11): [True: 0, False: 0]
  ------------------
  112|      0|        return rv;
  113|      0|      }
  114|      0|    }
  115|      0|  }
  116|       |
  117|       |  /* Copy out the source data */
  118|  12.9k|  rv = (*ss->stuff)(ss, src, srclen);
  119|  12.9k|  if (rv < 0) {
  ------------------
  |  Branch (119:7): [True: 0, False: 12.9k]
  ------------------
  120|      0|    return rv;
  121|      0|  }
  122|       |
  123|  12.9k|  if ((width > 0) && ((flags & FLAG_LEFT) != 0)) { /* Left adjusting */
  ------------------
  |  |   90|      0|#define FLAG_LEFT 0x1
  ------------------
  |  Branch (123:7): [True: 0, False: 12.9k]
  |  Branch (123:22): [True: 0, False: 0]
  ------------------
  124|      0|    while (--width >= 0) {
  ------------------
  |  Branch (124:12): [True: 0, False: 0]
  ------------------
  125|      0|      rv = (*ss->stuff)(ss, &space, 1);
  126|      0|      if (rv < 0) {
  ------------------
  |  Branch (126:11): [True: 0, False: 0]
  ------------------
  127|      0|        return rv;
  128|      0|      }
  129|      0|    }
  130|      0|  }
  131|  12.9k|  return 0;
  132|  12.9k|}
prprf.c:GrowStuff:
 1119|   156k|static int GrowStuff(SprintfState* ss, const char* sp, PRUint32 len) {
 1120|   156k|  ptrdiff_t off;
 1121|   156k|  char* newbase;
 1122|   156k|  PRUint32 newlen;
 1123|       |
 1124|   156k|  off = ss->cur - ss->base;
 1125|   156k|  if (PR_UINT32_MAX - len < off) {
  ------------------
  |  |  302|   156k|#define PR_UINT32_MAX PR_UINT32(4294967295)
  |  |  ------------------
  |  |  |  |  282|   156k|#define PR_UINT32(x) x ## U
  |  |  ------------------
  ------------------
  |  Branch (1125:7): [True: 0, False: 156k]
  ------------------
 1126|       |    /* off + len would be too big. */
 1127|      0|    return -1;
 1128|      0|  }
 1129|   156k|  if (off + len >= ss->maxlen) {
  ------------------
  |  Branch (1129:7): [True: 17.7k, False: 138k]
  ------------------
 1130|       |    /* Grow the buffer */
 1131|  17.7k|    PRUint32 increment = (len > 32) ? len : 32;
  ------------------
  |  Branch (1131:26): [True: 83, False: 17.6k]
  ------------------
 1132|  17.7k|    if (PR_UINT32_MAX - ss->maxlen < increment) {
  ------------------
  |  |  302|  17.7k|#define PR_UINT32_MAX PR_UINT32(4294967295)
  |  |  ------------------
  |  |  |  |  282|  17.7k|#define PR_UINT32(x) x ## U
  |  |  ------------------
  ------------------
  |  Branch (1132:9): [True: 0, False: 17.7k]
  ------------------
 1133|       |      /* ss->maxlen + increment would overflow. */
 1134|      0|      return -1;
 1135|      0|    }
 1136|  17.7k|    newlen = ss->maxlen + increment;
 1137|  17.7k|    if (newlen > PR_INT32_MAX) {
  ------------------
  |  |  300|  17.7k|#define PR_INT32_MAX PR_INT32(2147483647)
  |  |  ------------------
  |  |  |  |  281|  17.7k|#define PR_INT32(x)  x
  |  |  ------------------
  ------------------
  |  Branch (1137:9): [True: 0, False: 17.7k]
  ------------------
 1138|      0|      return -1;
 1139|      0|    }
 1140|  17.7k|    if (ss->base) {
  ------------------
  |  Branch (1140:9): [True: 540, False: 17.1k]
  ------------------
 1141|    540|      newbase = (char*)PR_REALLOC(ss->base, newlen);
  ------------------
  |  |   77|    540|#define PR_REALLOC(_ptr, _size) (PR_Realloc((_ptr), (_size)))
  ------------------
 1142|  17.1k|    } else {
 1143|  17.1k|      newbase = (char*)PR_MALLOC(newlen);
  ------------------
  |  |   55|  17.1k|#define PR_MALLOC(_bytes) (PR_Malloc((_bytes)))
  ------------------
 1144|  17.1k|    }
 1145|  17.7k|    if (!newbase) {
  ------------------
  |  Branch (1145:9): [True: 0, False: 17.7k]
  ------------------
 1146|       |      /* Ran out of memory */
 1147|      0|      return -1;
 1148|      0|    }
 1149|  17.7k|    ss->base = newbase;
 1150|  17.7k|    ss->maxlen = newlen;
 1151|  17.7k|    ss->cur = ss->base + off;
 1152|  17.7k|  }
 1153|       |
 1154|       |  /* Copy data */
 1155|   412k|  while (len) {
  ------------------
  |  Branch (1155:10): [True: 256k, False: 156k]
  ------------------
 1156|   256k|    --len;
 1157|   256k|    *ss->cur++ = *sp++;
 1158|   256k|  }
 1159|   156k|  PR_ASSERT((PRUint32)(ss->cur - ss->base) <= ss->maxlen);
  ------------------
  |  |  208|   156k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 156k, False: 0]
  |  |  ------------------
  ------------------
 1160|   156k|  return 0;
 1161|   156k|}
prprf.c:LimitStuff:
 1202|  6.76k|static int LimitStuff(SprintfState* ss, const char* sp, PRUint32 len) {
 1203|  6.76k|  PRUint32 limit = ss->maxlen - (ss->cur - ss->base);
 1204|       |
 1205|  6.76k|  if (len > limit) {
  ------------------
  |  Branch (1205:7): [True: 0, False: 6.76k]
  ------------------
 1206|      0|    len = limit;
 1207|      0|  }
 1208|  28.7k|  while (len) {
  ------------------
  |  Branch (1208:10): [True: 21.9k, False: 6.76k]
  ------------------
 1209|  21.9k|    --len;
 1210|  21.9k|    *ss->cur++ = *sp++;
 1211|  21.9k|  }
 1212|  6.76k|  return 0;
 1213|  6.76k|}

_PR_InitLinker:
  104|      1|void _PR_InitLinker(void) {
  105|      1|  PRLibrary* lm = NULL;
  106|      1|#if defined(XP_UNIX)
  107|      1|  void* h;
  108|      1|#endif
  109|       |
  110|      1|  if (!pr_linker_lock) {
  ------------------
  |  Branch (110:7): [True: 1, False: 0]
  ------------------
  111|      1|    pr_linker_lock = PR_NewNamedMonitor("linker-lock");
  112|      1|  }
  113|      1|  PR_EnterMonitor(pr_linker_lock);
  114|       |
  115|       |#if defined(XP_PC)
  116|       |  lm = PR_NEWZAP(PRLibrary);
  117|       |  lm->name = strdup("Executable");
  118|       |  /* A module handle for the executable. */
  119|       |  lm->dlh = GetModuleHandle(NULL);
  120|       |
  121|       |  lm->refCount = 1;
  122|       |  lm->staticTable = NULL;
  123|       |  pr_exe_loadmap = lm;
  124|       |  pr_loadmap = lm;
  125|       |
  126|       |#elif defined(XP_UNIX)
  127|       |#  ifdef HAVE_DLL
  128|      1|#    if defined(USE_DLFCN) && !defined(NO_DLOPEN_NULL)
  129|      1|  h = dlopen(0, RTLD_LAZY);
  130|      1|  if (!h) {
  ------------------
  |  Branch (130:7): [True: 0, False: 1]
  ------------------
  131|      0|    char* error;
  132|       |
  133|      0|    DLLErrorInternal(_MD_ERRNO());
  ------------------
  |  |  314|      0|#define _MD_ERRNO()                 (errno)
  ------------------
  134|      0|    error = (char*)PR_MALLOC(PR_GetErrorTextLength());
  ------------------
  |  |   55|      0|#define PR_MALLOC(_bytes) (PR_Malloc((_bytes)))
  ------------------
  135|      0|    (void)PR_GetErrorText(error);
  136|      0|    fprintf(stderr, "failed to initialize shared libraries [%s]\n", error);
  137|      0|    PR_DELETE(error);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  138|      0|    abort(); /* XXX */
  139|      0|  }
  140|       |#    elif defined(USE_HPSHL)
  141|       |  h = NULL;
  142|       |  /* don't abort with this NULL */
  143|       |#    elif defined(NO_DLOPEN_NULL)
  144|       |  h = NULL; /* XXXX  toshok */ /* XXXX  vlad */
  145|       |#    else
  146|       |#      error no dll strategy
  147|       |#    endif /* USE_DLFCN */
  148|       |
  149|      1|  lm = PR_NEWZAP(PRLibrary);
  ------------------
  |  |   99|      1|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  150|      1|  if (lm) {
  ------------------
  |  Branch (150:7): [True: 1, False: 0]
  ------------------
  151|      1|    lm->name = strdup("a.out");
  152|      1|    lm->refCount = 1;
  153|      1|    lm->dlh = h;
  154|      1|    lm->staticTable = NULL;
  155|      1|  }
  156|      1|  pr_exe_loadmap = lm;
  157|      1|  pr_loadmap = lm;
  158|      1|#  endif   /* HAVE_DLL */
  159|      1|#endif     /* XP_UNIX */
  160|       |
  161|      1|  if (lm) {
  ------------------
  |  Branch (161:7): [True: 1, False: 0]
  ------------------
  162|      1|    PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("Loaded library %s (init)", lm->name));
  ------------------
  |  |  177|      1|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|      1|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  178|      1|      if (PR_LOG_TEST(_module,_level)) { \
  |  |  ------------------
  |  |  |  |  167|      1|    ((_module)->level >= (_level))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:5): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  179|      0|      PR_LogPrint _args;         \
  |  |  180|      0|      }                     \
  |  |  181|      1|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      1|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|      1|  }
  164|       |
  165|      1|  PR_ExitMonitor(pr_linker_lock);
  166|      1|}

_PR_InitZones:
  140|      1|void _PR_InitZones(void) {
  141|      1|  int i, j;
  142|      1|  char* envp;
  143|      1|  PRBool* sym;
  144|       |
  145|      1|  if ((sym = (PRBool*)pr_FindSymbolInProg("nspr_use_zone_allocator")) != NULL) {
  ------------------
  |  Branch (145:7): [True: 0, False: 1]
  ------------------
  146|      0|    use_zone_allocator = *sym;
  147|      1|  } else if ((envp = getenv("NSPR_USE_ZONE_ALLOCATOR")) != NULL) {
  ------------------
  |  Branch (147:14): [True: 0, False: 1]
  ------------------
  148|      0|    use_zone_allocator = (atoi(envp) == 1);
  149|      0|  }
  150|       |
  151|      1|  if (!use_zone_allocator) {
  ------------------
  |  Branch (151:7): [True: 1, False: 0]
  ------------------
  152|      1|    return;
  153|      1|  }
  154|       |
  155|      0|  for (j = 0; j < THREAD_POOLS; j++) {
  ------------------
  |  |   47|      0|#  define THREAD_POOLS 11 /* prime number for modulus */
  ------------------
  |  Branch (155:15): [True: 0, False: 0]
  ------------------
  156|      0|    for (i = 0; i < MEM_ZONES; i++) {
  ------------------
  |  |   46|      0|#  define MEM_ZONES 7
  ------------------
  |  Branch (156:17): [True: 0, False: 0]
  ------------------
  157|      0|      MemoryZone* mz = &zones[i][j];
  158|      0|      int rv = pthread_mutex_init(&mz->lock, NULL);
  159|      0|      PR_ASSERT(0 == rv);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  160|      0|      if (rv != 0) {
  ------------------
  |  Branch (160:11): [True: 0, False: 0]
  ------------------
  161|      0|        goto loser;
  162|      0|      }
  163|      0|      mz->blockSize = 16 << (2 * i);
  164|      0|    }
  165|      0|  }
  166|      0|  return;
  167|       |
  168|      0|loser:
  169|      0|  _PR_DestroyZones();
  170|      0|  return;
  171|      0|}
PR_Malloc:
  420|   861k|PR_IMPLEMENT(void*) PR_Malloc(PRUint32 size) {
  421|   861k|  if (!_pr_initialized) {
  ------------------
  |  Branch (421:7): [True: 0, False: 861k]
  ------------------
  422|      0|    _PR_ImplicitInitialization();
  423|      0|  }
  424|       |
  425|   861k|  return use_zone_allocator ? pr_ZoneMalloc(size) : malloc(size);
  ------------------
  |  Branch (425:10): [True: 0, False: 861k]
  ------------------
  426|   861k|}
PR_Calloc:
  428|   938k|PR_IMPLEMENT(void*) PR_Calloc(PRUint32 nelem, PRUint32 elsize) {
  429|   938k|  if (!_pr_initialized) {
  ------------------
  |  Branch (429:7): [True: 0, False: 938k]
  ------------------
  430|      0|    _PR_ImplicitInitialization();
  431|      0|  }
  432|       |
  433|   938k|  return use_zone_allocator ? pr_ZoneCalloc(nelem, elsize)
  ------------------
  |  Branch (433:10): [True: 0, False: 938k]
  ------------------
  434|   938k|                            : calloc(nelem, elsize);
  435|   938k|}
PR_Realloc:
  437|  1.59k|PR_IMPLEMENT(void*) PR_Realloc(void* ptr, PRUint32 size) {
  438|  1.59k|  if (!_pr_initialized) {
  ------------------
  |  Branch (438:7): [True: 0, False: 1.59k]
  ------------------
  439|      0|    _PR_ImplicitInitialization();
  440|      0|  }
  441|       |
  442|  1.59k|  return use_zone_allocator ? pr_ZoneRealloc(ptr, size) : realloc(ptr, size);
  ------------------
  |  Branch (442:10): [True: 0, False: 1.59k]
  ------------------
  443|  1.59k|}
PR_Free:
  445|  1.80M|PR_IMPLEMENT(void) PR_Free(void* ptr) {
  446|  1.80M|  if (use_zone_allocator) {
  ------------------
  |  Branch (446:7): [True: 0, False: 1.80M]
  ------------------
  447|      0|    pr_ZoneFree(ptr);
  448|  1.80M|  } else {
  449|  1.80M|    free(ptr);
  450|  1.80M|  }
  451|  1.80M|}
prmem.c:pr_FindSymbolInProg:
   91|      1|static void* pr_FindSymbolInProg(const char* name) {
   92|      1|  void* h;
   93|      1|  void* sym;
   94|       |
   95|      1|  h = dlopen(0, RTLD_LAZY);
   96|      1|  if (h == NULL) {
  ------------------
  |  Branch (96:7): [True: 0, False: 1]
  ------------------
   97|      0|    return NULL;
   98|      0|  }
   99|      1|  sym = dlsym(h, name);
  100|      1|  (void)dlclose(h);
  101|      1|  return sym;
  102|      1|}

PR_GetPageSize:
   59|      1|PR_IMPLEMENT(PRInt32) PR_GetPageSize(void) {
   60|      1|  if (!_pr_pageSize) {
  ------------------
  |  Branch (60:7): [True: 1, False: 0]
  ------------------
   61|      1|    GetPageSize();
   62|      1|  }
   63|      1|  return _pr_pageSize;
   64|      1|}
prosdep.c:GetPageSize:
   22|      1|static void GetPageSize(void) {
   23|      1|  PRInt32 pageSize;
   24|       |
   25|       |  /* Get page size */
   26|      1|#ifdef XP_UNIX
   27|      1|#  if defined AIX || defined LINUX || defined __GNU__ || defined __GLIBC__ || \
   28|      1|      defined FREEBSD || defined NETBSD || defined OPENBSD || defined DARWIN
   29|      1|  _pr_pageSize = getpagesize();
   30|       |#  elif defined(HPUX)
   31|       |  /* I have no idea. Don't get me started. --Rob */
   32|       |  _pr_pageSize = sysconf(_SC_PAGE_SIZE);
   33|       |#  else
   34|       |  _pr_pageSize = sysconf(_SC_PAGESIZE);
   35|       |#  endif
   36|      1|#endif /* XP_UNIX */
   37|       |
   38|       |#ifdef XP_PC
   39|       |#  ifdef _WIN32
   40|       |  SYSTEM_INFO info;
   41|       |  GetSystemInfo(&info);
   42|       |  _pr_pageSize = info.dwPageSize;
   43|       |#  else
   44|       |  _pr_pageSize = 4096;
   45|       |#  endif
   46|       |#endif /* XP_PC */
   47|       |
   48|      1|  pageSize = _pr_pageSize;
   49|      1|  PR_CEILING_LOG2(_pr_pageShift, pageSize);
  ------------------
  |  |   72|      1|  PR_BEGIN_MACRO                       \
  |  |  ------------------
  |  |  |  |  123|      1|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|      1|    PRUint32 j_ = (PRUint32)(_n);      \
  |  |   74|      1|    (_log2) = (j_ <= 1 ? 0 : 32 - pr_bitscan_clz32(j_ - 1)); \
  |  |  ------------------
  |  |  |  |   40|      1|# define pr_bitscan_clz32(val)  __builtin_clz(val)
  |  |  ------------------
  |  |  |  Branch (74:16): [True: 0, False: 1]
  |  |  ------------------
  |  |   75|      1|  PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      1|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   50|      1|}

_MD_EarlyInit:
    8|      1|void _MD_EarlyInit(void) {}

_PR_UnixInit:
 2585|      1|void _PR_UnixInit(void) {
 2586|      1|  struct sigaction sigact;
 2587|      1|  int rv;
 2588|       |
 2589|      1|  sigemptyset(&timer_set);
 2590|       |
 2591|       |#if !defined(_PR_PTHREADS)
 2592|       |
 2593|       |  sigaddset(&timer_set, SIGALRM);
 2594|       |  sigemptyset(&empty_set);
 2595|       |  intr_timeout_ticks = PR_SecondsToInterval(_PR_INTERRUPT_CHECK_INTERVAL_SECS);
 2596|       |
 2597|       |#  if defined(SOLARIS)
 2598|       |
 2599|       |  if (getenv("NSPR_SIGSEGV_HANDLE")) {
 2600|       |    sigact.sa_handler = sigsegvhandler;
 2601|       |    sigact.sa_flags = 0;
 2602|       |    sigact.sa_mask = timer_set;
 2603|       |    sigaction(SIGSEGV, &sigact, 0);
 2604|       |  }
 2605|       |
 2606|       |  if (getenv("NSPR_SIGABRT_HANDLE")) {
 2607|       |    sigact.sa_handler = sigaborthandler;
 2608|       |    sigact.sa_flags = 0;
 2609|       |    sigact.sa_mask = timer_set;
 2610|       |    sigaction(SIGABRT, &sigact, 0);
 2611|       |  }
 2612|       |
 2613|       |  if (getenv("NSPR_SIGBUS_HANDLE")) {
 2614|       |    sigact.sa_handler = sigbushandler;
 2615|       |    sigact.sa_flags = 0;
 2616|       |    sigact.sa_mask = timer_set;
 2617|       |    sigaction(SIGBUS, &sigact, 0);
 2618|       |  }
 2619|       |
 2620|       |#  endif
 2621|       |#endif /* !defined(_PR_PTHREADS) */
 2622|       |
 2623|      1|  sigact.sa_handler = SIG_IGN;
 2624|      1|  sigemptyset(&sigact.sa_mask);
 2625|      1|  sigact.sa_flags = 0;
 2626|      1|  rv = sigaction(SIGPIPE, &sigact, 0);
 2627|      1|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 2628|       |
 2629|      1|  _pr_unix_rename_lock = PR_NewLock();
 2630|      1|  PR_ASSERT(NULL != _pr_unix_rename_lock);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 2631|      1|  _pr_Xfe_mon = PR_NewMonitor();
 2632|      1|  PR_ASSERT(NULL != _pr_Xfe_mon);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 2633|       |
 2634|      1|  _PR_InitIOV(); /* one last hack */
 2635|      1|}
PR_Now:
 2749|      1|PR_Now(void) {
 2750|      1|  struct timeval tv;
 2751|      1|  PRInt64 s, us, s2us;
 2752|       |
 2753|      1|  GETTIMEOFDAY(&tv);
  ------------------
  |  |  506|      1|#define GETTIMEOFDAY(tp) gettimeofday((tp), NULL)
  ------------------
 2754|      1|  LL_I2L(s2us, PR_USEC_PER_SEC);
  ------------------
  |  |  149|      1|#define LL_I2L(l, i)        ((l) = (PRInt64)(i))
  ------------------
 2755|      1|  LL_I2L(s, tv.tv_sec);
  ------------------
  |  |  149|      1|#define LL_I2L(l, i)        ((l) = (PRInt64)(i))
  ------------------
 2756|      1|  LL_I2L(us, tv.tv_usec);
  ------------------
  |  |  149|      1|#define LL_I2L(l, i)        ((l) = (PRInt64)(i))
  ------------------
 2757|      1|  LL_MUL(s, s, s2us);
  ------------------
  |  |  115|      1|#define LL_MUL(r, a, b)        ((r) = (a) * (b))
  ------------------
 2758|      1|  LL_ADD(s, s, us);
  ------------------
  |  |  105|      1|#define LL_ADD(r, a, b)     ((r) = (a) + (b))
  ------------------
 2759|      1|  return s;
 2760|      1|}
_PR_UNIX_GetInterval2:
 2785|  18.4k|PRIntervalTime _PR_UNIX_GetInterval2() {
 2786|  18.4k|  struct timespec time;
 2787|  18.4k|  PRIntervalTime ticks;
 2788|       |
 2789|  18.4k|  if (clock_gettime(CLOCK_MONOTONIC, &time) != 0) {
  ------------------
  |  Branch (2789:7): [True: 0, False: 18.4k]
  ------------------
 2790|      0|    fprintf(stderr, "clock_gettime failed: %d\n", errno);
 2791|      0|    abort();
 2792|      0|  }
 2793|       |
 2794|  18.4k|  ticks = (PRUint32)time.tv_sec * PR_MSEC_PER_SEC;
  ------------------
  |  |   27|  18.4k|#define PR_MSEC_PER_SEC     1000L
  ------------------
 2795|  18.4k|  ticks += (PRUint32)time.tv_nsec / PR_NSEC_PER_MSEC;
  ------------------
  |  |   31|  18.4k|#define PR_NSEC_PER_MSEC    1000000L
  ------------------
 2796|  18.4k|  return ticks;
 2797|  18.4k|}
_PR_UNIX_TicksPerSecond2:
 2799|  4.51k|PRIntervalTime _PR_UNIX_TicksPerSecond2() { return 1000; }
unix.c:_PR_InitIOV:
 2526|      1|static void _PR_InitIOV(void) {
 2527|       |#if defined(SOLARIS2_5)
 2528|       |  PRLibrary* lib;
 2529|       |  void* open64_func;
 2530|       |
 2531|       |  open64_func = PR_FindSymbolAndLibrary("open64", &lib);
 2532|       |  if (NULL != open64_func) {
 2533|       |    PR_ASSERT(NULL != lib);
 2534|       |    _md_iovector._open64 = (_MD_Open64)open64_func;
 2535|       |    _md_iovector._mmap64 = (_MD_Mmap64)PR_FindSymbol(lib, "mmap64");
 2536|       |    _md_iovector._fstat64 = (_MD_Fstat64)PR_FindSymbol(lib, "fstat64");
 2537|       |    _md_iovector._stat64 = (_MD_Stat64)PR_FindSymbol(lib, "stat64");
 2538|       |    _md_iovector._lseek64 = (_MD_Lseek64)PR_FindSymbol(lib, "lseek64");
 2539|       |    (void)PR_UnloadLibrary(lib);
 2540|       |  } else {
 2541|       |    _md_iovector._open64 = open;
 2542|       |    _md_iovector._mmap64 = _MD_Unix_mmap64;
 2543|       |    _md_iovector._fstat64 = _MD_solaris25_fstat64;
 2544|       |    _md_iovector._stat64 = _MD_solaris25_stat64;
 2545|       |    _md_iovector._lseek64 = _MD_Unix_lseek64;
 2546|       |  }
 2547|       |#elif defined(_PR_NO_LARGE_FILES)
 2548|       |  _md_iovector._open64 = open;
 2549|       |  _md_iovector._mmap64 = _MD_Unix_mmap64;
 2550|       |  _md_iovector._fstat64 = fstat;
 2551|       |  _md_iovector._stat64 = stat;
 2552|       |  _md_iovector._lseek64 = _MD_Unix_lseek64;
 2553|       |#elif defined(_PR_HAVE_OFF64_T)
 2554|       |#  if (defined(ANDROID) && __ANDROID_API__ < 21)
 2555|       |  /*
 2556|       |   * Android < 21 doesn't have open64.  We pass the O_LARGEFILE flag to open
 2557|       |   * in _MD_open.
 2558|       |   */
 2559|       |  _md_iovector._open64 = open;
 2560|       |#  else
 2561|      1|  _md_iovector._open64 = open64;
 2562|      1|#  endif
 2563|      1|  _md_iovector._mmap64 = mmap64;
 2564|       |#  if (defined(ANDROID) && __ANDROID_API__ < 21)
 2565|       |  /* Same as the open64 case for Android. */
 2566|       |  _md_iovector._fstat64 = (_MD_Fstat64)fstat;
 2567|       |  _md_iovector._stat64 = (_MD_Stat64)stat;
 2568|       |#  else
 2569|      1|  _md_iovector._fstat64 = fstat64;
 2570|      1|  _md_iovector._stat64 = stat64;
 2571|      1|#  endif
 2572|      1|  _md_iovector._lseek64 = lseek64;
 2573|       |#elif defined(_PR_HAVE_LARGE_OFF_T)
 2574|       |  _md_iovector._open64 = open;
 2575|       |  _md_iovector._mmap64 = mmap;
 2576|       |  _md_iovector._fstat64 = fstat;
 2577|       |  _md_iovector._stat64 = stat;
 2578|       |  _md_iovector._lseek64 = lseek;
 2579|       |#else
 2580|       |#  error "I don't know yet"
 2581|       |#endif
 2582|      1|  LL_I2L(minus_one, -1);
  ------------------
  |  |  149|      1|#define LL_I2L(l, i)        ((l) = (PRInt64)(i))
  ------------------
 2583|      1|} /* _PR_InitIOV */

_PR_InitSegs:
   13|      1|void _PR_InitSegs(void) {}

_PR_InitAtomic:
  243|      1|void _PR_InitAtomic(void) { _PR_MD_INIT_ATOMIC(); }

pr_inet_aton:
   99|  10.2k|int pr_inet_aton(const char* cp, PRUint32* addr) {
  100|  10.2k|  PRUint32 val;
  101|  10.2k|  int base, n;
  102|  10.2k|  char c;
  103|  10.2k|  PRUint8 parts[4];
  104|  10.2k|  PRUint8* pp = parts;
  105|  10.2k|  int digit;
  106|       |
  107|  10.2k|  c = *cp;
  108|  10.2k|  for (;;) {
  109|       |    /*
  110|       |     * Collect number up to ``.''.
  111|       |     * Values are specified as for C:
  112|       |     * 0x=hex, 0=octal, isdigit=decimal.
  113|       |     */
  114|  10.2k|    if (!_isdigit(c)) {
  ------------------
  |  Branch (114:9): [True: 10.2k, False: 0]
  ------------------
  115|  10.2k|      return (0);
  116|  10.2k|    }
  117|      0|    val = 0;
  118|      0|    base = 10;
  119|      0|    digit = 0;
  120|      0|    if (c == '0') {
  ------------------
  |  Branch (120:9): [True: 0, False: 0]
  ------------------
  121|      0|      c = *++cp;
  122|      0|      if (c == 'x' || c == 'X') {
  ------------------
  |  Branch (122:11): [True: 0, False: 0]
  |  Branch (122:23): [True: 0, False: 0]
  ------------------
  123|      0|        base = 16, c = *++cp;
  124|      0|      } else {
  125|      0|        base = 8;
  126|      0|        digit = 1;
  127|      0|      }
  128|      0|    }
  129|      0|    for (;;) {
  130|      0|      if (_isdigit(c)) {
  ------------------
  |  Branch (130:11): [True: 0, False: 0]
  ------------------
  131|      0|        if (base == 8 && (c == '8' || c == '9')) {
  ------------------
  |  Branch (131:13): [True: 0, False: 0]
  |  Branch (131:27): [True: 0, False: 0]
  |  Branch (131:39): [True: 0, False: 0]
  ------------------
  132|      0|          return (0);
  133|      0|        }
  134|      0|        val = (val * base) + (c - '0');
  135|      0|        c = *++cp;
  136|      0|        digit = 1;
  137|      0|      } else if (base == 16 && _isxdigit(c)) {
  ------------------
  |  Branch (137:18): [True: 0, False: 0]
  |  Branch (137:32): [True: 0, False: 0]
  ------------------
  138|      0|        val = (val << 4) + index_hex[(unsigned char)c];
  139|      0|        c = *++cp;
  140|      0|        digit = 1;
  141|      0|      } else {
  142|      0|        break;
  143|      0|      }
  144|      0|    }
  145|      0|    if (c == '.') {
  ------------------
  |  Branch (145:9): [True: 0, False: 0]
  ------------------
  146|       |      /*
  147|       |       * Internet format:
  148|       |       *    a.b.c.d
  149|       |       *    a.b.c    (with c treated as 16 bits)
  150|       |       *    a.b    (with b treated as 24 bits)
  151|       |       */
  152|      0|      if (pp >= parts + 3 || val > 0xffU) {
  ------------------
  |  Branch (152:11): [True: 0, False: 0]
  |  Branch (152:30): [True: 0, False: 0]
  ------------------
  153|      0|        return (0);
  154|      0|      }
  155|      0|      *pp++ = val;
  156|      0|      c = *++cp;
  157|      0|    } else {
  158|      0|      break;
  159|      0|    }
  160|      0|  }
  161|       |  /*
  162|       |   * Check for trailing characters.
  163|       |   */
  164|      0|  if (c != '\0' && !_isspace(c)) {
  ------------------
  |  Branch (164:7): [True: 0, False: 0]
  |  Branch (164:20): [True: 0, False: 0]
  ------------------
  165|      0|    return (0);
  166|      0|  }
  167|       |  /*
  168|       |   * Did we get a valid digit?
  169|       |   */
  170|      0|  if (!digit) {
  ------------------
  |  Branch (170:7): [True: 0, False: 0]
  ------------------
  171|      0|    return (0);
  172|      0|  }
  173|       |  /*
  174|       |   * Concoct the address according to
  175|       |   * the number of parts specified.
  176|       |   */
  177|      0|  n = pp - parts + 1;
  178|      0|  switch (n) {
  ------------------
  |  Branch (178:11): [True: 0, False: 0]
  ------------------
  179|      0|    case 1: /*%< a -- 32 bits */
  ------------------
  |  Branch (179:5): [True: 0, False: 0]
  ------------------
  180|      0|      break;
  181|       |
  182|      0|    case 2: /*%< a.b -- 8.24 bits */
  ------------------
  |  Branch (182:5): [True: 0, False: 0]
  ------------------
  183|      0|      if (val > 0xffffffU) {
  ------------------
  |  Branch (183:11): [True: 0, False: 0]
  ------------------
  184|      0|        return (0);
  185|      0|      }
  186|      0|      val |= (unsigned int)parts[0] << 24;
  187|      0|      break;
  188|       |
  189|      0|    case 3: /*%< a.b.c -- 8.8.16 bits */
  ------------------
  |  Branch (189:5): [True: 0, False: 0]
  ------------------
  190|      0|      if (val > 0xffffU) {
  ------------------
  |  Branch (190:11): [True: 0, False: 0]
  ------------------
  191|      0|        return (0);
  192|      0|      }
  193|      0|      val |= ((unsigned int)parts[0] << 24) | ((unsigned int)parts[1] << 16);
  194|      0|      break;
  195|       |
  196|      0|    case 4: /*%< a.b.c.d -- 8.8.8.8 bits */
  ------------------
  |  Branch (196:5): [True: 0, False: 0]
  ------------------
  197|      0|      if (val > 0xffU) {
  ------------------
  |  Branch (197:11): [True: 0, False: 0]
  ------------------
  198|      0|        return (0);
  199|      0|      }
  200|      0|      val |= ((unsigned int)parts[0] << 24) | ((unsigned int)parts[1] << 16) |
  201|      0|             ((unsigned int)parts[2] << 8);
  202|      0|      break;
  203|      0|  }
  204|      0|  *addr = PR_htonl(val);
  205|      0|  return (1);
  206|      0|}
praton.c:_isdigit:
   94|  10.2k|static PRBool _isdigit(char c) { return c >= '0' && c <= '9'; }
  ------------------
  |  Branch (94:41): [True: 10.2k, False: 0]
  |  Branch (94:53): [True: 0, False: 10.2k]
  ------------------

_PR_InitDtoa:
   25|      1|void _PR_InitDtoa(void) {
   26|      1|  dtoa_lock[0] = PR_NewLock();
   27|      1|  dtoa_lock[1] = PR_NewLock();
   28|      1|}

_PR_InitEnv:
   65|      1|void _PR_InitEnv(void) { _PR_NEW_LOCK_ENV(); }
  ------------------
  |  |   45|      1|    { _pr_envLock = PR_NewLock(); }
  ------------------
PR_GetEnv:
   69|     14|PR_IMPLEMENT(char*) PR_GetEnv(const char* var) {
   70|     14|  char* ev;
   71|       |
   72|     14|  if (!_pr_initialized) {
  ------------------
  |  Branch (72:7): [True: 0, False: 14]
  ------------------
   73|      0|    _PR_ImplicitInitialization();
   74|      0|  }
   75|       |
   76|     14|  _PR_LOCK_ENV();
  ------------------
  |  |   54|     14|    {                                        \
  |  |   55|     14|      if (_pr_envLock) PR_Lock(_pr_envLock); \
  |  |  ------------------
  |  |  |  Branch (55:11): [True: 3, False: 11]
  |  |  ------------------
  |  |   56|     14|    }
  ------------------
   77|     14|  ev = _PR_MD_GET_ENV(var);
  ------------------
  |  | 1923|     14|#define    _PR_MD_GET_ENV _MD_GET_ENV
  |  |  ------------------
  |  |  |  |  266|     14|#define _MD_GET_ENV             getenv
  |  |  ------------------
  ------------------
   78|     14|  _PR_UNLOCK_ENV();
  ------------------
  |  |   58|     14|    {                                          \
  |  |   59|     14|      if (_pr_envLock) PR_Unlock(_pr_envLock); \
  |  |  ------------------
  |  |  |  Branch (59:11): [True: 3, False: 11]
  |  |  ------------------
  |  |   60|     14|    }
  ------------------
   79|     14|  return ev;
   80|     14|}
PR_GetEnvSecure:
   82|  8.24k|PR_IMPLEMENT(char*) PR_GetEnvSecure(const char* var) {
   83|  8.24k|#ifdef HAVE_SECURE_GETENV
   84|  8.24k|  char* ev;
   85|       |
   86|  8.24k|  if (!_pr_initialized) {
  ------------------
  |  Branch (86:7): [True: 0, False: 8.24k]
  ------------------
   87|      0|    _PR_ImplicitInitialization();
   88|      0|  }
   89|       |
   90|  8.24k|  _PR_LOCK_ENV();
  ------------------
  |  |   54|  8.24k|    {                                        \
  |  |   55|  8.24k|      if (_pr_envLock) PR_Lock(_pr_envLock); \
  |  |  ------------------
  |  |  |  Branch (55:11): [True: 8.24k, False: 0]
  |  |  ------------------
  |  |   56|  8.24k|    }
  ------------------
   91|  8.24k|  ev = secure_getenv(var);
   92|  8.24k|  _PR_UNLOCK_ENV();
  ------------------
  |  |   58|  8.24k|    {                                          \
  |  |   59|  8.24k|      if (_pr_envLock) PR_Unlock(_pr_envLock); \
  |  |  ------------------
  |  |  |  Branch (59:11): [True: 8.24k, False: 0]
  |  |  ------------------
  |  |   60|  8.24k|    }
  ------------------
   93|       |
   94|  8.24k|  return ev;
   95|       |#else
   96|       |#  ifdef XP_UNIX
   97|       |  /*
   98|       |  ** Fall back to checking uids and gids.  This won't detect any other
   99|       |  ** privilege-granting mechanisms the platform may have.  This also
  100|       |  ** can't detect the case where the process already called
  101|       |  ** setuid(geteuid()) and/or setgid(getegid()).
  102|       |  */
  103|       |  if (getuid() != geteuid() || getgid() != getegid()) {
  104|       |    return NULL;
  105|       |  }
  106|       |#  endif /* XP_UNIX */
  107|       |  return PR_GetEnv(var);
  108|       |#endif   /* HAVE_SECURE_GETENV */
  109|  8.24k|}

nspr_InitializePRErrorTable:
  120|      1|void nspr_InitializePRErrorTable(void) { PR_ErrorInstallTable(&et); }

PR_GetError:
   11|  34.6k|PR_IMPLEMENT(PRErrorCode) PR_GetError(void) {
   12|  34.6k|  PRThread* thread = PR_GetCurrentThread();
   13|  34.6k|  return thread->errorCode;
   14|  34.6k|}
PR_SetError:
   21|   205k|PR_IMPLEMENT(void) PR_SetError(PRErrorCode code, PRInt32 osErr) {
   22|   205k|  PRThread* thread = PR_GetCurrentThread();
   23|   205k|  thread->errorCode = code;
   24|   205k|  thread->osErrorCode = osErr;
   25|   205k|  thread->errorStringLength = 0;
   26|   205k|}

PR_ErrorInstallTable:
  154|      3|PR_ErrorInstallTable(const struct PRErrorTable* table) {
  155|      3|  struct PRErrorTableList* new_et;
  156|       |
  157|      3|  new_et = (struct PRErrorTableList*)PR_Malloc(sizeof(struct PRErrorTableList));
  158|      3|  if (!new_et) {
  ------------------
  |  Branch (158:7): [True: 0, False: 3]
  ------------------
  159|      0|    return errno; /* oops */
  160|      0|  }
  161|      3|  new_et->table = table;
  162|      3|  if (callback_newtable) {
  ------------------
  |  Branch (162:7): [True: 0, False: 3]
  ------------------
  163|      0|    new_et->table_private = callback_newtable(table, callback_private);
  164|      3|  } else {
  165|      3|    new_et->table_private = 0;
  166|      3|  }
  167|      3|  new_et->next = Table_List;
  168|      3|  Table_List = new_et;
  169|      3|  return 0;
  170|      3|}

_PR_ImplicitInitialization:
  200|      1|void _PR_ImplicitInitialization(void) {
  201|      1|  _PR_InitStuff();
  202|       |
  203|       |  /* Enable interrupts */
  204|       |#if !defined(_PR_PTHREADS) && !defined(_PR_GLOBAL_THREADS_ONLY)
  205|       |  _PR_MD_START_INTERRUPTS();
  206|       |#endif
  207|      1|}
PR_CallOnce:
  706|   239k|PR_IMPLEMENT(PRStatus) PR_CallOnce(PRCallOnceType* once, PRCallOnceFN func) {
  707|   239k|  if (!_pr_initialized) {
  ------------------
  |  Branch (707:7): [True: 1, False: 239k]
  ------------------
  708|      1|    _PR_ImplicitInitialization();
  709|      1|  }
  710|       |
  711|   239k|  PR_Lock(mod_init.ml);
  712|   239k|  PRIntn initialized = once->initialized;
  713|   239k|  PRStatus status = once->status;
  714|   239k|  PR_Unlock(mod_init.ml);
  715|   239k|  if (!initialized) {
  ------------------
  |  Branch (715:7): [True: 12, False: 239k]
  ------------------
  716|     12|    if (PR_ATOMIC_SET(&once->inProgress, 1) == 0) {
  ------------------
  |  |  124|     12|#define PR_ATOMIC_SET(val, newval) __sync_lock_test_and_set(val, newval)
  ------------------
  |  Branch (716:9): [True: 12, False: 0]
  ------------------
  717|     12|      status = (*func)();
  718|     12|      PR_Lock(mod_init.ml);
  719|     12|      once->status = status;
  720|     12|      once->initialized = 1;
  721|     12|      PR_NotifyAllCondVar(mod_init.cv);
  722|     12|      PR_Unlock(mod_init.ml);
  723|     12|    } else {
  724|      0|      PR_Lock(mod_init.ml);
  725|      0|      while (!once->initialized) {
  ------------------
  |  Branch (725:14): [True: 0, False: 0]
  ------------------
  726|      0|        PR_WaitCondVar(mod_init.cv, PR_INTERVAL_NO_TIMEOUT);
  ------------------
  |  |   54|      0|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
  727|      0|      }
  728|      0|      status = once->status;
  729|      0|      PR_Unlock(mod_init.ml);
  730|      0|      if (PR_SUCCESS != status) {
  ------------------
  |  Branch (730:11): [True: 0, False: 0]
  ------------------
  731|      0|        PR_SetError(PR_CALL_ONCE_ERROR, 0);
  ------------------
  |  |  241|      0|#define PR_CALL_ONCE_ERROR                       (-5925L)
  ------------------
  732|      0|      }
  733|      0|    }
  734|     12|    return status;
  735|     12|  }
  736|   239k|  if (PR_SUCCESS != status) {
  ------------------
  |  Branch (736:7): [True: 0, False: 239k]
  ------------------
  737|      0|    PR_SetError(PR_CALL_ONCE_ERROR, 0);
  ------------------
  |  |  241|      0|#define PR_CALL_ONCE_ERROR                       (-5925L)
  ------------------
  738|      0|  }
  739|   239k|  return status;
  740|   239k|}
PR_CallOnceWithArg:
  743|   240k|PR_CallOnceWithArg(PRCallOnceType* once, PRCallOnceWithArgFN func, void* arg) {
  744|   240k|  if (!_pr_initialized) {
  ------------------
  |  Branch (744:7): [True: 0, False: 240k]
  ------------------
  745|      0|    _PR_ImplicitInitialization();
  746|      0|  }
  747|       |
  748|   240k|  PR_Lock(mod_init.ml);
  749|   240k|  PRIntn initialized = once->initialized;
  750|   240k|  PRStatus status = once->status;
  751|   240k|  PR_Unlock(mod_init.ml);
  752|   240k|  if (!initialized) {
  ------------------
  |  Branch (752:7): [True: 24, False: 240k]
  ------------------
  753|     24|    if (PR_ATOMIC_SET(&once->inProgress, 1) == 0) {
  ------------------
  |  |  124|     24|#define PR_ATOMIC_SET(val, newval) __sync_lock_test_and_set(val, newval)
  ------------------
  |  Branch (753:9): [True: 24, False: 0]
  ------------------
  754|     24|      status = (*func)(arg);
  755|     24|      PR_Lock(mod_init.ml);
  756|     24|      once->status = status;
  757|     24|      once->initialized = 1;
  758|     24|      PR_NotifyAllCondVar(mod_init.cv);
  759|     24|      PR_Unlock(mod_init.ml);
  760|     24|    } else {
  761|      0|      PR_Lock(mod_init.ml);
  762|      0|      while (!once->initialized) {
  ------------------
  |  Branch (762:14): [True: 0, False: 0]
  ------------------
  763|      0|        PR_WaitCondVar(mod_init.cv, PR_INTERVAL_NO_TIMEOUT);
  ------------------
  |  |   54|      0|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
  764|      0|      }
  765|      0|      status = once->status;
  766|      0|      PR_Unlock(mod_init.ml);
  767|      0|      if (PR_SUCCESS != status) {
  ------------------
  |  Branch (767:11): [True: 0, False: 0]
  ------------------
  768|      0|        PR_SetError(PR_CALL_ONCE_ERROR, 0);
  ------------------
  |  |  241|      0|#define PR_CALL_ONCE_ERROR                       (-5925L)
  ------------------
  769|      0|      }
  770|      0|    }
  771|     24|    return status;
  772|     24|  }
  773|   240k|  if (PR_SUCCESS != status) {
  ------------------
  |  Branch (773:7): [True: 0, False: 240k]
  ------------------
  774|      0|    PR_SetError(PR_CALL_ONCE_ERROR, 0);
  ------------------
  |  |  241|      0|#define PR_CALL_ONCE_ERROR                       (-5925L)
  ------------------
  775|      0|  }
  776|   240k|  return status;
  777|   240k|}
prinit.c:_PR_InitStuff:
  129|      1|static void _PR_InitStuff(void) {
  130|      1|  if (_pr_initialized) {
  ------------------
  |  Branch (130:7): [True: 0, False: 1]
  ------------------
  131|      0|    return;
  132|      0|  }
  133|      1|  _pr_initialized = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  134|      1|#ifdef _PR_ZONE_ALLOCATOR
  135|      1|  _PR_InitZones();
  136|      1|#endif
  137|       |#ifdef WINNT
  138|       |  _pr_SetNativeThreadsOnlyMode();
  139|       |#endif
  140|       |
  141|      1|  (void)PR_GetPageSize();
  142|       |
  143|      1|  _pr_clock_lm = PR_NewLogModule("clock");
  144|      1|  _pr_cmon_lm = PR_NewLogModule("cmon");
  145|      1|  _pr_io_lm = PR_NewLogModule("io");
  146|      1|  _pr_mon_lm = PR_NewLogModule("mon");
  147|      1|  _pr_linker_lm = PR_NewLogModule("linker");
  148|      1|  _pr_cvar_lm = PR_NewLogModule("cvar");
  149|      1|  _pr_sched_lm = PR_NewLogModule("sched");
  150|      1|  _pr_thread_lm = PR_NewLogModule("thread");
  151|      1|  _pr_gc_lm = PR_NewLogModule("gc");
  152|      1|  _pr_shm_lm = PR_NewLogModule("shm");
  153|      1|  _pr_shma_lm = PR_NewLogModule("shma");
  154|       |
  155|       |  /* NOTE: These init's cannot depend on _PR_MD_CURRENT_THREAD() */
  156|      1|  _PR_MD_EARLY_INIT();
  ------------------
  |  | 1888|      1|#define    _PR_MD_EARLY_INIT _MD_EARLY_INIT
  |  |  ------------------
  |  |  |  |  712|      1|#define _MD_EARLY_INIT                  _MD_EarlyInit
  |  |  ------------------
  ------------------
  157|       |
  158|      1|  _PR_InitLocks();
  159|      1|  _PR_InitAtomic();
  160|      1|  _PR_InitSegs();
  161|      1|  _PR_InitStacks();
  162|      1|  _PR_InitTPD();
  163|      1|  _PR_InitEnv();
  164|      1|  _PR_InitLayerCache();
  165|      1|  _PR_InitClock();
  166|       |
  167|      1|  _pr_sleeplock = PR_NewLock();
  168|      1|  PR_ASSERT(NULL != _pr_sleeplock);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  169|       |
  170|      1|  _PR_InitThreads(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
  171|       |
  172|      1|#ifndef _PR_GLOBAL_THREADS_ONLY
  173|      1|  _PR_InitCPUs();
  174|      1|#endif
  175|       |
  176|       |  /*
  177|       |   * XXX: call _PR_InitMem only on those platforms for which nspr implements
  178|       |   *  malloc, for now.
  179|       |   */
  180|       |#ifdef _PR_OVERRIDE_MALLOC
  181|       |  _PR_InitMem();
  182|       |#endif
  183|       |
  184|      1|  _PR_InitCMon();
  185|      1|  _PR_InitIO();
  186|      1|  _PR_InitNet();
  187|      1|  _PR_InitTime();
  188|      1|  _PR_InitLog();
  189|      1|  _PR_InitLinker();
  190|      1|  _PR_InitCallOnce();
  191|      1|  _PR_InitDtoa();
  192|      1|  _PR_InitMW();
  193|      1|  _PR_InitRWLocks();
  194|       |
  195|      1|  nspr_InitializePRErrorTable();
  196|       |
  197|      1|  _PR_MD_FINAL_INIT();
  ------------------
  |  | 1894|      1|#define    _PR_MD_FINAL_INIT _MD_FINAL_INIT
  |  |  ------------------
  |  |  |  |  713|      1|#define _MD_FINAL_INIT                  _PR_UnixInit
  |  |  ------------------
  ------------------
  198|      1|}
prinit.c:_PR_InitCallOnce:
  692|      1|static void _PR_InitCallOnce(void) {
  693|      1|  mod_init.ml = PR_NewLock();
  694|      1|  PR_ASSERT(NULL != mod_init.ml);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  695|      1|  mod_init.cv = PR_NewCondVar(mod_init.ml);
  696|      1|  PR_ASSERT(NULL != mod_init.cv);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  697|      1|}

_PR_InitClock:
   22|      1|void _PR_InitClock(void) {
   23|      1|  _PR_MD_INTERVAL_INIT();
   24|      1|#ifdef DEBUG
   25|      1|  {
   26|      1|    PRIntervalTime ticksPerSec = PR_TicksPerSecond();
   27|       |
   28|      1|    PR_ASSERT(ticksPerSec >= PR_INTERVAL_MIN);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   29|      1|    PR_ASSERT(ticksPerSec <= PR_INTERVAL_MAX);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   30|      1|  }
   31|      1|#endif /* DEBUG */
   32|      1|}
PR_IntervalNow:
   34|  18.4k|PR_IMPLEMENT(PRIntervalTime) PR_IntervalNow(void) {
   35|  18.4k|  if (!_pr_initialized) {
  ------------------
  |  Branch (35:7): [True: 0, False: 18.4k]
  ------------------
   36|      0|    _PR_ImplicitInitialization();
   37|      0|  }
   38|  18.4k|  return _PR_MD_GET_INTERVAL();
  ------------------
  |  | 1963|  18.4k|#define _PR_MD_GET_INTERVAL _MD_GET_INTERVAL
  |  |  ------------------
  |  |  |  |  305|  18.4k|#define _MD_GET_INTERVAL        _PR_UNIX_GetInterval2
  |  |  ------------------
  ------------------
   39|  18.4k|} /* PR_IntervalNow */
PR_TicksPerSecond:
   41|  4.51k|PR_EXTERN(PRUint32) PR_TicksPerSecond(void) {
   42|  4.51k|  if (!_pr_initialized) {
  ------------------
  |  Branch (42:7): [True: 0, False: 4.51k]
  ------------------
   43|      0|    _PR_ImplicitInitialization();
   44|      0|  }
   45|  4.51k|  return _PR_MD_INTERVAL_PER_SEC();
  ------------------
  |  | 1966|  4.51k|#define _PR_MD_INTERVAL_PER_SEC _MD_INTERVAL_PER_SEC
  |  |  ------------------
  |  |  |  |  306|  4.51k|#define _MD_INTERVAL_PER_SEC        _PR_UNIX_TicksPerSecond2
  |  |  ------------------
  ------------------
   46|  4.51k|} /* PR_TicksPerSecond */
PR_MillisecondsToInterval:
   52|  4.51k|PR_IMPLEMENT(PRIntervalTime) PR_MillisecondsToInterval(PRUint32 milli) {
   53|  4.51k|  PRIntervalTime ticks;
   54|  4.51k|  PRUint64 tock, tps, msecPerSec, rounding;
   55|  4.51k|  LL_UI2L(tock, milli);
  ------------------
  |  |  150|  4.51k|#define LL_UI2L(l, ui)        ((l) = (PRInt64)(ui))
  ------------------
   56|  4.51k|  LL_I2L(msecPerSec, PR_MSEC_PER_SEC);
  ------------------
  |  |  149|  4.51k|#define LL_I2L(l, i)        ((l) = (PRInt64)(i))
  ------------------
   57|  4.51k|  LL_I2L(rounding, (PR_MSEC_PER_SEC >> 1));
  ------------------
  |  |  149|  4.51k|#define LL_I2L(l, i)        ((l) = (PRInt64)(i))
  ------------------
   58|  4.51k|  LL_I2L(tps, PR_TicksPerSecond());
  ------------------
  |  |  149|  4.51k|#define LL_I2L(l, i)        ((l) = (PRInt64)(i))
  ------------------
   59|  4.51k|  LL_MUL(tock, tock, tps);
  ------------------
  |  |  115|  4.51k|#define LL_MUL(r, a, b)        ((r) = (a) * (b))
  ------------------
   60|  4.51k|  LL_ADD(tock, tock, rounding);
  ------------------
  |  |  105|  4.51k|#define LL_ADD(r, a, b)     ((r) = (a) + (b))
  ------------------
   61|  4.51k|  LL_DIV(tock, tock, msecPerSec);
  ------------------
  |  |  116|  4.51k|#define LL_DIV(r, a, b)        ((r) = (a) / (b))
  ------------------
   62|  4.51k|  LL_L2UI(ticks, tock);
  ------------------
  |  |  145|  4.51k|#define LL_L2UI(ui, l)        ((ui) = (PRUint32)(l))
  ------------------
   63|  4.51k|  return ticks;
   64|  4.51k|} /* PR_MillisecondsToInterval */

PR_CeilingLog2:
   11|      7|PR_IMPLEMENT(PRIntn) PR_CeilingLog2(PRUint32 n) {
   12|      7|  PRIntn log2;
   13|      7|  PR_CEILING_LOG2(log2, n);
  ------------------
  |  |   72|      7|  PR_BEGIN_MACRO                       \
  |  |  ------------------
  |  |  |  |  123|      7|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|      7|    PRUint32 j_ = (PRUint32)(_n);      \
  |  |   74|      7|    (_log2) = (j_ <= 1 ? 0 : 32 - pr_bitscan_clz32(j_ - 1)); \
  |  |  ------------------
  |  |  |  |   40|      7|# define pr_bitscan_clz32(val)  __builtin_clz(val)
  |  |  ------------------
  |  |  |  Branch (74:16): [True: 0, False: 7]
  |  |  ------------------
  |  |   75|      7|  PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      7|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   14|      7|  return log2;
   15|      7|}

_PR_InitNet:
  358|      1|void _PR_InitNet(void) {
  359|      1|#if defined(XP_UNIX)
  360|       |#  ifdef HAVE_NETCONFIG
  361|       |  /*
  362|       |   * This one-liner prevents the endless re-open's and re-read's of
  363|       |   * /etc/netconfig on EACH and EVERY call to accept(), connect(), etc.
  364|       |   */
  365|       |  (void)setnetconfig();
  366|       |#  endif
  367|      1|#endif
  368|       |#if !defined(_PR_NO_DNS_LOCK)
  369|       |  _pr_dnsLock = PR_NewLock();
  370|       |#endif
  371|       |#if !defined(_PR_HAVE_GETPROTO_R)
  372|       |  _getproto_lock = PR_NewLock();
  373|       |#endif
  374|      1|#if defined(_PR_INET6) && defined(_PR_HAVE_GETHOSTBYNAME2)
  375|      1|  _pr_query_ifs_lock = PR_NewLock();
  376|      1|#endif
  377|      1|}
PR_ConvertIPv4AddrToIPv6:
 1754|  8.85k|PR_ConvertIPv4AddrToIPv6(PRUint32 v4addr, PRIPv6Addr* v6addr) {
 1755|  8.85k|  PRUint8* dstp;
 1756|  8.85k|  dstp = v6addr->pr_s6_addr;
  ------------------
  |  |  138|  8.85k|#define pr_s6_addr      _S6_un._S6_u8
  ------------------
 1757|  8.85k|  memset(dstp, 0, 10);
 1758|  8.85k|  memset(dstp + 10, 0xff, 2);
 1759|  8.85k|  memcpy(dstp + 12, (char*)&v4addr, 4);
 1760|  8.85k|}
PR_htonll:
 1779|  1.66M|PR_IMPLEMENT(PRUint64) PR_htonll(PRUint64 n) {
 1780|       |#ifdef IS_BIG_ENDIAN
 1781|       |  return n;
 1782|       |#else
 1783|  1.66M|  PRUint32 hi, lo;
 1784|  1.66M|  lo = (PRUint32)n;
 1785|  1.66M|  hi = (PRUint32)(n >> 32);
 1786|  1.66M|  hi = htonl(hi);
 1787|  1.66M|  lo = htonl(lo);
 1788|  1.66M|  return ((PRUint64)lo << 32) + (PRUint64)hi;
 1789|  1.66M|#endif
 1790|  1.66M|} /* htonll */
PR_StringToNetAddr:
 2244|  10.2k|PR_IMPLEMENT(PRStatus) PR_StringToNetAddr(const char* string, PRNetAddr* addr) {
 2245|  10.2k|  if (!_pr_initialized) {
  ------------------
  |  Branch (2245:7): [True: 0, False: 10.2k]
  ------------------
 2246|      0|    _PR_ImplicitInitialization();
 2247|      0|  }
 2248|       |
 2249|  10.2k|  if (!addr || !string || !*string) {
  ------------------
  |  Branch (2249:7): [True: 0, False: 10.2k]
  |  Branch (2249:16): [True: 0, False: 10.2k]
  |  Branch (2249:27): [True: 0, False: 10.2k]
  ------------------
 2250|      0|    PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
 2251|      0|    return PR_FAILURE;
 2252|      0|  }
 2253|       |
 2254|       |#if !defined(_PR_HAVE_GETADDRINFO)
 2255|       |  return pr_StringToNetAddrFB(string, addr);
 2256|       |#else
 2257|       |  /*
 2258|       |   * getaddrinfo with AI_NUMERICHOST is much slower than pr_inet_aton on some
 2259|       |   * platforms, such as Mac OS X (bug 404399), Linux glibc 2.10 (bug 344809),
 2260|       |   * and most likely others. So we only use it to convert literal IP addresses
 2261|       |   * that contain IPv6 scope IDs, which pr_inet_aton cannot convert.
 2262|       |   */
 2263|  10.2k|  if (!strchr(string, '%')) {
  ------------------
  |  Branch (2263:7): [True: 10.2k, False: 0]
  ------------------
 2264|  10.2k|    return pr_StringToNetAddrFB(string, addr);
 2265|  10.2k|  }
 2266|       |
 2267|      0|#  if defined(_PR_INET6_PROBE)
 2268|      0|  if (!_pr_ipv6_is_present()) {
  ------------------
  |  Branch (2268:7): [True: 0, False: 0]
  ------------------
 2269|      0|    return pr_StringToNetAddrFB(string, addr);
 2270|      0|  }
 2271|      0|#  endif
 2272|       |
 2273|      0|  return pr_StringToNetAddrGAI(string, addr);
 2274|      0|#endif
 2275|      0|}
prnetdb.c:pr_StringToNetAddrFB:
 2220|  10.2k|static PRStatus pr_StringToNetAddrFB(const char* string, PRNetAddr* addr) {
 2221|  10.2k|  PRIntn rv;
 2222|       |
 2223|  10.2k|  rv = pr_inet_aton(string, &addr->inet.ip);
 2224|  10.2k|  if (1 == rv) {
  ------------------
  |  Branch (2224:7): [True: 0, False: 10.2k]
  ------------------
 2225|      0|    addr->raw.family = AF_INET;
 2226|      0|    return PR_SUCCESS;
 2227|      0|  }
 2228|       |
 2229|  10.2k|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  10.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
 2230|       |  /* clean up after the failed call */
 2231|  10.2k|  memset(&addr->inet.ip, 0, sizeof(addr->inet.ip));
 2232|       |
 2233|  10.2k|  rv = StringToV6Addr(string, &addr->ipv6.ip);
 2234|  10.2k|  if (1 == rv) {
  ------------------
  |  Branch (2234:7): [True: 0, False: 10.2k]
  ------------------
 2235|      0|    addr->raw.family = PR_AF_INET6;
  ------------------
  |  |   27|      0|#define PR_AF_INET6 10  /* same as AF_INET6 */
  ------------------
 2236|      0|    return PR_SUCCESS;
 2237|      0|  }
 2238|       |
 2239|  10.2k|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  10.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
 2240|  10.2k|  PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
  ------------------
  |  |   55|  10.2k|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
 2241|  10.2k|  return PR_FAILURE;
 2242|  10.2k|}
prnetdb.c:StringToV6Addr:
 1486|  10.2k|static int StringToV6Addr(const char* string, PRIPv6Addr* addr) {
 1487|  10.2k|  const unsigned char* s = (const unsigned char*)string;
 1488|  10.2k|  int section = 0;       /* index of the current section (a 16-bit
 1489|       |                          * piece of the address */
 1490|  10.2k|  int double_colon = -1; /* index of the section after the first
 1491|       |                          * 16-bit group of zeros represented by
 1492|       |                          * the double colon */
 1493|  10.2k|  unsigned int val;
 1494|  10.2k|  int len;
 1495|       |
 1496|       |  /* Handle initial (double) colon */
 1497|  10.2k|  if (*s == ':') {
  ------------------
  |  Branch (1497:7): [True: 0, False: 10.2k]
  ------------------
 1498|      0|    if (s[1] != ':') {
  ------------------
  |  Branch (1498:9): [True: 0, False: 0]
  ------------------
 1499|      0|      return 0;
 1500|      0|    }
 1501|      0|    s += 2;
 1502|      0|    addr->pr_s6_addr16[0] = 0;
  ------------------
  |  |  139|      0|#define pr_s6_addr16    _S6_un._S6_u16
  ------------------
 1503|      0|    section = double_colon = 1;
 1504|      0|  }
 1505|       |
 1506|  10.2k|  while (*s) {
  ------------------
  |  Branch (1506:10): [True: 10.2k, False: 0]
  ------------------
 1507|  10.2k|    if (section == 8) {
  ------------------
  |  Branch (1507:9): [True: 0, False: 10.2k]
  ------------------
 1508|      0|      return 0; /* too long */
 1509|      0|    }
 1510|  10.2k|    if (*s == ':') {
  ------------------
  |  Branch (1510:9): [True: 0, False: 10.2k]
  ------------------
 1511|      0|      if (double_colon != -1) {
  ------------------
  |  Branch (1511:11): [True: 0, False: 0]
  ------------------
 1512|      0|        return 0; /* two double colons */
 1513|      0|      }
 1514|      0|      addr->pr_s6_addr16[section++] = 0;
  ------------------
  |  |  139|      0|#define pr_s6_addr16    _S6_un._S6_u16
  ------------------
 1515|      0|      double_colon = section;
 1516|      0|      s++;
 1517|      0|      continue;
 1518|      0|    }
 1519|  20.4k|    for (len = val = 0; len < 4 && index_hex[*s] != XX; len++) {
  ------------------
  |  | 1463|  20.4k|#define XX 127
  ------------------
  |  Branch (1519:25): [True: 20.4k, False: 0]
  |  Branch (1519:36): [True: 10.2k, False: 10.2k]
  ------------------
 1520|  10.2k|      val = (val << 4) + index_hex[*s++];
 1521|  10.2k|    }
 1522|  10.2k|    if (*s == '.') {
  ------------------
  |  Branch (1522:9): [True: 0, False: 10.2k]
  ------------------
 1523|      0|      if (len == 0) {
  ------------------
  |  Branch (1523:11): [True: 0, False: 0]
  ------------------
 1524|      0|        return 0; /* nothing between : and . */
 1525|      0|      }
 1526|      0|      break;
 1527|      0|    }
 1528|  10.2k|    if (*s == ':') {
  ------------------
  |  Branch (1528:9): [True: 0, False: 10.2k]
  ------------------
 1529|      0|      s++;
 1530|      0|      if (!*s) {
  ------------------
  |  Branch (1530:11): [True: 0, False: 0]
  ------------------
 1531|      0|        return 0; /* cannot end with single colon */
 1532|      0|      }
 1533|  10.2k|    } else if (*s) {
  ------------------
  |  Branch (1533:16): [True: 10.2k, False: 0]
  ------------------
 1534|  10.2k|      return 0; /* bad character */
 1535|  10.2k|    }
 1536|      0|    addr->pr_s6_addr16[section++] = htons((unsigned short)val);
  ------------------
  |  |  139|      0|#define pr_s6_addr16    _S6_un._S6_u16
  ------------------
 1537|      0|  }
 1538|       |
 1539|      0|  if (*s == '.') {
  ------------------
  |  Branch (1539:7): [True: 0, False: 0]
  ------------------
 1540|       |    /* Have a trailing v4 format address */
 1541|      0|    if (section > 6) {
  ------------------
  |  Branch (1541:9): [True: 0, False: 0]
  ------------------
 1542|      0|      return 0; /* not enough room */
 1543|      0|    }
 1544|       |
 1545|       |    /*
 1546|       |     * The number before the '.' is decimal, but we parsed it
 1547|       |     * as hex.  That means it is in BCD.  Check it for validity
 1548|       |     * and convert it to binary.
 1549|       |     */
 1550|      0|    if (val > 0x0255 || (val & 0xf0) > 0x90 || (val & 0xf) > 9) {
  ------------------
  |  Branch (1550:9): [True: 0, False: 0]
  |  Branch (1550:25): [True: 0, False: 0]
  |  Branch (1550:48): [True: 0, False: 0]
  ------------------
 1551|      0|      return 0;
 1552|      0|    }
 1553|      0|    val = (val >> 8) * 100 + ((val >> 4) & 0xf) * 10 + (val & 0xf);
 1554|      0|    addr->pr_s6_addr[2 * section] = val;
  ------------------
  |  |  138|      0|#define pr_s6_addr      _S6_un._S6_u8
  ------------------
 1555|       |
 1556|      0|    s++;
 1557|      0|    val = index_hex[*s++];
 1558|      0|    if (val > 9) {
  ------------------
  |  Branch (1558:9): [True: 0, False: 0]
  ------------------
 1559|      0|      return 0;
 1560|      0|    }
 1561|      0|    while (*s >= '0' && *s <= '9') {
  ------------------
  |  Branch (1561:12): [True: 0, False: 0]
  |  Branch (1561:25): [True: 0, False: 0]
  ------------------
 1562|      0|      val = val * 10 + *s++ - '0';
 1563|      0|      if (val > 255) {
  ------------------
  |  Branch (1563:11): [True: 0, False: 0]
  ------------------
 1564|      0|        return 0;
 1565|      0|      }
 1566|      0|    }
 1567|      0|    if (*s != '.') {
  ------------------
  |  Branch (1567:9): [True: 0, False: 0]
  ------------------
 1568|      0|      return 0; /* must have exactly 4 decimal numbers */
 1569|      0|    }
 1570|      0|    addr->pr_s6_addr[2 * section + 1] = val;
  ------------------
  |  |  138|      0|#define pr_s6_addr      _S6_un._S6_u8
  ------------------
 1571|      0|    section++;
 1572|       |
 1573|      0|    s++;
 1574|      0|    val = index_hex[*s++];
 1575|      0|    if (val > 9) {
  ------------------
  |  Branch (1575:9): [True: 0, False: 0]
  ------------------
 1576|      0|      return 0;
 1577|      0|    }
 1578|      0|    while (*s >= '0' && *s <= '9') {
  ------------------
  |  Branch (1578:12): [True: 0, False: 0]
  |  Branch (1578:25): [True: 0, False: 0]
  ------------------
 1579|      0|      val = val * 10 + *s++ - '0';
 1580|      0|      if (val > 255) {
  ------------------
  |  Branch (1580:11): [True: 0, False: 0]
  ------------------
 1581|      0|        return 0;
 1582|      0|      }
 1583|      0|    }
 1584|      0|    if (*s != '.') {
  ------------------
  |  Branch (1584:9): [True: 0, False: 0]
  ------------------
 1585|      0|      return 0; /* must have exactly 4 decimal numbers */
 1586|      0|    }
 1587|      0|    addr->pr_s6_addr[2 * section] = val;
  ------------------
  |  |  138|      0|#define pr_s6_addr      _S6_un._S6_u8
  ------------------
 1588|       |
 1589|      0|    s++;
 1590|      0|    val = index_hex[*s++];
 1591|      0|    if (val > 9) {
  ------------------
  |  Branch (1591:9): [True: 0, False: 0]
  ------------------
 1592|      0|      return 0;
 1593|      0|    }
 1594|      0|    while (*s >= '0' && *s <= '9') {
  ------------------
  |  Branch (1594:12): [True: 0, False: 0]
  |  Branch (1594:25): [True: 0, False: 0]
  ------------------
 1595|      0|      val = val * 10 + *s++ - '0';
 1596|      0|      if (val > 255) {
  ------------------
  |  Branch (1596:11): [True: 0, False: 0]
  ------------------
 1597|      0|        return 0;
 1598|      0|      }
 1599|      0|    }
 1600|      0|    if (*s) {
  ------------------
  |  Branch (1600:9): [True: 0, False: 0]
  ------------------
 1601|      0|      return 0; /* must have exactly 4 decimal numbers */
 1602|      0|    }
 1603|      0|    addr->pr_s6_addr[2 * section + 1] = val;
  ------------------
  |  |  138|      0|#define pr_s6_addr      _S6_un._S6_u8
  ------------------
 1604|      0|    section++;
 1605|      0|  }
 1606|       |
 1607|      0|  if (double_colon != -1) {
  ------------------
  |  Branch (1607:7): [True: 0, False: 0]
  ------------------
 1608|       |    /* Stretch the double colon */
 1609|      0|    int tosection;
 1610|      0|    int ncopy = section - double_colon;
 1611|      0|    for (tosection = 7; ncopy--; tosection--) {
  ------------------
  |  Branch (1611:25): [True: 0, False: 0]
  ------------------
 1612|      0|      addr->pr_s6_addr16[tosection] = addr->pr_s6_addr16[double_colon + ncopy];
  ------------------
  |  |  139|      0|#define pr_s6_addr16    _S6_un._S6_u16
  ------------------
                    addr->pr_s6_addr16[tosection] = addr->pr_s6_addr16[double_colon + ncopy];
  ------------------
  |  |  139|      0|#define pr_s6_addr16    _S6_un._S6_u16
  ------------------
 1613|      0|    }
 1614|      0|    while (tosection >= double_colon) {
  ------------------
  |  Branch (1614:12): [True: 0, False: 0]
  ------------------
 1615|      0|      addr->pr_s6_addr16[tosection--] = 0;
  ------------------
  |  |  139|      0|#define pr_s6_addr16    _S6_un._S6_u16
  ------------------
 1616|      0|    }
 1617|      0|  } else if (section != 8) {
  ------------------
  |  Branch (1617:14): [True: 0, False: 0]
  ------------------
 1618|      0|    return 0; /* too short */
 1619|      0|  }
 1620|      0|  return 1;
 1621|      0|}

_PR_InitTime:
  538|      1|void _PR_InitTime(void) {
  539|       |#ifdef HAVE_LOCALTIME_MONITOR
  540|       |  monitor = PR_NewLock();
  541|       |#endif
  542|       |#ifdef WINCE
  543|       |  _MD_InitTime();
  544|       |#endif
  545|      1|}

_PR_InitIO:
 1117|      1|void _PR_InitIO(void) {
 1118|      1|#  if defined(DEBUG)
 1119|      1|  memset(&pt_debug, 0, sizeof(PTDebug));
 1120|      1|  pt_debug.timeStarted = PR_Now();
 1121|      1|#  endif
 1122|       |
 1123|      1|  _pr_flock_lock = PR_NewLock();
 1124|      1|  PR_ASSERT(NULL != _pr_flock_lock);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 1125|      1|  _pr_flock_cv = PR_NewCondVar(_pr_flock_lock);
 1126|      1|  PR_ASSERT(NULL != _pr_flock_cv);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 1127|      1|  _pr_rename_lock = PR_NewLock();
 1128|      1|  PR_ASSERT(NULL != _pr_rename_lock);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 1129|       |
 1130|      1|  _PR_InitFdCache(); /* do that */
 1131|       |
 1132|      1|  _pr_stdin = pt_SetMethods(0, PR_DESC_FILE, PR_FALSE, PR_TRUE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
                _pr_stdin = pt_SetMethods(0, PR_DESC_FILE, PR_FALSE, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 1133|      1|  _pr_stdout = pt_SetMethods(1, PR_DESC_FILE, PR_FALSE, PR_TRUE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
                _pr_stdout = pt_SetMethods(1, PR_DESC_FILE, PR_FALSE, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 1134|      1|  _pr_stderr = pt_SetMethods(2, PR_DESC_FILE, PR_FALSE, PR_TRUE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
                _pr_stderr = pt_SetMethods(2, PR_DESC_FILE, PR_FALSE, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 1135|      1|  PR_ASSERT(_pr_stdin && _pr_stdout && _pr_stderr);
  ------------------
  |  |  208|      4|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 1136|       |
 1137|       |#  ifdef _PR_IPV6_V6ONLY_PROBE
 1138|       |  /* In Mac OS X v10.3 Panther Beta the IPV6_V6ONLY socket option
 1139|       |   * is turned on by default, contrary to what RFC 3493, Section
 1140|       |   * 5.3 says.  So we have to turn it off.  Find out whether we
 1141|       |   * are running on such a system.
 1142|       |   */
 1143|       |  {
 1144|       |    int osfd;
 1145|       |    osfd = socket(AF_INET6, SOCK_STREAM, 0);
 1146|       |    if (osfd != -1) {
 1147|       |      int on;
 1148|       |      socklen_t optlen = sizeof(on);
 1149|       |      if (getsockopt(osfd, IPPROTO_IPV6, IPV6_V6ONLY, &on, &optlen) == 0) {
 1150|       |        _pr_ipv6_v6only_on_by_default = on;
 1151|       |      }
 1152|       |      close(osfd);
 1153|       |    }
 1154|       |  }
 1155|       |#  endif
 1156|      1|} /* _PR_InitIO */
PR_GetFileMethods:
 3367|      3|PR_IMPLEMENT(const PRIOMethods*) PR_GetFileMethods(void) {
 3368|      3|  return &_pr_file_methods;
 3369|      3|} /* PR_GetFileMethods */
ptio.c:pt_SetMethods:
 3319|      3|                                 PRBool isAcceptedSocket, PRBool imported) {
 3320|      3|  PRFileDesc* fd = _PR_Getfd();
 3321|       |
 3322|      3|  if (fd == NULL) {
  ------------------
  |  Branch (3322:7): [True: 0, False: 3]
  ------------------
 3323|      0|    PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
  ------------------
  |  |   16|      0|#define PR_OUT_OF_MEMORY_ERROR                   (-6000L)
  ------------------
 3324|      3|  } else {
 3325|      3|    fd->secret->md.osfd = osfd;
 3326|      3|    fd->secret->state = _PR_FILEDESC_OPEN;
  ------------------
  |  | 1702|      3|#define _PR_FILEDESC_OPEN       0xaaaaaaaa    /* 1010101... */
  ------------------
 3327|      3|    if (imported) {
  ------------------
  |  Branch (3327:9): [True: 3, False: 0]
  ------------------
 3328|      3|      fd->secret->inheritable = _PR_TRI_UNKNOWN;
 3329|      3|    } else {
 3330|       |      /* By default, a Unix fd is not closed on exec. */
 3331|      0|#  ifdef DEBUG
 3332|      0|      PRIntn flags;
 3333|      0|      flags = fcntl(osfd, F_GETFD, 0);
 3334|      0|      PR_ASSERT(0 == flags);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3335|      0|#  endif
 3336|      0|      fd->secret->inheritable = _PR_TRI_TRUE;
 3337|      0|    }
 3338|      3|    switch (type) {
 3339|      3|      case PR_DESC_FILE:
  ------------------
  |  Branch (3339:7): [True: 3, False: 0]
  ------------------
 3340|      3|        fd->methods = PR_GetFileMethods();
 3341|      3|        break;
 3342|      0|      case PR_DESC_SOCKET_TCP:
  ------------------
  |  Branch (3342:7): [True: 0, False: 3]
  ------------------
 3343|      0|        fd->methods = PR_GetTCPMethods();
 3344|       |#  ifdef _PR_ACCEPT_INHERIT_NONBLOCK
 3345|       |        if (!isAcceptedSocket) {
 3346|       |          pt_MakeSocketNonblock(osfd);
 3347|       |        }
 3348|       |#  else
 3349|      0|        pt_MakeSocketNonblock(osfd);
  ------------------
  |  | 3315|      0|#    define pt_MakeSocketNonblock pt_MakeFdNonblock
  ------------------
 3350|      0|#  endif
 3351|      0|        break;
 3352|      0|      case PR_DESC_SOCKET_UDP:
  ------------------
  |  Branch (3352:7): [True: 0, False: 3]
  ------------------
 3353|      0|        fd->methods = PR_GetUDPMethods();
 3354|      0|        pt_MakeFdNonblock(osfd);
 3355|      0|        break;
 3356|      0|      case PR_DESC_PIPE:
  ------------------
  |  Branch (3356:7): [True: 0, False: 3]
  ------------------
 3357|      0|        fd->methods = PR_GetPipeMethods();
 3358|      0|        pt_MakeFdNonblock(osfd);
 3359|      0|        break;
 3360|      0|      default:
  ------------------
  |  Branch (3360:7): [True: 0, False: 3]
  ------------------
 3361|      0|        break;
 3362|      3|    }
 3363|      3|  }
 3364|      3|  return fd;
 3365|      3|} /* pt_SetMethods */

_PR_InitCPUs:
   22|      1|void _PR_InitCPUs(void) { PT_LOG("_PR_InitCPUs") }
_PR_InitStacks:
   23|      1|void _PR_InitStacks(void){PT_LOG("_PR_InitStacks")}

_PR_InitLocks:
   45|      1|void _PR_InitLocks(void) {
   46|      1|  int rv;
   47|      1|  rv = _PT_PTHREAD_MUTEXATTR_INIT(&_pt_mattr);
  ------------------
  |  |   17|      1|#define _PT_PTHREAD_MUTEXATTR_INIT        pthread_mutexattr_init
  ------------------
   48|      1|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   49|       |
   50|      1|#  if (defined(LINUX) &&                                               \
   51|      1|       (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2))) || \
   52|      1|      (defined(FREEBSD) && __FreeBSD_version > 700055)
   53|      1|  rv = pthread_mutexattr_settype(&_pt_mattr, PTHREAD_MUTEX_ADAPTIVE_NP);
   54|      1|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   55|      1|#  endif
   56|       |
   57|      1|  rv = _PT_PTHREAD_CONDATTR_INIT(&_pt_cvar_attr);
  ------------------
  |  |   30|      1|#define _PT_PTHREAD_CONDATTR_INIT         pthread_condattr_init
  ------------------
   58|      1|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   59|      1|}
PR_NewLock:
  121|   369k|PR_IMPLEMENT(PRLock*) PR_NewLock(void) {
  122|   369k|  PRIntn rv;
  123|   369k|  PRLock* lock;
  124|       |
  125|   369k|  if (!_pr_initialized) {
  ------------------
  |  Branch (125:7): [True: 0, False: 369k]
  ------------------
  126|      0|    _PR_ImplicitInitialization();
  127|      0|  }
  128|       |
  129|   369k|  lock = PR_NEWZAP(PRLock);
  ------------------
  |  |   99|   369k|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  130|   369k|  if (lock != NULL) {
  ------------------
  |  Branch (130:7): [True: 369k, False: 0]
  ------------------
  131|   369k|    rv = _PT_PTHREAD_MUTEX_INIT(lock->mutex, _pt_mattr);
  ------------------
  |  |   19|   369k|#define _PT_PTHREAD_MUTEX_INIT(m, a)      pthread_mutex_init(&(m), &(a))
  ------------------
  132|   369k|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|   369k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 369k, False: 0]
  |  |  ------------------
  ------------------
  133|   369k|  }
  134|   369k|#  if defined(DEBUG)
  135|   369k|  pt_debug.locks_created += 1;
  136|   369k|#  endif
  137|   369k|  return lock;
  138|   369k|} /* PR_NewLock */
PR_DestroyLock:
  140|   369k|PR_IMPLEMENT(void) PR_DestroyLock(PRLock* lock) {
  141|   369k|  PRIntn rv;
  142|   369k|  PR_ASSERT(NULL != lock);
  ------------------
  |  |  208|   369k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 369k, False: 0]
  |  |  ------------------
  ------------------
  143|   369k|  PR_ASSERT(PR_FALSE == lock->locked);
  ------------------
  |  |  208|   369k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 369k, False: 0]
  |  |  ------------------
  ------------------
  144|   369k|  PR_ASSERT(0 == lock->notified.length);
  ------------------
  |  |  208|   369k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 369k, False: 0]
  |  |  ------------------
  ------------------
  145|   369k|  PR_ASSERT(NULL == lock->notified.link);
  ------------------
  |  |  208|   369k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 369k, False: 0]
  |  |  ------------------
  ------------------
  146|   369k|  rv = pthread_mutex_destroy(&lock->mutex);
  147|   369k|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|   369k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 369k, False: 0]
  |  |  ------------------
  ------------------
  148|   369k|#  if defined(DEBUG)
  149|   369k|  memset(lock, 0xaf, sizeof(PRLock));
  150|   369k|  pt_debug.locks_destroyed += 1;
  151|   369k|#  endif
  152|   369k|  PR_Free(lock);
  153|   369k|} /* PR_DestroyLock */
PR_Lock:
  155|  11.5M|PR_IMPLEMENT(void) PR_Lock(PRLock* lock) {
  156|       |  /* Nb: PR_Lock must not call PR_GetCurrentThread to access the |id| or
  157|       |   * |tid| field of the current thread's PRThread structure because
  158|       |   * _pt_root calls PR_Lock before setting thred->id and thred->tid. */
  159|  11.5M|  PRIntn rv;
  160|  11.5M|  PR_ASSERT(lock != NULL);
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  161|  11.5M|  rv = pthread_mutex_lock(&lock->mutex);
  162|  11.5M|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  163|  11.5M|  PR_ASSERT(0 == lock->notified.length);
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  164|  11.5M|  PR_ASSERT(NULL == lock->notified.link);
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  165|  11.5M|  PR_ASSERT(PR_FALSE == lock->locked);
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  166|       |  /* Nb: the order of the next two statements is not critical to
  167|       |   * the correctness of PR_AssertCurrentThreadOwnsLock(), but
  168|       |   * this particular order makes the assertion more likely to
  169|       |   * catch errors. */
  170|  11.5M|  lock->owner = pthread_self();
  171|  11.5M|  lock->locked = PR_TRUE;
  ------------------
  |  |  437|  11.5M|#define PR_TRUE 1
  ------------------
  172|  11.5M|#  if defined(DEBUG)
  173|  11.5M|  pt_debug.locks_acquired += 1;
  174|  11.5M|#  endif
  175|  11.5M|} /* PR_Lock */
PR_Unlock:
  177|  11.5M|PR_IMPLEMENT(PRStatus) PR_Unlock(PRLock* lock) {
  178|  11.5M|  pthread_t self = pthread_self();
  179|  11.5M|  PRIntn rv;
  180|       |
  181|  11.5M|  PR_ASSERT(lock != NULL);
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  182|  11.5M|  PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(lock->mutex));
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  183|  11.5M|  PR_ASSERT(PR_TRUE == lock->locked);
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  184|  11.5M|  PR_ASSERT(pthread_equal(lock->owner, self));
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  185|       |
  186|  11.5M|  if (!lock->locked || !pthread_equal(lock->owner, self)) {
  ------------------
  |  Branch (186:7): [True: 0, False: 11.5M]
  |  Branch (186:24): [True: 0, False: 11.5M]
  ------------------
  187|      0|    return PR_FAILURE;
  188|      0|  }
  189|       |
  190|  11.5M|  lock->locked = PR_FALSE;
  ------------------
  |  |  438|  11.5M|#define PR_FALSE 0
  ------------------
  191|  11.5M|  if (0 == lock->notified.length) /* shortcut */
  ------------------
  |  Branch (191:7): [True: 11.5M, False: 37]
  ------------------
  192|  11.5M|  {
  193|  11.5M|    rv = pthread_mutex_unlock(&lock->mutex);
  194|  11.5M|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  11.5M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 11.5M, False: 0]
  |  |  ------------------
  ------------------
  195|  11.5M|  } else {
  196|     37|    pt_PostNotifies(lock, PR_TRUE);
  ------------------
  |  |  437|     37|#define PR_TRUE 1
  ------------------
  197|     37|  }
  198|       |
  199|  11.5M|#  if defined(DEBUG)
  200|  11.5M|  pt_debug.locks_released += 1;
  201|  11.5M|#  endif
  202|  11.5M|  return PR_SUCCESS;
  203|  11.5M|} /* PR_Unlock */
PR_NewCondVar:
  296|  17.8k|PR_IMPLEMENT(PRCondVar*) PR_NewCondVar(PRLock* lock) {
  297|  17.8k|  PRCondVar* cv = PR_NEW(PRCondVar);
  ------------------
  |  |   65|  17.8k|#define PR_NEW(_struct) ((_struct *) PR_MALLOC(sizeof(_struct)))
  |  |  ------------------
  |  |  |  |   55|  17.8k|#define PR_MALLOC(_bytes) (PR_Malloc((_bytes)))
  |  |  ------------------
  ------------------
  298|  17.8k|  PR_ASSERT(lock != NULL);
  ------------------
  |  |  208|  17.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 17.8k, False: 0]
  |  |  ------------------
  ------------------
  299|  17.8k|  if (cv != NULL) {
  ------------------
  |  Branch (299:7): [True: 17.8k, False: 0]
  ------------------
  300|  17.8k|    int rv = _PT_PTHREAD_COND_INIT(cv->cv, _pt_cvar_attr);
  ------------------
  |  |   33|  17.8k|#define _PT_PTHREAD_COND_INIT(m, a)       pthread_cond_init(&(m), &(a))
  ------------------
  301|  17.8k|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  17.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 17.8k, False: 0]
  |  |  ------------------
  ------------------
  302|  17.8k|    if (0 == rv) {
  ------------------
  |  Branch (302:9): [True: 17.8k, False: 0]
  ------------------
  303|  17.8k|      cv->lock = lock;
  304|  17.8k|      cv->notify_pending = 0;
  305|  17.8k|#  if defined(DEBUG)
  306|  17.8k|      pt_debug.cvars_created += 1;
  307|  17.8k|#  endif
  308|  17.8k|    } else {
  309|      0|      PR_DELETE(cv);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  310|      0|      cv = NULL;
  311|      0|    }
  312|  17.8k|  }
  313|  17.8k|  return cv;
  314|  17.8k|} /* PR_NewCondVar */
PR_DestroyCondVar:
  316|  17.8k|PR_IMPLEMENT(void) PR_DestroyCondVar(PRCondVar* cvar) {
  317|  17.8k|  if (0 > PR_ATOMIC_DECREMENT(&cvar->notify_pending)) {
  ------------------
  |  |  123|  17.8k|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (317:7): [True: 17.8k, False: 0]
  ------------------
  318|  17.8k|    PRIntn rv = pthread_cond_destroy(&cvar->cv);
  319|  17.8k|#  if defined(DEBUG)
  320|  17.8k|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  17.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 17.8k, False: 0]
  |  |  ------------------
  ------------------
  321|  17.8k|    memset(cvar, 0xaf, sizeof(PRCondVar));
  322|  17.8k|    pt_debug.cvars_destroyed += 1;
  323|       |#  else
  324|       |    (void)rv;
  325|       |#  endif
  326|  17.8k|    PR_Free(cvar);
  327|  17.8k|  }
  328|  17.8k|} /* PR_DestroyCondVar */
PR_NotifyAllCondVar:
  401|     37|PR_IMPLEMENT(PRStatus) PR_NotifyAllCondVar(PRCondVar* cvar) {
  402|     37|  PR_ASSERT(cvar != NULL);
  ------------------
  |  |  208|     37|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 37, False: 0]
  |  |  ------------------
  ------------------
  403|     37|  pt_PostNotifyToCvar(cvar, PR_TRUE);
  ------------------
  |  |  437|     37|#define PR_TRUE 1
  ------------------
  404|     37|  return PR_SUCCESS;
  405|     37|} /* PR_NotifyAllCondVar */
PR_NewMonitor:
  452|  40.8k|PR_IMPLEMENT(PRMonitor*) PR_NewMonitor(void) {
  453|  40.8k|  PRMonitor* mon;
  454|  40.8k|  int rv;
  455|       |
  456|  40.8k|  if (!_pr_initialized) {
  ------------------
  |  Branch (456:7): [True: 0, False: 40.8k]
  ------------------
  457|      0|    _PR_ImplicitInitialization();
  458|      0|  }
  459|       |
  460|  40.8k|  mon = PR_NEWZAP(PRMonitor);
  ------------------
  |  |   99|  40.8k|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  461|  40.8k|  if (mon == NULL) {
  ------------------
  |  Branch (461:7): [True: 0, False: 40.8k]
  ------------------
  462|      0|    PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
  ------------------
  |  |   16|      0|#define PR_OUT_OF_MEMORY_ERROR                   (-6000L)
  ------------------
  463|      0|    return NULL;
  464|      0|  }
  465|       |
  466|  40.8k|  rv = _PT_PTHREAD_MUTEX_INIT(mon->lock, _pt_mattr);
  ------------------
  |  |   19|  40.8k|#define _PT_PTHREAD_MUTEX_INIT(m, a)      pthread_mutex_init(&(m), &(a))
  ------------------
  467|  40.8k|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  40.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 40.8k, False: 0]
  |  |  ------------------
  ------------------
  468|  40.8k|  if (0 != rv) {
  ------------------
  |  Branch (468:7): [True: 0, False: 40.8k]
  ------------------
  469|      0|    goto error1;
  470|      0|  }
  471|       |
  472|  40.8k|  _PT_PTHREAD_INVALIDATE_THR_HANDLE(mon->owner);
  ------------------
  |  |   70|  40.8k|#define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t)  (t) = 0
  ------------------
  473|       |
  474|  40.8k|  rv = _PT_PTHREAD_COND_INIT(mon->entryCV, _pt_cvar_attr);
  ------------------
  |  |   33|  40.8k|#define _PT_PTHREAD_COND_INIT(m, a)       pthread_cond_init(&(m), &(a))
  ------------------
  475|  40.8k|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  40.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 40.8k, False: 0]
  |  |  ------------------
  ------------------
  476|  40.8k|  if (0 != rv) {
  ------------------
  |  Branch (476:7): [True: 0, False: 40.8k]
  ------------------
  477|      0|    goto error2;
  478|      0|  }
  479|       |
  480|  40.8k|  rv = _PT_PTHREAD_COND_INIT(mon->waitCV, _pt_cvar_attr);
  ------------------
  |  |   33|  40.8k|#define _PT_PTHREAD_COND_INIT(m, a)       pthread_cond_init(&(m), &(a))
  ------------------
  481|  40.8k|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  40.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 40.8k, False: 0]
  |  |  ------------------
  ------------------
  482|  40.8k|  if (0 != rv) {
  ------------------
  |  Branch (482:7): [True: 0, False: 40.8k]
  ------------------
  483|      0|    goto error3;
  484|      0|  }
  485|       |
  486|  40.8k|  mon->notifyTimes = 0;
  487|  40.8k|  mon->entryCount = 0;
  488|  40.8k|  mon->refCount = 1;
  489|  40.8k|  mon->name = NULL;
  490|  40.8k|  return mon;
  491|       |
  492|      0|error3:
  493|      0|  pthread_cond_destroy(&mon->entryCV);
  494|      0|error2:
  495|      0|  pthread_mutex_destroy(&mon->lock);
  496|      0|error1:
  497|      0|  PR_Free(mon);
  498|      0|  _PR_MD_MAP_DEFAULT_ERROR(rv);
  ------------------
  |  |   15|      0|#define _PR_MD_MAP_DEFAULT_ERROR    _MD_unix_map_default_error
  ------------------
  499|      0|  return NULL;
  500|      0|} /* PR_NewMonitor */
PR_NewNamedMonitor:
  502|      1|PR_IMPLEMENT(PRMonitor*) PR_NewNamedMonitor(const char* name) {
  503|      1|  PRMonitor* mon = PR_NewMonitor();
  504|      1|  if (mon) {
  ------------------
  |  Branch (504:7): [True: 1, False: 0]
  ------------------
  505|      1|    mon->name = name;
  506|      1|  }
  507|      1|  return mon;
  508|      1|}
PR_DestroyMonitor:
  510|  2.58M|PR_IMPLEMENT(void) PR_DestroyMonitor(PRMonitor* mon) {
  511|  2.58M|  int rv;
  512|       |
  513|  2.58M|  PR_ASSERT(mon != NULL);
  ------------------
  |  |  208|  2.58M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.58M, False: 0]
  |  |  ------------------
  ------------------
  514|  2.58M|  if (PR_ATOMIC_DECREMENT(&mon->refCount) == 0) {
  ------------------
  |  |  123|  2.58M|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (514:7): [True: 40.8k, False: 2.54M]
  ------------------
  515|  40.8k|    rv = pthread_cond_destroy(&mon->waitCV);
  516|  40.8k|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  40.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 40.8k, False: 0]
  |  |  ------------------
  ------------------
  517|  40.8k|    rv = pthread_cond_destroy(&mon->entryCV);
  518|  40.8k|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  40.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 40.8k, False: 0]
  |  |  ------------------
  ------------------
  519|  40.8k|    rv = pthread_mutex_destroy(&mon->lock);
  520|  40.8k|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  40.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 40.8k, False: 0]
  |  |  ------------------
  ------------------
  521|  40.8k|#  if defined(DEBUG)
  522|  40.8k|    memset(mon, 0xaf, sizeof(PRMonitor));
  523|  40.8k|#  endif
  524|  40.8k|    PR_Free(mon);
  525|  40.8k|  }
  526|  2.58M|} /* PR_DestroyMonitor */
PR_GetMonitorEntryCount:
  531|  5.23M|PR_IMPLEMENT(PRIntn) PR_GetMonitorEntryCount(PRMonitor* mon) {
  532|  5.23M|  pthread_t self = pthread_self();
  533|  5.23M|  PRIntn rv;
  534|  5.23M|  PRIntn count = 0;
  535|       |
  536|  5.23M|  rv = pthread_mutex_lock(&mon->lock);
  537|  5.23M|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  5.23M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 5.23M, False: 0]
  |  |  ------------------
  ------------------
  538|  5.23M|  if (pthread_equal(mon->owner, self)) {
  ------------------
  |  Branch (538:7): [True: 2.47M, False: 2.75M]
  ------------------
  539|  2.47M|    count = mon->entryCount;
  540|  2.47M|  }
  541|  5.23M|  rv = pthread_mutex_unlock(&mon->lock);
  542|  5.23M|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  5.23M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 5.23M, False: 0]
  |  |  ------------------
  ------------------
  543|  5.23M|  return count;
  544|  5.23M|}
PR_EnterMonitor:
  558|  2.55M|PR_IMPLEMENT(void) PR_EnterMonitor(PRMonitor* mon) {
  559|  2.55M|  pthread_t self = pthread_self();
  560|  2.55M|  PRIntn rv;
  561|       |
  562|  2.55M|  PR_ASSERT(mon != NULL);
  ------------------
  |  |  208|  2.55M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.55M, False: 0]
  |  |  ------------------
  ------------------
  563|  2.55M|  rv = pthread_mutex_lock(&mon->lock);
  564|  2.55M|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  2.55M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.55M, False: 0]
  |  |  ------------------
  ------------------
  565|  2.55M|  if (mon->entryCount != 0) {
  ------------------
  |  Branch (565:7): [True: 15.8k, False: 2.54M]
  ------------------
  566|  15.8k|    if (pthread_equal(mon->owner, self)) {
  ------------------
  |  Branch (566:9): [True: 15.8k, False: 0]
  ------------------
  567|  15.8k|      goto done;
  568|  15.8k|    }
  569|      0|    while (mon->entryCount != 0) {
  ------------------
  |  Branch (569:12): [True: 0, False: 0]
  ------------------
  570|      0|      rv = pthread_cond_wait(&mon->entryCV, &mon->lock);
  571|      0|      PR_ASSERT(0 == rv);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  572|      0|    }
  573|      0|  }
  574|       |  /* and now I have the monitor */
  575|  2.54M|  PR_ASSERT(0 == mon->notifyTimes);
  ------------------
  |  |  208|  2.54M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.54M, False: 0]
  |  |  ------------------
  ------------------
  576|  2.54M|  PR_ASSERT(_PT_PTHREAD_THR_HANDLE_IS_INVALID(mon->owner));
  ------------------
  |  |  208|  2.54M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.54M, False: 0]
  |  |  ------------------
  ------------------
  577|  2.54M|  _PT_PTHREAD_COPY_THR_HANDLE(self, mon->owner);
  ------------------
  |  |   72|  2.54M|#define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
  ------------------
  578|       |
  579|  2.55M|done:
  580|  2.55M|  mon->entryCount += 1;
  581|  2.55M|  rv = pthread_mutex_unlock(&mon->lock);
  582|  2.55M|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  2.55M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.55M, False: 0]
  |  |  ------------------
  ------------------
  583|  2.55M|} /* PR_EnterMonitor */
PR_ExitMonitor:
  585|  2.55M|PR_IMPLEMENT(PRStatus) PR_ExitMonitor(PRMonitor* mon) {
  586|  2.55M|  pthread_t self = pthread_self();
  587|  2.55M|  PRIntn rv;
  588|  2.55M|  PRBool notifyEntryWaiter = PR_FALSE;
  ------------------
  |  |  438|  2.55M|#define PR_FALSE 0
  ------------------
  589|  2.55M|  PRIntn notifyTimes = 0;
  590|       |
  591|  2.55M|  PR_ASSERT(mon != NULL);
  ------------------
  |  |  208|  2.55M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.55M, False: 0]
  |  |  ------------------
  ------------------
  592|  2.55M|  rv = pthread_mutex_lock(&mon->lock);
  593|  2.55M|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  2.55M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.55M, False: 0]
  |  |  ------------------
  ------------------
  594|       |  /* the entries should be > 0 and we'd better be the owner */
  595|  2.55M|  PR_ASSERT(mon->entryCount > 0);
  ------------------
  |  |  208|  2.55M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.55M, False: 0]
  |  |  ------------------
  ------------------
  596|  2.55M|  PR_ASSERT(pthread_equal(mon->owner, self));
  ------------------
  |  |  208|  2.55M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.55M, False: 0]
  |  |  ------------------
  ------------------
  597|  2.55M|  if (mon->entryCount == 0 || !pthread_equal(mon->owner, self)) {
  ------------------
  |  Branch (597:7): [True: 0, False: 2.55M]
  |  Branch (597:31): [True: 0, False: 2.55M]
  ------------------
  598|      0|    rv = pthread_mutex_unlock(&mon->lock);
  599|      0|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  600|      0|    return PR_FAILURE;
  601|      0|  }
  602|       |
  603|  2.55M|  mon->entryCount -= 1; /* reduce by one */
  604|  2.55M|  if (mon->entryCount == 0) {
  ------------------
  |  Branch (604:7): [True: 2.54M, False: 15.8k]
  ------------------
  605|       |    /* and if it transitioned to zero - notify an entry waiter */
  606|       |    /* make the owner unknown */
  607|  2.54M|    _PT_PTHREAD_INVALIDATE_THR_HANDLE(mon->owner);
  ------------------
  |  |   70|  2.54M|#define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t)  (t) = 0
  ------------------
  608|  2.54M|    notifyEntryWaiter = PR_TRUE;
  ------------------
  |  |  437|  2.54M|#define PR_TRUE 1
  ------------------
  609|  2.54M|    notifyTimes = mon->notifyTimes;
  610|  2.54M|    mon->notifyTimes = 0;
  611|       |    /* We will access the members of 'mon' after unlocking mon->lock.
  612|       |     * Add a reference. */
  613|  2.54M|    PR_ATOMIC_INCREMENT(&mon->refCount);
  ------------------
  |  |  122|  2.54M|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  614|  2.54M|  }
  615|  2.55M|  rv = pthread_mutex_unlock(&mon->lock);
  616|  2.55M|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  2.55M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.55M, False: 0]
  |  |  ------------------
  ------------------
  617|  2.55M|  if (notifyEntryWaiter) {
  ------------------
  |  Branch (617:7): [True: 2.54M, False: 15.8k]
  ------------------
  618|  2.54M|    if (notifyTimes) {
  ------------------
  |  Branch (618:9): [True: 0, False: 2.54M]
  ------------------
  619|      0|      pt_PostNotifiesFromMonitor(&mon->waitCV, notifyTimes);
  620|      0|    }
  621|  2.54M|    rv = pthread_cond_signal(&mon->entryCV);
  622|  2.54M|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|  2.54M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2.54M, False: 0]
  |  |  ------------------
  ------------------
  623|       |    /* We are done accessing the members of 'mon'. Release the
  624|       |     * reference. */
  625|  2.54M|    PR_DestroyMonitor(mon);
  626|  2.54M|  }
  627|  2.55M|  return PR_SUCCESS;
  628|  2.55M|} /* PR_ExitMonitor */
ptsynch.c:pt_PostNotifies:
   61|     37|static void pt_PostNotifies(PRLock* lock, PRBool unlock) {
   62|     37|  PRIntn index, rv;
   63|     37|  _PT_Notified post;
   64|     37|  _PT_Notified *notified, *prev = NULL;
   65|       |  /*
   66|       |   * Time to actually notify any conditions that were affected
   67|       |   * while the lock was held. Get a copy of the list that's in
   68|       |   * the lock structure and then zero the original. If it's
   69|       |   * linked to other such structures, we own that storage.
   70|       |   */
   71|     37|  post = lock->notified; /* a safe copy; we own the lock */
   72|       |
   73|     37|#  if defined(DEBUG)
   74|     37|  memset(&lock->notified, 0, sizeof(_PT_Notified)); /* reset */
   75|       |#  else
   76|       |  lock->notified.length = 0; /* these are really sufficient */
   77|       |  lock->notified.link = NULL;
   78|       |#  endif
   79|       |
   80|       |  /* should (may) we release lock before notifying? */
   81|     37|  if (unlock) {
  ------------------
  |  Branch (81:7): [True: 37, False: 0]
  ------------------
   82|     37|    rv = pthread_mutex_unlock(&lock->mutex);
   83|     37|    PR_ASSERT(0 == rv);
  ------------------
  |  |  208|     37|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 37, False: 0]
  |  |  ------------------
  ------------------
   84|     37|  }
   85|       |
   86|     37|  notified = &post; /* this is where we start */
   87|     37|  do {
   88|     74|    for (index = 0; index < notified->length; ++index) {
  ------------------
  |  Branch (88:21): [True: 37, False: 37]
  ------------------
   89|     37|      PRCondVar* cv = notified->cv[index].cv;
   90|     37|      PR_ASSERT(NULL != cv);
  ------------------
  |  |  208|     37|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 37, False: 0]
  |  |  ------------------
  ------------------
   91|     37|      PR_ASSERT(0 != notified->cv[index].times);
  ------------------
  |  |  208|     37|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 37, False: 0]
  |  |  ------------------
  ------------------
   92|     37|      if (-1 == notified->cv[index].times) {
  ------------------
  |  Branch (92:11): [True: 37, False: 0]
  ------------------
   93|     37|        rv = pthread_cond_broadcast(&cv->cv);
   94|     37|        PR_ASSERT(0 == rv);
  ------------------
  |  |  208|     37|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 37, False: 0]
  |  |  ------------------
  ------------------
   95|     37|      } else {
   96|      0|        while (notified->cv[index].times-- > 0) {
  ------------------
  |  Branch (96:16): [True: 0, False: 0]
  ------------------
   97|      0|          rv = pthread_cond_signal(&cv->cv);
   98|      0|          PR_ASSERT(0 == rv);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   99|      0|        }
  100|      0|      }
  101|     37|#  if defined(DEBUG)
  102|     37|      pt_debug.cvars_notified += 1;
  103|     37|      if (0 > PR_ATOMIC_DECREMENT(&cv->notify_pending)) {
  ------------------
  |  |  123|     37|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (103:11): [True: 0, False: 37]
  ------------------
  104|      0|        pt_debug.delayed_cv_deletes += 1;
  105|      0|        PR_DestroyCondVar(cv);
  106|      0|      }
  107|       |#  else  /* defined(DEBUG) */
  108|       |      if (0 > PR_ATOMIC_DECREMENT(&cv->notify_pending)) {
  109|       |        PR_DestroyCondVar(cv);
  110|       |      }
  111|       |#  endif /* defined(DEBUG) */
  112|     37|    }
  113|     37|    prev = notified;
  114|     37|    notified = notified->link;
  115|     37|    if (&post != prev) {
  ------------------
  |  Branch (115:9): [True: 0, False: 37]
  ------------------
  116|      0|      PR_DELETE(prev);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  117|      0|    }
  118|     37|  } while (NULL != notified);
  ------------------
  |  Branch (118:12): [True: 0, False: 37]
  ------------------
  119|     37|} /* pt_PostNotifies */
ptsynch.c:pt_PostNotifyToCvar:
  258|     37|static void pt_PostNotifyToCvar(PRCondVar* cvar, PRBool broadcast) {
  259|     37|  PRIntn index = 0;
  260|     37|  _PT_Notified* notified = &cvar->lock->notified;
  261|       |
  262|     37|  PR_ASSERT(PR_TRUE == cvar->lock->locked);
  ------------------
  |  |  208|     37|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 37, False: 0]
  |  |  ------------------
  ------------------
  263|     37|  PR_ASSERT(pthread_equal(cvar->lock->owner, pthread_self()));
  ------------------
  |  |  208|     37|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 37, False: 0]
  |  |  ------------------
  ------------------
  264|     37|  PR_ASSERT(_PT_PTHREAD_MUTEX_IS_LOCKED(cvar->lock->mutex));
  ------------------
  |  |  208|     37|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 37, False: 0]
  |  |  ------------------
  ------------------
  265|       |
  266|     37|  while (1) {
  ------------------
  |  Branch (266:10): [Folded - Ignored]
  ------------------
  267|     37|    for (index = 0; index < notified->length; ++index) {
  ------------------
  |  Branch (267:21): [True: 0, False: 37]
  ------------------
  268|      0|      if (notified->cv[index].cv == cvar) {
  ------------------
  |  Branch (268:11): [True: 0, False: 0]
  ------------------
  269|      0|        if (broadcast) {
  ------------------
  |  Branch (269:13): [True: 0, False: 0]
  ------------------
  270|      0|          notified->cv[index].times = -1;
  271|      0|        } else if (-1 != notified->cv[index].times) {
  ------------------
  |  Branch (271:20): [True: 0, False: 0]
  ------------------
  272|      0|          notified->cv[index].times += 1;
  273|      0|        }
  274|      0|        return; /* we're finished */
  275|      0|      }
  276|      0|    }
  277|       |    /* if not full, enter new CV in this array */
  278|     37|    if (notified->length < PT_CV_NOTIFIED_LENGTH) {
  ------------------
  |  |  122|     37|#define PT_CV_NOTIFIED_LENGTH 6
  ------------------
  |  Branch (278:9): [True: 37, False: 0]
  ------------------
  279|     37|      break;
  280|     37|    }
  281|       |
  282|       |    /* if there's no link, create an empty array and link it */
  283|      0|    if (NULL == notified->link) {
  ------------------
  |  Branch (283:9): [True: 0, False: 0]
  ------------------
  284|      0|      notified->link = PR_NEWZAP(_PT_Notified);
  ------------------
  |  |   99|      0|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  285|      0|    }
  286|      0|    notified = notified->link;
  287|      0|  }
  288|       |
  289|       |  /* A brand new entry in the array */
  290|     37|  (void)PR_ATOMIC_INCREMENT(&cvar->notify_pending);
  ------------------
  |  |  122|     37|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  291|     37|  notified->cv[index].times = (broadcast) ? -1 : 1;
  ------------------
  |  Branch (291:31): [True: 37, False: 0]
  ------------------
  292|     37|  notified->cv[index].cv = cvar;
  293|     37|  notified->length += 1;
  294|     37|} /* pt_PostNotifyToCvar */

PR_GetCurrentThread:
  581|  1.82M|PR_IMPLEMENT(PRThread*) PR_GetCurrentThread(void) {
  582|  1.82M|  void* thred;
  583|       |
  584|  1.82M|  if (!_pr_initialized) {
  ------------------
  |  Branch (584:7): [True: 0, False: 1.82M]
  ------------------
  585|      0|    _PR_ImplicitInitialization();
  586|      0|  }
  587|       |
  588|  1.82M|  _PT_PTHREAD_GETSPECIFIC(pt_book.key, thred);
  ------------------
  |  |   84|  1.82M|#define _PT_PTHREAD_GETSPECIFIC(k, r)    (r) = pthread_getspecific(k)
  ------------------
  589|  1.82M|  if (NULL == thred) {
  ------------------
  |  Branch (589:7): [True: 0, False: 1.82M]
  ------------------
  590|      0|    thred = pt_AttachThread();
  591|      0|  }
  592|  1.82M|  PR_ASSERT(NULL != thred);
  ------------------
  |  |  208|  1.82M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1.82M, False: 0]
  |  |  ------------------
  ------------------
  593|  1.82M|  return (PRThread*)thred;
  594|  1.82M|} /* PR_GetCurrentThread */
_PR_InitThreads:
  835|      1|                     PRUintn maxPTDs) {
  836|      1|  int rv;
  837|      1|  PRThread* thred;
  838|       |
  839|      1|  PR_ASSERT(priority == PR_PRIORITY_NORMAL);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  840|       |
  841|       |#  ifdef _PR_NEED_PTHREAD_INIT
  842|       |  /*
  843|       |   * On BSD/OS (3.1 and 4.0), the pthread subsystem is lazily
  844|       |   * initialized, but pthread_self() fails to initialize
  845|       |   * pthreads and hence returns a null thread ID if invoked
  846|       |   * by the primordial thread before any other pthread call.
  847|       |   * So we explicitly initialize pthreads here.
  848|       |   */
  849|       |  pthread_init();
  850|       |#  endif
  851|       |
  852|       |#  if _POSIX_THREAD_PRIORITY_SCHEDULING > 0
  853|       |#    if defined(FREEBSD)
  854|       |  {
  855|       |    pthread_attr_t attr;
  856|       |    int policy;
  857|       |    /* get the min and max priorities of the default policy */
  858|       |    pthread_attr_init(&attr);
  859|       |    pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
  860|       |    pthread_attr_getschedpolicy(&attr, &policy);
  861|       |    pt_book.minPrio = sched_get_priority_min(policy);
  862|       |    PR_ASSERT(-1 != pt_book.minPrio);
  863|       |    pt_book.maxPrio = sched_get_priority_max(policy);
  864|       |    PR_ASSERT(-1 != pt_book.maxPrio);
  865|       |    pthread_attr_destroy(&attr);
  866|       |  }
  867|       |#    else
  868|       |  /*
  869|       |  ** These might be function evaluations
  870|       |  */
  871|       |  pt_book.minPrio = PT_PRIO_MIN;
  872|       |  pt_book.maxPrio = PT_PRIO_MAX;
  873|       |#    endif
  874|       |#  endif
  875|       |
  876|      1|  PR_ASSERT(NULL == pt_book.ml);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  877|      1|  pt_book.ml = PR_NewLock();
  878|      1|  PR_ASSERT(NULL != pt_book.ml);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  879|      1|  pt_book.cv = PR_NewCondVar(pt_book.ml);
  880|      1|  PR_ASSERT(NULL != pt_book.cv);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  881|      1|  thred = PR_NEWZAP(PRThread);
  ------------------
  |  |   99|      1|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  882|      1|  PR_ASSERT(NULL != thred);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  883|      1|  thred->arg = NULL;
  884|      1|  thred->startFunc = NULL;
  885|      1|  thred->priority = priority;
  886|      1|  thred->id = pthread_self();
  887|      1|  thred->idSet = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  888|      1|#  ifdef _PR_NICE_PRIORITY_SCHEDULING
  889|      1|  thred->tid = gettid();
  890|      1|#  endif
  891|       |
  892|      1|  thred->state = (PT_THREAD_DETACHED | PT_THREAD_PRIMORD);
  ------------------
  |  |  138|      1|#define PT_THREAD_DETACHED  0x01    /* thread can't be joined */
  ------------------
                thred->state = (PT_THREAD_DETACHED | PT_THREAD_PRIMORD);
  ------------------
  |  |  141|      1|#define PT_THREAD_PRIMORD   0x08    /* this is the primordial thread */
  ------------------
  893|      1|  if (PR_SYSTEM_THREAD == type) {
  ------------------
  |  Branch (893:7): [True: 0, False: 1]
  ------------------
  894|      0|    thred->state |= PT_THREAD_SYSTEM;
  ------------------
  |  |  140|      0|#define PT_THREAD_SYSTEM    0x04    /* system (not user) thread */
  ------------------
  895|      0|    pt_book.system += 1;
  896|      0|    pt_book.this_many = 0;
  897|      1|  } else {
  898|      1|    pt_book.user += 1;
  899|      1|    pt_book.this_many = 1;
  900|      1|  }
  901|      1|  thred->next = thred->prev = NULL;
  902|      1|  pt_book.first = pt_book.last = thred;
  903|       |
  904|      1|  thred->stack = PR_NEWZAP(PRThreadStack);
  ------------------
  |  |   99|      1|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  905|      1|  PR_ASSERT(thred->stack != NULL);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  906|      1|  thred->stack->stackSize = 0;
  907|      1|  thred->stack->thr = thred;
  908|      1|  _PR_InitializeStack(thred->stack);
  909|       |
  910|       |  /*
  911|       |   * Create a key for our use to store a backpointer in the pthread
  912|       |   * to our PRThread object. This object gets deleted when the thread
  913|       |   * returns from its root in the case of a detached thread. Other
  914|       |   * threads delete the objects in Join.
  915|       |   *
  916|       |   * NB: The destructor logic seems to have a bug so it isn't used.
  917|       |   * NBB: Oh really? I'm going to give it a spin - AOF 19 June 1998.
  918|       |   * More info - the problem is that pthreads calls the destructor
  919|       |   * eagerly as the thread returns from its root, rather than lazily
  920|       |   * after the thread is joined. Therefore, threads that are joining
  921|       |   * and holding PRThread references are actually holding pointers to
  922|       |   * nothing.
  923|       |   */
  924|      1|  rv = _PT_PTHREAD_KEY_CREATE(&pt_book.key, _pt_thread_death);
  ------------------
  |  |   81|      1|#define _PT_PTHREAD_KEY_CREATE           pthread_key_create
  ------------------
  925|      1|  if (0 != rv) {
  ------------------
  |  Branch (925:7): [True: 0, False: 1]
  ------------------
  926|      0|    PR_Assert("0 == rv", __FILE__, __LINE__);
  927|      0|  }
  928|      1|  pt_book.keyCreated = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  929|      1|  rv = pthread_setspecific(pt_book.key, thred);
  930|      1|  PR_ASSERT(0 == rv);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  931|      1|} /* _PR_InitThreads */
ptthread.c:_PR_InitializeStack:
   99|      1|static void _PR_InitializeStack(PRThreadStack* ts) {
  100|      1|  if (ts && (ts->stackTop == 0)) {
  ------------------
  |  Branch (100:7): [True: 1, False: 0]
  |  Branch (100:13): [True: 1, False: 0]
  ------------------
  101|      1|    ts->allocBase = (char*)&ts;
  102|      1|    ts->allocSize = ts->stackSize;
  103|       |
  104|       |    /*
  105|       |    ** Setup stackTop and stackBottom values.
  106|       |    */
  107|       |#  ifdef HAVE_STACK_GROWING_UP
  108|       |    ts->stackBottom = ts->allocBase + ts->stackSize;
  109|       |    ts->stackTop = ts->allocBase;
  110|       |#  else
  111|      1|    ts->stackTop = ts->allocBase;
  112|      1|    ts->stackBottom = ts->allocBase - ts->stackSize;
  113|      1|#  endif
  114|      1|  }
  115|      1|}

_PR_InitCMon:
  308|      1|void _PR_InitCMon(void) {
  309|      1|  _PR_NEW_LOCK_MCACHE();
  ------------------
  |  |   30|      1|#    define _PR_NEW_LOCK_MCACHE() (_pr_mcacheLock = PR_NewLock())
  ------------------
  310|      1|  ExpandMonitorCache(3);
  311|      1|}
prcmon.c:ExpandMonitorCache:
   94|      1|static PRStatus ExpandMonitorCache(PRUintn new_size_log2) {
   95|      1|  MonitorCacheEntry **old_hash_buckets, *p;
   96|      1|  PRUintn i, entries, old_num_hash_buckets, added;
   97|      1|  MonitorCacheEntry** new_hash_buckets;
   98|      1|  MonitorCacheEntryBlock* new_block;
   99|       |
  100|      1|  entries = 1L << new_size_log2;
  101|       |
  102|       |  /*
  103|       |  ** Expand the monitor-cache-entry free list
  104|       |  */
  105|      1|  new_block = (MonitorCacheEntryBlock*)PR_CALLOC(
  ------------------
  |  |   88|      1|#define PR_CALLOC(_size) (PR_Calloc(1, (_size)))
  ------------------
  106|      1|      sizeof(MonitorCacheEntryBlock) +
  107|      1|      (entries - 1) * sizeof(MonitorCacheEntry));
  108|      1|  if (NULL == new_block) {
  ------------------
  |  Branch (108:7): [True: 0, False: 1]
  ------------------
  109|      0|    return PR_FAILURE;
  110|      0|  }
  111|       |
  112|       |  /*
  113|       |  ** Allocate system monitors for the new monitor cache entries. If we
  114|       |  ** run out of system monitors, break out of the loop.
  115|       |  */
  116|      9|  for (i = 0, p = new_block->entries; i < entries; i++, p++) {
  ------------------
  |  Branch (116:39): [True: 8, False: 1]
  ------------------
  117|      8|    p->mon = PR_NewMonitor();
  118|      8|    if (!p->mon) {
  ------------------
  |  Branch (118:9): [True: 0, False: 8]
  ------------------
  119|      0|      break;
  120|      0|    }
  121|      8|  }
  122|      1|  added = i;
  123|      1|  if (added != entries) {
  ------------------
  |  Branch (123:7): [True: 0, False: 1]
  ------------------
  124|      0|    MonitorCacheEntryBlock* realloc_block;
  125|       |
  126|      0|    if (added == 0) {
  ------------------
  |  Branch (126:9): [True: 0, False: 0]
  ------------------
  127|       |      /* Totally out of system monitors. Lossage abounds */
  128|      0|      PR_DELETE(new_block);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  129|      0|      return PR_FAILURE;
  130|      0|    }
  131|       |
  132|       |    /*
  133|       |    ** We were able to allocate some of the system monitors. Use
  134|       |    ** realloc to shrink down the new_block memory. If that fails,
  135|       |    ** carry on with the too-large new_block.
  136|       |    */
  137|      0|    realloc_block = (MonitorCacheEntryBlock*)PR_REALLOC(
  ------------------
  |  |   77|      0|#define PR_REALLOC(_ptr, _size) (PR_Realloc((_ptr), (_size)))
  ------------------
  138|      0|        new_block, sizeof(MonitorCacheEntryBlock) +
  139|      0|                       (added - 1) * sizeof(MonitorCacheEntry));
  140|      0|    if (realloc_block) {
  ------------------
  |  Branch (140:9): [True: 0, False: 0]
  ------------------
  141|      0|      new_block = realloc_block;
  142|      0|    }
  143|      0|  }
  144|       |
  145|       |  /*
  146|       |  ** Now that we have allocated all of the system monitors, build up
  147|       |  ** the new free list. We can just update the free_list because we own
  148|       |  ** the mcache-lock and we aren't calling anyone who might want to use
  149|       |  ** it.
  150|       |  */
  151|      8|  for (i = 0, p = new_block->entries; i < added - 1; i++, p++) {
  ------------------
  |  Branch (151:39): [True: 7, False: 1]
  ------------------
  152|      7|    p->next = p + 1;
  153|      7|  }
  154|      1|  p->next = free_entries;
  155|      1|  free_entries = new_block->entries;
  156|      1|  num_free_entries += added;
  157|      1|  new_block->next = mcache_blocks;
  158|      1|  mcache_blocks = new_block;
  159|       |
  160|       |  /* Try to expand the hash table */
  161|      1|  new_hash_buckets =
  162|      1|      (MonitorCacheEntry**)PR_CALLOC(entries * sizeof(MonitorCacheEntry*));
  ------------------
  |  |   88|      1|#define PR_CALLOC(_size) (PR_Calloc(1, (_size)))
  ------------------
  163|      1|  if (NULL == new_hash_buckets) {
  ------------------
  |  Branch (163:7): [True: 0, False: 1]
  ------------------
  164|       |    /*
  165|       |    ** Partial lossage. In this situation we don't get any more hash
  166|       |    ** buckets, which just means that the table lookups will take
  167|       |    ** longer. This is bad, but not fatal
  168|       |    */
  169|      0|    PR_LOG(_pr_cmon_lm, PR_LOG_WARNING,
  ------------------
  |  |  177|      0|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  178|      0|      if (PR_LOG_TEST(_module,_level)) { \
  |  |  ------------------
  |  |  |  |  167|      0|    ((_module)->level >= (_level))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:5): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  179|      0|      PR_LogPrint _args;         \
  |  |  180|      0|      }                     \
  |  |  181|      0|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|      0|           ("unable to grow monitor cache hash buckets"));
  171|      0|    return PR_SUCCESS;
  172|      0|  }
  173|       |
  174|       |  /*
  175|       |  ** Compute new hash mask value. This value is used to mask an address
  176|       |  ** until it's bits are in the right spot for indexing into the hash
  177|       |  ** table.
  178|       |  */
  179|      1|  hash_mask = entries - 1;
  180|       |
  181|       |  /*
  182|       |  ** Expand the hash table. We have to rehash everything in the old
  183|       |  ** table into the new table.
  184|       |  */
  185|      1|  old_hash_buckets = hash_buckets;
  186|      1|  old_num_hash_buckets = num_hash_buckets;
  187|      1|  for (i = 0; i < old_num_hash_buckets; i++) {
  ------------------
  |  Branch (187:15): [True: 0, False: 1]
  ------------------
  188|      0|    p = old_hash_buckets[i];
  189|      0|    while (p) {
  ------------------
  |  Branch (189:12): [True: 0, False: 0]
  ------------------
  190|      0|      MonitorCacheEntry* next = p->next;
  191|       |
  192|       |      /* Hash based on new table size, and then put p in the new table */
  193|      0|      PRUintn hash = HASH(p->address);
  ------------------
  |  |   78|      0|  ((PRUint32)(((PRUptrdiff)(address) >> 2) ^ ((PRUptrdiff)(address) >> 10)) & \
  |  |   79|      0|   hash_mask)
  ------------------
  194|      0|      p->next = new_hash_buckets[hash];
  195|      0|      new_hash_buckets[hash] = p;
  196|       |
  197|      0|      p = next;
  198|      0|    }
  199|      0|  }
  200|       |
  201|       |  /*
  202|       |  ** Switch over to new hash table and THEN call free of the old
  203|       |  ** table. Since free might re-enter _pr_mcache_lock, things would
  204|       |  ** break terribly if it used the old hash table.
  205|       |  */
  206|      1|  hash_buckets = new_hash_buckets;
  207|      1|  num_hash_buckets = entries;
  208|      1|  num_hash_buckets_log2 = new_size_log2;
  209|      1|  PR_DELETE(old_hash_buckets);
  ------------------
  |  |  110|      1|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  210|       |
  211|      1|  PR_LOG(
  ------------------
  |  |  177|      1|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|      1|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  178|      1|      if (PR_LOG_TEST(_module,_level)) { \
  |  |  ------------------
  |  |  |  |  167|      1|    ((_module)->level >= (_level))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (167:5): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  179|      0|      PR_LogPrint _args;         \
  |  |  180|      0|      }                     \
  |  |  181|      1|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      1|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|      1|      _pr_cmon_lm, PR_LOG_NOTICE,
  213|      1|      ("expanded monitor cache to %d (buckets %d)", num_free_entries, entries));
  214|       |
  215|      1|  return PR_SUCCESS;
  216|      1|} /* ExpandMonitorCache */

PR_NewRWLock:
   97|     66|PR_NewRWLock(PRUint32 lock_rank, const char* lock_name) {
   98|     66|  PRRWLock* rwlock;
   99|       |#if defined(HAVE_UNIX98_RWLOCK) || defined(HAVE_UI_RWLOCK)
  100|       |  int err;
  101|       |#endif
  102|       |
  103|     66|  if (!_pr_initialized) {
  ------------------
  |  Branch (103:7): [True: 0, False: 66]
  ------------------
  104|      0|    _PR_ImplicitInitialization();
  105|      0|  }
  106|       |
  107|     66|  rwlock = PR_NEWZAP(PRRWLock);
  ------------------
  |  |   99|     66|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
  108|     66|  if (rwlock == NULL) {
  ------------------
  |  Branch (108:7): [True: 0, False: 66]
  ------------------
  109|      0|    return NULL;
  110|      0|  }
  111|       |
  112|     66|  rwlock->rw_rank = lock_rank;
  113|     66|  if (lock_name != NULL) {
  ------------------
  |  Branch (113:7): [True: 0, False: 66]
  ------------------
  114|      0|    rwlock->rw_name = (char*)PR_Malloc(strlen(lock_name) + 1);
  115|      0|    if (rwlock->rw_name == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 0]
  ------------------
  116|      0|      PR_DELETE(rwlock);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  117|      0|      return (NULL);
  118|      0|    }
  119|      0|    strcpy(rwlock->rw_name, lock_name);
  120|     66|  } else {
  121|     66|    rwlock->rw_name = NULL;
  122|     66|  }
  123|       |
  124|       |#if defined(HAVE_UNIX98_RWLOCK) || defined(HAVE_UI_RWLOCK)
  125|       |  err = RWLOCK_INIT(&rwlock->rw_lock);
  126|       |  if (err != 0) {
  127|       |    PR_SetError(PR_UNKNOWN_ERROR, err);
  128|       |    PR_Free(rwlock->rw_name);
  129|       |    PR_DELETE(rwlock);
  130|       |    return NULL;
  131|       |  }
  132|       |  return rwlock;
  133|       |#else
  134|     66|  rwlock->rw_lock = PR_NewLock();
  135|     66|  if (rwlock->rw_lock == NULL) {
  ------------------
  |  Branch (135:7): [True: 0, False: 66]
  ------------------
  136|      0|    goto failed;
  137|      0|  }
  138|     66|  rwlock->rw_reader_waitq = PR_NewCondVar(rwlock->rw_lock);
  139|     66|  if (rwlock->rw_reader_waitq == NULL) {
  ------------------
  |  Branch (139:7): [True: 0, False: 66]
  ------------------
  140|      0|    goto failed;
  141|      0|  }
  142|     66|  rwlock->rw_writer_waitq = PR_NewCondVar(rwlock->rw_lock);
  143|     66|  if (rwlock->rw_writer_waitq == NULL) {
  ------------------
  |  Branch (143:7): [True: 0, False: 66]
  ------------------
  144|      0|    goto failed;
  145|      0|  }
  146|     66|  rwlock->rw_reader_cnt = 0;
  147|     66|  rwlock->rw_writer_cnt = 0;
  148|     66|  rwlock->rw_lock_cnt = 0;
  149|     66|  return rwlock;
  150|       |
  151|      0|failed:
  152|      0|  if (rwlock->rw_reader_waitq != NULL) {
  ------------------
  |  Branch (152:7): [True: 0, False: 0]
  ------------------
  153|      0|    PR_DestroyCondVar(rwlock->rw_reader_waitq);
  154|      0|  }
  155|      0|  if (rwlock->rw_lock != NULL) {
  ------------------
  |  Branch (155:7): [True: 0, False: 0]
  ------------------
  156|      0|    PR_DestroyLock(rwlock->rw_lock);
  157|      0|  }
  158|      0|  PR_Free(rwlock->rw_name);
  159|      0|  PR_DELETE(rwlock);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  160|      0|  return NULL;
  161|     66|#endif
  162|     66|}
PR_DestroyRWLock:
  168|     66|PR_DestroyRWLock(PRRWLock* rwlock) {
  169|       |#if defined(HAVE_UNIX98_RWLOCK) || defined(HAVE_UI_RWLOCK)
  170|       |  int err;
  171|       |  err = RWLOCK_DESTROY(&rwlock->rw_lock);
  172|       |  PR_ASSERT(err == 0);
  173|       |#else
  174|     66|  PR_ASSERT(rwlock->rw_reader_cnt == 0);
  ------------------
  |  |  208|     66|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 66, False: 0]
  |  |  ------------------
  ------------------
  175|     66|  PR_DestroyCondVar(rwlock->rw_reader_waitq);
  176|     66|  PR_DestroyCondVar(rwlock->rw_writer_waitq);
  177|     66|  PR_DestroyLock(rwlock->rw_lock);
  178|     66|#endif
  179|     66|  if (rwlock->rw_name != NULL) {
  ------------------
  |  Branch (179:7): [True: 0, False: 66]
  ------------------
  180|      0|    PR_Free(rwlock->rw_name);
  181|      0|  }
  182|     66|  PR_DELETE(rwlock);
  ------------------
  |  |  110|     66|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  183|     66|}
_PR_InitRWLocks:
  367|      1|void _PR_InitRWLocks(void) {
  368|       |  /*
  369|       |   * allocated thread-private-data index for rwlock list
  370|       |   */
  371|      1|  if (PR_NewThreadPrivateIndex(&pr_thread_rwlock_key, _PR_RELEASE_LOCK_STACK) ==
  ------------------
  |  Branch (371:7): [True: 0, False: 1]
  ------------------
  372|      1|      PR_FAILURE) {
  373|      0|    pr_thread_rwlock_alloc_failed = 1;
  374|      0|    return;
  375|      0|  }
  376|      1|}

_PR_InitTPD:
   60|      1|void _PR_InitTPD(void) {
   61|      1|  _pr_tpd_destructors = (PRThreadPrivateDTOR*)PR_CALLOC(
  ------------------
  |  |   88|      1|#define PR_CALLOC(_size) (PR_Calloc(1, (_size)))
  ------------------
   62|      1|      _PR_TPD_LIMIT * sizeof(PRThreadPrivateDTOR*));
   63|      1|  PR_ASSERT(NULL != _pr_tpd_destructors);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
   64|      1|  _pr_tpd_length = _PR_TPD_LIMIT;
  ------------------
  |  |   49|      1|#define _PR_TPD_LIMIT 128             /* arbitary limit on the TPD slots */
  ------------------
   65|      1|}
PR_NewThreadPrivateIndex:
   93|      2|PR_NewThreadPrivateIndex(PRUintn* newIndex, PRThreadPrivateDTOR dtor) {
   94|      2|  PRStatus rv;
   95|      2|  PRInt32 index;
   96|       |
   97|      2|  if (!_pr_initialized) {
  ------------------
  |  Branch (97:7): [True: 0, False: 2]
  ------------------
   98|      0|    _PR_ImplicitInitialization();
   99|      0|  }
  100|       |
  101|      2|  PR_ASSERT(NULL != newIndex);
  ------------------
  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  102|      2|  PR_ASSERT(NULL != _pr_tpd_destructors);
  ------------------
  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  103|       |
  104|      2|  index = PR_ATOMIC_INCREMENT(&_pr_tpd_highwater) - 1; /* allocate index */
  ------------------
  |  |  122|      2|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  105|      2|  if (_PR_TPD_LIMIT <= index) {
  ------------------
  |  |   49|      2|#define _PR_TPD_LIMIT 128             /* arbitary limit on the TPD slots */
  ------------------
  |  Branch (105:7): [True: 0, False: 2]
  ------------------
  106|      0|    PR_SetError(PR_TPD_RANGE_ERROR, 0);
  ------------------
  |  |  100|      0|#define PR_TPD_RANGE_ERROR                       (-5972L)
  ------------------
  107|      0|    rv = PR_FAILURE; /* that's just wrong */
  108|      2|  } else {
  109|      2|    _pr_tpd_destructors[index] = dtor; /* record destructor @index */
  110|      2|    *newIndex = (PRUintn)index;        /* copy into client's location */
  111|      2|    rv = PR_SUCCESS;                   /* that's okay */
  112|      2|  }
  113|       |
  114|      2|  return rv;
  115|      2|}
PR_SetThreadPrivate:
  131|      2|PR_IMPLEMENT(PRStatus) PR_SetThreadPrivate(PRUintn index, void* priv) {
  132|      2|  PRThread* self = PR_GetCurrentThread();
  133|       |
  134|       |  /*
  135|       |  ** To improve performance, we don't check if the index has been
  136|       |  ** allocated.
  137|       |  */
  138|      2|  if (index >= _PR_TPD_LIMIT) {
  ------------------
  |  |   49|      2|#define _PR_TPD_LIMIT 128             /* arbitary limit on the TPD slots */
  ------------------
  |  Branch (138:7): [True: 0, False: 2]
  ------------------
  139|      0|    PR_SetError(PR_TPD_RANGE_ERROR, 0);
  ------------------
  |  |  100|      0|#define PR_TPD_RANGE_ERROR                       (-5972L)
  ------------------
  140|      0|    return PR_FAILURE;
  141|      0|  }
  142|       |
  143|      2|  PR_ASSERT(((NULL == self->privateData) && (0 == self->tpdLength)) ||
  ------------------
  |  |  208|      8|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:7): [True: 1, False: 1]
  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  144|      2|            ((NULL != self->privateData) && (0 != self->tpdLength)));
  145|       |
  146|       |  /*
  147|       |  ** If this thread does not have a sufficient vector for the index
  148|       |  ** being set, go ahead and extend this vector now.
  149|       |  */
  150|      2|  if ((NULL == self->privateData) || (self->tpdLength <= index)) {
  ------------------
  |  Branch (150:7): [True: 1, False: 1]
  |  Branch (150:38): [True: 0, False: 1]
  ------------------
  151|      1|    void* extension = PR_CALLOC(_pr_tpd_length * sizeof(void*));
  ------------------
  |  |   88|      1|#define PR_CALLOC(_size) (PR_Calloc(1, (_size)))
  ------------------
  152|      1|    if (NULL == extension) {
  ------------------
  |  Branch (152:9): [True: 0, False: 1]
  ------------------
  153|      0|      PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
  ------------------
  |  |   16|      0|#define PR_OUT_OF_MEMORY_ERROR                   (-6000L)
  ------------------
  154|      0|      return PR_FAILURE;
  155|      0|    }
  156|      1|    if (self->privateData) {
  ------------------
  |  Branch (156:9): [True: 0, False: 1]
  ------------------
  157|      0|      (void)memcpy(extension, self->privateData,
  158|      0|                   self->tpdLength * sizeof(void*));
  159|      0|      PR_DELETE(self->privateData);
  ------------------
  |  |  110|      0|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  160|      0|    }
  161|      1|    self->tpdLength = _pr_tpd_length;
  162|      1|    self->privateData = (void**)extension;
  163|      1|  }
  164|       |  /*
  165|       |  ** There wasn't much chance of having to call the destructor
  166|       |  ** unless the slot already existed.
  167|       |  */
  168|      1|  else if (self->privateData[index] && _pr_tpd_destructors[index]) {
  ------------------
  |  Branch (168:12): [True: 1, False: 0]
  |  Branch (168:40): [True: 1, False: 0]
  ------------------
  169|      1|    void* data = self->privateData[index];
  170|      1|    self->privateData[index] = NULL;
  171|      1|    (*_pr_tpd_destructors[index])(data);
  172|      1|  }
  173|       |
  174|      2|  PR_ASSERT(index < self->tpdLength);
  ------------------
  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  175|      2|  self->privateData[index] = priv;
  176|       |
  177|      2|  return PR_SUCCESS;
  178|      2|}
PR_GetThreadPrivate:
  189|  36.7k|PR_IMPLEMENT(void*) PR_GetThreadPrivate(PRUintn index) {
  190|  36.7k|  PRThread* self = PR_GetCurrentThread();
  191|  36.7k|  void* tpd = ((NULL == self->privateData) || (index >= self->tpdLength))
  ------------------
  |  Branch (191:16): [True: 1, False: 36.7k]
  |  Branch (191:47): [True: 0, False: 36.7k]
  ------------------
  192|  36.7k|                  ? NULL
  193|  36.7k|                  : self->privateData[index];
  194|       |
  195|  36.7k|  return tpd;
  196|  36.7k|}

_ZN19DummyIOLayerMethods8CreateFDEiPS_:
   20|  8.85k|                                               DummyIOLayerMethods *methods) {
   21|  8.85k|  ScopedPRFileDesc fd(PR_CreateIOLayerStub(id, &DummyMethodsForward));
   22|  8.85k|  assert(fd);
   23|  8.85k|  if (!fd) {
  ------------------
  |  Branch (23:7): [True: 0, False: 8.85k]
  ------------------
   24|      0|    return nullptr;
   25|      0|  }
   26|  8.85k|  fd->secret = reinterpret_cast<PRFilePrivate *>(methods);
   27|  8.85k|  return fd;
   28|  8.85k|}
_ZN19DummyIOLayerMethods5CloseEP10PRFileDesc:
   30|  8.85k|PRStatus DummyIOLayerMethods::Close(PRFileDesc *f) {
   31|  8.85k|  f->secret = nullptr;
   32|  8.85k|  f->dtor(f);
   33|  8.85k|  return PR_SUCCESS;
   34|  8.85k|}
_ZN19DummyIOLayerMethods4SendEP10PRFileDescPKviij:
  125|  15.3k|                                  PRIntervalTime to) {
  126|  15.3k|  return Write(f, buf, amount);
  127|  15.3k|}
_ZN19DummyIOLayerMethods11GetpeernameEP10PRFileDescP9PRNetAddr:
  168|  17.7k|PRStatus DummyIOLayerMethods::Getpeername(PRFileDesc *f, PRNetAddr *addr) {
  169|  17.7k|  addr->inet.family = PR_AF_INET;
  ------------------
  |  |   96|  17.7k|#define PR_AF_INET AF_INET
  ------------------
  170|  17.7k|  addr->inet.port = 0;
  171|  17.7k|  addr->inet.ip = 0;
  172|       |
  173|  17.7k|  return PR_SUCCESS;
  174|  17.7k|}
_ZN19DummyIOLayerMethods13GetsockoptionEP10PRFileDescP18PRSocketOptionData:
  182|  13.3k|                                            PRSocketOptionData *opt) {
  183|  13.3k|  switch (opt->option) {
  184|  13.3k|    case PR_SockOpt_Nonblocking:
  ------------------
  |  Branch (184:5): [True: 13.3k, False: 0]
  ------------------
  185|  13.3k|      opt->value.non_blocking = PR_TRUE;
  ------------------
  |  |  437|  13.3k|#define PR_TRUE 1
  ------------------
  186|  13.3k|      return PR_SUCCESS;
  187|      0|    default:
  ------------------
  |  Branch (187:5): [True: 0, False: 13.3k]
  ------------------
  188|      0|      UNIMPLEMENTED();
  ------------------
  |  |   14|      0|  std::cerr << "Unimplemented: " << __FUNCTION__ << std::endl; \
  |  |   15|      0|  assert(false);
  ------------------
  189|      0|      break;
  190|  13.3k|  }
  191|       |
  192|      0|  return PR_FAILURE;
  193|  13.3k|}
_ZN19DummyIOLayerMethods13SetsockoptionEP10PRFileDescPK18PRSocketOptionData:
  196|    137|                                            const PRSocketOptionData *opt) {
  197|    137|  switch (opt->option) {
  198|      0|    case PR_SockOpt_Nonblocking:
  ------------------
  |  Branch (198:5): [True: 0, False: 137]
  ------------------
  199|      0|      return PR_SUCCESS;
  200|    137|    case PR_SockOpt_NoDelay:
  ------------------
  |  Branch (200:5): [True: 137, False: 0]
  ------------------
  201|    137|      return PR_SUCCESS;
  202|      0|    default:
  ------------------
  |  Branch (202:5): [True: 0, False: 137]
  ------------------
  203|      0|      UNIMPLEMENTED();
  ------------------
  |  |   14|      0|  std::cerr << "Unimplemented: " << __FUNCTION__ << std::endl; \
  |  |   15|      0|  assert(false);
  ------------------
  204|      0|      break;
  205|    137|  }
  206|       |
  207|      0|  return PR_FAILURE;
  208|    137|}

dummy_io_fwd.cc:_ZL10DummyCloseP10PRFileDesc:
   13|  8.85k|static PRStatus DummyClose(PRFileDesc *f) { return ToMethods(f)->Close(f); }
dummy_io_fwd.cc:_ZL9ToMethodsP10PRFileDesc:
    9|  73.1k|static DummyIOLayerMethods *ToMethods(PRFileDesc *f) {
   10|  73.1k|  return reinterpret_cast<DummyIOLayerMethods *>(f->secret);
   11|  73.1k|}
dummy_io_fwd.cc:_ZL9DummyRecvP10PRFileDescPviij:
   77|  17.8k|                         int32_t flags, PRIntervalTime to) {
   78|  17.8k|  return ToMethods(f)->Recv(f, buf, buflen, flags, to);
   79|  17.8k|}
dummy_io_fwd.cc:_ZL9DummySendP10PRFileDescPKviij:
   82|  15.3k|                         int32_t flags, PRIntervalTime to) {
   83|  15.3k|  return ToMethods(f)->Send(f, buf, amount, flags, to);
   84|  15.3k|}
dummy_io_fwd.cc:_ZL16DummyGetpeernameP10PRFileDescP9PRNetAddr:
  114|  17.7k|static PRStatus DummyGetpeername(PRFileDesc *f, PRNetAddr *addr) {
  115|  17.7k|  return ToMethods(f)->Getpeername(f, addr);
  116|  17.7k|}
dummy_io_fwd.cc:_ZL18DummyGetsockoptionP10PRFileDescP18PRSocketOptionData:
  122|  13.3k|static PRStatus DummyGetsockoption(PRFileDesc *f, PRSocketOptionData *opt) {
  123|  13.3k|  return ToMethods(f)->Getsockoption(f, opt);
  124|  13.3k|}
dummy_io_fwd.cc:_ZL18DummySetsockoptionP10PRFileDescPK18PRSocketOptionData:
  127|    137|                                   const PRSocketOptionData *opt) {
  128|    137|  return ToMethods(f)->Setsockoption(f, opt);
  129|    137|}

_ZN17ScopedMaybeDeleteI10PRFileDescEclEPS0_:
   64|  8.85k|  void operator()(T* ptr) {
   65|  8.85k|    if (ptr) {
  ------------------
  |  Branch (65:9): [True: 8.85k, False: 0]
  ------------------
   66|  8.85k|      ScopedDelete del;
   67|  8.85k|      del(ptr);
   68|  8.85k|    }
   69|  8.85k|  }
_ZN12ScopedDeleteclEP10PRFileDesc:
   44|  8.85k|  void operator()(PRFileDesc* fd) { PR_Close(fd); }
_ZN12ScopedDeleteclEP15PK11SlotInfoStr:
   38|  4.62k|  void operator()(PK11SlotInfo* slot) { PK11_FreeSlot(slot); }
_ZN12ScopedDeleteclEP13PK11SymKeyStr:
   40|  4.62k|  void operator()(PK11SymKey* key) { PK11_FreeSymKey(key); }
_ZN17ScopedMaybeDeleteI15PK11SlotInfoStrEclEPS0_:
   64|  4.62k|  void operator()(T* ptr) {
   65|  4.62k|    if (ptr) {
  ------------------
  |  Branch (65:9): [True: 4.62k, False: 0]
  ------------------
   66|  4.62k|      ScopedDelete del;
   67|  4.62k|      del(ptr);
   68|  4.62k|    }
   69|  4.62k|  }
_ZN17ScopedMaybeDeleteI13PK11SymKeyStrEclEPS0_:
   64|  4.62k|  void operator()(T* ptr) {
   65|  4.62k|    if (ptr) {
  ------------------
  |  Branch (65:9): [True: 4.62k, False: 0]
  ------------------
   66|  4.62k|      ScopedDelete del;
   67|  4.62k|      del(ptr);
   68|  4.62k|    }
   69|  4.62k|  }

_ZN11NSSDatabaseC2Ev:
   15|      1|  NSSDatabase() { assert(NSS_NoDB_Init(nullptr) == SECSuccess); }
_ZN11NSSDatabaseD2Ev:
   16|      1|  ~NSSDatabase() { assert(NSS_Shutdown() == SECSuccess); }

_ZN9TlsClient6ConfigC2EPKhm:
   53|  8.85k|Config::Config(const uint8_t* data, size_t len) {
   54|  8.85k|  union {
   55|  8.85k|    uint64_t bitmap;
   56|  8.85k|    struct {
   57|  8.85k|      uint32_t config;
   58|  8.85k|      uint16_t ssl_version_range_min;
   59|  8.85k|      uint16_t ssl_version_range_max;
   60|  8.85k|    };
   61|  8.85k|  };
   62|       |
   63|  66.8M|  for (size_t i = 0; i < len; i++) {
  ------------------
  |  Branch (63:22): [True: 66.8M, False: 8.85k]
  ------------------
   64|  66.8M|    bitmap ^= static_cast<uint64_t>(data[i]) << (8 * (i % 8));
   65|  66.8M|  }
   66|       |
   67|       |  // Map SSL version values to a valid range.
   68|  8.85k|  ssl_version_range_min =
   69|  8.85k|      SSL_VERSION_RANGE_MIN_VALID +
  ------------------
  |  |   16|  8.85k|#define SSL_VERSION_RANGE_MIN_VALID 0x0302
  ------------------
   70|  8.85k|      (ssl_version_range_min %
   71|  8.85k|       (1 + SSL_VERSION_RANGE_MAX_VALID - SSL_VERSION_RANGE_MIN_VALID));
  ------------------
  |  |   20|  8.85k|#define SSL_VERSION_RANGE_MAX_VALID 0x0304
  ------------------
                     (1 + SSL_VERSION_RANGE_MAX_VALID - SSL_VERSION_RANGE_MIN_VALID));
  ------------------
  |  |   16|  8.85k|#define SSL_VERSION_RANGE_MIN_VALID 0x0302
  ------------------
   72|  8.85k|  ssl_version_range_max =
   73|  8.85k|      ssl_version_range_min +
   74|  8.85k|      (ssl_version_range_max %
   75|  8.85k|       (1 + SSL_VERSION_RANGE_MAX_VALID - ssl_version_range_min));
  ------------------
  |  |   20|  8.85k|#define SSL_VERSION_RANGE_MAX_VALID 0x0304
  ------------------
   76|       |
   77|  8.85k|  config_ = config;
   78|  8.85k|  ssl_version_range_ = {
   79|  8.85k|      .min = ssl_version_range_min,
   80|  8.85k|      .max = ssl_version_range_max,
   81|  8.85k|  };
   82|  8.85k|}
_ZN9TlsClient6Config12SetCallbacksEP10PRFileDesc:
   84|  8.85k|void Config::SetCallbacks(PRFileDesc* fd) {
   85|  8.85k|  SECStatus rv = SSL_AuthCertificateHook(fd, AuthCertificateHook, this);
   86|  8.85k|  assert(rv == SECSuccess);
   87|       |
   88|  8.85k|  rv = SSL_SetCanFalseStartCallback(fd, CanFalseStartCallback, nullptr);
   89|  8.85k|  assert(rv == SECSuccess);
   90|  8.85k|}
_ZN9TlsClient6Config16SetSocketOptionsEP10PRFileDesc:
   92|  8.85k|void Config::SetSocketOptions(PRFileDesc* fd) {
   93|  8.85k|  SECStatus rv = SSL_OptionSet(fd, SSL_ENABLE_EXTENDED_MASTER_SECRET,
  ------------------
  |  |  195|  8.85k|#define SSL_ENABLE_EXTENDED_MASTER_SECRET 30
  ------------------
   94|  8.85k|                               this->EnableExtendedMasterSecret());
   95|  8.85k|  assert(rv == SECSuccess);
   96|       |
   97|  8.85k|  rv = SSL_OptionSet(fd, SSL_REQUIRE_DH_NAMED_GROUPS,
  ------------------
  |  |  214|  8.85k|#define SSL_REQUIRE_DH_NAMED_GROUPS 32
  ------------------
   98|  8.85k|                     this->RequireDhNamedGroups());
   99|  8.85k|  assert(rv == SECSuccess);
  100|       |
  101|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_FALSE_START, this->EnableFalseStart());
  ------------------
  |  |  117|  8.85k|#define SSL_ENABLE_FALSE_START 22       /* Enable SSL false start (off by */
  ------------------
  102|  8.85k|  assert(rv == SECSuccess);
  103|       |
  104|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_DEFLATE, this->EnableDeflate());
  ------------------
  |  |  110|  8.85k|#define SSL_ENABLE_DEFLATE 19           /* (unsupported, deprecated, off) */
  ------------------
  105|  8.85k|  assert(rv == SECSuccess);
  106|       |
  107|  8.85k|  rv = SSL_OptionSet(fd, SSL_CBC_RANDOM_IV, this->CbcRandomIv());
  ------------------
  |  |  158|  8.85k|#define SSL_CBC_RANDOM_IV 23
  ------------------
  108|  8.85k|  assert(rv == SECSuccess);
  109|       |
  110|  8.85k|  rv = SSL_OptionSet(fd, SSL_REQUIRE_SAFE_NEGOTIATION,
  ------------------
  |  |  112|  8.85k|#define SSL_REQUIRE_SAFE_NEGOTIATION 21 /* Peer must send Signaling       */
  ------------------
  111|  8.85k|                     this->RequireSafeNegotiation());
  112|  8.85k|  assert(rv == SECSuccess);
  113|       |
  114|  8.85k|  rv = SSL_OptionSet(fd, SSL_NO_CACHE, this->NoCache());
  ------------------
  |  |   85|  8.85k|#define SSL_NO_CACHE 9             /* don't use the session cache */
  ------------------
  115|  8.85k|  assert(rv == SECSuccess);
  116|       |
  117|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_GREASE, this->EnableGrease());
  ------------------
  |  |  374|  8.85k|#define SSL_ENABLE_GREASE 42
  ------------------
  118|  8.85k|  assert(rv == SECSuccess);
  119|       |
  120|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_CH_EXTENSION_PERMUTATION,
  ------------------
  |  |  381|  8.85k|#define SSL_ENABLE_CH_EXTENSION_PERMUTATION 43
  ------------------
  121|  8.85k|                     this->EnableCHExtensionPermutation());
  122|  8.85k|  assert(rv == SECSuccess);
  123|       |
  124|  8.85k|  if (this->SetCertificateCompressionAlgorithm()) {
  ------------------
  |  Branch (124:7): [True: 4.46k, False: 4.39k]
  ------------------
  125|  4.46k|    rv = SSL_SetCertificateCompressionAlgorithm(fd, kCompressionAlg);
  ------------------
  |  | 1083|  4.46k|    SSL_EXPERIMENTAL_API("SSL_SetCertificateCompressionAlgorithm", \
  |  |  ------------------
  |  |  |  |   22|  4.46k|    (SSL_GetExperimentalAPI(name)                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (22:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   23|  4.46k|         ? ((SECStatus(*) arglist)SSL_GetExperimentalAPI(name))args \
  |  |  |  |   24|  4.46k|         : SECFailure)
  |  |  ------------------
  |  | 1084|  4.46k|                         (PRFileDesc * _fd,                        \
  |  | 1085|  4.46k|                          SSLCertificateCompressionAlgorithm t),   \
  |  | 1086|  4.46k|                         (fd, t))
  ------------------
  126|  4.46k|    assert(rv == SECSuccess);
  127|  4.46k|  }
  128|       |
  129|  8.85k|  if (this->SetVersionRange()) {
  ------------------
  |  Branch (129:7): [True: 3.25k, False: 5.60k]
  ------------------
  130|  3.25k|    rv = SSL_VersionRangeSet(fd, &ssl_version_range_);
  131|  3.25k|    assert(rv == SECSuccess);
  132|  3.25k|  }
  133|       |
  134|  8.85k|  if (this->AddExternalPsk()) {
  ------------------
  |  Branch (134:7): [True: 4.62k, False: 4.22k]
  ------------------
  135|  4.62k|    ScopedPK11SlotInfo slot(PK11_GetInternalSlot());
  136|  4.62k|    assert(slot);
  137|       |
  138|  4.62k|    ScopedPK11SymKey key(PK11_KeyGen(slot.get(), CKM_NSS_CHACHA20_POLY1305,
  ------------------
  |  |  243|  4.62k|#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 28)
  |  |  ------------------
  |  |  |  |  162|  4.62k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  4.62k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  4.62k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|  4.62k|                                     nullptr, 32, nullptr));
  140|  4.62k|    assert(key);
  141|       |
  142|  4.62k|    rv = SSL_AddExternalPsk(fd, key.get(), kPskIdentity,
  ------------------
  |  | 1051|  4.62k|    SSL_EXPERIMENTAL_API("SSL_AddExternalPsk",                                 \
  |  |  ------------------
  |  |  |  |   22|  4.62k|    (SSL_GetExperimentalAPI(name)                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (22:6): [True: 4.62k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   23|  4.62k|         ? ((SECStatus(*) arglist)SSL_GetExperimentalAPI(name))args \
  |  |  |  |   24|  4.62k|         : SECFailure)
  |  |  ------------------
  |  | 1052|  4.62k|                         (PRFileDesc * _fd, PK11SymKey * _psk,                 \
  |  | 1053|  4.62k|                          const PRUint8 *_identity, unsigned int _identityLen, \
  |  | 1054|  4.62k|                          SSLHashType _hash),                                  \
  |  | 1055|  4.62k|                         (fd, psk, identity, identityLen, hash))
  ------------------
  143|  4.62k|                            sizeof(kPskIdentity) - 1, this->PskHashType());
  144|  4.62k|    assert(rv == SECSuccess);
  145|  4.62k|  }
  146|       |
  147|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_POST_HANDSHAKE_AUTH,
  ------------------
  |  |  311|  8.85k|#define SSL_ENABLE_POST_HANDSHAKE_AUTH 39
  ------------------
  148|  8.85k|                     this->EnablePostHandshakeAuth());
  149|  8.85k|  assert(rv == SECSuccess);
  150|       |
  151|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_0RTT_DATA, this->EnableZeroRtt());
  ------------------
  |  |  244|  8.85k|#define SSL_ENABLE_0RTT_DATA 33
  ------------------
  152|  8.85k|  assert(rv == SECSuccess);
  153|       |
  154|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_ALPN, this->EnableAlpn());
  ------------------
  |  |  174|  8.85k|#define SSL_ENABLE_ALPN 26
  ------------------
  155|  8.85k|  assert(rv == SECSuccess);
  156|       |
  157|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_FALLBACK_SCSV, this->EnableFallbackScsv());
  ------------------
  |  |  183|  8.85k|#define SSL_ENABLE_FALLBACK_SCSV 28 /* Send fallback SCSV in \
  ------------------
  158|  8.85k|  assert(rv == SECSuccess);
  159|       |
  160|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_OCSP_STAPLING, this->EnableOcspStapling());
  ------------------
  |  |  159|  8.85k|#define SSL_ENABLE_OCSP_STAPLING 24 /* Request OCSP stapling (client) */
  ------------------
  161|  8.85k|  assert(rv == SECSuccess);
  162|       |
  163|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_SESSION_TICKETS,
  ------------------
  |  |  108|  8.85k|#define SSL_ENABLE_SESSION_TICKETS 18   /* Enable TLS SessionTicket       */
  ------------------
  164|  8.85k|                     this->EnableSessionTickets());
  165|  8.85k|  assert(rv == SECSuccess);
  166|       |
  167|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_TLS13_COMPAT_MODE,
  ------------------
  |  |  272|  8.85k|#define SSL_ENABLE_TLS13_COMPAT_MODE 35
  ------------------
  168|  8.85k|                     this->EnableTls13CompatMode());
  169|  8.85k|  assert(rv == SECSuccess);
  170|       |
  171|  8.85k|  rv = SSL_OptionSet(fd, SSL_NO_LOCKS, this->NoLocks());
  ------------------
  |  |  107|  8.85k|#define SSL_NO_LOCKS 17                 /* Don't use locks for protection */
  ------------------
  172|  8.85k|  assert(rv == SECSuccess);
  173|       |
  174|  8.85k|  rv = SSL_EnableTls13GreaseEch(fd, this->EnableTls13GreaseEch());
  ------------------
  |  |  517|  8.85k|    SSL_EXPERIMENTAL_API("SSL_EnableTls13GreaseEch", \
  |  |  ------------------
  |  |  |  |   22|  8.85k|    (SSL_GetExperimentalAPI(name)                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (22:6): [True: 8.85k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   23|  8.85k|         ? ((SECStatus(*) arglist)SSL_GetExperimentalAPI(name))args \
  |  |  |  |   24|  8.85k|         : SECFailure)
  |  |  ------------------
  |  |  518|  8.85k|                         (PRFileDesc * _fd, PRBool _enabled), (fd, enabled))
  ------------------
  175|  8.85k|  assert(rv == SECSuccess);
  176|       |
  177|  8.85k|  rv = SSL_SetDtls13VersionWorkaround(fd, this->SetDtls13VersionWorkaround());
  ------------------
  |  | 1028|  8.85k|    SSL_EXPERIMENTAL_API("SSL_SetDtls13VersionWorkaround", \
  |  |  ------------------
  |  |  |  |   22|  8.85k|    (SSL_GetExperimentalAPI(name)                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (22:6): [True: 8.85k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   23|  8.85k|         ? ((SECStatus(*) arglist)SSL_GetExperimentalAPI(name))args \
  |  |  |  |   24|  8.85k|         : SECFailure)
  |  |  ------------------
  |  | 1029|  8.85k|                         (PRFileDesc * _fd, PRBool _enabled), (fd, enabled))
  ------------------
  178|  8.85k|  assert(rv == SECSuccess);
  179|       |
  180|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_DELEGATED_CREDENTIALS,
  ------------------
  |  |  328|  8.85k|#define SSL_ENABLE_DELEGATED_CREDENTIALS 40
  ------------------
  181|  8.85k|                     this->EnableDelegatedCredentials());
  182|  8.85k|  assert(rv == SECSuccess);
  183|       |
  184|  8.85k|  rv = SSL_OptionSet(fd, SSL_ENABLE_DTLS_SHORT_HEADER,
  ------------------
  |  |  283|  8.85k|#define SSL_ENABLE_DTLS_SHORT_HEADER 36
  ------------------
  185|  8.85k|                     this->EnableDtlsShortHeader());
  186|  8.85k|  assert(rv == SECSuccess);
  187|       |
  188|       |#ifndef IS_DTLS_FUZZ
  189|       |  rv =
  190|       |      SSL_OptionSet(fd, SSL_ENABLE_RENEGOTIATION, SSL_RENEGOTIATE_UNRESTRICTED);
  191|       |  assert(rv == SECSuccess);
  192|       |
  193|       |  if (this->SetClientEchConfigs()) {
  194|       |    ScopedSECItem echConfigsBin(NSSBase64_DecodeBuffer(
  195|       |        nullptr, nullptr, kEchConfigs, sizeof(kEchConfigs)));
  196|       |    assert(echConfigsBin);
  197|       |
  198|       |    rv = SSL_SetClientEchConfigs(fd, echConfigsBin->data, echConfigsBin->len);
  199|       |    assert(rv == SECSuccess);
  200|       |  }
  201|       |#endif  // IS_DTLS_FUZZ
  202|  8.85k|}
client_config.cc:_ZL19AuthCertificateHookPvP10PRFileDescii:
   33|  4.74k|                                     PRBool isServer) {
   34|  4.74k|  assert(!isServer);
   35|       |
   36|  4.74k|  auto config = reinterpret_cast<TlsClient::Config*>(arg);
   37|  4.74k|  if (config->FailCertificateAuthentication()) return SECFailure;
  ------------------
  |  Branch (37:7): [True: 82, False: 4.66k]
  ------------------
   38|       |
   39|  4.66k|  return SECSuccess;
   40|  4.74k|}
client_config.cc:_ZL21CanFalseStartCallbackP10PRFileDescPvPi:
   43|    600|                                       PRBool* canFalseStart) {
   44|    600|  *canFalseStart = true;
   45|    600|  return SECSuccess;
   46|    600|}

_ZN9TlsClient6Config11PskHashTypeEv:
   31|  4.62k|  SSLHashType PskHashType() {
   32|  4.62k|    if (config_ % 2) return ssl_hash_sha256;
  ------------------
  |  Branch (32:9): [True: 1.08k, False: 3.54k]
  ------------------
   33|       |
   34|  3.54k|    return ssl_hash_sha384;
   35|  4.62k|  };
_ZN9TlsClient6Config29FailCertificateAuthenticationEv:
   40|  4.74k|  bool FailCertificateAuthentication() { return config_ & (1 << 0); };
_ZN9TlsClient6Config26EnableExtendedMasterSecretEv:
   41|  8.85k|  bool EnableExtendedMasterSecret() { return config_ & (1 << 1); };
_ZN9TlsClient6Config20RequireDhNamedGroupsEv:
   42|  8.85k|  bool RequireDhNamedGroups() { return config_ & (1 << 2); };
_ZN9TlsClient6Config16EnableFalseStartEv:
   43|  8.85k|  bool EnableFalseStart() { return config_ & (1 << 3); };
_ZN9TlsClient6Config13EnableDeflateEv:
   44|  8.85k|  bool EnableDeflate() { return config_ & (1 << 4); };
_ZN9TlsClient6Config11CbcRandomIvEv:
   45|  8.85k|  bool CbcRandomIv() { return config_ & (1 << 5); };
_ZN9TlsClient6Config22RequireSafeNegotiationEv:
   46|  8.85k|  bool RequireSafeNegotiation() { return config_ & (1 << 6); };
_ZN9TlsClient6Config7NoCacheEv:
   47|  8.85k|  bool NoCache() { return config_ & (1 << 7); };
_ZN9TlsClient6Config12EnableGreaseEv:
   48|  8.85k|  bool EnableGrease() { return config_ & (1 << 8); };
_ZN9TlsClient6Config28EnableCHExtensionPermutationEv:
   49|  8.85k|  bool EnableCHExtensionPermutation() { return config_ & (1 << 9); };
_ZN9TlsClient6Config34SetCertificateCompressionAlgorithmEv:
   50|  8.85k|  bool SetCertificateCompressionAlgorithm() { return config_ & (1 << 10); };
_ZN9TlsClient6Config15SetVersionRangeEv:
   52|  8.85k|  bool SetVersionRange() { return config_ & (1 << 12); };
_ZN9TlsClient6Config14AddExternalPskEv:
   53|  8.85k|  bool AddExternalPsk() { return config_ & (1 << 13); };
_ZN9TlsClient6Config23EnablePostHandshakeAuthEv:
   54|  8.85k|  bool EnablePostHandshakeAuth() { return config_ & (1 << 14); };
_ZN9TlsClient6Config13EnableZeroRttEv:
   55|  8.85k|  bool EnableZeroRtt() { return config_ & (1 << 15); };
_ZN9TlsClient6Config10EnableAlpnEv:
   56|  8.85k|  bool EnableAlpn() { return config_ & (1 << 16); };
_ZN9TlsClient6Config18EnableFallbackScsvEv:
   57|  8.85k|  bool EnableFallbackScsv() { return config_ & (1 << 17); };
_ZN9TlsClient6Config18EnableOcspStaplingEv:
   58|  8.85k|  bool EnableOcspStapling() { return config_ & (1 << 18); };
_ZN9TlsClient6Config20EnableSessionTicketsEv:
   59|  8.85k|  bool EnableSessionTickets() { return config_ & (1 << 19); };
_ZN9TlsClient6Config21EnableTls13CompatModeEv:
   60|  8.85k|  bool EnableTls13CompatMode() { return config_ & (1 << 20); };
_ZN9TlsClient6Config7NoLocksEv:
   61|  8.85k|  bool NoLocks() { return config_ & (1 << 21); };
_ZN9TlsClient6Config20EnableTls13GreaseEchEv:
   62|  8.85k|  bool EnableTls13GreaseEch() { return config_ & (1 << 22); };
_ZN9TlsClient6Config26SetDtls13VersionWorkaroundEv:
   63|  8.85k|  bool SetDtls13VersionWorkaround() { return config_ & (1 << 23); };
_ZN9TlsClient6Config26EnableDelegatedCredentialsEv:
   64|  8.85k|  bool EnableDelegatedCredentials() { return config_ & (1 << 24); };
_ZN9TlsClient6Config21EnableDtlsShortHeaderEv:
   65|  8.85k|  bool EnableDtlsShortHeader() { return config_ & (1 << 25); };

_ZN9TlsCommon7FixTimeEP10PRFileDesc:
   21|  8.85k|void FixTime(PRFileDesc* fd) {
   22|  8.85k|  SECStatus rv = SSL_SetTimeFunc(fd, FixedTime, nullptr);
  ------------------
  |  |  892|  8.85k|    SSL_EXPERIMENTAL_API("SSL_SetTimeFunc",                              \
  |  |  ------------------
  |  |  |  |   22|  8.85k|    (SSL_GetExperimentalAPI(name)                                   \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (22:6): [True: 8.85k, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   23|  8.85k|         ? ((SECStatus(*) arglist)SSL_GetExperimentalAPI(name))args \
  |  |  |  |   24|  8.85k|         : SECFailure)
  |  |  ------------------
  |  |  893|  8.85k|                         (PRFileDesc * _fd, SSLTimeFunc _f, void *_arg), \
  |  |  894|  8.85k|                         (fd, f, arg))
  ------------------
   23|  8.85k|  assert(rv == SECSuccess);
   24|  8.85k|}
_ZN9TlsCommon25EnableAllProtocolVersionsEv:
   26|  8.85k|void EnableAllProtocolVersions() {
   27|  8.85k|  SSLVersionRange supported;
   28|  8.85k|  SECStatus rv;
   29|       |
   30|       |  // Enable all supported versions for TCP.
   31|  8.85k|  rv = SSL_VersionRangeGetSupported(ssl_variant_stream, &supported);
   32|  8.85k|  assert(rv == SECSuccess);
   33|       |
   34|  8.85k|  rv = SSL_VersionRangeSetDefault(ssl_variant_stream, &supported);
   35|  8.85k|  assert(rv == SECSuccess);
   36|       |
   37|       |  // Enable all supported versions for UDP.
   38|  8.85k|  rv = SSL_VersionRangeGetSupported(ssl_variant_datagram, &supported);
   39|  8.85k|  assert(rv == SECSuccess);
   40|       |
   41|  8.85k|  rv = SSL_VersionRangeSetDefault(ssl_variant_datagram, &supported);
   42|  8.85k|  assert(rv == SECSuccess);
   43|  8.85k|}
_ZN9TlsCommon21EnableAllCipherSuitesEP10PRFileDesc:
   45|  8.85k|void EnableAllCipherSuites(PRFileDesc* fd) {
   46|   637k|  for (uint16_t i = 0; i < SSL_NumImplementedCiphers; ++i) {
  ------------------
  |  Branch (46:24): [True: 628k, False: 8.85k]
  ------------------
   47|   628k|    SECStatus rv = SSL_CipherPrefSet(fd, SSL_ImplementedCiphers[i], true);
   48|   628k|    assert(rv == SECSuccess);
   49|   628k|  }
   50|  8.85k|}
_ZN9TlsCommon11DoHandshakeEP10PRFileDescb:
   52|  8.85k|void DoHandshake(PRFileDesc* fd, bool isServer) {
   53|  8.85k|  SECStatus rv = SSL_ResetHandshake(fd, isServer);
   54|  8.85k|  assert(rv == SECSuccess);
   55|       |
   56|  12.2k|  do {
   57|  12.2k|    rv = SSL_ForceHandshake(fd);
   58|  12.2k|  } while (rv != SECSuccess && PR_GetError() == PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|  11.5k|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (58:12): [True: 11.5k, False: 686]
  |  Branch (58:32): [True: 3.40k, False: 8.16k]
  ------------------
   59|       |
   60|       |  // If the handshake succeeds, let's read some data from the server, if any.
   61|  8.85k|  if (rv == SECSuccess) {
  ------------------
  |  Branch (61:7): [True: 686, False: 8.16k]
  ------------------
   62|    686|    uint8_t block[1024];
   63|    686|    int32_t nb;
   64|       |
   65|       |    // Read application data and echo it back.
   66|  1.10k|    while ((nb = PR_Read(fd, block, sizeof(block))) > 0) {
  ------------------
  |  Branch (66:12): [True: 419, False: 686]
  ------------------
   67|    419|      PR_Write(fd, block, nb);
   68|    419|    }
   69|    686|  }
   70|  8.85k|}
common.cc:_ZL9FixedTimePv:
   16|  10.0k|static PRTime FixedTime(void*) { return 1234; }

_ZN9TlsSocket13DummyPrSocket4ReadEP10PRFileDescPvi:
   17|  17.8k|int32_t DummyPrSocket::Read(PRFileDesc *fd, void *data, int32_t len) {
   18|  17.8k|  assert(data && len > 0);
   19|       |
   20|  17.8k|  int32_t amount = std::min(len, static_cast<int32_t>(len_));
   21|  17.8k|  memcpy(data, buf_, amount);
   22|       |
   23|  17.8k|  buf_ += amount;
   24|  17.8k|  len_ -= amount;
   25|       |
   26|  17.8k|  return amount;
   27|  17.8k|}
_ZN9TlsSocket13DummyPrSocket5WriteEP10PRFileDescPKvi:
   29|  15.3k|int32_t DummyPrSocket::Write(PRFileDesc *fd, const void *buf, int32_t length) {
   30|  15.3k|  return length;
   31|  15.3k|}
_ZN9TlsSocket13DummyPrSocket4RecvEP10PRFileDescPviij:
   34|  17.8k|                            int32_t flags, PRIntervalTime to) {
   35|  17.8k|  assert(flags == 0);
   36|  17.8k|  return Read(fd, buf, buflen);
   37|  17.8k|}

_ZN9TlsSocket13DummyPrSocketC2EPKhm:
   18|  8.85k|  DummyPrSocket(const uint8_t *buf, size_t len) : buf_(buf), len_(len) {}

LLVMFuzzerTestOneInput:
   28|  8.85k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   29|  8.85k|  static NSSDatabase db = NSSDatabase();
   30|  8.85k|  static PRDescIdentity id = PR_GetUniqueIdentity("fuzz-client");
   31|       |
   32|       |  // Create and import dummy socket.
   33|  8.85k|  TlsSocket::DummyPrSocket socket = TlsSocket::DummyPrSocket(data, size);
   34|  8.85k|  ScopedPRFileDesc prFd(DummyIOLayerMethods::CreateFD(id, &socket));
   35|  8.85k|  PRFileDesc* sslFd = ImportFD(nullptr, prFd.get());
  ------------------
  |  |   23|  8.85k|#define ImportFD DTLS_ImportFD
  ------------------
   36|  8.85k|  assert(sslFd == prFd.get());
   37|       |
   38|       |  // Derive client config from input data.
   39|  8.85k|  TlsClient::Config config = TlsClient::Config(data, size);
   40|       |
   41|  8.85k|  if (ssl_trace >= 90) {
  ------------------
  |  Branch (41:7): [True: 0, False: 8.85k]
  ------------------
   42|      0|    std::cerr << config << "\n";
   43|      0|  }
   44|       |
   45|       |  // Reset the RNG state.
   46|  8.85k|  assert(RNG_RandomUpdate(NULL, 0) == SECSuccess);
   47|  8.85k|  assert(SSL_SetURL(sslFd, "fuzz.client") == SECSuccess);
   48|       |
   49|  8.85k|  TlsCommon::EnableAllProtocolVersions();
   50|  8.85k|  TlsCommon::EnableAllCipherSuites(sslFd);
   51|  8.85k|  TlsCommon::FixTime(sslFd);
   52|       |
   53|       |  // Set socket callbacks & options from client config.
   54|  8.85k|  config.SetCallbacks(sslFd);
   55|  8.85k|  config.SetSocketOptions(sslFd);
   56|       |
   57|       |  // Perform the acutal handshake.
   58|  8.85k|  TlsCommon::DoHandshake(sslFd, false);
   59|       |
   60|       |  // Release all SIDs.
   61|  8.85k|  SSL_ClearSessionCache();
   62|       |
   63|  8.85k|  return 0;
   64|  8.85k|}

nssArena_verifyPointer:
  153|  26.2k|{
  154|  26.2k|    PRStatus rv;
  155|       |
  156|  26.2k|    rv = nssPointerTracker_initialize(&arena_pointer_tracker);
  157|  26.2k|    if (PR_SUCCESS != rv) {
  ------------------
  |  Branch (157:9): [True: 0, False: 26.2k]
  ------------------
  158|       |        /*
  159|       |         * This is a little disingenious.  We have to initialize the
  160|       |         * tracker, because someone could "legitimately" try to verify
  161|       |         * an arena pointer before one is ever created.  And this step
  162|       |         * might fail, due to lack of memory.  But the only way that
  163|       |         * this step can fail is if it's doing the call_once stuff,
  164|       |         * (later calls just no-op).  And if it didn't no-op, there
  165|       |         * aren't any valid arenas.. so the argument certainly isn't one.
  166|       |         */
  167|      0|        nss_SetError(NSS_ERROR_INVALID_ARENA);
  168|      0|        return PR_FAILURE;
  169|      0|    }
  170|       |
  171|  26.2k|    rv = nssPointerTracker_verify(&arena_pointer_tracker, arena);
  172|  26.2k|    if (PR_SUCCESS != rv) {
  ------------------
  |  Branch (172:9): [True: 0, False: 26.2k]
  ------------------
  173|      0|        nss_SetError(NSS_ERROR_INVALID_ARENA);
  174|      0|        return PR_FAILURE;
  175|      0|    }
  176|       |
  177|  26.2k|    return PR_SUCCESS;
  178|  26.2k|}
NSSArena_Create:
  328|      2|{
  329|      2|    nss_ClearErrorStack();
  330|      2|    return nssArena_Create();
  331|      2|}
nssArena_Create:
  350|  10.6k|{
  351|  10.6k|    NSSArena *rv = (NSSArena *)NULL;
  352|       |
  353|  10.6k|    rv = nss_ZNEW((NSSArena *)NULL, NSSArena);
  ------------------
  |  |  348|  10.6k|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  354|  10.6k|    if ((NSSArena *)NULL == rv) {
  ------------------
  |  Branch (354:9): [True: 0, False: 10.6k]
  ------------------
  355|      0|        nss_SetError(NSS_ERROR_NO_MEMORY);
  356|      0|        return (NSSArena *)NULL;
  357|      0|    }
  358|       |
  359|  10.6k|    rv->lock = PR_NewLock();
  360|  10.6k|    if ((PRLock *)NULL == rv->lock) {
  ------------------
  |  Branch (360:9): [True: 0, False: 10.6k]
  ------------------
  361|      0|        (void)nss_ZFreeIf(rv);
  362|      0|        nss_SetError(NSS_ERROR_NO_MEMORY);
  363|      0|        return (NSSArena *)NULL;
  364|      0|    }
  365|       |
  366|       |    /*
  367|       |     * Arena sizes.  The current security code has 229 occurrences of
  368|       |     * PORT_NewArena.  The default chunksizes specified break down as
  369|       |     *
  370|       |     *  Size    Mult.   Specified as
  371|       |     *   512       1    512
  372|       |     *  1024       7    1024
  373|       |     *  2048       5    2048
  374|       |     *  2048       5    CRMF_DEFAULT_ARENA_SIZE
  375|       |     *  2048     190    DER_DEFAULT_CHUNKSIZE
  376|       |     *  2048      20    SEC_ASN1_DEFAULT_ARENA_SIZE
  377|       |     *  4096       1    4096
  378|       |     *
  379|       |     * Obviously this "default chunksize" flexibility isn't very
  380|       |     * useful to us, so I'll just pick 2048.
  381|       |     */
  382|       |
  383|  10.6k|    PL_InitArenaPool(&rv->pool, "NSS", 2048, sizeof(double));
  384|       |
  385|  10.6k|#ifdef DEBUG
  386|  10.6k|    {
  387|  10.6k|        PRStatus st;
  388|  10.6k|        st = arena_add_pointer(rv);
  389|  10.6k|        if (PR_SUCCESS != st) {
  ------------------
  |  Branch (389:13): [True: 0, False: 10.6k]
  ------------------
  390|      0|            PL_FinishArenaPool(&rv->pool);
  391|      0|            PR_DestroyLock(rv->lock);
  392|      0|            (void)nss_ZFreeIf(rv);
  393|      0|            return (NSSArena *)NULL;
  394|      0|        }
  395|  10.6k|    }
  396|  10.6k|#endif /* DEBUG */
  397|       |
  398|  10.6k|    return rv;
  399|  10.6k|}
NSSArena_Destroy:
  419|  5.21k|{
  420|  5.21k|    nss_ClearErrorStack();
  421|       |
  422|  5.21k|#ifdef DEBUG
  423|  5.21k|    if (PR_SUCCESS != nssArena_verifyPointer(arena)) {
  ------------------
  |  Branch (423:9): [True: 0, False: 5.21k]
  ------------------
  424|      0|        return PR_FAILURE;
  425|      0|    }
  426|  5.21k|#endif /* DEBUG */
  427|       |
  428|  5.21k|    return nssArena_Destroy(arena);
  429|  5.21k|}
nssArena_Destroy:
  449|  10.6k|{
  450|  10.6k|    PRLock *lock;
  451|       |
  452|       |#ifdef NSSDEBUG
  453|       |    if (PR_SUCCESS != nssArena_verifyPointer(arena)) {
  454|       |        return PR_FAILURE;
  455|       |    }
  456|       |#endif /* NSSDEBUG */
  457|       |
  458|  10.6k|    if ((PRLock *)NULL == arena->lock) {
  ------------------
  |  Branch (458:9): [True: 0, False: 10.6k]
  ------------------
  459|       |        /* Just got destroyed */
  460|      0|        nss_SetError(NSS_ERROR_INVALID_ARENA);
  461|      0|        return PR_FAILURE;
  462|      0|    }
  463|  10.6k|    PR_Lock(arena->lock);
  464|       |
  465|  10.6k|#ifdef DEBUG
  466|  10.6k|    if (PR_SUCCESS != arena_remove_pointer(arena)) {
  ------------------
  |  Branch (466:9): [True: 0, False: 10.6k]
  ------------------
  467|      0|        PR_Unlock(arena->lock);
  468|      0|        return PR_FAILURE;
  469|      0|    }
  470|  10.6k|#endif /* DEBUG */
  471|       |
  472|  10.6k|#ifdef ARENA_DESTRUCTOR_LIST
  473|       |    /* Note that the arena is locked at this time */
  474|  10.6k|    nss_arena_call_destructor_chain(arena->first_destructor);
  475|  10.6k|#endif /* ARENA_DESTRUCTOR_LIST */
  476|       |
  477|  10.6k|    PL_FinishArenaPool(&arena->pool);
  478|  10.6k|    lock = arena->lock;
  479|  10.6k|    arena->lock = (PRLock *)NULL;
  480|  10.6k|    PR_Unlock(lock);
  481|  10.6k|    PR_DestroyLock(lock);
  482|  10.6k|    (void)nss_ZFreeIf(arena);
  483|  10.6k|    return PR_SUCCESS;
  484|  10.6k|}
nss_ZAlloc:
  823|   105k|{
  824|   105k|    struct pointer_header *h;
  825|   105k|    PRUint32 my_size = size + sizeof(struct pointer_header);
  826|       |
  827|   105k|    if (my_size < sizeof(struct pointer_header)) {
  ------------------
  |  Branch (827:9): [True: 0, False: 105k]
  ------------------
  828|       |        /* Wrapped */
  829|      0|        nss_SetError(NSS_ERROR_NO_MEMORY);
  830|      0|        return (void *)NULL;
  831|      0|    }
  832|       |
  833|   105k|    if ((NSSArena *)NULL == arenaOpt) {
  ------------------
  |  Branch (833:9): [True: 57.6k, False: 47.5k]
  ------------------
  834|       |        /* Heap allocation, no locking required. */
  835|  57.6k|        h = (struct pointer_header *)PR_Calloc(1, my_size);
  836|  57.6k|        if ((struct pointer_header *)NULL == h) {
  ------------------
  |  Branch (836:13): [True: 0, False: 57.6k]
  ------------------
  837|      0|            nss_SetError(NSS_ERROR_NO_MEMORY);
  838|      0|            return (void *)NULL;
  839|      0|        }
  840|       |
  841|  57.6k|        h->arena = (NSSArena *)NULL;
  842|  57.6k|        h->size = size;
  843|       |        /* We used calloc: it's already zeroed */
  844|       |
  845|  57.6k|        return (void *)((char *)h + sizeof(struct pointer_header));
  846|  57.6k|    } else {
  847|  47.5k|        void *rv;
  848|       |/* Arena allocation */
  849|       |#ifdef NSSDEBUG
  850|       |        if (PR_SUCCESS != nssArena_verifyPointer(arenaOpt)) {
  851|       |            return (void *)NULL;
  852|       |        }
  853|       |#endif /* NSSDEBUG */
  854|       |
  855|  47.5k|        if ((PRLock *)NULL == arenaOpt->lock) {
  ------------------
  |  Branch (855:13): [True: 0, False: 47.5k]
  ------------------
  856|       |            /* Just got destroyed */
  857|      0|            nss_SetError(NSS_ERROR_INVALID_ARENA);
  858|      0|            return (void *)NULL;
  859|      0|        }
  860|  47.5k|        PR_Lock(arenaOpt->lock);
  861|       |
  862|  47.5k|#ifdef ARENA_THREADMARK
  863|  47.5k|        if ((PRThread *)NULL != arenaOpt->marking_thread) {
  ------------------
  |  Branch (863:13): [True: 0, False: 47.5k]
  ------------------
  864|      0|            if (PR_GetCurrentThread() != arenaOpt->marking_thread) {
  ------------------
  |  Branch (864:17): [True: 0, False: 0]
  ------------------
  865|      0|                nss_SetError(NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD);
  866|      0|                PR_Unlock(arenaOpt->lock);
  867|      0|                return (void *)NULL;
  868|      0|            }
  869|      0|        }
  870|  47.5k|#endif /* ARENA_THREADMARK */
  871|       |
  872|  47.5k|        rv = nss_zalloc_arena_locked(arenaOpt, size);
  873|       |
  874|  47.5k|        PR_Unlock(arenaOpt->lock);
  875|  47.5k|        return rv;
  876|  47.5k|    }
  877|       |    /*NOTREACHED*/
  878|   105k|}
nss_ZFreeIf:
  923|  73.2k|{
  924|  73.2k|    struct pointer_header *h;
  925|       |
  926|  73.2k|    if ((void *)NULL == pointer) {
  ------------------
  |  Branch (926:9): [True: 5.21k, False: 68.0k]
  ------------------
  927|  5.21k|        return PR_SUCCESS;
  928|  5.21k|    }
  929|       |
  930|  68.0k|    h = (struct pointer_header *)((char *)pointer -
  931|  68.0k|                                  sizeof(struct pointer_header));
  932|       |
  933|       |    /* Check any magic here */
  934|       |
  935|  68.0k|    if ((NSSArena *)NULL == h->arena) {
  ------------------
  |  Branch (935:9): [True: 57.6k, False: 10.4k]
  ------------------
  936|       |        /* Heap */
  937|  57.6k|        (void)nsslibc_memset(pointer, 0, h->size);
  938|  57.6k|        PR_Free(h);
  939|  57.6k|        return PR_SUCCESS;
  940|  57.6k|    } else {
  941|       |/* Arena */
  942|       |#ifdef NSSDEBUG
  943|       |        if (PR_SUCCESS != nssArena_verifyPointer(h->arena)) {
  944|       |            return PR_FAILURE;
  945|       |        }
  946|       |#endif /* NSSDEBUG */
  947|       |
  948|  10.4k|        if ((PRLock *)NULL == h->arena->lock) {
  ------------------
  |  Branch (948:13): [True: 0, False: 10.4k]
  ------------------
  949|       |            /* Just got destroyed.. so this pointer is invalid */
  950|      0|            nss_SetError(NSS_ERROR_INVALID_POINTER);
  951|      0|            return PR_FAILURE;
  952|      0|        }
  953|  10.4k|        PR_Lock(h->arena->lock);
  954|       |
  955|  10.4k|        (void)nsslibc_memset(pointer, 0, h->size);
  956|       |
  957|       |        /* No way to "free" it within an NSPR arena. */
  958|       |
  959|  10.4k|        PR_Unlock(h->arena->lock);
  960|  10.4k|        return PR_SUCCESS;
  961|  10.4k|    }
  962|       |    /*NOTREACHED*/
  963|  68.0k|}
nssArena_Shutdown:
 1137|      1|{
 1138|      1|    PRStatus rv = PR_SUCCESS;
 1139|      1|#ifdef DEBUG
 1140|      1|    rv = nssPointerTracker_finalize(&arena_pointer_tracker);
 1141|      1|#endif
 1142|      1|    return rv;
 1143|      1|}
arena.c:arena_add_pointer:
  100|  10.6k|{
  101|  10.6k|    PRStatus rv;
  102|       |
  103|  10.6k|    rv = nssPointerTracker_initialize(&arena_pointer_tracker);
  104|  10.6k|    if (PR_SUCCESS != rv) {
  ------------------
  |  Branch (104:9): [True: 0, False: 10.6k]
  ------------------
  105|      0|        return rv;
  106|      0|    }
  107|       |
  108|  10.6k|    rv = nssPointerTracker_add(&arena_pointer_tracker, arena);
  109|  10.6k|    if (PR_SUCCESS != rv) {
  ------------------
  |  Branch (109:9): [True: 0, False: 10.6k]
  ------------------
  110|      0|        NSSError e = NSS_GetError();
  111|      0|        if (NSS_ERROR_NO_MEMORY != e) {
  ------------------
  |  Branch (111:13): [True: 0, False: 0]
  ------------------
  112|      0|            nss_SetError(NSS_ERROR_INTERNAL_ERROR);
  113|      0|        }
  114|       |
  115|      0|        return rv;
  116|      0|    }
  117|       |
  118|  10.6k|    return PR_SUCCESS;
  119|  10.6k|}
arena.c:arena_remove_pointer:
  123|  10.6k|{
  124|  10.6k|    PRStatus rv;
  125|       |
  126|  10.6k|    rv = nssPointerTracker_remove(&arena_pointer_tracker, arena);
  127|  10.6k|    if (PR_SUCCESS != rv) {
  ------------------
  |  Branch (127:9): [True: 0, False: 10.6k]
  ------------------
  128|      0|        nss_SetError(NSS_ERROR_INTERNAL_ERROR);
  129|      0|    }
  130|       |
  131|  10.6k|    return rv;
  132|  10.6k|}
arena.c:nss_arena_call_destructor_chain:
  304|  10.6k|{
  305|  10.6k|    for (; it; it = it->next) {
  ------------------
  |  Branch (305:12): [True: 0, False: 10.6k]
  ------------------
  306|      0|        (*(it->destructor))(it->arg);
  307|      0|    }
  308|  10.6k|}
arena.c:nss_zalloc_arena_locked:
  746|  47.5k|{
  747|  47.5k|    void *p;
  748|  47.5k|    void *rv;
  749|  47.5k|    struct pointer_header *h;
  750|  47.5k|    PRUint32 my_size = size + sizeof(struct pointer_header);
  751|  47.5k|    PL_ARENA_ALLOCATE(p, &arena->pool, my_size);
  ------------------
  |  |  150|  47.5k|    PR_BEGIN_MACRO \
  |  |  ------------------
  |  |  |  |  123|  47.5k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  151|  47.5k|        PLArena *_a = (pool)->current; \
  |  |  152|  47.5k|        PRUint32 _nb = PL_ARENA_ALIGN(pool, (PRUint32)nb); \
  |  |  ------------------
  |  |  |  |  146|  47.5k|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  |  |  ------------------
  |  |  153|  47.5k|        PRUword _p = _a->avail; \
  |  |  154|  47.5k|        if (_nb < (PRUint32)nb) { \
  |  |  ------------------
  |  |  |  Branch (154:13): [True: 0, False: 47.5k]
  |  |  ------------------
  |  |  155|      0|            _p = 0; \
  |  |  156|  47.5k|        } else if (_nb > (_a->limit - _a->avail)) { \
  |  |  ------------------
  |  |  |  Branch (156:20): [True: 10.7k, False: 36.8k]
  |  |  ------------------
  |  |  157|  10.7k|            _p = (PRUword)PL_ArenaAllocate(pool, _nb); \
  |  |  158|  36.8k|        } else { \
  |  |  159|  36.8k|            _a->avail += _nb; \
  |  |  160|  36.8k|        } \
  |  |  161|  47.5k|        p = (void *)_p; \
  |  |  162|  47.5k|        if (p) { \
  |  |  ------------------
  |  |  |  Branch (162:13): [True: 47.5k, False: 0]
  |  |  ------------------
  |  |  163|  47.5k|            PL_MAKE_MEM_UNDEFINED(p, (PRUint32)nb); \
  |  |  164|  47.5k|            PL_ArenaCountAllocation(pool, (PRUint32)nb); \
  |  |  165|  47.5k|        } \
  |  |  166|  47.5k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  47.5k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|  47.5k|    if ((void *)NULL == p) {
  ------------------
  |  Branch (752:9): [True: 0, False: 47.5k]
  ------------------
  753|      0|        nss_SetError(NSS_ERROR_NO_MEMORY);
  754|      0|        return (void *)NULL;
  755|      0|    }
  756|       |    /*
  757|       |     * Do this before we unlock.  This way if the user is using
  758|       |     * an arena in one thread while destroying it in another, he'll
  759|       |     * fault/FMR in his code, not ours.
  760|       |     */
  761|  47.5k|    h = (struct pointer_header *)p;
  762|  47.5k|    h->arena = arena;
  763|  47.5k|    h->size = size;
  764|  47.5k|    rv = (void *)((char *)h + sizeof(struct pointer_header));
  765|  47.5k|    (void)nsslibc_memset(rv, 0, size);
  766|  47.5k|    return rv;
  767|  47.5k|}

NSS_GetErrorStack:
  219|    193|{
  220|    193|    error_stack *es = error_get_my_stack();
  221|       |
  222|    193|    if ((error_stack *)NULL == es) {
  ------------------
  |  Branch (222:9): [True: 0, False: 193]
  ------------------
  223|      0|        return (PRInt32 *)NULL;
  224|      0|    }
  225|       |
  226|       |    /* Make sure it's terminated */
  227|    193|    es->stack[es->header.count] = 0;
  228|       |
  229|    193|    return es->stack;
  230|    193|}
nss_SetError:
  242|  31.3k|{
  243|  31.3k|    error_stack *es;
  244|       |
  245|  31.3k|    if (0 == error) {
  ------------------
  |  Branch (245:9): [True: 0, False: 31.3k]
  ------------------
  246|      0|        nss_ClearErrorStack();
  247|      0|        return;
  248|      0|    }
  249|       |
  250|  31.3k|    es = error_get_my_stack();
  251|  31.3k|    if ((error_stack *)NULL == es) {
  ------------------
  |  Branch (251:9): [True: 0, False: 31.3k]
  ------------------
  252|       |        /* Oh, well. */
  253|      0|        return;
  254|      0|    }
  255|       |
  256|  31.3k|    if (es->header.count < es->header.space) {
  ------------------
  |  Branch (256:9): [True: 31.3k, False: 0]
  ------------------
  257|  31.3k|        es->stack[es->header.count++] = error;
  258|  31.3k|    } else {
  259|      0|        memmove(es->stack, es->stack + 1,
  260|      0|                (es->header.space - 1) * (sizeof es->stack[0]));
  261|      0|        es->stack[es->header.space - 1] = error;
  262|      0|    }
  263|  31.3k|    return;
  264|  31.3k|}
nss_ClearErrorStack:
  274|  5.21k|{
  275|  5.21k|    error_stack *es = error_get_my_stack();
  276|  5.21k|    if ((error_stack *)NULL == es) {
  ------------------
  |  Branch (276:9): [True: 0, False: 5.21k]
  ------------------
  277|       |        /* Oh, well. */
  278|      0|        return;
  279|      0|    }
  280|       |
  281|  5.21k|    es->header.count = 0;
  282|  5.21k|    es->stack[0] = 0;
  283|  5.21k|    return;
  284|  5.21k|}
nss_DestroyErrorStack:
  294|      1|{
  295|      1|    if (INVALID_TPD_INDEX != error_stack_index) {
  ------------------
  |  |   51|      1|#define INVALID_TPD_INDEX UINT_MAX
  ------------------
  |  Branch (295:9): [True: 1, False: 0]
  ------------------
  296|      1|        PR_SetThreadPrivate(error_stack_index, NULL);
  297|      1|        error_stack_index = INVALID_TPD_INDEX;
  ------------------
  |  |   51|      1|#define INVALID_TPD_INDEX UINT_MAX
  ------------------
  298|      1|        error_call_once = error_call_again; /* allow to init again */
  299|      1|    }
  300|      1|    return;
  301|      1|}
error.c:error_get_my_stack:
  110|  36.7k|{
  111|  36.7k|    PRStatus st;
  112|  36.7k|    error_stack *rv;
  113|  36.7k|    PRUintn new_size;
  114|  36.7k|    PRUint32 new_bytes;
  115|  36.7k|    error_stack *new_stack;
  116|       |
  117|  36.7k|    if (INVALID_TPD_INDEX == error_stack_index) {
  ------------------
  |  |   51|  36.7k|#define INVALID_TPD_INDEX UINT_MAX
  ------------------
  |  Branch (117:9): [True: 1, False: 36.7k]
  ------------------
  118|      1|        st = PR_CallOnce(&error_call_once, error_once_function);
  119|      1|        if (PR_SUCCESS != st) {
  ------------------
  |  Branch (119:13): [True: 0, False: 1]
  ------------------
  120|      0|            return (error_stack *)NULL;
  121|      0|        }
  122|      1|    }
  123|       |
  124|  36.7k|    rv = (error_stack *)PR_GetThreadPrivate(error_stack_index);
  125|  36.7k|    if ((error_stack *)NULL == rv) {
  ------------------
  |  Branch (125:9): [True: 1, False: 36.7k]
  ------------------
  126|       |        /* Doesn't exist; create one */
  127|      1|        new_size = 16;
  128|  36.7k|    } else if (rv->header.count == rv->header.space &&
  ------------------
  |  Branch (128:16): [True: 0, False: 36.7k]
  ------------------
  129|  36.7k|               rv->header.count < NSS_MAX_ERROR_STACK_COUNT) {
  ------------------
  |  |   22|      0|#define NSS_MAX_ERROR_STACK_COUNT 16 /* error codes */
  ------------------
  |  Branch (129:16): [True: 0, False: 0]
  ------------------
  130|       |        /* Too small, expand it */
  131|      0|        new_size = PR_MIN(rv->header.space * 2, NSS_MAX_ERROR_STACK_COUNT);
  ------------------
  |  |  158|      0|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  132|  36.7k|    } else {
  133|       |        /* Okay, return it */
  134|  36.7k|        return rv;
  135|  36.7k|    }
  136|       |
  137|      1|    new_bytes = (new_size * sizeof(PRInt32)) + sizeof(error_stack);
  138|       |    /* Use NSPR's calloc/realloc, not NSS's, to avoid loops! */
  139|      1|    new_stack = PR_Calloc(1, new_bytes);
  140|       |
  141|      1|    if ((error_stack *)NULL != new_stack) {
  ------------------
  |  Branch (141:9): [True: 1, False: 0]
  ------------------
  142|      1|        if ((error_stack *)NULL != rv) {
  ------------------
  |  Branch (142:13): [True: 0, False: 1]
  ------------------
  143|      0|            (void)nsslibc_memcpy(new_stack, rv, rv->header.space);
  144|      0|        }
  145|      1|        new_stack->header.space = new_size;
  146|      1|    }
  147|       |
  148|       |    /* Set the value, whether or not the allocation worked */
  149|      1|    PR_SetThreadPrivate(error_stack_index, new_stack);
  150|      1|    return new_stack;
  151|  36.7k|}
error.c:error_once_function:
   71|      1|{
   72|       |
   73|       |/*
   74|       | * This #ifdef function is redundant. It performs the same thing as the
   75|       | * else case.
   76|       | *
   77|       | * However, the MinGW version looks up the function from nss3's export
   78|       | * table, and on MinGW _that_ behaves differently than passing a
   79|       | * function pointer in a different module because MinGW has
   80|       | * -mnop-fun-dllimport specified, which generates function thunks for
   81|       | * cross-module calls. And when a module (like nssckbi) gets unloaded,
   82|       | * and you try to call into that thunk (which is now missing) you'll
   83|       | * crash. So we do this bit of ugly to avoid that crash. Fortunately
   84|       | * this is the only place we've had to do this.
   85|       | */
   86|       |#if defined(__MINGW32__)
   87|       |    HMODULE nss3 = GetModuleHandleW(L"nss3");
   88|       |    if (nss3) {
   89|       |        PRThreadPrivateDTOR freePtr = (PRThreadPrivateDTOR)GetProcAddress(nss3, "PR_Free");
   90|       |        if (freePtr) {
   91|       |            return PR_NewThreadPrivateIndex(&error_stack_index, freePtr);
   92|       |        }
   93|       |    }
   94|       |    return PR_NewThreadPrivateIndex(&error_stack_index, PR_Free);
   95|       |#else
   96|      1|    return PR_NewThreadPrivateIndex(&error_stack_index, PR_Free);
   97|      1|#endif
   98|      1|}

nssHash_Create:
   80|      6|{
   81|      6|    nssHash *rv;
   82|      6|    NSSArena *arena;
   83|      6|    PRBool i_alloced;
   84|       |
   85|       |#ifdef NSSDEBUG
   86|       |    if (arenaOpt && PR_SUCCESS != nssArena_verifyPointer(arenaOpt)) {
   87|       |        nss_SetError(NSS_ERROR_INVALID_POINTER);
   88|       |        return (nssHash *)NULL;
   89|       |    }
   90|       |#endif /* NSSDEBUG */
   91|       |
   92|      6|    if (arenaOpt) {
  ------------------
  |  Branch (92:9): [True: 6, False: 0]
  ------------------
   93|      6|        arena = arenaOpt;
   94|      6|        i_alloced = PR_FALSE;
  ------------------
  |  |  438|      6|#define PR_FALSE 0
  ------------------
   95|      6|    } else {
   96|      0|        arena = nssArena_Create();
   97|      0|        i_alloced = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
   98|      0|    }
   99|       |
  100|      6|    rv = nss_ZNEW(arena, nssHash);
  ------------------
  |  |  348|      6|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  101|      6|    if ((nssHash *)NULL == rv) {
  ------------------
  |  Branch (101:9): [True: 0, False: 6]
  ------------------
  102|      0|        goto loser;
  103|      0|    }
  104|       |
  105|      6|    rv->mutex = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      6|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  106|      6|    if ((PZLock *)NULL == rv->mutex) {
  ------------------
  |  Branch (106:9): [True: 0, False: 6]
  ------------------
  107|      0|        goto loser;
  108|      0|    }
  109|       |
  110|      6|    rv->plHashTable =
  111|      6|        PL_NewHashTable(numBuckets, keyHash, keyCompare, valueCompare,
  112|      6|                        &nssArenaHashAllocOps, arena);
  113|      6|    if ((PLHashTable *)NULL == rv->plHashTable) {
  ------------------
  |  Branch (113:9): [True: 0, False: 6]
  ------------------
  114|      0|        (void)PZ_DestroyLock(rv->mutex);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  115|      0|        goto loser;
  116|      0|    }
  117|       |
  118|      6|    rv->count = 0;
  119|      6|    rv->arena = arena;
  120|      6|    rv->i_alloced_arena = i_alloced;
  121|       |
  122|      6|    return rv;
  123|      0|loser:
  124|      0|    (void)nss_ZFreeIf(rv);
  125|      0|    return (nssHash *)NULL;
  126|      6|}
nssHash_CreateString:
  145|      2|{
  146|      2|    return nssHash_Create(arenaOpt, numBuckets, PL_HashString,
  147|      2|                          PL_CompareStrings, PL_CompareStrings);
  148|      2|}
nssHash_CreateItem:
  156|      2|{
  157|      2|    return nssHash_Create(arenaOpt, numBuckets, nss_item_hash,
  158|      2|                          nss_compare_items, PL_CompareValues);
  159|      2|}
nssHash_Destroy:
  167|      6|{
  168|      6|    (void)PZ_DestroyLock(hash->mutex);
  ------------------
  |  |  244|      6|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  169|      6|    PL_HashTableDestroy(hash->plHashTable);
  170|      6|    if (hash->i_alloced_arena) {
  ------------------
  |  Branch (170:9): [True: 0, False: 6]
  ------------------
  171|      0|        nssArena_Destroy(hash->arena);
  172|      6|    } else {
  173|      6|        nss_ZFreeIf(hash);
  174|      6|    }
  175|      6|}
nssHash_Add:
  183|  10.4k|{
  184|  10.4k|    PRStatus error = PR_FAILURE;
  185|  10.4k|    PLHashEntry *he;
  186|       |
  187|  10.4k|    PZ_Lock(hash->mutex);
  ------------------
  |  |  245|  10.4k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  188|       |
  189|  10.4k|    he = PL_HashTableAdd(hash->plHashTable, key, (void *)value);
  190|  10.4k|    if ((PLHashEntry *)NULL == he) {
  ------------------
  |  Branch (190:9): [True: 0, False: 10.4k]
  ------------------
  191|      0|        nss_SetError(NSS_ERROR_NO_MEMORY);
  192|  10.4k|    } else if (he->value != value) {
  ------------------
  |  Branch (192:16): [True: 0, False: 10.4k]
  ------------------
  193|      0|        nss_SetError(NSS_ERROR_HASH_COLLISION);
  194|  10.4k|    } else {
  195|  10.4k|        hash->count++;
  196|  10.4k|        error = PR_SUCCESS;
  197|  10.4k|    }
  198|       |
  199|  10.4k|    (void)PZ_Unlock(hash->mutex);
  ------------------
  |  |  246|  10.4k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  200|       |
  201|  10.4k|    return error;
  202|  10.4k|}
nssHash_Remove:
  210|  10.4k|{
  211|  10.4k|    PRBool found;
  212|       |
  213|  10.4k|    PZ_Lock(hash->mutex);
  ------------------
  |  |  245|  10.4k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  214|       |
  215|  10.4k|    found = PL_HashTableRemove(hash->plHashTable, it);
  216|  10.4k|    if (found) {
  ------------------
  |  Branch (216:9): [True: 10.4k, False: 0]
  ------------------
  217|  10.4k|        hash->count--;
  218|  10.4k|    }
  219|       |
  220|  10.4k|    (void)PZ_Unlock(hash->mutex);
  ------------------
  |  |  246|  10.4k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  221|  10.4k|    return;
  222|  10.4k|}
nssHash_Count:
  230|      2|{
  231|      2|    PRUint32 count;
  232|       |
  233|      2|    PZ_Lock(hash->mutex);
  ------------------
  |  |  245|      2|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  234|       |
  235|      2|    count = hash->count;
  236|       |
  237|      2|    (void)PZ_Unlock(hash->mutex);
  ------------------
  |  |  246|      2|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  238|       |
  239|      2|    return count;
  240|      2|}
nssHash_Lookup:
  270|  41.7k|{
  271|  41.7k|    void *rv;
  272|       |
  273|  41.7k|    PZ_Lock(hash->mutex);
  ------------------
  |  |  245|  41.7k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  274|       |
  275|  41.7k|    rv = PL_HashTableLookup(hash->plHashTable, it);
  276|       |
  277|  41.7k|    (void)PZ_Unlock(hash->mutex);
  ------------------
  |  |  246|  41.7k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  278|       |
  279|  41.7k|    return rv;
  280|  41.7k|}
hash.c:nss_item_hash:
   56|  20.8k|{
   57|  20.8k|    unsigned int i;
   58|  20.8k|    PLHashNumber h;
   59|  20.8k|    NSSItem *it = (NSSItem *)key;
   60|  20.8k|    h = 0;
   61|   397k|    for (i = 0; i < it->size; i++)
  ------------------
  |  Branch (61:17): [True: 377k, False: 20.8k]
  ------------------
   62|   377k|        h = PR_ROTATE_LEFT32(h, 4) ^ ((unsigned char *)it->data)[i];
  ------------------
  |  |  147|   377k|#define PR_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits))))
  ------------------
   63|  20.8k|    return h;
   64|  20.8k|}
hash.c:nss_compare_items:
   68|  10.4k|{
   69|  10.4k|    PRStatus ignore;
   70|  10.4k|    return (int)nssItem_Equal((NSSItem *)v1, (NSSItem *)v2, &ignore);
   71|  10.4k|}

hashops.c:nss_arena_hash_alloc_table:
   17|     12|{
   18|     12|    NSSArena *arena = (NSSArena *)NULL;
   19|       |
   20|       |#ifdef NSSDEBUG
   21|       |    if ((void *)NULL != arena) {
   22|       |        if (PR_SUCCESS != nssArena_verifyPointer(arena)) {
   23|       |            return (void *)NULL;
   24|       |        }
   25|       |    }
   26|       |#endif /* NSSDEBUG */
   27|       |
   28|     12|    return nss_ZAlloc(arena, size);
   29|     12|}
hashops.c:nss_arena_hash_free_table:
   33|     12|{
   34|     12|    (void)nss_ZFreeIf(item);
   35|     12|}
hashops.c:nss_arena_hash_alloc_entry:
   39|  10.4k|{
   40|  10.4k|    NSSArena *arena = NULL;
   41|       |
   42|       |#ifdef NSSDEBUG
   43|       |    if ((void *)NULL != arena) {
   44|       |        if (PR_SUCCESS != nssArena_verifyPointer(arena)) {
   45|       |            return (void *)NULL;
   46|       |        }
   47|       |    }
   48|       |#endif /* NSSDEBUG */
   49|       |
   50|  10.4k|    return nss_ZNEW(arena, PLHashEntry);
  ------------------
  |  |  348|  10.4k|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
   51|  10.4k|}
hashops.c:nss_arena_hash_free_entry:
   55|  10.4k|{
   56|  10.4k|    if (HT_FREE_ENTRY == flag) {
  ------------------
  |  |   39|  10.4k|#define HT_FREE_ENTRY   1               /* free value and entire entry */
  ------------------
  |  Branch (56:9): [True: 10.4k, False: 0]
  ------------------
   57|  10.4k|        (void)nss_ZFreeIf(he);
   58|  10.4k|    }
   59|  10.4k|}

nssItem_Create:
   34|  21.0k|{
   35|  21.0k|    NSSItem *rv = (NSSItem *)NULL;
   36|       |
   37|  21.0k|#ifdef DEBUG
   38|  21.0k|    if ((NSSArena *)NULL != arenaOpt) {
  ------------------
  |  Branch (38:9): [True: 21.0k, False: 0]
  ------------------
   39|  21.0k|        if (PR_SUCCESS != nssArena_verifyPointer(arenaOpt)) {
  ------------------
  |  Branch (39:13): [True: 0, False: 21.0k]
  ------------------
   40|      0|            return (NSSItem *)NULL;
   41|      0|        }
   42|  21.0k|    }
   43|       |
   44|  21.0k|    if ((const void *)NULL == data) {
  ------------------
  |  Branch (44:9): [True: 0, False: 21.0k]
  ------------------
   45|      0|        if (length > 0) {
  ------------------
  |  Branch (45:13): [True: 0, False: 0]
  ------------------
   46|      0|            nss_SetError(NSS_ERROR_INVALID_POINTER);
   47|      0|            return (NSSItem *)NULL;
   48|      0|        }
   49|      0|    }
   50|  21.0k|#endif /* DEBUG */
   51|       |
   52|  21.0k|    if ((NSSItem *)NULL == rvOpt) {
  ------------------
  |  Branch (52:9): [True: 0, False: 21.0k]
  ------------------
   53|      0|        rv = (NSSItem *)nss_ZNEW(arenaOpt, NSSItem);
  ------------------
  |  |  348|      0|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
   54|      0|        if ((NSSItem *)NULL == rv) {
  ------------------
  |  Branch (54:13): [True: 0, False: 0]
  ------------------
   55|      0|            goto loser;
   56|      0|        }
   57|  21.0k|    } else {
   58|  21.0k|        rv = rvOpt;
   59|  21.0k|    }
   60|       |
   61|  21.0k|    rv->size = length;
   62|  21.0k|    rv->data = nss_ZAlloc(arenaOpt, length);
   63|  21.0k|    if ((void *)NULL == rv->data) {
  ------------------
  |  Branch (63:9): [True: 0, False: 21.0k]
  ------------------
   64|      0|        goto loser;
   65|      0|    }
   66|       |
   67|  21.0k|    if (length > 0) {
  ------------------
  |  Branch (67:9): [True: 21.0k, False: 0]
  ------------------
   68|  21.0k|        (void)nsslibc_memcpy(rv->data, data, length);
   69|  21.0k|    }
   70|       |
   71|  21.0k|    return rv;
   72|       |
   73|      0|loser:
   74|      0|    if (rv != rvOpt) {
  ------------------
  |  Branch (74:9): [True: 0, False: 0]
  ------------------
   75|      0|        nss_ZFreeIf(rv);
   76|      0|    }
   77|       |
   78|      0|    return (NSSItem *)NULL;
   79|  21.0k|}
nssItem_Equal:
  168|  41.7k|{
  169|  41.7k|    if ((PRStatus *)NULL != statusOpt) {
  ------------------
  |  Branch (169:9): [True: 41.7k, False: 0]
  ------------------
  170|  41.7k|        *statusOpt = PR_SUCCESS;
  171|  41.7k|    }
  172|       |
  173|  41.7k|    if (((const NSSItem *)NULL == one) && ((const NSSItem *)NULL == two)) {
  ------------------
  |  Branch (173:9): [True: 0, False: 41.7k]
  |  Branch (173:43): [True: 0, False: 0]
  ------------------
  174|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  175|      0|    }
  176|       |
  177|  41.7k|    if (((const NSSItem *)NULL == one) || ((const NSSItem *)NULL == two)) {
  ------------------
  |  Branch (177:9): [True: 0, False: 41.7k]
  |  Branch (177:43): [True: 0, False: 41.7k]
  ------------------
  178|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  179|      0|    }
  180|       |
  181|  41.7k|    if (one->size != two->size) {
  ------------------
  |  Branch (181:9): [True: 0, False: 41.7k]
  ------------------
  182|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  183|      0|    }
  184|       |
  185|  41.7k|    return nsslibc_memequal(one->data, two->data, one->size, statusOpt);
  186|  41.7k|}

nsslibc_memcpy:
   42|  21.0k|{
   43|       |#ifdef NSSDEBUG
   44|       |    if (((void *)NULL == dest) || ((const void *)NULL == source)) {
   45|       |        nss_SetError(NSS_ERROR_INVALID_POINTER);
   46|       |        return (void *)NULL;
   47|       |    }
   48|       |#endif /* NSSDEBUG */
   49|       |
   50|  21.0k|    return memcpy(dest, source, (size_t)n);
   51|  21.0k|}
nsslibc_memset:
   66|   115k|{
   67|       |#ifdef NSSDEBUG
   68|       |    if (((void *)NULL == dest)) {
   69|       |        nss_SetError(NSS_ERROR_INVALID_POINTER);
   70|       |        return (void *)NULL;
   71|       |    }
   72|       |#endif /* NSSDEBUG */
   73|       |
   74|   115k|    return memset(dest, (int)byte, (size_t)n);
   75|   115k|}
nsslibc_memequal:
   92|  41.7k|{
   93|       |#ifdef NSSDEBUG
   94|       |    if ((((void *)NULL == a) || ((void *)NULL == b))) {
   95|       |        nss_SetError(NSS_ERROR_INVALID_POINTER);
   96|       |        if ((PRStatus *)NULL != statusOpt) {
   97|       |            *statusOpt = PR_FAILURE;
   98|       |        }
   99|       |        return PR_FALSE;
  100|       |    }
  101|       |#endif /* NSSDEBUG */
  102|       |
  103|  41.7k|    if ((PRStatus *)NULL != statusOpt) {
  ------------------
  |  Branch (103:9): [True: 41.7k, False: 0]
  ------------------
  104|  41.7k|        *statusOpt = PR_SUCCESS;
  105|  41.7k|    }
  106|       |
  107|  41.7k|    if (0 == memcmp(a, b, len)) {
  ------------------
  |  Branch (107:9): [True: 41.7k, False: 0]
  ------------------
  108|  41.7k|        return PR_TRUE;
  ------------------
  |  |  437|  41.7k|#define PR_TRUE 1
  ------------------
  109|  41.7k|    } else {
  110|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  111|      0|    }
  112|  41.7k|}

nssList_Create:
   76|  5.21k|{
   77|  5.21k|    NSSArena *arena;
   78|  5.21k|    nssList *list;
   79|  5.21k|    PRBool i_alloced;
   80|  5.21k|    if (arenaOpt) {
  ------------------
  |  Branch (80:9): [True: 1, False: 5.21k]
  ------------------
   81|      1|        arena = arenaOpt;
   82|      1|        i_alloced = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
   83|  5.21k|    } else {
   84|  5.21k|        arena = nssArena_Create();
   85|  5.21k|        i_alloced = PR_TRUE;
  ------------------
  |  |  437|  5.21k|#define PR_TRUE 1
  ------------------
   86|  5.21k|    }
   87|  5.21k|    if (!arena) {
  ------------------
  |  Branch (87:9): [True: 0, False: 5.21k]
  ------------------
   88|      0|        return (nssList *)NULL;
   89|      0|    }
   90|  5.21k|    list = nss_ZNEW(arena, nssList);
  ------------------
  |  |  348|  5.21k|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
   91|  5.21k|    if (!list) {
  ------------------
  |  Branch (91:9): [True: 0, False: 5.21k]
  ------------------
   92|      0|        if (!arenaOpt) {
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  ------------------
   93|      0|            NSSArena_Destroy(arena);
   94|      0|        }
   95|      0|        return (nssList *)NULL;
   96|      0|    }
   97|  5.21k|    if (threadSafe) {
  ------------------
  |  Branch (97:9): [True: 2, False: 5.21k]
  ------------------
   98|      2|        list->lock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
   99|      2|        if (!list->lock) {
  ------------------
  |  Branch (99:13): [True: 0, False: 2]
  ------------------
  100|      0|            if (arenaOpt) {
  ------------------
  |  Branch (100:17): [True: 0, False: 0]
  ------------------
  101|      0|                nss_ZFreeIf(list);
  102|      0|            } else {
  103|      0|                NSSArena_Destroy(arena);
  104|      0|            }
  105|      0|            return (nssList *)NULL;
  106|      0|        }
  107|      2|    }
  108|  5.21k|    list->arena = arena;
  109|  5.21k|    list->i_alloced_arena = i_alloced;
  110|  5.21k|    list->compareFunc = pointer_compare;
  111|  5.21k|    return list;
  112|  5.21k|}
nssList_Destroy:
  116|  5.21k|{
  117|  5.21k|    if (!list) {
  ------------------
  |  Branch (117:9): [True: 0, False: 5.21k]
  ------------------
  118|      0|        return PR_SUCCESS;
  119|      0|    }
  120|  5.21k|    if (!list->i_alloced_arena) {
  ------------------
  |  Branch (120:9): [True: 1, False: 5.21k]
  ------------------
  121|      1|        nssList_Clear(list, NULL);
  122|      1|    }
  123|  5.21k|    if (list->lock) {
  ------------------
  |  Branch (123:9): [True: 2, False: 5.21k]
  ------------------
  124|      2|        (void)PZ_DestroyLock(list->lock);
  ------------------
  |  |  244|      2|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  125|      2|    }
  126|  5.21k|    if (list->i_alloced_arena) {
  ------------------
  |  Branch (126:9): [True: 5.21k, False: 1]
  ------------------
  127|  5.21k|        NSSArena_Destroy(list->arena);
  128|  5.21k|        list = NULL;
  129|  5.21k|    }
  130|  5.21k|    nss_ZFreeIf(list);
  131|  5.21k|    return PR_SUCCESS;
  132|  5.21k|}
nssList_SetSortFunction:
  142|  5.21k|{
  143|       |    /* XXX if list already has elements, sort them */
  144|  5.21k|    list->sortFunc = sortFunc;
  145|  5.21k|}
nssList_Clear:
  155|      2|{
  156|      2|    PRCList *link;
  157|      2|    nssListElement *node, *tmp;
  158|      2|    if (!list) {
  ------------------
  |  Branch (158:9): [True: 0, False: 2]
  ------------------
  159|      0|        return;
  160|      0|    }
  161|      2|    NSSLIST_LOCK_IF(list);
  ------------------
  |  |   39|      2|    if ((list)->lock)         \
  |  |  ------------------
  |  |  |  Branch (39:9): [True: 2, False: 0]
  |  |  ------------------
  |  |   40|      2|    PZ_Lock((list)->lock)
  |  |  ------------------
  |  |  |  |  245|      2|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
  162|      2|    node = list->head;
  163|      2|    list->head = NULL;
  164|      4|    while (node && list->count > 0) {
  ------------------
  |  Branch (164:12): [True: 3, False: 1]
  |  Branch (164:20): [True: 2, False: 1]
  ------------------
  165|      2|        if (destructor)
  ------------------
  |  Branch (165:13): [True: 2, False: 0]
  ------------------
  166|      2|            (*destructor)(node->data);
  167|      2|        link = &node->link;
  168|      2|        tmp = (nssListElement *)PR_NEXT_LINK(link);
  ------------------
  |  |   47|      2|        ((_e)->next)
  ------------------
  169|      2|        PR_REMOVE_LINK(link);
  ------------------
  |  |   72|      2|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|      2|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|      2|    (_e)->prev->next = (_e)->next; \
  |  |   74|      2|    (_e)->next->prev = (_e)->prev; \
  |  |   75|      2|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      2|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|      2|        nss_ZFreeIf(node);
  171|      2|        node = tmp;
  172|      2|        --list->count;
  173|      2|    }
  174|      2|    NSSLIST_UNLOCK_IF(list);
  ------------------
  |  |   43|      2|    if ((list)->lock)           \
  |  |  ------------------
  |  |  |  Branch (43:9): [True: 2, False: 0]
  |  |  ------------------
  |  |   44|      2|    PZ_Unlock((list)->lock)
  |  |  ------------------
  |  |  |  |  246|      2|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  175|      2|}
nssList_Add:
  222|  5.21k|{
  223|  5.21k|    NSSLIST_LOCK_IF(list);
  ------------------
  |  |   39|  5.21k|    if ((list)->lock)         \
  |  |  ------------------
  |  |  |  Branch (39:9): [True: 4, False: 5.21k]
  |  |  ------------------
  |  |   40|  5.21k|    PZ_Lock((list)->lock)
  |  |  ------------------
  |  |  |  |  245|      4|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
  224|  5.21k|    (void)nsslist_add_element(list, data);
  225|  5.21k|    NSSLIST_UNLOCK_IF(list);
  ------------------
  |  |   43|  5.21k|    if ((list)->lock)           \
  |  |  ------------------
  |  |  |  Branch (43:9): [True: 4, False: 5.21k]
  |  |  ------------------
  |  |   44|  5.21k|    PZ_Unlock((list)->lock)
  |  |  ------------------
  |  |  |  |  246|      4|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  226|  5.21k|    return PR_SUCCESS;
  227|  5.21k|}
nssList_Remove:
  248|  5.21k|{
  249|  5.21k|    nssListElement *node;
  250|  5.21k|    NSSLIST_LOCK_IF(list);
  ------------------
  |  |   39|  5.21k|    if ((list)->lock)         \
  |  |  ------------------
  |  |  |  Branch (39:9): [True: 0, False: 5.21k]
  |  |  ------------------
  |  |   40|  5.21k|    PZ_Lock((list)->lock)
  |  |  ------------------
  |  |  |  |  245|      0|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
  251|  5.21k|    node = nsslist_get_matching_element(list, data);
  252|  5.21k|    if (node) {
  ------------------
  |  Branch (252:9): [True: 5.21k, False: 0]
  ------------------
  253|  5.21k|        if (node == list->head) {
  ------------------
  |  Branch (253:13): [True: 5.21k, False: 0]
  ------------------
  254|  5.21k|            list->head = (nssListElement *)PR_NEXT_LINK(&node->link);
  ------------------
  |  |   47|  5.21k|        ((_e)->next)
  ------------------
  255|  5.21k|        }
  256|  5.21k|        PR_REMOVE_LINK(&node->link);
  ------------------
  |  |   72|  5.21k|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|  5.21k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|  5.21k|    (_e)->prev->next = (_e)->next; \
  |  |   74|  5.21k|    (_e)->next->prev = (_e)->prev; \
  |  |   75|  5.21k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  5.21k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|  5.21k|        nss_ZFreeIf(node);
  258|  5.21k|        if (--list->count == 0) {
  ------------------
  |  Branch (258:13): [True: 5.21k, False: 0]
  ------------------
  259|  5.21k|            list->head = NULL;
  260|  5.21k|        }
  261|  5.21k|    }
  262|  5.21k|    NSSLIST_UNLOCK_IF(list);
  ------------------
  |  |   43|  5.21k|    if ((list)->lock)           \
  |  |  ------------------
  |  |  |  Branch (43:9): [True: 0, False: 5.21k]
  |  |  ------------------
  |  |   44|  5.21k|    PZ_Unlock((list)->lock)
  |  |  ------------------
  |  |  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  263|  5.21k|    return PR_SUCCESS;
  264|  5.21k|}
nssList_Count:
  278|  20.8k|{
  279|  20.8k|    return list->count;
  280|  20.8k|}
nssList_GetArray:
  284|  15.6k|{
  285|  15.6k|    nssListElement *node;
  286|  15.6k|    PRUint32 i = 0;
  287|  15.6k|    PR_ASSERT(maxElements > 0);
  ------------------
  |  |  208|  15.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 15.6k, False: 0]
  |  |  ------------------
  ------------------
  288|  15.6k|    node = list->head;
  289|  15.6k|    if (!node) {
  ------------------
  |  Branch (289:9): [True: 0, False: 15.6k]
  ------------------
  290|      0|        return PR_SUCCESS;
  291|      0|    }
  292|  15.6k|    NSSLIST_LOCK_IF(list);
  ------------------
  |  |   39|  15.6k|    if ((list)->lock)         \
  |  |  ------------------
  |  |  |  Branch (39:9): [True: 15.6k, False: 0]
  |  |  ------------------
  |  |   40|  15.6k|    PZ_Lock((list)->lock)
  |  |  ------------------
  |  |  |  |  245|  15.6k|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
  293|  31.3k|    while (node) {
  ------------------
  |  Branch (293:12): [True: 31.3k, False: 0]
  ------------------
  294|  31.3k|        rvArray[i++] = node->data;
  295|  31.3k|        if (i == maxElements)
  ------------------
  |  Branch (295:13): [True: 15.6k, False: 15.6k]
  ------------------
  296|  15.6k|            break;
  297|  15.6k|        node = (nssListElement *)PR_NEXT_LINK(&node->link);
  ------------------
  |  |   47|  15.6k|        ((_e)->next)
  ------------------
  298|  15.6k|        if (node == list->head) {
  ------------------
  |  Branch (298:13): [True: 0, False: 15.6k]
  ------------------
  299|      0|            break;
  300|      0|        }
  301|  15.6k|    }
  302|  15.6k|    NSSLIST_UNLOCK_IF(list);
  ------------------
  |  |   43|  15.6k|    if ((list)->lock)           \
  |  |  ------------------
  |  |  |  Branch (43:9): [True: 15.6k, False: 0]
  |  |  ------------------
  |  |   44|  15.6k|    PZ_Unlock((list)->lock)
  |  |  ------------------
  |  |  |  |  246|  15.6k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  303|  15.6k|    return PR_SUCCESS;
  304|  15.6k|}
nssList_Clone:
  308|      1|{
  309|      1|    nssList *rvList;
  310|      1|    nssListElement *node;
  311|      1|    rvList = nssList_Create(NULL, (list->lock != NULL));
  312|      1|    if (!rvList) {
  ------------------
  |  Branch (312:9): [True: 0, False: 1]
  ------------------
  313|      0|        return NULL;
  314|      0|    }
  315|      1|    NSSLIST_LOCK_IF(list);
  ------------------
  |  |   39|      1|    if ((list)->lock)         \
  |  |  ------------------
  |  |  |  Branch (39:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   40|      1|    PZ_Lock((list)->lock)
  |  |  ------------------
  |  |  |  |  245|      1|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
  316|      1|    if (list->count > 0) {
  ------------------
  |  Branch (316:9): [True: 1, False: 0]
  ------------------
  317|      1|        node = list->head;
  318|      2|        while (PR_TRUE) {
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  |  |  ------------------
  |  |  |  Branch (437:17): [Folded - Ignored]
  |  |  ------------------
  ------------------
  319|      2|            nssList_Add(rvList, node->data);
  320|      2|            node = (nssListElement *)PR_NEXT_LINK(&node->link);
  ------------------
  |  |   47|      2|        ((_e)->next)
  ------------------
  321|      2|            if (node == list->head) {
  ------------------
  |  Branch (321:17): [True: 1, False: 1]
  ------------------
  322|      1|                break;
  323|      1|            }
  324|      2|        }
  325|      1|    }
  326|      1|    NSSLIST_UNLOCK_IF(list);
  ------------------
  |  |   43|      1|    if ((list)->lock)           \
  |  |  ------------------
  |  |  |  Branch (43:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   44|      1|    PZ_Unlock((list)->lock)
  |  |  ------------------
  |  |  |  |  246|      1|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  327|      1|    return rvList;
  328|      1|}
nssList_CreateIterator:
  332|      1|{
  333|      1|    nssListIterator *rvIterator;
  334|      1|    rvIterator = nss_ZNEW(NULL, nssListIterator);
  ------------------
  |  |  348|      1|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  335|      1|    if (!rvIterator) {
  ------------------
  |  Branch (335:9): [True: 0, False: 1]
  ------------------
  336|      0|        return NULL;
  337|      0|    }
  338|      1|    rvIterator->list = nssList_Clone(list);
  339|      1|    if (!rvIterator->list) {
  ------------------
  |  Branch (339:9): [True: 0, False: 1]
  ------------------
  340|      0|        nss_ZFreeIf(rvIterator);
  341|      0|        return NULL;
  342|      0|    }
  343|      1|    rvIterator->current = rvIterator->list->head;
  344|      1|    if (list->lock) {
  ------------------
  |  Branch (344:9): [True: 1, False: 0]
  ------------------
  345|      1|        rvIterator->lock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  346|      1|        if (!rvIterator->lock) {
  ------------------
  |  Branch (346:13): [True: 0, False: 1]
  ------------------
  347|      0|            nssList_Destroy(rvIterator->list);
  348|      0|            nss_ZFreeIf(rvIterator);
  349|      0|            rvIterator = NULL;
  350|      0|        }
  351|      1|    }
  352|      1|    return rvIterator;
  353|      1|}
nssListIterator_Destroy:
  357|      1|{
  358|      1|    if (iter->lock) {
  ------------------
  |  Branch (358:9): [True: 1, False: 0]
  ------------------
  359|      1|        (void)PZ_DestroyLock(iter->lock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  360|      1|    }
  361|      1|    if (iter->list) {
  ------------------
  |  Branch (361:9): [True: 1, False: 0]
  ------------------
  362|      1|        nssList_Destroy(iter->list);
  363|      1|    }
  364|      1|    nss_ZFreeIf(iter);
  365|      1|}
list.c:pointer_compare:
   48|  5.21k|{
   49|  5.21k|    return (PRBool)(a == b);
   50|  5.21k|}
list.c:nsslist_add_element:
  179|  5.21k|{
  180|  5.21k|    nssListElement *node = nss_ZNEW(list->arena, nssListElement);
  ------------------
  |  |  348|  5.21k|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  181|  5.21k|    if (!node) {
  ------------------
  |  Branch (181:9): [True: 0, False: 5.21k]
  ------------------
  182|      0|        return PR_FAILURE;
  183|      0|    }
  184|  5.21k|    PR_INIT_CLIST(&node->link);
  ------------------
  |  |  100|  10.4k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  5.21k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  10.4k|    (_l)->next = (_l); \
  |  |  102|  10.4k|    (_l)->prev = (_l); \
  |  |  103|  10.4k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  5.21k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  5.21k|    node->data = data;
  186|  5.21k|    if (list->head) {
  ------------------
  |  Branch (186:9): [True: 2, False: 5.21k]
  ------------------
  187|      2|        if (list->sortFunc) {
  ------------------
  |  Branch (187:13): [True: 0, False: 2]
  ------------------
  188|      0|            PRCList *link;
  189|      0|            nssListElement *currNode;
  190|      0|            currNode = list->head;
  191|       |            /* insert in ordered list */
  192|      0|            while (currNode) {
  ------------------
  |  Branch (192:20): [True: 0, False: 0]
  ------------------
  193|      0|                link = &currNode->link;
  194|      0|                if (list->sortFunc(data, currNode->data) <= 0) {
  ------------------
  |  Branch (194:21): [True: 0, False: 0]
  ------------------
  195|       |                    /* new element goes before current node */
  196|      0|                    PR_INSERT_BEFORE(&node->link, link);
  ------------------
  |  |   25|      0|    PR_BEGIN_MACRO       \
  |  |  ------------------
  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   26|      0|    (_e)->next = (_l);   \
  |  |   27|      0|    (_e)->prev = (_l)->prev; \
  |  |   28|      0|    (_l)->prev->next = (_e); \
  |  |   29|      0|    (_l)->prev = (_e);   \
  |  |   30|      0|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|       |                    /* reset head if this is first */
  198|      0|                    if (currNode == list->head)
  ------------------
  |  Branch (198:25): [True: 0, False: 0]
  ------------------
  199|      0|                        list->head = node;
  200|      0|                    break;
  201|      0|                }
  202|      0|                if (link == PR_LIST_TAIL(&list->head->link)) {
  ------------------
  |  |   66|      0|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
  |  Branch (202:21): [True: 0, False: 0]
  ------------------
  203|       |                    /* reached end of list, append */
  204|      0|                    PR_INSERT_AFTER(&node->link, link);
  ------------------
  |  |   36|      0|    PR_BEGIN_MACRO       \
  |  |  ------------------
  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   37|      0|    (_e)->next = (_l)->next; \
  |  |   38|      0|    (_e)->prev = (_l);   \
  |  |   39|      0|    (_l)->next->prev = (_e); \
  |  |   40|      0|    (_l)->next = (_e);   \
  |  |   41|      0|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|      0|                    break;
  206|      0|                }
  207|      0|                currNode = (nssListElement *)PR_NEXT_LINK(&currNode->link);
  ------------------
  |  |   47|      0|        ((_e)->next)
  ------------------
  208|      0|            }
  209|      2|        } else {
  210|       |            /* not sorting */
  211|      2|            PR_APPEND_LINK(&node->link, &list->head->link);
  ------------------
  |  |   57|      2|#define PR_APPEND_LINK(_e,_l) PR_INSERT_BEFORE(_e,_l)
  |  |  ------------------
  |  |  |  |   25|      2|    PR_BEGIN_MACRO       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|      2|#define PR_BEGIN_MACRO  do {
  |  |  |  |  ------------------
  |  |  |  |   26|      2|    (_e)->next = (_l);   \
  |  |  |  |   27|      2|    (_e)->prev = (_l)->prev; \
  |  |  |  |   28|      2|    (_l)->prev->next = (_e); \
  |  |  |  |   29|      2|    (_l)->prev = (_e);   \
  |  |  |  |   30|      2|    PR_END_MACRO
  |  |  |  |  ------------------
  |  |  |  |  |  |  124|      2|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|      2|        }
  213|  5.21k|    } else {
  214|  5.21k|        list->head = node;
  215|  5.21k|    }
  216|  5.21k|    ++list->count;
  217|  5.21k|    return PR_SUCCESS;
  218|  5.21k|}
list.c:nsslist_get_matching_element:
   54|  5.21k|{
   55|  5.21k|    nssListElement *node;
   56|  5.21k|    node = list->head;
   57|  5.21k|    if (!node) {
  ------------------
  |  Branch (57:9): [True: 0, False: 5.21k]
  ------------------
   58|      0|        return NULL;
   59|      0|    }
   60|  5.21k|    while (node) {
  ------------------
  |  Branch (60:12): [True: 5.21k, False: 0]
  ------------------
   61|       |        /* using a callback slows things down when it's just compare ... */
   62|  5.21k|        if (list->compareFunc(node->data, data)) {
  ------------------
  |  Branch (62:13): [True: 5.21k, False: 0]
  ------------------
   63|  5.21k|            break;
   64|  5.21k|        }
   65|      0|        if (&node->link == PR_LIST_TAIL(&list->head->link)) {
  ------------------
  |  |   66|      0|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
  |  Branch (65:13): [True: 0, False: 0]
  ------------------
   66|      0|            node = NULL;
   67|      0|            break;
   68|      0|        }
   69|      0|        node = (nssListElement *)PR_NEXT_LINK(&node->link);
  ------------------
  |  |   47|      0|        ((_e)->next)
  ------------------
   70|      0|    }
   71|  5.21k|    return node;
   72|  5.21k|}

nssPointerTracker_initialize:
   85|  36.8k|{
   86|  36.8k|    PRStatus rv = PR_CallOnceWithArg(&tracker->once, trackerOnceFunc, tracker);
   87|  36.8k|    if (PR_SUCCESS != rv) {
  ------------------
  |  Branch (87:9): [True: 0, False: 36.8k]
  ------------------
   88|      0|        nss_SetError(NSS_ERROR_NO_MEMORY);
   89|      0|    }
   90|       |
   91|  36.8k|    return rv;
   92|  36.8k|}
nssPointerTracker_finalize:
  147|      1|{
  148|      1|    PZLock *lock;
  ------------------
  |  |  185|      1|#define PZLock PRLock
  ------------------
  149|       |
  150|      1|    if ((nssPointerTracker *)NULL == tracker) {
  ------------------
  |  Branch (150:9): [True: 0, False: 1]
  ------------------
  151|      0|        nss_SetError(NSS_ERROR_INVALID_POINTER);
  152|      0|        return PR_FAILURE;
  153|      0|    }
  154|       |
  155|      1|    if ((PZLock *)NULL == tracker->lock) {
  ------------------
  |  Branch (155:9): [True: 0, False: 1]
  ------------------
  156|      0|        nss_SetError(NSS_ERROR_TRACKER_NOT_INITIALIZED);
  157|      0|        return PR_FAILURE;
  158|      0|    }
  159|       |
  160|      1|    lock = tracker->lock;
  161|      1|    PZ_Lock(lock);
  ------------------
  |  |  245|      1|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  162|       |
  163|      1|    if ((PLHashTable *)NULL == tracker->table) {
  ------------------
  |  Branch (163:9): [True: 0, False: 1]
  ------------------
  164|      0|        PZ_Unlock(lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  165|      0|        nss_SetError(NSS_ERROR_TRACKER_NOT_INITIALIZED);
  166|      0|        return PR_FAILURE;
  167|      0|    }
  168|       |
  169|       |#ifdef DONT_DESTROY_EMPTY_TABLES
  170|       |    /*
  171|       |     * I changed my mind; I think we don't want this after all.
  172|       |     * Comments?
  173|       |     */
  174|       |    count = PL_HashTableEnumerateEntries(tracker->table, count_entries,
  175|       |                                         (void *)NULL);
  176|       |
  177|       |    if (0 != count) {
  178|       |        PZ_Unlock(lock);
  179|       |        nss_SetError(NSS_ERROR_TRACKER_NOT_EMPTY);
  180|       |        return PR_FAILURE;
  181|       |    }
  182|       |#endif /* DONT_DESTROY_EMPTY_TABLES */
  183|       |
  184|      1|    PL_HashTableDestroy(tracker->table);
  185|       |    /* memset(tracker, 0, sizeof(nssPointerTracker)); */
  186|      1|    tracker->once = zero_once;
  187|      1|    tracker->lock = (PZLock *)NULL;
  188|      1|    tracker->table = (PLHashTable *)NULL;
  189|       |
  190|      1|    PZ_Unlock(lock);
  ------------------
  |  |  246|      1|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  191|      1|    PZ_DestroyLock(lock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  192|       |
  193|      1|    return PR_SUCCESS;
  194|      1|}
nssPointerTracker_add:
  221|  10.6k|{
  222|  10.6k|    void *check;
  223|  10.6k|    PLHashEntry *entry;
  224|       |
  225|  10.6k|    if ((nssPointerTracker *)NULL == tracker) {
  ------------------
  |  Branch (225:9): [True: 0, False: 10.6k]
  ------------------
  226|      0|        nss_SetError(NSS_ERROR_INVALID_POINTER);
  227|      0|        return PR_FAILURE;
  228|      0|    }
  229|       |
  230|  10.6k|    if ((PZLock *)NULL == tracker->lock) {
  ------------------
  |  Branch (230:9): [True: 0, False: 10.6k]
  ------------------
  231|      0|        nss_SetError(NSS_ERROR_TRACKER_NOT_INITIALIZED);
  232|      0|        return PR_FAILURE;
  233|      0|    }
  234|       |
  235|  10.6k|    PZ_Lock(tracker->lock);
  ------------------
  |  |  245|  10.6k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  236|       |
  237|  10.6k|    if ((PLHashTable *)NULL == tracker->table) {
  ------------------
  |  Branch (237:9): [True: 0, False: 10.6k]
  ------------------
  238|      0|        PZ_Unlock(tracker->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  239|      0|        nss_SetError(NSS_ERROR_TRACKER_NOT_INITIALIZED);
  240|      0|        return PR_FAILURE;
  241|      0|    }
  242|       |
  243|  10.6k|    check = PL_HashTableLookup(tracker->table, pointer);
  244|  10.6k|    if ((void *)NULL != check) {
  ------------------
  |  Branch (244:9): [True: 0, False: 10.6k]
  ------------------
  245|      0|        PZ_Unlock(tracker->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  246|      0|        nss_SetError(NSS_ERROR_DUPLICATE_POINTER);
  247|      0|        return PR_FAILURE;
  248|      0|    }
  249|       |
  250|  10.6k|    entry = PL_HashTableAdd(tracker->table, pointer, (void *)pointer);
  251|       |
  252|  10.6k|    PZ_Unlock(tracker->lock);
  ------------------
  |  |  246|  10.6k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  253|       |
  254|  10.6k|    if ((PLHashEntry *)NULL == entry) {
  ------------------
  |  Branch (254:9): [True: 0, False: 10.6k]
  ------------------
  255|      0|        nss_SetError(NSS_ERROR_NO_MEMORY);
  256|      0|        return PR_FAILURE;
  257|      0|    }
  258|       |
  259|  10.6k|    return PR_SUCCESS;
  260|  10.6k|}
nssPointerTracker_remove:
  287|  10.6k|{
  288|  10.6k|    PRBool registered;
  289|       |
  290|  10.6k|    if ((nssPointerTracker *)NULL == tracker) {
  ------------------
  |  Branch (290:9): [True: 0, False: 10.6k]
  ------------------
  291|      0|        nss_SetError(NSS_ERROR_INVALID_POINTER);
  292|      0|        return PR_FAILURE;
  293|      0|    }
  294|       |
  295|  10.6k|    if ((PZLock *)NULL == tracker->lock) {
  ------------------
  |  Branch (295:9): [True: 0, False: 10.6k]
  ------------------
  296|      0|        nss_SetError(NSS_ERROR_TRACKER_NOT_INITIALIZED);
  297|      0|        return PR_FAILURE;
  298|      0|    }
  299|       |
  300|  10.6k|    PZ_Lock(tracker->lock);
  ------------------
  |  |  245|  10.6k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  301|       |
  302|  10.6k|    if ((PLHashTable *)NULL == tracker->table) {
  ------------------
  |  Branch (302:9): [True: 0, False: 10.6k]
  ------------------
  303|      0|        PZ_Unlock(tracker->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  304|      0|        nss_SetError(NSS_ERROR_TRACKER_NOT_INITIALIZED);
  305|      0|        return PR_FAILURE;
  306|      0|    }
  307|       |
  308|  10.6k|    registered = PL_HashTableRemove(tracker->table, pointer);
  309|  10.6k|    PZ_Unlock(tracker->lock);
  ------------------
  |  |  246|  10.6k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  310|       |
  311|  10.6k|    if (!registered) {
  ------------------
  |  Branch (311:9): [True: 0, False: 10.6k]
  ------------------
  312|      0|        nss_SetError(NSS_ERROR_POINTER_NOT_REGISTERED);
  313|      0|        return PR_FAILURE;
  314|      0|    }
  315|       |
  316|  10.6k|    return PR_SUCCESS;
  317|  10.6k|}
nssPointerTracker_verify:
  346|  26.2k|{
  347|  26.2k|    void *check;
  348|       |
  349|  26.2k|    if ((nssPointerTracker *)NULL == tracker) {
  ------------------
  |  Branch (349:9): [True: 0, False: 26.2k]
  ------------------
  350|      0|        nss_SetError(NSS_ERROR_INVALID_POINTER);
  351|      0|        return PR_FAILURE;
  352|      0|    }
  353|       |
  354|  26.2k|    if ((PZLock *)NULL == tracker->lock) {
  ------------------
  |  Branch (354:9): [True: 0, False: 26.2k]
  ------------------
  355|      0|        nss_SetError(NSS_ERROR_TRACKER_NOT_INITIALIZED);
  356|      0|        return PR_FAILURE;
  357|      0|    }
  358|       |
  359|  26.2k|    PZ_Lock(tracker->lock);
  ------------------
  |  |  245|  26.2k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  360|       |
  361|  26.2k|    if ((PLHashTable *)NULL == tracker->table) {
  ------------------
  |  Branch (361:9): [True: 0, False: 26.2k]
  ------------------
  362|      0|        PZ_Unlock(tracker->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  363|      0|        nss_SetError(NSS_ERROR_TRACKER_NOT_INITIALIZED);
  364|      0|        return PR_FAILURE;
  365|      0|    }
  366|       |
  367|  26.2k|    check = PL_HashTableLookup(tracker->table, pointer);
  368|  26.2k|    PZ_Unlock(tracker->lock);
  ------------------
  |  |  246|  26.2k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  369|       |
  370|  26.2k|    if ((void *)NULL == check) {
  ------------------
  |  Branch (370:9): [True: 0, False: 26.2k]
  ------------------
  371|      0|        nss_SetError(NSS_ERROR_POINTER_NOT_REGISTERED);
  372|      0|        return PR_FAILURE;
  373|      0|    }
  374|       |
  375|  26.2k|    return PR_SUCCESS;
  376|  26.2k|}
tracker.c:trackerOnceFunc:
   42|      1|{
   43|      1|    nssPointerTracker *tracker = (nssPointerTracker *)arg;
   44|       |
   45|      1|    tracker->lock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
   46|      1|    if ((PZLock *)NULL == tracker->lock) {
  ------------------
  |  Branch (46:9): [True: 0, False: 1]
  ------------------
   47|      0|        return PR_FAILURE;
   48|      0|    }
   49|       |
   50|      1|    tracker->table =
   51|      1|        PL_NewHashTable(0, identity_hash, PL_CompareValues, PL_CompareValues,
   52|      1|                        (PLHashAllocOps *)NULL, (void *)NULL);
   53|      1|    if ((PLHashTable *)NULL == tracker->table) {
  ------------------
  |  Branch (53:9): [True: 0, False: 1]
  ------------------
   54|      0|        PZ_DestroyLock(tracker->lock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
   55|      0|        tracker->lock = (PZLock *)NULL;
   56|      0|        return PR_FAILURE;
   57|      0|    }
   58|       |
   59|      1|    return PR_SUCCESS;
   60|      1|}
tracker.c:identity_hash:
   28|  58.1k|{
   29|  58.1k|    return (PLHashNumber)((char *)key - (char *)NULL);
   30|  58.1k|}

nssUTF8_Duplicate:
  193|      4|{
  194|      4|    NSSUTF8 *rv;
  195|      4|    PRUint32 len;
  196|       |
  197|       |#ifdef NSSDEBUG
  198|       |    if ((const NSSUTF8 *)NULL == s) {
  199|       |        nss_SetError(NSS_ERROR_INVALID_POINTER);
  200|       |        return (NSSUTF8 *)NULL;
  201|       |    }
  202|       |
  203|       |    if ((NSSArena *)NULL != arenaOpt) {
  204|       |        if (PR_SUCCESS != nssArena_verifyPointer(arenaOpt)) {
  205|       |            return (NSSUTF8 *)NULL;
  206|       |        }
  207|       |    }
  208|       |#endif /* NSSDEBUG */
  209|       |
  210|      4|    len = PL_strlen((const char *)s);
  211|       |#ifdef PEDANTIC
  212|       |    if ('\0' != ((const char *)s)[len]) {
  213|       |        /* must have wrapped, e.g., too big for PRUint32 */
  214|       |        nss_SetError(NSS_ERROR_NO_MEMORY);
  215|       |        return (NSSUTF8 *)NULL;
  216|       |    }
  217|       |#endif     /* PEDANTIC */
  218|      4|    len++; /* zero termination */
  219|       |
  220|      4|    rv = nss_ZAlloc(arenaOpt, len);
  221|      4|    if ((void *)NULL == rv) {
  ------------------
  |  Branch (221:9): [True: 0, False: 4]
  ------------------
  222|      0|        return (NSSUTF8 *)NULL;
  223|      0|    }
  224|       |
  225|      4|    (void)nsslibc_memcpy(rv, s, len);
  226|      4|    return rv;
  227|      4|}
nssUTF8_Create:
  429|     18|{
  430|     18|    NSSUTF8 *rv = NULL;
  431|       |
  432|       |#ifdef NSSDEBUG
  433|       |    if ((NSSArena *)NULL != arenaOpt) {
  434|       |        if (PR_SUCCESS != nssArena_verifyPointer(arenaOpt)) {
  435|       |            return (NSSUTF8 *)NULL;
  436|       |        }
  437|       |    }
  438|       |
  439|       |    if ((const void *)NULL == inputString) {
  440|       |        nss_SetError(NSS_ERROR_INVALID_POINTER);
  441|       |        return (NSSUTF8 *)NULL;
  442|       |    }
  443|       |#endif /* NSSDEBUG */
  444|       |
  445|     18|    switch (type) {
  446|      0|        case nssStringType_DirectoryString:
  ------------------
  |  Branch (446:9): [True: 0, False: 18]
  ------------------
  447|       |            /* This is a composite type requiring BER */
  448|      0|            nss_SetError(NSS_ERROR_UNSUPPORTED_TYPE);
  449|      0|            break;
  450|      0|        case nssStringType_TeletexString:
  ------------------
  |  Branch (450:9): [True: 0, False: 18]
  ------------------
  451|       |            /*
  452|       |             * draft-ietf-pkix-ipki-part1-11 says in part:
  453|       |             *
  454|       |             * In addition, many legacy implementations support names encoded
  455|       |             * in the ISO 8859-1 character set (Latin1String) but tag them as
  456|       |             * TeletexString.  The Latin1String includes characters used in
  457|       |             * Western European countries which are not part of the
  458|       |             * TeletexString charcter set.  Implementations that process
  459|       |             * TeletexString SHOULD be prepared to handle the entire ISO
  460|       |             * 8859-1 character set.[ISO 8859-1].
  461|       |             */
  462|      0|            nss_SetError(NSS_ERROR_INTERNAL_ERROR); /* unimplemented */
  463|      0|            break;
  464|     18|        case nssStringType_PrintableString:
  ------------------
  |  Branch (464:9): [True: 18, False: 0]
  ------------------
  465|       |            /*
  466|       |             * PrintableString consists of A-Za-z0-9 ,()+,-./:=?
  467|       |             * This is a subset of ASCII, which is a subset of UTF8.
  468|       |             * So we can just duplicate the string over.
  469|       |             */
  470|       |
  471|     18|            if (0 == size) {
  ------------------
  |  Branch (471:17): [True: 0, False: 18]
  ------------------
  472|      0|                rv = nssUTF8_Duplicate((const NSSUTF8 *)inputString, arenaOpt);
  473|     18|            } else {
  474|     18|                rv = nss_ZAlloc(arenaOpt, size + 1);
  475|     18|                if ((NSSUTF8 *)NULL == rv) {
  ------------------
  |  Branch (475:21): [True: 0, False: 18]
  ------------------
  476|      0|                    return (NSSUTF8 *)NULL;
  477|      0|                }
  478|       |
  479|     18|                (void)nsslibc_memcpy(rv, inputString, size);
  480|     18|            }
  481|       |
  482|     18|            break;
  483|     18|        case nssStringType_UniversalString:
  ------------------
  |  Branch (483:9): [True: 0, False: 18]
  ------------------
  484|       |            /* 4-byte unicode */
  485|      0|            nss_SetError(NSS_ERROR_INTERNAL_ERROR); /* unimplemented */
  486|      0|            break;
  487|      0|        case nssStringType_BMPString:
  ------------------
  |  Branch (487:9): [True: 0, False: 18]
  ------------------
  488|       |            /* Base Multilingual Plane of Unicode */
  489|      0|            nss_SetError(NSS_ERROR_INTERNAL_ERROR); /* unimplemented */
  490|      0|            break;
  491|      0|        case nssStringType_UTF8String:
  ------------------
  |  Branch (491:9): [True: 0, False: 18]
  ------------------
  492|      0|            if (0 == size) {
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|                rv = nssUTF8_Duplicate((const NSSUTF8 *)inputString, arenaOpt);
  494|      0|            } else {
  495|      0|                rv = nss_ZAlloc(arenaOpt, size + 1);
  496|      0|                if ((NSSUTF8 *)NULL == rv) {
  ------------------
  |  Branch (496:21): [True: 0, False: 0]
  ------------------
  497|      0|                    return (NSSUTF8 *)NULL;
  498|      0|                }
  499|       |
  500|      0|                (void)nsslibc_memcpy(rv, inputString, size);
  501|      0|            }
  502|       |
  503|      0|            break;
  504|      0|        case nssStringType_PHGString:
  ------------------
  |  Branch (504:9): [True: 0, False: 18]
  ------------------
  505|       |            /*
  506|       |             * PHGString is an IA5String (with case-insensitive comparisons).
  507|       |             * IA5 is ~almost~ ascii; ascii has dollar-sign where IA5 has
  508|       |             * currency symbol.
  509|       |             */
  510|      0|            nss_SetError(NSS_ERROR_INTERNAL_ERROR); /* unimplemented */
  511|      0|            break;
  512|      0|        case nssStringType_GeneralString:
  ------------------
  |  Branch (512:9): [True: 0, False: 18]
  ------------------
  513|      0|            nss_SetError(NSS_ERROR_INTERNAL_ERROR); /* unimplemented */
  514|      0|            break;
  515|      0|        default:
  ------------------
  |  Branch (515:9): [True: 0, False: 18]
  ------------------
  516|      0|            nss_SetError(NSS_ERROR_UNSUPPORTED_TYPE);
  517|      0|            break;
  518|     18|    }
  519|       |
  520|     18|    return rv;
  521|     18|}

CERT_GetOidString:
  701|  7.64k|{
  702|  7.64k|    PRUint8* stop;  /* points to first byte after OID string */
  703|  7.64k|    PRUint8* first; /* byte of an OID component integer      */
  704|  7.64k|    PRUint8* last;  /* byte of an OID component integer      */
  705|  7.64k|    char* rvString = NULL;
  706|  7.64k|    char* prefix = NULL;
  707|       |
  708|  7.64k|#define MAX_OID_LEN 1024 /* bytes */
  709|       |
  710|  7.64k|    if (oid->len > MAX_OID_LEN) {
  ------------------
  |  |  708|  7.64k|#define MAX_OID_LEN 1024 /* bytes */
  ------------------
  |  Branch (710:9): [True: 0, False: 7.64k]
  ------------------
  711|      0|        PORT_SetError(SEC_ERROR_INPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  712|      0|        return NULL;
  713|      0|    }
  714|       |
  715|       |    /* If the OID has length 1, we bail. */
  716|  7.64k|    if (oid->len < 2) {
  ------------------
  |  Branch (716:9): [True: 61, False: 7.58k]
  ------------------
  717|     61|        return NULL;
  718|     61|    }
  719|       |
  720|       |    /* first will point to the next sequence of bytes to decode */
  721|  7.58k|    first = (PRUint8*)oid->data;
  722|       |    /* stop points to one past the legitimate data */
  723|  7.58k|    stop = &first[oid->len];
  724|       |
  725|       |    /*
  726|       |     * Check for our pseudo-encoded single-digit OIDs
  727|       |     */
  728|  7.58k|    if ((*first == 0x80) && (2 == oid->len)) {
  ------------------
  |  Branch (728:9): [True: 76, False: 7.50k]
  |  Branch (728:29): [True: 4, False: 72]
  ------------------
  729|       |        /* Funky encoding.  The second byte is the number */
  730|      4|        rvString = PR_smprintf("%lu", (PRUint32)first[1]);
  731|      4|        if (!rvString) {
  ------------------
  |  Branch (731:13): [True: 0, False: 4]
  ------------------
  732|      0|            PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  733|      0|        }
  734|      4|        return rvString;
  735|      4|    }
  736|       |
  737|  24.7k|    for (; first < stop; first = last + 1) {
  ------------------
  |  Branch (737:12): [True: 17.1k, False: 7.57k]
  ------------------
  738|  17.1k|        unsigned int bytesBeforeLast;
  739|       |
  740|  27.4k|        for (last = first; last < stop; last++) {
  ------------------
  |  Branch (740:28): [True: 26.4k, False: 999]
  ------------------
  741|  26.4k|            if (0 == (*last & 0x80)) {
  ------------------
  |  Branch (741:17): [True: 16.1k, False: 10.3k]
  ------------------
  742|  16.1k|                break;
  743|  16.1k|            }
  744|  26.4k|        }
  745|       |        /* There's no first bit set, so this isn't valid. Bail.*/
  746|  17.1k|        if (last == stop) {
  ------------------
  |  Branch (746:13): [True: 999, False: 16.1k]
  ------------------
  747|    999|            goto unsupported;
  748|    999|        }
  749|  16.1k|        bytesBeforeLast = (unsigned int)(last - first);
  750|  16.1k|        if (bytesBeforeLast <= 3U) { /* 0-28 bit number */
  ------------------
  |  Branch (750:13): [True: 15.8k, False: 337]
  ------------------
  751|  15.8k|            PRUint32 n = 0;
  752|  15.8k|            PRUint32 c;
  753|       |
  754|  15.8k|#define CGET(i, m)    \
  755|  15.8k|    c = last[-i] & m; \
  756|  15.8k|    n |= c << (7 * i)
  757|       |
  758|  15.8k|#define CASE(i, m)  \
  759|  15.8k|    case i:         \
  760|  15.8k|        CGET(i, m); \
  761|  15.8k|        if (!n)     \
  762|  15.8k|        goto unsupported /* fall-through */
  763|       |
  764|  15.8k|            switch (bytesBeforeLast) {
  ------------------
  |  Branch (764:21): [True: 0, False: 15.8k]
  ------------------
  765|     98|                CASE(3, 0x7f);
  ------------------
  |  |  759|     98|    case i:         \
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 98, False: 15.7k]
  |  |  ------------------
  |  |  760|     98|        CGET(i, m); \
  |  |  ------------------
  |  |  |  |  755|     98|    c = last[-i] & m; \
  |  |  |  |  756|     98|    n |= c << (7 * i)
  |  |  ------------------
  |  |  761|     98|        if (!n)     \
  |  |  ------------------
  |  |  |  Branch (761:13): [True: 15, False: 83]
  |  |  ------------------
  |  |  762|     98|        goto unsupported /* fall-through */
  ------------------
  766|    943|                CASE(2, 0x7f);
  ------------------
  |  |  759|    943|    case i:         \
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 860, False: 14.9k]
  |  |  ------------------
  |  |  760|    943|        CGET(i, m); \
  |  |  ------------------
  |  |  |  |  755|    943|    c = last[-i] & m; \
  |  |  |  |  756|    943|    n |= c << (7 * i)
  |  |  ------------------
  |  |  761|    943|        if (!n)     \
  |  |  ------------------
  |  |  |  Branch (761:13): [True: 38, False: 905]
  |  |  ------------------
  |  |  762|    943|        goto unsupported /* fall-through */
  ------------------
  767|  6.00k|                CASE(1, 0x7f);
  ------------------
  |  |  759|  6.00k|    case i:         \
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 5.09k, False: 10.7k]
  |  |  ------------------
  |  |  760|  6.00k|        CGET(i, m); \
  |  |  ------------------
  |  |  |  |  755|  6.00k|    c = last[-i] & m; \
  |  |  |  |  756|  6.00k|    n |= c << (7 * i)
  |  |  ------------------
  |  |  761|  6.00k|        if (!n)     \
  |  |  ------------------
  |  |  |  Branch (761:13): [True: 4.60k, False: 1.39k]
  |  |  ------------------
  |  |  762|  6.00k|        goto unsupported /* fall-through */
  ------------------
  768|  11.1k|                case 0:
  ------------------
  |  Branch (768:17): [True: 9.76k, False: 6.05k]
  ------------------
  769|  11.1k|                    n |= last[0] & 0x7f;
  770|  11.1k|                    break;
  771|  15.8k|            }
  772|  11.1k|            if (last[0] & 0x80) {
  ------------------
  |  Branch (772:17): [True: 0, False: 11.1k]
  ------------------
  773|      0|                goto unsupported;
  774|      0|            }
  775|       |
  776|  11.1k|            if (!rvString) {
  ------------------
  |  Branch (776:17): [True: 7.30k, False: 3.85k]
  ------------------
  777|       |                /* This is the first number.. decompose it */
  778|  7.30k|                PRUint32 one = PR_MIN(n / 40, 2); /* never > 2 */
  ------------------
  |  |  158|  7.30k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 528, False: 6.77k]
  |  |  ------------------
  ------------------
  779|  7.30k|                PRUint32 two = n - (one * 40);
  780|       |
  781|  7.30k|                rvString = PR_smprintf("OID.%lu.%lu", one, two);
  782|  7.30k|            } else {
  783|  3.85k|                prefix = rvString;
  784|  3.85k|                rvString = PR_smprintf("%s.%lu", prefix, n);
  785|  3.85k|            }
  786|  11.1k|        } else if (bytesBeforeLast <= 9U) { /* 29-64 bit number */
  ------------------
  |  Branch (786:20): [True: 331, False: 6]
  ------------------
  787|    331|            PRUint64 n = 0;
  788|    331|            PRUint64 c;
  789|       |
  790|    331|            switch (bytesBeforeLast) {
  ------------------
  |  Branch (790:21): [True: 0, False: 331]
  ------------------
  791|     87|                CASE(9, 0x01);
  ------------------
  |  |  759|     87|    case i:         \
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 87, False: 244]
  |  |  ------------------
  |  |  760|     87|        CGET(i, m); \
  |  |  ------------------
  |  |  |  |  755|     87|    c = last[-i] & m; \
  |  |  |  |  756|     87|    n |= c << (7 * i)
  |  |  ------------------
  |  |  761|     87|        if (!n)     \
  |  |  ------------------
  |  |  |  Branch (761:13): [True: 10, False: 77]
  |  |  ------------------
  |  |  762|     87|        goto unsupported /* fall-through */
  ------------------
  792|     91|                CASE(8, 0x7f);
  ------------------
  |  |  759|     91|    case i:         \
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 14, False: 317]
  |  |  ------------------
  |  |  760|     91|        CGET(i, m); \
  |  |  ------------------
  |  |  |  |  755|     91|    c = last[-i] & m; \
  |  |  |  |  756|     91|    n |= c << (7 * i)
  |  |  ------------------
  |  |  761|     91|        if (!n)     \
  |  |  ------------------
  |  |  |  Branch (761:13): [True: 3, False: 88]
  |  |  ------------------
  |  |  762|     91|        goto unsupported /* fall-through */
  ------------------
  793|    104|                CASE(7, 0x7f);
  ------------------
  |  |  759|    104|    case i:         \
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 16, False: 315]
  |  |  ------------------
  |  |  760|    104|        CGET(i, m); \
  |  |  ------------------
  |  |  |  |  755|    104|    c = last[-i] & m; \
  |  |  |  |  756|    104|    n |= c << (7 * i)
  |  |  ------------------
  |  |  761|    104|        if (!n)     \
  |  |  ------------------
  |  |  |  Branch (761:13): [True: 4, False: 100]
  |  |  ------------------
  |  |  762|    104|        goto unsupported /* fall-through */
  ------------------
  794|    127|                CASE(6, 0x7f);
  ------------------
  |  |  759|    127|    case i:         \
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 27, False: 304]
  |  |  ------------------
  |  |  760|    127|        CGET(i, m); \
  |  |  ------------------
  |  |  |  |  755|    127|    c = last[-i] & m; \
  |  |  |  |  756|    127|    n |= c << (7 * i)
  |  |  ------------------
  |  |  761|    127|        if (!n)     \
  |  |  ------------------
  |  |  |  Branch (761:13): [True: 3, False: 124]
  |  |  ------------------
  |  |  762|    127|        goto unsupported /* fall-through */
  ------------------
  795|    220|                CASE(5, 0x7f);
  ------------------
  |  |  759|    220|    case i:         \
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 96, False: 235]
  |  |  ------------------
  |  |  760|    220|        CGET(i, m); \
  |  |  ------------------
  |  |  |  |  755|    220|    c = last[-i] & m; \
  |  |  |  |  756|    220|    n |= c << (7 * i)
  |  |  ------------------
  |  |  761|    220|        if (!n)     \
  |  |  ------------------
  |  |  |  Branch (761:13): [True: 13, False: 207]
  |  |  ------------------
  |  |  762|    220|        goto unsupported /* fall-through */
  ------------------
  796|    298|                CASE(4, 0x7f);
  ------------------
  |  |  759|    298|    case i:         \
  |  |  ------------------
  |  |  |  Branch (759:5): [True: 91, False: 240]
  |  |  ------------------
  |  |  760|    298|        CGET(i, m); \
  |  |  ------------------
  |  |  |  |  755|    298|    c = last[-i] & m; \
  |  |  |  |  756|    298|    n |= c << (7 * i)
  |  |  ------------------
  |  |  761|    298|        if (!n)     \
  |  |  ------------------
  |  |  |  Branch (761:13): [True: 18, False: 280]
  |  |  ------------------
  |  |  762|    298|        goto unsupported /* fall-through */
  ------------------
  797|    280|                CGET(3, 0x7f);
  ------------------
  |  |  755|    280|    c = last[-i] & m; \
  |  |  756|    280|    n |= c << (7 * i)
  ------------------
  798|    280|                CGET(2, 0x7f);
  ------------------
  |  |  755|    280|    c = last[-i] & m; \
  |  |  756|    280|    n |= c << (7 * i)
  ------------------
  799|    280|                CGET(1, 0x7f);
  ------------------
  |  |  755|    280|    c = last[-i] & m; \
  |  |  756|    280|    n |= c << (7 * i)
  ------------------
  800|    280|                CGET(0, 0x7f);
  ------------------
  |  |  755|    280|    c = last[-i] & m; \
  |  |  756|    280|    n |= c << (7 * i)
  ------------------
  801|    280|                break;
  802|    331|            }
  803|    280|            if (last[0] & 0x80)
  ------------------
  |  Branch (803:17): [True: 0, False: 280]
  ------------------
  804|      0|                goto unsupported;
  805|       |
  806|    280|            if (!rvString) {
  ------------------
  |  Branch (806:17): [True: 166, False: 114]
  ------------------
  807|       |                /* This is the first number.. decompose it */
  808|    166|                PRUint64 one = PR_MIN(n / 40, 2); /* never > 2 */
  ------------------
  |  |  158|    166|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 166]
  |  |  ------------------
  ------------------
  809|    166|                PRUint64 two = n - (one * 40);
  810|       |
  811|    166|                rvString = PR_smprintf("OID.%llu.%llu", one, two);
  812|    166|            } else {
  813|    114|                prefix = rvString;
  814|    114|                rvString = PR_smprintf("%s.%llu", prefix, n);
  815|    114|            }
  816|    280|        } else {
  817|       |        /* More than a 64-bit number, or not minimal encoding. */
  818|  5.71k|        unsupported:
  819|  5.71k|            if (!rvString)
  ------------------
  |  Branch (819:17): [True: 108, False: 5.61k]
  ------------------
  820|    108|                rvString = PR_smprintf("OID.UNSUPPORTED");
  821|  5.61k|            else {
  822|  5.61k|                prefix = rvString;
  823|  5.61k|                rvString = PR_smprintf("%s.UNSUPPORTED", prefix);
  824|  5.61k|            }
  825|  5.71k|        }
  826|       |
  827|  17.1k|        if (prefix) {
  ------------------
  |  Branch (827:13): [True: 9.58k, False: 7.57k]
  ------------------
  828|  9.58k|            PR_smprintf_free(prefix);
  829|  9.58k|            prefix = NULL;
  830|  9.58k|        }
  831|  17.1k|        if (!rvString) {
  ------------------
  |  Branch (831:13): [True: 0, False: 17.1k]
  ------------------
  832|      0|            PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  833|      0|            break;
  834|      0|        }
  835|  17.1k|    }
  836|  7.57k|    return rvString;
  837|  7.57k|}
CERT_NameToAsciiInvertible:
 1117|  10.4k|{
 1118|  10.4k|    CERTRDN** rdns;
 1119|  10.4k|    CERTRDN** lastRdn;
 1120|  10.4k|    CERTRDN** rdn;
 1121|  10.4k|    PRBool first = PR_TRUE;
  ------------------
  |  |  437|  10.4k|#define PR_TRUE 1
  ------------------
 1122|  10.4k|    stringBuf strBuf = { NULL, 0, 0 };
 1123|       |
 1124|  10.4k|    rdns = name->rdns;
 1125|  10.4k|    if (rdns == NULL) {
  ------------------
  |  Branch (1125:9): [True: 0, False: 10.4k]
  ------------------
 1126|      0|        return NULL;
 1127|      0|    }
 1128|       |
 1129|       |    /* find last RDN */
 1130|  10.4k|    lastRdn = rdns;
 1131|  21.1k|    while (*lastRdn)
  ------------------
  |  Branch (1131:12): [True: 10.7k, False: 10.4k]
  ------------------
 1132|  10.7k|        lastRdn++;
 1133|  10.4k|    lastRdn--;
 1134|       |
 1135|       |    /*
 1136|       |     * Loop over name contents in _reverse_ RDN order appending to string
 1137|       |     */
 1138|  21.0k|    for (rdn = lastRdn; rdn >= rdns; rdn--) {
  ------------------
  |  Branch (1138:25): [True: 10.6k, False: 10.3k]
  ------------------
 1139|  10.6k|        CERTAVA** avas = (*rdn)->avas;
 1140|  10.6k|        CERTAVA* ava;
 1141|  10.6k|        PRBool newRDN = PR_TRUE;
  ------------------
  |  |  437|  10.6k|#define PR_TRUE 1
  ------------------
 1142|       |
 1143|       |        /*
 1144|       |         * XXX Do we need to traverse the AVAs in reverse order, too?
 1145|       |         */
 1146|  21.3k|        while (avas && (ava = *avas++) != NULL) {
  ------------------
  |  Branch (1146:16): [True: 21.3k, False: 0]
  |  Branch (1146:24): [True: 10.6k, False: 10.6k]
  ------------------
 1147|  10.6k|            SECStatus rv;
 1148|       |            /* Put in comma or plus separator */
 1149|  10.6k|            if (!first) {
  ------------------
  |  Branch (1149:17): [True: 263, False: 10.4k]
  ------------------
 1150|       |                /* Use of spaces is deprecated in RFC 2253. */
 1151|    263|                rv = AppendStr(&strBuf, newRDN ? "," : "+");
  ------------------
  |  Branch (1151:41): [True: 263, False: 0]
  ------------------
 1152|    263|                if (rv)
  ------------------
  |  Branch (1152:21): [True: 0, False: 263]
  ------------------
 1153|      0|                    goto loser;
 1154|  10.4k|            } else {
 1155|  10.4k|                first = PR_FALSE;
  ------------------
  |  |  438|  10.4k|#define PR_FALSE 0
  ------------------
 1156|  10.4k|            }
 1157|       |
 1158|       |            /* Add in tag type plus value into strBuf */
 1159|  10.6k|            rv = AppendAVA(&strBuf, ava, strict);
 1160|  10.6k|            if (rv)
  ------------------
  |  Branch (1160:17): [True: 61, False: 10.6k]
  ------------------
 1161|     61|                goto loser;
 1162|  10.6k|            newRDN = PR_FALSE;
  ------------------
  |  |  438|  10.6k|#define PR_FALSE 0
  ------------------
 1163|  10.6k|        }
 1164|  10.6k|    }
 1165|  10.3k|    return strBuf.buffer;
 1166|     61|loser:
 1167|     61|    if (strBuf.buffer) {
  ------------------
  |  Branch (1167:9): [True: 53, False: 8]
  ------------------
 1168|     53|        PORT_Free(strBuf.buffer);
  ------------------
  |  |   60|     53|#define PORT_Free PORT_Free_Util
  ------------------
 1169|     53|    }
 1170|     61|    return NULL;
 1171|  10.4k|}
CERT_NameToAscii:
 1175|  10.4k|{
 1176|  10.4k|    return CERT_NameToAsciiInvertible(name, CERT_N2A_READABLE);
 1177|  10.4k|}
cert_GetCertificateEmailAddresses:
 1437|  5.21k|{
 1438|  5.21k|    char* rawEmailAddr = NULL;
 1439|  5.21k|    char* addrBuf = NULL;
 1440|  5.21k|    char* pBuf = NULL;
 1441|  5.21k|    PORTCheapArenaPool tmpArena;
 1442|  5.21k|    PRUint32 maxLen = 0;
 1443|  5.21k|    PRInt32 finalLen = 0;
 1444|  5.21k|    SECStatus rv;
 1445|  5.21k|    SECItem subAltName;
 1446|       |
 1447|  5.21k|    PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  5.21k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 1448|       |
 1449|  5.21k|    subAltName.data = NULL;
 1450|  5.21k|    maxLen = cert->derCert.len;
 1451|  5.21k|    PORT_Assert(maxLen);
  ------------------
  |  |  120|  5.21k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.21k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1452|  5.21k|    if (!maxLen)
  ------------------
  |  Branch (1452:9): [True: 0, False: 5.21k]
  ------------------
 1453|      0|        maxLen = 2000; /* a guess, should never happen */
 1454|       |
 1455|  5.21k|    pBuf = addrBuf = (char*)PORT_ArenaZAlloc(&tmpArena.arena, maxLen + 1);
  ------------------
  |  |   59|  5.21k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
 1456|  5.21k|    if (!addrBuf)
  ------------------
  |  Branch (1456:9): [True: 0, False: 5.21k]
  ------------------
 1457|      0|        goto loser;
 1458|       |
 1459|  5.21k|    rawEmailAddr = CERT_GetNameElement(&tmpArena.arena, &cert->subject,
 1460|  5.21k|                                       SEC_OID_PKCS9_EMAIL_ADDRESS);
 1461|  5.21k|    pBuf = appendStringToBuf(pBuf, rawEmailAddr, &maxLen);
 1462|       |
 1463|  5.21k|    rawEmailAddr = CERT_GetNameElement(&tmpArena.arena, &cert->subject,
 1464|  5.21k|                                       SEC_OID_RFC1274_MAIL);
 1465|  5.21k|    pBuf = appendStringToBuf(pBuf, rawEmailAddr, &maxLen);
 1466|       |
 1467|  5.21k|    rv = CERT_FindCertExtension(cert, SEC_OID_X509_SUBJECT_ALT_NAME, &subAltName);
 1468|  5.21k|    if (rv == SECSuccess && subAltName.data) {
  ------------------
  |  Branch (1468:9): [True: 158, False: 5.05k]
  |  Branch (1468:29): [True: 157, False: 1]
  ------------------
 1469|    157|        CERTGeneralName* nameList = NULL;
 1470|       |
 1471|    157|        if (!!(nameList = CERT_DecodeAltNameExtension(&tmpArena.arena, &subAltName))) {
  ------------------
  |  Branch (1471:13): [True: 27, False: 130]
  ------------------
 1472|     27|            CERTGeneralName* current = nameList;
 1473|     57|            do {
 1474|     57|                if (current->type == certDirectoryName) {
  ------------------
  |  Branch (1474:21): [True: 4, False: 53]
  ------------------
 1475|      4|                    rawEmailAddr =
 1476|      4|                        CERT_GetNameElement(&tmpArena.arena,
 1477|      4|                                            &current->name.directoryName,
 1478|      4|                                            SEC_OID_PKCS9_EMAIL_ADDRESS);
 1479|      4|                    pBuf =
 1480|      4|                        appendStringToBuf(pBuf, rawEmailAddr, &maxLen);
 1481|       |
 1482|      4|                    rawEmailAddr =
 1483|      4|                        CERT_GetNameElement(&tmpArena.arena,
 1484|      4|                                            &current->name.directoryName,
 1485|      4|                                            SEC_OID_RFC1274_MAIL);
 1486|      4|                    pBuf =
 1487|      4|                        appendStringToBuf(pBuf, rawEmailAddr, &maxLen);
 1488|     53|                } else if (current->type == certRFC822Name) {
  ------------------
  |  Branch (1488:28): [True: 38, False: 15]
  ------------------
 1489|     38|                    pBuf =
 1490|     38|                        appendItemToBuf(pBuf, &current->name.other, &maxLen);
 1491|     38|                }
 1492|     57|                current = CERT_GetNextGeneralName(current);
 1493|     57|            } while (current != nameList);
  ------------------
  |  Branch (1493:22): [True: 30, False: 27]
  ------------------
 1494|     27|        }
 1495|    157|        SECITEM_FreeItem(&subAltName, PR_FALSE);
  ------------------
  |  |  108|    157|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(&subAltName, PR_FALSE);
  ------------------
  |  |  438|    157|#define PR_FALSE 0
  ------------------
 1496|       |        /* Don't free nameList, it's part of the tmpArena. */
 1497|    157|    }
 1498|       |    /* now copy superstring to cert's arena */
 1499|  5.21k|    finalLen = (pBuf - addrBuf) + 1;
 1500|  5.21k|    pBuf = NULL;
 1501|  5.21k|    if (finalLen > 1) {
  ------------------
  |  Branch (1501:9): [True: 18, False: 5.19k]
  ------------------
 1502|     18|        pBuf = PORT_ArenaAlloc(cert->arena, finalLen);
  ------------------
  |  |   53|     18|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
 1503|     18|        if (pBuf) {
  ------------------
  |  Branch (1503:13): [True: 18, False: 0]
  ------------------
 1504|     18|            PORT_Memcpy(pBuf, addrBuf, finalLen);
  ------------------
  |  |  180|     18|#define PORT_Memcpy memcpy
  ------------------
 1505|     18|        }
 1506|     18|    }
 1507|  5.21k|loser:
 1508|  5.21k|    PORT_DestroyCheapArena(&tmpArena);
 1509|       |
 1510|  5.21k|    return pBuf;
 1511|  5.21k|}
alg1485.c:escapeAndQuote:
  655|  7.15k|{
  656|  7.15k|    int i, reqLen = 0;
  657|  7.15k|    EQMode mode = pEQMode ? *pEQMode : minimalEscape;
  ------------------
  |  Branch (657:19): [True: 7.15k, False: 0]
  ------------------
  658|       |
  659|  7.15k|    reqLen = cert_RFC1485_GetRequiredLen(src, srclen, &mode);
  660|       |    /* reqLen is max 16384*3 + 2 */
  661|       |    /* space for terminal null */
  662|  7.15k|    if (reqLen < 0 || reqLen + 1 > dstlen) {
  ------------------
  |  Branch (662:9): [True: 0, False: 7.15k]
  |  Branch (662:23): [True: 0, False: 7.15k]
  ------------------
  663|      0|        PORT_SetError(SEC_ERROR_OUTPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  664|      0|        return SECFailure;
  665|      0|    }
  666|       |
  667|  7.15k|    if (mode == minimalEscapeAndQuote)
  ------------------
  |  Branch (667:9): [True: 779, False: 6.37k]
  ------------------
  668|    779|        *dst++ = C_DOUBLE_QUOTE;
  ------------------
  |  |  117|    779|#define C_DOUBLE_QUOTE '\042'
  ------------------
  669|  41.2k|    for (i = 0; i < srclen; i++) {
  ------------------
  |  Branch (669:17): [True: 34.0k, False: 7.15k]
  ------------------
  670|  34.0k|        char c = src[i];
  671|  34.0k|        if (NEEDS_HEX_ESCAPE(c)) {
  ------------------
  |  |  155|  34.0k|#define NEEDS_HEX_ESCAPE(c) ((PRUint8)c < 0x20 || c == 0x7f)
  |  |  ------------------
  |  |  |  Branch (155:30): [True: 2.47k, False: 31.5k]
  |  |  |  Branch (155:51): [True: 44, False: 31.5k]
  |  |  ------------------
  ------------------
  672|  2.51k|            *dst++ = C_BACKSLASH;
  ------------------
  |  |  119|  2.51k|#define C_BACKSLASH '\134'
  ------------------
  673|  2.51k|            *dst++ = hexChars[(c >> 4) & 0x0f];
  674|  2.51k|            *dst++ = hexChars[c & 0x0f];
  675|  31.5k|        } else {
  676|  31.5k|            if (NEEDS_ESCAPE(c) || (SPECIAL_CHAR(c) && mode == fullEscape)) {
  ------------------
  |  |  153|  63.1k|#define NEEDS_ESCAPE(c) (c == C_DOUBLE_QUOTE || c == C_BACKSLASH)
  |  |  ------------------
  |  |  |  |  117|  63.1k|#define C_DOUBLE_QUOTE '\042'
  |  |  ------------------
  |  |               #define NEEDS_ESCAPE(c) (c == C_DOUBLE_QUOTE || c == C_BACKSLASH)
  |  |  ------------------
  |  |  |  |  119|  63.0k|#define C_BACKSLASH '\134'
  |  |  ------------------
  |  |  |  Branch (153:26): [True: 97, False: 31.4k]
  |  |  |  Branch (153:49): [True: 113, False: 31.3k]
  |  |  ------------------
  ------------------
                          if (NEEDS_ESCAPE(c) || (SPECIAL_CHAR(c) && mode == fullEscape)) {
  ------------------
  |  |  127|  62.6k|    (((c) == ',') || ((c) == '=') || ((c) == C_DOUBLE_QUOTE) ||                \
  |  |  ------------------
  |  |  |  |  117|  31.1k|#define C_DOUBLE_QUOTE '\042'
  |  |  ------------------
  |  |  |  Branch (127:6): [True: 73, False: 31.2k]
  |  |  |  Branch (127:22): [True: 125, False: 31.1k]
  |  |  |  Branch (127:38): [True: 0, False: 31.1k]
  |  |  ------------------
  |  |  128|  31.3k|     ((c) == '\r') || ((c) == '\n') || ((c) == '+') ||                         \
  |  |  ------------------
  |  |  |  Branch (128:6): [True: 0, False: 31.1k]
  |  |  |  Branch (128:23): [True: 0, False: 31.1k]
  |  |  |  Branch (128:40): [True: 110, False: 31.0k]
  |  |  ------------------
  |  |  129|  31.3k|     ((c) == '<') || ((c) == '>') || ((c) == '#') ||                           \
  |  |  ------------------
  |  |  |  Branch (129:6): [True: 51, False: 30.9k]
  |  |  |  Branch (129:22): [True: 163, False: 30.8k]
  |  |  |  Branch (129:38): [True: 142, False: 30.6k]
  |  |  ------------------
  |  |  130|  31.3k|     ((c) == ';') || ((c) == C_BACKSLASH))
  |  |  ------------------
  |  |  |  |  119|  30.2k|#define C_BACKSLASH '\134'
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 441, False: 30.2k]
  |  |  |  Branch (130:22): [True: 0, False: 30.2k]
  |  |  ------------------
  ------------------
  |  Branch (676:56): [True: 0, False: 1.10k]
  ------------------
  677|    210|                *dst++ = C_BACKSLASH;
  ------------------
  |  |  119|    210|#define C_BACKSLASH '\134'
  ------------------
  678|    210|            }
  679|  31.5k|            *dst++ = c;
  680|  31.5k|        }
  681|  34.0k|    }
  682|  7.15k|    if (mode == minimalEscapeAndQuote)
  ------------------
  |  Branch (682:9): [True: 779, False: 6.37k]
  ------------------
  683|    779|        *dst++ = C_DOUBLE_QUOTE;
  ------------------
  |  |  117|    779|#define C_DOUBLE_QUOTE '\042'
  ------------------
  684|  7.15k|    *dst++ = 0;
  685|  7.15k|    if (pEQMode)
  ------------------
  |  Branch (685:9): [True: 7.15k, False: 0]
  ------------------
  686|  7.15k|        *pEQMode = mode;
  687|  7.15k|    return SECSuccess;
  688|  7.15k|}
alg1485.c:cert_RFC1485_GetRequiredLen:
  608|  14.3k|{
  609|  14.3k|    int i, reqLen = 0;
  610|  14.3k|    EQMode mode = pEQMode ? *pEQMode : minimalEscape;
  ------------------
  |  Branch (610:19): [True: 14.3k, False: 0]
  ------------------
  611|  14.3k|    PRBool needsQuoting = PR_FALSE;
  ------------------
  |  |  438|  14.3k|#define PR_FALSE 0
  ------------------
  612|  14.3k|    char lastC = 0;
  613|       |
  614|       |    /* avoids needing to check for overflow */
  615|  14.3k|    if (srclen > 16384) {
  ------------------
  |  Branch (615:9): [True: 0, False: 14.3k]
  ------------------
  616|      0|        return -1;
  617|      0|    }
  618|       |    /* need to make an initial pass to determine if quoting is needed */
  619|  82.9k|    for (i = 0; i < srclen; i++) {
  ------------------
  |  Branch (619:17): [True: 68.6k, False: 14.3k]
  ------------------
  620|  68.6k|        char c = src[i];
  621|  68.6k|        reqLen++;
  622|  68.6k|        if (NEEDS_HEX_ESCAPE(c)) { /* c -> \xx  */
  ------------------
  |  |  155|  68.6k|#define NEEDS_HEX_ESCAPE(c) ((PRUint8)c < 0x20 || c == 0x7f)
  |  |  ------------------
  |  |  |  Branch (155:30): [True: 5.05k, False: 63.5k]
  |  |  |  Branch (155:51): [True: 91, False: 63.4k]
  |  |  ------------------
  ------------------
  623|  5.15k|            reqLen += 2;
  624|  63.4k|        } else if (NEEDS_ESCAPE(c)) { /* c -> \c   */
  ------------------
  |  |  153|  63.4k|#define NEEDS_ESCAPE(c) (c == C_DOUBLE_QUOTE || c == C_BACKSLASH)
  |  |  ------------------
  |  |  |  |  117|   126k|#define C_DOUBLE_QUOTE '\042'
  |  |  ------------------
  |  |               #define NEEDS_ESCAPE(c) (c == C_DOUBLE_QUOTE || c == C_BACKSLASH)
  |  |  ------------------
  |  |  |  |  119|   126k|#define C_BACKSLASH '\134'
  |  |  ------------------
  |  |  |  Branch (153:26): [True: 198, False: 63.2k]
  |  |  |  Branch (153:49): [True: 231, False: 63.0k]
  |  |  ------------------
  ------------------
  625|    429|            reqLen++;
  626|  63.0k|        } else if (SPECIAL_CHAR(c)) {
  ------------------
  |  |  127|  63.0k|    (((c) == ',') || ((c) == '=') || ((c) == C_DOUBLE_QUOTE) ||                \
  |  |  ------------------
  |  |  |  |  117|  62.6k|#define C_DOUBLE_QUOTE '\042'
  |  |  ------------------
  |  |  |  Branch (127:6): [True: 151, False: 62.8k]
  |  |  |  Branch (127:22): [True: 258, False: 62.6k]
  |  |  |  Branch (127:38): [True: 0, False: 62.6k]
  |  |  ------------------
  |  |  128|  63.0k|     ((c) == '\r') || ((c) == '\n') || ((c) == '+') ||                         \
  |  |  ------------------
  |  |  |  Branch (128:6): [True: 0, False: 62.6k]
  |  |  |  Branch (128:23): [True: 0, False: 62.6k]
  |  |  |  Branch (128:40): [True: 225, False: 62.4k]
  |  |  ------------------
  |  |  129|  63.0k|     ((c) == '<') || ((c) == '>') || ((c) == '#') ||                           \
  |  |  ------------------
  |  |  |  Branch (129:6): [True: 106, False: 62.2k]
  |  |  |  Branch (129:22): [True: 329, False: 61.9k]
  |  |  |  Branch (129:38): [True: 304, False: 61.6k]
  |  |  ------------------
  |  |  130|  63.0k|     ((c) == ';') || ((c) == C_BACKSLASH))
  |  |  ------------------
  |  |  |  |  119|  60.7k|#define C_BACKSLASH '\134'
  |  |  ------------------
  |  |  |  Branch (130:6): [True: 887, False: 60.7k]
  |  |  |  Branch (130:22): [True: 0, False: 60.7k]
  |  |  ------------------
  ------------------
  627|  2.26k|            if (mode == minimalEscapeAndQuote) /* quoting is allowed */
  ------------------
  |  Branch (627:17): [True: 2.26k, False: 0]
  ------------------
  628|  2.26k|                needsQuoting = PR_TRUE;        /* entirety will need quoting */
  ------------------
  |  |  437|  2.26k|#define PR_TRUE 1
  ------------------
  629|      0|            else if (mode == fullEscape)
  ------------------
  |  Branch (629:22): [True: 0, False: 0]
  ------------------
  630|      0|                reqLen++; /* MAY escape this character */
  631|  60.7k|        } else if (OPTIONAL_SPACE(c) && OPTIONAL_SPACE(lastC)) {
  ------------------
  |  |  124|   121k|    (((c) == ' ') || ((c) == '\r') || ((c) == '\n'))
  |  |  ------------------
  |  |  |  Branch (124:6): [True: 764, False: 60.0k]
  |  |  |  Branch (124:22): [True: 0, False: 60.0k]
  |  |  |  Branch (124:39): [True: 0, False: 60.0k]
  |  |  ------------------
  ------------------
                      } else if (OPTIONAL_SPACE(c) && OPTIONAL_SPACE(lastC)) {
  ------------------
  |  |  124|    764|    (((c) == ' ') || ((c) == '\r') || ((c) == '\n'))
  |  |  ------------------
  |  |  |  Branch (124:6): [True: 98, False: 666]
  |  |  |  Branch (124:22): [True: 13, False: 653]
  |  |  |  Branch (124:39): [True: 16, False: 637]
  |  |  ------------------
  ------------------
  632|    127|            if (mode == minimalEscapeAndQuote) /* quoting is allowed */
  ------------------
  |  Branch (632:17): [True: 127, False: 0]
  ------------------
  633|    127|                needsQuoting = PR_TRUE;        /* entirety will need quoting */
  ------------------
  |  |  437|    127|#define PR_TRUE 1
  ------------------
  634|    127|        }
  635|  68.6k|        lastC = c;
  636|  68.6k|    }
  637|       |    /* if it begins or ends in optional space it needs quoting */
  638|  14.3k|    if (!needsQuoting && srclen > 0 && mode == minimalEscapeAndQuote &&
  ------------------
  |  Branch (638:9): [True: 12.8k, False: 1.45k]
  |  Branch (638:26): [True: 12.6k, False: 192]
  |  Branch (638:40): [True: 6.41k, False: 6.24k]
  ------------------
  639|  14.3k|        (OPTIONAL_SPACE(src[srclen - 1]) || OPTIONAL_SPACE(src[0]))) {
  ------------------
  |  |  124|  12.8k|    (((c) == ' ') || ((c) == '\r') || ((c) == '\n'))
  |  |  ------------------
  |  |  |  Branch (124:6): [True: 36, False: 6.38k]
  |  |  |  Branch (124:22): [True: 24, False: 6.35k]
  |  |  |  Branch (124:39): [True: 23, False: 6.33k]
  |  |  ------------------
  ------------------
                      (OPTIONAL_SPACE(src[srclen - 1]) || OPTIONAL_SPACE(src[0]))) {
  ------------------
  |  |  124|  6.33k|    (((c) == ' ') || ((c) == '\r') || ((c) == '\n'))
  |  |  ------------------
  |  |  |  Branch (124:6): [True: 17, False: 6.31k]
  |  |  |  Branch (124:22): [True: 16, False: 6.30k]
  |  |  |  Branch (124:39): [True: 21, False: 6.28k]
  |  |  ------------------
  ------------------
  640|    137|        needsQuoting = PR_TRUE;
  ------------------
  |  |  437|    137|#define PR_TRUE 1
  ------------------
  641|    137|    }
  642|       |
  643|  14.3k|    if (needsQuoting)
  ------------------
  |  Branch (643:9): [True: 1.59k, False: 12.7k]
  ------------------
  644|  1.59k|        reqLen += 2;
  645|  14.3k|    if (pEQMode && mode == minimalEscapeAndQuote && !needsQuoting)
  ------------------
  |  Branch (645:9): [True: 14.3k, False: 0]
  |  Branch (645:20): [True: 7.96k, False: 6.34k]
  |  Branch (645:53): [True: 6.37k, False: 1.59k]
  ------------------
  646|  6.37k|        *pEQMode = minimalEscape;
  647|       |    /* Maximum output size would be 3*srclen+2 */
  648|  14.3k|    return reqLen;
  649|  14.3k|}
alg1485.c:AppendStr:
  554|  10.8k|{
  555|  10.8k|    char* buf;
  556|  10.8k|    unsigned bufLen, bufSize, len;
  557|  10.8k|    int size = 0;
  558|       |
  559|       |    /* Figure out how much to grow buf by (add in the '\0') */
  560|  10.8k|    buf = bufp->buffer;
  561|  10.8k|    bufLen = bufp->offset;
  562|  10.8k|    len = PORT_Strlen(str);
  ------------------
  |  |  190|  10.8k|#define PORT_Strlen(s) strlen(s)
  ------------------
  563|  10.8k|    bufSize = bufLen + len;
  564|  10.8k|    if (!buf) {
  ------------------
  |  Branch (564:9): [True: 10.4k, False: 473]
  ------------------
  565|  10.4k|        bufSize++;
  566|  10.4k|        size = PR_MAX(DEFAULT_BUFFER_SIZE, bufSize * 2);
  ------------------
  |  |  159|  10.4k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 10.4k, False: 0]
  |  |  ------------------
  ------------------
  567|  10.4k|        buf = (char*)PORT_Alloc(size);
  ------------------
  |  |   52|  10.4k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  568|  10.4k|        bufp->size = size;
  569|  10.4k|    } else if (bufp->size < bufSize) {
  ------------------
  |  Branch (569:16): [True: 0, False: 473]
  ------------------
  570|      0|        size = bufSize * 2;
  571|      0|        buf = (char*)PORT_Realloc(buf, size);
  ------------------
  |  |   64|      0|#define PORT_Realloc PORT_Realloc_Util
  ------------------
  572|      0|        bufp->size = size;
  573|      0|    }
  574|  10.8k|    if (!buf) {
  ------------------
  |  Branch (574:9): [True: 0, False: 10.8k]
  ------------------
  575|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  576|      0|        return SECFailure;
  577|      0|    }
  578|  10.8k|    bufp->buffer = buf;
  579|  10.8k|    bufp->offset = bufSize;
  580|       |
  581|       |    /* Concatenate str onto buf */
  582|  10.8k|    buf = buf + bufLen;
  583|  10.8k|    if (bufLen)
  ------------------
  |  Branch (583:9): [True: 473, False: 10.4k]
  ------------------
  584|    473|        buf--;                      /* stomp on old '\0' */
  585|  10.8k|    PORT_Memcpy(buf, str, len + 1); /* put in new null */
  ------------------
  |  |  180|  10.8k|#define PORT_Memcpy memcpy
  ------------------
  586|  10.8k|    return SECSuccess;
  587|  10.8k|}
alg1485.c:AppendAVA:
  921|  10.6k|{
  922|  10.6k|#define TMPBUF_LEN 2048
  923|  10.6k|    const NameToKind* pn2k = name2kinds;
  924|  10.6k|    SECItem* avaValue = NULL;
  925|  10.6k|    char* unknownTag = NULL;
  926|  10.6k|    char* encodedAVA = NULL;
  927|  10.6k|    PRBool useHex = PR_FALSE; /* use =#hexXXXX form */
  ------------------
  |  |  438|  10.6k|#define PR_FALSE 0
  ------------------
  928|  10.6k|    PRBool truncateName = PR_FALSE;
  ------------------
  |  |  438|  10.6k|#define PR_FALSE 0
  ------------------
  929|  10.6k|    PRBool truncateValue = PR_FALSE;
  ------------------
  |  |  438|  10.6k|#define PR_FALSE 0
  ------------------
  930|  10.6k|    SECOidTag endKind;
  931|  10.6k|    SECStatus rv;
  932|  10.6k|    unsigned int len;
  933|  10.6k|    unsigned int nameLen, valueLen;
  934|  10.6k|    unsigned int maxName, maxValue;
  935|  10.6k|    EQMode mode = minimalEscapeAndQuote;
  936|  10.6k|    NameToKind n2k = { NULL, 32767, SEC_OID_UNKNOWN, SEC_ASN1_DS };
  ------------------
  |  |   24|  10.6k|#define SEC_ASN1_DS SEC_ASN1_HIGH_TAG_NUMBER
  |  |  ------------------
  |  |  |  |  107|  10.6k|#define SEC_ASN1_HIGH_TAG_NUMBER 0x1f
  |  |  ------------------
  ------------------
  937|  10.6k|    char tmpBuf[TMPBUF_LEN];
  938|       |
  939|  10.6k|#define tagName n2k.name /* non-NULL means use NAME= form */
  940|  10.6k|#define maxBytes n2k.maxLen
  941|  10.6k|#define tag n2k.kind
  942|  10.6k|#define vt n2k.valueType
  943|       |
  944|       |    /* READABLE mode recognizes more names from the name2kinds table
  945|       |     * than do STRICT or INVERTIBLE modes.  This assignment chooses the
  946|       |     * point in the table where the attribute type name scanning stops.
  947|       |     */
  948|  10.6k|    endKind = (strict == CERT_N2A_READABLE) ? SEC_OID_UNKNOWN
  ------------------
  |  Branch (948:15): [True: 10.6k, False: 0]
  ------------------
  949|  10.6k|                                            : SEC_OID_AVA_POSTAL_ADDRESS;
  950|  10.6k|    tag = CERT_GetAVATag(ava);
  ------------------
  |  |  941|  10.6k|#define tag n2k.kind
  ------------------
  951|   227k|    while (pn2k->kind != tag && pn2k->kind != endKind) {
  ------------------
  |  |  941|   455k|#define tag n2k.kind
  ------------------
  |  Branch (951:12): [True: 224k, False: 3.04k]
  |  Branch (951:33): [True: 217k, False: 7.64k]
  ------------------
  952|   217k|        ++pn2k;
  953|   217k|    }
  954|       |
  955|  10.6k|    if (pn2k->kind != endKind) {
  ------------------
  |  Branch (955:9): [True: 3.04k, False: 7.64k]
  ------------------
  956|  3.04k|        n2k = *pn2k;
  957|  7.64k|    } else if (strict != CERT_N2A_READABLE) {
  ------------------
  |  Branch (957:16): [True: 0, False: 7.64k]
  ------------------
  958|      0|        useHex = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  959|      0|    }
  960|       |    /* For invertable form, force Directory Strings to use hex form. */
  961|  10.6k|    if (strict == CERT_N2A_INVERTIBLE && vt == SEC_ASN1_DS) {
  ------------------
  |  |  942|      0|#define vt n2k.valueType
  ------------------
                  if (strict == CERT_N2A_INVERTIBLE && vt == SEC_ASN1_DS) {
  ------------------
  |  |   24|      0|#define SEC_ASN1_DS SEC_ASN1_HIGH_TAG_NUMBER
  |  |  ------------------
  |  |  |  |  107|      0|#define SEC_ASN1_HIGH_TAG_NUMBER 0x1f
  |  |  ------------------
  ------------------
  |  Branch (961:9): [True: 0, False: 10.6k]
  |  Branch (961:42): [True: 0, False: 0]
  ------------------
  962|      0|        tagName = NULL;   /* must use OID.N form */
  ------------------
  |  |  939|      0|#define tagName n2k.name /* non-NULL means use NAME= form */
  ------------------
  963|      0|        useHex = PR_TRUE; /* must use hex string */
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  964|      0|    }
  965|  10.6k|    if (!useHex) {
  ------------------
  |  Branch (965:9): [True: 10.6k, False: 0]
  ------------------
  966|  10.6k|        avaValue = CERT_DecodeAVAValue(&ava->value);
  967|  10.6k|        if (!avaValue) {
  ------------------
  |  Branch (967:13): [True: 3.51k, False: 7.17k]
  ------------------
  968|  3.51k|            useHex = PR_TRUE;
  ------------------
  |  |  437|  3.51k|#define PR_TRUE 1
  ------------------
  969|  3.51k|            if (strict != CERT_N2A_READABLE) {
  ------------------
  |  Branch (969:17): [True: 0, False: 3.51k]
  ------------------
  970|      0|                tagName = NULL; /* must use OID.N form */
  ------------------
  |  |  939|      0|#define tagName n2k.name /* non-NULL means use NAME= form */
  ------------------
  971|      0|            }
  972|  3.51k|        }
  973|  10.6k|    }
  974|  10.6k|    if (!tagName) {
  ------------------
  |  |  939|  10.6k|#define tagName n2k.name /* non-NULL means use NAME= form */
  ------------------
  |  Branch (974:9): [True: 7.64k, False: 3.04k]
  ------------------
  975|       |        /* handle unknown attribute types per RFC 2253 */
  976|  7.64k|        tagName = unknownTag = CERT_GetOidString(&ava->type);
  ------------------
  |  |  939|  7.64k|#define tagName n2k.name /* non-NULL means use NAME= form */
  ------------------
  977|  7.64k|        if (!tagName) {
  ------------------
  |  |  939|  7.64k|#define tagName n2k.name /* non-NULL means use NAME= form */
  ------------------
  |  Branch (977:13): [True: 61, False: 7.58k]
  ------------------
  978|     61|            if (avaValue)
  ------------------
  |  Branch (978:17): [True: 16, False: 45]
  ------------------
  979|     16|                SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  108|     16|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                              SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  437|     16|#define PR_TRUE 1
  ------------------
  980|     61|            return SECFailure;
  981|     61|        }
  982|  7.64k|    }
  983|  10.6k|    if (useHex) {
  ------------------
  |  Branch (983:9): [True: 3.47k, False: 7.15k]
  ------------------
  984|  3.47k|        avaValue = get_hex_string(&ava->value);
  985|  3.47k|        if (!avaValue) {
  ------------------
  |  Branch (985:13): [True: 0, False: 3.47k]
  ------------------
  986|      0|            if (unknownTag)
  ------------------
  |  Branch (986:17): [True: 0, False: 0]
  ------------------
  987|      0|                PR_smprintf_free(unknownTag);
  988|      0|            return SECFailure;
  989|      0|        }
  990|  3.47k|    }
  991|       |
  992|  10.6k|    nameLen = strlen(tagName);
  ------------------
  |  |  939|  10.6k|#define tagName n2k.name /* non-NULL means use NAME= form */
  ------------------
  993|       |
  994|  10.6k|    if (useHex) {
  ------------------
  |  Branch (994:9): [True: 3.47k, False: 7.15k]
  ------------------
  995|  3.47k|        valueLen = avaValue->len;
  996|  7.15k|    } else {
  997|  7.15k|        int reqLen = cert_RFC1485_GetRequiredLen((char*)avaValue->data, avaValue->len, &mode);
  998|  7.15k|        if (reqLen < 0) {
  ------------------
  |  Branch (998:13): [True: 0, False: 7.15k]
  ------------------
  999|      0|            SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                          SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1000|      0|            return SECFailure;
 1001|      0|        }
 1002|  7.15k|        valueLen = reqLen;
 1003|  7.15k|    }
 1004|  10.6k|    if (UINT_MAX - nameLen < 2 ||
  ------------------
  |  Branch (1004:9): [True: 0, False: 10.6k]
  ------------------
 1005|  10.6k|        valueLen > UINT_MAX - nameLen - 2) {
  ------------------
  |  Branch (1005:9): [True: 0, False: 10.6k]
  ------------------
 1006|      0|        SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1007|      0|        return SECFailure;
 1008|      0|    }
 1009|  10.6k|    len = nameLen + valueLen + 2; /* Add 2 for '=' and trailing NUL */
 1010|       |
 1011|  10.6k|    maxName = nameLen;
 1012|  10.6k|    maxValue = valueLen;
 1013|  10.6k|    if (len <= sizeof(tmpBuf)) {
  ------------------
  |  Branch (1013:9): [True: 10.6k, False: 0]
  ------------------
 1014|  10.6k|        encodedAVA = tmpBuf;
 1015|  10.6k|    } else if (strict != CERT_N2A_READABLE) {
  ------------------
  |  Branch (1015:16): [True: 0, False: 0]
  ------------------
 1016|      0|        encodedAVA = PORT_Alloc(len);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1017|      0|        if (!encodedAVA) {
  ------------------
  |  Branch (1017:13): [True: 0, False: 0]
  ------------------
 1018|      0|            SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                          SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1019|      0|            if (unknownTag)
  ------------------
  |  Branch (1019:17): [True: 0, False: 0]
  ------------------
 1020|      0|                PR_smprintf_free(unknownTag);
 1021|      0|            return SECFailure;
 1022|      0|        }
 1023|      0|    } else {
 1024|       |        /* Must make output fit in tmpbuf */
 1025|      0|        unsigned int fair = (sizeof tmpBuf) / 2 - 1; /* for = and \0 */
 1026|       |
 1027|      0|        if (nameLen < fair) {
  ------------------
  |  Branch (1027:13): [True: 0, False: 0]
  ------------------
 1028|       |            /* just truncate the value */
 1029|      0|            maxValue = (sizeof tmpBuf) - (nameLen + 6); /* for "=...\0",
 1030|       |                                                     and possibly '"' */
 1031|      0|        } else if (valueLen < fair) {
  ------------------
  |  Branch (1031:20): [True: 0, False: 0]
  ------------------
 1032|       |            /* just truncate the name */
 1033|      0|            maxName = (sizeof tmpBuf) - (valueLen + 5); /* for "=...\0" */
 1034|      0|        } else {
 1035|       |            /* truncate both */
 1036|      0|            maxName = maxValue = fair - 3; /* for "..." */
 1037|      0|        }
 1038|      0|        if (nameLen > maxName) {
  ------------------
  |  Branch (1038:13): [True: 0, False: 0]
  ------------------
 1039|      0|            PORT_Assert(unknownTag && unknownTag == tagName);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1040|      0|            truncateName = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1041|      0|            nameLen = maxName;
 1042|      0|        }
 1043|      0|        encodedAVA = tmpBuf;
 1044|      0|    }
 1045|       |
 1046|  10.6k|    memcpy(encodedAVA, tagName, nameLen);
  ------------------
  |  |  939|  10.6k|#define tagName n2k.name /* non-NULL means use NAME= form */
  ------------------
 1047|  10.6k|    if (truncateName) {
  ------------------
  |  Branch (1047:9): [True: 0, False: 10.6k]
  ------------------
 1048|       |        /* If tag name is too long, we know it is an OID form that was
 1049|       |         * allocated from the heap, so we can modify it in place
 1050|       |         */
 1051|      0|        encodedAVA[nameLen - 1] = '.';
 1052|      0|        encodedAVA[nameLen - 2] = '.';
 1053|      0|        encodedAVA[nameLen - 3] = '.';
 1054|      0|    }
 1055|  10.6k|    encodedAVA[nameLen++] = '=';
 1056|  10.6k|    if (unknownTag)
  ------------------
  |  Branch (1056:9): [True: 7.58k, False: 3.04k]
  ------------------
 1057|  7.58k|        PR_smprintf_free(unknownTag);
 1058|       |
 1059|  10.6k|    if (strict == CERT_N2A_READABLE && maxValue > maxBytes)
  ------------------
  |  |  940|  10.6k|#define maxBytes n2k.maxLen
  ------------------
  |  Branch (1059:9): [True: 10.6k, False: 0]
  |  Branch (1059:40): [True: 97, False: 10.5k]
  ------------------
 1060|     97|        maxValue = maxBytes;
  ------------------
  |  |  940|     97|#define maxBytes n2k.maxLen
  ------------------
 1061|  10.6k|    if (valueLen > maxValue) {
  ------------------
  |  Branch (1061:9): [True: 97, False: 10.5k]
  ------------------
 1062|     97|        valueLen = maxValue;
 1063|     97|        truncateValue = PR_TRUE;
  ------------------
  |  |  437|     97|#define PR_TRUE 1
  ------------------
 1064|     97|    }
 1065|       |    /* escape and quote as necessary - don't quote hex strings */
 1066|  10.6k|    if (useHex) {
  ------------------
  |  Branch (1066:9): [True: 3.47k, False: 7.15k]
  ------------------
 1067|  3.47k|        char* end = encodedAVA + nameLen + valueLen;
 1068|  3.47k|        memcpy(encodedAVA + nameLen, (char*)avaValue->data, valueLen);
 1069|  3.47k|        end[0] = '\0';
 1070|  3.47k|        if (truncateValue) {
  ------------------
  |  Branch (1070:13): [True: 13, False: 3.45k]
  ------------------
 1071|     13|            end[-1] = '.';
 1072|     13|            end[-2] = '.';
 1073|     13|            end[-3] = '.';
 1074|     13|        }
 1075|  3.47k|        rv = SECSuccess;
 1076|  7.15k|    } else if (!truncateValue) {
  ------------------
  |  Branch (1076:16): [True: 7.07k, False: 84]
  ------------------
 1077|  7.07k|        rv = escapeAndQuote(encodedAVA + nameLen, len - nameLen,
 1078|  7.07k|                            (char*)avaValue->data, avaValue->len, &mode);
 1079|  7.07k|    } else {
 1080|       |        /* must truncate the escaped and quoted value */
 1081|     84|        char bigTmpBuf[TMPBUF_LEN * 3 + 3];
 1082|     84|        PORT_Assert(valueLen < sizeof tmpBuf);
  ------------------
  |  |  120|     84|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     84|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 84, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1083|     84|        rv = escapeAndQuote(bigTmpBuf, sizeof bigTmpBuf, (char*)avaValue->data,
 1084|     84|                            PR_MIN(avaValue->len, valueLen), &mode);
  ------------------
  |  |  158|     84|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 84]
  |  |  ------------------
  ------------------
 1085|       |
 1086|     84|        bigTmpBuf[valueLen--] = '\0'; /* hard stop here */
 1087|       |        /* See if we're in the middle of a multi-byte UTF8 character */
 1088|    114|        while (((bigTmpBuf[valueLen] & 0xc0) == 0x80) && valueLen > 0) {
  ------------------
  |  Branch (1088:16): [True: 34, False: 80]
  |  Branch (1088:58): [True: 30, False: 4]
  ------------------
 1089|     30|            bigTmpBuf[valueLen--] = '\0';
 1090|     30|        }
 1091|       |        /* add ellipsis to signify truncation. */
 1092|     84|        bigTmpBuf[++valueLen] = '.';
 1093|     84|        bigTmpBuf[++valueLen] = '.';
 1094|     84|        bigTmpBuf[++valueLen] = '.';
 1095|     84|        if (bigTmpBuf[0] == '"')
  ------------------
  |  Branch (1095:13): [True: 26, False: 58]
  ------------------
 1096|     26|            bigTmpBuf[++valueLen] = '"';
 1097|     84|        bigTmpBuf[++valueLen] = '\0';
 1098|     84|        PORT_Assert(nameLen + valueLen <= (sizeof tmpBuf) - 1);
  ------------------
  |  |  120|     84|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     84|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 84, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1099|     84|        memcpy(encodedAVA + nameLen, bigTmpBuf, valueLen + 1);
 1100|     84|    }
 1101|       |
 1102|  10.6k|    SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  108|  10.6k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(avaValue, PR_TRUE);
  ------------------
  |  |  437|  10.6k|#define PR_TRUE 1
  ------------------
 1103|  10.6k|    if (rv == SECSuccess)
  ------------------
  |  Branch (1103:9): [True: 10.6k, False: 0]
  ------------------
 1104|  10.6k|        rv = AppendStr(bufp, encodedAVA);
 1105|  10.6k|    if (encodedAVA != tmpBuf)
  ------------------
  |  Branch (1105:9): [True: 0, False: 10.6k]
  ------------------
 1106|      0|        PORT_Free(encodedAVA);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1107|  10.6k|    return rv;
 1108|  10.6k|}
alg1485.c:get_hex_string:
  842|  3.47k|{
  843|  3.47k|    SECItem* rv;
  844|  3.47k|    unsigned int i, j;
  845|  3.47k|    static const char hex[] = { "0123456789ABCDEF" };
  846|       |
  847|       |    /* '#' + 2 chars per octet + terminator */
  848|  3.47k|    rv = SECITEM_AllocItem(NULL, NULL, data->len * 2 + 2);
  ------------------
  |  |  103|  3.47k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  849|  3.47k|    if (!rv) {
  ------------------
  |  Branch (849:9): [True: 0, False: 3.47k]
  ------------------
  850|      0|        return NULL;
  851|      0|    }
  852|  3.47k|    rv->data[0] = '#';
  853|  3.47k|    rv->len = 1 + 2 * data->len;
  854|  23.2k|    for (i = 0; i < data->len; i++) {
  ------------------
  |  Branch (854:17): [True: 19.7k, False: 3.47k]
  ------------------
  855|  19.7k|        j = data->data[i];
  856|  19.7k|        rv->data[2 * i + 1] = hex[j >> 4];
  857|  19.7k|        rv->data[2 * i + 2] = hex[j & 15];
  858|  19.7k|    }
  859|  3.47k|    rv->data[rv->len] = 0;
  860|  3.47k|    return rv;
  861|  3.47k|}
alg1485.c:CERT_GetNameElement:
 1252|  10.4k|{
 1253|  10.4k|    CERTRDN** rdns = name->rdns;
 1254|  10.4k|    CERTRDN* rdn;
 1255|  10.4k|    CERTAVA* ava = NULL;
 1256|       |
 1257|  21.1k|    while (rdns && (rdn = *rdns++) != 0) {
  ------------------
  |  Branch (1257:12): [True: 21.1k, False: 0]
  |  Branch (1257:20): [True: 10.7k, False: 10.4k]
  ------------------
 1258|  10.7k|        CERTAVA** avas = rdn->avas;
 1259|  21.4k|        while (avas && (ava = *avas++) != 0) {
  ------------------
  |  Branch (1259:16): [True: 21.4k, False: 0]
  |  Branch (1259:24): [True: 10.7k, False: 10.7k]
  ------------------
 1260|  10.7k|            int tag = CERT_GetAVATag(ava);
 1261|  10.7k|            if (tag == wantedTag) {
  ------------------
  |  Branch (1261:17): [True: 0, False: 10.7k]
  ------------------
 1262|      0|                avas = NULL;
 1263|      0|                rdns = NULL; /* break out of all loops */
 1264|      0|            }
 1265|  10.7k|        }
 1266|  10.7k|    }
 1267|  10.4k|    return ava ? avaToString(arena, ava) : NULL;
  ------------------
  |  Branch (1267:12): [True: 0, False: 10.4k]
  ------------------
 1268|  10.4k|}
alg1485.c:appendStringToBuf:
 1381|  10.4k|{
 1382|  10.4k|    PRUint32 len;
 1383|  10.4k|    if (dest && src && src[0] && *pRemaining > (len = PL_strlen(src))) {
  ------------------
  |  Branch (1383:9): [True: 10.4k, False: 0]
  |  Branch (1383:17): [True: 0, False: 10.4k]
  |  Branch (1383:24): [True: 0, False: 0]
  |  Branch (1383:34): [True: 0, False: 0]
  ------------------
 1384|      0|        PRUint32 i;
 1385|      0|        for (i = 0; i < len; ++i)
  ------------------
  |  Branch (1385:21): [True: 0, False: 0]
  ------------------
 1386|      0|            dest[i] = tolower((unsigned char)src[i]);
 1387|      0|        dest[len] = 0;
 1388|      0|        dest += len + 1;
 1389|      0|        *pRemaining -= len + 1;
 1390|      0|    }
 1391|  10.4k|    return dest;
 1392|  10.4k|}
alg1485.c:appendItemToBuf:
 1399|     38|{
 1400|     38|    if (dest && src && src->data && src->len && src->data[0]) {
  ------------------
  |  Branch (1400:9): [True: 38, False: 0]
  |  Branch (1400:17): [True: 38, False: 0]
  |  Branch (1400:24): [True: 30, False: 8]
  |  Branch (1400:37): [True: 30, False: 0]
  |  Branch (1400:49): [True: 19, False: 11]
  ------------------
 1401|     19|        PRUint32 len = src->len;
 1402|     19|        PRUint32 i;
 1403|     19|        PRUint32 reqLen = len + 1;
 1404|       |        /* are there any embedded control characters ? */
 1405|    134|        for (i = 0; i < len; i++) {
  ------------------
  |  Branch (1405:21): [True: 115, False: 19]
  ------------------
 1406|    115|            if (NEEDS_HEX_ESCAPE(src->data[i]))
  ------------------
  |  | 1395|    115|#define NEEDS_HEX_ESCAPE(c) (c < 0x20)
  |  |  ------------------
  |  |  |  Branch (1395:29): [True: 52, False: 63]
  |  |  ------------------
  ------------------
 1407|     52|                reqLen += 2;
 1408|    115|        }
 1409|     19|        if (*pRemaining > reqLen) {
  ------------------
  |  Branch (1409:13): [True: 19, False: 0]
  ------------------
 1410|    134|            for (i = 0; i < len; ++i) {
  ------------------
  |  Branch (1410:25): [True: 115, False: 19]
  ------------------
 1411|    115|                PRUint8 c = src->data[i];
 1412|    115|                if (NEEDS_HEX_ESCAPE(c)) {
  ------------------
  |  | 1395|    115|#define NEEDS_HEX_ESCAPE(c) (c < 0x20)
  |  |  ------------------
  |  |  |  Branch (1395:29): [True: 52, False: 63]
  |  |  ------------------
  ------------------
 1413|     52|                    *dest++ =
 1414|     52|                        C_BACKSLASH;
  ------------------
  |  |  119|     52|#define C_BACKSLASH '\134'
  ------------------
 1415|     52|                    *dest++ =
 1416|     52|                        hexChars[(c >> 4) & 0x0f];
 1417|     52|                    *dest++ =
 1418|     52|                        hexChars[c & 0x0f];
 1419|     63|                } else {
 1420|     63|                    *dest++ =
 1421|     63|                        tolower(c);
 1422|     63|                }
 1423|    115|            }
 1424|     19|            *dest++ = '\0';
 1425|     19|            *pRemaining -= reqLen;
 1426|     19|        }
 1427|     19|    }
 1428|     38|    return dest;
 1429|     38|}

CERT_KeyFromIssuerAndSN:
  184|  5.21k|{
  185|  5.21k|    key->len = sn->len + issuer->len;
  186|       |
  187|  5.21k|    if ((sn->data == NULL) || (issuer->data == NULL)) {
  ------------------
  |  Branch (187:9): [True: 0, False: 5.21k]
  |  Branch (187:31): [True: 0, False: 5.21k]
  ------------------
  188|      0|        goto loser;
  189|      0|    }
  190|       |
  191|  5.21k|    key->data = (unsigned char *)PORT_ArenaAlloc(arena, key->len);
  ------------------
  |  |   53|  5.21k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  192|  5.21k|    if (!key->data) {
  ------------------
  |  Branch (192:9): [True: 0, False: 5.21k]
  ------------------
  193|      0|        goto loser;
  194|      0|    }
  195|       |
  196|       |    /* copy the serialNumber */
  197|  5.21k|    PORT_Memcpy(key->data, sn->data, sn->len);
  ------------------
  |  |  180|  5.21k|#define PORT_Memcpy memcpy
  ------------------
  198|       |
  199|       |    /* copy the issuer */
  200|  5.21k|    PORT_Memcpy(&key->data[sn->len], issuer->data, issuer->len);
  ------------------
  |  |  180|  5.21k|#define PORT_Memcpy memcpy
  ------------------
  201|       |
  202|  5.21k|    return (SECSuccess);
  203|       |
  204|      0|loser:
  205|      0|    return (SECFailure);
  206|  5.21k|}
CERT_IssuerNameFromDERCert:
  258|  10.8k|{
  259|  10.8k|    int rv;
  260|  10.8k|    PORTCheapArenaPool tmpArena;
  261|  10.8k|    CERTSignedData sd;
  262|  10.8k|    void *tmpptr;
  263|       |
  264|  10.8k|    PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  10.8k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  265|       |
  266|  10.8k|    PORT_Memset(&sd, 0, sizeof(CERTSignedData));
  ------------------
  |  |  182|  10.8k|#define PORT_Memset memset
  ------------------
  267|  10.8k|    rv = SEC_QuickDERDecodeItem(&tmpArena.arena, &sd, CERT_SignedDataTemplate,
  ------------------
  |  |  102|  10.8k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  268|  10.8k|                                derCert);
  269|  10.8k|    if (rv) {
  ------------------
  |  Branch (269:9): [True: 320, False: 10.4k]
  ------------------
  270|    320|        goto loser;
  271|    320|    }
  272|       |
  273|  10.4k|    PORT_Memset(derName, 0, sizeof(SECItem));
  ------------------
  |  |  182|  10.4k|#define PORT_Memset memset
  ------------------
  274|  10.4k|    rv = SEC_QuickDERDecodeItem(&tmpArena.arena, derName,
  ------------------
  |  |  102|  10.4k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  275|  10.4k|                                SEC_CertIssuerTemplate, &sd.data);
  276|  10.4k|    if (rv) {
  ------------------
  |  Branch (276:9): [True: 6, False: 10.4k]
  ------------------
  277|      6|        goto loser;
  278|      6|    }
  279|       |
  280|  10.4k|    tmpptr = derName->data;
  281|  10.4k|    derName->data = (unsigned char *)PORT_Alloc(derName->len);
  ------------------
  |  |   52|  10.4k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  282|  10.4k|    if (derName->data == NULL) {
  ------------------
  |  Branch (282:9): [True: 0, False: 10.4k]
  ------------------
  283|      0|        goto loser;
  284|      0|    }
  285|       |
  286|  10.4k|    PORT_Memcpy(derName->data, tmpptr, derName->len);
  ------------------
  |  |  180|  10.4k|#define PORT_Memcpy memcpy
  ------------------
  287|       |
  288|  10.4k|    PORT_DestroyCheapArena(&tmpArena);
  289|  10.4k|    return (SECSuccess);
  290|       |
  291|    326|loser:
  292|    326|    PORT_DestroyCheapArena(&tmpArena);
  293|    326|    return (SECFailure);
  294|  10.4k|}
CERT_SerialNumberFromDERCert:
  298|  15.6k|{
  299|  15.6k|    int rv;
  300|  15.6k|    PORTCheapArenaPool tmpArena;
  301|  15.6k|    CERTSignedData sd;
  302|  15.6k|    void *tmpptr;
  303|       |
  304|  15.6k|    PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  15.6k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  305|       |
  306|  15.6k|    PORT_Memset(&sd, 0, sizeof(CERTSignedData));
  ------------------
  |  |  182|  15.6k|#define PORT_Memset memset
  ------------------
  307|  15.6k|    rv = SEC_QuickDERDecodeItem(&tmpArena.arena, &sd, CERT_SignedDataTemplate,
  ------------------
  |  |  102|  15.6k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  308|  15.6k|                                derCert);
  309|  15.6k|    if (rv) {
  ------------------
  |  Branch (309:9): [True: 0, False: 15.6k]
  ------------------
  310|      0|        goto loser;
  311|      0|    }
  312|       |
  313|  15.6k|    PORT_Memset(derName, 0, sizeof(SECItem));
  ------------------
  |  |  182|  15.6k|#define PORT_Memset memset
  ------------------
  314|  15.6k|    rv = SEC_QuickDERDecodeItem(&tmpArena.arena, derName,
  ------------------
  |  |  102|  15.6k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  315|  15.6k|                                SEC_CertSerialNumberTemplate, &sd.data);
  316|  15.6k|    if (rv) {
  ------------------
  |  Branch (316:9): [True: 0, False: 15.6k]
  ------------------
  317|      0|        goto loser;
  318|      0|    }
  319|       |
  320|  15.6k|    tmpptr = derName->data;
  321|  15.6k|    derName->data = (unsigned char *)PORT_Alloc(derName->len);
  ------------------
  |  |   52|  15.6k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  322|  15.6k|    if (derName->data == NULL) {
  ------------------
  |  Branch (322:9): [True: 0, False: 15.6k]
  ------------------
  323|      0|        goto loser;
  324|      0|    }
  325|       |
  326|  15.6k|    PORT_Memcpy(derName->data, tmpptr, derName->len);
  ------------------
  |  |  180|  15.6k|#define PORT_Memcpy memcpy
  ------------------
  327|       |
  328|  15.6k|    PORT_DestroyCheapArena(&tmpArena);
  329|  15.6k|    return (SECSuccess);
  330|       |
  331|      0|loser:
  332|      0|    PORT_DestroyCheapArena(&tmpArena);
  333|      0|    return (SECFailure);
  334|  15.6k|}
cert_GetCertType:
  434|  5.21k|{
  435|  5.21k|    PRUint32 nsCertType;
  436|       |
  437|  5.21k|    if (cert->nsCertType) {
  ------------------
  |  Branch (437:9): [True: 0, False: 5.21k]
  ------------------
  438|       |        /* once set, no need to recalculate */
  439|      0|        return SECSuccess;
  440|      0|    }
  441|  5.21k|    nsCertType = cert_ComputeCertType(cert);
  442|       |
  443|       |    /* Assert that it is safe to cast &cert->nsCertType to "PRInt32 *" */
  444|  5.21k|    PORT_Assert(sizeof(cert->nsCertType) == sizeof(PRInt32));
  ------------------
  |  |  120|  5.21k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.21k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  445|  5.21k|    PR_ATOMIC_SET((PRInt32 *)&cert->nsCertType, nsCertType);
  ------------------
  |  |  124|  5.21k|#define PR_ATOMIC_SET(val, newval) __sync_lock_test_and_set(val, newval)
  ------------------
  446|  5.21k|    return SECSuccess;
  447|  5.21k|}
cert_IsIPsecOID:
  451|     50|{
  452|     50|    if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (452:9): [True: 0, False: 50]
  ------------------
  453|     50|            extKeyUsage, SEC_OID_EXT_KEY_USAGE_IPSEC_IKE) == SECSuccess) {
  454|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  455|      0|    }
  456|     50|    if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (456:9): [True: 0, False: 50]
  ------------------
  457|     50|            extKeyUsage, SEC_OID_IPSEC_IKE_END) == SECSuccess) {
  458|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  459|      0|    }
  460|     50|    if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (460:9): [True: 0, False: 50]
  ------------------
  461|     50|            extKeyUsage, SEC_OID_IPSEC_IKE_INTERMEDIATE) == SECSuccess) {
  462|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  463|      0|    }
  464|       |    /* these are now deprecated, but may show up. Treat them the same as IKE */
  465|     50|    if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (465:9): [True: 0, False: 50]
  ------------------
  466|     50|            extKeyUsage, SEC_OID_EXT_KEY_USAGE_IPSEC_END) == SECSuccess) {
  467|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  468|      0|    }
  469|     50|    if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (469:9): [True: 0, False: 50]
  ------------------
  470|     50|            extKeyUsage, SEC_OID_EXT_KEY_USAGE_IPSEC_TUNNEL) == SECSuccess) {
  471|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  472|      0|    }
  473|     50|    if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (473:9): [True: 0, False: 50]
  ------------------
  474|     50|            extKeyUsage, SEC_OID_EXT_KEY_USAGE_IPSEC_USER) == SECSuccess) {
  475|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  476|      0|    }
  477|       |    /* this one should probably be in cert_ComputeCertType and set all usages? */
  478|     50|    if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (478:9): [True: 0, False: 50]
  ------------------
  479|     50|            extKeyUsage, SEC_OID_X509_ANY_EXT_KEY_USAGE) == SECSuccess) {
  480|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  481|      0|    }
  482|     50|    return PR_FALSE;
  ------------------
  |  |  438|     50|#define PR_FALSE 0
  ------------------
  483|     50|}
cert_ComputeCertType:
  487|  5.21k|{
  488|  5.21k|    SECStatus rv;
  489|  5.21k|    SECItem tmpitem;
  490|  5.21k|    SECItem encodedExtKeyUsage;
  491|  5.21k|    CERTOidSequence *extKeyUsage = NULL;
  492|  5.21k|    CERTBasicConstraints basicConstraint;
  493|  5.21k|    PRUint32 nsCertType = 0;
  494|  5.21k|    PRBool isCA = PR_FALSE;
  ------------------
  |  |  438|  5.21k|#define PR_FALSE 0
  ------------------
  495|       |
  496|  5.21k|    tmpitem.data = NULL;
  497|  5.21k|    CERT_FindNSCertTypeExtension(cert, &tmpitem);
  498|  5.21k|    encodedExtKeyUsage.data = NULL;
  499|  5.21k|    rv = CERT_FindCertExtension(cert, SEC_OID_X509_EXT_KEY_USAGE,
  500|  5.21k|                                &encodedExtKeyUsage);
  501|  5.21k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (501:9): [True: 237, False: 4.97k]
  ------------------
  502|    237|        extKeyUsage = CERT_DecodeOidSequence(&encodedExtKeyUsage);
  503|    237|    }
  504|  5.21k|    rv = CERT_FindBasicConstraintExten(cert, &basicConstraint);
  505|  5.21k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (505:9): [True: 2.10k, False: 3.10k]
  ------------------
  506|  2.10k|        isCA = basicConstraint.isCA;
  507|  2.10k|    }
  508|  5.21k|    if (tmpitem.data != NULL || extKeyUsage != NULL) {
  ------------------
  |  Branch (508:9): [True: 0, False: 5.21k]
  |  Branch (508:33): [True: 50, False: 5.16k]
  ------------------
  509|     50|        if (tmpitem.data == NULL || tmpitem.len == 0) {
  ------------------
  |  Branch (509:13): [True: 50, False: 0]
  |  Branch (509:37): [True: 0, False: 0]
  ------------------
  510|     50|            nsCertType = 0;
  511|     50|        } else {
  512|      0|            nsCertType = tmpitem.data[0];
  513|      0|        }
  514|       |
  515|       |        /* free tmpitem data pointer to avoid memory leak */
  516|     50|        PORT_Free(tmpitem.data);
  ------------------
  |  |   60|     50|#define PORT_Free PORT_Free_Util
  ------------------
  517|     50|        tmpitem.data = NULL;
  518|       |
  519|       |        /*
  520|       |         * for this release, we will allow SSL certs with an email address
  521|       |         * to be used for email
  522|       |         */
  523|     50|        if ((nsCertType & NS_CERT_TYPE_SSL_CLIENT) && cert->emailAddr &&
  ------------------
  |  |  447|     50|#define NS_CERT_TYPE_SSL_CLIENT (0x80)        /* bit 0 */
  ------------------
  |  Branch (523:13): [True: 0, False: 50]
  |  Branch (523:55): [True: 0, False: 0]
  ------------------
  524|     50|            cert->emailAddr[0]) {
  ------------------
  |  Branch (524:13): [True: 0, False: 0]
  ------------------
  525|      0|            nsCertType |= NS_CERT_TYPE_EMAIL;
  ------------------
  |  |  449|      0|#define NS_CERT_TYPE_EMAIL (0x20)             /* bit 2 */
  ------------------
  526|      0|        }
  527|       |        /*
  528|       |         * for this release, we will allow SSL intermediate CAs to be
  529|       |         * email intermediate CAs too.
  530|       |         */
  531|     50|        if (nsCertType & NS_CERT_TYPE_SSL_CA) {
  ------------------
  |  |  452|     50|#define NS_CERT_TYPE_SSL_CA (0x04)            /* bit 5 */
  ------------------
  |  Branch (531:13): [True: 0, False: 50]
  ------------------
  532|      0|            nsCertType |= NS_CERT_TYPE_EMAIL_CA;
  ------------------
  |  |  453|      0|#define NS_CERT_TYPE_EMAIL_CA (0x02)          /* bit 6 */
  ------------------
  533|      0|        }
  534|       |        /*
  535|       |         * allow a cert with the extended key usage of EMail Protect
  536|       |         * to be used for email or as an email CA, if basic constraints
  537|       |         * indicates that it is a CA.
  538|       |         */
  539|     50|        if (findOIDinOIDSeqByTagNum(extKeyUsage,
  ------------------
  |  Branch (539:13): [True: 0, False: 50]
  ------------------
  540|     50|                                    SEC_OID_EXT_KEY_USAGE_EMAIL_PROTECT) ==
  541|     50|            SECSuccess) {
  542|      0|            nsCertType |= isCA ? NS_CERT_TYPE_EMAIL_CA : NS_CERT_TYPE_EMAIL;
  ------------------
  |  |  453|      0|#define NS_CERT_TYPE_EMAIL_CA (0x02)          /* bit 6 */
  ------------------
                          nsCertType |= isCA ? NS_CERT_TYPE_EMAIL_CA : NS_CERT_TYPE_EMAIL;
  ------------------
  |  |  449|      0|#define NS_CERT_TYPE_EMAIL (0x20)             /* bit 2 */
  ------------------
  |  Branch (542:27): [True: 0, False: 0]
  ------------------
  543|      0|        }
  544|     50|        if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (544:13): [True: 0, False: 50]
  ------------------
  545|     50|                extKeyUsage, SEC_OID_EXT_KEY_USAGE_SERVER_AUTH) == SECSuccess) {
  546|      0|            nsCertType |= isCA ? NS_CERT_TYPE_SSL_CA : NS_CERT_TYPE_SSL_SERVER;
  ------------------
  |  |  452|      0|#define NS_CERT_TYPE_SSL_CA (0x04)            /* bit 5 */
  ------------------
                          nsCertType |= isCA ? NS_CERT_TYPE_SSL_CA : NS_CERT_TYPE_SSL_SERVER;
  ------------------
  |  |  448|      0|#define NS_CERT_TYPE_SSL_SERVER (0x40)        /* bit 1 */
  ------------------
  |  Branch (546:27): [True: 0, False: 0]
  ------------------
  547|      0|        }
  548|       |        /*
  549|       |         * Treat certs with step-up OID as also having SSL server type.
  550|       |         * COMODO needs this behaviour until June 2020.  See Bug 737802.
  551|       |         */
  552|     50|        if (findOIDinOIDSeqByTagNum(extKeyUsage,
  ------------------
  |  Branch (552:13): [True: 0, False: 50]
  ------------------
  553|     50|                                    SEC_OID_NS_KEY_USAGE_GOVT_APPROVED) ==
  554|     50|            SECSuccess) {
  555|      0|            nsCertType |= isCA ? NS_CERT_TYPE_SSL_CA : NS_CERT_TYPE_SSL_SERVER;
  ------------------
  |  |  452|      0|#define NS_CERT_TYPE_SSL_CA (0x04)            /* bit 5 */
  ------------------
                          nsCertType |= isCA ? NS_CERT_TYPE_SSL_CA : NS_CERT_TYPE_SSL_SERVER;
  ------------------
  |  |  448|      0|#define NS_CERT_TYPE_SSL_SERVER (0x40)        /* bit 1 */
  ------------------
  |  Branch (555:27): [True: 0, False: 0]
  ------------------
  556|      0|        }
  557|     50|        if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (557:13): [True: 0, False: 50]
  ------------------
  558|     50|                extKeyUsage, SEC_OID_EXT_KEY_USAGE_CLIENT_AUTH) == SECSuccess) {
  559|      0|            nsCertType |= isCA ? NS_CERT_TYPE_SSL_CA : NS_CERT_TYPE_SSL_CLIENT;
  ------------------
  |  |  452|      0|#define NS_CERT_TYPE_SSL_CA (0x04)            /* bit 5 */
  ------------------
                          nsCertType |= isCA ? NS_CERT_TYPE_SSL_CA : NS_CERT_TYPE_SSL_CLIENT;
  ------------------
  |  |  447|      0|#define NS_CERT_TYPE_SSL_CLIENT (0x80)        /* bit 0 */
  ------------------
  |  Branch (559:27): [True: 0, False: 0]
  ------------------
  560|      0|        }
  561|     50|        if (cert_IsIPsecOID(extKeyUsage)) {
  ------------------
  |  Branch (561:13): [True: 0, False: 50]
  ------------------
  562|      0|            nsCertType |= isCA ? NS_CERT_TYPE_IPSEC_CA : NS_CERT_TYPE_IPSEC;
  ------------------
  |  |  445|      0|#define NS_CERT_TYPE_IPSEC_CA (0x200)         /* outside the NS Cert Type Extenstion */
  ------------------
                          nsCertType |= isCA ? NS_CERT_TYPE_IPSEC_CA : NS_CERT_TYPE_IPSEC;
  ------------------
  |  |  446|      0|#define NS_CERT_TYPE_IPSEC (0x100)            /* outside the NS Cert Type Extenstion */
  ------------------
  |  Branch (562:27): [True: 0, False: 0]
  ------------------
  563|      0|        }
  564|     50|        if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (564:13): [True: 0, False: 50]
  ------------------
  565|     50|                extKeyUsage, SEC_OID_EXT_KEY_USAGE_CODE_SIGN) == SECSuccess) {
  566|      0|            nsCertType |= isCA ? NS_CERT_TYPE_OBJECT_SIGNING_CA : NS_CERT_TYPE_OBJECT_SIGNING;
  ------------------
  |  |  454|      0|#define NS_CERT_TYPE_OBJECT_SIGNING_CA (0x01) /* bit 7 */
  ------------------
                          nsCertType |= isCA ? NS_CERT_TYPE_OBJECT_SIGNING_CA : NS_CERT_TYPE_OBJECT_SIGNING;
  ------------------
  |  |  450|      0|#define NS_CERT_TYPE_OBJECT_SIGNING (0x10)    /* bit 3 */
  ------------------
  |  Branch (566:27): [True: 0, False: 0]
  ------------------
  567|      0|        }
  568|     50|        if (findOIDinOIDSeqByTagNum(
  ------------------
  |  Branch (568:13): [True: 0, False: 50]
  ------------------
  569|     50|                extKeyUsage, SEC_OID_EXT_KEY_USAGE_TIME_STAMP) == SECSuccess) {
  570|      0|            nsCertType |= EXT_KEY_USAGE_TIME_STAMP;
  ------------------
  |  |  456|      0|#define EXT_KEY_USAGE_TIME_STAMP (0x8000)
  ------------------
  571|      0|        }
  572|     50|        if (findOIDinOIDSeqByTagNum(extKeyUsage, SEC_OID_OCSP_RESPONDER) ==
  ------------------
  |  Branch (572:13): [True: 0, False: 50]
  ------------------
  573|     50|            SECSuccess) {
  574|      0|            nsCertType |= EXT_KEY_USAGE_STATUS_RESPONDER;
  ------------------
  |  |  457|      0|#define EXT_KEY_USAGE_STATUS_RESPONDER (0x4000)
  ------------------
  575|      0|        }
  576|  5.16k|    } else {
  577|       |        /* If no NS Cert Type extension and no EKU extension, then */
  578|  5.16k|        nsCertType = 0;
  579|  5.16k|        if (CERT_IsCACert(cert, &nsCertType))
  ------------------
  |  Branch (579:13): [True: 304, False: 4.85k]
  ------------------
  580|    304|            nsCertType |= EXT_KEY_USAGE_STATUS_RESPONDER;
  ------------------
  |  |  457|    304|#define EXT_KEY_USAGE_STATUS_RESPONDER (0x4000)
  ------------------
  581|       |        /* if the basic constraint extension says the cert is a CA, then
  582|       |           allow SSL CA and EMAIL CA and Status Responder */
  583|  5.16k|        if (isCA) {
  ------------------
  |  Branch (583:13): [True: 48, False: 5.11k]
  ------------------
  584|     48|            nsCertType |= (NS_CERT_TYPE_SSL_CA | NS_CERT_TYPE_EMAIL_CA |
  ------------------
  |  |  452|     48|#define NS_CERT_TYPE_SSL_CA (0x04)            /* bit 5 */
  ------------------
                          nsCertType |= (NS_CERT_TYPE_SSL_CA | NS_CERT_TYPE_EMAIL_CA |
  ------------------
  |  |  453|     48|#define NS_CERT_TYPE_EMAIL_CA (0x02)          /* bit 6 */
  ------------------
  585|     48|                           EXT_KEY_USAGE_STATUS_RESPONDER);
  ------------------
  |  |  457|     48|#define EXT_KEY_USAGE_STATUS_RESPONDER (0x4000)
  ------------------
  586|     48|        }
  587|       |        /* allow any ssl or email (no ca or object signing. */
  588|  5.16k|        nsCertType |= NS_CERT_TYPE_SSL_CLIENT | NS_CERT_TYPE_SSL_SERVER |
  ------------------
  |  |  447|  5.16k|#define NS_CERT_TYPE_SSL_CLIENT (0x80)        /* bit 0 */
  ------------------
                      nsCertType |= NS_CERT_TYPE_SSL_CLIENT | NS_CERT_TYPE_SSL_SERVER |
  ------------------
  |  |  448|  5.16k|#define NS_CERT_TYPE_SSL_SERVER (0x40)        /* bit 1 */
  ------------------
  589|  5.16k|                      NS_CERT_TYPE_EMAIL;
  ------------------
  |  |  449|  5.16k|#define NS_CERT_TYPE_EMAIL (0x20)             /* bit 2 */
  ------------------
  590|  5.16k|    }
  591|       |
  592|       |    /* IPSEC is allowed to use SSL client and server certs as well as email certs */
  593|  5.21k|    if (nsCertType & (NS_CERT_TYPE_SSL_CLIENT | NS_CERT_TYPE_SSL_SERVER | NS_CERT_TYPE_EMAIL)) {
  ------------------
  |  |  447|  5.21k|#define NS_CERT_TYPE_SSL_CLIENT (0x80)        /* bit 0 */
  ------------------
                  if (nsCertType & (NS_CERT_TYPE_SSL_CLIENT | NS_CERT_TYPE_SSL_SERVER | NS_CERT_TYPE_EMAIL)) {
  ------------------
  |  |  448|  5.21k|#define NS_CERT_TYPE_SSL_SERVER (0x40)        /* bit 1 */
  ------------------
                  if (nsCertType & (NS_CERT_TYPE_SSL_CLIENT | NS_CERT_TYPE_SSL_SERVER | NS_CERT_TYPE_EMAIL)) {
  ------------------
  |  |  449|  5.21k|#define NS_CERT_TYPE_EMAIL (0x20)             /* bit 2 */
  ------------------
  |  Branch (593:9): [True: 5.16k, False: 50]
  ------------------
  594|  5.16k|        nsCertType |= NS_CERT_TYPE_IPSEC;
  ------------------
  |  |  446|  5.16k|#define NS_CERT_TYPE_IPSEC (0x100)            /* outside the NS Cert Type Extenstion */
  ------------------
  595|  5.16k|    }
  596|  5.21k|    if (nsCertType & (NS_CERT_TYPE_SSL_CA | NS_CERT_TYPE_EMAIL_CA)) {
  ------------------
  |  |  452|  5.21k|#define NS_CERT_TYPE_SSL_CA (0x04)            /* bit 5 */
  ------------------
                  if (nsCertType & (NS_CERT_TYPE_SSL_CA | NS_CERT_TYPE_EMAIL_CA)) {
  ------------------
  |  |  453|  5.21k|#define NS_CERT_TYPE_EMAIL_CA (0x02)          /* bit 6 */
  ------------------
  |  Branch (596:9): [True: 304, False: 4.90k]
  ------------------
  597|    304|        nsCertType |= NS_CERT_TYPE_IPSEC_CA;
  ------------------
  |  |  445|    304|#define NS_CERT_TYPE_IPSEC_CA (0x200)         /* outside the NS Cert Type Extenstion */
  ------------------
  598|    304|    }
  599|       |
  600|  5.21k|    if (encodedExtKeyUsage.data != NULL) {
  ------------------
  |  Branch (600:9): [True: 234, False: 4.97k]
  ------------------
  601|    234|        PORT_Free(encodedExtKeyUsage.data);
  ------------------
  |  |   60|    234|#define PORT_Free PORT_Free_Util
  ------------------
  602|    234|    }
  603|  5.21k|    if (extKeyUsage != NULL) {
  ------------------
  |  Branch (603:9): [True: 50, False: 5.16k]
  ------------------
  604|     50|        CERT_DestroyOidSequence(extKeyUsage);
  605|     50|    }
  606|  5.21k|    return nsCertType;
  607|  5.21k|}
cert_GetKeyID:
  614|  5.21k|{
  615|  5.21k|    SECItem tmpitem;
  616|  5.21k|    SECStatus rv;
  617|       |
  618|  5.21k|    cert->subjectKeyID.len = 0;
  619|       |
  620|       |    /* see of the cert has a key identifier extension */
  621|  5.21k|    rv = CERT_FindSubjectKeyIDExtension(cert, &tmpitem);
  622|  5.21k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (622:9): [True: 46, False: 5.16k]
  ------------------
  623|     46|        cert->subjectKeyID.data =
  624|     46|            (unsigned char *)PORT_ArenaAlloc(cert->arena, tmpitem.len);
  ------------------
  |  |   53|     46|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  625|     46|        if (cert->subjectKeyID.data != NULL) {
  ------------------
  |  Branch (625:13): [True: 46, False: 0]
  ------------------
  626|     46|            PORT_Memcpy(cert->subjectKeyID.data, tmpitem.data, tmpitem.len);
  ------------------
  |  |  180|     46|#define PORT_Memcpy memcpy
  ------------------
  627|     46|            cert->subjectKeyID.len = tmpitem.len;
  628|     46|            cert->keyIDGenerated = PR_FALSE;
  ------------------
  |  |  438|     46|#define PR_FALSE 0
  ------------------
  629|     46|        }
  630|       |
  631|     46|        PORT_Free(tmpitem.data);
  ------------------
  |  |   60|     46|#define PORT_Free PORT_Free_Util
  ------------------
  632|     46|    }
  633|       |
  634|       |    /* if the cert doesn't have a key identifier extension, then generate one*/
  635|  5.21k|    if (cert->subjectKeyID.len == 0) {
  ------------------
  |  Branch (635:9): [True: 5.16k, False: 46]
  ------------------
  636|       |        /*
  637|       |         * pkix says that if the subjectKeyID is not present, then we should
  638|       |         * use the SHA-1 hash of the DER-encoded publicKeyInfo from the cert
  639|       |         */
  640|  5.16k|        cert->subjectKeyID.data =
  641|  5.16k|            (unsigned char *)PORT_ArenaAlloc(cert->arena, SHA1_LENGTH);
  ------------------
  |  |   53|  5.16k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
                          (unsigned char *)PORT_ArenaAlloc(cert->arena, SHA1_LENGTH);
  ------------------
  |  |  101|  5.16k|#define SHA1_LENGTH 20       /* Bytes */
  ------------------
  642|  5.16k|        if (cert->subjectKeyID.data != NULL) {
  ------------------
  |  Branch (642:13): [True: 5.16k, False: 0]
  ------------------
  643|  5.16k|            rv = PK11_HashBuf(SEC_OID_SHA1, cert->subjectKeyID.data,
  644|  5.16k|                              cert->derPublicKey.data, cert->derPublicKey.len);
  645|  5.16k|            if (rv == SECSuccess) {
  ------------------
  |  Branch (645:17): [True: 5.16k, False: 0]
  ------------------
  646|  5.16k|                cert->subjectKeyID.len = SHA1_LENGTH;
  ------------------
  |  |  101|  5.16k|#define SHA1_LENGTH 20       /* Bytes */
  ------------------
  647|  5.16k|            }
  648|  5.16k|        }
  649|  5.16k|    }
  650|       |
  651|  5.21k|    if (cert->subjectKeyID.len == 0) {
  ------------------
  |  Branch (651:9): [True: 0, False: 5.21k]
  ------------------
  652|      0|        return (SECFailure);
  653|      0|    }
  654|  5.21k|    return (SECSuccess);
  655|  5.21k|}
CERT_DecodeDERCertificate:
  721|  5.40k|{
  722|  5.40k|    CERTCertificate *cert;
  723|  5.40k|    PLArenaPool *arena;
  724|  5.40k|    void *data;
  725|  5.40k|    int rv;
  726|  5.40k|    int len;
  727|  5.40k|    char *tmpname;
  728|       |
  729|       |    /* make a new arena */
  730|  5.40k|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  5.40k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  5.40k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  731|       |
  732|  5.40k|    if (!arena) {
  ------------------
  |  Branch (732:9): [True: 0, False: 5.40k]
  ------------------
  733|      0|        return 0;
  734|      0|    }
  735|       |
  736|       |    /* allocate the certificate structure */
  737|  5.40k|    cert = (CERTCertificate *)PORT_ArenaZAlloc(arena, sizeof(CERTCertificate));
  ------------------
  |  |   59|  5.40k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  738|       |
  739|  5.40k|    if (!cert) {
  ------------------
  |  Branch (739:9): [True: 0, False: 5.40k]
  ------------------
  740|      0|        goto loser;
  741|      0|    }
  742|       |
  743|  5.40k|    cert->arena = arena;
  744|       |
  745|  5.40k|    if (copyDER) {
  ------------------
  |  Branch (745:9): [True: 5.40k, False: 0]
  ------------------
  746|       |        /* copy the DER data for the cert into this arena */
  747|  5.40k|        data = (void *)PORT_ArenaAlloc(arena, derSignedCert->len);
  ------------------
  |  |   53|  5.40k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  748|  5.40k|        if (!data) {
  ------------------
  |  Branch (748:13): [True: 0, False: 5.40k]
  ------------------
  749|      0|            goto loser;
  750|      0|        }
  751|  5.40k|        cert->derCert.data = (unsigned char *)data;
  752|  5.40k|        cert->derCert.len = derSignedCert->len;
  753|  5.40k|        PORT_Memcpy(data, derSignedCert->data, derSignedCert->len);
  ------------------
  |  |  180|  5.40k|#define PORT_Memcpy memcpy
  ------------------
  754|  5.40k|    } else {
  755|       |        /* point to passed in DER data */
  756|      0|        cert->derCert = *derSignedCert;
  757|      0|    }
  758|       |
  759|       |    /* decode the certificate info */
  760|  5.40k|    rv = SEC_QuickDERDecodeItem(arena, cert, SEC_SignedCertificateTemplate,
  ------------------
  |  |  102|  5.40k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  761|  5.40k|                                &cert->derCert);
  762|       |
  763|  5.40k|    if (rv) {
  ------------------
  |  Branch (763:9): [True: 193, False: 5.21k]
  ------------------
  764|    193|        goto loser;
  765|    193|    }
  766|       |
  767|  5.21k|    if (cert_HasUnknownCriticalExten(cert->extensions) == PR_TRUE) {
  ------------------
  |  |  437|  5.21k|#define PR_TRUE 1
  ------------------
  |  Branch (767:9): [True: 6, False: 5.20k]
  ------------------
  768|      6|        cert->options.bits.hasUnsupportedCriticalExt = PR_TRUE;
  ------------------
  |  |  437|      6|#define PR_TRUE 1
  ------------------
  769|      6|    }
  770|       |
  771|       |    /* generate and save the database key for the cert */
  772|  5.21k|    rv = CERT_KeyFromIssuerAndSN(arena, &cert->derIssuer, &cert->serialNumber,
  773|  5.21k|                                 &cert->certKey);
  774|  5.21k|    if (rv) {
  ------------------
  |  Branch (774:9): [True: 0, False: 5.21k]
  ------------------
  775|      0|        goto loser;
  776|      0|    }
  777|       |
  778|       |    /* set the nickname */
  779|  5.21k|    if (nickname == NULL) {
  ------------------
  |  Branch (779:9): [True: 5.21k, False: 0]
  ------------------
  780|  5.21k|        cert->nickname = NULL;
  781|  5.21k|    } else {
  782|       |        /* copy and install the nickname */
  783|      0|        len = PORT_Strlen(nickname) + 1;
  ------------------
  |  |  190|      0|#define PORT_Strlen(s) strlen(s)
  ------------------
  784|      0|        cert->nickname = (char *)PORT_ArenaAlloc(arena, len);
  ------------------
  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  785|      0|        if (cert->nickname == NULL) {
  ------------------
  |  Branch (785:13): [True: 0, False: 0]
  ------------------
  786|      0|            goto loser;
  787|      0|        }
  788|       |
  789|      0|        PORT_Memcpy(cert->nickname, nickname, len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  790|      0|    }
  791|       |
  792|       |    /* set the email address */
  793|  5.21k|    cert->emailAddr = cert_GetCertificateEmailAddresses(cert);
  794|       |
  795|       |    /* initialize the subjectKeyID */
  796|  5.21k|    rv = cert_GetKeyID(cert);
  797|  5.21k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (797:9): [True: 0, False: 5.21k]
  ------------------
  798|      0|        goto loser;
  799|      0|    }
  800|       |
  801|       |    /* initialize keyUsage */
  802|  5.21k|    rv = GetKeyUsage(cert);
  803|  5.21k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (803:9): [True: 0, False: 5.21k]
  ------------------
  804|      0|        goto loser;
  805|      0|    }
  806|       |
  807|       |    /* determine if this is a root cert */
  808|  5.21k|    cert->isRoot = cert_IsRootCert(cert);
  809|       |
  810|       |    /* initialize the certType */
  811|  5.21k|    rv = cert_GetCertType(cert);
  812|  5.21k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (812:9): [True: 0, False: 5.21k]
  ------------------
  813|      0|        goto loser;
  814|      0|    }
  815|       |
  816|  5.21k|    tmpname = CERT_NameToAscii(&cert->subject);
  817|  5.21k|    if (tmpname != NULL) {
  ------------------
  |  Branch (817:9): [True: 5.18k, False: 31]
  ------------------
  818|  5.18k|        cert->subjectName = PORT_ArenaStrdup(cert->arena, tmpname);
  ------------------
  |  |   57|  5.18k|#define PORT_ArenaStrdup PORT_ArenaStrdup_Util
  ------------------
  819|  5.18k|        PORT_Free(tmpname);
  ------------------
  |  |   60|  5.18k|#define PORT_Free PORT_Free_Util
  ------------------
  820|  5.18k|    }
  821|       |
  822|  5.21k|    tmpname = CERT_NameToAscii(&cert->issuer);
  823|  5.21k|    if (tmpname != NULL) {
  ------------------
  |  Branch (823:9): [True: 5.18k, False: 30]
  ------------------
  824|  5.18k|        cert->issuerName = PORT_ArenaStrdup(cert->arena, tmpname);
  ------------------
  |  |   57|  5.18k|#define PORT_ArenaStrdup PORT_ArenaStrdup_Util
  ------------------
  825|  5.18k|        PORT_Free(tmpname);
  ------------------
  |  |   60|  5.18k|#define PORT_Free PORT_Free_Util
  ------------------
  826|  5.18k|    }
  827|       |
  828|  5.21k|    cert->referenceCount = 1;
  829|  5.21k|    cert->slot = NULL;
  830|  5.21k|    cert->pkcs11ID = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  5.21k|#define CK_INVALID_HANDLE 0
  ------------------
  831|  5.21k|    cert->dbnickname = NULL;
  832|       |
  833|  5.21k|    return (cert);
  834|       |
  835|    193|loser:
  836|       |
  837|    193|    if (arena) {
  ------------------
  |  Branch (837:9): [True: 193, False: 0]
  ------------------
  838|    193|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|    193|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|    193|#define PR_FALSE 0
  ------------------
  839|    193|    }
  840|       |
  841|    193|    return (0);
  842|  5.21k|}
CERT_DupCertificate:
 1269|  4.75k|{
 1270|  4.75k|    if (c) {
  ------------------
  |  Branch (1270:9): [True: 4.66k, False: 89]
  ------------------
 1271|  4.66k|        NSSCertificate *tmp = STAN_GetNSSCertificate(c);
 1272|  4.66k|        nssCertificate_AddRef(tmp);
 1273|  4.66k|    }
 1274|  4.75k|    return c;
 1275|  4.75k|}
CERT_SetDefaultCertDB:
 1296|      1|{
 1297|      1|    default_cert_db_handle = handle;
 1298|       |
 1299|      1|    return;
 1300|      1|}
CERT_GetDefaultCertDB:
 1304|  8.85k|{
 1305|  8.85k|    return (default_cert_db_handle);
 1306|  8.85k|}
CERT_IsCACert:
 2113|  5.16k|{
 2114|  5.16k|    unsigned int cType = cert->nsCertType;
 2115|  5.16k|    PRBool ret = PR_FALSE;
  ------------------
  |  |  438|  5.16k|#define PR_FALSE 0
  ------------------
 2116|       |
 2117|       |    /*
 2118|       |     * Check if the constraints are available and it's a CA, OR if it's
 2119|       |     * a X.509 v1 Root CA.
 2120|       |     */
 2121|  5.16k|    CERTBasicConstraints constraints;
 2122|  5.16k|    if ((CERT_FindBasicConstraintExten(cert, &constraints) == SECSuccess &&
  ------------------
  |  Branch (2122:10): [True: 2.10k, False: 3.05k]
  ------------------
 2123|  5.16k|         constraints.isCA) ||
  ------------------
  |  Branch (2123:10): [True: 48, False: 2.06k]
  ------------------
 2124|  5.16k|        (cert->isRoot && cert_Version(cert) < SEC_CERTIFICATE_VERSION_3))
  ------------------
  |  |  300|    814|#define SEC_CERTIFICATE_VERSION_3 2 /* v3 extensions */
  ------------------
  |  Branch (2124:10): [True: 814, False: 4.30k]
  |  Branch (2124:26): [True: 256, False: 558]
  ------------------
 2125|    304|        cType |= (NS_CERT_TYPE_SSL_CA | NS_CERT_TYPE_EMAIL_CA);
  ------------------
  |  |  452|    304|#define NS_CERT_TYPE_SSL_CA (0x04)            /* bit 5 */
  ------------------
                      cType |= (NS_CERT_TYPE_SSL_CA | NS_CERT_TYPE_EMAIL_CA);
  ------------------
  |  |  453|    304|#define NS_CERT_TYPE_EMAIL_CA (0x02)          /* bit 6 */
  ------------------
 2126|       |
 2127|       |    /*
 2128|       |     * Apply trust overrides, if any.
 2129|       |     */
 2130|  5.16k|    cType = cert_ComputeTrustOverrides(cert, cType);
 2131|  5.16k|    ret = (cType & (NS_CERT_TYPE_SSL_CA | NS_CERT_TYPE_EMAIL_CA |
  ------------------
  |  |  452|  5.16k|#define NS_CERT_TYPE_SSL_CA (0x04)            /* bit 5 */
  ------------------
                  ret = (cType & (NS_CERT_TYPE_SSL_CA | NS_CERT_TYPE_EMAIL_CA |
  ------------------
  |  |  453|  5.16k|#define NS_CERT_TYPE_EMAIL_CA (0x02)          /* bit 6 */
  ------------------
  |  Branch (2131:11): [True: 304, False: 4.85k]
  ------------------
 2132|  5.16k|                    NS_CERT_TYPE_OBJECT_SIGNING_CA))
  ------------------
  |  |  454|  5.16k|#define NS_CERT_TYPE_OBJECT_SIGNING_CA (0x01) /* bit 7 */
  ------------------
 2133|  5.16k|              ? PR_TRUE
  ------------------
  |  |  437|    304|#define PR_TRUE 1
  ------------------
 2134|  5.16k|              : PR_FALSE;
  ------------------
  |  |  438|  10.0k|#define PR_FALSE 0
  ------------------
 2135|       |
 2136|  5.16k|    if (rettype) {
  ------------------
  |  Branch (2136:9): [True: 5.16k, False: 0]
  ------------------
 2137|  5.16k|        *rettype = cType;
 2138|  5.16k|    }
 2139|       |
 2140|  5.16k|    return ret;
 2141|  5.16k|}
CERT_LockCertTrust:
 2991|  10.3k|{
 2992|  10.3k|    PORT_Assert(certTrustLock != NULL);
  ------------------
  |  |  120|  10.3k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2993|  10.3k|    PZ_Lock(certTrustLock);
  ------------------
  |  |  245|  10.3k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 2994|  10.3k|}
CERT_LockCertTempPerm:
 3003|  25.5k|{
 3004|  25.5k|    PORT_Assert(certTempPermCertLock != NULL);
  ------------------
  |  |  120|  25.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  25.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 25.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3005|  25.5k|    PZ_Lock(certTempPermCertLock);
  ------------------
  |  |  245|  25.5k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 3006|  25.5k|}
CERT_MaybeLockCertTempPerm:
 3013|  9.88k|{
 3014|  9.88k|    if (certTempPermCertLock) {
  ------------------
  |  Branch (3014:9): [True: 9.88k, False: 0]
  ------------------
 3015|  9.88k|        PZ_Lock(certTempPermCertLock);
  ------------------
  |  |  245|  9.88k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 3016|  9.88k|    }
 3017|  9.88k|}
cert_InitLocks:
 3021|      1|{
 3022|      1|    if (certRefCountLock == NULL) {
  ------------------
  |  Branch (3022:9): [True: 1, False: 0]
  ------------------
 3023|      1|        certRefCountLock = PZ_NewLock(nssILockRefLock);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 3024|      1|        PORT_Assert(certRefCountLock != NULL);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3025|      1|        if (!certRefCountLock) {
  ------------------
  |  Branch (3025:13): [True: 0, False: 1]
  ------------------
 3026|      0|            return SECFailure;
 3027|      0|        }
 3028|      1|    }
 3029|       |
 3030|      1|    if (certTrustLock == NULL) {
  ------------------
  |  Branch (3030:9): [True: 1, False: 0]
  ------------------
 3031|      1|        certTrustLock = PZ_NewLock(nssILockCertDB);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 3032|      1|        PORT_Assert(certTrustLock != NULL);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3033|      1|        if (!certTrustLock) {
  ------------------
  |  Branch (3033:13): [True: 0, False: 1]
  ------------------
 3034|      0|            PZ_DestroyLock(certRefCountLock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 3035|      0|            certRefCountLock = NULL;
 3036|      0|            return SECFailure;
 3037|      0|        }
 3038|      1|    }
 3039|       |
 3040|      1|    if (certTempPermCertLock == NULL) {
  ------------------
  |  Branch (3040:9): [True: 1, False: 0]
  ------------------
 3041|      1|        certTempPermCertLock = PZ_NewLock(nssILockCertDB);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 3042|      1|        PORT_Assert(certTempPermCertLock != NULL);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3043|      1|        if (!certTempPermCertLock) {
  ------------------
  |  Branch (3043:13): [True: 0, False: 1]
  ------------------
 3044|      0|            PZ_DestroyLock(certTrustLock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 3045|      0|            PZ_DestroyLock(certRefCountLock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 3046|      0|            certRefCountLock = NULL;
 3047|      0|            certTrustLock = NULL;
 3048|      0|            return SECFailure;
 3049|      0|        }
 3050|      1|    }
 3051|       |
 3052|      1|    return SECSuccess;
 3053|      1|}
cert_DestroyLocks:
 3057|      1|{
 3058|      1|    SECStatus rv = SECSuccess;
 3059|       |
 3060|      1|    PORT_Assert(certRefCountLock != NULL);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3061|      1|    if (certRefCountLock) {
  ------------------
  |  Branch (3061:9): [True: 1, False: 0]
  ------------------
 3062|      1|        PZ_DestroyLock(certRefCountLock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 3063|      1|        certRefCountLock = NULL;
 3064|      1|    } else {
 3065|      0|        rv = SECFailure;
 3066|      0|    }
 3067|       |
 3068|      1|    PORT_Assert(certTrustLock != NULL);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3069|      1|    if (certTrustLock) {
  ------------------
  |  Branch (3069:9): [True: 1, False: 0]
  ------------------
 3070|      1|        PZ_DestroyLock(certTrustLock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 3071|      1|        certTrustLock = NULL;
 3072|      1|    } else {
 3073|      0|        rv = SECFailure;
 3074|      0|    }
 3075|       |
 3076|      1|    PORT_Assert(certTempPermCertLock != NULL);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3077|      1|    if (certTempPermCertLock) {
  ------------------
  |  Branch (3077:9): [True: 1, False: 0]
  ------------------
 3078|      1|        PZ_DestroyLock(certTempPermCertLock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 3079|      1|        certTempPermCertLock = NULL;
 3080|      1|    } else {
 3081|      0|        rv = SECFailure;
 3082|      0|    }
 3083|      1|    return rv;
 3084|      1|}
CERT_UnlockCertTrust:
 3091|  10.3k|{
 3092|  10.3k|    PORT_Assert(certTrustLock != NULL);
  ------------------
  |  |  120|  10.3k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3093|  10.3k|    PRStatus prstat = PZ_Unlock(certTrustLock);
  ------------------
  |  |  246|  10.3k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 3094|  10.3k|    PORT_AssertArg(prstat == PR_SUCCESS);
  ------------------
  |  |  124|  10.3k|#define PORT_AssertArg PR_ASSERT_ARG
  |  |  ------------------
  |  |  |  |  210|  10.3k|#define PR_ASSERT_ARG(_expr) PR_ASSERT(_expr)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  10.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 10.3k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3095|  10.3k|}
CERT_UnlockCertTempPerm:
 3102|  25.5k|{
 3103|  25.5k|    PORT_Assert(certTempPermCertLock != NULL);
  ------------------
  |  |  120|  25.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  25.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 25.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3104|  25.5k|    PRStatus prstat = PZ_Unlock(certTempPermCertLock);
  ------------------
  |  |  246|  25.5k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 3105|  25.5k|    PORT_AssertArg(prstat == PR_SUCCESS);
  ------------------
  |  |  124|  25.5k|#define PORT_AssertArg PR_ASSERT_ARG
  |  |  ------------------
  |  |  |  |  210|  25.5k|#define PR_ASSERT_ARG(_expr) PR_ASSERT(_expr)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  25.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 25.5k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3106|  25.5k|}
CERT_MaybeUnlockCertTempPerm:
 3110|  9.88k|{
 3111|  9.88k|    if (certTempPermCertLock) {
  ------------------
  |  Branch (3111:9): [True: 9.88k, False: 0]
  ------------------
 3112|  9.88k|        PZ_Unlock(certTempPermCertLock);
  ------------------
  |  |  246|  9.88k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 3113|  9.88k|    }
 3114|  9.88k|}
cert_CreateSubjectKeyIDSlotCheckHash:
 3178|      1|{
 3179|       |    /*
 3180|       |     * This hash is used to remember the series of a slot
 3181|       |     * when we last checked for user certs
 3182|       |     */
 3183|      1|    gSubjKeyIDSlotCheckHash =
 3184|      1|        PL_NewHashTable(0, SECITEM_Hash, SECITEM_HashCompare,
 3185|      1|                        SECITEM_HashCompare, &cert_AllocOps, NULL);
 3186|      1|    if (!gSubjKeyIDSlotCheckHash) {
  ------------------
  |  Branch (3186:9): [True: 0, False: 1]
  ------------------
 3187|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3188|      0|        return SECFailure;
 3189|      0|    }
 3190|      1|    gSubjKeyIDSlotCheckLock = PR_NewLock();
 3191|      1|    if (!gSubjKeyIDSlotCheckLock) {
  ------------------
  |  Branch (3191:9): [True: 0, False: 1]
  ------------------
 3192|      0|        PL_HashTableDestroy(gSubjKeyIDSlotCheckHash);
 3193|      0|        gSubjKeyIDSlotCheckHash = NULL;
 3194|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3195|      0|        return SECFailure;
 3196|      0|    }
 3197|      1|    return SECSuccess;
 3198|      1|}
cert_CreateSubjectKeyIDHashTable:
 3202|      1|{
 3203|      1|    gSubjKeyIDHash = PL_NewHashTable(0, SECITEM_Hash, SECITEM_HashCompare,
 3204|      1|                                     SECITEM_HashCompare, &cert_AllocOps, NULL);
 3205|      1|    if (!gSubjKeyIDHash) {
  ------------------
  |  Branch (3205:9): [True: 0, False: 1]
  ------------------
 3206|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3207|      0|        return SECFailure;
 3208|      0|    }
 3209|      1|    gSubjKeyIDLock = PR_NewLock();
 3210|      1|    if (!gSubjKeyIDLock) {
  ------------------
  |  Branch (3210:9): [True: 0, False: 1]
  ------------------
 3211|      0|        PL_HashTableDestroy(gSubjKeyIDHash);
 3212|      0|        gSubjKeyIDHash = NULL;
 3213|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3214|      0|        return SECFailure;
 3215|      0|    }
 3216|       |    /* initialize the companion hash (for remembering slot series) */
 3217|      1|    if (cert_CreateSubjectKeyIDSlotCheckHash() != SECSuccess) {
  ------------------
  |  Branch (3217:9): [True: 0, False: 1]
  ------------------
 3218|      0|        cert_DestroySubjectKeyIDHashTable();
 3219|      0|        return SECFailure;
 3220|      0|    }
 3221|      1|    return SECSuccess;
 3222|      1|}
cert_DestroySubjectKeyIDSlotCheckHash:
 3355|      1|{
 3356|      1|    if (gSubjKeyIDSlotCheckHash) {
  ------------------
  |  Branch (3356:9): [True: 1, False: 0]
  ------------------
 3357|      1|        PR_Lock(gSubjKeyIDSlotCheckLock);
 3358|      1|        PL_HashTableDestroy(gSubjKeyIDSlotCheckHash);
 3359|      1|        gSubjKeyIDSlotCheckHash = NULL;
 3360|      1|        PR_Unlock(gSubjKeyIDSlotCheckLock);
 3361|      1|        PR_DestroyLock(gSubjKeyIDSlotCheckLock);
 3362|      1|        gSubjKeyIDSlotCheckLock = NULL;
 3363|      1|    }
 3364|      1|    return SECSuccess;
 3365|      1|}
cert_DestroySubjectKeyIDHashTable:
 3369|      1|{
 3370|      1|    if (gSubjKeyIDHash) {
  ------------------
  |  Branch (3370:9): [True: 1, False: 0]
  ------------------
 3371|      1|        PR_Lock(gSubjKeyIDLock);
 3372|      1|        PL_HashTableDestroy(gSubjKeyIDHash);
 3373|      1|        gSubjKeyIDHash = NULL;
 3374|      1|        PR_Unlock(gSubjKeyIDLock);
 3375|      1|        PR_DestroyLock(gSubjKeyIDLock);
 3376|      1|        gSubjKeyIDLock = NULL;
 3377|      1|    }
 3378|      1|    cert_DestroySubjectKeyIDSlotCheckHash();
 3379|      1|    return SECSuccess;
 3380|      1|}
certdb.c:findOIDinOIDSeqByTagNum:
  410|    700|{
  411|    700|    SECItem **oids;
  412|    700|    SECItem *oid;
  413|    700|    SECStatus rv = SECFailure;
  414|       |
  415|    700|    if (seq != NULL) {
  ------------------
  |  Branch (415:9): [True: 700, False: 0]
  ------------------
  416|    700|        oids = seq->oids;
  417|    784|        while (oids != NULL && *oids != NULL) {
  ------------------
  |  Branch (417:16): [True: 784, False: 0]
  |  Branch (417:32): [True: 84, False: 700]
  ------------------
  418|     84|            oid = *oids;
  419|     84|            if (SECOID_FindOIDTag(oid) == tagnum) {
  ------------------
  |  |  117|     84|#define SECOID_FindOIDTag SECOID_FindOIDTag_Util
  ------------------
  |  Branch (419:17): [True: 0, False: 84]
  ------------------
  420|      0|                rv = SECSuccess;
  421|      0|                break;
  422|      0|            }
  423|     84|            oids++;
  424|     84|        }
  425|    700|    }
  426|    700|    return rv;
  427|    700|}
certdb.c:GetKeyUsage:
  380|  5.21k|{
  381|  5.21k|    SECStatus rv;
  382|  5.21k|    SECItem tmpitem;
  383|       |
  384|  5.21k|    rv = CERT_FindKeyUsageExtension(cert, &tmpitem);
  385|  5.21k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (385:9): [True: 2.05k, False: 3.16k]
  ------------------
  386|       |        /* remember the actual value of the extension */
  387|  2.05k|        cert->rawKeyUsage = tmpitem.len ? tmpitem.data[0] : 0;
  ------------------
  |  Branch (387:29): [True: 2.05k, False: 0]
  ------------------
  388|  2.05k|        cert->keyUsagePresent = PR_TRUE;
  ------------------
  |  |  437|  2.05k|#define PR_TRUE 1
  ------------------
  389|  2.05k|        cert->keyUsage = cert->rawKeyUsage;
  390|       |
  391|  2.05k|        PORT_Free(tmpitem.data);
  ------------------
  |  |   60|  2.05k|#define PORT_Free PORT_Free_Util
  ------------------
  392|  2.05k|        tmpitem.data = NULL;
  393|  3.16k|    } else {
  394|       |        /* if the extension is not present, then we allow all uses */
  395|  3.16k|        cert->keyUsage = KU_ALL;
  ------------------
  |  |  571|  3.16k|    (KU_DIGITAL_SIGNATURE | KU_NON_REPUDIATION | KU_KEY_ENCIPHERMENT | \
  |  |  ------------------
  |  |  |  |  562|  3.16k|#define KU_DIGITAL_SIGNATURE (0x80) /* bit 0 */
  |  |  ------------------
  |  |                   (KU_DIGITAL_SIGNATURE | KU_NON_REPUDIATION | KU_KEY_ENCIPHERMENT | \
  |  |  ------------------
  |  |  |  |  563|  3.16k|#define KU_NON_REPUDIATION (0x40)   /* bit 1 */
  |  |  ------------------
  |  |                   (KU_DIGITAL_SIGNATURE | KU_NON_REPUDIATION | KU_KEY_ENCIPHERMENT | \
  |  |  ------------------
  |  |  |  |  564|  3.16k|#define KU_KEY_ENCIPHERMENT (0x20)  /* bit 2 */
  |  |  ------------------
  |  |  572|  3.16k|     KU_DATA_ENCIPHERMENT | KU_KEY_AGREEMENT | KU_KEY_CERT_SIGN |      \
  |  |  ------------------
  |  |  |  |  565|  3.16k|#define KU_DATA_ENCIPHERMENT (0x10) /* bit 3 */
  |  |  ------------------
  |  |                    KU_DATA_ENCIPHERMENT | KU_KEY_AGREEMENT | KU_KEY_CERT_SIGN |      \
  |  |  ------------------
  |  |  |  |  566|  3.16k|#define KU_KEY_AGREEMENT (0x08)     /* bit 4 */
  |  |  ------------------
  |  |                    KU_DATA_ENCIPHERMENT | KU_KEY_AGREEMENT | KU_KEY_CERT_SIGN |      \
  |  |  ------------------
  |  |  |  |  567|  3.16k|#define KU_KEY_CERT_SIGN (0x04)     /* bit 5 */
  |  |  ------------------
  |  |  573|  3.16k|     KU_CRL_SIGN | KU_ENCIPHER_ONLY)
  |  |  ------------------
  |  |  |  |  568|  3.16k|#define KU_CRL_SIGN (0x02)          /* bit 6 */
  |  |  ------------------
  |  |                    KU_CRL_SIGN | KU_ENCIPHER_ONLY)
  |  |  ------------------
  |  |  |  |  569|  3.16k|#define KU_ENCIPHER_ONLY (0x01)     /* bit 7 */
  |  |  ------------------
  ------------------
  396|  3.16k|        cert->rawKeyUsage = KU_ALL;
  ------------------
  |  |  571|  3.16k|    (KU_DIGITAL_SIGNATURE | KU_NON_REPUDIATION | KU_KEY_ENCIPHERMENT | \
  |  |  ------------------
  |  |  |  |  562|  3.16k|#define KU_DIGITAL_SIGNATURE (0x80) /* bit 0 */
  |  |  ------------------
  |  |                   (KU_DIGITAL_SIGNATURE | KU_NON_REPUDIATION | KU_KEY_ENCIPHERMENT | \
  |  |  ------------------
  |  |  |  |  563|  3.16k|#define KU_NON_REPUDIATION (0x40)   /* bit 1 */
  |  |  ------------------
  |  |                   (KU_DIGITAL_SIGNATURE | KU_NON_REPUDIATION | KU_KEY_ENCIPHERMENT | \
  |  |  ------------------
  |  |  |  |  564|  3.16k|#define KU_KEY_ENCIPHERMENT (0x20)  /* bit 2 */
  |  |  ------------------
  |  |  572|  3.16k|     KU_DATA_ENCIPHERMENT | KU_KEY_AGREEMENT | KU_KEY_CERT_SIGN |      \
  |  |  ------------------
  |  |  |  |  565|  3.16k|#define KU_DATA_ENCIPHERMENT (0x10) /* bit 3 */
  |  |  ------------------
  |  |                    KU_DATA_ENCIPHERMENT | KU_KEY_AGREEMENT | KU_KEY_CERT_SIGN |      \
  |  |  ------------------
  |  |  |  |  566|  3.16k|#define KU_KEY_AGREEMENT (0x08)     /* bit 4 */
  |  |  ------------------
  |  |                    KU_DATA_ENCIPHERMENT | KU_KEY_AGREEMENT | KU_KEY_CERT_SIGN |      \
  |  |  ------------------
  |  |  |  |  567|  3.16k|#define KU_KEY_CERT_SIGN (0x04)     /* bit 5 */
  |  |  ------------------
  |  |  573|  3.16k|     KU_CRL_SIGN | KU_ENCIPHER_ONLY)
  |  |  ------------------
  |  |  |  |  568|  3.16k|#define KU_CRL_SIGN (0x02)          /* bit 6 */
  |  |  ------------------
  |  |                    KU_CRL_SIGN | KU_ENCIPHER_ONLY)
  |  |  ------------------
  |  |  |  |  569|  3.16k|#define KU_ENCIPHER_ONLY (0x01)     /* bit 7 */
  |  |  ------------------
  ------------------
  397|  3.16k|        cert->keyUsagePresent = PR_FALSE;
  ------------------
  |  |  438|  3.16k|#define PR_FALSE 0
  ------------------
  398|  3.16k|    }
  399|       |
  400|  5.21k|    if (CERT_GovtApprovedBitSet(cert)) {
  ------------------
  |  Branch (400:9): [True: 0, False: 5.21k]
  ------------------
  401|      0|        cert->keyUsage |= KU_NS_GOVT_APPROVED;
  ------------------
  |  |  589|      0|#define KU_NS_GOVT_APPROVED (0x8000) /*don't make part of KU_ALL!*/
  ------------------
  402|      0|        cert->rawKeyUsage |= KU_NS_GOVT_APPROVED;
  ------------------
  |  |  589|      0|#define KU_NS_GOVT_APPROVED (0x8000) /*don't make part of KU_ALL!*/
  ------------------
  403|      0|    }
  404|       |
  405|  5.21k|    return (SECSuccess);
  406|  5.21k|}
certdb.c:cert_IsRootCert:
  659|  5.21k|{
  660|  5.21k|    SECStatus rv;
  661|  5.21k|    SECItem tmpitem;
  662|       |
  663|       |    /* cache the authKeyID extension, if present */
  664|  5.21k|    cert->authKeyID = CERT_FindAuthKeyIDExten(cert->arena, cert);
  665|       |
  666|       |    /* it MUST be self-issued to be a root */
  667|  5.21k|    if (cert->derIssuer.len == 0 ||
  ------------------
  |  Branch (667:9): [True: 0, False: 5.21k]
  ------------------
  668|  5.21k|        !SECITEM_ItemsAreEqual(&cert->derIssuer, &cert->derSubject)) {
  ------------------
  |  |  109|  5.21k|#define SECITEM_ItemsAreEqual SECITEM_ItemsAreEqual_Util
  ------------------
  |  Branch (668:9): [True: 4.38k, False: 829]
  ------------------
  669|  4.38k|        return PR_FALSE;
  ------------------
  |  |  438|  4.38k|#define PR_FALSE 0
  ------------------
  670|  4.38k|    }
  671|       |
  672|       |    /* check the authKeyID extension */
  673|    829|    if (cert->authKeyID) {
  ------------------
  |  Branch (673:9): [True: 24, False: 805]
  ------------------
  674|       |        /* authority key identifier is present */
  675|     24|        if (cert->authKeyID->keyID.len > 0) {
  ------------------
  |  Branch (675:13): [True: 11, False: 13]
  ------------------
  676|       |            /* the keyIdentifier field is set, look for subjectKeyID */
  677|     11|            rv = CERT_FindSubjectKeyIDExtension(cert, &tmpitem);
  678|     11|            if (rv == SECSuccess) {
  ------------------
  |  Branch (678:17): [True: 8, False: 3]
  ------------------
  679|      8|                PRBool match;
  680|       |                /* also present, they MUST match for it to be a root */
  681|      8|                match =
  682|      8|                    SECITEM_ItemsAreEqual(&cert->authKeyID->keyID, &tmpitem);
  ------------------
  |  |  109|      8|#define SECITEM_ItemsAreEqual SECITEM_ItemsAreEqual_Util
  ------------------
  683|      8|                PORT_Free(tmpitem.data);
  ------------------
  |  |   60|      8|#define PORT_Free PORT_Free_Util
  ------------------
  684|      8|                if (!match)
  ------------------
  |  Branch (684:21): [True: 7, False: 1]
  ------------------
  685|      7|                    return PR_FALSE; /* else fall through */
  ------------------
  |  |  438|      7|#define PR_FALSE 0
  ------------------
  686|      8|            } else {
  687|       |                /* the subject key ID is required when AKI is present */
  688|      3|                return PR_FALSE;
  ------------------
  |  |  438|      3|#define PR_FALSE 0
  ------------------
  689|      3|            }
  690|     11|        }
  691|     14|        if (cert->authKeyID->authCertIssuer) {
  ------------------
  |  Branch (691:13): [True: 0, False: 14]
  ------------------
  692|      0|            SECItem *caName;
  693|      0|            caName = (SECItem *)CERT_GetGeneralNameByType(
  694|      0|                cert->authKeyID->authCertIssuer, certDirectoryName, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  695|      0|            if (caName) {
  ------------------
  |  Branch (695:17): [True: 0, False: 0]
  ------------------
  696|      0|                if (!SECITEM_ItemsAreEqual(&cert->derIssuer, caName)) {
  ------------------
  |  |  109|      0|#define SECITEM_ItemsAreEqual SECITEM_ItemsAreEqual_Util
  ------------------
  |  Branch (696:21): [True: 0, False: 0]
  ------------------
  697|      0|                    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  698|      0|                } /* else fall through */
  699|      0|            }     /* else ??? could not get general name as directory name? */
  700|      0|        }
  701|     14|        if (cert->authKeyID->authCertSerialNumber.len > 0) {
  ------------------
  |  Branch (701:13): [True: 1, False: 13]
  ------------------
  702|      1|            if (!SECITEM_ItemsAreEqual(
  ------------------
  |  |  109|      1|#define SECITEM_ItemsAreEqual SECITEM_ItemsAreEqual_Util
  ------------------
  |  Branch (702:17): [True: 1, False: 0]
  ------------------
  703|      1|                    &cert->serialNumber,
  704|      1|                    &cert->authKeyID->authCertSerialNumber)) {
  705|      1|                return PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  706|      1|            } /* else fall through */
  707|      1|        }
  708|       |        /* all of the AKI fields that were present passed the test */
  709|     13|        return PR_TRUE;
  ------------------
  |  |  437|     13|#define PR_TRUE 1
  ------------------
  710|     14|    }
  711|       |    /* else the AKI was not present, so this is a root */
  712|    805|    return PR_TRUE;
  ------------------
  |  |  437|    805|#define PR_TRUE 1
  ------------------
  713|    829|}
certdb.c:cert_Version:
 2055|    814|{
 2056|    814|    int version = 0;
 2057|    814|    if (cert && cert->version.data && cert->version.len) {
  ------------------
  |  Branch (2057:9): [True: 814, False: 0]
  |  Branch (2057:17): [True: 813, False: 1]
  |  Branch (2057:39): [True: 813, False: 0]
  ------------------
 2058|    813|        version = DER_GetInteger(&cert->version);
  ------------------
  |  |   27|    813|#define DER_GetInteger DER_GetInteger_Util
  ------------------
 2059|    813|        if (version < 0)
  ------------------
  |  Branch (2059:13): [True: 251, False: 562]
  ------------------
 2060|    251|            version = 0;
 2061|    813|    }
 2062|    814|    return version;
 2063|    814|}
certdb.c:cert_ComputeTrustOverrides:
 2067|  5.16k|{
 2068|  5.16k|    CERTCertTrust trust;
 2069|  5.16k|    SECStatus rv = SECFailure;
 2070|       |
 2071|  5.16k|    rv = CERT_GetCertTrust(cert, &trust);
 2072|       |
 2073|  5.16k|    if (rv == SECSuccess &&
  ------------------
  |  Branch (2073:9): [True: 0, False: 5.16k]
  ------------------
 2074|  5.16k|        (trust.sslFlags | trust.emailFlags | trust.objectSigningFlags)) {
  ------------------
  |  Branch (2074:9): [True: 0, False: 0]
  ------------------
 2075|       |
 2076|      0|        if (trust.sslFlags & (CERTDB_TERMINAL_RECORD | CERTDB_TRUSTED))
  ------------------
  |  |    9|      0|#define CERTDB_TERMINAL_RECORD (1u << 0)
  ------------------
                      if (trust.sslFlags & (CERTDB_TERMINAL_RECORD | CERTDB_TRUSTED))
  ------------------
  |  |   10|      0|#define CERTDB_TRUSTED (1u << 1)
  ------------------
  |  Branch (2076:13): [True: 0, False: 0]
  ------------------
 2077|      0|            cType |= NS_CERT_TYPE_SSL_SERVER | NS_CERT_TYPE_SSL_CLIENT;
  ------------------
  |  |  448|      0|#define NS_CERT_TYPE_SSL_SERVER (0x40)        /* bit 1 */
  ------------------
                          cType |= NS_CERT_TYPE_SSL_SERVER | NS_CERT_TYPE_SSL_CLIENT;
  ------------------
  |  |  447|      0|#define NS_CERT_TYPE_SSL_CLIENT (0x80)        /* bit 0 */
  ------------------
 2078|      0|        if (trust.sslFlags & (CERTDB_VALID_CA | CERTDB_TRUSTED_CA))
  ------------------
  |  |   12|      0|#define CERTDB_VALID_CA (1u << 3)
  ------------------
                      if (trust.sslFlags & (CERTDB_VALID_CA | CERTDB_TRUSTED_CA))
  ------------------
  |  |   13|      0|#define CERTDB_TRUSTED_CA (1u << 4) /* trusted for issuing server certs */
  ------------------
  |  Branch (2078:13): [True: 0, False: 0]
  ------------------
 2079|      0|            cType |= NS_CERT_TYPE_SSL_CA;
  ------------------
  |  |  452|      0|#define NS_CERT_TYPE_SSL_CA (0x04)            /* bit 5 */
  ------------------
 2080|       |#if defined(CERTDB_NOT_TRUSTED)
 2081|       |        if (trust.sslFlags & CERTDB_NOT_TRUSTED)
 2082|       |            cType &= ~(NS_CERT_TYPE_SSL_SERVER | NS_CERT_TYPE_SSL_CLIENT |
 2083|       |                       NS_CERT_TYPE_SSL_CA);
 2084|       |#endif
 2085|      0|        if (trust.emailFlags & (CERTDB_TERMINAL_RECORD | CERTDB_TRUSTED))
  ------------------
  |  |    9|      0|#define CERTDB_TERMINAL_RECORD (1u << 0)
  ------------------
                      if (trust.emailFlags & (CERTDB_TERMINAL_RECORD | CERTDB_TRUSTED))
  ------------------
  |  |   10|      0|#define CERTDB_TRUSTED (1u << 1)
  ------------------
  |  Branch (2085:13): [True: 0, False: 0]
  ------------------
 2086|      0|            cType |= NS_CERT_TYPE_EMAIL;
  ------------------
  |  |  449|      0|#define NS_CERT_TYPE_EMAIL (0x20)             /* bit 2 */
  ------------------
 2087|      0|        if (trust.emailFlags & (CERTDB_VALID_CA | CERTDB_TRUSTED_CA))
  ------------------
  |  |   12|      0|#define CERTDB_VALID_CA (1u << 3)
  ------------------
                      if (trust.emailFlags & (CERTDB_VALID_CA | CERTDB_TRUSTED_CA))
  ------------------
  |  |   13|      0|#define CERTDB_TRUSTED_CA (1u << 4) /* trusted for issuing server certs */
  ------------------
  |  Branch (2087:13): [True: 0, False: 0]
  ------------------
 2088|      0|            cType |= NS_CERT_TYPE_EMAIL_CA;
  ------------------
  |  |  453|      0|#define NS_CERT_TYPE_EMAIL_CA (0x02)          /* bit 6 */
  ------------------
 2089|       |#if defined(CERTDB_NOT_TRUSTED)
 2090|       |        if (trust.emailFlags & CERTDB_NOT_TRUSTED)
 2091|       |            cType &= ~(NS_CERT_TYPE_EMAIL | NS_CERT_TYPE_EMAIL_CA);
 2092|       |#endif
 2093|      0|        if (trust.objectSigningFlags &
  ------------------
  |  Branch (2093:13): [True: 0, False: 0]
  ------------------
 2094|      0|            (CERTDB_TERMINAL_RECORD | CERTDB_TRUSTED))
  ------------------
  |  |    9|      0|#define CERTDB_TERMINAL_RECORD (1u << 0)
  ------------------
                          (CERTDB_TERMINAL_RECORD | CERTDB_TRUSTED))
  ------------------
  |  |   10|      0|#define CERTDB_TRUSTED (1u << 1)
  ------------------
 2095|      0|            cType |= NS_CERT_TYPE_OBJECT_SIGNING;
  ------------------
  |  |  450|      0|#define NS_CERT_TYPE_OBJECT_SIGNING (0x10)    /* bit 3 */
  ------------------
 2096|      0|        if (trust.objectSigningFlags & (CERTDB_VALID_CA | CERTDB_TRUSTED_CA))
  ------------------
  |  |   12|      0|#define CERTDB_VALID_CA (1u << 3)
  ------------------
                      if (trust.objectSigningFlags & (CERTDB_VALID_CA | CERTDB_TRUSTED_CA))
  ------------------
  |  |   13|      0|#define CERTDB_TRUSTED_CA (1u << 4) /* trusted for issuing server certs */
  ------------------
  |  Branch (2096:13): [True: 0, False: 0]
  ------------------
 2097|      0|            cType |= NS_CERT_TYPE_OBJECT_SIGNING_CA;
  ------------------
  |  |  454|      0|#define NS_CERT_TYPE_OBJECT_SIGNING_CA (0x01) /* bit 7 */
  ------------------
 2098|       |#if defined(CERTDB_NOT_TRUSTED)
 2099|       |        if (trust.objectSigningFlags & CERTDB_NOT_TRUSTED)
 2100|       |            cType &=
 2101|       |                ~(NS_CERT_TYPE_OBJECT_SIGNING | NS_CERT_TYPE_OBJECT_SIGNING_CA);
 2102|       |#endif
 2103|      0|    }
 2104|  5.16k|    return cType;
 2105|  5.16k|}
certdb.c:cert_AllocTable:
 3147|      4|{
 3148|      4|    return PORT_Alloc(size);
  ------------------
  |  |   52|      4|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 3149|      4|}
certdb.c:cert_FreeTable:
 3153|      4|{
 3154|      4|    PORT_Free(item);
  ------------------
  |  |   60|      4|#define PORT_Free PORT_Free_Util
  ------------------
 3155|      4|}

CERT_FindCertExtension:
   25|  15.6k|{
   26|  15.6k|    return (cert_FindExtension(cert->extensions, tag, value));
   27|  15.6k|}
CERT_FindNSCertTypeExtension:
   49|  5.21k|{
   50|       |
   51|  5.21k|    return (CERT_FindBitStringExtension(
   52|  5.21k|        cert->extensions, SEC_OID_NS_CERT_EXT_CERT_TYPE, retItem));
   53|  5.21k|}
CERT_FindKeyUsageExtension:
  112|  5.21k|{
  113|       |
  114|  5.21k|    return (CERT_FindBitStringExtension(cert->extensions,
  115|  5.21k|                                        SEC_OID_X509_KEY_USAGE, retItem));
  116|  5.21k|}
CERT_FindSubjectKeyIDExtension:
  123|  5.22k|{
  124|       |
  125|  5.22k|    SECStatus rv;
  126|  5.22k|    SECItem encodedValue = { siBuffer, NULL, 0 };
  127|  5.22k|    SECItem decodedValue = { siBuffer, NULL, 0 };
  128|       |
  129|  5.22k|    rv = cert_FindExtension(cert->extensions, SEC_OID_X509_SUBJECT_KEY_ID,
  130|  5.22k|                            &encodedValue);
  131|  5.22k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (131:9): [True: 151, False: 5.07k]
  ------------------
  132|    151|        PORTCheapArenaPool tmpArena;
  133|    151|        PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|    151|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  134|    151|        rv = SEC_QuickDERDecodeItem(&tmpArena.arena, &decodedValue,
  ------------------
  |  |  102|    151|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  135|    151|                                    SEC_ASN1_GET(SEC_OctetStringTemplate),
  ------------------
  |  |  188|    151|#define SEC_ASN1_GET(x) x
  ------------------
  136|    151|                                    &encodedValue);
  137|    151|        if (rv == SECSuccess) {
  ------------------
  |  Branch (137:13): [True: 54, False: 97]
  ------------------
  138|     54|            rv = SECITEM_CopyItem(NULL, retItem, &decodedValue);
  ------------------
  |  |  106|     54|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  139|     54|        }
  140|    151|        PORT_DestroyCheapArena(&tmpArena);
  141|    151|    }
  142|  5.22k|    SECITEM_FreeItem(&encodedValue, PR_FALSE);
  ------------------
  |  |  108|  5.22k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&encodedValue, PR_FALSE);
  ------------------
  |  |  438|  5.22k|#define PR_FALSE 0
  ------------------
  143|  5.22k|    return rv;
  144|  5.22k|}
CERT_FindBasicConstraintExten:
  149|  10.3k|{
  150|  10.3k|    SECItem encodedExtenValue;
  151|  10.3k|    SECStatus rv;
  152|       |
  153|  10.3k|    encodedExtenValue.data = NULL;
  154|  10.3k|    encodedExtenValue.len = 0;
  155|       |
  156|  10.3k|    rv = cert_FindExtension(cert->extensions, SEC_OID_X509_BASIC_CONSTRAINTS,
  157|  10.3k|                            &encodedExtenValue);
  158|  10.3k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (158:9): [True: 4.63k, False: 5.74k]
  ------------------
  159|  4.63k|        return (rv);
  160|  4.63k|    }
  161|       |
  162|  5.74k|    rv = CERT_DecodeBasicConstraintValue(value, &encodedExtenValue);
  163|       |
  164|       |    /* free the raw extension data */
  165|  5.74k|    PORT_Free(encodedExtenValue.data);
  ------------------
  |  |   60|  5.74k|#define PORT_Free PORT_Free_Util
  ------------------
  166|  5.74k|    encodedExtenValue.data = NULL;
  167|       |
  168|  5.74k|    return (rv);
  169|  10.3k|}
CERT_FindAuthKeyIDExten:
  173|  5.21k|{
  174|  5.21k|    SECItem encodedExtenValue;
  175|  5.21k|    SECStatus rv;
  176|  5.21k|    CERTAuthKeyID *ret;
  177|       |
  178|  5.21k|    encodedExtenValue.data = NULL;
  179|  5.21k|    encodedExtenValue.len = 0;
  180|       |
  181|  5.21k|    rv = cert_FindExtension(cert->extensions, SEC_OID_X509_AUTH_KEY_ID,
  182|  5.21k|                            &encodedExtenValue);
  183|  5.21k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (183:9): [True: 5.08k, False: 126]
  ------------------
  184|  5.08k|        return (NULL);
  185|  5.08k|    }
  186|       |
  187|    126|    ret = CERT_DecodeAuthKeyID(arena, &encodedExtenValue);
  188|       |
  189|    126|    PORT_Free(encodedExtenValue.data);
  ------------------
  |  |   60|    126|#define PORT_Free PORT_Free_Util
  ------------------
  190|    126|    encodedExtenValue.data = NULL;
  191|       |
  192|    126|    return (ret);
  193|  5.21k|}

cert_FindExtensionByOID:
   49|  46.8k|{
   50|  46.8k|    CERTCertExtension *ext;
   51|  46.8k|    SECStatus rv = SECSuccess;
   52|       |
   53|  46.8k|    ext = GetExtension(extensions, oid);
   54|  46.8k|    if (ext == NULL) {
  ------------------
  |  Branch (54:9): [True: 36.2k, False: 10.6k]
  ------------------
   55|  36.2k|        PORT_SetError(SEC_ERROR_EXTENSION_NOT_FOUND);
  ------------------
  |  |   65|  36.2k|#define PORT_SetError PORT_SetError_Util
  ------------------
   56|  36.2k|        return (SECFailure);
   57|  36.2k|    }
   58|  10.6k|    if (value)
  ------------------
  |  Branch (58:9): [True: 10.6k, False: 0]
  ------------------
   59|  10.6k|        rv = SECITEM_CopyItem(NULL, value, &ext->value);
  ------------------
  |  |  106|  10.6k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
   60|  10.6k|    return (rv);
   61|  46.8k|}
cert_FindExtension:
   95|  46.8k|{
   96|  46.8k|    SECOidData *oid;
   97|       |
   98|  46.8k|    oid = SECOID_FindOIDByTag((SECOidTag)tag);
  ------------------
  |  |  116|  46.8k|#define SECOID_FindOIDByTag SECOID_FindOIDByTag_Util
  ------------------
   99|  46.8k|    if (!oid) {
  ------------------
  |  Branch (99:9): [True: 0, False: 46.8k]
  ------------------
  100|      0|        return (SECFailure);
  101|      0|    }
  102|       |
  103|  46.8k|    return (cert_FindExtensionByOID(extensions, &oid->oid, value));
  104|  46.8k|}
CERT_FindBitStringExtension:
  397|  10.4k|{
  398|  10.4k|    SECItem wrapperItem, tmpItem = { siBuffer, 0 };
  399|  10.4k|    SECStatus rv;
  400|  10.4k|    PORTCheapArenaPool tmpArena;
  401|       |
  402|  10.4k|    wrapperItem.data = NULL;
  403|  10.4k|    tmpItem.data = NULL;
  404|       |
  405|  10.4k|    PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  10.4k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  406|       |
  407|  10.4k|    rv = cert_FindExtension(extensions, tag, &wrapperItem);
  408|  10.4k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (408:9): [True: 6.43k, False: 3.98k]
  ------------------
  409|  6.43k|        goto loser;
  410|  6.43k|    }
  411|       |
  412|  3.98k|    rv = SEC_QuickDERDecodeItem(&tmpArena.arena, &tmpItem,
  ------------------
  |  |  102|  3.98k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  413|  3.98k|                                SEC_ASN1_GET(SEC_BitStringTemplate),
  ------------------
  |  |  188|  3.98k|#define SEC_ASN1_GET(x) x
  ------------------
  414|  3.98k|                                &wrapperItem);
  415|       |
  416|  3.98k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (416:9): [True: 1.93k, False: 2.05k]
  ------------------
  417|  1.93k|        goto loser;
  418|  1.93k|    }
  419|       |
  420|  2.05k|    retItem->data = (unsigned char *)PORT_ZAlloc((tmpItem.len + 7) >> 3);
  ------------------
  |  |   72|  2.05k|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  421|  2.05k|    if (retItem->data == NULL) {
  ------------------
  |  Branch (421:9): [True: 0, False: 2.05k]
  ------------------
  422|      0|        goto loser;
  423|      0|    }
  424|       |
  425|  2.05k|    if (tmpItem.len > 0) {
  ------------------
  |  Branch (425:9): [True: 2.05k, False: 0]
  ------------------
  426|  2.05k|        PORT_Memcpy(retItem->data, tmpItem.data, (tmpItem.len + 7) >> 3);
  ------------------
  |  |  180|  2.05k|#define PORT_Memcpy memcpy
  ------------------
  427|  2.05k|    }
  428|       |
  429|  2.05k|    retItem->len = tmpItem.len;
  430|       |
  431|  2.05k|    rv = SECSuccess;
  432|  2.05k|    goto done;
  433|       |
  434|  8.37k|loser:
  435|  8.37k|    rv = SECFailure;
  436|       |
  437|  10.4k|done:
  438|  10.4k|    PORT_DestroyCheapArena(&tmpArena);
  439|       |
  440|  10.4k|    if (wrapperItem.data) {
  ------------------
  |  Branch (440:9): [True: 3.98k, False: 6.43k]
  ------------------
  441|  3.98k|        PORT_Free(wrapperItem.data);
  ------------------
  |  |   60|  3.98k|#define PORT_Free PORT_Free_Util
  ------------------
  442|  3.98k|    }
  443|       |
  444|  10.4k|    return (rv);
  445|  8.37k|}
cert_HasUnknownCriticalExten:
  472|  5.21k|{
  473|  5.21k|    CERTCertExtension **exts;
  474|  5.21k|    CERTCertExtension *ext = NULL;
  475|  5.21k|    PRBool hasUnknownCriticalExten = PR_FALSE;
  ------------------
  |  |  438|  5.21k|#define PR_FALSE 0
  ------------------
  476|       |
  477|  5.21k|    exts = extensions;
  478|       |
  479|  5.21k|    if (exts) {
  ------------------
  |  Branch (479:9): [True: 5.21k, False: 1]
  ------------------
  480|  15.3k|        while (*exts) {
  ------------------
  |  Branch (480:16): [True: 10.1k, False: 5.20k]
  ------------------
  481|  10.1k|            ext = *exts;
  482|       |            /* If the criticality is omitted, it's non-critical.
  483|       |               If an extension is critical, make sure that we know
  484|       |               how to process the extension.
  485|       |             */
  486|  10.1k|            if (ext->critical.data && ext->critical.data[0] == 0xff) {
  ------------------
  |  Branch (486:17): [True: 68, False: 10.0k]
  |  Branch (486:39): [True: 53, False: 15]
  ------------------
  487|     53|                if (SECOID_KnownCertExtenOID(&ext->id) == PR_FALSE) {
  ------------------
  |  |  438|     53|#define PR_FALSE 0
  ------------------
  |  Branch (487:21): [True: 6, False: 47]
  ------------------
  488|      6|                    hasUnknownCriticalExten = PR_TRUE;
  ------------------
  |  |  437|      6|#define PR_TRUE 1
  ------------------
  489|      6|                    break;
  490|      6|                }
  491|     53|            }
  492|  10.1k|            exts++;
  493|  10.1k|        }
  494|  5.21k|    }
  495|  5.21k|    return (hasUnknownCriticalExten);
  496|  5.21k|}
certxutl.c:GetExtension:
   25|  46.8k|{
   26|  46.8k|    CERTCertExtension **exts;
   27|  46.8k|    CERTCertExtension *ext = NULL;
   28|  46.8k|    SECComparison comp;
   29|       |
   30|  46.8k|    exts = extensions;
   31|       |
   32|  46.8k|    if (exts) {
  ------------------
  |  Branch (32:9): [True: 46.8k, False: 9]
  ------------------
   33|   121k|        while (*exts) {
  ------------------
  |  Branch (33:16): [True: 85.0k, False: 36.2k]
  ------------------
   34|  85.0k|            ext = *exts;
   35|  85.0k|            comp = SECITEM_CompareItem(oid, &ext->id);
  ------------------
  |  |  105|  85.0k|#define SECITEM_CompareItem SECITEM_CompareItem_Util
  ------------------
   36|  85.0k|            if (comp == SECEqual)
  ------------------
  |  Branch (36:17): [True: 10.6k, False: 74.3k]
  ------------------
   37|  10.6k|                break;
   38|       |
   39|  74.3k|            exts++;
   40|  74.3k|        }
   41|  46.8k|        return (*exts ? ext : NULL);
  ------------------
  |  Branch (41:17): [True: 10.6k, False: 36.2k]
  ------------------
   42|  46.8k|    }
   43|      9|    return (NULL);
   44|  46.8k|}

InitCRLCache:
  962|      1|{
  963|      1|    if (PR_FALSE == crlcache_initialized) {
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  |  Branch (963:9): [True: 1, False: 0]
  ------------------
  964|      1|        PORT_Assert(NULL == crlcache.lock);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  965|      1|        PORT_Assert(NULL == crlcache.issuers);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  966|      1|        PORT_Assert(NULL == namedCRLCache.lock);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  967|      1|        PORT_Assert(NULL == namedCRLCache.entries);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  968|      1|        if (crlcache.lock || crlcache.issuers || namedCRLCache.lock ||
  ------------------
  |  Branch (968:13): [True: 0, False: 1]
  |  Branch (968:30): [True: 0, False: 1]
  |  Branch (968:50): [True: 0, False: 1]
  ------------------
  969|      1|            namedCRLCache.entries) {
  ------------------
  |  Branch (969:13): [True: 0, False: 1]
  ------------------
  970|       |            /* CRL cache already partially initialized */
  971|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  972|      0|            return SECFailure;
  973|      0|        }
  974|       |#ifdef GLOBAL_RWLOCK
  975|       |        crlcache.lock = NSSRWLock_New(NSS_RWLOCK_RANK_NONE, NULL);
  976|       |#else
  977|      1|        crlcache.lock = PR_NewLock();
  978|      1|#endif
  979|      1|        namedCRLCache.lock = PR_NewLock();
  980|      1|        crlcache.issuers = PL_NewHashTable(0, SECITEM_Hash, SECITEM_HashCompare,
  981|      1|                                           PL_CompareValues, NULL, NULL);
  982|      1|        namedCRLCache.entries = PL_NewHashTable(
  983|      1|            0, SECITEM_Hash, SECITEM_HashCompare, PL_CompareValues, NULL, NULL);
  984|      1|        if (!crlcache.lock || !namedCRLCache.lock || !crlcache.issuers ||
  ------------------
  |  Branch (984:13): [True: 0, False: 1]
  |  Branch (984:31): [True: 0, False: 1]
  |  Branch (984:54): [True: 0, False: 1]
  ------------------
  985|      1|            !namedCRLCache.entries) {
  ------------------
  |  Branch (985:13): [True: 0, False: 1]
  ------------------
  986|      0|            if (crlcache.lock) {
  ------------------
  |  Branch (986:17): [True: 0, False: 0]
  ------------------
  987|       |#ifdef GLOBAL_RWLOCK
  988|       |                NSSRWLock_Destroy(crlcache.lock);
  989|       |#else
  990|      0|                PR_DestroyLock(crlcache.lock);
  991|      0|#endif
  992|      0|                crlcache.lock = NULL;
  993|      0|            }
  994|      0|            if (namedCRLCache.lock) {
  ------------------
  |  Branch (994:17): [True: 0, False: 0]
  ------------------
  995|      0|                PR_DestroyLock(namedCRLCache.lock);
  996|      0|                namedCRLCache.lock = NULL;
  997|      0|            }
  998|      0|            if (crlcache.issuers) {
  ------------------
  |  Branch (998:17): [True: 0, False: 0]
  ------------------
  999|      0|                PL_HashTableDestroy(crlcache.issuers);
 1000|      0|                crlcache.issuers = NULL;
 1001|      0|            }
 1002|      0|            if (namedCRLCache.entries) {
  ------------------
  |  Branch (1002:17): [True: 0, False: 0]
  ------------------
 1003|      0|                PL_HashTableDestroy(namedCRLCache.entries);
 1004|      0|                namedCRLCache.entries = NULL;
 1005|      0|            }
 1006|       |
 1007|      0|            return SECFailure;
 1008|      0|        }
 1009|      1|        crlcache_initialized = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 1010|      1|        return SECSuccess;
 1011|      1|    } else {
 1012|      0|        PORT_Assert(crlcache.lock);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1013|      0|        PORT_Assert(crlcache.issuers);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1014|      0|        if ((NULL == crlcache.lock) || (NULL == crlcache.issuers)) {
  ------------------
  |  Branch (1014:13): [True: 0, False: 0]
  |  Branch (1014:40): [True: 0, False: 0]
  ------------------
 1015|       |            /* CRL cache not fully initialized */
 1016|      0|            return SECFailure;
 1017|      0|        } else {
 1018|       |            /* CRL cache already initialized */
 1019|      0|            return SECSuccess;
 1020|      0|        }
 1021|      0|    }
 1022|      1|}
ShutdownCRLCache:
 1202|      1|{
 1203|      1|    SECStatus rv = SECSuccess;
 1204|      1|    if (PR_FALSE == crlcache_initialized && !crlcache.lock &&
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  |  Branch (1204:9): [True: 0, False: 1]
  |  Branch (1204:45): [True: 0, False: 0]
  ------------------
 1205|      1|        !crlcache.issuers) {
  ------------------
  |  Branch (1205:9): [True: 0, False: 0]
  ------------------
 1206|       |        /* CRL cache has already been shut down */
 1207|      0|        return SECSuccess;
 1208|      0|    }
 1209|      1|    if (PR_TRUE == crlcache_initialized &&
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  |  Branch (1209:9): [True: 1, False: 0]
  ------------------
 1210|      1|        (!crlcache.lock || !crlcache.issuers || !namedCRLCache.lock ||
  ------------------
  |  Branch (1210:10): [True: 0, False: 1]
  |  Branch (1210:28): [True: 0, False: 1]
  |  Branch (1210:49): [True: 0, False: 1]
  ------------------
 1211|      1|         !namedCRLCache.entries)) {
  ------------------
  |  Branch (1211:10): [True: 0, False: 1]
  ------------------
 1212|       |        /* CRL cache has partially been shut down */
 1213|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1214|      0|        return SECFailure;
 1215|      0|    }
 1216|       |    /* empty the CRL cache */
 1217|       |    /* free the issuers */
 1218|      1|    PL_HashTableEnumerateEntries(crlcache.issuers, &FreeIssuer, &rv);
 1219|       |    /* free the hash table of issuers */
 1220|      1|    PL_HashTableDestroy(crlcache.issuers);
 1221|      1|    crlcache.issuers = NULL;
 1222|       |/* free the global lock */
 1223|       |#ifdef GLOBAL_RWLOCK
 1224|       |    NSSRWLock_Destroy(crlcache.lock);
 1225|       |#else
 1226|      1|    PR_DestroyLock(crlcache.lock);
 1227|      1|#endif
 1228|      1|    crlcache.lock = NULL;
 1229|       |
 1230|       |    /* empty the named CRL cache. This must be done after freeing the CRL
 1231|       |     * cache, since some CRLs in this cache are in the memory for the other  */
 1232|       |    /* free the entries */
 1233|      1|    PL_HashTableEnumerateEntries(namedCRLCache.entries, &FreeNamedEntries, &rv);
 1234|       |    /* free the hash table of issuers */
 1235|      1|    PL_HashTableDestroy(namedCRLCache.entries);
 1236|      1|    namedCRLCache.entries = NULL;
 1237|       |    /* free the global lock */
 1238|      1|    PR_DestroyLock(namedCRLCache.lock);
 1239|      1|    namedCRLCache.lock = NULL;
 1240|       |
 1241|      1|    crlcache_initialized = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 1242|      1|    return rv;
 1243|      1|}

CERT_NewGeneralName:
  153|     76|{
  154|     76|    CERTGeneralName *name = arena ? PORT_ArenaZNew(arena, CERTGeneralName)
  ------------------
  |  |  155|     76|    (type *)PORT_ArenaZAlloc(poolp, sizeof(type))
  |  |  ------------------
  |  |  |  |   59|     76|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  |  |  ------------------
  ------------------
  |  Branch (154:29): [True: 76, False: 0]
  ------------------
  155|     76|                                  : PORT_ZNew(CERTGeneralName);
  ------------------
  |  |  148|      0|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  156|     76|    if (name) {
  ------------------
  |  Branch (156:9): [True: 76, False: 0]
  ------------------
  157|     76|        name->type = type;
  158|     76|        name->l.prev = name->l.next = &name->l;
  159|     76|    }
  160|     76|    return name;
  161|     76|}
CERT_GetNextGeneralName:
  264|     84|{
  265|     84|    PRCList *next;
  266|       |
  267|     84|    next = current->l.next;
  268|     84|    return (CERTGeneralName *)(((char *)next) - offsetof(CERTGeneralName, l));
  269|     84|}
CERT_DecodeGeneralName:
  418|     76|{
  419|     76|    const SEC_ASN1Template *template;
  420|     76|    CERTGeneralNameType genNameType;
  421|     76|    SECStatus rv = SECSuccess;
  422|     76|    SECItem *newEncodedName;
  423|       |
  424|     76|    if (!reqArena) {
  ------------------
  |  Branch (424:9): [True: 0, False: 76]
  ------------------
  425|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  426|      0|        return NULL;
  427|      0|    }
  428|       |    /* make a copy for decoding so the data decoded with QuickDER doesn't
  429|       |       point to temporary memory */
  430|     76|    newEncodedName = SECITEM_ArenaDupItem(reqArena, encodedName);
  ------------------
  |  |  104|     76|#define SECITEM_ArenaDupItem SECITEM_ArenaDupItem_Util
  ------------------
  431|     76|    if (!newEncodedName) {
  ------------------
  |  Branch (431:9): [True: 0, False: 76]
  ------------------
  432|      0|        return NULL;
  433|      0|    }
  434|       |    /* TODO: mark arena */
  435|     76|    genNameType = (CERTGeneralNameType)((*(newEncodedName->data) & 0x0f) + 1);
  436|     76|    if (genName == NULL) {
  ------------------
  |  Branch (436:9): [True: 76, False: 0]
  ------------------
  437|     76|        genName = CERT_NewGeneralName(reqArena, genNameType);
  438|     76|        if (!genName)
  ------------------
  |  Branch (438:13): [True: 0, False: 76]
  ------------------
  439|      0|            goto loser;
  440|     76|    } else {
  441|      0|        genName->type = genNameType;
  442|      0|        genName->l.prev = genName->l.next = &genName->l;
  443|      0|    }
  444|       |
  445|     76|    switch (genNameType) {
  446|      8|        case certURI:
  ------------------
  |  Branch (446:9): [True: 8, False: 68]
  ------------------
  447|      8|            template = CERT_URITemplate;
  448|      8|            break;
  449|     45|        case certRFC822Name:
  ------------------
  |  Branch (449:9): [True: 45, False: 31]
  ------------------
  450|     45|            template = CERT_RFC822NameTemplate;
  451|     45|            break;
  452|      7|        case certDNSName:
  ------------------
  |  Branch (452:9): [True: 7, False: 69]
  ------------------
  453|      7|            template = CERT_DNSNameTemplate;
  454|      7|            break;
  455|      2|        case certIPAddress:
  ------------------
  |  Branch (455:9): [True: 2, False: 74]
  ------------------
  456|      2|            template = CERT_IPAddressTemplate;
  457|      2|            break;
  458|      2|        case certOtherName:
  ------------------
  |  Branch (458:9): [True: 2, False: 74]
  ------------------
  459|      2|            template = CERTOtherNameTemplate;
  460|      2|            break;
  461|      0|        case certRegisterID:
  ------------------
  |  Branch (461:9): [True: 0, False: 76]
  ------------------
  462|      0|            template = CERT_RegisteredIDTemplate;
  463|      0|            break;
  464|      2|        case certEDIPartyName:
  ------------------
  |  Branch (464:9): [True: 2, False: 74]
  ------------------
  465|      2|            template = CERT_EDIPartyNameTemplate;
  466|      2|            break;
  467|      3|        case certX400Address:
  ------------------
  |  Branch (467:9): [True: 3, False: 73]
  ------------------
  468|      3|            template = CERT_X400AddressTemplate;
  469|      3|            break;
  470|      5|        case certDirectoryName:
  ------------------
  |  Branch (470:9): [True: 5, False: 71]
  ------------------
  471|      5|            template = CERT_DirectoryNameTemplate;
  472|      5|            break;
  473|      2|        default:
  ------------------
  |  Branch (473:9): [True: 2, False: 74]
  ------------------
  474|      2|            goto loser;
  475|     76|    }
  476|     74|    rv = SEC_QuickDERDecodeItem(reqArena, genName, template, newEncodedName);
  ------------------
  |  |  102|     74|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  477|     74|    if (rv != SECSuccess)
  ------------------
  |  Branch (477:9): [True: 10, False: 64]
  ------------------
  478|     10|        goto loser;
  479|     64|    if (genNameType == certDirectoryName) {
  ------------------
  |  Branch (479:9): [True: 5, False: 59]
  ------------------
  480|      5|        rv = SEC_QuickDERDecodeItem(reqArena, &(genName->name.directoryName),
  ------------------
  |  |  102|      5|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  481|      5|                                    CERT_NameTemplate,
  482|      5|                                    &(genName->derDirectoryName));
  483|      5|        if (rv != SECSuccess)
  ------------------
  |  Branch (483:13): [True: 1, False: 4]
  ------------------
  484|      1|            goto loser;
  485|      5|    }
  486|       |
  487|       |    /* TODO: unmark arena */
  488|     63|    return genName;
  489|     13|loser:
  490|       |    /* TODO: release arena to mark */
  491|     13|    return NULL;
  492|     64|}
cert_DecodeGeneralNames:
  496|    114|{
  497|    114|    PRCList *head = NULL;
  498|    114|    PRCList *tail = NULL;
  499|    114|    CERTGeneralName *currentName = NULL;
  500|       |
  501|    114|    PORT_Assert(arena);
  ------------------
  |  |  120|    114|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    114|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 114, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  502|    114|    if (!encodedGenName || !arena) {
  ------------------
  |  Branch (502:9): [True: 74, False: 40]
  |  Branch (502:28): [True: 0, False: 40]
  ------------------
  503|     74|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|     74|#define PORT_SetError PORT_SetError_Util
  ------------------
  504|     74|        return NULL;
  505|     74|    }
  506|       |    /* TODO: mark arena */
  507|    103|    while (*encodedGenName != NULL) {
  ------------------
  |  Branch (507:12): [True: 76, False: 27]
  ------------------
  508|     76|        currentName = CERT_DecodeGeneralName(arena, *encodedGenName, NULL);
  509|     76|        if (currentName == NULL)
  ------------------
  |  Branch (509:13): [True: 13, False: 63]
  ------------------
  510|     13|            break;
  511|     63|        if (head == NULL) {
  ------------------
  |  Branch (511:13): [True: 30, False: 33]
  ------------------
  512|     30|            head = &(currentName->l);
  513|     30|            tail = head;
  514|     30|        }
  515|     63|        currentName->l.next = head;
  516|     63|        currentName->l.prev = tail;
  517|     63|        tail = head->prev = tail->next = &(currentName->l);
  518|     63|        encodedGenName++;
  519|     63|    }
  520|     40|    if (currentName) {
  ------------------
  |  Branch (520:9): [True: 27, False: 13]
  ------------------
  521|       |        /* TODO: unmark arena */
  522|     27|        return CERT_GetNextGeneralName(currentName);
  523|     27|    }
  524|       |    /* TODO: release arena to mark */
  525|     13|    return NULL;
  526|     40|}

CERT_DecodeOidSequence:
  590|    474|{
  591|    474|    PLArenaPool *arena = NULL;
  592|    474|    SECStatus rv;
  593|    474|    CERTOidSequence *oidSeq;
  594|    474|    SECItem newSeqItem;
  595|       |
  596|       |    /* make a new arena */
  597|    474|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|    474|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|    474|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  598|       |
  599|    474|    if (!arena) {
  ------------------
  |  Branch (599:9): [True: 0, False: 474]
  ------------------
  600|      0|        goto loser;
  601|      0|    }
  602|       |
  603|       |    /* allocate the userNotice structure */
  604|    474|    oidSeq =
  605|    474|        (CERTOidSequence *)PORT_ArenaZAlloc(arena, sizeof(CERTOidSequence));
  ------------------
  |  |   59|    474|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  606|       |
  607|    474|    if (oidSeq == NULL) {
  ------------------
  |  Branch (607:9): [True: 0, False: 474]
  ------------------
  608|      0|        goto loser;
  609|      0|    }
  610|       |
  611|    474|    oidSeq->arena = arena;
  612|       |
  613|       |    /* copy the DER into the arena, since Quick DER returns data that points
  614|       |       into the DER input, which may get freed by the caller */
  615|    474|    rv = SECITEM_CopyItem(arena, &newSeqItem, seqItem);
  ------------------
  |  |  106|    474|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  616|    474|    if (rv != SECSuccess) {
  ------------------
  |  Branch (616:9): [True: 0, False: 474]
  ------------------
  617|      0|        goto loser;
  618|      0|    }
  619|       |
  620|       |    /* decode the user notice */
  621|    474|    rv =
  622|    474|        SEC_QuickDERDecodeItem(arena, oidSeq, CERT_OidSeqTemplate, &newSeqItem);
  ------------------
  |  |  102|    474|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  623|       |
  624|    474|    if (rv != SECSuccess) {
  ------------------
  |  Branch (624:9): [True: 374, False: 100]
  ------------------
  625|    374|        goto loser;
  626|    374|    }
  627|       |
  628|    100|    return (oidSeq);
  629|       |
  630|    374|loser:
  631|    374|    if (arena) {
  ------------------
  |  Branch (631:9): [True: 374, False: 0]
  ------------------
  632|    374|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|    374|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|    374|#define PR_FALSE 0
  ------------------
  633|    374|    }
  634|    374|    return (NULL);
  635|    474|}
CERT_DestroyOidSequence:
  639|    100|{
  640|    100|    if (oidSeq != NULL) {
  ------------------
  |  Branch (640:9): [True: 100, False: 0]
  ------------------
  641|    100|        PORT_FreeArena(oidSeq->arena, PR_FALSE);
  ------------------
  |  |   61|    100|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(oidSeq->arena, PR_FALSE);
  ------------------
  |  |  438|    100|#define PR_FALSE 0
  ------------------
  642|    100|    }
  643|    100|    return;
  644|    100|}
CERT_GovtApprovedBitSet:
  648|  5.21k|{
  649|  5.21k|    SECStatus rv;
  650|  5.21k|    SECItem extItem;
  651|  5.21k|    CERTOidSequence *oidSeq = NULL;
  652|  5.21k|    PRBool ret;
  653|  5.21k|    SECItem **oids;
  654|  5.21k|    SECItem *oid;
  655|  5.21k|    SECOidTag oidTag;
  656|       |
  657|  5.21k|    extItem.data = NULL;
  658|  5.21k|    rv = CERT_FindCertExtension(cert, SEC_OID_X509_EXT_KEY_USAGE, &extItem);
  659|  5.21k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (659:9): [True: 4.97k, False: 237]
  ------------------
  660|  4.97k|        goto loser;
  661|  4.97k|    }
  662|       |
  663|    237|    oidSeq = CERT_DecodeOidSequence(&extItem);
  664|    237|    if (oidSeq == NULL) {
  ------------------
  |  Branch (664:9): [True: 187, False: 50]
  ------------------
  665|    187|        goto loser;
  666|    187|    }
  667|       |
  668|     50|    oids = oidSeq->oids;
  669|     56|    while (oids != NULL && *oids != NULL) {
  ------------------
  |  Branch (669:12): [True: 56, False: 0]
  |  Branch (669:28): [True: 6, False: 50]
  ------------------
  670|      6|        oid = *oids;
  671|       |
  672|      6|        oidTag = SECOID_FindOIDTag(oid);
  ------------------
  |  |  117|      6|#define SECOID_FindOIDTag SECOID_FindOIDTag_Util
  ------------------
  673|       |
  674|      6|        if (oidTag == SEC_OID_NS_KEY_USAGE_GOVT_APPROVED) {
  ------------------
  |  Branch (674:13): [True: 0, False: 6]
  ------------------
  675|      0|            goto success;
  676|      0|        }
  677|       |
  678|      6|        oids++;
  679|      6|    }
  680|       |
  681|  5.21k|loser:
  682|  5.21k|    ret = PR_FALSE;
  ------------------
  |  |  438|  5.21k|#define PR_FALSE 0
  ------------------
  683|  5.21k|    goto done;
  684|      0|success:
  685|      0|    ret = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  686|  5.21k|done:
  687|  5.21k|    if (oidSeq != NULL) {
  ------------------
  |  Branch (687:9): [True: 50, False: 5.16k]
  ------------------
  688|     50|        CERT_DestroyOidSequence(oidSeq);
  689|     50|    }
  690|  5.21k|    if (extItem.data != NULL) {
  ------------------
  |  Branch (690:9): [True: 234, False: 4.97k]
  ------------------
  691|    234|        PORT_Free(extItem.data);
  ------------------
  |  |   60|    234|#define PORT_Free PORT_Free_Util
  ------------------
  692|    234|    }
  693|  5.21k|    return (ret);
  694|      0|}

CERT_GetAVATag:
   69|  21.4k|{
   70|  21.4k|    SECOidData *oid;
   71|  21.4k|    if (!ava->type.data)
  ------------------
  |  Branch (71:9): [True: 0, False: 21.4k]
  ------------------
   72|      0|        return (SECOidTag)-1;
   73|       |
   74|  21.4k|    oid = SECOID_FindOID(&ava->type);
  ------------------
  |  |  115|  21.4k|#define SECOID_FindOID SECOID_FindOID_Util
  ------------------
   75|       |
   76|  21.4k|    if (oid) {
  ------------------
  |  Branch (76:9): [True: 6.55k, False: 14.8k]
  ------------------
   77|  6.55k|        return (oid->offset);
   78|  6.55k|    }
   79|  14.8k|    return (SECOidTag)-1;
   80|  21.4k|}
CERT_DecodeAVAValue:
  599|  10.6k|{
  600|  10.6k|    SECItem *retItem;
  601|  10.6k|    const SEC_ASN1Template *theTemplate = NULL;
  602|  10.6k|    enum { conv_none,
  603|  10.6k|           conv_ucs4,
  604|  10.6k|           conv_ucs2,
  605|  10.6k|           conv_iso88591 } convert = conv_none;
  606|  10.6k|    SECItem avaValue = { siBuffer, 0 };
  607|  10.6k|    PORTCheapArenaPool tmpArena;
  608|       |
  609|  10.6k|    if (!derAVAValue || !derAVAValue->len || !derAVAValue->data) {
  ------------------
  |  Branch (609:9): [True: 0, False: 10.6k]
  |  Branch (609:25): [True: 0, False: 10.6k]
  |  Branch (609:46): [True: 0, False: 10.6k]
  ------------------
  610|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  611|      0|        return NULL;
  612|      0|    }
  613|       |
  614|  10.6k|    switch (derAVAValue->data[0]) {
  615|    813|        case SEC_ASN1_UNIVERSAL_STRING:
  ------------------
  |  |  104|    813|#define SEC_ASN1_UNIVERSAL_STRING 0x1c
  ------------------
  |  Branch (615:9): [True: 813, False: 9.87k]
  ------------------
  616|    813|            convert = conv_ucs4;
  617|    813|            theTemplate = SEC_ASN1_GET(SEC_UniversalStringTemplate);
  ------------------
  |  |  188|    813|#define SEC_ASN1_GET(x) x
  ------------------
  618|    813|            break;
  619|     79|        case SEC_ASN1_IA5_STRING:
  ------------------
  |  |   98|     79|#define SEC_ASN1_IA5_STRING 0x16
  ------------------
  |  Branch (619:9): [True: 79, False: 10.6k]
  ------------------
  620|     79|            theTemplate = SEC_ASN1_GET(SEC_IA5StringTemplate);
  ------------------
  |  |  188|     79|#define SEC_ASN1_GET(x) x
  ------------------
  621|     79|            break;
  622|  5.82k|        case SEC_ASN1_PRINTABLE_STRING:
  ------------------
  |  |   95|  5.82k|#define SEC_ASN1_PRINTABLE_STRING 0x13
  ------------------
  |  Branch (622:9): [True: 5.82k, False: 4.86k]
  ------------------
  623|  5.82k|            theTemplate = SEC_ASN1_GET(SEC_PrintableStringTemplate);
  ------------------
  |  |  188|  5.82k|#define SEC_ASN1_GET(x) x
  ------------------
  624|  5.82k|            break;
  625|    113|        case SEC_ASN1_T61_STRING:
  ------------------
  |  |   96|    113|#define SEC_ASN1_T61_STRING 0x14
  ------------------
  |  Branch (625:9): [True: 113, False: 10.5k]
  ------------------
  626|       |            /*
  627|       |             * Per common practice, we're not decoding actual T.61, but instead
  628|       |             * treating T61-labeled strings as containing ISO-8859-1.
  629|       |             */
  630|    113|            convert = conv_iso88591;
  631|    113|            theTemplate = SEC_ASN1_GET(SEC_T61StringTemplate);
  ------------------
  |  |  188|    113|#define SEC_ASN1_GET(x) x
  ------------------
  632|    113|            break;
  633|    555|        case SEC_ASN1_BMP_STRING:
  ------------------
  |  |  106|    555|#define SEC_ASN1_BMP_STRING 0x1e
  ------------------
  |  Branch (633:9): [True: 555, False: 10.1k]
  ------------------
  634|    555|            convert = conv_ucs2;
  635|    555|            theTemplate = SEC_ASN1_GET(SEC_BMPStringTemplate);
  ------------------
  |  |  188|    555|#define SEC_ASN1_GET(x) x
  ------------------
  636|    555|            break;
  637|    963|        case SEC_ASN1_UTF8_STRING:
  ------------------
  |  |   88|    963|#define SEC_ASN1_UTF8_STRING 0x0c
  ------------------
  |  Branch (637:9): [True: 963, False: 9.72k]
  ------------------
  638|       |            /* No conversion needed ! */
  639|    963|            theTemplate = SEC_ASN1_GET(SEC_UTF8StringTemplate);
  ------------------
  |  |  188|    963|#define SEC_ASN1_GET(x) x
  ------------------
  640|    963|            break;
  641|  2.34k|        default:
  ------------------
  |  Branch (641:9): [True: 2.34k, False: 8.34k]
  ------------------
  642|  2.34k|            PORT_SetError(SEC_ERROR_INVALID_AVA);
  ------------------
  |  |   65|  2.34k|#define PORT_SetError PORT_SetError_Util
  ------------------
  643|  2.34k|            return NULL;
  644|  10.6k|    }
  645|       |
  646|  8.34k|    PORT_Memset(&avaValue, 0, sizeof(SECItem));
  ------------------
  |  |  182|  8.34k|#define PORT_Memset memset
  ------------------
  647|  8.34k|    PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  8.34k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  648|  8.34k|    if (SEC_QuickDERDecodeItem(&tmpArena.arena, &avaValue, theTemplate,
  ------------------
  |  |  102|  8.34k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  |  Branch (648:9): [True: 0, False: 8.34k]
  ------------------
  649|  8.34k|                               derAVAValue) != SECSuccess) {
  650|      0|        PORT_DestroyCheapArena(&tmpArena);
  651|      0|        return NULL;
  652|      0|    }
  653|       |
  654|  8.34k|    if (convert != conv_none) {
  ------------------
  |  Branch (654:9): [True: 1.48k, False: 6.86k]
  ------------------
  655|  1.48k|        unsigned int utf8ValLen = avaValue.len * 3;
  656|  1.48k|        unsigned char *utf8Val =
  657|  1.48k|            (unsigned char *)PORT_ArenaZAlloc(&tmpArena.arena, utf8ValLen);
  ------------------
  |  |   59|  1.48k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  658|       |
  659|  1.48k|        switch (convert) {
  ------------------
  |  Branch (659:17): [True: 0, False: 1.48k]
  ------------------
  660|    813|            case conv_ucs4:
  ------------------
  |  Branch (660:13): [True: 813, False: 668]
  ------------------
  661|    813|                if (avaValue.len % 4 != 0 ||
  ------------------
  |  Branch (661:21): [True: 678, False: 135]
  ------------------
  662|    813|                    !PORT_UCS4_UTF8Conversion(PR_FALSE, avaValue.data,
  ------------------
  |  |  438|    135|#define PR_FALSE 0
  ------------------
  |  Branch (662:21): [True: 34, False: 101]
  ------------------
  663|    135|                                              avaValue.len, utf8Val, utf8ValLen,
  664|    712|                                              &utf8ValLen)) {
  665|    712|                    PORT_DestroyCheapArena(&tmpArena);
  666|    712|                    PORT_SetError(SEC_ERROR_INVALID_AVA);
  ------------------
  |  |   65|    712|#define PORT_SetError PORT_SetError_Util
  ------------------
  667|    712|                    return NULL;
  668|    712|                }
  669|    101|                break;
  670|    555|            case conv_ucs2:
  ------------------
  |  Branch (670:13): [True: 555, False: 926]
  ------------------
  671|    555|                if (avaValue.len % 2 != 0 ||
  ------------------
  |  Branch (671:21): [True: 420, False: 135]
  ------------------
  672|    555|                    !PORT_UCS2_UTF8Conversion(PR_FALSE, avaValue.data,
  ------------------
  |  |   71|    135|#define PORT_UCS2_UTF8Conversion PORT_UCS2_UTF8Conversion_Util
  ------------------
                                  !PORT_UCS2_UTF8Conversion(PR_FALSE, avaValue.data,
  ------------------
  |  |  438|    135|#define PR_FALSE 0
  ------------------
  |  Branch (672:21): [True: 43, False: 92]
  ------------------
  673|    135|                                              avaValue.len, utf8Val, utf8ValLen,
  674|    463|                                              &utf8ValLen)) {
  675|    463|                    PORT_DestroyCheapArena(&tmpArena);
  676|    463|                    PORT_SetError(SEC_ERROR_INVALID_AVA);
  ------------------
  |  |   65|    463|#define PORT_SetError PORT_SetError_Util
  ------------------
  677|    463|                    return NULL;
  678|    463|                }
  679|     92|                break;
  680|    113|            case conv_iso88591:
  ------------------
  |  Branch (680:13): [True: 113, False: 1.36k]
  ------------------
  681|    113|                if (!PORT_ISO88591_UTF8Conversion(avaValue.data, avaValue.len,
  ------------------
  |  Branch (681:21): [True: 0, False: 113]
  ------------------
  682|    113|                                                  utf8Val, utf8ValLen,
  683|    113|                                                  &utf8ValLen)) {
  684|      0|                    PORT_DestroyCheapArena(&tmpArena);
  685|      0|                    PORT_SetError(SEC_ERROR_INVALID_AVA);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  686|      0|                    return NULL;
  687|      0|                }
  688|    113|                break;
  689|    113|            case conv_none:
  ------------------
  |  Branch (689:13): [True: 0, False: 1.48k]
  ------------------
  690|      0|                PORT_Assert(0); /* not reached */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  691|      0|                break;
  692|  1.48k|        }
  693|       |
  694|    306|        avaValue.data = utf8Val;
  695|    306|        avaValue.len = utf8ValLen;
  696|    306|    }
  697|       |
  698|  7.17k|    retItem = SECITEM_DupItem(&avaValue);
  ------------------
  |  |  107|  7.17k|#define SECITEM_DupItem SECITEM_DupItem_Util
  ------------------
  699|  7.17k|    PORT_DestroyCheapArena(&tmpArena);
  700|  7.17k|    return retItem;
  701|  8.34k|}

CERT_GetCertTrust:
   95|  10.3k|{
   96|  10.3k|    SECStatus rv;
   97|  10.3k|    CERT_LockCertTrust(cert);
   98|  10.3k|    if (!cert || cert->trust == NULL) {
  ------------------
  |  Branch (98:9): [True: 0, False: 10.3k]
  |  Branch (98:18): [True: 10.3k, False: 0]
  ------------------
   99|  10.3k|        rv = SECFailure;
  100|  10.3k|    } else {
  101|      0|        *trust = *cert->trust;
  102|      0|        rv = SECSuccess;
  103|      0|    }
  104|  10.3k|    CERT_UnlockCertTrust(cert);
  105|  10.3k|    return (rv);
  106|  10.3k|}
CERT_MapStanError:
  159|    193|{
  160|    193|    PRInt32 *errorStack;
  161|    193|    NSSError error, prevError;
  162|    193|    int secError;
  163|    193|    int i;
  164|       |
  165|    193|    errorStack = NSS_GetErrorStack();
  166|    193|    if (errorStack == 0) {
  ------------------
  |  Branch (166:9): [True: 0, False: 193]
  ------------------
  167|      0|        PORT_SetError(0);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  168|      0|        return;
  169|      0|    }
  170|    193|    error = prevError = CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|    193|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
  171|       |    /* get the 'top 2' error codes from the stack */
  172|    275|    for (i = 0; errorStack[i]; i++) {
  ------------------
  |  Branch (172:17): [True: 82, False: 193]
  ------------------
  173|     82|        prevError = error;
  174|     82|        error = errorStack[i];
  175|     82|    }
  176|    193|    if (error == NSS_ERROR_PKCS11) {
  ------------------
  |  Branch (176:9): [True: 0, False: 193]
  ------------------
  177|       |        /* map it */
  178|      0|        secError = PK11_MapError(prevError);
  179|      0|    }
  180|    193|    STAN_MAP_ERROR(NSS_ERROR_NO_ERROR, 0)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  181|    193|    STAN_MAP_ERROR(NSS_ERROR_NO_MEMORY, SEC_ERROR_NO_MEMORY)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  182|    193|    STAN_MAP_ERROR(NSS_ERROR_INVALID_BASE64, SEC_ERROR_BAD_DATA)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  183|    193|    STAN_MAP_ERROR(NSS_ERROR_INVALID_BER, SEC_ERROR_BAD_DER)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  184|    193|    STAN_MAP_ERROR(NSS_ERROR_INVALID_ATAV, SEC_ERROR_INVALID_AVA)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  185|    193|    STAN_MAP_ERROR(NSS_ERROR_INVALID_PASSWORD, SEC_ERROR_BAD_PASSWORD)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  186|    193|    STAN_MAP_ERROR(NSS_ERROR_BUSY, SEC_ERROR_BUSY)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  187|    193|    STAN_MAP_ERROR(NSS_ERROR_DEVICE_ERROR, SEC_ERROR_IO)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  188|    193|    STAN_MAP_ERROR(NSS_ERROR_CERTIFICATE_ISSUER_NOT_FOUND,
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  189|    193|                   SEC_ERROR_UNKNOWN_ISSUER)
  190|    193|    STAN_MAP_ERROR(NSS_ERROR_INVALID_CERTIFICATE, SEC_ERROR_CERT_NOT_VALID)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  191|    193|    STAN_MAP_ERROR(NSS_ERROR_INVALID_UTF8, SEC_ERROR_BAD_DATA)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  192|    193|    STAN_MAP_ERROR(NSS_ERROR_INVALID_NSSOID, SEC_ERROR_BAD_DATA)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 193]
  |  |  ------------------
  ------------------
  193|       |
  194|       |    /* these are library failure for lack of a better error code */
  195|    193|    STAN_MAP_ERROR(NSS_ERROR_NOT_FOUND, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 41, False: 152]
  |  |  ------------------
  ------------------
  196|    193|    STAN_MAP_ERROR(NSS_ERROR_CERTIFICATE_IN_CACHE, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |  150|    193|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  197|    152|    STAN_MAP_ERROR(NSS_ERROR_MAXIMUM_FOUND, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  198|    152|    STAN_MAP_ERROR(NSS_ERROR_USER_CANCELED, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  199|    152|    STAN_MAP_ERROR(NSS_ERROR_TRACKER_NOT_INITIALIZED, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  200|    152|    STAN_MAP_ERROR(NSS_ERROR_ALREADY_INITIALIZED, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  201|    152|    STAN_MAP_ERROR(NSS_ERROR_ARENA_MARKED_BY_ANOTHER_THREAD,
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  202|    152|                   SEC_ERROR_LIBRARY_FAILURE)
  203|    152|    STAN_MAP_ERROR(NSS_ERROR_HASH_COLLISION, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  204|       |
  205|    152|    STAN_MAP_ERROR(NSS_ERROR_INTERNAL_ERROR, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  206|       |
  207|       |    /* these are all invalid arguments */
  208|    152|    STAN_MAP_ERROR(NSS_ERROR_INVALID_ARGUMENT, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  209|    152|    STAN_MAP_ERROR(NSS_ERROR_INVALID_POINTER, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  210|    152|    STAN_MAP_ERROR(NSS_ERROR_INVALID_ARENA, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 152]
  |  |  ------------------
  ------------------
  211|    152|    STAN_MAP_ERROR(NSS_ERROR_INVALID_ARENA_MARK, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 152, False: 0]
  |  |  ------------------
  ------------------
  212|    152|    STAN_MAP_ERROR(NSS_ERROR_DUPLICATE_POINTER, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|    152|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  213|      0|    STAN_MAP_ERROR(NSS_ERROR_POINTER_NOT_REGISTERED, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  214|      0|    STAN_MAP_ERROR(NSS_ERROR_TRACKER_NOT_EMPTY, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  215|      0|    STAN_MAP_ERROR(NSS_ERROR_VALUE_TOO_LARGE, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  216|      0|    STAN_MAP_ERROR(NSS_ERROR_UNSUPPORTED_TYPE, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  217|      0|    STAN_MAP_ERROR(NSS_ERROR_BUFFER_TOO_SHORT, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  218|      0|    STAN_MAP_ERROR(NSS_ERROR_INVALID_ATOB_CONTEXT, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  219|      0|    STAN_MAP_ERROR(NSS_ERROR_INVALID_BTOA_CONTEXT, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  220|      0|    STAN_MAP_ERROR(NSS_ERROR_INVALID_ITEM, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  221|      0|    STAN_MAP_ERROR(NSS_ERROR_INVALID_STRING, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  222|      0|    STAN_MAP_ERROR(NSS_ERROR_INVALID_ASN1ENCODER, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  223|      0|    STAN_MAP_ERROR(NSS_ERROR_INVALID_ASN1DECODER, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  224|      0|    STAN_MAP_ERROR(NSS_ERROR_UNKNOWN_ATTRIBUTE, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |  150|      0|    else if (error == (x)) { secError = y; }
  |  |  ------------------
  |  |  |  Branch (150:14): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  225|      0|    else { secError = SEC_ERROR_LIBRARY_FAILURE; }
  226|    193|    PORT_SetError(secError);
  ------------------
  |  |   65|    193|#define PORT_SetError PORT_SetError_Util
  ------------------
  227|    193|}
CERT_NewTempCertificate:
  357|  5.40k|{
  358|  5.40k|    NSSCertificate *c;
  359|  5.40k|    CERTCertificate *cc;
  360|  5.40k|    NSSCertificate *tempCert = NULL;
  361|  5.40k|    nssPKIObject *pkio;
  362|  5.40k|    NSSCryptoContext *gCC = STAN_GetDefaultCryptoContext();
  363|  5.40k|    NSSTrustDomain *gTD = STAN_GetDefaultTrustDomain();
  364|  5.40k|    if (!isperm) {
  ------------------
  |  Branch (364:9): [True: 5.40k, False: 0]
  ------------------
  365|  5.40k|        NSSDER encoding;
  366|  5.40k|        NSSITEM_FROM_SECITEM(&encoding, derCert);
  ------------------
  |  |   27|  5.40k|    (nssit)->data = (void *)(secit)->data; \
  |  |   28|  5.40k|    (nssit)->size = (PRUint32)(secit)->len;
  ------------------
  367|       |        /* First, see if it is already a temp cert */
  368|  5.40k|        c = NSSCryptoContext_FindCertificateByEncodedCertificate(gCC,
  369|  5.40k|                                                                 &encoding);
  370|  5.40k|        if (!c && handle) {
  ------------------
  |  Branch (370:13): [True: 5.40k, False: 0]
  |  Branch (370:19): [True: 5.40k, False: 0]
  ------------------
  371|       |            /* Then, see if it is already a perm cert */
  372|  5.40k|            c = NSSTrustDomain_FindCertificateByEncodedCertificate(handle,
  373|  5.40k|                                                                   &encoding);
  374|  5.40k|        }
  375|  5.40k|        if (c) {
  ------------------
  |  Branch (375:13): [True: 0, False: 5.40k]
  ------------------
  376|       |            /* actually, that search ends up going by issuer/serial,
  377|       |             * so it is still possible to return a cert with the same
  378|       |             * issuer/serial but a different encoding, and we're
  379|       |             * going to reject that
  380|       |             */
  381|      0|            if (!nssItem_Equal(&c->encoding, &encoding, NULL)) {
  ------------------
  |  Branch (381:17): [True: 0, False: 0]
  ------------------
  382|      0|                nssCertificate_Destroy(c);
  383|      0|                PORT_SetError(SEC_ERROR_REUSED_ISSUER_AND_SERIAL);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  384|      0|                cc = NULL;
  385|      0|            } else {
  386|      0|                cc = STAN_GetCERTCertificateOrRelease(c);
  387|      0|                if (cc == NULL) {
  ------------------
  |  Branch (387:21): [True: 0, False: 0]
  ------------------
  388|      0|                    CERT_MapStanError();
  389|      0|                }
  390|      0|            }
  391|      0|            return cc;
  392|      0|        }
  393|  5.40k|    }
  394|  5.40k|    pkio = nssPKIObject_Create(NULL, NULL, gTD, gCC, nssPKIMonitor);
  395|  5.40k|    if (!pkio) {
  ------------------
  |  Branch (395:9): [True: 0, False: 5.40k]
  ------------------
  396|      0|        CERT_MapStanError();
  397|      0|        return NULL;
  398|      0|    }
  399|  5.40k|    c = nss_ZNEW(pkio->arena, NSSCertificate);
  ------------------
  |  |  348|  5.40k|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  400|  5.40k|    if (!c) {
  ------------------
  |  Branch (400:9): [True: 0, False: 5.40k]
  ------------------
  401|      0|        CERT_MapStanError();
  402|      0|        nssPKIObject_Destroy(pkio);
  403|      0|        return NULL;
  404|      0|    }
  405|  5.40k|    c->object = *pkio;
  406|  5.40k|    if (copyDER) {
  ------------------
  |  Branch (406:9): [True: 5.40k, False: 0]
  ------------------
  407|  5.40k|        nssItem_Create(c->object.arena, &c->encoding, derCert->len,
  408|  5.40k|                       derCert->data);
  409|  5.40k|    } else {
  410|      0|        NSSITEM_FROM_SECITEM(&c->encoding, derCert);
  ------------------
  |  |   27|      0|    (nssit)->data = (void *)(secit)->data; \
  |  |   28|      0|    (nssit)->size = (PRUint32)(secit)->len;
  ------------------
  411|      0|    }
  412|       |    /* Forces a decoding of the cert in order to obtain the parts used
  413|       |     * below
  414|       |     */
  415|       |    /* 'c' is not adopted here, if we fail loser frees what has been
  416|       |     * allocated so far for 'c' */
  417|  5.40k|    cc = STAN_GetCERTCertificate(c);
  418|  5.40k|    if (!cc) {
  ------------------
  |  Branch (418:9): [True: 193, False: 5.21k]
  ------------------
  419|    193|        CERT_MapStanError();
  420|    193|        goto loser;
  421|    193|    }
  422|  5.21k|    nssItem_Create(c->object.arena, &c->issuer, cc->derIssuer.len,
  423|  5.21k|                   cc->derIssuer.data);
  424|  5.21k|    nssItem_Create(c->object.arena, &c->subject, cc->derSubject.len,
  425|  5.21k|                   cc->derSubject.data);
  426|       |    /* CERTCertificate stores serial numbers decoded.  I need the DER
  427|       |     * here.  sigh.
  428|       |     */
  429|  5.21k|    SECItem derSerial = { 0 };
  430|  5.21k|    CERT_SerialNumberFromDERCert(&cc->derCert, &derSerial);
  431|  5.21k|    if (!derSerial.data)
  ------------------
  |  Branch (431:9): [True: 0, False: 5.21k]
  ------------------
  432|      0|        goto loser;
  433|  5.21k|    nssItem_Create(c->object.arena, &c->serial, derSerial.len,
  434|  5.21k|                   derSerial.data);
  435|  5.21k|    PORT_Free(derSerial.data);
  ------------------
  |  |   60|  5.21k|#define PORT_Free PORT_Free_Util
  ------------------
  436|       |
  437|  5.21k|    if (nickname) {
  ------------------
  |  Branch (437:9): [True: 0, False: 5.21k]
  ------------------
  438|      0|        c->object.tempName =
  439|      0|            nssUTF8_Create(c->object.arena, nssStringType_UTF8String,
  440|      0|                           (NSSUTF8 *)nickname, PORT_Strlen(nickname));
  ------------------
  |  |  190|      0|#define PORT_Strlen(s) strlen(s)
  ------------------
  441|      0|    }
  442|  5.21k|    if (cc->emailAddr && cc->emailAddr[0]) {
  ------------------
  |  Branch (442:9): [True: 18, False: 5.19k]
  |  Branch (442:26): [True: 18, False: 0]
  ------------------
  443|     18|        c->email = nssUTF8_Create(
  444|     18|            c->object.arena, nssStringType_PrintableString,
  445|     18|            (NSSUTF8 *)cc->emailAddr, PORT_Strlen(cc->emailAddr));
  ------------------
  |  |  190|     18|#define PORT_Strlen(s) strlen(s)
  ------------------
  446|     18|    }
  447|       |
  448|  5.21k|    tempCert = NSSCryptoContext_FindOrImportCertificate(gCC, c);
  449|  5.21k|    if (!tempCert) {
  ------------------
  |  Branch (449:9): [True: 0, False: 5.21k]
  ------------------
  450|      0|        CERT_MapStanError();
  451|      0|        goto loser;
  452|      0|    }
  453|       |    /* destroy our copy */
  454|  5.21k|    NSSCertificate_Destroy(c);
  455|       |    /* and use the stored entry */
  456|  5.21k|    c = tempCert;
  457|  5.21k|    cc = STAN_GetCERTCertificateOrRelease(c);
  458|  5.21k|    if (!cc) {
  ------------------
  |  Branch (458:9): [True: 0, False: 5.21k]
  ------------------
  459|       |        /* STAN_GetCERTCertificateOrRelease destroys c on failure. */
  460|      0|        CERT_MapStanError();
  461|      0|        return NULL;
  462|      0|    }
  463|       |
  464|  5.21k|    CERT_LockCertTempPerm(cc);
  465|  5.21k|    cc->istemp = PR_TRUE;
  ------------------
  |  |  437|  5.21k|#define PR_TRUE 1
  ------------------
  466|  5.21k|    cc->isperm = PR_FALSE;
  ------------------
  |  |  438|  5.21k|#define PR_FALSE 0
  ------------------
  467|  5.21k|    CERT_UnlockCertTempPerm(cc);
  468|  5.21k|    return cc;
  469|    193|loser:
  470|       |    /* Perhaps this should be nssCertificate_Destroy(c) */
  471|    193|    nssPKIObject_Destroy(&c->object);
  472|    193|    return NULL;
  473|  5.21k|}
CERT_DestroyCertificate:
  817|  9.89k|{
  818|  9.89k|    if (cert) {
  ------------------
  |  Branch (818:9): [True: 9.88k, False: 19]
  ------------------
  819|       |        /* don't use STAN_GetNSSCertificate because we don't want to
  820|       |         * go to the trouble of translating the CERTCertificate into
  821|       |         * an NSSCertificate just to destroy it.  If it hasn't been done
  822|       |         * yet, don't do it at all
  823|       |         *
  824|       |         * cert->nssCertificate contains its own locks and refcount, but as it
  825|       |         * may be NULL, the pointer itself must be guarded by some other lock.
  826|       |         * Rather than creating a new global lock for only this purpose, share
  827|       |         * an existing global lock that happens to be taken near the write in
  828|       |         * fill_CERTCertificateFields(). The longer-term goal is to refactor
  829|       |         * all these global locks to be certificate-scoped. */
  830|  9.88k|        CERT_MaybeLockCertTempPerm(cert);
  831|  9.88k|        NSSCertificate *tmp = cert->nssCertificate;
  832|  9.88k|        CERT_MaybeUnlockCertTempPerm(cert);
  833|  9.88k|        if (tmp) {
  ------------------
  |  Branch (833:13): [True: 9.88k, False: 0]
  ------------------
  834|       |            /* delete the NSSCertificate */
  835|  9.88k|            NSSCertificate_Destroy(tmp);
  836|  9.88k|        } else if (cert->arena) {
  ------------------
  |  Branch (836:20): [True: 0, False: 0]
  ------------------
  837|      0|            PORT_FreeArena(cert->arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(cert->arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  838|      0|        }
  839|  9.88k|    }
  840|  9.89k|    return;
  841|  9.89k|}

CERT_DecodeAuthKeyID:
   81|    126|{
   82|    126|    CERTAuthKeyID *value = NULL;
   83|    126|    SECStatus rv = SECFailure;
   84|    126|    void *mark;
   85|    126|    SECItem newEncodedValue;
   86|       |
   87|    126|    PORT_Assert(arena);
  ------------------
  |  |  120|    126|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    126|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 126, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|       |
   89|    126|    do {
   90|    126|        mark = PORT_ArenaMark(arena);
  ------------------
  |  |   55|    126|#define PORT_ArenaMark PORT_ArenaMark_Util
  ------------------
   91|    126|        value = (CERTAuthKeyID *)PORT_ArenaZAlloc(arena, sizeof(*value));
  ------------------
  |  |   59|    126|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
   92|    126|        if (value == NULL)
  ------------------
  |  Branch (92:13): [True: 0, False: 126]
  ------------------
   93|      0|            break;
   94|    126|        value->DERAuthCertIssuer = NULL;
   95|       |        /* copy the DER into the arena, since Quick DER returns data that points
   96|       |           into the DER input, which may get freed by the caller */
   97|    126|        rv = SECITEM_CopyItem(arena, &newEncodedValue, encodedValue);
  ------------------
  |  |  106|    126|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
   98|    126|        if (rv != SECSuccess) {
  ------------------
  |  Branch (98:13): [True: 0, False: 126]
  ------------------
   99|      0|            break;
  100|      0|        }
  101|       |
  102|    126|        rv = SEC_QuickDERDecodeItem(arena, value, CERTAuthKeyIDTemplate,
  ------------------
  |  |  102|    126|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  103|    126|                                    &newEncodedValue);
  104|    126|        if (rv != SECSuccess)
  ------------------
  |  Branch (104:13): [True: 52, False: 74]
  ------------------
  105|     52|            break;
  106|       |
  107|     74|        value->authCertIssuer =
  108|     74|            cert_DecodeGeneralNames(arena, value->DERAuthCertIssuer);
  109|     74|        if (value->authCertIssuer == NULL)
  ------------------
  |  Branch (109:13): [True: 74, False: 0]
  ------------------
  110|     74|            break;
  111|       |
  112|       |        /* what if the general name contains other format but not URI ?
  113|       |           hl
  114|       |         */
  115|      0|        if ((value->authCertSerialNumber.data && !value->authCertIssuer) ||
  ------------------
  |  Branch (115:14): [True: 0, False: 0]
  |  Branch (115:50): [True: 0, False: 0]
  ------------------
  116|      0|            (!value->authCertSerialNumber.data && value->authCertIssuer)) {
  ------------------
  |  Branch (116:14): [True: 0, False: 0]
  |  Branch (116:51): [True: 0, False: 0]
  ------------------
  117|      0|            PORT_SetError(SEC_ERROR_EXTENSION_VALUE_INVALID);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  118|      0|            break;
  119|      0|        }
  120|      0|    } while (0);
  ------------------
  |  Branch (120:14): [Folded - Ignored]
  ------------------
  121|       |
  122|    126|    if (rv != SECSuccess) {
  ------------------
  |  Branch (122:9): [True: 52, False: 74]
  ------------------
  123|     52|        PORT_ArenaRelease(arena, mark);
  ------------------
  |  |   56|     52|#define PORT_ArenaRelease PORT_ArenaRelease_Util
  ------------------
  124|     52|        return ((CERTAuthKeyID *)NULL);
  125|     52|    }
  126|     74|    PORT_ArenaUnmark(arena, mark);
  ------------------
  |  |   58|     74|#define PORT_ArenaUnmark PORT_ArenaUnmark_Util
  ------------------
  127|     74|    return (value);
  128|    126|}

CERT_DecodeBasicConstraintValue:
   94|  5.74k|{
   95|  5.74k|    EncodedContext decodeContext;
   96|  5.74k|    PORTCheapArenaPool tmpArena;
   97|  5.74k|    SECStatus rv = SECSuccess;
   98|       |
   99|  5.74k|    do {
  100|  5.74k|        PORT_Memset(&decodeContext, 0, sizeof(decodeContext));
  ------------------
  |  |  182|  5.74k|#define PORT_Memset memset
  ------------------
  101|       |        /* initialize the value just in case we got "0x30 00", or when the
  102|       |           pathLenConstraint is omitted.
  103|       |         */
  104|  5.74k|        decodeContext.isCA.data = &hexFalse;
  105|  5.74k|        decodeContext.isCA.len = 1;
  106|       |
  107|  5.74k|        PORT_InitCheapArena(&tmpArena, SEC_ASN1_DEFAULT_ARENA_SIZE);
  ------------------
  |  |   60|  5.74k|#define SEC_ASN1_DEFAULT_ARENA_SIZE (2048)
  ------------------
  108|       |
  109|  5.74k|        rv = SEC_QuickDERDecodeItem(&tmpArena.arena, &decodeContext,
  ------------------
  |  |  102|  5.74k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  110|  5.74k|                                    CERTBasicConstraintsTemplate, encodedValue);
  111|  5.74k|        if (rv == SECFailure)
  ------------------
  |  Branch (111:13): [True: 1.52k, False: 4.21k]
  ------------------
  112|  1.52k|            break;
  113|       |
  114|  4.21k|        value->isCA = decodeContext.isCA.data
  ------------------
  |  Branch (114:23): [True: 4.21k, False: 0]
  ------------------
  115|  4.21k|                          ? (PRBool)(decodeContext.isCA.data[0] != 0)
  116|  4.21k|                          : PR_FALSE;
  ------------------
  |  |  438|  4.21k|#define PR_FALSE 0
  ------------------
  117|  4.21k|        if (decodeContext.pathLenConstraint.data == NULL) {
  ------------------
  |  Branch (117:13): [True: 4.21k, False: 2]
  ------------------
  118|       |            /* if the pathLenConstraint is not encoded, and the current setting
  119|       |              is CA, then the pathLenConstraint should be set to a negative
  120|       |              number
  121|       |              for unlimited certificate path.
  122|       |             */
  123|  4.21k|            if (value->isCA) {
  ------------------
  |  Branch (123:17): [True: 96, False: 4.12k]
  ------------------
  124|     96|                value->pathLenConstraint = CERT_UNLIMITED_PATH_CONSTRAINT;
  ------------------
  |  |  599|     96|#define CERT_UNLIMITED_PATH_CONSTRAINT -2
  ------------------
  125|  4.12k|            } else {
  126|  4.12k|                value->pathLenConstraint = 0;
  127|  4.12k|            }
  128|  4.21k|        } else if (value->isCA) {
  ------------------
  |  Branch (128:20): [True: 0, False: 2]
  ------------------
  129|      0|            long len = DER_GetInteger(&decodeContext.pathLenConstraint);
  ------------------
  |  |   27|      0|#define DER_GetInteger DER_GetInteger_Util
  ------------------
  130|      0|            if (len < 0 || len == LONG_MAX) {
  ------------------
  |  Branch (130:17): [True: 0, False: 0]
  |  Branch (130:28): [True: 0, False: 0]
  ------------------
  131|      0|                PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  132|      0|                GEN_BREAK(SECFailure);
  ------------------
  |  |   41|      0|    rv = status;          \
  |  |   42|      0|    break;
  ------------------
  133|      0|            }
  134|      0|            value->pathLenConstraint = len;
  135|      2|        } else {
  136|       |            /* here we get an error where the subject is not a CA, but
  137|       |               the pathLenConstraint is set */
  138|      2|            PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
  139|      2|            GEN_BREAK(SECFailure);
  ------------------
  |  |   41|      2|    rv = status;          \
  |  |   42|      2|    break;
  ------------------
  140|      0|            break;
  141|      2|        }
  142|  4.21k|    } while (0);
  ------------------
  |  Branch (142:14): [Folded - Ignored]
  ------------------
  143|       |
  144|      0|    PORT_DestroyCheapArena(&tmpArena);
  145|  5.74k|    return (rv);
  146|  5.74k|}

CERT_DecodeAltNameExtension:
  164|    157|{
  165|    157|    SECStatus rv = SECSuccess;
  166|    157|    CERTAltNameEncodedContext encodedContext;
  167|    157|    SECItem *newEncodedAltName;
  168|       |
  169|    157|    if (!reqArena) {
  ------------------
  |  Branch (169:9): [True: 0, False: 157]
  ------------------
  170|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  171|      0|        return NULL;
  172|      0|    }
  173|       |
  174|    157|    newEncodedAltName = SECITEM_ArenaDupItem(reqArena, EncodedAltName);
  ------------------
  |  |  104|    157|#define SECITEM_ArenaDupItem SECITEM_ArenaDupItem_Util
  ------------------
  175|    157|    if (!newEncodedAltName) {
  ------------------
  |  Branch (175:9): [True: 0, False: 157]
  ------------------
  176|      0|        return NULL;
  177|      0|    }
  178|       |
  179|    157|    encodedContext.encodedGenName = NULL;
  180|    157|    PORT_Memset(&encodedContext, 0, sizeof(CERTAltNameEncodedContext));
  ------------------
  |  |  182|    157|#define PORT_Memset memset
  ------------------
  181|    157|    rv = SEC_QuickDERDecodeItem(reqArena, &encodedContext,
  ------------------
  |  |  102|    157|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  182|    157|                                CERT_GeneralNamesTemplate, newEncodedAltName);
  183|    157|    if (rv == SECFailure) {
  ------------------
  |  Branch (183:9): [True: 61, False: 96]
  ------------------
  184|     61|        goto loser;
  185|     61|    }
  186|     96|    if (encodedContext.encodedGenName && encodedContext.encodedGenName[0])
  ------------------
  |  Branch (186:9): [True: 96, False: 0]
  |  Branch (186:42): [True: 40, False: 56]
  ------------------
  187|     40|        return cert_DecodeGeneralNames(reqArena, encodedContext.encodedGenName);
  188|       |    /* Extension contained an empty GeneralNames sequence */
  189|       |    /* Treat as extension not found */
  190|     56|    PORT_SetError(SEC_ERROR_EXTENSION_NOT_FOUND);
  ------------------
  |  |   65|     56|#define PORT_SetError PORT_SetError_Util
  ------------------
  191|    117|loser:
  192|    117|    return NULL;
  193|     56|}

CERT_ClearOCSPCache:
  595|      1|{
  596|      1|    OCSP_TRACE(("OCSP CERT_ClearOCSPCache\n"));
  ------------------
  |  |  144|      1|#define OCSP_TRACE(msg) ocsp_Trace msg
  ------------------
  597|      1|    PR_EnterMonitor(OCSP_Global.monitor);
  598|      1|    while (OCSP_Global.cache.numberOfEntries > 0) {
  ------------------
  |  Branch (598:12): [True: 0, False: 1]
  ------------------
  599|      0|        ocsp_RemoveCacheItem(&OCSP_Global.cache,
  600|      0|                             OCSP_Global.cache.LRUitem);
  601|      0|    }
  602|      1|    PR_ExitMonitor(OCSP_Global.monitor);
  603|      1|    return SECSuccess;
  604|      1|}
OCSP_InitGlobal:
  933|      1|{
  934|      1|    SECStatus rv = SECFailure;
  935|       |
  936|      1|    if (OCSP_Global.monitor == NULL) {
  ------------------
  |  Branch (936:9): [True: 1, False: 0]
  ------------------
  937|      1|        OCSP_Global.monitor = PR_NewMonitor();
  938|      1|    }
  939|      1|    if (!OCSP_Global.monitor)
  ------------------
  |  Branch (939:9): [True: 0, False: 1]
  ------------------
  940|      0|        return SECFailure;
  941|       |
  942|      1|    PR_EnterMonitor(OCSP_Global.monitor);
  943|      1|    if (!OCSP_Global.cache.entries) {
  ------------------
  |  Branch (943:9): [True: 1, False: 0]
  ------------------
  944|      1|        OCSP_Global.cache.entries =
  945|      1|            PL_NewHashTable(0,
  946|      1|                            ocsp_CacheKeyHashFunction,
  947|      1|                            ocsp_CacheKeyCompareFunction,
  948|      1|                            PL_CompareValues,
  949|      1|                            NULL,
  950|      1|                            NULL);
  951|      1|        OCSP_Global.ocspFailureMode = ocspMode_FailureIsVerificationFailure;
  952|      1|        OCSP_Global.cache.numberOfEntries = 0;
  953|      1|        OCSP_Global.cache.MRUitem = NULL;
  954|      1|        OCSP_Global.cache.LRUitem = NULL;
  955|      1|    } else {
  956|       |        /*
  957|       |         * NSS might call this function twice while attempting to init.
  958|       |         * But it's not allowed to call this again after any activity.
  959|       |         */
  960|      0|        PORT_Assert(OCSP_Global.cache.numberOfEntries == 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  961|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  962|      0|    }
  963|      1|    if (OCSP_Global.cache.entries)
  ------------------
  |  Branch (963:9): [True: 1, False: 0]
  ------------------
  964|      1|        rv = SECSuccess;
  965|      1|    PR_ExitMonitor(OCSP_Global.monitor);
  966|      1|    return rv;
  967|      1|}
OCSP_ShutdownGlobal:
  971|      1|{
  972|      1|    if (!OCSP_Global.monitor)
  ------------------
  |  Branch (972:9): [True: 0, False: 1]
  ------------------
  973|      0|        return SECSuccess;
  974|       |
  975|      1|    PR_EnterMonitor(OCSP_Global.monitor);
  976|      1|    if (OCSP_Global.cache.entries) {
  ------------------
  |  Branch (976:9): [True: 1, False: 0]
  ------------------
  977|      1|        CERT_ClearOCSPCache();
  978|      1|        PL_HashTableDestroy(OCSP_Global.cache.entries);
  979|      1|        OCSP_Global.cache.entries = NULL;
  980|      1|    }
  981|      1|    PORT_Assert(OCSP_Global.cache.numberOfEntries == 0);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  982|      1|    OCSP_Global.cache.MRUitem = NULL;
  983|      1|    OCSP_Global.cache.LRUitem = NULL;
  984|       |
  985|      1|    OCSP_Global.defaultHttpClientFcn = NULL;
  986|      1|    OCSP_Global.maxCacheEntries = DEFAULT_OCSP_CACHE_SIZE;
  ------------------
  |  |   40|      1|#define DEFAULT_OCSP_CACHE_SIZE 1000
  ------------------
  987|      1|    OCSP_Global.minimumSecondsToNextFetchAttempt =
  988|      1|        DEFAULT_MINIMUM_SECONDS_TO_NEXT_OCSP_FETCH_ATTEMPT;
  ------------------
  |  |   41|      1|#define DEFAULT_MINIMUM_SECONDS_TO_NEXT_OCSP_FETCH_ATTEMPT 1 * 60 * 60L
  ------------------
  989|      1|    OCSP_Global.maximumSecondsToNextFetchAttempt =
  990|      1|        DEFAULT_MAXIMUM_SECONDS_TO_NEXT_OCSP_FETCH_ATTEMPT;
  ------------------
  |  |   42|      1|#define DEFAULT_MAXIMUM_SECONDS_TO_NEXT_OCSP_FETCH_ATTEMPT 24 * 60 * 60L
  ------------------
  991|      1|    OCSP_Global.ocspFailureMode =
  992|      1|        ocspMode_FailureIsVerificationFailure;
  993|      1|    PR_ExitMonitor(OCSP_Global.monitor);
  994|       |
  995|      1|    PR_DestroyMonitor(OCSP_Global.monitor);
  996|      1|    OCSP_Global.monitor = NULL;
  997|      1|    return SECSuccess;
  998|      1|}
ocsp.c:ocsp_Trace:
  173|      1|{
  174|      1|    char buf[2000];
  175|      1|    va_list args;
  176|       |
  177|      1|    if (!wantOcspTrace())
  ------------------
  |  Branch (177:9): [True: 1, False: 0]
  ------------------
  178|      1|        return;
  179|      0|    va_start(args, format);
  180|      0|    PR_vsnprintf(buf, sizeof(buf), format, args);
  181|      0|    va_end(args);
  182|      0|    PR_LogPrint("%s", buf);
  183|      0|}
ocsp.c:wantOcspTrace:
  155|      1|{
  156|      1|    static PRBool firstTime = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  157|      1|    static PRBool wantTrace = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  158|       |
  159|      1|#ifdef NSS_HAVE_GETENV
  160|      1|    if (firstTime) {
  ------------------
  |  Branch (160:9): [True: 1, False: 0]
  ------------------
  161|      1|        char *ev = PR_GetEnvSecure("NSS_TRACE_OCSP");
  162|      1|        if (ev && ev[0]) {
  ------------------
  |  Branch (162:13): [True: 0, False: 1]
  |  Branch (162:19): [True: 0, False: 0]
  ------------------
  163|      0|            wantTrace = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  164|      0|        }
  165|      1|        firstTime = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  166|      1|    }
  167|      1|#endif
  168|      1|    return wantTrace;
  169|      1|}

DSAU_ConvertSignedToFixedUnsigned:
   70|  2.10k|{
   71|  2.10k|    unsigned char *pSrc = src->data;
   72|  2.10k|    unsigned char *pDst = dest->data;
   73|  2.10k|    unsigned int cntSrc = src->len;
   74|  2.10k|    unsigned int cntDst = dest->len;
   75|  2.10k|    int zCount = cntDst - cntSrc;
   76|       |
   77|  2.10k|    if (zCount > 0) {
  ------------------
  |  Branch (77:9): [True: 1.48k, False: 613]
  ------------------
   78|  1.48k|        PORT_Memset(pDst, 0, zCount);
  ------------------
  |  |  182|  1.48k|#define PORT_Memset memset
  ------------------
   79|  1.48k|        PORT_Memcpy(pDst + zCount, pSrc, cntSrc);
  ------------------
  |  |  180|  1.48k|#define PORT_Memcpy memcpy
  ------------------
   80|  1.48k|        return SECSuccess;
   81|  1.48k|    }
   82|    613|    if (zCount <= 0) {
  ------------------
  |  Branch (82:9): [True: 613, False: 0]
  ------------------
   83|       |        /* Source is longer than destination.  Check for leading zeros. */
   84|    613|        while (zCount++ < 0) {
  ------------------
  |  Branch (84:16): [True: 10, False: 603]
  ------------------
   85|     10|            if (*pSrc++ != 0)
  ------------------
  |  Branch (85:17): [True: 10, False: 0]
  ------------------
   86|     10|                goto loser;
   87|     10|        }
   88|    613|    }
   89|    603|    PORT_Memcpy(pDst, pSrc, cntDst);
  ------------------
  |  |  180|    603|#define PORT_Memcpy memcpy
  ------------------
   90|    603|    return SECSuccess;
   91|       |
   92|     10|loser:
   93|     10|    PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   65|     10|#define PORT_SetError PORT_SetError_Util
  ------------------
                  PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   55|     10|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
   94|     10|    return SECFailure;
   95|    613|}
DSAU_DecodeDerSigToLen:
  269|  1.15k|{
  270|  1.15k|    return common_DecodeDerSig(item, len / 2);
  271|  1.15k|}
dsautil.c:common_DecodeDerSig:
  166|  1.15k|{
  167|  1.15k|    SECItem *result = NULL;
  168|  1.15k|    PORTCheapArenaPool arena;
  169|  1.15k|    SECStatus status;
  170|  1.15k|    DSA_ASN1Signature sig;
  171|  1.15k|    SECItem dst;
  172|       |
  173|  1.15k|    PORT_Memset(&sig, 0, sizeof(sig));
  ------------------
  |  |  182|  1.15k|#define PORT_Memset memset
  ------------------
  174|       |
  175|       |    /* Make enough room for r + s. */
  176|  1.15k|    PORT_InitCheapArena(&arena, PR_MAX(2 * MAX_ECKEY_LEN, DSA_MAX_SIGNATURE_LEN));
  ------------------
  |  |  159|  1.15k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [Folded - Ignored]
  |  |  ------------------
  ------------------
  177|       |
  178|  1.15k|    result = PORT_ZNew(SECItem);
  ------------------
  |  |  148|  1.15k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  1.15k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  179|  1.15k|    if (result == NULL)
  ------------------
  |  Branch (179:9): [True: 0, False: 1.15k]
  ------------------
  180|      0|        goto loser;
  181|       |
  182|  1.15k|    result->len = 2 * len;
  183|  1.15k|    result->data = (unsigned char *)PORT_Alloc(2 * len);
  ------------------
  |  |   52|  1.15k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  184|  1.15k|    if (result->data == NULL)
  ------------------
  |  Branch (184:9): [True: 0, False: 1.15k]
  ------------------
  185|      0|        goto loser;
  186|       |
  187|  1.15k|    sig.r.type = siUnsignedInteger;
  188|  1.15k|    sig.s.type = siUnsignedInteger;
  189|  1.15k|    status = SEC_QuickDERDecodeItem(&arena.arena, &sig, DSA_SignatureTemplate, item);
  ------------------
  |  |  102|  1.15k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  190|  1.15k|    if (status != SECSuccess)
  ------------------
  |  Branch (190:9): [True: 96, False: 1.05k]
  ------------------
  191|     96|        goto loser;
  192|       |
  193|       |    /* Convert sig.r and sig.s from variable  length signed integers to
  194|       |    ** fixed length unsigned integers.
  195|       |    */
  196|  1.05k|    dst.data = result->data;
  197|  1.05k|    dst.len = len;
  198|  1.05k|    status = DSAU_ConvertSignedToFixedUnsigned(&dst, &sig.r);
  199|  1.05k|    if (status != SECSuccess)
  ------------------
  |  Branch (199:9): [True: 9, False: 1.04k]
  ------------------
  200|      9|        goto loser;
  201|       |
  202|  1.04k|    dst.data += len;
  203|  1.04k|    status = DSAU_ConvertSignedToFixedUnsigned(&dst, &sig.s);
  204|  1.04k|    if (status != SECSuccess)
  ------------------
  |  Branch (204:9): [True: 1, False: 1.04k]
  ------------------
  205|      1|        goto loser;
  206|       |
  207|  1.15k|done:
  208|  1.15k|    PORT_DestroyCheapArena(&arena);
  209|       |
  210|  1.15k|    return result;
  211|       |
  212|    106|loser:
  213|    106|    if (result != NULL) {
  ------------------
  |  Branch (213:9): [True: 106, False: 0]
  ------------------
  214|    106|        SECITEM_FreeItem(result, PR_TRUE);
  ------------------
  |  |  108|    106|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(result, PR_TRUE);
  ------------------
  |  |  437|    106|#define PR_TRUE 1
  ------------------
  215|    106|        result = NULL;
  216|    106|    }
  217|    106|    goto done;
  218|  1.04k|}

HASH_GetHashObjectByOidTag:
  273|  17.5k|{
  274|  17.5k|    HASH_HashType ht = HASH_GetHashTypeByOidTag(hashOid);
  ------------------
  |  |  125|  17.5k|#define HASH_GetHashTypeByOidTag HASH_GetHashTypeByOidTag_Util
  ------------------
  275|       |
  276|  17.5k|    return (ht == HASH_AlgNULL) ? NULL : &SECHashObjects[ht];
  ------------------
  |  Branch (276:12): [True: 0, False: 17.5k]
  ------------------
  277|  17.5k|}
HASH_ResultLenByOidTag:
  282|  17.5k|{
  283|  17.5k|    const SECHashObject *hashObject = HASH_GetHashObjectByOidTag(hashOid);
  284|  17.5k|    unsigned int resultLen = 0;
  285|       |
  286|  17.5k|    if (hashObject)
  ------------------
  |  Branch (286:9): [True: 17.5k, False: 0]
  ------------------
  287|  17.5k|        resultLen = hashObject->length;
  288|  17.5k|    return resultLen;
  289|  17.5k|}

SECKEY_CreateDHPrivateKey:
  175|  1.60k|{
  176|  1.60k|    SECKEYPrivateKey *privk;
  177|  1.60k|    PK11SlotInfo *slot;
  178|       |
  179|  1.60k|    if (!param || !param->base.data || !param->prime.data ||
  ------------------
  |  Branch (179:9): [True: 0, False: 1.60k]
  |  Branch (179:19): [True: 0, False: 1.60k]
  |  Branch (179:40): [True: 0, False: 1.60k]
  ------------------
  180|  1.60k|        SECKEY_BigIntegerBitLength(&param->prime) < DH_MIN_P_BITS ||
  ------------------
  |  |  154|  3.20k|#define DH_MIN_P_BITS 128
  ------------------
  |  Branch (180:9): [True: 0, False: 1.60k]
  ------------------
  181|  1.60k|        param->base.len == 0 || param->base.len > param->prime.len + 1 ||
  ------------------
  |  Branch (181:9): [True: 0, False: 1.60k]
  |  Branch (181:33): [True: 0, False: 1.60k]
  ------------------
  182|  1.60k|        (param->base.len == 1 && param->base.data[0] == 0)) {
  ------------------
  |  Branch (182:10): [True: 1.24k, False: 355]
  |  Branch (182:34): [True: 0, False: 1.24k]
  ------------------
  183|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  184|      0|        return NULL;
  185|      0|    }
  186|       |
  187|  1.60k|    slot = PK11_GetBestSlot(CKM_DH_PKCS_KEY_PAIR_GEN, cx);
  ------------------
  |  |  758|  1.60k|#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
  ------------------
  188|  1.60k|    if (!slot) {
  ------------------
  |  Branch (188:9): [True: 0, False: 1.60k]
  ------------------
  189|      0|        return NULL;
  190|      0|    }
  191|       |
  192|  1.60k|    privk = PK11_GenerateKeyPair(slot, CKM_DH_PKCS_KEY_PAIR_GEN, param,
  ------------------
  |  |  758|  1.60k|#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
  ------------------
  193|  1.60k|                                 pubk, PR_FALSE, PR_FALSE, cx);
  ------------------
  |  |  438|  1.60k|#define PR_FALSE 0
  ------------------
                                               pubk, PR_FALSE, PR_FALSE, cx);
  ------------------
  |  |  438|  1.60k|#define PR_FALSE 0
  ------------------
  194|  1.60k|    if (!privk)
  ------------------
  |  Branch (194:9): [True: 308, False: 1.29k]
  ------------------
  195|    308|        privk = PK11_GenerateKeyPair(slot, CKM_DH_PKCS_KEY_PAIR_GEN, param,
  ------------------
  |  |  758|    308|#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
  ------------------
  196|    308|                                     pubk, PR_FALSE, PR_TRUE, cx);
  ------------------
  |  |  438|    308|#define PR_FALSE 0
  ------------------
                                                   pubk, PR_FALSE, PR_TRUE, cx);
  ------------------
  |  |  437|    308|#define PR_TRUE 1
  ------------------
  197|       |
  198|  1.60k|    PK11_FreeSlot(slot);
  199|  1.60k|    return (privk);
  200|  1.60k|}
SECKEY_DestroyPrivateKey:
  267|  18.0k|{
  268|  18.0k|    if (privk) {
  ------------------
  |  Branch (268:9): [True: 9.19k, False: 8.87k]
  ------------------
  269|  9.19k|        if (privk->pkcs11Slot) {
  ------------------
  |  Branch (269:13): [True: 9.19k, False: 0]
  ------------------
  270|  9.19k|            if (privk->pkcs11IsTemp) {
  ------------------
  |  Branch (270:17): [True: 9.19k, False: 0]
  ------------------
  271|  9.19k|                PK11_DestroyObject(privk->pkcs11Slot, privk->pkcs11ID);
  272|  9.19k|            }
  273|  9.19k|            PK11_FreeSlot(privk->pkcs11Slot);
  274|  9.19k|        }
  275|  9.19k|        if (privk->arena) {
  ------------------
  |  Branch (275:13): [True: 9.19k, False: 0]
  ------------------
  276|  9.19k|            PORT_FreeArena(privk->arena, PR_TRUE);
  ------------------
  |  |   61|  9.19k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(privk->arena, PR_TRUE);
  ------------------
  |  |  437|  9.19k|#define PR_TRUE 1
  ------------------
  277|  9.19k|        }
  278|  9.19k|    }
  279|  18.0k|}
SECKEY_DestroyPublicKey:
  283|  31.2k|{
  284|  31.2k|    if (pubk) {
  ------------------
  |  Branch (284:9): [True: 22.3k, False: 8.85k]
  ------------------
  285|  22.3k|        if (pubk->pkcs11Slot) {
  ------------------
  |  Branch (285:13): [True: 12.7k, False: 9.57k]
  ------------------
  286|  12.7k|            if (!PK11_IsPermObject(pubk->pkcs11Slot, pubk->pkcs11ID)) {
  ------------------
  |  Branch (286:17): [True: 12.7k, False: 0]
  ------------------
  287|  12.7k|                PK11_DestroyObject(pubk->pkcs11Slot, pubk->pkcs11ID);
  288|  12.7k|            }
  289|  12.7k|            PK11_FreeSlot(pubk->pkcs11Slot);
  290|  12.7k|        }
  291|  22.3k|        if (pubk->arena) {
  ------------------
  |  Branch (291:13): [True: 22.3k, False: 0]
  ------------------
  292|  22.3k|            PORT_FreeArena(pubk->arena, PR_FALSE);
  ------------------
  |  |   61|  22.3k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(pubk->arena, PR_FALSE);
  ------------------
  |  |  438|  22.3k|#define PR_FALSE 0
  ------------------
  293|  22.3k|        }
  294|  22.3k|    }
  295|  31.2k|}
SECKEY_UpdateCertPQG:
  459|  5.13k|{
  460|  5.13k|    if (!subjectCert) {
  ------------------
  |  Branch (460:9): [True: 0, False: 5.13k]
  ------------------
  461|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  462|      0|        return SECFailure;
  463|      0|    }
  464|  5.13k|    return seckey_UpdateCertPQGChain(subjectCert, 0);
  465|  5.13k|}
seckey_GetKeyType:
  520|    854|{
  521|    854|    KeyType keyType;
  522|       |
  523|    854|    switch (tag) {
  524|      0|        case SEC_OID_X500_RSA_ENCRYPTION:
  ------------------
  |  Branch (524:9): [True: 0, False: 854]
  ------------------
  525|    624|        case SEC_OID_PKCS1_RSA_ENCRYPTION:
  ------------------
  |  Branch (525:9): [True: 624, False: 230]
  ------------------
  526|    624|            keyType = rsaKey;
  527|    624|            break;
  528|      0|        case SEC_OID_PKCS1_RSA_PSS_SIGNATURE:
  ------------------
  |  Branch (528:9): [True: 0, False: 854]
  ------------------
  529|      0|            keyType = rsaPssKey;
  530|      0|            break;
  531|      0|        case SEC_OID_PKCS1_RSA_OAEP_ENCRYPTION:
  ------------------
  |  Branch (531:9): [True: 0, False: 854]
  ------------------
  532|      0|            keyType = rsaOaepKey;
  533|      0|            break;
  534|      0|        case SEC_OID_ANSIX9_DSA_SIGNATURE:
  ------------------
  |  Branch (534:9): [True: 0, False: 854]
  ------------------
  535|      0|            keyType = dsaKey;
  536|      0|            break;
  537|      0|        case SEC_OID_MISSI_KEA_DSS_OLD:
  ------------------
  |  Branch (537:9): [True: 0, False: 854]
  ------------------
  538|      0|        case SEC_OID_MISSI_KEA_DSS:
  ------------------
  |  Branch (538:9): [True: 0, False: 854]
  ------------------
  539|      0|        case SEC_OID_MISSI_DSS_OLD:
  ------------------
  |  Branch (539:9): [True: 0, False: 854]
  ------------------
  540|      0|        case SEC_OID_MISSI_DSS:
  ------------------
  |  Branch (540:9): [True: 0, False: 854]
  ------------------
  541|      0|            keyType = fortezzaKey;
  542|      0|            break;
  543|      0|        case SEC_OID_MISSI_KEA:
  ------------------
  |  Branch (543:9): [True: 0, False: 854]
  ------------------
  544|      0|        case SEC_OID_MISSI_ALT_KEA:
  ------------------
  |  Branch (544:9): [True: 0, False: 854]
  ------------------
  545|      0|            keyType = keaKey;
  546|      0|            break;
  547|      0|        case SEC_OID_X942_DIFFIE_HELMAN_KEY:
  ------------------
  |  Branch (547:9): [True: 0, False: 854]
  ------------------
  548|      0|            keyType = dhKey;
  549|      0|            break;
  550|    230|        case SEC_OID_ANSIX962_EC_PUBLIC_KEY:
  ------------------
  |  Branch (550:9): [True: 230, False: 624]
  ------------------
  551|    230|            keyType = ecKey;
  552|    230|            break;
  553|      0|        case SEC_OID_ED25519_PUBLIC_KEY:
  ------------------
  |  Branch (553:9): [True: 0, False: 854]
  ------------------
  554|      0|            keyType = edKey;
  555|      0|            break;
  556|       |        /* accommodate applications that hand us a signature type when they
  557|       |         * should be handing us a cipher type */
  558|      0|        case SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION:
  ------------------
  |  Branch (558:9): [True: 0, False: 854]
  ------------------
  559|      0|        case SEC_OID_PKCS1_SHA1_WITH_RSA_ENCRYPTION:
  ------------------
  |  Branch (559:9): [True: 0, False: 854]
  ------------------
  560|      0|        case SEC_OID_PKCS1_SHA224_WITH_RSA_ENCRYPTION:
  ------------------
  |  Branch (560:9): [True: 0, False: 854]
  ------------------
  561|      0|        case SEC_OID_PKCS1_SHA256_WITH_RSA_ENCRYPTION:
  ------------------
  |  Branch (561:9): [True: 0, False: 854]
  ------------------
  562|      0|        case SEC_OID_PKCS1_SHA384_WITH_RSA_ENCRYPTION:
  ------------------
  |  Branch (562:9): [True: 0, False: 854]
  ------------------
  563|      0|        case SEC_OID_PKCS1_SHA512_WITH_RSA_ENCRYPTION:
  ------------------
  |  Branch (563:9): [True: 0, False: 854]
  ------------------
  564|      0|            keyType = rsaKey;
  565|      0|            break;
  566|      0|        default:
  ------------------
  |  Branch (566:9): [True: 0, False: 854]
  ------------------
  567|      0|            keyType = nullKey;
  568|    854|    }
  569|    854|    return keyType;
  570|    854|}
SECKEY_ExtractPublicKey:
  755|  2.90k|{
  756|  2.90k|    return seckey_ExtractPublicKey(spki);
  757|  2.90k|}
CERT_ExtractPublicKey:
  761|  6.49k|{
  762|  6.49k|    return seckey_ExtractPublicKey(&cert->subjectPublicKeyInfo);
  763|  6.49k|}
SECKEY_ECParamsToKeySize:
  767|  1.78k|{
  768|  1.78k|    SECOidTag tag;
  769|  1.78k|    SECItem oid = { siBuffer, NULL, 0 };
  770|       |
  771|       |    /* The encodedParams data contains 0x06 (SEC_ASN1_OBJECT_ID),
  772|       |     * followed by the length of the curve oid and the curve oid.
  773|       |     */
  774|  1.78k|    oid.len = encodedParams->data[1];
  775|  1.78k|    oid.data = encodedParams->data + 2;
  776|  1.78k|    if ((tag = SECOID_FindOIDTag(&oid)) == SEC_OID_UNKNOWN)
  ------------------
  |  |  117|  1.78k|#define SECOID_FindOIDTag SECOID_FindOIDTag_Util
  ------------------
  |  Branch (776:9): [True: 74, False: 1.71k]
  ------------------
  777|     74|        return 0;
  778|       |
  779|  1.71k|    switch (tag) {
  780|      1|        case SEC_OID_SECG_EC_SECP112R1:
  ------------------
  |  Branch (780:9): [True: 1, False: 1.71k]
  ------------------
  781|      4|        case SEC_OID_SECG_EC_SECP112R2:
  ------------------
  |  Branch (781:9): [True: 3, False: 1.71k]
  ------------------
  782|      4|            return 112;
  783|       |
  784|      1|        case SEC_OID_SECG_EC_SECT113R1:
  ------------------
  |  Branch (784:9): [True: 1, False: 1.71k]
  ------------------
  785|      3|        case SEC_OID_SECG_EC_SECT113R2:
  ------------------
  |  Branch (785:9): [True: 2, False: 1.71k]
  ------------------
  786|      3|            return 113;
  787|       |
  788|      1|        case SEC_OID_SECG_EC_SECP128R1:
  ------------------
  |  Branch (788:9): [True: 1, False: 1.71k]
  ------------------
  789|      2|        case SEC_OID_SECG_EC_SECP128R2:
  ------------------
  |  Branch (789:9): [True: 1, False: 1.71k]
  ------------------
  790|      2|            return 128;
  791|       |
  792|      1|        case SEC_OID_SECG_EC_SECT131R1:
  ------------------
  |  Branch (792:9): [True: 1, False: 1.71k]
  ------------------
  793|      2|        case SEC_OID_SECG_EC_SECT131R2:
  ------------------
  |  Branch (793:9): [True: 1, False: 1.71k]
  ------------------
  794|      2|            return 131;
  795|       |
  796|      1|        case SEC_OID_SECG_EC_SECP160K1:
  ------------------
  |  Branch (796:9): [True: 1, False: 1.71k]
  ------------------
  797|      3|        case SEC_OID_SECG_EC_SECP160R1:
  ------------------
  |  Branch (797:9): [True: 2, False: 1.71k]
  ------------------
  798|      5|        case SEC_OID_SECG_EC_SECP160R2:
  ------------------
  |  Branch (798:9): [True: 2, False: 1.71k]
  ------------------
  799|      5|            return 160;
  800|       |
  801|      1|        case SEC_OID_SECG_EC_SECT163K1:
  ------------------
  |  Branch (801:9): [True: 1, False: 1.71k]
  ------------------
  802|      2|        case SEC_OID_SECG_EC_SECT163R1:
  ------------------
  |  Branch (802:9): [True: 1, False: 1.71k]
  ------------------
  803|      3|        case SEC_OID_SECG_EC_SECT163R2:
  ------------------
  |  Branch (803:9): [True: 1, False: 1.71k]
  ------------------
  804|      4|        case SEC_OID_ANSIX962_EC_C2PNB163V1:
  ------------------
  |  Branch (804:9): [True: 1, False: 1.71k]
  ------------------
  805|      8|        case SEC_OID_ANSIX962_EC_C2PNB163V2:
  ------------------
  |  Branch (805:9): [True: 4, False: 1.71k]
  ------------------
  806|     10|        case SEC_OID_ANSIX962_EC_C2PNB163V3:
  ------------------
  |  Branch (806:9): [True: 2, False: 1.71k]
  ------------------
  807|     10|            return 163;
  808|       |
  809|      1|        case SEC_OID_ANSIX962_EC_C2PNB176V1:
  ------------------
  |  Branch (809:9): [True: 1, False: 1.71k]
  ------------------
  810|      1|            return 176;
  811|       |
  812|      3|        case SEC_OID_ANSIX962_EC_C2TNB191V1:
  ------------------
  |  Branch (812:9): [True: 3, False: 1.71k]
  ------------------
  813|      4|        case SEC_OID_ANSIX962_EC_C2TNB191V2:
  ------------------
  |  Branch (813:9): [True: 1, False: 1.71k]
  ------------------
  814|      6|        case SEC_OID_ANSIX962_EC_C2TNB191V3:
  ------------------
  |  Branch (814:9): [True: 2, False: 1.71k]
  ------------------
  815|      7|        case SEC_OID_ANSIX962_EC_C2ONB191V4:
  ------------------
  |  Branch (815:9): [True: 1, False: 1.71k]
  ------------------
  816|      9|        case SEC_OID_ANSIX962_EC_C2ONB191V5:
  ------------------
  |  Branch (816:9): [True: 2, False: 1.71k]
  ------------------
  817|      9|            return 191;
  818|       |
  819|      1|        case SEC_OID_SECG_EC_SECP192K1:
  ------------------
  |  Branch (819:9): [True: 1, False: 1.71k]
  ------------------
  820|      5|        case SEC_OID_ANSIX962_EC_PRIME192V1:
  ------------------
  |  Branch (820:9): [True: 4, False: 1.71k]
  ------------------
  821|      8|        case SEC_OID_ANSIX962_EC_PRIME192V2:
  ------------------
  |  Branch (821:9): [True: 3, False: 1.71k]
  ------------------
  822|      9|        case SEC_OID_ANSIX962_EC_PRIME192V3:
  ------------------
  |  Branch (822:9): [True: 1, False: 1.71k]
  ------------------
  823|      9|            return 192;
  824|       |
  825|      1|        case SEC_OID_SECG_EC_SECT193R1:
  ------------------
  |  Branch (825:9): [True: 1, False: 1.71k]
  ------------------
  826|      2|        case SEC_OID_SECG_EC_SECT193R2:
  ------------------
  |  Branch (826:9): [True: 1, False: 1.71k]
  ------------------
  827|      2|            return 193;
  828|       |
  829|      1|        case SEC_OID_ANSIX962_EC_C2PNB208W1:
  ------------------
  |  Branch (829:9): [True: 1, False: 1.71k]
  ------------------
  830|      1|            return 208;
  831|       |
  832|      1|        case SEC_OID_SECG_EC_SECP224K1:
  ------------------
  |  Branch (832:9): [True: 1, False: 1.71k]
  ------------------
  833|      3|        case SEC_OID_SECG_EC_SECP224R1:
  ------------------
  |  Branch (833:9): [True: 2, False: 1.71k]
  ------------------
  834|      3|            return 224;
  835|       |
  836|      1|        case SEC_OID_SECG_EC_SECT233K1:
  ------------------
  |  Branch (836:9): [True: 1, False: 1.71k]
  ------------------
  837|      3|        case SEC_OID_SECG_EC_SECT233R1:
  ------------------
  |  Branch (837:9): [True: 2, False: 1.71k]
  ------------------
  838|      3|            return 233;
  839|       |
  840|      1|        case SEC_OID_SECG_EC_SECT239K1:
  ------------------
  |  Branch (840:9): [True: 1, False: 1.71k]
  ------------------
  841|      2|        case SEC_OID_ANSIX962_EC_C2TNB239V1:
  ------------------
  |  Branch (841:9): [True: 1, False: 1.71k]
  ------------------
  842|     10|        case SEC_OID_ANSIX962_EC_C2TNB239V2:
  ------------------
  |  Branch (842:9): [True: 8, False: 1.70k]
  ------------------
  843|     11|        case SEC_OID_ANSIX962_EC_C2TNB239V3:
  ------------------
  |  Branch (843:9): [True: 1, False: 1.71k]
  ------------------
  844|     12|        case SEC_OID_ANSIX962_EC_C2ONB239V4:
  ------------------
  |  Branch (844:9): [True: 1, False: 1.71k]
  ------------------
  845|     15|        case SEC_OID_ANSIX962_EC_C2ONB239V5:
  ------------------
  |  Branch (845:9): [True: 3, False: 1.71k]
  ------------------
  846|     16|        case SEC_OID_ANSIX962_EC_PRIME239V1:
  ------------------
  |  Branch (846:9): [True: 1, False: 1.71k]
  ------------------
  847|     18|        case SEC_OID_ANSIX962_EC_PRIME239V2:
  ------------------
  |  Branch (847:9): [True: 2, False: 1.71k]
  ------------------
  848|     22|        case SEC_OID_ANSIX962_EC_PRIME239V3:
  ------------------
  |  Branch (848:9): [True: 4, False: 1.71k]
  ------------------
  849|     22|            return 239;
  850|       |
  851|     10|        case SEC_OID_SECG_EC_SECP256K1:
  ------------------
  |  Branch (851:9): [True: 10, False: 1.70k]
  ------------------
  852|    773|        case SEC_OID_ANSIX962_EC_PRIME256V1:
  ------------------
  |  Branch (852:9): [True: 763, False: 951]
  ------------------
  853|    773|            return 256;
  854|       |
  855|     45|        case SEC_OID_ANSIX962_EC_C2PNB272W1:
  ------------------
  |  Branch (855:9): [True: 45, False: 1.66k]
  ------------------
  856|     45|            return 272;
  857|       |
  858|     10|        case SEC_OID_SECG_EC_SECT283K1:
  ------------------
  |  Branch (858:9): [True: 10, False: 1.70k]
  ------------------
  859|     20|        case SEC_OID_SECG_EC_SECT283R1:
  ------------------
  |  Branch (859:9): [True: 10, False: 1.70k]
  ------------------
  860|     20|            return 283;
  861|       |
  862|     52|        case SEC_OID_ANSIX962_EC_C2PNB304W1:
  ------------------
  |  Branch (862:9): [True: 52, False: 1.66k]
  ------------------
  863|     52|            return 304;
  864|       |
  865|     23|        case SEC_OID_ANSIX962_EC_C2TNB359V1:
  ------------------
  |  Branch (865:9): [True: 23, False: 1.69k]
  ------------------
  866|     23|            return 359;
  867|       |
  868|    122|        case SEC_OID_ANSIX962_EC_C2PNB368W1:
  ------------------
  |  Branch (868:9): [True: 122, False: 1.59k]
  ------------------
  869|    122|            return 368;
  870|       |
  871|    303|        case SEC_OID_SECG_EC_SECP384R1:
  ------------------
  |  Branch (871:9): [True: 303, False: 1.41k]
  ------------------
  872|    303|            return 384;
  873|       |
  874|     10|        case SEC_OID_SECG_EC_SECT409K1:
  ------------------
  |  Branch (874:9): [True: 10, False: 1.70k]
  ------------------
  875|     20|        case SEC_OID_SECG_EC_SECT409R1:
  ------------------
  |  Branch (875:9): [True: 10, False: 1.70k]
  ------------------
  876|     20|            return 409;
  877|       |
  878|     26|        case SEC_OID_ANSIX962_EC_C2TNB431R1:
  ------------------
  |  Branch (878:9): [True: 26, False: 1.68k]
  ------------------
  879|     26|            return 431;
  880|       |
  881|     47|        case SEC_OID_SECG_EC_SECP521R1:
  ------------------
  |  Branch (881:9): [True: 47, False: 1.66k]
  ------------------
  882|     47|            return 521;
  883|       |
  884|     13|        case SEC_OID_SECG_EC_SECT571K1:
  ------------------
  |  Branch (884:9): [True: 13, False: 1.70k]
  ------------------
  885|     23|        case SEC_OID_SECG_EC_SECT571R1:
  ------------------
  |  Branch (885:9): [True: 10, False: 1.70k]
  ------------------
  886|     23|            return 571;
  887|       |
  888|      0|        case SEC_OID_X25519:
  ------------------
  |  Branch (888:9): [True: 0, False: 1.71k]
  ------------------
  889|    180|        case SEC_OID_CURVE25519:
  ------------------
  |  Branch (889:9): [True: 180, False: 1.53k]
  ------------------
  890|    180|        case SEC_OID_ED25519_PUBLIC_KEY:
  ------------------
  |  Branch (890:9): [True: 0, False: 1.71k]
  ------------------
  891|    180|            return 255;
  892|       |
  893|      4|        default:
  ------------------
  |  Branch (893:9): [True: 4, False: 1.71k]
  ------------------
  894|      4|            PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
  895|      4|            return 0;
  896|  1.71k|    }
  897|  1.71k|}
SECKEY_ECParamsToBasePointOrderLen:
  901|    360|{
  902|    360|    SECOidTag tag;
  903|    360|    SECItem oid = { siBuffer, NULL, 0 };
  904|       |
  905|       |    /* The encodedParams data contains 0x06 (SEC_ASN1_OBJECT_ID),
  906|       |     * followed by the length of the curve oid and the curve oid.
  907|       |     */
  908|    360|    oid.len = encodedParams->data[1];
  909|    360|    oid.data = encodedParams->data + 2;
  910|    360|    if ((tag = SECOID_FindOIDTag(&oid)) == SEC_OID_UNKNOWN)
  ------------------
  |  |  117|    360|#define SECOID_FindOIDTag SECOID_FindOIDTag_Util
  ------------------
  |  Branch (910:9): [True: 0, False: 360]
  ------------------
  911|      0|        return 0;
  912|       |
  913|    360|    switch (tag) {
  914|      0|        case SEC_OID_SECG_EC_SECP112R1:
  ------------------
  |  Branch (914:9): [True: 0, False: 360]
  ------------------
  915|      0|            return 112;
  916|      0|        case SEC_OID_SECG_EC_SECP112R2:
  ------------------
  |  Branch (916:9): [True: 0, False: 360]
  ------------------
  917|      0|            return 110;
  918|       |
  919|      0|        case SEC_OID_SECG_EC_SECT113R1:
  ------------------
  |  Branch (919:9): [True: 0, False: 360]
  ------------------
  920|      0|        case SEC_OID_SECG_EC_SECT113R2:
  ------------------
  |  Branch (920:9): [True: 0, False: 360]
  ------------------
  921|      0|            return 113;
  922|       |
  923|      0|        case SEC_OID_SECG_EC_SECP128R1:
  ------------------
  |  Branch (923:9): [True: 0, False: 360]
  ------------------
  924|      0|            return 128;
  925|      0|        case SEC_OID_SECG_EC_SECP128R2:
  ------------------
  |  Branch (925:9): [True: 0, False: 360]
  ------------------
  926|      0|            return 126;
  927|       |
  928|      0|        case SEC_OID_SECG_EC_SECT131R1:
  ------------------
  |  Branch (928:9): [True: 0, False: 360]
  ------------------
  929|      0|        case SEC_OID_SECG_EC_SECT131R2:
  ------------------
  |  Branch (929:9): [True: 0, False: 360]
  ------------------
  930|      0|            return 131;
  931|       |
  932|      0|        case SEC_OID_SECG_EC_SECP160K1:
  ------------------
  |  Branch (932:9): [True: 0, False: 360]
  ------------------
  933|      0|        case SEC_OID_SECG_EC_SECP160R1:
  ------------------
  |  Branch (933:9): [True: 0, False: 360]
  ------------------
  934|      0|        case SEC_OID_SECG_EC_SECP160R2:
  ------------------
  |  Branch (934:9): [True: 0, False: 360]
  ------------------
  935|      0|            return 161;
  936|       |
  937|      0|        case SEC_OID_SECG_EC_SECT163K1:
  ------------------
  |  Branch (937:9): [True: 0, False: 360]
  ------------------
  938|      0|            return 163;
  939|      0|        case SEC_OID_SECG_EC_SECT163R1:
  ------------------
  |  Branch (939:9): [True: 0, False: 360]
  ------------------
  940|      0|            return 162;
  941|      0|        case SEC_OID_SECG_EC_SECT163R2:
  ------------------
  |  Branch (941:9): [True: 0, False: 360]
  ------------------
  942|      0|        case SEC_OID_ANSIX962_EC_C2PNB163V1:
  ------------------
  |  Branch (942:9): [True: 0, False: 360]
  ------------------
  943|      0|            return 163;
  944|      0|        case SEC_OID_ANSIX962_EC_C2PNB163V2:
  ------------------
  |  Branch (944:9): [True: 0, False: 360]
  ------------------
  945|      0|        case SEC_OID_ANSIX962_EC_C2PNB163V3:
  ------------------
  |  Branch (945:9): [True: 0, False: 360]
  ------------------
  946|      0|            return 162;
  947|       |
  948|      0|        case SEC_OID_ANSIX962_EC_C2PNB176V1:
  ------------------
  |  Branch (948:9): [True: 0, False: 360]
  ------------------
  949|      0|            return 161;
  950|       |
  951|      0|        case SEC_OID_ANSIX962_EC_C2TNB191V1:
  ------------------
  |  Branch (951:9): [True: 0, False: 360]
  ------------------
  952|      0|            return 191;
  953|      0|        case SEC_OID_ANSIX962_EC_C2TNB191V2:
  ------------------
  |  Branch (953:9): [True: 0, False: 360]
  ------------------
  954|      0|            return 190;
  955|      0|        case SEC_OID_ANSIX962_EC_C2TNB191V3:
  ------------------
  |  Branch (955:9): [True: 0, False: 360]
  ------------------
  956|      0|            return 189;
  957|      0|        case SEC_OID_ANSIX962_EC_C2ONB191V4:
  ------------------
  |  Branch (957:9): [True: 0, False: 360]
  ------------------
  958|      0|            return 191;
  959|      0|        case SEC_OID_ANSIX962_EC_C2ONB191V5:
  ------------------
  |  Branch (959:9): [True: 0, False: 360]
  ------------------
  960|      0|            return 188;
  961|       |
  962|      0|        case SEC_OID_SECG_EC_SECP192K1:
  ------------------
  |  Branch (962:9): [True: 0, False: 360]
  ------------------
  963|      0|        case SEC_OID_ANSIX962_EC_PRIME192V1:
  ------------------
  |  Branch (963:9): [True: 0, False: 360]
  ------------------
  964|      0|        case SEC_OID_ANSIX962_EC_PRIME192V2:
  ------------------
  |  Branch (964:9): [True: 0, False: 360]
  ------------------
  965|      0|        case SEC_OID_ANSIX962_EC_PRIME192V3:
  ------------------
  |  Branch (965:9): [True: 0, False: 360]
  ------------------
  966|      0|            return 192;
  967|       |
  968|      0|        case SEC_OID_SECG_EC_SECT193R1:
  ------------------
  |  Branch (968:9): [True: 0, False: 360]
  ------------------
  969|      0|        case SEC_OID_SECG_EC_SECT193R2:
  ------------------
  |  Branch (969:9): [True: 0, False: 360]
  ------------------
  970|      0|            return 193;
  971|       |
  972|      0|        case SEC_OID_ANSIX962_EC_C2PNB208W1:
  ------------------
  |  Branch (972:9): [True: 0, False: 360]
  ------------------
  973|      0|            return 193;
  974|       |
  975|      0|        case SEC_OID_SECG_EC_SECP224K1:
  ------------------
  |  Branch (975:9): [True: 0, False: 360]
  ------------------
  976|      0|            return 225;
  977|      0|        case SEC_OID_SECG_EC_SECP224R1:
  ------------------
  |  Branch (977:9): [True: 0, False: 360]
  ------------------
  978|      0|            return 224;
  979|       |
  980|      0|        case SEC_OID_SECG_EC_SECT233K1:
  ------------------
  |  Branch (980:9): [True: 0, False: 360]
  ------------------
  981|      0|            return 232;
  982|      0|        case SEC_OID_SECG_EC_SECT233R1:
  ------------------
  |  Branch (982:9): [True: 0, False: 360]
  ------------------
  983|      0|            return 233;
  984|       |
  985|      0|        case SEC_OID_SECG_EC_SECT239K1:
  ------------------
  |  Branch (985:9): [True: 0, False: 360]
  ------------------
  986|      0|        case SEC_OID_ANSIX962_EC_C2TNB239V1:
  ------------------
  |  Branch (986:9): [True: 0, False: 360]
  ------------------
  987|      0|            return 238;
  988|      0|        case SEC_OID_ANSIX962_EC_C2TNB239V2:
  ------------------
  |  Branch (988:9): [True: 0, False: 360]
  ------------------
  989|      0|            return 237;
  990|      0|        case SEC_OID_ANSIX962_EC_C2TNB239V3:
  ------------------
  |  Branch (990:9): [True: 0, False: 360]
  ------------------
  991|      0|            return 236;
  992|      0|        case SEC_OID_ANSIX962_EC_C2ONB239V4:
  ------------------
  |  Branch (992:9): [True: 0, False: 360]
  ------------------
  993|      0|            return 238;
  994|      0|        case SEC_OID_ANSIX962_EC_C2ONB239V5:
  ------------------
  |  Branch (994:9): [True: 0, False: 360]
  ------------------
  995|      0|            return 237;
  996|      0|        case SEC_OID_ANSIX962_EC_PRIME239V1:
  ------------------
  |  Branch (996:9): [True: 0, False: 360]
  ------------------
  997|      0|        case SEC_OID_ANSIX962_EC_PRIME239V2:
  ------------------
  |  Branch (997:9): [True: 0, False: 360]
  ------------------
  998|      0|        case SEC_OID_ANSIX962_EC_PRIME239V3:
  ------------------
  |  Branch (998:9): [True: 0, False: 360]
  ------------------
  999|      0|            return 239;
 1000|       |
 1001|      3|        case SEC_OID_SECG_EC_SECP256K1:
  ------------------
  |  Branch (1001:9): [True: 3, False: 357]
  ------------------
 1002|    228|        case SEC_OID_ANSIX962_EC_PRIME256V1:
  ------------------
  |  Branch (1002:9): [True: 225, False: 135]
  ------------------
 1003|    228|            return 256;
 1004|       |
 1005|      3|        case SEC_OID_ANSIX962_EC_C2PNB272W1:
  ------------------
  |  Branch (1005:9): [True: 3, False: 357]
  ------------------
 1006|      3|            return 257;
 1007|       |
 1008|      3|        case SEC_OID_SECG_EC_SECT283K1:
  ------------------
  |  Branch (1008:9): [True: 3, False: 357]
  ------------------
 1009|      3|            return 281;
 1010|      4|        case SEC_OID_SECG_EC_SECT283R1:
  ------------------
  |  Branch (1010:9): [True: 4, False: 356]
  ------------------
 1011|      4|            return 282;
 1012|       |
 1013|      9|        case SEC_OID_ANSIX962_EC_C2PNB304W1:
  ------------------
  |  Branch (1013:9): [True: 9, False: 351]
  ------------------
 1014|      9|            return 289;
 1015|       |
 1016|      4|        case SEC_OID_ANSIX962_EC_C2TNB359V1:
  ------------------
  |  Branch (1016:9): [True: 4, False: 356]
  ------------------
 1017|      4|            return 353;
 1018|       |
 1019|     50|        case SEC_OID_ANSIX962_EC_C2PNB368W1:
  ------------------
  |  Branch (1019:9): [True: 50, False: 310]
  ------------------
 1020|     50|            return 353;
 1021|       |
 1022|     27|        case SEC_OID_SECG_EC_SECP384R1:
  ------------------
  |  Branch (1022:9): [True: 27, False: 333]
  ------------------
 1023|     27|            return 384;
 1024|       |
 1025|      3|        case SEC_OID_SECG_EC_SECT409K1:
  ------------------
  |  Branch (1025:9): [True: 3, False: 357]
  ------------------
 1026|      3|            return 407;
 1027|      3|        case SEC_OID_SECG_EC_SECT409R1:
  ------------------
  |  Branch (1027:9): [True: 3, False: 357]
  ------------------
 1028|      3|            return 409;
 1029|       |
 1030|      5|        case SEC_OID_ANSIX962_EC_C2TNB431R1:
  ------------------
  |  Branch (1030:9): [True: 5, False: 355]
  ------------------
 1031|      5|            return 418;
 1032|       |
 1033|     14|        case SEC_OID_SECG_EC_SECP521R1:
  ------------------
  |  Branch (1033:9): [True: 14, False: 346]
  ------------------
 1034|     14|            return 521;
 1035|       |
 1036|      4|        case SEC_OID_SECG_EC_SECT571K1:
  ------------------
  |  Branch (1036:9): [True: 4, False: 356]
  ------------------
 1037|      7|        case SEC_OID_SECG_EC_SECT571R1:
  ------------------
  |  Branch (1037:9): [True: 3, False: 357]
  ------------------
 1038|      7|            return 570;
 1039|       |
 1040|      0|        case SEC_OID_X25519:
  ------------------
  |  Branch (1040:9): [True: 0, False: 360]
  ------------------
 1041|      0|        case SEC_OID_CURVE25519:
  ------------------
  |  Branch (1041:9): [True: 0, False: 360]
  ------------------
 1042|      0|        case SEC_OID_ED25519_PUBLIC_KEY:
  ------------------
  |  Branch (1042:9): [True: 0, False: 360]
  ------------------
 1043|      0|            return 255;
 1044|       |
 1045|      0|        default:
  ------------------
  |  Branch (1045:9): [True: 0, False: 360]
  ------------------
 1046|      0|            PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1047|      0|            return 0;
 1048|    360|    }
 1049|    360|}
SECKEY_BigIntegerBitLength:
 1054|  18.4k|{
 1055|  18.4k|    const unsigned char *p;
 1056|  18.4k|    unsigned octets;
 1057|  18.4k|    unsigned bits;
 1058|       |
 1059|  18.4k|    if (!number || !number->data) {
  ------------------
  |  Branch (1059:9): [True: 0, False: 18.4k]
  |  Branch (1059:20): [True: 5, False: 18.4k]
  ------------------
 1060|      5|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      5|#define PORT_SetError PORT_SetError_Util
  ------------------
 1061|      5|        return 0;
 1062|      5|    }
 1063|       |
 1064|  18.4k|    p = number->data;
 1065|  18.4k|    octets = number->len;
 1066|   162k|    while (octets > 0 && !*p) {
  ------------------
  |  Branch (1066:12): [True: 162k, False: 4]
  |  Branch (1066:26): [True: 143k, False: 18.4k]
  ------------------
 1067|   143k|        ++p;
 1068|   143k|        --octets;
 1069|   143k|    }
 1070|  18.4k|    if (octets == 0) {
  ------------------
  |  Branch (1070:9): [True: 4, False: 18.4k]
  ------------------
 1071|      4|        return 0;
 1072|      4|    }
 1073|       |    /* bits = 7..1 because we know at least one bit is set already */
 1074|       |    /* Note: This could do a binary search, but this is faster for keys if we
 1075|       |     * assume that good keys will have the MSB set. */
 1076|  46.4k|    for (bits = 7; bits > 0; --bits) {
  ------------------
  |  Branch (1076:20): [True: 45.3k, False: 1.09k]
  ------------------
 1077|  45.3k|        if (*p & (1 << bits)) {
  ------------------
  |  Branch (1077:13): [True: 17.3k, False: 28.0k]
  ------------------
 1078|  17.3k|            break;
 1079|  17.3k|        }
 1080|  45.3k|    }
 1081|  18.4k|    return octets * 8 + bits - 7;
 1082|  18.4k|}
SECKEY_PublicKeyStrength:
 1087|    624|{
 1088|    624|    return (SECKEY_PublicKeyStrengthInBits(pubk) + 7) / 8;
 1089|    624|}
SECKEY_PublicKeyStrengthInBits:
 1094|  10.5k|{
 1095|  10.5k|    unsigned bitSize = 0;
 1096|       |
 1097|  10.5k|    if (!pubk) {
  ------------------
  |  Branch (1097:9): [True: 0, False: 10.5k]
  ------------------
 1098|      0|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1099|      0|        return 0;
 1100|      0|    }
 1101|       |
 1102|       |    /* interpret modulus length as key strength */
 1103|  10.5k|    switch (pubk->keyType) {
 1104|  6.36k|        case rsaKey:
  ------------------
  |  Branch (1104:9): [True: 6.36k, False: 4.17k]
  ------------------
 1105|  6.36k|            bitSize = SECKEY_BigIntegerBitLength(&pubk->u.rsa.modulus);
 1106|  6.36k|            break;
 1107|    945|        case dsaKey:
  ------------------
  |  Branch (1107:9): [True: 945, False: 9.59k]
  ------------------
 1108|    945|            bitSize = SECKEY_BigIntegerBitLength(&pubk->u.dsa.params.prime);
 1109|    945|            break;
 1110|  1.44k|        case dhKey:
  ------------------
  |  Branch (1110:9): [True: 1.44k, False: 9.09k]
  ------------------
 1111|  1.44k|            bitSize = SECKEY_BigIntegerBitLength(&pubk->u.dh.prime);
 1112|  1.44k|            break;
 1113|  1.78k|        case ecKey:
  ------------------
  |  Branch (1113:9): [True: 1.78k, False: 8.75k]
  ------------------
 1114|  1.78k|        case edKey:
  ------------------
  |  Branch (1114:9): [True: 0, False: 10.5k]
  ------------------
 1115|  1.78k|        case ecMontKey:
  ------------------
  |  Branch (1115:9): [True: 0, False: 10.5k]
  ------------------
 1116|  1.78k|            bitSize = SECKEY_ECParamsToKeySize(&pubk->u.ec.DEREncodedParams);
 1117|  1.78k|            break;
 1118|      0|        default:
  ------------------
  |  Branch (1118:9): [True: 0, False: 10.5k]
  ------------------
 1119|      0|            PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1120|      0|            break;
 1121|  10.5k|    }
 1122|  10.5k|    return bitSize;
 1123|  10.5k|}
SECKEY_SignatureLen:
 1190|  1.28k|{
 1191|  1.28k|    unsigned size;
 1192|       |
 1193|  1.28k|    switch (pubk->keyType) {
 1194|      0|        case rsaKey:
  ------------------
  |  Branch (1194:9): [True: 0, False: 1.28k]
  ------------------
 1195|      0|        case rsaPssKey:
  ------------------
  |  Branch (1195:9): [True: 0, False: 1.28k]
  ------------------
 1196|      0|            if (pubk->u.rsa.modulus.len == 0) {
  ------------------
  |  Branch (1196:17): [True: 0, False: 0]
  ------------------
 1197|      0|                return 0;
 1198|      0|            }
 1199|      0|            if (pubk->u.rsa.modulus.data[0] == 0) {
  ------------------
  |  Branch (1199:17): [True: 0, False: 0]
  ------------------
 1200|      0|                return pubk->u.rsa.modulus.len - 1;
 1201|      0|            }
 1202|      0|            return pubk->u.rsa.modulus.len;
 1203|    921|        case dsaKey:
  ------------------
  |  Branch (1203:9): [True: 921, False: 360]
  ------------------
 1204|    921|            return pubk->u.dsa.params.subPrime.len * 2;
 1205|    360|        case ecKey:
  ------------------
  |  Branch (1205:9): [True: 360, False: 921]
  ------------------
 1206|    360|        case edKey:
  ------------------
  |  Branch (1206:9): [True: 0, False: 1.28k]
  ------------------
 1207|    360|        case ecMontKey:
  ------------------
  |  Branch (1207:9): [True: 0, False: 1.28k]
  ------------------
 1208|       |            /* Get the base point order length in bits and adjust */
 1209|    360|            size = SECKEY_ECParamsToBasePointOrderLen(
 1210|    360|                &pubk->u.ec.DEREncodedParams);
 1211|    360|            return ((size + 7) / 8) * 2;
 1212|      0|        default:
  ------------------
  |  Branch (1212:9): [True: 0, False: 1.28k]
  ------------------
 1213|      0|            break;
 1214|  1.28k|    }
 1215|      0|    PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1216|      0|    return 0;
 1217|  1.28k|}
SECKEY_CopyPublicKey:
 1268|    854|{
 1269|    854|    SECKEYPublicKey *copyk;
 1270|    854|    PLArenaPool *arena;
 1271|    854|    SECStatus rv = SECSuccess;
 1272|       |
 1273|    854|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|    854|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|    854|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 1274|    854|    if (arena == NULL) {
  ------------------
  |  Branch (1274:9): [True: 0, False: 854]
  ------------------
 1275|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1276|      0|        return NULL;
 1277|      0|    }
 1278|       |
 1279|    854|    copyk = (SECKEYPublicKey *)PORT_ArenaZAlloc(arena, sizeof(SECKEYPublicKey));
  ------------------
  |  |   59|    854|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
 1280|    854|    if (!copyk) {
  ------------------
  |  Branch (1280:9): [True: 0, False: 854]
  ------------------
 1281|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1282|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1283|      0|        return NULL;
 1284|      0|    }
 1285|       |
 1286|    854|    copyk->arena = arena;
 1287|    854|    copyk->keyType = pubk->keyType;
 1288|    854|    if (pubk->pkcs11Slot &&
  ------------------
  |  Branch (1288:9): [True: 0, False: 854]
  ------------------
 1289|    854|        PK11_IsPermObject(pubk->pkcs11Slot, pubk->pkcs11ID)) {
  ------------------
  |  Branch (1289:9): [True: 0, False: 0]
  ------------------
 1290|      0|        copyk->pkcs11Slot = PK11_ReferenceSlot(pubk->pkcs11Slot);
 1291|      0|        copyk->pkcs11ID = pubk->pkcs11ID;
 1292|    854|    } else {
 1293|    854|        copyk->pkcs11Slot = NULL; /* go get own reference */
 1294|    854|        copyk->pkcs11ID = CK_INVALID_HANDLE;
  ------------------
  |  |   78|    854|#define CK_INVALID_HANDLE 0
  ------------------
 1295|    854|    }
 1296|    854|    switch (pubk->keyType) {
 1297|    624|        case rsaKey:
  ------------------
  |  Branch (1297:9): [True: 624, False: 230]
  ------------------
 1298|    624|            rv = SECITEM_CopyItem(arena, &copyk->u.rsa.modulus,
  ------------------
  |  |  106|    624|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1299|    624|                                  &pubk->u.rsa.modulus);
 1300|    624|            if (rv == SECSuccess) {
  ------------------
  |  Branch (1300:17): [True: 624, False: 0]
  ------------------
 1301|    624|                rv = SECITEM_CopyItem(arena, &copyk->u.rsa.publicExponent,
  ------------------
  |  |  106|    624|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1302|    624|                                      &pubk->u.rsa.publicExponent);
 1303|    624|                if (rv == SECSuccess)
  ------------------
  |  Branch (1303:21): [True: 624, False: 0]
  ------------------
 1304|    624|                    return copyk;
 1305|    624|            }
 1306|      0|            break;
 1307|      0|        case dsaKey:
  ------------------
  |  Branch (1307:9): [True: 0, False: 854]
  ------------------
 1308|      0|            rv = SECITEM_CopyItem(arena, &copyk->u.dsa.publicValue,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1309|      0|                                  &pubk->u.dsa.publicValue);
 1310|      0|            if (rv != SECSuccess)
  ------------------
  |  Branch (1310:17): [True: 0, False: 0]
  ------------------
 1311|      0|                break;
 1312|      0|            rv = SECITEM_CopyItem(arena, &copyk->u.dsa.params.prime,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1313|      0|                                  &pubk->u.dsa.params.prime);
 1314|      0|            if (rv != SECSuccess)
  ------------------
  |  Branch (1314:17): [True: 0, False: 0]
  ------------------
 1315|      0|                break;
 1316|      0|            rv = SECITEM_CopyItem(arena, &copyk->u.dsa.params.subPrime,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1317|      0|                                  &pubk->u.dsa.params.subPrime);
 1318|      0|            if (rv != SECSuccess)
  ------------------
  |  Branch (1318:17): [True: 0, False: 0]
  ------------------
 1319|      0|                break;
 1320|      0|            rv = SECITEM_CopyItem(arena, &copyk->u.dsa.params.base,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1321|      0|                                  &pubk->u.dsa.params.base);
 1322|      0|            break;
 1323|      0|        case dhKey:
  ------------------
  |  Branch (1323:9): [True: 0, False: 854]
  ------------------
 1324|      0|            rv = SECITEM_CopyItem(arena, &copyk->u.dh.prime, &pubk->u.dh.prime);
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1325|      0|            if (rv != SECSuccess)
  ------------------
  |  Branch (1325:17): [True: 0, False: 0]
  ------------------
 1326|      0|                break;
 1327|      0|            rv = SECITEM_CopyItem(arena, &copyk->u.dh.base, &pubk->u.dh.base);
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1328|      0|            if (rv != SECSuccess)
  ------------------
  |  Branch (1328:17): [True: 0, False: 0]
  ------------------
 1329|      0|                break;
 1330|      0|            rv = SECITEM_CopyItem(arena, &copyk->u.dh.publicValue,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1331|      0|                                  &pubk->u.dh.publicValue);
 1332|      0|            break;
 1333|    230|        case ecKey:
  ------------------
  |  Branch (1333:9): [True: 230, False: 624]
  ------------------
 1334|    230|        case edKey:
  ------------------
  |  Branch (1334:9): [True: 0, False: 854]
  ------------------
 1335|    230|        case ecMontKey:
  ------------------
  |  Branch (1335:9): [True: 0, False: 854]
  ------------------
 1336|    230|            copyk->u.ec.size = pubk->u.ec.size;
 1337|    230|            rv = seckey_HasCurveOID(pubk);
 1338|    230|            if (rv != SECSuccess) {
  ------------------
  |  Branch (1338:17): [True: 0, False: 230]
  ------------------
 1339|      0|                break;
 1340|      0|            }
 1341|    230|            rv = SECITEM_CopyItem(arena, &copyk->u.ec.DEREncodedParams,
  ------------------
  |  |  106|    230|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1342|    230|                                  &pubk->u.ec.DEREncodedParams);
 1343|    230|            if (rv != SECSuccess) {
  ------------------
  |  Branch (1343:17): [True: 0, False: 230]
  ------------------
 1344|      0|                break;
 1345|      0|            }
 1346|    230|            copyk->u.ec.encoding = ECPoint_Undefined;
 1347|    230|            rv = SECITEM_CopyItem(arena, &copyk->u.ec.publicValue,
  ------------------
  |  |  106|    230|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1348|    230|                                  &pubk->u.ec.publicValue);
 1349|    230|            break;
 1350|      0|        case nullKey:
  ------------------
  |  Branch (1350:9): [True: 0, False: 854]
  ------------------
 1351|      0|            return copyk;
 1352|      0|        case kyberKey:
  ------------------
  |  Branch (1352:9): [True: 0, False: 854]
  ------------------
 1353|      0|            copyk->u.kyber.params = pubk->u.kyber.params;
 1354|      0|            rv = SECITEM_CopyItem(arena, &copyk->u.kyber.publicValue,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 1355|      0|                                  &pubk->u.kyber.publicValue);
 1356|      0|            break;
 1357|      0|        default:
  ------------------
  |  Branch (1357:9): [True: 0, False: 854]
  ------------------
 1358|      0|            PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1359|      0|            rv = SECFailure;
 1360|      0|            break;
 1361|    854|    }
 1362|    230|    if (rv == SECSuccess)
  ------------------
  |  Branch (1362:9): [True: 230, False: 0]
  ------------------
 1363|    230|        return copyk;
 1364|       |
 1365|      0|    SECKEY_DestroyPublicKey(copyk);
 1366|      0|    return NULL;
 1367|    230|}
SECKEY_EnforceKeySize:
 1375|    854|{
 1376|    854|    PRInt32 opt = -1;
 1377|    854|    PRInt32 optVal;
 1378|    854|    SECStatus rv;
 1379|       |
 1380|    854|    switch (keyType) {
 1381|    624|        case rsaKey:
  ------------------
  |  Branch (1381:9): [True: 624, False: 230]
  ------------------
 1382|    624|        case rsaPssKey:
  ------------------
  |  Branch (1382:9): [True: 0, False: 854]
  ------------------
 1383|    624|        case rsaOaepKey:
  ------------------
  |  Branch (1383:9): [True: 0, False: 854]
  ------------------
 1384|    624|            opt = NSS_RSA_MIN_KEY_SIZE;
  ------------------
  |  |  286|    624|#define NSS_RSA_MIN_KEY_SIZE 0x001
  ------------------
 1385|    624|            break;
 1386|      0|        case dsaKey:
  ------------------
  |  Branch (1386:9): [True: 0, False: 854]
  ------------------
 1387|      0|        case fortezzaKey:
  ------------------
  |  Branch (1387:9): [True: 0, False: 854]
  ------------------
 1388|      0|            opt = NSS_DSA_MIN_KEY_SIZE;
  ------------------
  |  |  288|      0|#define NSS_DSA_MIN_KEY_SIZE 0x004
  ------------------
 1389|      0|            break;
 1390|      0|        case dhKey:
  ------------------
  |  Branch (1390:9): [True: 0, False: 854]
  ------------------
 1391|      0|        case keaKey:
  ------------------
  |  Branch (1391:9): [True: 0, False: 854]
  ------------------
 1392|      0|            opt = NSS_DH_MIN_KEY_SIZE;
  ------------------
  |  |  287|      0|#define NSS_DH_MIN_KEY_SIZE 0x002
  ------------------
 1393|      0|            break;
 1394|    230|        case ecKey:
  ------------------
  |  Branch (1394:9): [True: 230, False: 624]
  ------------------
 1395|    230|            opt = NSS_ECC_MIN_KEY_SIZE;
  ------------------
  |  |  327|    230|#define NSS_ECC_MIN_KEY_SIZE 0x011
  ------------------
 1396|    230|            break;
 1397|      0|        case nullKey:
  ------------------
  |  Branch (1397:9): [True: 0, False: 854]
  ------------------
 1398|      0|        default:
  ------------------
  |  Branch (1398:9): [True: 0, False: 854]
  ------------------
 1399|      0|            PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1400|      0|            return SECFailure;
 1401|    854|    }
 1402|    854|    PORT_Assert(opt != -1);
  ------------------
  |  |  120|    854|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    854|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 854, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1403|    854|    rv = NSS_OptionGet(opt, &optVal);
 1404|    854|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1404:9): [True: 0, False: 854]
  ------------------
 1405|      0|        return rv;
 1406|      0|    }
 1407|    854|    if (optVal > keyLength) {
  ------------------
  |  Branch (1407:9): [True: 0, False: 854]
  ------------------
 1408|      0|        PORT_SetError(error);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1409|      0|        return SECFailure;
 1410|      0|    }
 1411|    854|    return SECSuccess;
 1412|    854|}
SECKEY_GetPublicKeyType:
 2065|  10.3k|{
 2066|  10.3k|    return pubKey->keyType;
 2067|  10.3k|}
seckey.c:seckey_UpdateCertPQGChain:
  334|  5.13k|{
  335|  5.13k|    SECStatus rv;
  336|  5.13k|    SECOidData *oid = NULL;
  337|  5.13k|    int tag;
  338|  5.13k|    CERTSubjectPublicKeyInfo *subjectSpki = NULL;
  339|  5.13k|    CERTSubjectPublicKeyInfo *issuerSpki = NULL;
  340|  5.13k|    CERTCertificate *issuerCert = NULL;
  341|       |
  342|       |    /* increment cert chain length counter*/
  343|  5.13k|    count++;
  344|       |
  345|       |    /* check if cert chain length exceeds the maximum length*/
  346|  5.13k|    if (count > CERT_MAX_CERT_CHAIN) {
  ------------------
  |  |  610|  5.13k|#define CERT_MAX_CERT_CHAIN 20
  ------------------
  |  Branch (346:9): [True: 0, False: 5.13k]
  ------------------
  347|      0|        return SECFailure;
  348|      0|    }
  349|       |
  350|  5.13k|    oid = SECOID_FindOID(&subjectCert->subjectPublicKeyInfo.algorithm.algorithm);
  ------------------
  |  |  115|  5.13k|#define SECOID_FindOID SECOID_FindOID_Util
  ------------------
  351|  5.13k|    if (oid != NULL) {
  ------------------
  |  Branch (351:9): [True: 4.99k, False: 135]
  ------------------
  352|  4.99k|        tag = oid->offset;
  353|       |
  354|       |        /* Check if cert has a DSA or EC public key. If not, return
  355|       |         * success since no PQG params need to be updated.
  356|       |         *
  357|       |         * Question: do we really need to do this for EC keys. They don't have
  358|       |         * PQG parameters, but they do have parameters. The question is does
  359|       |         * the child cert inherit those parameters for EC from the parent, or
  360|       |         * do we always include those parameters in each cert.
  361|       |         */
  362|       |
  363|  4.99k|        if ((tag != SEC_OID_ANSIX9_DSA_SIGNATURE) &&
  ------------------
  |  Branch (363:13): [True: 4.04k, False: 946]
  ------------------
  364|  4.99k|            (tag != SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST) &&
  ------------------
  |  Branch (364:13): [True: 4.04k, False: 1]
  ------------------
  365|  4.99k|            (tag != SEC_OID_NIST_DSA_SIGNATURE_WITH_SHA224_DIGEST) &&
  ------------------
  |  Branch (365:13): [True: 4.04k, False: 1]
  ------------------
  366|  4.99k|            (tag != SEC_OID_NIST_DSA_SIGNATURE_WITH_SHA256_DIGEST) &&
  ------------------
  |  Branch (366:13): [True: 4.04k, False: 1]
  ------------------
  367|  4.99k|            (tag != SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST) &&
  ------------------
  |  Branch (367:13): [True: 4.04k, False: 0]
  ------------------
  368|  4.99k|            (tag != SEC_OID_SDN702_DSA_SIGNATURE) &&
  ------------------
  |  Branch (368:13): [True: 4.04k, False: 0]
  ------------------
  369|  4.99k|            (tag != SEC_OID_ED25519_PUBLIC_KEY) &&
  ------------------
  |  Branch (369:13): [True: 4.04k, False: 0]
  ------------------
  370|  4.99k|            (tag != SEC_OID_ANSIX962_EC_PUBLIC_KEY)) {
  ------------------
  |  Branch (370:13): [True: 3.00k, False: 1.04k]
  ------------------
  371|       |
  372|  3.00k|            return SECSuccess;
  373|  3.00k|        }
  374|  4.99k|    } else {
  375|    135|        return SECFailure; /* return failure if oid is NULL */
  376|    135|    }
  377|       |
  378|       |    /* if cert has PQG parameters, return success */
  379|       |
  380|  1.99k|    subjectSpki = &subjectCert->subjectPublicKeyInfo;
  381|       |
  382|  1.99k|    if (subjectSpki->algorithm.parameters.len != 0) {
  ------------------
  |  Branch (382:9): [True: 1.99k, False: 0]
  ------------------
  383|  1.99k|        return SECSuccess;
  384|  1.99k|    }
  385|       |
  386|       |    /* check if the cert is self-signed */
  387|      0|    if (subjectCert->isRoot) {
  ------------------
  |  Branch (387:9): [True: 0, False: 0]
  ------------------
  388|       |        /* fail since cert is self-signed and has no pqg params. */
  389|      0|        return SECFailure;
  390|      0|    }
  391|       |
  392|       |    /* get issuer cert */
  393|      0|    issuerCert = CERT_FindCertIssuer(subjectCert, PR_Now(), certUsageAnyCA);
  394|      0|    if (!issuerCert) {
  ------------------
  |  Branch (394:9): [True: 0, False: 0]
  ------------------
  395|      0|        return SECFailure;
  396|      0|    }
  397|       |
  398|       |    /* if parent is not DSA, return failure since
  399|       |       we don't allow this case. */
  400|       |
  401|      0|    oid = SECOID_FindOID(&issuerCert->subjectPublicKeyInfo.algorithm.algorithm);
  ------------------
  |  |  115|      0|#define SECOID_FindOID SECOID_FindOID_Util
  ------------------
  402|      0|    if (oid != NULL) {
  ------------------
  |  Branch (402:9): [True: 0, False: 0]
  ------------------
  403|      0|        tag = oid->offset;
  404|       |
  405|       |        /* Check if issuer cert has a DSA public key. If not,
  406|       |         * return failure.   */
  407|       |
  408|      0|        if ((tag != SEC_OID_ANSIX9_DSA_SIGNATURE) &&
  ------------------
  |  Branch (408:13): [True: 0, False: 0]
  ------------------
  409|      0|            (tag != SEC_OID_ANSIX9_DSA_SIGNATURE_WITH_SHA1_DIGEST) &&
  ------------------
  |  Branch (409:13): [True: 0, False: 0]
  ------------------
  410|      0|            (tag != SEC_OID_NIST_DSA_SIGNATURE_WITH_SHA224_DIGEST) &&
  ------------------
  |  Branch (410:13): [True: 0, False: 0]
  ------------------
  411|      0|            (tag != SEC_OID_NIST_DSA_SIGNATURE_WITH_SHA256_DIGEST) &&
  ------------------
  |  Branch (411:13): [True: 0, False: 0]
  ------------------
  412|      0|            (tag != SEC_OID_BOGUS_DSA_SIGNATURE_WITH_SHA1_DIGEST) &&
  ------------------
  |  Branch (412:13): [True: 0, False: 0]
  ------------------
  413|      0|            (tag != SEC_OID_SDN702_DSA_SIGNATURE) &&
  ------------------
  |  Branch (413:13): [True: 0, False: 0]
  ------------------
  414|      0|            (tag != SEC_OID_ED25519_PUBLIC_KEY) &&
  ------------------
  |  Branch (414:13): [True: 0, False: 0]
  ------------------
  415|      0|            (tag != SEC_OID_ANSIX962_EC_PUBLIC_KEY)) {
  ------------------
  |  Branch (415:13): [True: 0, False: 0]
  ------------------
  416|      0|            rv = SECFailure;
  417|      0|            goto loser;
  418|      0|        }
  419|      0|    } else {
  420|      0|        rv = SECFailure; /* return failure if oid is NULL */
  421|      0|        goto loser;
  422|      0|    }
  423|       |
  424|       |    /* at this point the subject cert has no pqg parameters and the
  425|       |     * issuer cert has a DSA public key.  Update the issuer's
  426|       |     * pqg parameters with a recursive call to this same function. */
  427|       |
  428|      0|    rv = seckey_UpdateCertPQGChain(issuerCert, count);
  429|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (429:9): [True: 0, False: 0]
  ------------------
  430|      0|        rv = SECFailure;
  431|      0|        goto loser;
  432|      0|    }
  433|       |
  434|       |    /* ensure issuer has pqg parameters */
  435|       |
  436|      0|    issuerSpki = &issuerCert->subjectPublicKeyInfo;
  437|      0|    if (issuerSpki->algorithm.parameters.len == 0) {
  ------------------
  |  Branch (437:9): [True: 0, False: 0]
  ------------------
  438|      0|        rv = SECFailure;
  439|      0|    }
  440|       |
  441|       |    /* if update was successful and pqg params present, then copy the
  442|       |     * parameters to the subject cert's key. */
  443|       |
  444|      0|    if (rv == SECSuccess) {
  ------------------
  |  Branch (444:9): [True: 0, False: 0]
  ------------------
  445|      0|        rv = SECITEM_CopyItem(subjectCert->arena,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  446|      0|                              &subjectSpki->algorithm.parameters,
  447|      0|                              &issuerSpki->algorithm.parameters);
  448|      0|    }
  449|       |
  450|      0|loser:
  451|      0|    if (issuerCert) {
  ------------------
  |  Branch (451:9): [True: 0, False: 0]
  ------------------
  452|      0|        CERT_DestroyCertificate(issuerCert);
  453|      0|    }
  454|      0|    return rv;
  455|      0|}
seckey.c:seckey_ExtractPublicKey:
  598|  9.40k|{
  599|  9.40k|    SECKEYPublicKey *pubk;
  600|  9.40k|    SECItem os, newOs, newParms;
  601|  9.40k|    SECStatus rv;
  602|  9.40k|    PLArenaPool *arena;
  603|  9.40k|    SECOidTag tag;
  604|       |
  605|  9.40k|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  9.40k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  9.40k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  606|  9.40k|    if (arena == NULL)
  ------------------
  |  Branch (606:9): [True: 0, False: 9.40k]
  ------------------
  607|      0|        return NULL;
  608|       |
  609|  9.40k|    pubk = (SECKEYPublicKey *)PORT_ArenaZAlloc(arena, sizeof(SECKEYPublicKey));
  ------------------
  |  |   59|  9.40k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  610|  9.40k|    if (pubk == NULL) {
  ------------------
  |  Branch (610:9): [True: 0, False: 9.40k]
  ------------------
  611|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  612|      0|        return NULL;
  613|      0|    }
  614|       |
  615|  9.40k|    pubk->arena = arena;
  616|  9.40k|    pubk->pkcs11Slot = 0;
  617|  9.40k|    pubk->pkcs11ID = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  9.40k|#define CK_INVALID_HANDLE 0
  ------------------
  618|       |
  619|       |    /* Convert bit string length from bits to bytes */
  620|  9.40k|    os = spki->subjectPublicKey;
  621|  9.40k|    DER_ConvertBitString(&os);
  ------------------
  |  |  125|  9.40k|    {                                         \
  |  |  126|  9.40k|        (item)->len = ((item)->len + 7) >> 3; \
  |  |  127|  9.40k|    }
  ------------------
  622|       |
  623|  9.40k|    tag = SECOID_GetAlgorithmTag(&spki->algorithm);
  ------------------
  |  |  119|  9.40k|#define SECOID_GetAlgorithmTag SECOID_GetAlgorithmTag_Util
  ------------------
  624|       |
  625|       |    /* copy the DER into the arena, since Quick DER returns data that points
  626|       |       into the DER input, which may get freed by the caller */
  627|  9.40k|    rv = SECITEM_CopyItem(arena, &newOs, &os);
  ------------------
  |  |  106|  9.40k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  628|  9.40k|    if (rv == SECSuccess)
  ------------------
  |  Branch (628:9): [True: 9.40k, False: 0]
  ------------------
  629|  9.40k|        switch (tag) {
  630|      0|            case SEC_OID_X500_RSA_ENCRYPTION:
  ------------------
  |  Branch (630:13): [True: 0, False: 9.40k]
  ------------------
  631|  5.75k|            case SEC_OID_PKCS1_RSA_ENCRYPTION:
  ------------------
  |  Branch (631:13): [True: 5.75k, False: 3.65k]
  ------------------
  632|  5.80k|            case SEC_OID_PKCS1_RSA_PSS_SIGNATURE:
  ------------------
  |  Branch (632:13): [True: 50, False: 9.35k]
  ------------------
  633|  5.80k|                pubk->keyType = rsaKey;
  634|  5.80k|                prepare_rsa_pub_key_for_asn1(pubk);
  635|  5.80k|                rv = SEC_QuickDERDecodeItem(arena, pubk, SECKEY_RSAPublicKeyTemplate, &newOs);
  ------------------
  |  |  102|  5.80k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  636|  5.80k|                if (rv == SECSuccess)
  ------------------
  |  Branch (636:21): [True: 5.79k, False: 11]
  ------------------
  637|  5.79k|                    return pubk;
  638|     11|                break;
  639|  1.87k|            case SEC_OID_ANSIX9_DSA_SIGNATURE:
  ------------------
  |  Branch (639:13): [True: 1.87k, False: 7.53k]
  ------------------
  640|  1.87k|            case SEC_OID_SDN702_DSA_SIGNATURE:
  ------------------
  |  Branch (640:13): [True: 0, False: 9.40k]
  ------------------
  641|  1.87k|                pubk->keyType = dsaKey;
  642|  1.87k|                prepare_dsa_pub_key_for_asn1(pubk);
  643|  1.87k|                rv = SEC_QuickDERDecodeItem(arena, pubk, SECKEY_DSAPublicKeyTemplate, &newOs);
  ------------------
  |  |  102|  1.87k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  644|  1.87k|                if (rv != SECSuccess)
  ------------------
  |  Branch (644:21): [True: 1, False: 1.87k]
  ------------------
  645|      1|                    break;
  646|       |
  647|  1.87k|                rv = seckey_DSADecodePQG(arena, pubk,
  648|  1.87k|                                         &spki->algorithm.parameters);
  649|       |
  650|  1.87k|                if (rv == SECSuccess)
  ------------------
  |  Branch (650:21): [True: 1.86k, False: 9]
  ------------------
  651|  1.86k|                    return pubk;
  652|      9|                break;
  653|     37|            case SEC_OID_X942_DIFFIE_HELMAN_KEY:
  ------------------
  |  Branch (653:13): [True: 37, False: 9.37k]
  ------------------
  654|     37|                pubk->keyType = dhKey;
  655|     37|                prepare_dh_pub_key_for_asn1(pubk);
  656|     37|                rv = SEC_QuickDERDecodeItem(arena, pubk, SECKEY_DHPublicKeyTemplate, &newOs);
  ------------------
  |  |  102|     37|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  657|     37|                if (rv != SECSuccess)
  ------------------
  |  Branch (657:21): [True: 18, False: 19]
  ------------------
  658|     18|                    break;
  659|       |
  660|       |                /* copy the DER into the arena, since Quick DER returns data that points
  661|       |                   into the DER input, which may get freed by the caller */
  662|     19|                rv = SECITEM_CopyItem(arena, &newParms, &spki->algorithm.parameters);
  ------------------
  |  |  106|     19|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  663|     19|                if (rv != SECSuccess)
  ------------------
  |  Branch (663:21): [True: 0, False: 19]
  ------------------
  664|      0|                    break;
  665|       |
  666|     19|                rv = SEC_QuickDERDecodeItem(arena, pubk, SECKEY_DHParamKeyTemplate,
  ------------------
  |  |  102|     19|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  667|     19|                                            &newParms);
  668|       |
  669|     19|                if (rv == SECSuccess)
  ------------------
  |  Branch (669:21): [True: 18, False: 1]
  ------------------
  670|     18|                    return pubk;
  671|      1|                break;
  672|      1|            case SEC_OID_X25519:
  ------------------
  |  Branch (672:13): [True: 0, False: 9.40k]
  ------------------
  673|      0|            case SEC_OID_ED25519_PUBLIC_KEY:
  ------------------
  |  Branch (673:13): [True: 0, False: 9.40k]
  ------------------
  674|       |                /* A basic consistency check on inputs. */
  675|      0|                if (newOs.len == 0) {
  ------------------
  |  Branch (675:21): [True: 0, False: 0]
  ------------------
  676|      0|                    PORT_SetError(SEC_ERROR_INPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  677|      0|                    break;
  678|      0|                }
  679|       |
  680|       |                /* Currently supporting only (Pure)Ed25519 .*/
  681|      0|                if (spki->algorithm.parameters.len != 0) {
  ------------------
  |  Branch (681:21): [True: 0, False: 0]
  ------------------
  682|      0|                    PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  683|      0|                    break;
  684|      0|                }
  685|       |
  686|       |                /* edKey corresponds to Ed25519 mechanism.
  687|       |                 * ecMontKey corresponds to X25519 mechanism.
  688|       |                 * The other options are not supported. */
  689|      0|                if (tag == SEC_OID_X25519) {
  ------------------
  |  Branch (689:21): [True: 0, False: 0]
  ------------------
  690|      0|                    pubk->keyType = ecMontKey;
  691|      0|                } else {
  692|       |                    /* tag == SEC_OID_ED25519_PUBLIC_KEY */
  693|      0|                    pubk->keyType = edKey;
  694|      0|                }
  695|       |
  696|      0|                pubk->u.ec.size = 0;
  697|       |
  698|      0|                SECOidData *oid25519 = SECOID_FindOIDByTag(tag);
  ------------------
  |  |  116|      0|#define SECOID_FindOIDByTag SECOID_FindOIDByTag_Util
  ------------------
  699|      0|                if (!oid25519) {
  ------------------
  |  Branch (699:21): [True: 0, False: 0]
  ------------------
  700|      0|                    break;
  701|      0|                }
  702|       |
  703|      0|                if (!SECITEM_AllocItem(arena, &pubk->u.ec.DEREncodedParams, oid25519->oid.len + 2)) {
  ------------------
  |  |  103|      0|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  |  Branch (703:21): [True: 0, False: 0]
  ------------------
  704|      0|                    break;
  705|      0|                }
  706|      0|                pubk->u.ec.DEREncodedParams.data[0] = SEC_ASN1_OBJECT_ID;
  ------------------
  |  |   82|      0|#define SEC_ASN1_OBJECT_ID 0x06
  ------------------
  707|      0|                pubk->u.ec.DEREncodedParams.data[1] = oid25519->oid.len;
  708|      0|                PORT_Memcpy(pubk->u.ec.DEREncodedParams.data + 2, oid25519->oid.data, oid25519->oid.len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  709|       |
  710|      0|                rv = SECITEM_CopyItem(arena, &pubk->u.ec.publicValue, &newOs);
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  711|      0|                if (rv != SECSuccess) {
  ------------------
  |  Branch (711:21): [True: 0, False: 0]
  ------------------
  712|      0|                    break;
  713|      0|                }
  714|      0|                return pubk;
  715|  1.54k|            case SEC_OID_ANSIX962_EC_PUBLIC_KEY:
  ------------------
  |  Branch (715:13): [True: 1.54k, False: 7.85k]
  ------------------
  716|       |                /* A basic sanity check on inputs. */
  717|  1.54k|                if (spki->algorithm.parameters.len == 0 || newOs.len == 0) {
  ------------------
  |  Branch (717:21): [True: 0, False: 1.54k]
  |  Branch (717:60): [True: 0, False: 1.54k]
  ------------------
  718|      0|                    PORT_SetError(SEC_ERROR_INPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  719|      0|                    break;
  720|      0|                }
  721|  1.54k|                pubk->keyType = ecKey;
  722|  1.54k|                pubk->u.ec.size = 0;
  723|       |
  724|       |                /* Since PKCS#11 directly takes the DER encoding of EC params
  725|       |                 * and public value, we don't need any decoding here.
  726|       |                 */
  727|  1.54k|                rv = SECITEM_CopyItem(arena, &pubk->u.ec.DEREncodedParams,
  ------------------
  |  |  106|  1.54k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  728|  1.54k|                                      &spki->algorithm.parameters);
  729|  1.54k|                if (rv != SECSuccess) {
  ------------------
  |  Branch (729:21): [True: 0, False: 1.54k]
  ------------------
  730|      0|                    break;
  731|      0|                }
  732|  1.54k|                rv = SECITEM_CopyItem(arena, &pubk->u.ec.publicValue, &newOs);
  ------------------
  |  |  106|  1.54k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  733|  1.54k|                if (rv != SECSuccess) {
  ------------------
  |  Branch (733:21): [True: 0, False: 1.54k]
  ------------------
  734|      0|                    break;
  735|      0|                }
  736|  1.54k|                pubk->u.ec.encoding = ECPoint_Undefined;
  737|  1.54k|                rv = seckey_HasCurveOID(pubk);
  738|  1.54k|                if (rv == SECSuccess) {
  ------------------
  |  Branch (738:21): [True: 1.53k, False: 18]
  ------------------
  739|  1.53k|                    return pubk;
  740|  1.53k|                }
  741|     18|                break;
  742|       |
  743|    148|            default:
  ------------------
  |  Branch (743:13): [True: 148, False: 9.25k]
  ------------------
  744|    148|                PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG);
  ------------------
  |  |   65|    148|#define PORT_SetError PORT_SetError_Util
  ------------------
  745|    148|                break;
  746|  9.40k|        }
  747|       |
  748|    206|    SECKEY_DestroyPublicKey(pubk);
  749|    206|    return NULL;
  750|  9.40k|}
seckey.c:seckey_DSADecodePQG:
  475|  1.87k|{
  476|  1.87k|    SECStatus rv;
  477|  1.87k|    SECItem newparams;
  478|       |
  479|  1.87k|    if (params == NULL)
  ------------------
  |  Branch (479:9): [True: 0, False: 1.87k]
  ------------------
  480|      0|        return SECFailure;
  481|       |
  482|  1.87k|    if (params->data == NULL)
  ------------------
  |  Branch (482:9): [True: 0, False: 1.87k]
  ------------------
  483|      0|        return SECFailure;
  484|       |
  485|  1.87k|    PORT_Assert(arena);
  ------------------
  |  |  120|  1.87k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.87k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.87k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  486|       |
  487|       |    /* make a copy of the data into the arena so QuickDER output is valid */
  488|  1.87k|    rv = SECITEM_CopyItem(arena, &newparams, params);
  ------------------
  |  |  106|  1.87k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  489|       |
  490|       |    /* Check if params use the standard format.
  491|       |     * The value 0xa1 will appear in the first byte of the parameter data
  492|       |     * if the PQG parameters are not using the standard format.  This
  493|       |     * code should be changed to use a better method to detect non-standard
  494|       |     * parameters.    */
  495|       |
  496|  1.87k|    if ((newparams.data[0] != 0xa1) &&
  ------------------
  |  Branch (496:9): [True: 1.87k, False: 1]
  ------------------
  497|  1.87k|        (newparams.data[0] != 0xa0)) {
  ------------------
  |  Branch (497:9): [True: 1.87k, False: 1]
  ------------------
  498|       |
  499|  1.87k|        if (SECSuccess == rv) {
  ------------------
  |  Branch (499:13): [True: 1.87k, False: 0]
  ------------------
  500|       |            /* PQG params are in the standard format */
  501|  1.87k|            prepare_pqg_params_for_asn1(&pubk->u.dsa.params);
  502|  1.87k|            rv = SEC_QuickDERDecodeItem(arena, &pubk->u.dsa.params,
  ------------------
  |  |  102|  1.87k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  503|  1.87k|                                        SECKEY_PQGParamsTemplate,
  504|  1.87k|                                        &newparams);
  505|  1.87k|        }
  506|  1.87k|    } else {
  507|       |
  508|      2|        if (SECSuccess == rv) {
  ------------------
  |  Branch (508:13): [True: 2, False: 0]
  ------------------
  509|       |            /* else the old fortezza-only wrapped format is used. */
  510|      2|            PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
  511|      2|            rv = SECFailure;
  512|      2|        }
  513|      2|    }
  514|  1.87k|    return rv;
  515|  1.87k|}
seckey.c:prepare_pqg_params_for_asn1:
  129|  1.87k|{
  130|  1.87k|    params->prime.type = siUnsignedInteger;
  131|  1.87k|    params->subPrime.type = siUnsignedInteger;
  132|  1.87k|    params->base.type = siUnsignedInteger;
  133|  1.87k|}
seckey.c:seckey_HasCurveOID:
  582|  1.77k|{
  583|  1.77k|    SECItem oid;
  584|  1.77k|    SECStatus rv;
  585|  1.77k|    PORTCheapArenaPool tmpArena;
  586|       |
  587|  1.77k|    PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  1.77k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  588|       |    /* If we can decode it, an OID is available. */
  589|  1.77k|    rv = SEC_QuickDERDecodeItem(&tmpArena.arena, &oid,
  ------------------
  |  |  102|  1.77k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  590|  1.77k|                                SEC_ASN1_GET(SEC_ObjectIDTemplate),
  ------------------
  |  |  188|  1.77k|#define SEC_ASN1_GET(x) x
  ------------------
  591|  1.77k|                                &pubKey->u.ec.DEREncodedParams);
  592|  1.77k|    PORT_DestroyCheapArena(&tmpArena);
  593|  1.77k|    return rv;
  594|  1.77k|}
seckey.c:prepare_rsa_pub_key_for_asn1:
  116|  5.80k|{
  117|  5.80k|    pubk->u.rsa.modulus.type = siUnsignedInteger;
  118|  5.80k|    pubk->u.rsa.publicExponent.type = siUnsignedInteger;
  119|  5.80k|}
seckey.c:prepare_dsa_pub_key_for_asn1:
  123|  1.87k|{
  124|  1.87k|    pubk->u.dsa.publicValue.type = siUnsignedInteger;
  125|  1.87k|}
seckey.c:prepare_dh_pub_key_for_asn1:
  137|     37|{
  138|     37|    pubk->u.dh.prime.type = siUnsignedInteger;
  139|     37|    pubk->u.dh.base.type = siUnsignedInteger;
  140|     37|    pubk->u.dh.publicValue.type = siUnsignedInteger;
  141|     37|}

vfy_ImportPublicKey:
  630|    854|{
  631|    854|    PK11SlotInfo *slot;
  632|    854|    CK_OBJECT_HANDLE objID;
  633|       |
  634|    854|    if (cx->key->pkcs11Slot &&
  ------------------
  |  Branch (634:9): [True: 0, False: 854]
  ------------------
  635|    854|        PK11_DoesMechanismFlag(cx->key->pkcs11Slot,
  ------------------
  |  Branch (635:9): [True: 0, False: 0]
  ------------------
  636|      0|                               cx->mech, CKF_VERIFY)) {
  ------------------
  |  | 1358|      0|#define CKF_VERIFY 0x00002000
  ------------------
  637|      0|        return SECSuccess;
  638|      0|    }
  639|    854|    slot = PK11_GetBestSlotWithAttributes(cx->mech, CKF_VERIFY, 0, cx->wincx);
  ------------------
  |  | 1358|    854|#define CKF_VERIFY 0x00002000
  ------------------
  640|    854|    if (slot == NULL) {
  ------------------
  |  Branch (640:9): [True: 0, False: 854]
  ------------------
  641|      0|        return SECFailure; /* can't find a slot, fall back to
  642|       |                            * normal processing */
  643|      0|    }
  644|    854|    objID = PK11_ImportPublicKey(slot, cx->key, PR_FALSE);
  ------------------
  |  |  438|    854|#define PR_FALSE 0
  ------------------
  645|    854|    PK11_FreeSlot(slot);
  646|    854|    return objID == CK_INVALID_HANDLE ? SECFailure : SECSuccess;
  ------------------
  |  |   78|    854|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (646:12): [True: 225, False: 629]
  ------------------
  647|    854|}
VFY_DestroyContext:
  885|    854|{
  886|    854|    if (cx) {
  ------------------
  |  Branch (886:9): [True: 854, False: 0]
  ------------------
  887|    854|        if (cx->hashcx != NULL) {
  ------------------
  |  Branch (887:13): [True: 0, False: 854]
  ------------------
  888|      0|            (*cx->hashobj->destroy)(cx->hashcx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  889|      0|            cx->hashcx = NULL;
  890|      0|        }
  891|    854|        if (cx->vfycx != NULL) {
  ------------------
  |  Branch (891:13): [True: 0, False: 854]
  ------------------
  892|      0|            (void)PK11_DestroyContext(cx->vfycx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  893|      0|            cx->vfycx = NULL;
  894|      0|        }
  895|    854|        if (cx->key) {
  ------------------
  |  Branch (895:13): [True: 854, False: 0]
  ------------------
  896|    854|            SECKEY_DestroyPublicKey(cx->key);
  897|    854|        }
  898|    854|        if (cx->pkcs1RSADigestInfo) {
  ------------------
  |  Branch (898:13): [True: 9, False: 845]
  ------------------
  899|      9|            PORT_Free(cx->pkcs1RSADigestInfo);
  ------------------
  |  |   60|      9|#define PORT_Free PORT_Free_Util
  ------------------
  900|      9|        }
  901|    854|        SECITEM_FreeItem(&cx->mechparams, PR_FALSE);
  ------------------
  |  |  108|    854|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(&cx->mechparams, PR_FALSE);
  ------------------
  |  |  438|    854|#define PR_FALSE 0
  ------------------
  902|    854|        if (freeit) {
  ------------------
  |  Branch (902:13): [True: 854, False: 0]
  ------------------
  903|    854|            PORT_ZFree(cx, sizeof(VFYContext));
  ------------------
  |  |   75|    854|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  904|    854|        }
  905|    854|    }
  906|    854|}
VFY_VerifyDigestDirect:
 1107|    854|{
 1108|    854|    CK_MECHANISM_TYPE mech = sec_GetCombinedMech(encAlg, hashAlg);
 1109|    854|    return vfy_VerifyDigest(digest, key, sig, encAlg, hashAlg, mech,
 1110|    854|                            NULL, wincx);
 1111|    854|}
secvfy.c:sec_ECDSAGetCombinedMech:
  370|    230|{
  371|    230|    switch (hashalg) {
  372|    119|        case SEC_OID_SHA1:
  ------------------
  |  Branch (372:9): [True: 119, False: 111]
  ------------------
  373|    119|            return CKM_ECDSA_SHA1;
  ------------------
  |  | 1075|    119|#define CKM_ECDSA_SHA1 0x00001042UL
  ------------------
  374|      0|        case SEC_OID_SHA224:
  ------------------
  |  Branch (374:9): [True: 0, False: 230]
  ------------------
  375|      0|            return CKM_ECDSA_SHA224;
  ------------------
  |  | 1078|      0|#define CKM_ECDSA_SHA224 0x00001043UL
  ------------------
  376|     41|        case SEC_OID_SHA256:
  ------------------
  |  Branch (376:9): [True: 41, False: 189]
  ------------------
  377|     41|            return CKM_ECDSA_SHA256;
  ------------------
  |  | 1079|     41|#define CKM_ECDSA_SHA256 0x00001044UL
  ------------------
  378|     26|        case SEC_OID_SHA384:
  ------------------
  |  Branch (378:9): [True: 26, False: 204]
  ------------------
  379|     26|            return CKM_ECDSA_SHA384;
  ------------------
  |  | 1080|     26|#define CKM_ECDSA_SHA384 0x00001045UL
  ------------------
  380|     44|        case SEC_OID_SHA512:
  ------------------
  |  Branch (380:9): [True: 44, False: 186]
  ------------------
  381|     44|            return CKM_ECDSA_SHA512;
  ------------------
  |  | 1081|     44|#define CKM_ECDSA_SHA512 0x00001046UL
  ------------------
  382|      0|        default:
  ------------------
  |  Branch (382:9): [True: 0, False: 230]
  ------------------
  383|      0|            break;
  384|    230|    }
  385|      0|    return CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|      0|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  386|    230|}
secvfy.c:vfy_CreateContext:
  721|    854|{
  722|    854|    VFYContext *cx;
  723|    854|    SECStatus rv;
  724|    854|    KeyType type;
  725|    854|    PRUint32 policyFlags;
  726|    854|    PRInt32 optFlags;
  727|       |
  728|       |    /* make sure the encryption algorithm matches the key type */
  729|       |    /* RSA-PSS algorithm can be used with both rsaKey and rsaPssKey */
  730|    854|    type = seckey_GetKeyType(encAlg);
  731|    854|    if ((key->keyType != type) &&
  ------------------
  |  Branch (731:9): [True: 0, False: 854]
  ------------------
  732|    854|        ((key->keyType != rsaKey) || (type != rsaPssKey))) {
  ------------------
  |  Branch (732:10): [True: 0, False: 0]
  |  Branch (732:38): [True: 0, False: 0]
  ------------------
  733|      0|        SECITEM_FreeItem(mechparamsp, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(mechparamsp, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  734|      0|        PORT_SetError(SEC_ERROR_PKCS7_KEYALG_MISMATCH);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  735|      0|        return NULL;
  736|      0|    }
  737|    854|    if (NSS_OptionGet(NSS_KEY_SIZE_POLICY_FLAGS, &optFlags) != SECFailure) {
  ------------------
  |  |  317|    854|#define NSS_KEY_SIZE_POLICY_FLAGS 0x00e
  ------------------
  |  Branch (737:9): [True: 854, False: 0]
  ------------------
  738|    854|        if (optFlags & NSS_KEY_SIZE_POLICY_VERIFY_FLAG) {
  ------------------
  |  |  322|    854|#define NSS_KEY_SIZE_POLICY_VERIFY_FLAG 2
  ------------------
  |  Branch (738:13): [True: 854, False: 0]
  ------------------
  739|    854|            rv = SECKEY_EnforceKeySize(key->keyType,
  740|    854|                                       SECKEY_PublicKeyStrengthInBits(key),
  741|    854|                                       SEC_ERROR_SIGNATURE_ALGORITHM_DISABLED);
  742|    854|            if (rv != SECSuccess) {
  ------------------
  |  Branch (742:17): [True: 0, False: 854]
  ------------------
  743|      0|                SECITEM_FreeItem(mechparamsp, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                              SECITEM_FreeItem(mechparamsp, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  744|      0|                return NULL;
  745|      0|            }
  746|    854|        }
  747|    854|    }
  748|       |    /* check the policy on the encryption algorithm */
  749|    854|    if ((NSS_GetAlgorithmPolicy(encAlg, &policyFlags) == SECFailure) ||
  ------------------
  |  Branch (749:9): [True: 0, False: 854]
  ------------------
  750|    854|        !(policyFlags & NSS_USE_ALG_IN_ANY_SIGNATURE)) {
  ------------------
  |  |  575|    854|#define NSS_USE_ALG_IN_ANY_SIGNATURE 0x00000020    /* used in any signature */
  ------------------
  |  Branch (750:9): [True: 0, False: 854]
  ------------------
  751|      0|        SECITEM_FreeItem(mechparamsp, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(mechparamsp, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  752|      0|        PORT_SetError(SEC_ERROR_SIGNATURE_ALGORITHM_DISABLED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  753|      0|        return NULL;
  754|      0|    }
  755|       |
  756|    854|    cx = (VFYContext *)PORT_ZAlloc(sizeof(VFYContext));
  ------------------
  |  |   72|    854|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  757|    854|    if (cx == NULL) {
  ------------------
  |  Branch (757:9): [True: 0, False: 854]
  ------------------
  758|       |        /* after this point mechparamsp is 'owned' by the context and will be
  759|       |         * freed by Destroy context for any other failures here */
  760|      0|        SECITEM_FreeItem(mechparamsp, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(mechparamsp, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  761|      0|        goto loser;
  762|      0|    }
  763|       |
  764|    854|    cx->wincx = wincx;
  765|    854|    cx->hasSignature = (sig != NULL);
  766|    854|    cx->encAlg = encAlg;
  767|    854|    cx->hashAlg = hashAlg;
  768|    854|    cx->mech = mech;
  769|    854|    if (mechparamsp) {
  ------------------
  |  Branch (769:9): [True: 0, False: 854]
  ------------------
  770|      0|        cx->mechparams = *mechparamsp;
  771|    854|    } else {
  772|       |        /* probably needs to have a call to set the default
  773|       |         * paramseters based on hashAlg and encAlg */
  774|    854|        cx->mechparams.data = NULL;
  775|    854|        cx->mechparams.len = 0;
  776|    854|    }
  777|    854|    cx->key = SECKEY_CopyPublicKey(key);
  778|    854|    cx->pkcs1RSADigestInfo = NULL;
  779|    854|    if (mech != CKM_INVALID_MECHANISM) {
  ------------------
  |  |  155|    854|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  |  Branch (779:9): [True: 854, False: 0]
  ------------------
  780|    854|        rv = vfy_ImportPublicKey(cx);
  781|       |        /* if we can't import the key, then we probably can't
  782|       |         * support the requested combined mechanism, fallback
  783|       |         * to the non-combined method */
  784|    854|        if (rv != SECSuccess) {
  ------------------
  |  Branch (784:13): [True: 225, False: 629]
  ------------------
  785|    225|            cx->mech = mech = CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|    225|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  786|    225|        }
  787|    854|    }
  788|    854|    if (sig) {
  ------------------
  |  Branch (788:9): [True: 854, False: 0]
  ------------------
  789|       |        /* sigh, if we are prehashing, we still need to do verifyRecover
  790|       |         * recover for RSA PKCS #1 */
  791|    854|        if ((mech == CKM_INVALID_MECHANISM || prehash) && (type == rsaKey)) {
  ------------------
  |  |  155|  1.70k|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  |  Branch (791:14): [True: 225, False: 629]
  |  Branch (791:47): [True: 629, False: 0]
  |  Branch (791:59): [True: 624, False: 230]
  ------------------
  792|       |            /* in traditional rsa PKCS #1, we use verify recover to get
  793|       |             * the encoded RSADigestInfo. In all other cases we just
  794|       |             * stash the signature encoded in PKCS#11 in our context */
  795|    624|            rv = recoverPKCS1DigestInfo(hashAlg, &cx->hashAlg,
  796|    624|                                        &cx->pkcs1RSADigestInfo,
  797|    624|                                        &cx->pkcs1RSADigestInfoLen,
  798|    624|                                        cx->key,
  799|    624|                                        sig, wincx);
  800|    624|        } else {
  801|       |            /* at this point hashAlg should be known. Only the RSA case
  802|       |             * enters here with hashAlg unknown, and it's found out
  803|       |             * above */
  804|    230|            PORT_Assert(hashAlg != SEC_OID_UNKNOWN);
  ------------------
  |  |  120|    230|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    230|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 230, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  805|    230|            rv = vfy_SetPKCS11SigFromX509Sig(cx, sig);
  806|    230|        }
  807|    854|        if (rv != SECSuccess) {
  ------------------
  |  Branch (807:13): [True: 715, False: 139]
  ------------------
  808|    715|            goto loser;
  809|    715|        }
  810|    854|    }
  811|       |
  812|       |    /* check hash alg again, RSA may have changed it.*/
  813|    139|    if (HASH_GetHashTypeByOidTag(cx->hashAlg) == HASH_AlgNULL) {
  ------------------
  |  |  125|    139|#define HASH_GetHashTypeByOidTag HASH_GetHashTypeByOidTag_Util
  ------------------
  |  Branch (813:9): [True: 0, False: 139]
  ------------------
  814|       |        /* error set by HASH_GetHashTypeByOidTag */
  815|      0|        goto loser;
  816|      0|    }
  817|       |    /* check the policy on the hash algorithm. Do this after
  818|       |     * the rsa decode because some uses of this function get hash implicitly
  819|       |     * from the RSA signature itself. */
  820|    139|    if ((NSS_GetAlgorithmPolicy(cx->hashAlg, &policyFlags) == SECFailure) ||
  ------------------
  |  Branch (820:9): [True: 0, False: 139]
  ------------------
  821|    139|        !(policyFlags & NSS_USE_ALG_IN_ANY_SIGNATURE)) {
  ------------------
  |  |  575|    139|#define NSS_USE_ALG_IN_ANY_SIGNATURE 0x00000020    /* used in any signature */
  ------------------
  |  Branch (821:9): [True: 0, False: 139]
  ------------------
  822|      0|        PORT_SetError(SEC_ERROR_SIGNATURE_ALGORITHM_DISABLED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  823|      0|        goto loser;
  824|      0|    }
  825|       |
  826|    139|    if (hash) {
  ------------------
  |  Branch (826:9): [True: 0, False: 139]
  ------------------
  827|      0|        *hash = cx->hashAlg;
  828|      0|    }
  829|    139|    return cx;
  830|       |
  831|    715|loser:
  832|    715|    if (cx) {
  ------------------
  |  Branch (832:9): [True: 715, False: 0]
  ------------------
  833|    715|        VFY_DestroyContext(cx, PR_TRUE);
  ------------------
  |  |  437|    715|#define PR_TRUE 1
  ------------------
  834|    715|    }
  835|    715|    return 0;
  836|    139|}
secvfy.c:sec_GetCombinedMech:
  390|    854|{
  391|    854|    switch (encalg) {
  392|    624|        case SEC_OID_PKCS1_RSA_ENCRYPTION:
  ------------------
  |  Branch (392:9): [True: 624, False: 230]
  ------------------
  393|    624|            return sec_RSAPKCS1GetCombinedMech(hashalg);
  394|      0|        case SEC_OID_PKCS1_RSA_PSS_SIGNATURE:
  ------------------
  |  Branch (394:9): [True: 0, False: 854]
  ------------------
  395|      0|            return sec_RSAPSSGetCombinedMech(hashalg);
  396|    230|        case SEC_OID_ANSIX962_EC_PUBLIC_KEY:
  ------------------
  |  Branch (396:9): [True: 230, False: 624]
  ------------------
  397|    230|            return sec_ECDSAGetCombinedMech(hashalg);
  398|      0|        case SEC_OID_ANSIX9_DSA_SIGNATURE:
  ------------------
  |  Branch (398:9): [True: 0, False: 854]
  ------------------
  399|      0|            return sec_DSAGetCombinedMech(hashalg);
  400|      0|        default:
  ------------------
  |  Branch (400:9): [True: 0, False: 854]
  ------------------
  401|      0|            break;
  402|    854|    }
  403|      0|    return CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|      0|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  404|    854|}
secvfy.c:sec_RSAPKCS1GetCombinedMech:
  307|    624|{
  308|    624|    switch (hashalg) {
  309|      0|        case SEC_OID_MD5:
  ------------------
  |  Branch (309:9): [True: 0, False: 624]
  ------------------
  310|      0|            return CKM_MD5_RSA_PKCS;
  ------------------
  |  |  727|      0|#define CKM_MD5_RSA_PKCS 0x00000005UL
  ------------------
  311|      0|        case SEC_OID_MD2:
  ------------------
  |  Branch (311:9): [True: 0, False: 624]
  ------------------
  312|      0|            return CKM_MD2_RSA_PKCS;
  ------------------
  |  |  726|      0|#define CKM_MD2_RSA_PKCS 0x00000004UL
  ------------------
  313|     19|        case SEC_OID_SHA1:
  ------------------
  |  Branch (313:9): [True: 19, False: 605]
  ------------------
  314|     19|            return CKM_SHA1_RSA_PKCS;
  ------------------
  |  |  728|     19|#define CKM_SHA1_RSA_PKCS 0x00000006UL
  ------------------
  315|      0|        case SEC_OID_SHA224:
  ------------------
  |  Branch (315:9): [True: 0, False: 624]
  ------------------
  316|      0|            return CKM_SHA224_RSA_PKCS;
  ------------------
  |  |  778|      0|#define CKM_SHA224_RSA_PKCS 0x00000046UL
  ------------------
  317|    304|        case SEC_OID_SHA256:
  ------------------
  |  Branch (317:9): [True: 304, False: 320]
  ------------------
  318|    304|            return CKM_SHA256_RSA_PKCS;
  ------------------
  |  |  770|    304|#define CKM_SHA256_RSA_PKCS 0x00000040UL
  ------------------
  319|    201|        case SEC_OID_SHA384:
  ------------------
  |  Branch (319:9): [True: 201, False: 423]
  ------------------
  320|    201|            return CKM_SHA384_RSA_PKCS;
  ------------------
  |  |  771|    201|#define CKM_SHA384_RSA_PKCS 0x00000041UL
  ------------------
  321|    100|        case SEC_OID_SHA512:
  ------------------
  |  Branch (321:9): [True: 100, False: 524]
  ------------------
  322|    100|            return CKM_SHA512_RSA_PKCS;
  ------------------
  |  |  772|    100|#define CKM_SHA512_RSA_PKCS 0x00000042UL
  ------------------
  323|      0|        default:
  ------------------
  |  Branch (323:9): [True: 0, False: 624]
  ------------------
  324|      0|            break;
  325|    624|    }
  326|      0|    return CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|      0|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  327|    624|}
secvfy.c:vfy_SetPKCS11SigFromX509Sig:
  655|    230|{
  656|    230|    unsigned int sigLen;
  657|       |
  658|       |    /* skip the legacy RSA PKCS #11 case, it's always handled separately */
  659|    230|    if ((cx->key->keyType == rsaKey) && (cx->mech == CKM_INVALID_MECHANISM) &&
  ------------------
  |  |  155|      0|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  |  Branch (659:9): [True: 0, False: 230]
  |  Branch (659:41): [True: 0, False: 0]
  ------------------
  660|    230|        (cx->encAlg != SEC_OID_PKCS1_RSA_PSS_SIGNATURE)) {
  ------------------
  |  Branch (660:9): [True: 0, False: 0]
  ------------------
  661|      0|        return SECSuccess;
  662|      0|    }
  663|       |
  664|    230|    sigLen = checkedSignatureLen(cx->key);
  665|       |    /* Check signature length is within limits */
  666|    230|    if (sigLen == 0) {
  ------------------
  |  Branch (666:9): [True: 0, False: 230]
  ------------------
  667|       |        /* error set by checkedSignatureLen */
  668|      0|        return SECFailure;
  669|      0|    }
  670|    230|    if (sigLen > sizeof(cx->u)) {
  ------------------
  |  Branch (670:9): [True: 0, False: 230]
  ------------------
  671|      0|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  672|      0|        return SECFailure;
  673|      0|    }
  674|       |    /* save the authenticated length */
  675|    230|    cx->signatureLen = sigLen;
  676|    230|    switch (cx->encAlg) {
  677|      0|        case SEC_OID_ANSIX9_DSA_SIGNATURE:
  ------------------
  |  Branch (677:9): [True: 0, False: 230]
  ------------------
  678|    230|        case SEC_OID_ANSIX962_EC_PUBLIC_KEY:
  ------------------
  |  Branch (678:9): [True: 230, False: 0]
  ------------------
  679|       |            /* decodeECorDSASignature will check sigLen == sig->len after padding */
  680|    230|            return decodeECorDSASignature(cx->encAlg, sig, cx->u.buffer, sigLen);
  681|      0|        default:
  ------------------
  |  Branch (681:9): [True: 0, False: 230]
  ------------------
  682|      0|            break;
  683|    230|    }
  684|       |    /* all other cases, no transform needed, just copy the signature */
  685|      0|    if (sig->len != sigLen) {
  ------------------
  |  Branch (685:9): [True: 0, False: 0]
  ------------------
  686|      0|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  687|      0|        return SECFailure;
  688|      0|    }
  689|      0|    PORT_Memcpy(cx->u.buffer, sig->data, sigLen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  690|      0|    return SECSuccess;
  691|      0|}
secvfy.c:checkedSignatureLen:
  175|    360|{
  176|    360|    unsigned int sigLen = SECKEY_SignatureLen(pubk);
  177|    360|    if (sigLen == 0) {
  ------------------
  |  Branch (177:9): [True: 0, False: 360]
  ------------------
  178|       |        /* Error set by SECKEY_SignatureLen */
  179|      0|        return sigLen;
  180|      0|    }
  181|    360|    unsigned int maxSigLen;
  182|    360|    switch (pubk->keyType) {
  183|      0|        case rsaKey:
  ------------------
  |  Branch (183:9): [True: 0, False: 360]
  ------------------
  184|      0|        case rsaPssKey:
  ------------------
  |  Branch (184:9): [True: 0, False: 360]
  ------------------
  185|      0|            maxSigLen = (RSA_MAX_MODULUS_BITS + 7) / 8;
  ------------------
  |  |  152|      0|#define RSA_MAX_MODULUS_BITS 16384
  ------------------
  186|      0|            break;
  187|      0|        case dsaKey:
  ------------------
  |  Branch (187:9): [True: 0, False: 360]
  ------------------
  188|      0|            maxSigLen = DSA_MAX_SIGNATURE_LEN;
  ------------------
  |  |   52|      0|#define DSA_MAX_SIGNATURE_LEN (DSA_MAX_SUBPRIME_LEN * 2) /* Bytes */
  |  |  ------------------
  |  |  |  |   51|      0|#define DSA_MAX_SUBPRIME_LEN 32                          /* Bytes */
  |  |  ------------------
  ------------------
  189|      0|            break;
  190|    360|        case ecKey:
  ------------------
  |  Branch (190:9): [True: 360, False: 0]
  ------------------
  191|    360|            maxSigLen = 2 * MAX_ECKEY_LEN;
  ------------------
  |  |   81|    360|#define MAX_ECKEY_LEN 72 /* Bytes */
  ------------------
  192|    360|            break;
  193|      0|        default:
  ------------------
  |  Branch (193:9): [True: 0, False: 360]
  ------------------
  194|      0|            PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  195|      0|            return 0;
  196|    360|    }
  197|    360|    PORT_Assert(maxSigLen <= MAX_SIGNATURE_LEN);
  ------------------
  |  |  120|    360|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    360|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 360, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|    360|    if (sigLen > maxSigLen) {
  ------------------
  |  Branch (198:9): [True: 0, False: 360]
  ------------------
  199|      0|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  200|      0|        return 0;
  201|      0|    }
  202|    360|    return sigLen;
  203|    360|}
secvfy.c:decodeECorDSASignature:
  213|    230|{
  214|    230|    SECItem *dsasig = NULL; /* also used for ECDSA */
  215|       |
  216|       |    /* Safety: Ensure algId is as expected and that signature size is within maxmimums */
  217|    230|    if (algid == SEC_OID_ANSIX9_DSA_SIGNATURE) {
  ------------------
  |  Branch (217:9): [True: 0, False: 230]
  ------------------
  218|      0|        if (len > DSA_MAX_SIGNATURE_LEN) {
  ------------------
  |  |   52|      0|#define DSA_MAX_SIGNATURE_LEN (DSA_MAX_SUBPRIME_LEN * 2) /* Bytes */
  |  |  ------------------
  |  |  |  |   51|      0|#define DSA_MAX_SUBPRIME_LEN 32                          /* Bytes */
  |  |  ------------------
  ------------------
  |  Branch (218:13): [True: 0, False: 0]
  ------------------
  219|      0|            goto loser;
  220|      0|        }
  221|    230|    } else if (algid == SEC_OID_ANSIX962_EC_PUBLIC_KEY) {
  ------------------
  |  Branch (221:16): [True: 230, False: 0]
  ------------------
  222|    230|        if (len > MAX_ECKEY_LEN * 2) {
  ------------------
  |  |   81|    230|#define MAX_ECKEY_LEN 72 /* Bytes */
  ------------------
  |  Branch (222:13): [True: 0, False: 230]
  ------------------
  223|      0|            goto loser;
  224|      0|        }
  225|    230|    } else {
  226|      0|        goto loser;
  227|      0|    }
  228|       |
  229|       |    /* Decode and pad to length */
  230|    230|    dsasig = DSAU_DecodeDerSigToLen((SECItem *)sig, len);
  231|    230|    if (dsasig == NULL) {
  ------------------
  |  Branch (231:9): [True: 100, False: 130]
  ------------------
  232|    100|        goto loser;
  233|    100|    }
  234|    130|    if (dsasig->len != len) {
  ------------------
  |  Branch (234:9): [True: 0, False: 130]
  ------------------
  235|      0|        SECITEM_FreeItem(dsasig, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(dsasig, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  236|      0|        goto loser;
  237|      0|    }
  238|       |
  239|    130|    PORT_Memcpy(dsig, dsasig->data, len);
  ------------------
  |  |  180|    130|#define PORT_Memcpy memcpy
  ------------------
  240|    130|    SECITEM_FreeItem(dsasig, PR_TRUE);
  ------------------
  |  |  108|    130|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(dsasig, PR_TRUE);
  ------------------
  |  |  437|    130|#define PR_TRUE 1
  ------------------
  241|       |
  242|    130|    return SECSuccess;
  243|       |
  244|    100|loser:
  245|    100|    PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|    100|#define PORT_SetError PORT_SetError_Util
  ------------------
  246|    100|    return SECFailure;
  247|    130|}
secvfy.c:recoverPKCS1DigestInfo:
   45|    624|{
   46|    624|    SGNDigestInfo *di = NULL;
   47|    624|    SECItem it;
   48|    624|    PRBool rv = SECSuccess;
   49|       |
   50|    624|    PORT_Assert(digestAlgOut);
  ------------------
  |  |  120|    624|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    624|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 624, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|    624|    PORT_Assert(digestInfo);
  ------------------
  |  |  120|    624|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    624|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 624, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   52|    624|    PORT_Assert(digestInfoLen);
  ------------------
  |  |  120|    624|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    624|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 624, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   53|    624|    PORT_Assert(key);
  ------------------
  |  |  120|    624|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    624|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 624, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   54|    624|    PORT_Assert(key->keyType == rsaKey);
  ------------------
  |  |  120|    624|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    624|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 624, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   55|    624|    PORT_Assert(sig);
  ------------------
  |  |  120|    624|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    624|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 624, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   56|       |
   57|    624|    it.data = NULL;
   58|    624|    it.len = SECKEY_PublicKeyStrength(key);
   59|    624|    if (it.len != 0) {
  ------------------
  |  Branch (59:9): [True: 624, False: 0]
  ------------------
   60|    624|        it.data = (unsigned char *)PORT_Alloc(it.len);
  ------------------
  |  |   52|    624|#define PORT_Alloc PORT_Alloc_Util
  ------------------
   61|    624|    }
   62|    624|    if (it.len == 0 || it.data == NULL) {
  ------------------
  |  Branch (62:9): [True: 0, False: 624]
  |  Branch (62:24): [True: 0, False: 624]
  ------------------
   63|      0|        rv = SECFailure;
   64|      0|    }
   65|       |
   66|    624|    if (rv == SECSuccess) {
  ------------------
  |  Branch (66:9): [True: 624, False: 0]
  ------------------
   67|       |        /* decrypt the block */
   68|    624|        rv = PK11_VerifyRecover(key, sig, &it, wincx);
   69|    624|    }
   70|       |
   71|    624|    if (rv == SECSuccess) {
  ------------------
  |  Branch (71:9): [True: 9, False: 615]
  ------------------
   72|      9|        if (givenDigestAlg != SEC_OID_UNKNOWN) {
  ------------------
  |  Branch (72:13): [True: 9, False: 0]
  ------------------
   73|       |            /* We don't need to parse the DigestInfo if the caller gave us the
   74|       |             * digest algorithm to use. Later verifyPKCS1DigestInfo will verify
   75|       |             * that the DigestInfo identifies the given digest algorithm and
   76|       |             * that the DigestInfo is encoded absolutely correctly.
   77|       |             */
   78|      9|            *digestInfoLen = it.len;
   79|      9|            *digestInfo = (unsigned char *)it.data;
   80|      9|            *digestAlgOut = givenDigestAlg;
   81|      9|            return SECSuccess;
   82|      9|        }
   83|      9|    }
   84|       |
   85|    615|    if (rv == SECSuccess) {
  ------------------
  |  Branch (85:9): [True: 0, False: 615]
  ------------------
   86|       |        /* The caller didn't specify a digest algorithm to use, so choose the
   87|       |         * digest algorithm by parsing the AlgorithmIdentifier within the
   88|       |         * DigestInfo.
   89|       |         */
   90|      0|        di = SGN_DecodeDigestInfo(&it);
   91|      0|        if (!di) {
  ------------------
  |  Branch (91:13): [True: 0, False: 0]
  ------------------
   92|      0|            rv = SECFailure;
   93|      0|        }
   94|      0|    }
   95|       |
   96|    615|    if (rv == SECSuccess) {
  ------------------
  |  Branch (96:9): [True: 0, False: 615]
  ------------------
   97|      0|        *digestAlgOut = SECOID_GetAlgorithmTag(&di->digestAlgorithm);
  ------------------
  |  |  119|      0|#define SECOID_GetAlgorithmTag SECOID_GetAlgorithmTag_Util
  ------------------
   98|      0|        if (*digestAlgOut == SEC_OID_UNKNOWN) {
  ------------------
  |  Branch (98:13): [True: 0, False: 0]
  ------------------
   99|      0|            rv = SECFailure;
  100|      0|        }
  101|      0|    }
  102|       |
  103|    615|    if (di) {
  ------------------
  |  Branch (103:9): [True: 0, False: 615]
  ------------------
  104|      0|        SGN_DestroyDigestInfo(di);
  ------------------
  |  |  124|      0|#define SGN_DestroyDigestInfo SGN_DestroyDigestInfo_Util
  ------------------
  105|      0|    }
  106|       |
  107|    615|    if (rv == SECSuccess) {
  ------------------
  |  Branch (107:9): [True: 0, False: 615]
  ------------------
  108|      0|        *digestInfoLen = it.len;
  109|      0|        *digestInfo = (unsigned char *)it.data;
  110|    615|    } else {
  111|    615|        if (it.data) {
  ------------------
  |  Branch (111:13): [True: 615, False: 0]
  ------------------
  112|    615|            PORT_Free(it.data);
  ------------------
  |  |   60|    615|#define PORT_Free PORT_Free_Util
  ------------------
  113|    615|        }
  114|    615|        *digestInfo = NULL;
  115|    615|        *digestInfoLen = 0;
  116|    615|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|    615|#define PORT_SetError PORT_SetError_Util
  ------------------
  117|    615|    }
  118|       |
  119|    615|    return rv;
  120|    624|}
secvfy.c:verifyPKCS1DigestInfo:
  164|      9|{
  165|      9|    SECItem pkcs1DigestInfo;
  166|      9|    pkcs1DigestInfo.data = cx->pkcs1RSADigestInfo;
  167|      9|    pkcs1DigestInfo.len = cx->pkcs1RSADigestInfoLen;
  168|      9|    return _SGN_VerifyPKCS1DigestInfo(
  169|      9|        cx->hashAlg, digest, &pkcs1DigestInfo,
  170|      9|        PR_FALSE /*XXX: unsafeAllowMissingParameters*/);
  ------------------
  |  |  438|      9|#define PR_FALSE 0
  ------------------
  171|      9|}
secvfy.c:vfy_VerifyDigest:
 1060|    854|{
 1061|    854|    SECStatus rv;
 1062|    854|    VFYContext *cx;
 1063|    854|    SECItem dsasig; /* also used for ECDSA */
 1064|    854|    rv = SECFailure;
 1065|       |
 1066|    854|    cx = vfy_CreateContext(key, sig, encAlg, hashAlg, mech, mechparamsp,
 1067|    854|                           NULL, PR_TRUE, wincx);
  ------------------
  |  |  437|    854|#define PR_TRUE 1
  ------------------
 1068|    854|    if (cx != NULL) {
  ------------------
  |  Branch (1068:9): [True: 139, False: 715]
  ------------------
 1069|    139|        switch (key->keyType) {
 1070|      9|            case rsaKey:
  ------------------
  |  Branch (1070:13): [True: 9, False: 130]
  ------------------
 1071|       |                /* PSS isn't handled here for VerifyDigest. SSL
 1072|       |                 * calls PK11_Verify directly */
 1073|      9|                rv = verifyPKCS1DigestInfo(cx, digest);
 1074|       |                /* Error (if any) set by verifyPKCS1DigestInfo */
 1075|      9|                break;
 1076|    130|            case ecKey:
  ------------------
  |  Branch (1076:13): [True: 130, False: 9]
  ------------------
 1077|    130|            case dsaKey:
  ------------------
  |  Branch (1077:13): [True: 0, False: 139]
  ------------------
 1078|    130|                dsasig.data = cx->u.buffer;
 1079|    130|                dsasig.len = checkedSignatureLen(cx->key);
 1080|    130|                if (dsasig.len == 0) {
  ------------------
  |  Branch (1080:21): [True: 0, False: 130]
  ------------------
 1081|       |                    /* Error set by checkedSignatureLen */
 1082|      0|                    rv = SECFailure;
 1083|      0|                    break;
 1084|      0|                }
 1085|    130|                if (dsasig.len > sizeof(cx->u)) {
  ------------------
  |  Branch (1085:21): [True: 0, False: 130]
  ------------------
 1086|      0|                    PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1087|      0|                    rv = SECFailure;
 1088|      0|                    break;
 1089|      0|                }
 1090|    130|                rv = PK11_Verify(cx->key, &dsasig, (SECItem *)digest, cx->wincx);
 1091|    130|                if (rv != SECSuccess) {
  ------------------
  |  Branch (1091:21): [True: 130, False: 0]
  ------------------
 1092|    130|                    PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|    130|#define PORT_SetError PORT_SetError_Util
  ------------------
 1093|    130|                }
 1094|    130|                break;
 1095|      0|            default:
  ------------------
  |  Branch (1095:13): [True: 0, False: 139]
  ------------------
 1096|      0|                break;
 1097|    139|        }
 1098|    139|        VFY_DestroyContext(cx, PR_TRUE);
  ------------------
  |  |  437|    139|#define PR_TRUE 1
  ------------------
 1099|    139|    }
 1100|    854|    return rv;
 1101|    854|}

nssSlot_Destroy:
   33|  31.3k|{
   34|  31.3k|    if (slot) {
  ------------------
  |  Branch (34:9): [True: 31.3k, False: 0]
  ------------------
   35|  31.3k|        if (PR_ATOMIC_DECREMENT(&slot->base.refCount) == 0) {
  ------------------
  |  |  123|  31.3k|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (35:13): [True: 2, False: 31.3k]
  ------------------
   36|      2|            PK11_FreeSlot(slot->pk11slot);
   37|      2|            PZ_DestroyLock(slot->base.lock);
  ------------------
  |  |  244|      2|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
   38|      2|            PZ_DestroyCondVar(slot->isPresentCondition);
  ------------------
  |  |  249|      2|#define PZ_DestroyCondVar(v) PR_DestroyCondVar((v))
  ------------------
   39|      2|            PZ_DestroyLock(slot->isPresentLock);
  ------------------
  |  |  244|      2|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
   40|      2|            return nssArena_Destroy(slot->base.arena);
   41|      2|        }
   42|  31.3k|    }
   43|  31.3k|    return PR_SUCCESS;
   44|  31.3k|}
nssSlot_AddRef:
   72|  31.3k|{
   73|  31.3k|    PR_ATOMIC_INCREMENT(&slot->base.refCount);
  ------------------
  |  |  122|  31.3k|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
   74|  31.3k|    return slot;
   75|  31.3k|}
nssSlot_IsTokenPresent:
  118|  31.3k|{
  119|  31.3k|    CK_RV ckrv;
  120|  31.3k|    PRStatus nssrv;
  121|  31.3k|    NSSToken *nssToken = NULL;
  122|       |    /* XXX */
  123|  31.3k|    nssSession *session;
  124|  31.3k|    CK_SLOT_INFO slotInfo;
  125|  31.3k|    void *epv;
  126|  31.3k|    PRBool isPresent = PR_FALSE;
  ------------------
  |  |  438|  31.3k|#define PR_FALSE 0
  ------------------
  127|  31.3k|    PRBool doUpdateCachedCerts = PR_FALSE;
  ------------------
  |  |  438|  31.3k|#define PR_FALSE 0
  ------------------
  128|       |
  129|       |    /* permanent slots are always present unless they're disabled */
  130|  31.3k|    if (nssSlot_IsPermanent(slot)) {
  ------------------
  |  Branch (130:9): [True: 31.3k, False: 0]
  ------------------
  131|  31.3k|        return !PK11_IsDisabled(slot->pk11slot);
  132|  31.3k|    }
  133|       |
  134|       |    /* avoid repeated calls to check token status within set interval */
  135|      0|    PZ_Lock(slot->isPresentLock);
  ------------------
  |  |  245|      0|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  136|      0|    if (token_status_checked(slot)) {
  ------------------
  |  Branch (136:9): [True: 0, False: 0]
  ------------------
  137|      0|        CK_FLAGS ckFlags = slot->ckFlags;
  138|      0|        PZ_Unlock(slot->isPresentLock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  139|      0|        return ((ckFlags & CKF_TOKEN_PRESENT) != 0);
  ------------------
  |  |  131|      0|#define CKF_TOKEN_PRESENT 0x00000001UL    /* a token is there */
  ------------------
  140|      0|    }
  141|      0|    PZ_Unlock(slot->isPresentLock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  142|       |
  143|       |    /* First obtain the slot epv before we set up the condition
  144|       |     * variable, so we can just return if we couldn't get it. */
  145|      0|    epv = slot->epv;
  146|      0|    if (!epv) {
  ------------------
  |  Branch (146:9): [True: 0, False: 0]
  ------------------
  147|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  148|      0|    }
  149|       |
  150|       |    /* set up condition so only one thread is active in this part of the code at a time */
  151|      0|    PZ_Lock(slot->isPresentLock);
  ------------------
  |  |  245|      0|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  152|      0|    while (slot->isPresentThread) {
  ------------------
  |  Branch (152:12): [True: 0, False: 0]
  ------------------
  153|      0|        PR_WaitCondVar(slot->isPresentCondition, PR_INTERVAL_NO_TIMEOUT);
  ------------------
  |  |   54|      0|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
  154|      0|    }
  155|       |    /* if we were one of multiple threads here, the first thread will have
  156|       |     * given us the answer, no need to make more queries of the token. */
  157|      0|    if (token_status_checked(slot)) {
  ------------------
  |  Branch (157:9): [True: 0, False: 0]
  ------------------
  158|      0|        CK_FLAGS ckFlags = slot->ckFlags;
  159|      0|        PZ_Unlock(slot->isPresentLock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  160|      0|        return ((ckFlags & CKF_TOKEN_PRESENT) != 0);
  ------------------
  |  |  131|      0|#define CKF_TOKEN_PRESENT 0x00000001UL    /* a token is there */
  ------------------
  161|      0|    }
  162|       |    /* this is the winning thread, block all others until we've determined
  163|       |     * if the token is present and that it needs initialization. */
  164|      0|    slot->lastTokenPingState = nssSlotLastPingState_Update;
  165|      0|    slot->isPresentThread = PR_GetCurrentThread();
  166|       |
  167|      0|    PZ_Unlock(slot->isPresentLock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  168|       |
  169|      0|    nssToken = PK11Slot_GetNSSToken(slot->pk11slot);
  170|      0|    if (!nssToken) {
  ------------------
  |  Branch (170:9): [True: 0, False: 0]
  ------------------
  171|      0|        isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  172|      0|        goto done;
  173|      0|    }
  174|       |
  175|      0|    if (PK11_GetSlotInfo(slot->pk11slot, &slotInfo) != SECSuccess) {
  ------------------
  |  Branch (175:9): [True: 0, False: 0]
  ------------------
  176|      0|        nssToken->base.name[0] = 0; /* XXX */
  177|      0|        isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  178|      0|        goto done;
  179|      0|    }
  180|      0|    slot->ckFlags = slotInfo.flags;
  181|       |    /* check for the presence of the token */
  182|      0|    if ((slot->ckFlags & CKF_TOKEN_PRESENT) == 0) {
  ------------------
  |  |  131|      0|#define CKF_TOKEN_PRESENT 0x00000001UL    /* a token is there */
  ------------------
  |  Branch (182:9): [True: 0, False: 0]
  ------------------
  183|      0|        session = nssToken_GetDefaultSession(nssToken);
  184|      0|        if (session) {
  ------------------
  |  Branch (184:13): [True: 0, False: 0]
  ------------------
  185|      0|            nssSession_EnterMonitor(session);
  186|       |            /* token is not present */
  187|      0|            if (session->handle != CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (187:17): [True: 0, False: 0]
  ------------------
  188|       |                /* session is valid, close and invalidate it */
  189|      0|                CKAPI(epv)
  ------------------
  |  |   24|      0|    ((CK_FUNCTION_LIST_PTR)(epv))
  ------------------
  190|      0|                    ->C_CloseSession(session->handle);
  191|      0|                session->handle = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  192|      0|            }
  193|      0|            nssSession_ExitMonitor(session);
  194|      0|        }
  195|      0|        if (nssToken->base.name[0] != 0) {
  ------------------
  |  Branch (195:13): [True: 0, False: 0]
  ------------------
  196|       |            /* notify the high-level cache that the token is removed */
  197|      0|            nssToken->base.name[0] = 0; /* XXX */
  198|      0|            nssToken_NotifyCertsNotVisible(nssToken);
  199|      0|        }
  200|      0|        nssToken->base.name[0] = 0; /* XXX */
  201|       |        /* clear the token cache */
  202|      0|        nssToken_Remove(nssToken);
  203|      0|        isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  204|      0|        goto done;
  205|      0|    }
  206|       |    /* token is present, use the session info to determine if the card
  207|       |     * has been removed and reinserted.
  208|       |     */
  209|      0|    session = nssToken_GetDefaultSession(nssToken);
  210|      0|    if (session) {
  ------------------
  |  Branch (210:9): [True: 0, False: 0]
  ------------------
  211|      0|        PRBool tokenRemoved;
  212|      0|        nssSession_EnterMonitor(session);
  213|      0|        if (session->handle != CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (213:13): [True: 0, False: 0]
  ------------------
  214|      0|            CK_SESSION_INFO sessionInfo;
  215|      0|            ckrv = CKAPI(epv)->C_GetSessionInfo(session->handle, &sessionInfo);
  ------------------
  |  |   24|      0|    ((CK_FUNCTION_LIST_PTR)(epv))
  ------------------
  216|      0|            if (ckrv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (216:17): [True: 0, False: 0]
  ------------------
  217|       |                /* session is screwy, close and invalidate it */
  218|      0|                CKAPI(epv)
  ------------------
  |  |   24|      0|    ((CK_FUNCTION_LIST_PTR)(epv))
  ------------------
  219|      0|                    ->C_CloseSession(session->handle);
  220|      0|                session->handle = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  221|      0|            }
  222|      0|        }
  223|      0|        tokenRemoved = (session->handle == CK_INVALID_HANDLE);
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  224|      0|        nssSession_ExitMonitor(session);
  225|       |        /* token not removed, finished */
  226|      0|        if (!tokenRemoved) {
  ------------------
  |  Branch (226:13): [True: 0, False: 0]
  ------------------
  227|      0|            isPresent = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  228|      0|            goto done;
  229|      0|        }
  230|      0|    }
  231|       |    /* the token has been removed, and reinserted, or the slot contains
  232|       |     * a token it doesn't recognize. invalidate all the old
  233|       |     * information we had on this token, if we can't refresh, clear
  234|       |     * the present flag */
  235|      0|    nssToken_NotifyCertsNotVisible(nssToken);
  236|      0|    nssToken_Remove(nssToken);
  237|      0|    if (nssToken->base.name[0] == 0) {
  ------------------
  |  Branch (237:9): [True: 0, False: 0]
  ------------------
  238|      0|        doUpdateCachedCerts = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  239|      0|    }
  240|      0|    if (PK11_InitToken(slot->pk11slot, PR_FALSE) != SECSuccess) {
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (240:9): [True: 0, False: 0]
  ------------------
  241|      0|        isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  242|      0|        goto done;
  243|      0|    }
  244|      0|    if (doUpdateCachedCerts) {
  ------------------
  |  Branch (244:9): [True: 0, False: 0]
  ------------------
  245|      0|        nssTrustDomain_UpdateCachedTokenCerts(nssToken->trustDomain,
  246|      0|                                              nssToken);
  247|      0|    }
  248|      0|    nssrv = nssToken_Refresh(nssToken);
  249|      0|    if (nssrv != PR_SUCCESS) {
  ------------------
  |  Branch (249:9): [True: 0, False: 0]
  ------------------
  250|      0|        nssToken->base.name[0] = 0; /* XXX */
  251|      0|        slot->ckFlags &= ~CKF_TOKEN_PRESENT;
  ------------------
  |  |  131|      0|#define CKF_TOKEN_PRESENT 0x00000001UL    /* a token is there */
  ------------------
  252|      0|        isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  253|      0|        goto done;
  254|      0|    }
  255|      0|    isPresent = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  256|      0|done:
  257|      0|    if (nssToken) {
  ------------------
  |  Branch (257:9): [True: 0, False: 0]
  ------------------
  258|      0|        (void)nssToken_Destroy(nssToken);
  259|      0|    }
  260|       |    /* Once we've set up the condition variable,
  261|       |     * Before returning, it's necessary to:
  262|       |     *  1) Set the lastTokenPingTime so that any other threads waiting on this
  263|       |     *     initialization and any future calls within the initialization window
  264|       |     *     return the just-computed status.
  265|       |     *  2) Indicate we're complete, waking up all other threads that may still
  266|       |     *     be waiting on initialization can progress.
  267|       |     */
  268|      0|    PZ_Lock(slot->isPresentLock);
  ------------------
  |  |  245|      0|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  269|       |    /* don't update the time if we were reset while we were
  270|       |     * getting the token state */
  271|      0|    if (slot->lastTokenPingState == nssSlotLastPingState_Update) {
  ------------------
  |  Branch (271:9): [True: 0, False: 0]
  ------------------
  272|      0|        slot->lastTokenPingTime = PR_IntervalNow();
  273|      0|        slot->lastTokenPingState = nssSlotLastPingState_Valid;
  274|      0|    }
  275|      0|    slot->isPresentThread = NULL;
  276|      0|    PR_NotifyAllCondVar(slot->isPresentCondition);
  277|      0|    PZ_Unlock(slot->isPresentLock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  278|      0|    return isPresent;
  279|      0|}
nssSlot_GetCryptokiEPV:
  284|  31.3k|{
  285|  31.3k|    return slot->epv;
  286|  31.3k|}
nssSlot_GetToken:
  291|  31.3k|{
  292|  31.3k|    NSSToken *rvToken = NULL;
  293|       |
  294|  31.3k|    if (nssSlot_IsTokenPresent(slot)) {
  ------------------
  |  Branch (294:9): [True: 31.3k, False: 0]
  ------------------
  295|  31.3k|        rvToken = PK11Slot_GetNSSToken(slot->pk11slot);
  296|  31.3k|    }
  297|       |
  298|  31.3k|    return rvToken;
  299|  31.3k|}
nssSession_EnterMonitor:
  304|  31.3k|{
  305|  31.3k|    if (s->lock)
  ------------------
  |  Branch (305:9): [True: 31.3k, False: 0]
  ------------------
  306|  31.3k|        PZ_Lock(s->lock);
  ------------------
  |  |  245|  31.3k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  307|  31.3k|    return PR_SUCCESS;
  308|  31.3k|}
nssSession_ExitMonitor:
  313|  31.3k|{
  314|  31.3k|    return (s->lock) ? PZ_Unlock(s->lock) : PR_SUCCESS;
  ------------------
  |  |  246|  31.3k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  |  Branch (314:12): [True: 31.3k, False: 0]
  ------------------
  315|  31.3k|}

nssToken_Destroy:
   29|  31.3k|{
   30|  31.3k|    if (tok) {
  ------------------
  |  Branch (30:9): [True: 31.3k, False: 4]
  ------------------
   31|  31.3k|        if (PR_ATOMIC_DECREMENT(&tok->base.refCount) == 0) {
  ------------------
  |  |  123|  31.3k|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (31:13): [True: 2, False: 31.3k]
  ------------------
   32|      2|            PK11_FreeSlot(tok->pk11slot);
   33|      2|            PZ_DestroyLock(tok->base.lock);
  ------------------
  |  |  244|      2|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
   34|      2|            nssTokenObjectCache_Destroy(tok->cache);
   35|      2|            (void)nssSlot_Destroy(tok->slot);
   36|      2|            return nssArena_Destroy(tok->base.arena);
   37|      2|        }
   38|  31.3k|    }
   39|  31.3k|    return PR_SUCCESS;
   40|  31.3k|}
nssToken_AddRef:
   52|  31.3k|{
   53|  31.3k|    PR_ATOMIC_INCREMENT(&tok->base.refCount);
  ------------------
  |  |  122|  31.3k|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
   54|  31.3k|    return tok;
   55|  31.3k|}
nssToken_GetSlot:
   60|  31.3k|{
   61|  31.3k|    return nssSlot_AddRef(tok->slot);
   62|  31.3k|}
nssToken_GetCryptokiEPV:
   67|  31.3k|{
   68|  31.3k|    return nssSlot_GetCryptokiEPV(token->slot);
   69|  31.3k|}
nssToken_GetDefaultSession:
   74|  10.4k|{
   75|  10.4k|    return token->defaultSession;
   76|  10.4k|}
nssToken_FindObjectsByTemplate:
  372|  31.3k|{
  373|  31.3k|    CK_OBJECT_CLASS objclass = (CK_OBJECT_CLASS)-1;
  374|  31.3k|    nssCryptokiObject **objects = NULL;
  375|  31.3k|    PRUint32 i;
  376|       |
  377|  31.3k|    if (!token) {
  ------------------
  |  Branch (377:9): [True: 0, False: 31.3k]
  ------------------
  378|      0|        PORT_SetError(SEC_ERROR_NO_TOKEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  379|      0|        if (statusOpt)
  ------------------
  |  Branch (379:13): [True: 0, False: 0]
  ------------------
  380|      0|            *statusOpt = PR_FAILURE;
  381|      0|        return NULL;
  382|      0|    }
  383|  62.6k|    for (i = 0; i < otsize; i++) {
  ------------------
  |  Branch (383:17): [True: 62.6k, False: 0]
  ------------------
  384|  62.6k|        if (obj_template[i].type == CKA_CLASS) {
  ------------------
  |  |  511|  62.6k|#define CKA_CLASS 0x00000000UL
  ------------------
  |  Branch (384:13): [True: 31.3k, False: 31.3k]
  ------------------
  385|  31.3k|            objclass = *(CK_OBJECT_CLASS *)obj_template[i].pValue;
  386|  31.3k|            break;
  387|  31.3k|        }
  388|  62.6k|    }
  389|  31.3k|    PR_ASSERT(i < otsize);
  ------------------
  |  |  208|  31.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 31.3k, False: 0]
  |  |  ------------------
  ------------------
  390|  31.3k|    if (i == otsize) {
  ------------------
  |  Branch (390:9): [True: 0, False: 31.3k]
  ------------------
  391|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  392|      0|        if (statusOpt)
  ------------------
  |  Branch (392:13): [True: 0, False: 0]
  ------------------
  393|      0|            *statusOpt = PR_FAILURE;
  394|      0|        return NULL;
  395|      0|    }
  396|       |    /* If these objects are being cached, try looking there first */
  397|  31.3k|    if (token->cache &&
  ------------------
  |  Branch (397:9): [True: 0, False: 31.3k]
  ------------------
  398|  31.3k|        nssTokenObjectCache_HaveObjectClass(token->cache, objclass)) {
  ------------------
  |  Branch (398:9): [True: 0, False: 0]
  ------------------
  399|      0|        PRStatus status;
  400|      0|        objects = nssTokenObjectCache_FindObjectsByTemplate(token->cache,
  401|      0|                                                            objclass,
  402|      0|                                                            obj_template,
  403|      0|                                                            otsize,
  404|      0|                                                            maximumOpt,
  405|      0|                                                            &status);
  406|      0|        if (status == PR_SUCCESS) {
  ------------------
  |  Branch (406:13): [True: 0, False: 0]
  ------------------
  407|      0|            if (statusOpt)
  ------------------
  |  Branch (407:17): [True: 0, False: 0]
  ------------------
  408|      0|                *statusOpt = status;
  409|      0|            return objects;
  410|      0|        }
  411|      0|    }
  412|       |    /* Either they are not cached, or cache failed; look on token. */
  413|  31.3k|    objects = find_objects(token, sessionOpt,
  414|  31.3k|                           obj_template, otsize,
  415|  31.3k|                           maximumOpt, statusOpt);
  416|  31.3k|    return objects;
  417|  31.3k|}
nssToken_FindCertificateByIssuerAndSerialNumber:
  744|  10.4k|{
  745|  10.4k|    CK_ATTRIBUTE_PTR attr;
  746|  10.4k|    CK_ATTRIBUTE cert_template[4];
  747|  10.4k|    CK_ULONG ctsize;
  748|  10.4k|    nssCryptokiObject **objects;
  749|  10.4k|    nssCryptokiObject *rvObject = NULL;
  750|  10.4k|    NSS_CK_TEMPLATE_START(cert_template, attr, ctsize);
  ------------------
  |  |   30|  10.4k|    attr = _template;                                \
  |  |   31|  10.4k|    size = 0;
  ------------------
  751|       |
  752|  10.4k|    if (!token) {
  ------------------
  |  Branch (752:9): [True: 0, False: 10.4k]
  ------------------
  753|      0|        PORT_SetError(SEC_ERROR_NO_TOKEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  754|      0|        if (statusOpt)
  ------------------
  |  Branch (754:13): [True: 0, False: 0]
  ------------------
  755|      0|            *statusOpt = PR_FAILURE;
  756|      0|        return NULL;
  757|      0|    }
  758|       |    /* Set the search to token/session only if provided */
  759|  10.4k|    if (searchType == nssTokenSearchType_SessionOnly) {
  ------------------
  |  Branch (759:9): [True: 0, False: 10.4k]
  ------------------
  760|      0|        NSS_CK_SET_ATTRIBUTE_ITEM(attr, CKA_TOKEN, &g_ck_false);
  ------------------
  |  |   34|      0|    (pattr)->type = kind;                            \
  |  |   35|      0|    (pattr)->pValue = (CK_VOID_PTR)(item)->data;     \
  |  |   36|      0|    (pattr)->ulValueLen = (CK_ULONG)(item)->size;    \
  |  |   37|      0|    (pattr)++;
  ------------------
  761|  10.4k|    } else if ((searchType == nssTokenSearchType_TokenOnly) ||
  ------------------
  |  Branch (761:16): [True: 10.4k, False: 0]
  ------------------
  762|  10.4k|               (searchType == nssTokenSearchType_TokenForced)) {
  ------------------
  |  Branch (762:16): [True: 0, False: 0]
  ------------------
  763|  10.4k|        NSS_CK_SET_ATTRIBUTE_ITEM(attr, CKA_TOKEN, &g_ck_true);
  ------------------
  |  |   34|  10.4k|    (pattr)->type = kind;                            \
  |  |   35|  10.4k|    (pattr)->pValue = (CK_VOID_PTR)(item)->data;     \
  |  |   36|  10.4k|    (pattr)->ulValueLen = (CK_ULONG)(item)->size;    \
  |  |   37|  10.4k|    (pattr)++;
  ------------------
  764|  10.4k|    }
  765|       |    /* Set the unique id */
  766|  10.4k|    NSS_CK_SET_ATTRIBUTE_ITEM(attr, CKA_CLASS, &g_ck_class_cert);
  ------------------
  |  |   34|  10.4k|    (pattr)->type = kind;                            \
  |  |   35|  10.4k|    (pattr)->pValue = (CK_VOID_PTR)(item)->data;     \
  |  |   36|  10.4k|    (pattr)->ulValueLen = (CK_ULONG)(item)->size;    \
  |  |   37|  10.4k|    (pattr)++;
  ------------------
  767|  10.4k|    NSS_CK_SET_ATTRIBUTE_ITEM(attr, CKA_ISSUER, issuer);
  ------------------
  |  |   34|  10.4k|    (pattr)->type = kind;                            \
  |  |   35|  10.4k|    (pattr)->pValue = (CK_VOID_PTR)(item)->data;     \
  |  |   36|  10.4k|    (pattr)->ulValueLen = (CK_ULONG)(item)->size;    \
  |  |   37|  10.4k|    (pattr)++;
  ------------------
  768|  10.4k|    NSS_CK_SET_ATTRIBUTE_ITEM(attr, CKA_SERIAL_NUMBER, serial);
  ------------------
  |  |   34|  10.4k|    (pattr)->type = kind;                            \
  |  |   35|  10.4k|    (pattr)->pValue = (CK_VOID_PTR)(item)->data;     \
  |  |   36|  10.4k|    (pattr)->ulValueLen = (CK_ULONG)(item)->size;    \
  |  |   37|  10.4k|    (pattr)++;
  ------------------
  769|  10.4k|    NSS_CK_TEMPLATE_FINISH(cert_template, attr, ctsize);
  ------------------
  |  |   60|  10.4k|    size = (attr) - (_template);                      \
  |  |   61|  10.4k|    PR_ASSERT(size <= sizeof(_template) / sizeof(_template[0]));
  |  |  ------------------
  |  |  |  |  208|  10.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  770|       |    /* get the object handle */
  771|  10.4k|    if (searchType == nssTokenSearchType_TokenForced) {
  ------------------
  |  Branch (771:9): [True: 0, False: 10.4k]
  ------------------
  772|      0|        objects = find_objects(token, sessionOpt,
  773|      0|                               cert_template, ctsize,
  774|      0|                               1, statusOpt);
  775|  10.4k|    } else {
  776|  10.4k|        objects = nssToken_FindObjectsByTemplate(token, sessionOpt,
  777|  10.4k|                                                 cert_template, ctsize,
  778|  10.4k|                                                 1, statusOpt);
  779|  10.4k|    }
  780|  10.4k|    if (objects) {
  ------------------
  |  Branch (780:9): [True: 0, False: 10.4k]
  ------------------
  781|      0|        rvObject = objects[0];
  782|      0|        nss_ZFreeIf(objects);
  783|      0|    }
  784|       |
  785|  10.4k|    return rvObject;
  786|  10.4k|}
nssToken_FindTrustForCertificate:
 1037|  20.8k|{
 1038|  20.8k|    CK_OBJECT_CLASS tobjc = CKO_NSS_TRUST;
  ------------------
  |  |   37|  20.8k|#define CKO_NSS_TRUST (CKO_NSS + 3)
  |  |  ------------------
  |  |  |  |   33|  20.8k|#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|  20.8k|#define CKO_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  20.8k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1039|  20.8k|    CK_ATTRIBUTE_PTR attr;
 1040|  20.8k|    CK_ATTRIBUTE tobj_template[5];
 1041|  20.8k|    CK_ULONG tobj_size;
 1042|  20.8k|    nssSession *session = sessionOpt ? sessionOpt : token->defaultSession;
  ------------------
  |  Branch (1042:27): [True: 0, False: 20.8k]
  ------------------
 1043|  20.8k|    nssCryptokiObject *object = NULL, **objects;
 1044|       |
 1045|       |    /* Don't ask the module to use an invalid session handle. */
 1046|  20.8k|    if (!session || session->handle == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  20.8k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1046:9): [True: 0, False: 20.8k]
  |  Branch (1046:21): [True: 0, False: 20.8k]
  ------------------
 1047|      0|        PORT_SetError(SEC_ERROR_NO_TOKEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1048|      0|        return object;
 1049|      0|    }
 1050|       |
 1051|  20.8k|    NSS_CK_TEMPLATE_START(tobj_template, attr, tobj_size);
  ------------------
  |  |   30|  20.8k|    attr = _template;                                \
  |  |   31|  20.8k|    size = 0;
  ------------------
 1052|  20.8k|    if (searchType == nssTokenSearchType_TokenOnly) {
  ------------------
  |  Branch (1052:9): [True: 20.8k, False: 0]
  ------------------
 1053|  20.8k|        NSS_CK_SET_ATTRIBUTE_ITEM(attr, CKA_TOKEN, &g_ck_true);
  ------------------
  |  |   34|  20.8k|    (pattr)->type = kind;                            \
  |  |   35|  20.8k|    (pattr)->pValue = (CK_VOID_PTR)(item)->data;     \
  |  |   36|  20.8k|    (pattr)->ulValueLen = (CK_ULONG)(item)->size;    \
  |  |   37|  20.8k|    (pattr)++;
  ------------------
 1054|  20.8k|    }
 1055|  20.8k|    NSS_CK_SET_ATTRIBUTE_VAR(attr, CKA_CLASS, tobjc);
  ------------------
  |  |   48|  20.8k|    (pattr)->type = kind;                          \
  |  |   49|  20.8k|    (pattr)->pValue = (CK_VOID_PTR)&var;           \
  |  |   50|  20.8k|    (pattr)->ulValueLen = (CK_ULONG)sizeof(var);   \
  |  |   51|  20.8k|    (pattr)++;
  ------------------
 1056|  20.8k|    NSS_CK_SET_ATTRIBUTE_ITEM(attr, CKA_ISSUER, certIssuer);
  ------------------
  |  |   34|  20.8k|    (pattr)->type = kind;                            \
  |  |   35|  20.8k|    (pattr)->pValue = (CK_VOID_PTR)(item)->data;     \
  |  |   36|  20.8k|    (pattr)->ulValueLen = (CK_ULONG)(item)->size;    \
  |  |   37|  20.8k|    (pattr)++;
  ------------------
 1057|  20.8k|    NSS_CK_SET_ATTRIBUTE_ITEM(attr, CKA_SERIAL_NUMBER, certSerial);
  ------------------
  |  |   34|  20.8k|    (pattr)->type = kind;                            \
  |  |   35|  20.8k|    (pattr)->pValue = (CK_VOID_PTR)(item)->data;     \
  |  |   36|  20.8k|    (pattr)->ulValueLen = (CK_ULONG)(item)->size;    \
  |  |   37|  20.8k|    (pattr)++;
  ------------------
 1058|  20.8k|    NSS_CK_TEMPLATE_FINISH(tobj_template, attr, tobj_size);
  ------------------
  |  |   60|  20.8k|    size = (attr) - (_template);                      \
  |  |   61|  20.8k|    PR_ASSERT(size <= sizeof(_template) / sizeof(_template[0]));
  |  |  ------------------
  |  |  |  |  208|  20.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 20.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1059|  20.8k|    objects = nssToken_FindObjectsByTemplate(token, session,
 1060|  20.8k|                                             tobj_template, tobj_size,
 1061|  20.8k|                                             1, NULL);
 1062|  20.8k|    if (objects) {
  ------------------
  |  Branch (1062:9): [True: 0, False: 20.8k]
  ------------------
 1063|      0|        object = objects[0];
 1064|      0|        nss_ZFreeIf(objects);
 1065|      0|    }
 1066|  20.8k|    return object;
 1067|  20.8k|}
devtoken.c:find_objects:
  240|  31.3k|{
  241|  31.3k|    CK_RV ckrv = CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
  242|  31.3k|    CK_ULONG count;
  243|  31.3k|    CK_OBJECT_HANDLE *objectHandles = NULL;
  244|  31.3k|    CK_OBJECT_HANDLE staticObjects[OBJECT_STACK_SIZE];
  245|  31.3k|    PRUint32 arraySize, numHandles;
  246|  31.3k|    void *epv = nssToken_GetCryptokiEPV(tok);
  247|  31.3k|    nssCryptokiObject **objects;
  248|  31.3k|    nssSession *session = (sessionOpt) ? sessionOpt : tok->defaultSession;
  ------------------
  |  Branch (248:27): [True: 31.3k, False: 0]
  ------------------
  249|       |
  250|       |    /* Don't ask the module to use an invalid session handle. */
  251|  31.3k|    if (!session || session->handle == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  31.3k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (251:9): [True: 0, False: 31.3k]
  |  Branch (251:21): [True: 0, False: 31.3k]
  ------------------
  252|      0|        ckrv = CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
  253|      0|        goto loser;
  254|      0|    }
  255|       |
  256|       |    /* the arena is only for the array of object handles */
  257|  31.3k|    if (maximumOpt > 0) {
  ------------------
  |  Branch (257:9): [True: 31.3k, False: 0]
  ------------------
  258|  31.3k|        arraySize = maximumOpt;
  259|  31.3k|    } else {
  260|      0|        arraySize = OBJECT_STACK_SIZE;
  ------------------
  |  |   24|      0|#define OBJECT_STACK_SIZE 16
  ------------------
  261|      0|    }
  262|  31.3k|    numHandles = 0;
  263|  31.3k|    if (arraySize <= OBJECT_STACK_SIZE) {
  ------------------
  |  |   24|  31.3k|#define OBJECT_STACK_SIZE 16
  ------------------
  |  Branch (263:9): [True: 31.3k, False: 0]
  ------------------
  264|  31.3k|        objectHandles = staticObjects;
  265|  31.3k|    } else {
  266|      0|        objectHandles = nss_ZNEWARRAY(NULL, CK_OBJECT_HANDLE, arraySize);
  ------------------
  |  |  371|      0|    ((type *)nss_ZAlloc((arenaOpt), sizeof(type) * (quantity)))
  ------------------
  267|      0|    }
  268|  31.3k|    if (!objectHandles) {
  ------------------
  |  Branch (268:9): [True: 0, False: 31.3k]
  ------------------
  269|      0|        ckrv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  270|      0|        goto loser;
  271|      0|    }
  272|  31.3k|    nssSession_EnterMonitor(session); /* ==== session lock === */
  273|       |    /* Initialize the find with the template */
  274|  31.3k|    ckrv = CKAPI(epv)->C_FindObjectsInit(session->handle,
  ------------------
  |  |   24|  31.3k|    ((CK_FUNCTION_LIST_PTR)(epv))
  ------------------
  275|  31.3k|                                         obj_template, otsize);
  276|  31.3k|    if (ckrv != CKR_OK) {
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (276:9): [True: 0, False: 31.3k]
  ------------------
  277|      0|        nssSession_ExitMonitor(session);
  278|      0|        goto loser;
  279|      0|    }
  280|  31.3k|    while (PR_TRUE) {
  ------------------
  |  |  437|  31.3k|#define PR_TRUE 1
  |  |  ------------------
  |  |  |  Branch (437:17): [Folded - Ignored]
  |  |  ------------------
  ------------------
  281|       |        /* Issue the find for up to arraySize - numHandles objects */
  282|  31.3k|        ckrv = CKAPI(epv)->C_FindObjects(session->handle,
  ------------------
  |  |   24|  31.3k|    ((CK_FUNCTION_LIST_PTR)(epv))
  ------------------
  283|  31.3k|                                         objectHandles + numHandles,
  284|  31.3k|                                         arraySize - numHandles,
  285|  31.3k|                                         &count);
  286|  31.3k|        if (ckrv != CKR_OK) {
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (286:13): [True: 0, False: 31.3k]
  ------------------
  287|      0|            nssSession_ExitMonitor(session);
  288|      0|            goto loser;
  289|      0|        }
  290|       |        /* bump the number of found objects */
  291|  31.3k|        numHandles += count;
  292|  31.3k|        if (maximumOpt > 0 || numHandles < arraySize) {
  ------------------
  |  Branch (292:13): [True: 31.3k, False: 0]
  |  Branch (292:31): [True: 0, False: 0]
  ------------------
  293|       |            /* When a maximum is provided, the search is done all at once,
  294|       |             * so the search is finished.  If the number returned was less
  295|       |             * than the number sought, the search is finished.
  296|       |             */
  297|  31.3k|            break;
  298|  31.3k|        }
  299|       |        /* the array is filled, double it and continue */
  300|      0|        arraySize *= 2;
  301|      0|        if (objectHandles == staticObjects) {
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  ------------------
  302|      0|            objectHandles = nss_ZNEWARRAY(NULL, CK_OBJECT_HANDLE, arraySize);
  ------------------
  |  |  371|      0|    ((type *)nss_ZAlloc((arenaOpt), sizeof(type) * (quantity)))
  ------------------
  303|      0|            if (objectHandles) {
  ------------------
  |  Branch (303:17): [True: 0, False: 0]
  ------------------
  304|      0|                PORT_Memcpy(objectHandles, staticObjects,
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  305|      0|                            OBJECT_STACK_SIZE * sizeof(objectHandles[1]));
  ------------------
  |  |   24|      0|#define OBJECT_STACK_SIZE 16
  ------------------
  306|      0|            }
  307|      0|        } else {
  308|      0|            objectHandles = nss_ZREALLOCARRAY(objectHandles,
  ------------------
  |  |  391|      0|    ((type *)nss_ZRealloc((p), sizeof(type) * (quantity)))
  ------------------
  309|      0|                                              CK_OBJECT_HANDLE,
  310|      0|                                              arraySize);
  311|      0|        }
  312|      0|        if (!objectHandles) {
  ------------------
  |  Branch (312:13): [True: 0, False: 0]
  ------------------
  313|      0|            nssSession_ExitMonitor(session);
  314|      0|            ckrv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  315|      0|            goto loser;
  316|      0|        }
  317|      0|    }
  318|  31.3k|    ckrv = CKAPI(epv)->C_FindObjectsFinal(session->handle);
  ------------------
  |  |   24|  31.3k|    ((CK_FUNCTION_LIST_PTR)(epv))
  ------------------
  319|  31.3k|    nssSession_ExitMonitor(session); /* ==== end session lock === */
  320|  31.3k|    if (ckrv != CKR_OK) {
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (320:9): [True: 0, False: 31.3k]
  ------------------
  321|      0|        goto loser;
  322|      0|    }
  323|  31.3k|    if (numHandles > 0) {
  ------------------
  |  Branch (323:9): [True: 0, False: 31.3k]
  ------------------
  324|      0|        objects = create_objects_from_handles(tok, session,
  325|      0|                                              objectHandles, numHandles);
  326|  31.3k|    } else {
  327|  31.3k|        nss_SetError(NSS_ERROR_NOT_FOUND);
  328|  31.3k|        objects = NULL;
  329|  31.3k|    }
  330|  31.3k|    if (objectHandles && objectHandles != staticObjects) {
  ------------------
  |  Branch (330:9): [True: 31.3k, False: 0]
  |  Branch (330:26): [True: 0, False: 31.3k]
  ------------------
  331|      0|        nss_ZFreeIf(objectHandles);
  332|      0|    }
  333|  31.3k|    if (statusOpt)
  ------------------
  |  Branch (333:9): [True: 10.4k, False: 20.8k]
  ------------------
  334|  10.4k|        *statusOpt = PR_SUCCESS;
  335|  31.3k|    return objects;
  336|      0|loser:
  337|      0|    if (objectHandles && objectHandles != staticObjects) {
  ------------------
  |  Branch (337:9): [True: 0, False: 0]
  |  Branch (337:26): [True: 0, False: 0]
  ------------------
  338|      0|        nss_ZFreeIf(objectHandles);
  339|      0|    }
  340|       |    /*
  341|       |     * These errors should be treated the same as if the objects just weren't
  342|       |     * found..
  343|       |     */
  344|      0|    if ((ckrv == CKR_ATTRIBUTE_TYPE_INVALID) ||
  ------------------
  |  | 1408|      0|#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012UL
  ------------------
  |  Branch (344:9): [True: 0, False: 0]
  ------------------
  345|      0|        (ckrv == CKR_ATTRIBUTE_VALUE_INVALID) ||
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  |  Branch (345:9): [True: 0, False: 0]
  ------------------
  346|      0|        (ckrv == CKR_DATA_INVALID) ||
  ------------------
  |  | 1414|      0|#define CKR_DATA_INVALID 0x00000020UL
  ------------------
  |  Branch (346:9): [True: 0, False: 0]
  ------------------
  347|      0|        (ckrv == CKR_DATA_LEN_RANGE) ||
  ------------------
  |  | 1415|      0|#define CKR_DATA_LEN_RANGE 0x00000021UL
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|        (ckrv == CKR_FUNCTION_NOT_SUPPORTED) ||
  ------------------
  |  | 1426|      0|#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL
  ------------------
  |  Branch (348:9): [True: 0, False: 0]
  ------------------
  349|      0|        (ckrv == CKR_TEMPLATE_INCOMPLETE) ||
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
  |  Branch (349:9): [True: 0, False: 0]
  ------------------
  350|      0|        (ckrv == CKR_TEMPLATE_INCONSISTENT)) {
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
  |  Branch (350:9): [True: 0, False: 0]
  ------------------
  351|       |
  352|      0|        nss_SetError(NSS_ERROR_NOT_FOUND);
  353|      0|        if (statusOpt)
  ------------------
  |  Branch (353:13): [True: 0, False: 0]
  ------------------
  354|      0|            *statusOpt = PR_SUCCESS;
  355|      0|    } else {
  356|      0|        nss_SetError(ckrv);
  357|      0|        nss_SetError(NSS_ERROR_PKCS11);
  358|      0|        if (statusOpt)
  ------------------
  |  Branch (358:13): [True: 0, False: 0]
  ------------------
  359|      0|            *statusOpt = PR_FAILURE;
  360|      0|    }
  361|      0|    return (nssCryptokiObject **)NULL;
  362|  31.3k|}

nssSlotArray_Destroy:
  129|  15.6k|{
  130|  15.6k|    if (slots) {
  ------------------
  |  Branch (130:9): [True: 15.6k, False: 0]
  ------------------
  131|  15.6k|        NSSSlot **slotp;
  132|  47.0k|        for (slotp = slots; *slotp; slotp++) {
  ------------------
  |  Branch (132:29): [True: 31.3k, False: 15.6k]
  ------------------
  133|  31.3k|            nssSlot_Destroy(*slotp);
  134|  31.3k|        }
  135|  15.6k|        nss_ZFreeIf(slots);
  136|  15.6k|    }
  137|  15.6k|}
nssTokenObjectCache_Destroy:
  259|      2|{
  260|      2|    if (cache) {
  ------------------
  |  Branch (260:9): [True: 0, False: 2]
  ------------------
  261|      0|        clear_cache(cache);
  262|      0|        if (cache->lock) {
  ------------------
  |  Branch (262:13): [True: 0, False: 0]
  ------------------
  263|      0|            PZ_DestroyLock(cache->lock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  264|      0|        }
  265|      0|        nss_ZFreeIf(cache);
  266|      0|    }
  267|      2|}

rijndael_native_key_expansion:
  127|  1.24k|{
  128|  1.24k|    switch (Nk) {
  129|    901|        case 4:
  ------------------
  |  Branch (129:9): [True: 901, False: 340]
  ------------------
  130|    901|            native_key_expansion128(cx, key);
  131|    901|            return;
  132|      0|        case 6:
  ------------------
  |  Branch (132:9): [True: 0, False: 1.24k]
  ------------------
  133|      0|            native_key_expansion192(cx, key);
  134|      0|            return;
  135|    340|        case 8:
  ------------------
  |  Branch (135:9): [True: 340, False: 901]
  ------------------
  136|    340|            native_key_expansion256(cx, key);
  137|    340|            return;
  138|      0|        default:
  ------------------
  |  Branch (138:9): [True: 0, False: 1.24k]
  ------------------
  139|       |            /* This shouldn't happen (checked by the caller). */
  140|      0|            return;
  141|  1.24k|    }
  142|  1.24k|}
rijndael_native_encryptBlock:
  148|  1.24k|{
  149|  1.24k|    unsigned int i;
  150|  1.24k|    pre_align __m128i m post_align = _mm_loadu_si128((__m128i *)input);
  151|  1.24k|    m = _mm_xor_si128(m, cx->k.keySchedule[0]);
  152|  13.7k|    for (i = 1; i < cx->Nr; ++i) {
  ------------------
  |  Branch (152:17): [True: 12.5k, False: 1.24k]
  ------------------
  153|  12.5k|        m = _mm_aesenc_si128(m, cx->k.keySchedule[i]);
  154|  12.5k|    }
  155|  1.24k|    m = _mm_aesenclast_si128(m, cx->k.keySchedule[cx->Nr]);
  156|  1.24k|    _mm_storeu_si128((__m128i *)output, m);
  157|  1.24k|}
aes-x86.c:native_key_expansion128:
   23|    901|{
   24|    901|    __m128i *keySchedule = cx->k.keySchedule;
   25|    901|    pre_align __m128i tmp_key post_align;
   26|    901|    pre_align __m128i tmp post_align;
   27|    901|    keySchedule[0] = _mm_loadu_si128((__m128i *)key);
   28|    901|    EXPAND_KEY128(keySchedule[0], 0x01, keySchedule[1]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   29|    901|    EXPAND_KEY128(keySchedule[1], 0x02, keySchedule[2]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   30|    901|    EXPAND_KEY128(keySchedule[2], 0x04, keySchedule[3]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   31|    901|    EXPAND_KEY128(keySchedule[3], 0x08, keySchedule[4]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   32|    901|    EXPAND_KEY128(keySchedule[4], 0x10, keySchedule[5]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   33|    901|    EXPAND_KEY128(keySchedule[5], 0x20, keySchedule[6]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   34|    901|    EXPAND_KEY128(keySchedule[6], 0x40, keySchedule[7]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   35|    901|    EXPAND_KEY128(keySchedule[7], 0x80, keySchedule[8]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   36|    901|    EXPAND_KEY128(keySchedule[8], 0x1B, keySchedule[9]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   37|    901|    EXPAND_KEY128(keySchedule[9], 0x36, keySchedule[10]);
  ------------------
  |  |   14|    901|    tmp_key = _mm_aeskeygenassist_si128(k, rcon);     \
  |  |   15|    901|    tmp_key = _mm_shuffle_epi32(tmp_key, 0xFF);       \
  |  |   16|    901|    tmp = _mm_xor_si128(k, _mm_slli_si128(k, 4));     \
  |  |   17|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   18|    901|    tmp = _mm_xor_si128(tmp, _mm_slli_si128(tmp, 4)); \
  |  |   19|    901|    res = _mm_xor_si128(tmp, tmp_key)
  ------------------
   38|    901|}
aes-x86.c:native_key_expansion256:
   98|    340|{
   99|    340|    __m128i *keySchedule = cx->k.keySchedule;
  100|    340|    pre_align __m128i tmp_key post_align;
  101|    340|    pre_align __m128i tmp1 post_align;
  102|    340|    pre_align __m128i tmp2 post_align;
  103|    340|    keySchedule[0] = _mm_loadu_si128((__m128i *)key);
  104|    340|    keySchedule[1] = _mm_loadu_si128((__m128i *)(key + 16));
  105|    340|    EXPAND_KEY256(keySchedule[2], keySchedule[3], keySchedule[0],
  ------------------
  |  |   93|    340|    EXPAND_KEY256_PART(res1, rcon, k1, k2, 0xFF); \
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  |  |   94|    340|    EXPAND_KEY256_PART(res2, 0x00, k2, res1, 0xAA)
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  ------------------
  106|    340|                  keySchedule[1], 0x01);
  107|    340|    EXPAND_KEY256(keySchedule[4], keySchedule[5], keySchedule[2],
  ------------------
  |  |   93|    340|    EXPAND_KEY256_PART(res1, rcon, k1, k2, 0xFF); \
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  |  |   94|    340|    EXPAND_KEY256_PART(res2, 0x00, k2, res1, 0xAA)
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  ------------------
  108|    340|                  keySchedule[3], 0x02);
  109|    340|    EXPAND_KEY256(keySchedule[6], keySchedule[7], keySchedule[4],
  ------------------
  |  |   93|    340|    EXPAND_KEY256_PART(res1, rcon, k1, k2, 0xFF); \
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  |  |   94|    340|    EXPAND_KEY256_PART(res2, 0x00, k2, res1, 0xAA)
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  ------------------
  110|    340|                  keySchedule[5], 0x04);
  111|    340|    EXPAND_KEY256(keySchedule[8], keySchedule[9], keySchedule[6],
  ------------------
  |  |   93|    340|    EXPAND_KEY256_PART(res1, rcon, k1, k2, 0xFF); \
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  |  |   94|    340|    EXPAND_KEY256_PART(res2, 0x00, k2, res1, 0xAA)
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  ------------------
  112|    340|                  keySchedule[7], 0x08);
  113|    340|    EXPAND_KEY256(keySchedule[10], keySchedule[11], keySchedule[8],
  ------------------
  |  |   93|    340|    EXPAND_KEY256_PART(res1, rcon, k1, k2, 0xFF); \
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  |  |   94|    340|    EXPAND_KEY256_PART(res2, 0x00, k2, res1, 0xAA)
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  ------------------
  114|    340|                  keySchedule[9], 0x10);
  115|    340|    EXPAND_KEY256(keySchedule[12], keySchedule[13], keySchedule[10],
  ------------------
  |  |   93|    340|    EXPAND_KEY256_PART(res1, rcon, k1, k2, 0xFF); \
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  |  |   94|    340|    EXPAND_KEY256_PART(res2, 0x00, k2, res1, 0xAA)
  |  |  ------------------
  |  |  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  |  |  ------------------
  ------------------
  116|    340|                  keySchedule[11], 0x20);
  117|    340|    EXPAND_KEY256_PART(keySchedule[14], 0x40, keySchedule[12],
  ------------------
  |  |   85|    340|    tmp_key = _mm_shuffle_epi32(_mm_aeskeygenassist_si128(k2x, rconx), X);    \
  |  |   86|    340|    tmp2 = _mm_slli_si128(k1x, 4);                                            \
  |  |   87|    340|    tmp1 = _mm_xor_si128(k1x, tmp2);                                          \
  |  |   88|    340|    tmp2 = _mm_slli_si128(tmp2, 4);                                           \
  |  |   89|    340|    tmp1 = _mm_xor_si128(_mm_xor_si128(tmp1, tmp2), _mm_slli_si128(tmp2, 4)); \
  |  |   90|    340|    res = _mm_xor_si128(tmp1, tmp_key);
  ------------------
  118|    340|                       keySchedule[13], 0xFF);
  119|    340|}

HMAC_Destroy:
   27|  34.4k|{
   28|  34.4k|    if (cx == NULL)
  ------------------
  |  Branch (28:9): [True: 0, False: 34.4k]
  ------------------
   29|      0|        return;
   30|       |
   31|  34.4k|    PORT_Assert(!freeit == !cx->wasAllocated);
  ------------------
  |  |  120|  34.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  34.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 34.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   32|  34.4k|    if (cx->hash != NULL) {
  ------------------
  |  Branch (32:9): [True: 34.4k, False: 0]
  ------------------
   33|  34.4k|        cx->hashobj->destroy(cx->hash, PR_TRUE);
  ------------------
  |  |  437|  34.4k|#define PR_TRUE 1
  ------------------
   34|  34.4k|        PORT_Memset(cx, 0, sizeof *cx);
  ------------------
  |  |  182|  34.4k|#define PORT_Memset memset
  ------------------
   35|  34.4k|    }
   36|  34.4k|    if (freeit)
  ------------------
  |  Branch (36:9): [True: 34.4k, False: 0]
  ------------------
   37|  34.4k|        PORT_Free(cx);
  ------------------
  |  |   60|  34.4k|#define PORT_Free PORT_Free_Util
  ------------------
   38|  34.4k|}
HMAC_Init:
   85|  34.4k|{
   86|  34.4k|    SECStatus rv;
   87|       |
   88|  34.4k|    if (cx == NULL) {
  ------------------
  |  Branch (88:9): [True: 0, False: 34.4k]
  ------------------
   89|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   90|      0|        return SECFailure;
   91|      0|    }
   92|  34.4k|    cx->wasAllocated = PR_FALSE;
  ------------------
  |  |  438|  34.4k|#define PR_FALSE 0
  ------------------
   93|  34.4k|    cx->hashobj = hash_obj;
   94|  34.4k|    cx->hash = cx->hashobj->create();
   95|  34.4k|    if (cx->hash == NULL)
  ------------------
  |  Branch (95:9): [True: 0, False: 34.4k]
  ------------------
   96|      0|        goto loser;
   97|       |
   98|  34.4k|    rv = hmac_initKey(cx, secret, secret_len, isFIPS);
   99|  34.4k|    if (rv != SECSuccess)
  ------------------
  |  Branch (99:9): [True: 0, False: 34.4k]
  ------------------
  100|      0|        goto loser;
  101|       |
  102|  34.4k|    return rv;
  103|      0|loser:
  104|      0|    if (cx->hash != NULL)
  ------------------
  |  Branch (104:9): [True: 0, False: 0]
  ------------------
  105|      0|        cx->hashobj->destroy(cx->hash, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  106|      0|    return SECFailure;
  107|  34.4k|}
HMAC_Create:
  112|  34.4k|{
  113|  34.4k|    SECStatus rv;
  114|  34.4k|    HMACContext *cx = PORT_ZNew(HMACContext);
  ------------------
  |  |  148|  34.4k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  34.4k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  115|  34.4k|    if (cx == NULL)
  ------------------
  |  Branch (115:9): [True: 0, False: 34.4k]
  ------------------
  116|      0|        return NULL;
  117|  34.4k|    rv = HMAC_Init(cx, hash_obj, secret, secret_len, isFIPS);
  118|  34.4k|    cx->wasAllocated = PR_TRUE;
  ------------------
  |  |  437|  34.4k|#define PR_TRUE 1
  ------------------
  119|  34.4k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (119:9): [True: 0, False: 34.4k]
  ------------------
  120|      0|        PORT_Free(cx); /* contains no secret info */
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  121|      0|        cx = NULL;
  122|      0|    }
  123|  34.4k|    return cx;
  124|  34.4k|}
HMAC_Begin:
  156|  61.1k|{
  157|       |    /* start inner hash */
  158|  61.1k|    cx->hashobj->begin(cx->hash);
  159|  61.1k|    cx->hashobj->update(cx->hash, cx->ipad, cx->hashobj->blocklength);
  160|  61.1k|}
HMAC_Update:
  164|   102k|{
  165|   102k|    cx->hashobj->update(cx->hash, data, data_len);
  166|   102k|}
HMAC_Finish:
  171|  57.9k|{
  172|  57.9k|    if (max_result_len < cx->hashobj->length) {
  ------------------
  |  Branch (172:9): [True: 0, False: 57.9k]
  ------------------
  173|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  174|      0|        return SECFailure;
  175|      0|    }
  176|       |
  177|  57.9k|    cx->hashobj->end(cx->hash, result, result_len, max_result_len);
  178|  57.9k|    if (*result_len != cx->hashobj->length)
  ------------------
  |  Branch (178:9): [True: 0, False: 57.9k]
  ------------------
  179|      0|        return SECFailure;
  180|       |
  181|  57.9k|    cx->hashobj->begin(cx->hash);
  182|  57.9k|    cx->hashobj->update(cx->hash, cx->opad, cx->hashobj->blocklength);
  183|  57.9k|    cx->hashobj->update(cx->hash, result, *result_len);
  184|  57.9k|    cx->hashobj->end(cx->hash, result, result_len, max_result_len);
  185|  57.9k|    return SECSuccess;
  186|  57.9k|}
alghmac.c:hmac_initKey:
   43|  34.4k|{
   44|  34.4k|    unsigned int i;
   45|  34.4k|    unsigned char hashed_secret[HASH_LENGTH_MAX];
   46|       |
   47|       |    /* required by FIPS 198 Section 3 */
   48|  34.4k|    if (isFIPS && secret_len < cx->hashobj->length / 2) {
  ------------------
  |  Branch (48:9): [True: 0, False: 34.4k]
  |  Branch (48:19): [True: 0, False: 0]
  ------------------
   49|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   50|      0|        return SECFailure;
   51|      0|    }
   52|       |
   53|  34.4k|    if (secret_len > cx->hashobj->blocklength) {
  ------------------
  |  Branch (53:9): [True: 472, False: 33.9k]
  ------------------
   54|    472|        cx->hashobj->begin(cx->hash);
   55|    472|        cx->hashobj->update(cx->hash, secret, secret_len);
   56|    472|        PORT_Assert(cx->hashobj->length <= sizeof hashed_secret);
  ------------------
  |  |  120|    472|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    472|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 472, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|    472|        cx->hashobj->end(cx->hash, hashed_secret, &secret_len,
   58|    472|                         sizeof hashed_secret);
   59|    472|        if (secret_len != cx->hashobj->length) {
  ------------------
  |  Branch (59:13): [True: 0, False: 472]
  ------------------
   60|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   61|      0|            goto loser;
   62|      0|        }
   63|    472|        secret = (const unsigned char *)&hashed_secret[0];
   64|    472|    }
   65|       |
   66|  34.4k|    PORT_Memset(cx->ipad, 0x36, cx->hashobj->blocklength);
  ------------------
  |  |  182|  34.4k|#define PORT_Memset memset
  ------------------
   67|  34.4k|    PORT_Memset(cx->opad, 0x5c, cx->hashobj->blocklength);
  ------------------
  |  |  182|  34.4k|#define PORT_Memset memset
  ------------------
   68|       |
   69|       |    /* fold secret into padding */
   70|  1.37M|    for (i = 0; i < secret_len; i++) {
  ------------------
  |  Branch (70:17): [True: 1.33M, False: 34.4k]
  ------------------
   71|  1.33M|        cx->ipad[i] ^= secret[i];
   72|  1.33M|        cx->opad[i] ^= secret[i];
   73|  1.33M|    }
   74|  34.4k|    PORT_Memset(hashed_secret, 0, sizeof hashed_secret);
  ------------------
  |  |  182|  34.4k|#define PORT_Memset memset
  ------------------
   75|  34.4k|    return SECSuccess;
   76|       |
   77|      0|loser:
   78|      0|    PORT_Memset(hashed_secret, 0, sizeof hashed_secret);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
   79|      0|    return SECFailure;
   80|  34.4k|}

CheckX86CPUSupport:
  102|      1|{
  103|      1|    unsigned long eax, ebx, ecx, edx;
  104|      1|    unsigned long eax7, ebx7, ecx7, edx7;
  105|      1|    char *disable_hw_aes = PR_GetEnvSecure("NSS_DISABLE_HW_AES");
  106|      1|    char *disable_pclmul = PR_GetEnvSecure("NSS_DISABLE_PCLMUL");
  107|      1|    char *disable_hw_sha = PR_GetEnvSecure("NSS_DISABLE_HW_SHA");
  108|      1|    char *disable_avx = PR_GetEnvSecure("NSS_DISABLE_AVX");
  109|      1|    char *disable_avx2 = PR_GetEnvSecure("NSS_DISABLE_AVX2");
  110|      1|    char *disable_adx = PR_GetEnvSecure("NSS_DISABLE_ADX");
  111|      1|    char *disable_ssse3 = PR_GetEnvSecure("NSS_DISABLE_SSSE3");
  112|      1|    char *disable_sse4_1 = PR_GetEnvSecure("NSS_DISABLE_SSE4_1");
  113|      1|    char *disable_sse4_2 = PR_GetEnvSecure("NSS_DISABLE_SSE4_2");
  114|      1|    freebl_cpuid(1, &eax, &ebx, &ecx, &edx);
  115|      1|    freebl_cpuid(7, &eax7, &ebx7, &ecx7, &edx7);
  116|      1|    aesni_support_ = (PRBool)((ecx & ECX_AESNI) != 0 && disable_hw_aes == NULL);
  ------------------
  |  |   81|      1|#define ECX_AESNI (1 << 25)
  ------------------
  |  Branch (116:31): [True: 1, False: 0]
  |  Branch (116:57): [True: 1, False: 0]
  ------------------
  117|      1|    clmul_support_ = (PRBool)((ecx & ECX_CLMUL) != 0 && disable_pclmul == NULL);
  ------------------
  |  |   82|      1|#define ECX_CLMUL (1 << 1)
  ------------------
  |  Branch (117:31): [True: 1, False: 0]
  |  Branch (117:57): [True: 1, False: 0]
  ------------------
  118|      1|    sha_support_ = (PRBool)((ebx7 & EBX_SHA) != 0 && disable_hw_sha == NULL);
  ------------------
  |  |   90|      1|#define EBX_SHA (1 << 29)
  ------------------
  |  Branch (118:29): [True: 1, False: 0]
  |  Branch (118:54): [True: 1, False: 0]
  ------------------
  119|       |    /* For AVX we ensure that:
  120|       |     *  - The AVX, OSXSAVE, and XSAVE bits of ECX from CPUID(EAX=1) are set, and
  121|       |     *  - the SSE and AVX state bits of XCR0 are set (check_xcr0_ymm).
  122|       |     */
  123|      1|    avx_support_ = (PRBool)((ecx & AVX_BITS) == AVX_BITS) && check_xcr0_ymm() &&
  ------------------
  |  |   96|      1|#define AVX_BITS (ECX_XSAVE | ECX_OSXSAVE | ECX_AVX)
  |  |  ------------------
  |  |  |  |   83|      1|#define ECX_XSAVE (1 << 26)
  |  |  ------------------
  |  |               #define AVX_BITS (ECX_XSAVE | ECX_OSXSAVE | ECX_AVX)
  |  |  ------------------
  |  |  |  |   84|      1|#define ECX_OSXSAVE (1 << 27)
  |  |  ------------------
  |  |               #define AVX_BITS (ECX_XSAVE | ECX_OSXSAVE | ECX_AVX)
  |  |  ------------------
  |  |  |  |   85|      1|#define ECX_AVX (1 << 28)
  |  |  ------------------
  ------------------
                  avx_support_ = (PRBool)((ecx & AVX_BITS) == AVX_BITS) && check_xcr0_ymm() &&
  ------------------
  |  |   96|      1|#define AVX_BITS (ECX_XSAVE | ECX_OSXSAVE | ECX_AVX)
  |  |  ------------------
  |  |  |  |   83|      1|#define ECX_XSAVE (1 << 26)
  |  |  ------------------
  |  |               #define AVX_BITS (ECX_XSAVE | ECX_OSXSAVE | ECX_AVX)
  |  |  ------------------
  |  |  |  |   84|      1|#define ECX_OSXSAVE (1 << 27)
  |  |  ------------------
  |  |               #define AVX_BITS (ECX_XSAVE | ECX_OSXSAVE | ECX_AVX)
  |  |  ------------------
  |  |  |  |   85|      1|#define ECX_AVX (1 << 28)
  |  |  ------------------
  ------------------
  |  Branch (123:20): [True: 1, False: 0]
  |  Branch (123:62): [True: 1, False: 0]
  ------------------
  124|      1|                   disable_avx == NULL;
  ------------------
  |  Branch (124:20): [True: 1, False: 0]
  ------------------
  125|       |    /* For AVX2 we ensure that:
  126|       |     *  - AVX is supported,
  127|       |     *  - the AVX2, BMI1, and BMI2 bits of EBX from CPUID(EAX=7) are set, and
  128|       |     *  - the FMA, and MOVBE bits of ECX from CPUID(EAX=1) are set.
  129|       |     * We do not check for LZCNT support.
  130|       |     */
  131|      1|    avx2_support_ = (PRBool)(avx_support_ == PR_TRUE &&
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
  |  Branch (131:30): [True: 1, False: 0]
  ------------------
  132|      1|                             (ebx7 & AVX2_EBX_BITS) == AVX2_EBX_BITS &&
  ------------------
  |  |   97|      1|#define AVX2_EBX_BITS (EBX_AVX2 | EBX_BMI1 | EBX_BMI2)
  |  |  ------------------
  |  |  |  |   86|      1|#define EBX_AVX2 (1 << 5)
  |  |  ------------------
  |  |               #define AVX2_EBX_BITS (EBX_AVX2 | EBX_BMI1 | EBX_BMI2)
  |  |  ------------------
  |  |  |  |   88|      1|#define EBX_BMI1 (1 << 3)
  |  |  ------------------
  |  |               #define AVX2_EBX_BITS (EBX_AVX2 | EBX_BMI1 | EBX_BMI2)
  |  |  ------------------
  |  |  |  |   89|      1|#define EBX_BMI2 (1 << 8)
  |  |  ------------------
  ------------------
                                           (ebx7 & AVX2_EBX_BITS) == AVX2_EBX_BITS &&
  ------------------
  |  |   97|      2|#define AVX2_EBX_BITS (EBX_AVX2 | EBX_BMI1 | EBX_BMI2)
  |  |  ------------------
  |  |  |  |   86|      1|#define EBX_AVX2 (1 << 5)
  |  |  ------------------
  |  |               #define AVX2_EBX_BITS (EBX_AVX2 | EBX_BMI1 | EBX_BMI2)
  |  |  ------------------
  |  |  |  |   88|      1|#define EBX_BMI1 (1 << 3)
  |  |  ------------------
  |  |               #define AVX2_EBX_BITS (EBX_AVX2 | EBX_BMI1 | EBX_BMI2)
  |  |  ------------------
  |  |  |  |   89|      1|#define EBX_BMI2 (1 << 8)
  |  |  ------------------
  ------------------
  |  Branch (132:30): [True: 1, False: 0]
  ------------------
  133|      1|                             (ecx & AVX2_ECX_BITS) == AVX2_ECX_BITS &&
  ------------------
  |  |   98|      1|#define AVX2_ECX_BITS (ECX_FMA | ECX_MOVBE)
  |  |  ------------------
  |  |  |  |   91|      1|#define ECX_FMA (1 << 12)
  |  |  ------------------
  |  |               #define AVX2_ECX_BITS (ECX_FMA | ECX_MOVBE)
  |  |  ------------------
  |  |  |  |   92|      1|#define ECX_MOVBE (1 << 22)
  |  |  ------------------
  ------------------
                                           (ecx & AVX2_ECX_BITS) == AVX2_ECX_BITS &&
  ------------------
  |  |   98|      2|#define AVX2_ECX_BITS (ECX_FMA | ECX_MOVBE)
  |  |  ------------------
  |  |  |  |   91|      1|#define ECX_FMA (1 << 12)
  |  |  ------------------
  |  |               #define AVX2_ECX_BITS (ECX_FMA | ECX_MOVBE)
  |  |  ------------------
  |  |  |  |   92|      1|#define ECX_MOVBE (1 << 22)
  |  |  ------------------
  ------------------
  |  Branch (133:30): [True: 1, False: 0]
  ------------------
  134|      1|                             disable_avx2 == NULL);
  ------------------
  |  Branch (134:30): [True: 1, False: 0]
  ------------------
  135|       |    /* CPUID.(EAX=07H, ECX=0H):EBX.ADX[bit 19]=1 indicates
  136|       |    the processor supports ADCX and ADOX instructions.*/
  137|      1|    adx_support_ = (PRBool)((ebx7 & EBX_ADX) != 0 && disable_adx == NULL);
  ------------------
  |  |   87|      1|#define EBX_ADX (1 << 19)
  ------------------
  |  Branch (137:29): [True: 1, False: 0]
  |  Branch (137:54): [True: 1, False: 0]
  ------------------
  138|      1|    ssse3_support_ = (PRBool)((ecx & ECX_SSSE3) != 0 &&
  ------------------
  |  |   93|      1|#define ECX_SSSE3 (1 << 9)
  ------------------
  |  Branch (138:31): [True: 1, False: 0]
  ------------------
  139|      1|                              disable_ssse3 == NULL);
  ------------------
  |  Branch (139:31): [True: 1, False: 0]
  ------------------
  140|      1|    sse4_1_support_ = (PRBool)((ecx & ECX_SSE4_1) != 0 &&
  ------------------
  |  |   94|      1|#define ECX_SSE4_1 (1 << 19)
  ------------------
  |  Branch (140:32): [True: 1, False: 0]
  ------------------
  141|      1|                               disable_sse4_1 == NULL);
  ------------------
  |  Branch (141:32): [True: 1, False: 0]
  ------------------
  142|      1|    sse4_2_support_ = (PRBool)((ecx & ECX_SSE4_2) != 0 &&
  ------------------
  |  |   95|      1|#define ECX_SSE4_2 (1 << 20)
  ------------------
  |  Branch (142:32): [True: 1, False: 0]
  ------------------
  143|      1|                               disable_sse4_2 == NULL);
  ------------------
  |  Branch (143:32): [True: 1, False: 0]
  ------------------
  144|      1|}
aesni_support:
  440|  3.00k|{
  441|  3.00k|    return aesni_support_;
  442|  3.00k|}
clmul_support:
  445|  1.24k|{
  446|  1.24k|    return clmul_support_;
  447|  1.24k|}
sha_support:
  450|  84.6k|{
  451|  84.6k|    return sha_support_;
  452|  84.6k|}
ssse3_support:
  470|  84.6k|{
  471|  84.6k|    return ssse3_support_;
  472|  84.6k|}
sse4_1_support:
  475|  84.6k|{
  476|  84.6k|    return sse4_1_support_;
  477|  84.6k|}
arm_sha2_support:
  505|  84.6k|{
  506|  84.6k|    return arm_sha2_support_;
  507|  84.6k|}
BL_Init:
  576|      1|{
  577|      1|    if (PR_CallOnce(&coFreeblInit, FreeblInit) != PR_SUCCESS) {
  ------------------
  |  Branch (577:9): [True: 0, False: 1]
  ------------------
  578|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  579|      0|        return SECFailure;
  580|      0|    }
  581|      1|    RSA_Init();
  582|       |
  583|      1|    return SECSuccess;
  584|      1|}
blinit.c:check_xcr0_ymm:
   58|      1|{
   59|      1|    PRUint32 xcr0;
   60|       |#if defined(_MSC_VER)
   61|       |#if defined(_M_IX86)
   62|       |    __asm {
   63|       |        mov ecx, 0
   64|       |        xgetbv
   65|       |        mov xcr0, eax
   66|       |    }
   67|       |#else
   68|       |    xcr0 = (PRUint32)_xgetbv(0); /* Requires VS2010 SP1 or later. */
   69|       |#endif /* _M_IX86 */
   70|       |#else  /* _MSC_VER */
   71|       |    /* Old OSX compilers don't support xgetbv. Use byte form. */
   72|      1|    __asm__(".byte 0x0F, 0x01, 0xd0"
   73|      1|            : "=a"(xcr0)
   74|      1|            : "c"(0)
   75|      1|            : "%edx");
   76|      1|#endif /* _MSC_VER */
   77|       |    /* Check if xmm and ymm state are enabled in XCR0. */
   78|      1|    return (xcr0 & 6) == 6;
   79|      1|}
blinit.c:FreeblInit:
  563|      1|{
  564|      1|#ifdef NSS_X86_OR_X64
  565|      1|    CheckX86CPUSupport();
  566|       |#elif (defined(__aarch64__) || defined(__arm__))
  567|       |    CheckARMSupport();
  568|       |#elif (defined(__powerpc__))
  569|       |    CheckPPCSupport();
  570|       |#endif
  571|      1|    return PR_SUCCESS;
  572|      1|}

camellia_setup128:
  435|     46|{
  436|     46|    PRUint32 kll, klr, krl, krr;
  437|     46|    PRUint32 il, ir, t0, t1, w0, w1;
  438|     46|    PRUint32 kw4l, kw4r, dw, tl, tr;
  439|     46|    PRUint32 subL[26];
  440|     46|    PRUint32 subR[26];
  441|       |#if defined(CAMELLIA_NEED_TMP_VARIABLE)
  442|       |    PRUint32 tmp;
  443|       |#endif
  444|       |
  445|       |    /**
  446|       |     *  k == kll || klr || krl || krr (|| is concatination)
  447|       |     */
  448|     46|    kll = GETU32(key);
  ------------------
  |  |   45|     46|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     46|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  449|     46|    klr = GETU32(key + 4);
  ------------------
  |  |   45|     46|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     46|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  450|     46|    krl = GETU32(key + 8);
  ------------------
  |  |   45|     46|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     46|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  451|     46|    krr = GETU32(key + 12);
  ------------------
  |  |   45|     46|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     46|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  452|       |    /**
  453|       |     * generate KL dependent subkeys
  454|       |     */
  455|     46|    subl(0) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  456|     46|    subr(0) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  457|     46|    subl(1) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  458|     46|    subr(1) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  459|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 15);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  460|     46|    subl(4) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  461|     46|    subr(4) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  462|     46|    subl(5) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  463|     46|    subr(5) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  464|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 30);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  465|     46|    subl(10) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  466|     46|    subr(10) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  467|     46|    subl(11) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  468|     46|    subr(11) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  469|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 15);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  470|     46|    subl(13) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  471|     46|    subr(13) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  472|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 17);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  473|     46|    subl(16) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  474|     46|    subr(16) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  475|     46|    subl(17) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  476|     46|    subr(17) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  477|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 17);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  478|     46|    subl(18) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  479|     46|    subr(18) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  480|     46|    subl(19) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  481|     46|    subr(19) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  482|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 17);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  483|     46|    subl(22) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  484|     46|    subr(22) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  485|     46|    subl(23) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  486|     46|    subr(23) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  487|       |
  488|       |    /* generate KA */
  489|     46|    kll = subl(0);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  490|     46|    klr = subr(0);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  491|     46|    krl = subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  492|     46|    krr = subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  493|     46|    CAMELLIA_F(kll, klr,
  ------------------
  |  |  101|     46|    do {                                                   \
  |  |  102|     46|        il = xl ^ kl;                                      \
  |  |  103|     46|        ir = xr ^ kr;                                      \
  |  |  104|     46|        t0 = il >> 16;                                     \
  |  |  105|     46|        t1 = ir >> 16;                                     \
  |  |  106|     46|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     46|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     46|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     46|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     46|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     46|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     46|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     46|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     46|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     46|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     46|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     46|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     46|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     46|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     46|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     46|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     46|        yl ^= yr;                                          \
  |  |  115|     46|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     46|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     46|        yr ^= yl;                                          \
  |  |  117|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  494|     46|               CAMELLIA_SIGMA1L, CAMELLIA_SIGMA1R,
  495|     46|               w0, w1, il, ir, t0, t1);
  496|     46|    krl ^= w0;
  497|     46|    krr ^= w1;
  498|     46|    CAMELLIA_F(krl, krr,
  ------------------
  |  |  101|     46|    do {                                                   \
  |  |  102|     46|        il = xl ^ kl;                                      \
  |  |  103|     46|        ir = xr ^ kr;                                      \
  |  |  104|     46|        t0 = il >> 16;                                     \
  |  |  105|     46|        t1 = ir >> 16;                                     \
  |  |  106|     46|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     46|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     46|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     46|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     46|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     46|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     46|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     46|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     46|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     46|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     46|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     46|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     46|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     46|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     46|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     46|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     46|        yl ^= yr;                                          \
  |  |  115|     46|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     46|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     46|        yr ^= yl;                                          \
  |  |  117|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  499|     46|               CAMELLIA_SIGMA2L, CAMELLIA_SIGMA2R,
  500|     46|               kll, klr, il, ir, t0, t1);
  501|     46|    CAMELLIA_F(kll, klr,
  ------------------
  |  |  101|     46|    do {                                                   \
  |  |  102|     46|        il = xl ^ kl;                                      \
  |  |  103|     46|        ir = xr ^ kr;                                      \
  |  |  104|     46|        t0 = il >> 16;                                     \
  |  |  105|     46|        t1 = ir >> 16;                                     \
  |  |  106|     46|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     46|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     46|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     46|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     46|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     46|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     46|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     46|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     46|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     46|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     46|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     46|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     46|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     46|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     46|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     46|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     46|        yl ^= yr;                                          \
  |  |  115|     46|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     46|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     46|        yr ^= yl;                                          \
  |  |  117|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  502|     46|               CAMELLIA_SIGMA3L, CAMELLIA_SIGMA3R,
  503|     46|               krl, krr, il, ir, t0, t1);
  504|     46|    krl ^= w0;
  505|     46|    krr ^= w1;
  506|     46|    CAMELLIA_F(krl, krr,
  ------------------
  |  |  101|     46|    do {                                                   \
  |  |  102|     46|        il = xl ^ kl;                                      \
  |  |  103|     46|        ir = xr ^ kr;                                      \
  |  |  104|     46|        t0 = il >> 16;                                     \
  |  |  105|     46|        t1 = ir >> 16;                                     \
  |  |  106|     46|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     46|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     46|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     46|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     46|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     46|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     46|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     46|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     46|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     46|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     46|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     46|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     46|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     46|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     46|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     46|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     46|        yl ^= yr;                                          \
  |  |  115|     46|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     46|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     46|        yr ^= yl;                                          \
  |  |  117|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  507|     46|               CAMELLIA_SIGMA4L, CAMELLIA_SIGMA4R,
  508|     46|               w0, w1, il, ir, t0, t1);
  509|     46|    kll ^= w0;
  510|     46|    klr ^= w1;
  511|       |
  512|       |    /* generate KA dependent subkeys */
  513|     46|    subl(2) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  514|     46|    subr(2) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  515|     46|    subl(3) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  516|     46|    subr(3) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  517|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 15);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  518|     46|    subl(6) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  519|     46|    subr(6) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  520|     46|    subl(7) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  521|     46|    subr(7) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  522|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 15);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  523|     46|    subl(8) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  524|     46|    subr(8) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  525|     46|    subl(9) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  526|     46|    subr(9) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  527|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 15);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  528|     46|    subl(12) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  529|     46|    subr(12) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  530|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 15);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  531|     46|    subl(14) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  532|     46|    subr(14) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  533|     46|    subl(15) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  534|     46|    subr(15) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  535|     46|    CAMELLIA_ROLDQo32(kll, klr, krl, krr, w0, w1, 34);
  ------------------
  |  |   86|     46|    do {                                                \
  |  |   87|     46|        w0 = ll;                                        \
  |  |   88|     46|        w1 = lr;                                        \
  |  |   89|     46|        ll = (lr << (bits - 32)) + (rl >> (64 - bits)); \
  |  |   90|     46|        lr = (rl << (bits - 32)) + (rr >> (64 - bits)); \
  |  |   91|     46|        rl = (rr << (bits - 32)) + (w0 >> (64 - bits)); \
  |  |   92|     46|        rr = (w0 << (bits - 32)) + (w1 >> (64 - bits)); \
  |  |   93|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (93:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  536|     46|    subl(20) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  537|     46|    subr(20) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  538|     46|    subl(21) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  539|     46|    subr(21) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  540|     46|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 17);
  ------------------
  |  |   77|     46|    do {                                             \
  |  |   78|     46|        w0 = ll;                                     \
  |  |   79|     46|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     46|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     46|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     46|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  541|     46|    subl(24) = kll;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  542|     46|    subr(24) = klr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  543|     46|    subl(25) = krl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  544|     46|    subr(25) = krr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  545|       |
  546|       |    /* absorb kw2 to other subkeys */
  547|     46|    subl(3) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(3) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  548|     46|    subr(3) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(3) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  549|     46|    subl(5) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(5) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  550|     46|    subr(5) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(5) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  551|     46|    subl(7) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(7) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  552|     46|    subr(7) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(7) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  553|     46|    subl(1) ^= subr(1) & ~subr(9);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(9);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(9);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  554|     46|    dw = subl(1) & subl(9), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(9), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(9), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  dw = subl(1) & subl(9), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     46|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  555|     46|    subl(11) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(11) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  556|     46|    subr(11) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(11) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  557|     46|    subl(13) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(13) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  558|     46|    subr(13) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(13) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  559|     46|    subl(15) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(15) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  560|     46|    subr(15) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(15) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  561|     46|    subl(1) ^= subr(1) & ~subr(17);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(17);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(17);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  562|     46|    dw = subl(1) & subl(17), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(17), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(17), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  dw = subl(1) & subl(17), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     46|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  563|     46|    subl(19) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(19) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  564|     46|    subr(19) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(19) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  565|     46|    subl(21) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(21) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  566|     46|    subr(21) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(21) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  567|     46|    subl(23) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(23) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  568|     46|    subr(23) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(23) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  569|     46|    subl(24) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  subl(24) ^= subl(1);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  570|     46|    subr(24) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  subr(24) ^= subr(1);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  571|       |
  572|       |    /* absorb kw4 to other subkeys */
  573|     46|    kw4l = subl(25);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  574|     46|    kw4r = subr(25);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  575|     46|    subl(22) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  576|     46|    subr(22) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  577|     46|    subl(20) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  578|     46|    subr(20) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  579|     46|    subl(18) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  580|     46|    subr(18) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  581|     46|    kw4l ^= kw4r & ~subr(16);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  582|     46|    dw = kw4l & subl(16), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = kw4l & subl(16), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     46|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  583|     46|    subl(14) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  584|     46|    subr(14) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  585|     46|    subl(12) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  586|     46|    subr(12) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  587|     46|    subl(10) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  588|     46|    subr(10) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  589|     46|    kw4l ^= kw4r & ~subr(8);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  590|     46|    dw = kw4l & subl(8), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = kw4l & subl(8), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     46|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  591|     46|    subl(6) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  592|     46|    subr(6) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  593|     46|    subl(4) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  594|     46|    subr(4) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  595|     46|    subl(2) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  596|     46|    subr(2) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  597|     46|    subl(0) ^= kw4l;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  598|     46|    subr(0) ^= kw4r;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  599|       |
  600|       |    /* key XOR is end of F-function */
  601|     46|    CamelliaSubkeyL(0) = subl(0) ^ subl(2);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(0) = subl(0) ^ subl(2);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(0) = subl(0) ^ subl(2);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  602|     46|    CamelliaSubkeyR(0) = subr(0) ^ subr(2);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(0) = subr(0) ^ subr(2);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(0) = subr(0) ^ subr(2);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  603|     46|    CamelliaSubkeyL(2) = subl(3);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(2) = subl(3);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  604|     46|    CamelliaSubkeyR(2) = subr(3);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(2) = subr(3);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  605|     46|    CamelliaSubkeyL(3) = subl(2) ^ subl(4);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(3) = subl(2) ^ subl(4);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(3) = subl(2) ^ subl(4);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  606|     46|    CamelliaSubkeyR(3) = subr(2) ^ subr(4);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(3) = subr(2) ^ subr(4);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(3) = subr(2) ^ subr(4);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  607|     46|    CamelliaSubkeyL(4) = subl(3) ^ subl(5);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(4) = subl(3) ^ subl(5);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(4) = subl(3) ^ subl(5);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  608|     46|    CamelliaSubkeyR(4) = subr(3) ^ subr(5);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(4) = subr(3) ^ subr(5);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(4) = subr(3) ^ subr(5);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  609|     46|    CamelliaSubkeyL(5) = subl(4) ^ subl(6);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(5) = subl(4) ^ subl(6);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(5) = subl(4) ^ subl(6);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  610|     46|    CamelliaSubkeyR(5) = subr(4) ^ subr(6);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(5) = subr(4) ^ subr(6);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(5) = subr(4) ^ subr(6);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  611|     46|    CamelliaSubkeyL(6) = subl(5) ^ subl(7);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(6) = subl(5) ^ subl(7);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(6) = subl(5) ^ subl(7);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  612|     46|    CamelliaSubkeyR(6) = subr(5) ^ subr(7);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(6) = subr(5) ^ subr(7);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(6) = subr(5) ^ subr(7);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  613|     46|    tl = subl(10) ^ (subr(10) & ~subr(8));
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(10) ^ (subr(10) & ~subr(8));
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(10) ^ (subr(10) & ~subr(8));
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  614|     46|    dw = tl & subl(8), tr = subr(10) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(8), tr = subr(10) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(8), tr = subr(10) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     46|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  615|     46|    CamelliaSubkeyL(7) = subl(6) ^ tl;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(7) = subl(6) ^ tl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  616|     46|    CamelliaSubkeyR(7) = subr(6) ^ tr;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(7) = subr(6) ^ tr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  617|     46|    CamelliaSubkeyL(8) = subl(8);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(8) = subl(8);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  618|     46|    CamelliaSubkeyR(8) = subr(8);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(8) = subr(8);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  619|     46|    CamelliaSubkeyL(9) = subl(9);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(9) = subl(9);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  620|     46|    CamelliaSubkeyR(9) = subr(9);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(9) = subr(9);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  621|     46|    tl = subl(7) ^ (subr(7) & ~subr(9));
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(7) ^ (subr(7) & ~subr(9));
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(7) ^ (subr(7) & ~subr(9));
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  622|     46|    dw = tl & subl(9), tr = subr(7) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(9), tr = subr(7) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(9), tr = subr(7) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     46|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  623|     46|    CamelliaSubkeyL(10) = tl ^ subl(11);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(10) = tl ^ subl(11);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  624|     46|    CamelliaSubkeyR(10) = tr ^ subr(11);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(10) = tr ^ subr(11);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  625|     46|    CamelliaSubkeyL(11) = subl(10) ^ subl(12);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(11) = subl(10) ^ subl(12);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(11) = subl(10) ^ subl(12);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  626|     46|    CamelliaSubkeyR(11) = subr(10) ^ subr(12);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(11) = subr(10) ^ subr(12);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(11) = subr(10) ^ subr(12);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  627|     46|    CamelliaSubkeyL(12) = subl(11) ^ subl(13);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(12) = subl(11) ^ subl(13);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(12) = subl(11) ^ subl(13);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  628|     46|    CamelliaSubkeyR(12) = subr(11) ^ subr(13);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(12) = subr(11) ^ subr(13);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(12) = subr(11) ^ subr(13);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  629|     46|    CamelliaSubkeyL(13) = subl(12) ^ subl(14);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(13) = subl(12) ^ subl(14);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(13) = subl(12) ^ subl(14);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  630|     46|    CamelliaSubkeyR(13) = subr(12) ^ subr(14);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(13) = subr(12) ^ subr(14);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(13) = subr(12) ^ subr(14);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  631|     46|    CamelliaSubkeyL(14) = subl(13) ^ subl(15);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(14) = subl(13) ^ subl(15);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(14) = subl(13) ^ subl(15);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  632|     46|    CamelliaSubkeyR(14) = subr(13) ^ subr(15);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(14) = subr(13) ^ subr(15);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(14) = subr(13) ^ subr(15);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  633|     46|    tl = subl(18) ^ (subr(18) & ~subr(16));
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(18) ^ (subr(18) & ~subr(16));
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(18) ^ (subr(18) & ~subr(16));
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  634|     46|    dw = tl & subl(16), tr = subr(18) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(16), tr = subr(18) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(16), tr = subr(18) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     46|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  635|     46|    CamelliaSubkeyL(15) = subl(14) ^ tl;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(15) = subl(14) ^ tl;
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  636|     46|    CamelliaSubkeyR(15) = subr(14) ^ tr;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(15) = subr(14) ^ tr;
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  637|     46|    CamelliaSubkeyL(16) = subl(16);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(16) = subl(16);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  638|     46|    CamelliaSubkeyR(16) = subr(16);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(16) = subr(16);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  639|     46|    CamelliaSubkeyL(17) = subl(17);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(17) = subl(17);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  640|     46|    CamelliaSubkeyR(17) = subr(17);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(17) = subr(17);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  641|     46|    tl = subl(15) ^ (subr(15) & ~subr(17));
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(15) ^ (subr(15) & ~subr(17));
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(15) ^ (subr(15) & ~subr(17));
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  642|     46|    dw = tl & subl(17), tr = subr(15) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(17), tr = subr(15) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(17), tr = subr(15) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     46|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  643|     46|    CamelliaSubkeyL(18) = tl ^ subl(19);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(18) = tl ^ subl(19);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  644|     46|    CamelliaSubkeyR(18) = tr ^ subr(19);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(18) = tr ^ subr(19);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  645|     46|    CamelliaSubkeyL(19) = subl(18) ^ subl(20);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(19) = subl(18) ^ subl(20);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(19) = subl(18) ^ subl(20);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  646|     46|    CamelliaSubkeyR(19) = subr(18) ^ subr(20);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(19) = subr(18) ^ subr(20);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(19) = subr(18) ^ subr(20);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  647|     46|    CamelliaSubkeyL(20) = subl(19) ^ subl(21);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(20) = subl(19) ^ subl(21);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(20) = subl(19) ^ subl(21);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  648|     46|    CamelliaSubkeyR(20) = subr(19) ^ subr(21);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(20) = subr(19) ^ subr(21);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(20) = subr(19) ^ subr(21);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  649|     46|    CamelliaSubkeyL(21) = subl(20) ^ subl(22);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(21) = subl(20) ^ subl(22);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(21) = subl(20) ^ subl(22);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  650|     46|    CamelliaSubkeyR(21) = subr(20) ^ subr(22);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(21) = subr(20) ^ subr(22);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(21) = subr(20) ^ subr(22);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  651|     46|    CamelliaSubkeyL(22) = subl(21) ^ subl(23);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(22) = subl(21) ^ subl(23);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(22) = subl(21) ^ subl(23);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  652|     46|    CamelliaSubkeyR(22) = subr(21) ^ subr(23);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(22) = subr(21) ^ subr(23);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(22) = subr(21) ^ subr(23);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  653|     46|    CamelliaSubkeyL(23) = subl(22);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(23) = subl(22);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  654|     46|    CamelliaSubkeyR(23) = subr(22);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(23) = subr(22);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  655|     46|    CamelliaSubkeyL(24) = subl(24) ^ subl(23);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(24) = subl(24) ^ subl(23);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(24) = subl(24) ^ subl(23);
  ------------------
  |  |  430|     46|#define subl(x) subL[(x)]
  ------------------
  656|     46|    CamelliaSubkeyR(24) = subr(24) ^ subr(23);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(24) = subr(24) ^ subr(23);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(24) = subr(24) ^ subr(23);
  ------------------
  |  |  431|     46|#define subr(x) subR[(x)]
  ------------------
  657|       |
  658|       |    /* apply the inverse of the last half of P-function */
  659|     46|    dw = CamelliaSubkeyL(2) ^ CamelliaSubkeyR(2), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(2) ^ CamelliaSubkeyR(2), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(2) ^ CamelliaSubkeyR(2), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  660|     46|    CamelliaSubkeyR(2) = CamelliaSubkeyL(2) ^ dw, CamelliaSubkeyL(2) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(2) = CamelliaSubkeyL(2) ^ dw, CamelliaSubkeyL(2) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(2) = CamelliaSubkeyL(2) ^ dw, CamelliaSubkeyL(2) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  661|     46|    dw = CamelliaSubkeyL(3) ^ CamelliaSubkeyR(3), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(3) ^ CamelliaSubkeyR(3), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(3) ^ CamelliaSubkeyR(3), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  662|     46|    CamelliaSubkeyR(3) = CamelliaSubkeyL(3) ^ dw, CamelliaSubkeyL(3) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(3) = CamelliaSubkeyL(3) ^ dw, CamelliaSubkeyL(3) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(3) = CamelliaSubkeyL(3) ^ dw, CamelliaSubkeyL(3) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  663|     46|    dw = CamelliaSubkeyL(4) ^ CamelliaSubkeyR(4), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(4) ^ CamelliaSubkeyR(4), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(4) ^ CamelliaSubkeyR(4), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  664|     46|    CamelliaSubkeyR(4) = CamelliaSubkeyL(4) ^ dw, CamelliaSubkeyL(4) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(4) = CamelliaSubkeyL(4) ^ dw, CamelliaSubkeyL(4) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(4) = CamelliaSubkeyL(4) ^ dw, CamelliaSubkeyL(4) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  665|     46|    dw = CamelliaSubkeyL(5) ^ CamelliaSubkeyR(5), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(5) ^ CamelliaSubkeyR(5), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(5) ^ CamelliaSubkeyR(5), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  666|     46|    CamelliaSubkeyR(5) = CamelliaSubkeyL(5) ^ dw, CamelliaSubkeyL(5) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(5) = CamelliaSubkeyL(5) ^ dw, CamelliaSubkeyL(5) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(5) = CamelliaSubkeyL(5) ^ dw, CamelliaSubkeyL(5) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  667|     46|    dw = CamelliaSubkeyL(6) ^ CamelliaSubkeyR(6), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(6) ^ CamelliaSubkeyR(6), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(6) ^ CamelliaSubkeyR(6), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  668|     46|    CamelliaSubkeyR(6) = CamelliaSubkeyL(6) ^ dw, CamelliaSubkeyL(6) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(6) = CamelliaSubkeyL(6) ^ dw, CamelliaSubkeyL(6) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(6) = CamelliaSubkeyL(6) ^ dw, CamelliaSubkeyL(6) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  669|     46|    dw = CamelliaSubkeyL(7) ^ CamelliaSubkeyR(7), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(7) ^ CamelliaSubkeyR(7), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(7) ^ CamelliaSubkeyR(7), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  670|     46|    CamelliaSubkeyR(7) = CamelliaSubkeyL(7) ^ dw, CamelliaSubkeyL(7) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(7) = CamelliaSubkeyL(7) ^ dw, CamelliaSubkeyL(7) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(7) = CamelliaSubkeyL(7) ^ dw, CamelliaSubkeyL(7) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  671|     46|    dw = CamelliaSubkeyL(10) ^ CamelliaSubkeyR(10), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(10) ^ CamelliaSubkeyR(10), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(10) ^ CamelliaSubkeyR(10), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  672|     46|    CamelliaSubkeyR(10) = CamelliaSubkeyL(10) ^ dw, CamelliaSubkeyL(10) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(10) = CamelliaSubkeyL(10) ^ dw, CamelliaSubkeyL(10) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(10) = CamelliaSubkeyL(10) ^ dw, CamelliaSubkeyL(10) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  673|     46|    dw = CamelliaSubkeyL(11) ^ CamelliaSubkeyR(11), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(11) ^ CamelliaSubkeyR(11), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(11) ^ CamelliaSubkeyR(11), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  674|     46|    CamelliaSubkeyR(11) = CamelliaSubkeyL(11) ^ dw, CamelliaSubkeyL(11) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(11) = CamelliaSubkeyL(11) ^ dw, CamelliaSubkeyL(11) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(11) = CamelliaSubkeyL(11) ^ dw, CamelliaSubkeyL(11) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  675|     46|    dw = CamelliaSubkeyL(12) ^ CamelliaSubkeyR(12), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(12) ^ CamelliaSubkeyR(12), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(12) ^ CamelliaSubkeyR(12), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  676|     46|    CamelliaSubkeyR(12) = CamelliaSubkeyL(12) ^ dw, CamelliaSubkeyL(12) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(12) = CamelliaSubkeyL(12) ^ dw, CamelliaSubkeyL(12) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(12) = CamelliaSubkeyL(12) ^ dw, CamelliaSubkeyL(12) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  677|     46|    dw = CamelliaSubkeyL(13) ^ CamelliaSubkeyR(13), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(13) ^ CamelliaSubkeyR(13), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(13) ^ CamelliaSubkeyR(13), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  678|     46|    CamelliaSubkeyR(13) = CamelliaSubkeyL(13) ^ dw, CamelliaSubkeyL(13) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(13) = CamelliaSubkeyL(13) ^ dw, CamelliaSubkeyL(13) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(13) = CamelliaSubkeyL(13) ^ dw, CamelliaSubkeyL(13) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  679|     46|    dw = CamelliaSubkeyL(14) ^ CamelliaSubkeyR(14), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(14) ^ CamelliaSubkeyR(14), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(14) ^ CamelliaSubkeyR(14), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  680|     46|    CamelliaSubkeyR(14) = CamelliaSubkeyL(14) ^ dw, CamelliaSubkeyL(14) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(14) = CamelliaSubkeyL(14) ^ dw, CamelliaSubkeyL(14) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(14) = CamelliaSubkeyL(14) ^ dw, CamelliaSubkeyL(14) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  681|     46|    dw = CamelliaSubkeyL(15) ^ CamelliaSubkeyR(15), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(15) ^ CamelliaSubkeyR(15), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(15) ^ CamelliaSubkeyR(15), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  682|     46|    CamelliaSubkeyR(15) = CamelliaSubkeyL(15) ^ dw, CamelliaSubkeyL(15) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(15) = CamelliaSubkeyL(15) ^ dw, CamelliaSubkeyL(15) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(15) = CamelliaSubkeyL(15) ^ dw, CamelliaSubkeyL(15) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  683|     46|    dw = CamelliaSubkeyL(18) ^ CamelliaSubkeyR(18), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(18) ^ CamelliaSubkeyR(18), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(18) ^ CamelliaSubkeyR(18), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  684|     46|    CamelliaSubkeyR(18) = CamelliaSubkeyL(18) ^ dw, CamelliaSubkeyL(18) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(18) = CamelliaSubkeyL(18) ^ dw, CamelliaSubkeyL(18) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(18) = CamelliaSubkeyL(18) ^ dw, CamelliaSubkeyL(18) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  685|     46|    dw = CamelliaSubkeyL(19) ^ CamelliaSubkeyR(19), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(19) ^ CamelliaSubkeyR(19), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(19) ^ CamelliaSubkeyR(19), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  686|     46|    CamelliaSubkeyR(19) = CamelliaSubkeyL(19) ^ dw, CamelliaSubkeyL(19) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(19) = CamelliaSubkeyL(19) ^ dw, CamelliaSubkeyL(19) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(19) = CamelliaSubkeyL(19) ^ dw, CamelliaSubkeyL(19) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  687|     46|    dw = CamelliaSubkeyL(20) ^ CamelliaSubkeyR(20), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(20) ^ CamelliaSubkeyR(20), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(20) ^ CamelliaSubkeyR(20), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  688|     46|    CamelliaSubkeyR(20) = CamelliaSubkeyL(20) ^ dw, CamelliaSubkeyL(20) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(20) = CamelliaSubkeyL(20) ^ dw, CamelliaSubkeyL(20) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(20) = CamelliaSubkeyL(20) ^ dw, CamelliaSubkeyL(20) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  689|     46|    dw = CamelliaSubkeyL(21) ^ CamelliaSubkeyR(21), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(21) ^ CamelliaSubkeyR(21), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(21) ^ CamelliaSubkeyR(21), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  690|     46|    CamelliaSubkeyR(21) = CamelliaSubkeyL(21) ^ dw, CamelliaSubkeyL(21) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(21) = CamelliaSubkeyL(21) ^ dw, CamelliaSubkeyL(21) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(21) = CamelliaSubkeyL(21) ^ dw, CamelliaSubkeyL(21) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  691|     46|    dw = CamelliaSubkeyL(22) ^ CamelliaSubkeyR(22), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(22) ^ CamelliaSubkeyR(22), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(22) ^ CamelliaSubkeyR(22), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  692|     46|    CamelliaSubkeyR(22) = CamelliaSubkeyL(22) ^ dw, CamelliaSubkeyL(22) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(22) = CamelliaSubkeyL(22) ^ dw, CamelliaSubkeyL(22) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(22) = CamelliaSubkeyL(22) ^ dw, CamelliaSubkeyL(22) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  693|     46|    dw = CamelliaSubkeyL(23) ^ CamelliaSubkeyR(23), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(23) ^ CamelliaSubkeyR(23), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(23) ^ CamelliaSubkeyR(23), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     46|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
  694|     46|    CamelliaSubkeyR(23) = CamelliaSubkeyL(23) ^ dw, CamelliaSubkeyL(23) = dw;
  ------------------
  |  |   67|     46|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(23) = CamelliaSubkeyL(23) ^ dw, CamelliaSubkeyL(23) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(23) = CamelliaSubkeyL(23) ^ dw, CamelliaSubkeyL(23) = dw;
  ------------------
  |  |   66|     46|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
  695|       |
  696|     46|    return;
  697|     46|}
camellia_setup256:
  701|     42|{
  702|     42|    PRUint32 kll, klr, krl, krr;     /* left half of key */
  703|     42|    PRUint32 krll, krlr, krrl, krrr; /* right half of key */
  704|     42|    PRUint32 il, ir, t0, t1, w0, w1; /* temporary variables */
  705|     42|    PRUint32 kw4l, kw4r, dw, tl, tr;
  706|     42|    PRUint32 subL[34];
  707|     42|    PRUint32 subR[34];
  708|       |#if defined(CAMELLIA_NEED_TMP_VARIABLE)
  709|       |    PRUint32 tmp;
  710|       |#endif
  711|       |
  712|       |    /**
  713|       |     *  key = (kll || klr || krl || krr || krll || krlr || krrl || krrr)
  714|       |     *  (|| is concatination)
  715|       |     */
  716|       |
  717|     42|    kll = GETU32(key);
  ------------------
  |  |   45|     42|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     42|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  718|     42|    klr = GETU32(key + 4);
  ------------------
  |  |   45|     42|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     42|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  719|     42|    krl = GETU32(key + 8);
  ------------------
  |  |   45|     42|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     42|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  720|     42|    krr = GETU32(key + 12);
  ------------------
  |  |   45|     42|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     42|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  721|     42|    krll = GETU32(key + 16);
  ------------------
  |  |   45|     42|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     42|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  722|     42|    krlr = GETU32(key + 20);
  ------------------
  |  |   45|     42|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     42|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  723|     42|    krrl = GETU32(key + 24);
  ------------------
  |  |   45|     42|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     42|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  724|     42|    krrr = GETU32(key + 28);
  ------------------
  |  |   45|     42|#define GETU32(p) SHA_HTONL(*((PRUint32 *)(p)))
  |  |  ------------------
  |  |  |  |   97|     42|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  725|       |
  726|       |    /* generate KL dependent subkeys */
  727|     42|    subl(0) = kll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  728|     42|    subr(0) = klr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  729|     42|    subl(1) = krl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  730|     42|    subr(1) = krr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  731|     42|    CAMELLIA_ROLDQo32(kll, klr, krl, krr, w0, w1, 45);
  ------------------
  |  |   86|     42|    do {                                                \
  |  |   87|     42|        w0 = ll;                                        \
  |  |   88|     42|        w1 = lr;                                        \
  |  |   89|     42|        ll = (lr << (bits - 32)) + (rl >> (64 - bits)); \
  |  |   90|     42|        lr = (rl << (bits - 32)) + (rr >> (64 - bits)); \
  |  |   91|     42|        rl = (rr << (bits - 32)) + (w0 >> (64 - bits)); \
  |  |   92|     42|        rr = (w0 << (bits - 32)) + (w1 >> (64 - bits)); \
  |  |   93|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (93:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  732|     42|    subl(12) = kll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  733|     42|    subr(12) = klr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  734|     42|    subl(13) = krl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  735|     42|    subr(13) = krr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  736|     42|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 15);
  ------------------
  |  |   77|     42|    do {                                             \
  |  |   78|     42|        w0 = ll;                                     \
  |  |   79|     42|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     42|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     42|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     42|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  737|     42|    subl(16) = kll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  738|     42|    subr(16) = klr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  739|     42|    subl(17) = krl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  740|     42|    subr(17) = krr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  741|     42|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 17);
  ------------------
  |  |   77|     42|    do {                                             \
  |  |   78|     42|        w0 = ll;                                     \
  |  |   79|     42|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     42|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     42|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     42|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  742|     42|    subl(22) = kll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  743|     42|    subr(22) = klr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  744|     42|    subl(23) = krl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  745|     42|    subr(23) = krr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  746|     42|    CAMELLIA_ROLDQo32(kll, klr, krl, krr, w0, w1, 34);
  ------------------
  |  |   86|     42|    do {                                                \
  |  |   87|     42|        w0 = ll;                                        \
  |  |   88|     42|        w1 = lr;                                        \
  |  |   89|     42|        ll = (lr << (bits - 32)) + (rl >> (64 - bits)); \
  |  |   90|     42|        lr = (rl << (bits - 32)) + (rr >> (64 - bits)); \
  |  |   91|     42|        rl = (rr << (bits - 32)) + (w0 >> (64 - bits)); \
  |  |   92|     42|        rr = (w0 << (bits - 32)) + (w1 >> (64 - bits)); \
  |  |   93|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (93:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  747|     42|    subl(30) = kll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  748|     42|    subr(30) = klr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  749|     42|    subl(31) = krl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  750|     42|    subr(31) = krr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  751|       |
  752|       |    /* generate KR dependent subkeys */
  753|     42|    CAMELLIA_ROLDQ(krll, krlr, krrl, krrr, w0, w1, 15);
  ------------------
  |  |   77|     42|    do {                                             \
  |  |   78|     42|        w0 = ll;                                     \
  |  |   79|     42|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     42|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     42|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     42|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  754|     42|    subl(4) = krll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  755|     42|    subr(4) = krlr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  756|     42|    subl(5) = krrl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  757|     42|    subr(5) = krrr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  758|     42|    CAMELLIA_ROLDQ(krll, krlr, krrl, krrr, w0, w1, 15);
  ------------------
  |  |   77|     42|    do {                                             \
  |  |   78|     42|        w0 = ll;                                     \
  |  |   79|     42|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     42|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     42|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     42|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  759|     42|    subl(8) = krll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  760|     42|    subr(8) = krlr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  761|     42|    subl(9) = krrl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  762|     42|    subr(9) = krrr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  763|     42|    CAMELLIA_ROLDQ(krll, krlr, krrl, krrr, w0, w1, 30);
  ------------------
  |  |   77|     42|    do {                                             \
  |  |   78|     42|        w0 = ll;                                     \
  |  |   79|     42|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     42|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     42|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     42|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  764|     42|    subl(18) = krll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  765|     42|    subr(18) = krlr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  766|     42|    subl(19) = krrl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  767|     42|    subr(19) = krrr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  768|     42|    CAMELLIA_ROLDQo32(krll, krlr, krrl, krrr, w0, w1, 34);
  ------------------
  |  |   86|     42|    do {                                                \
  |  |   87|     42|        w0 = ll;                                        \
  |  |   88|     42|        w1 = lr;                                        \
  |  |   89|     42|        ll = (lr << (bits - 32)) + (rl >> (64 - bits)); \
  |  |   90|     42|        lr = (rl << (bits - 32)) + (rr >> (64 - bits)); \
  |  |   91|     42|        rl = (rr << (bits - 32)) + (w0 >> (64 - bits)); \
  |  |   92|     42|        rr = (w0 << (bits - 32)) + (w1 >> (64 - bits)); \
  |  |   93|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (93:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  769|     42|    subl(26) = krll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  770|     42|    subr(26) = krlr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  771|     42|    subl(27) = krrl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  772|     42|    subr(27) = krrr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  773|     42|    CAMELLIA_ROLDQo32(krll, krlr, krrl, krrr, w0, w1, 34);
  ------------------
  |  |   86|     42|    do {                                                \
  |  |   87|     42|        w0 = ll;                                        \
  |  |   88|     42|        w1 = lr;                                        \
  |  |   89|     42|        ll = (lr << (bits - 32)) + (rl >> (64 - bits)); \
  |  |   90|     42|        lr = (rl << (bits - 32)) + (rr >> (64 - bits)); \
  |  |   91|     42|        rl = (rr << (bits - 32)) + (w0 >> (64 - bits)); \
  |  |   92|     42|        rr = (w0 << (bits - 32)) + (w1 >> (64 - bits)); \
  |  |   93|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (93:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  774|       |
  775|       |    /* generate KA */
  776|     42|    kll = subl(0) ^ krll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  777|     42|    klr = subr(0) ^ krlr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  778|     42|    krl = subl(1) ^ krrl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  779|     42|    krr = subr(1) ^ krrr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  780|     42|    CAMELLIA_F(kll, klr,
  ------------------
  |  |  101|     42|    do {                                                   \
  |  |  102|     42|        il = xl ^ kl;                                      \
  |  |  103|     42|        ir = xr ^ kr;                                      \
  |  |  104|     42|        t0 = il >> 16;                                     \
  |  |  105|     42|        t1 = ir >> 16;                                     \
  |  |  106|     42|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     42|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     42|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     42|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     42|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     42|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     42|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     42|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     42|        yl ^= yr;                                          \
  |  |  115|     42|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     42|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     42|        yr ^= yl;                                          \
  |  |  117|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  781|     42|               CAMELLIA_SIGMA1L, CAMELLIA_SIGMA1R,
  782|     42|               w0, w1, il, ir, t0, t1);
  783|     42|    krl ^= w0;
  784|     42|    krr ^= w1;
  785|     42|    CAMELLIA_F(krl, krr,
  ------------------
  |  |  101|     42|    do {                                                   \
  |  |  102|     42|        il = xl ^ kl;                                      \
  |  |  103|     42|        ir = xr ^ kr;                                      \
  |  |  104|     42|        t0 = il >> 16;                                     \
  |  |  105|     42|        t1 = ir >> 16;                                     \
  |  |  106|     42|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     42|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     42|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     42|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     42|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     42|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     42|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     42|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     42|        yl ^= yr;                                          \
  |  |  115|     42|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     42|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     42|        yr ^= yl;                                          \
  |  |  117|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  786|     42|               CAMELLIA_SIGMA2L, CAMELLIA_SIGMA2R,
  787|     42|               kll, klr, il, ir, t0, t1);
  788|     42|    kll ^= krll;
  789|     42|    klr ^= krlr;
  790|     42|    CAMELLIA_F(kll, klr,
  ------------------
  |  |  101|     42|    do {                                                   \
  |  |  102|     42|        il = xl ^ kl;                                      \
  |  |  103|     42|        ir = xr ^ kr;                                      \
  |  |  104|     42|        t0 = il >> 16;                                     \
  |  |  105|     42|        t1 = ir >> 16;                                     \
  |  |  106|     42|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     42|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     42|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     42|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     42|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     42|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     42|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     42|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     42|        yl ^= yr;                                          \
  |  |  115|     42|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     42|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     42|        yr ^= yl;                                          \
  |  |  117|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  791|     42|               CAMELLIA_SIGMA3L, CAMELLIA_SIGMA3R,
  792|     42|               krl, krr, il, ir, t0, t1);
  793|     42|    krl ^= w0 ^ krrl;
  794|     42|    krr ^= w1 ^ krrr;
  795|     42|    CAMELLIA_F(krl, krr,
  ------------------
  |  |  101|     42|    do {                                                   \
  |  |  102|     42|        il = xl ^ kl;                                      \
  |  |  103|     42|        ir = xr ^ kr;                                      \
  |  |  104|     42|        t0 = il >> 16;                                     \
  |  |  105|     42|        t1 = ir >> 16;                                     \
  |  |  106|     42|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     42|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     42|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     42|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     42|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     42|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     42|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     42|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     42|        yl ^= yr;                                          \
  |  |  115|     42|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     42|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     42|        yr ^= yl;                                          \
  |  |  117|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  796|     42|               CAMELLIA_SIGMA4L, CAMELLIA_SIGMA4R,
  797|     42|               w0, w1, il, ir, t0, t1);
  798|     42|    kll ^= w0;
  799|     42|    klr ^= w1;
  800|       |
  801|       |    /* generate KB */
  802|     42|    krll ^= kll;
  803|     42|    krlr ^= klr;
  804|     42|    krrl ^= krl;
  805|     42|    krrr ^= krr;
  806|     42|    CAMELLIA_F(krll, krlr,
  ------------------
  |  |  101|     42|    do {                                                   \
  |  |  102|     42|        il = xl ^ kl;                                      \
  |  |  103|     42|        ir = xr ^ kr;                                      \
  |  |  104|     42|        t0 = il >> 16;                                     \
  |  |  105|     42|        t1 = ir >> 16;                                     \
  |  |  106|     42|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     42|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     42|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     42|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     42|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     42|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     42|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     42|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     42|        yl ^= yr;                                          \
  |  |  115|     42|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     42|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     42|        yr ^= yl;                                          \
  |  |  117|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  807|     42|               CAMELLIA_SIGMA5L, CAMELLIA_SIGMA5R,
  808|     42|               w0, w1, il, ir, t0, t1);
  809|     42|    krrl ^= w0;
  810|     42|    krrr ^= w1;
  811|     42|    CAMELLIA_F(krrl, krrr,
  ------------------
  |  |  101|     42|    do {                                                   \
  |  |  102|     42|        il = xl ^ kl;                                      \
  |  |  103|     42|        ir = xr ^ kr;                                      \
  |  |  104|     42|        t0 = il >> 16;                                     \
  |  |  105|     42|        t1 = ir >> 16;                                     \
  |  |  106|     42|        yl = CAMELLIA_SP1110(ir & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  107|     42|             CAMELLIA_SP0222((t1 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  108|     42|             CAMELLIA_SP3033(t1 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  109|     42|             CAMELLIA_SP4404((ir >> 8) & 0xff);            \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  110|     42|        yr = CAMELLIA_SP1110((t0 >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   95|     42|#define CAMELLIA_SP1110(INDEX) (camellia_sp1110[(INDEX)])
  |  |  ------------------
  |  |  111|     42|             CAMELLIA_SP0222(t0 & 0xff) ^                  \
  |  |  ------------------
  |  |  |  |   96|     42|#define CAMELLIA_SP0222(INDEX) (camellia_sp0222[(INDEX)])
  |  |  ------------------
  |  |  112|     42|             CAMELLIA_SP3033((il >> 8) & 0xff) ^           \
  |  |  ------------------
  |  |  |  |   97|     42|#define CAMELLIA_SP3033(INDEX) (camellia_sp3033[(INDEX)])
  |  |  ------------------
  |  |  113|     42|             CAMELLIA_SP4404(il & 0xff);                   \
  |  |  ------------------
  |  |  |  |   98|     42|#define CAMELLIA_SP4404(INDEX) (camellia_sp4404[(INDEX)])
  |  |  ------------------
  |  |  114|     42|        yl ^= yr;                                          \
  |  |  115|     42|        yr = CAMELLIA_RR8(yr);                             \
  |  |  ------------------
  |  |  |  |   70|     42|#define CAMELLIA_RR8(x) (((x) >> 8) + ((x) << 24))
  |  |  ------------------
  |  |  116|     42|        yr ^= yl;                                          \
  |  |  117|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (117:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  812|     42|               CAMELLIA_SIGMA6L, CAMELLIA_SIGMA6R,
  813|     42|               w0, w1, il, ir, t0, t1);
  814|     42|    krll ^= w0;
  815|     42|    krlr ^= w1;
  816|       |
  817|       |    /* generate KA dependent subkeys */
  818|     42|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 15);
  ------------------
  |  |   77|     42|    do {                                             \
  |  |   78|     42|        w0 = ll;                                     \
  |  |   79|     42|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     42|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     42|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     42|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  819|     42|    subl(6) = kll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  820|     42|    subr(6) = klr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  821|     42|    subl(7) = krl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  822|     42|    subr(7) = krr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  823|     42|    CAMELLIA_ROLDQ(kll, klr, krl, krr, w0, w1, 30);
  ------------------
  |  |   77|     42|    do {                                             \
  |  |   78|     42|        w0 = ll;                                     \
  |  |   79|     42|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     42|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     42|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     42|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  824|     42|    subl(14) = kll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  825|     42|    subr(14) = klr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  826|     42|    subl(15) = krl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  827|     42|    subr(15) = krr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  828|     42|    subl(24) = klr;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  829|     42|    subr(24) = krl;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  830|     42|    subl(25) = krr;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  831|     42|    subr(25) = kll;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  832|     42|    CAMELLIA_ROLDQo32(kll, klr, krl, krr, w0, w1, 49);
  ------------------
  |  |   86|     42|    do {                                                \
  |  |   87|     42|        w0 = ll;                                        \
  |  |   88|     42|        w1 = lr;                                        \
  |  |   89|     42|        ll = (lr << (bits - 32)) + (rl >> (64 - bits)); \
  |  |   90|     42|        lr = (rl << (bits - 32)) + (rr >> (64 - bits)); \
  |  |   91|     42|        rl = (rr << (bits - 32)) + (w0 >> (64 - bits)); \
  |  |   92|     42|        rr = (w0 << (bits - 32)) + (w1 >> (64 - bits)); \
  |  |   93|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (93:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  833|     42|    subl(28) = kll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  834|     42|    subr(28) = klr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  835|     42|    subl(29) = krl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  836|     42|    subr(29) = krr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  837|       |
  838|       |    /* generate KB dependent subkeys */
  839|     42|    subl(2) = krll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  840|     42|    subr(2) = krlr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  841|     42|    subl(3) = krrl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  842|     42|    subr(3) = krrr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  843|     42|    CAMELLIA_ROLDQ(krll, krlr, krrl, krrr, w0, w1, 30);
  ------------------
  |  |   77|     42|    do {                                             \
  |  |   78|     42|        w0 = ll;                                     \
  |  |   79|     42|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     42|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     42|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     42|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  844|     42|    subl(10) = krll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  845|     42|    subr(10) = krlr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  846|     42|    subl(11) = krrl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  847|     42|    subr(11) = krrr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  848|     42|    CAMELLIA_ROLDQ(krll, krlr, krrl, krrr, w0, w1, 30);
  ------------------
  |  |   77|     42|    do {                                             \
  |  |   78|     42|        w0 = ll;                                     \
  |  |   79|     42|        ll = (ll << bits) + (lr >> (32 - bits));     \
  |  |   80|     42|        lr = (lr << bits) + (rl >> (32 - bits));     \
  |  |   81|     42|        rl = (rl << bits) + (rr >> (32 - bits));     \
  |  |   82|     42|        rr = (rr << bits) + (w0 >> (32 - bits));     \
  |  |   83|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (83:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  849|     42|    subl(20) = krll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  850|     42|    subr(20) = krlr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  851|     42|    subl(21) = krrl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  852|     42|    subr(21) = krrr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  853|     42|    CAMELLIA_ROLDQo32(krll, krlr, krrl, krrr, w0, w1, 51);
  ------------------
  |  |   86|     42|    do {                                                \
  |  |   87|     42|        w0 = ll;                                        \
  |  |   88|     42|        w1 = lr;                                        \
  |  |   89|     42|        ll = (lr << (bits - 32)) + (rl >> (64 - bits)); \
  |  |   90|     42|        lr = (rl << (bits - 32)) + (rr >> (64 - bits)); \
  |  |   91|     42|        rl = (rr << (bits - 32)) + (w0 >> (64 - bits)); \
  |  |   92|     42|        rr = (w0 << (bits - 32)) + (w1 >> (64 - bits)); \
  |  |   93|     42|    } while (0)
  |  |  ------------------
  |  |  |  Branch (93:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  854|     42|    subl(32) = krll;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  855|     42|    subr(32) = krlr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  856|     42|    subl(33) = krrl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  857|     42|    subr(33) = krrr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  858|       |
  859|       |    /* absorb kw2 to other subkeys */
  860|     42|    subl(3) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(3) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  861|     42|    subr(3) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(3) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  862|     42|    subl(5) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(5) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  863|     42|    subr(5) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(5) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  864|     42|    subl(7) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(7) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  865|     42|    subr(7) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(7) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  866|     42|    subl(1) ^= subr(1) & ~subr(9);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(9);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(9);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  867|     42|    dw = subl(1) & subl(9), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(9), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(9), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  dw = subl(1) & subl(9), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  868|     42|    subl(11) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(11) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  869|     42|    subr(11) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(11) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  870|     42|    subl(13) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(13) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  871|     42|    subr(13) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(13) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  872|     42|    subl(15) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(15) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  873|     42|    subr(15) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(15) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  874|     42|    subl(1) ^= subr(1) & ~subr(17);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(17);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(17);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  875|     42|    dw = subl(1) & subl(17), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(17), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(17), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  dw = subl(1) & subl(17), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  876|     42|    subl(19) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(19) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  877|     42|    subr(19) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(19) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  878|     42|    subl(21) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(21) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  879|     42|    subr(21) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(21) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  880|     42|    subl(23) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(23) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  881|     42|    subr(23) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(23) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  882|     42|    subl(1) ^= subr(1) & ~subr(25);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(25);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subl(1) ^= subr(1) & ~subr(25);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  883|     42|    dw = subl(1) & subl(25), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(25), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = subl(1) & subl(25), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  dw = subl(1) & subl(25), subr(1) ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  884|     42|    subl(27) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(27) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  885|     42|    subr(27) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(27) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  886|     42|    subl(29) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(29) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  887|     42|    subr(29) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(29) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  888|     42|    subl(31) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(31) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  889|     42|    subr(31) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(31) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  890|     42|    subl(32) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  subl(32) ^= subl(1);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  891|     42|    subr(32) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  subr(32) ^= subr(1);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  892|       |
  893|       |    /* absorb kw4 to other subkeys */
  894|     42|    kw4l = subl(33);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  895|     42|    kw4r = subr(33);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  896|     42|    subl(30) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  897|     42|    subr(30) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  898|     42|    subl(28) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  899|     42|    subr(28) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  900|     42|    subl(26) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  901|     42|    subr(26) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  902|     42|    kw4l ^= kw4r & ~subr(24);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  903|     42|    dw = kw4l & subl(24), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = kw4l & subl(24), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  904|     42|    subl(22) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  905|     42|    subr(22) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  906|     42|    subl(20) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  907|     42|    subr(20) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  908|     42|    subl(18) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  909|     42|    subr(18) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  910|     42|    kw4l ^= kw4r & ~subr(16);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  911|     42|    dw = kw4l & subl(16), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = kw4l & subl(16), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  912|     42|    subl(14) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  913|     42|    subr(14) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  914|     42|    subl(12) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  915|     42|    subr(12) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  916|     42|    subl(10) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  917|     42|    subr(10) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  918|     42|    kw4l ^= kw4r & ~subr(8);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  919|     42|    dw = kw4l & subl(8), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = kw4l & subl(8), kw4r ^= CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  920|     42|    subl(6) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  921|     42|    subr(6) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  922|     42|    subl(4) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  923|     42|    subr(4) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  924|     42|    subl(2) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  925|     42|    subr(2) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  926|     42|    subl(0) ^= kw4l;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  927|     42|    subr(0) ^= kw4r;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  928|       |
  929|       |    /* key XOR is end of F-function */
  930|     42|    CamelliaSubkeyL(0) = subl(0) ^ subl(2);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(0) = subl(0) ^ subl(2);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(0) = subl(0) ^ subl(2);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  931|     42|    CamelliaSubkeyR(0) = subr(0) ^ subr(2);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(0) = subr(0) ^ subr(2);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(0) = subr(0) ^ subr(2);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  932|     42|    CamelliaSubkeyL(2) = subl(3);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(2) = subl(3);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  933|     42|    CamelliaSubkeyR(2) = subr(3);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(2) = subr(3);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  934|     42|    CamelliaSubkeyL(3) = subl(2) ^ subl(4);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(3) = subl(2) ^ subl(4);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(3) = subl(2) ^ subl(4);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  935|     42|    CamelliaSubkeyR(3) = subr(2) ^ subr(4);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(3) = subr(2) ^ subr(4);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(3) = subr(2) ^ subr(4);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  936|     42|    CamelliaSubkeyL(4) = subl(3) ^ subl(5);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(4) = subl(3) ^ subl(5);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(4) = subl(3) ^ subl(5);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  937|     42|    CamelliaSubkeyR(4) = subr(3) ^ subr(5);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(4) = subr(3) ^ subr(5);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(4) = subr(3) ^ subr(5);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  938|     42|    CamelliaSubkeyL(5) = subl(4) ^ subl(6);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(5) = subl(4) ^ subl(6);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(5) = subl(4) ^ subl(6);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  939|     42|    CamelliaSubkeyR(5) = subr(4) ^ subr(6);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(5) = subr(4) ^ subr(6);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(5) = subr(4) ^ subr(6);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  940|     42|    CamelliaSubkeyL(6) = subl(5) ^ subl(7);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(6) = subl(5) ^ subl(7);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(6) = subl(5) ^ subl(7);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  941|     42|    CamelliaSubkeyR(6) = subr(5) ^ subr(7);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(6) = subr(5) ^ subr(7);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(6) = subr(5) ^ subr(7);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  942|     42|    tl = subl(10) ^ (subr(10) & ~subr(8));
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(10) ^ (subr(10) & ~subr(8));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(10) ^ (subr(10) & ~subr(8));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  943|     42|    dw = tl & subl(8), tr = subr(10) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(8), tr = subr(10) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(8), tr = subr(10) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  944|     42|    CamelliaSubkeyL(7) = subl(6) ^ tl;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(7) = subl(6) ^ tl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  945|     42|    CamelliaSubkeyR(7) = subr(6) ^ tr;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(7) = subr(6) ^ tr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  946|     42|    CamelliaSubkeyL(8) = subl(8);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(8) = subl(8);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  947|     42|    CamelliaSubkeyR(8) = subr(8);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(8) = subr(8);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  948|     42|    CamelliaSubkeyL(9) = subl(9);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(9) = subl(9);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  949|     42|    CamelliaSubkeyR(9) = subr(9);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(9) = subr(9);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  950|     42|    tl = subl(7) ^ (subr(7) & ~subr(9));
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(7) ^ (subr(7) & ~subr(9));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(7) ^ (subr(7) & ~subr(9));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  951|     42|    dw = tl & subl(9), tr = subr(7) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(9), tr = subr(7) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(9), tr = subr(7) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  952|     42|    CamelliaSubkeyL(10) = tl ^ subl(11);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(10) = tl ^ subl(11);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  953|     42|    CamelliaSubkeyR(10) = tr ^ subr(11);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(10) = tr ^ subr(11);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  954|     42|    CamelliaSubkeyL(11) = subl(10) ^ subl(12);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(11) = subl(10) ^ subl(12);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(11) = subl(10) ^ subl(12);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  955|     42|    CamelliaSubkeyR(11) = subr(10) ^ subr(12);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(11) = subr(10) ^ subr(12);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(11) = subr(10) ^ subr(12);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  956|     42|    CamelliaSubkeyL(12) = subl(11) ^ subl(13);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(12) = subl(11) ^ subl(13);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(12) = subl(11) ^ subl(13);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  957|     42|    CamelliaSubkeyR(12) = subr(11) ^ subr(13);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(12) = subr(11) ^ subr(13);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(12) = subr(11) ^ subr(13);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  958|     42|    CamelliaSubkeyL(13) = subl(12) ^ subl(14);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(13) = subl(12) ^ subl(14);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(13) = subl(12) ^ subl(14);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  959|     42|    CamelliaSubkeyR(13) = subr(12) ^ subr(14);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(13) = subr(12) ^ subr(14);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(13) = subr(12) ^ subr(14);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  960|     42|    CamelliaSubkeyL(14) = subl(13) ^ subl(15);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(14) = subl(13) ^ subl(15);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(14) = subl(13) ^ subl(15);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  961|     42|    CamelliaSubkeyR(14) = subr(13) ^ subr(15);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(14) = subr(13) ^ subr(15);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(14) = subr(13) ^ subr(15);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  962|     42|    tl = subl(18) ^ (subr(18) & ~subr(16));
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(18) ^ (subr(18) & ~subr(16));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(18) ^ (subr(18) & ~subr(16));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  963|     42|    dw = tl & subl(16), tr = subr(18) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(16), tr = subr(18) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(16), tr = subr(18) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  964|     42|    CamelliaSubkeyL(15) = subl(14) ^ tl;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(15) = subl(14) ^ tl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  965|     42|    CamelliaSubkeyR(15) = subr(14) ^ tr;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(15) = subr(14) ^ tr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  966|     42|    CamelliaSubkeyL(16) = subl(16);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(16) = subl(16);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  967|     42|    CamelliaSubkeyR(16) = subr(16);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(16) = subr(16);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  968|     42|    CamelliaSubkeyL(17) = subl(17);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(17) = subl(17);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  969|     42|    CamelliaSubkeyR(17) = subr(17);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(17) = subr(17);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  970|     42|    tl = subl(15) ^ (subr(15) & ~subr(17));
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(15) ^ (subr(15) & ~subr(17));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(15) ^ (subr(15) & ~subr(17));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  971|     42|    dw = tl & subl(17), tr = subr(15) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(17), tr = subr(15) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(17), tr = subr(15) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  972|     42|    CamelliaSubkeyL(18) = tl ^ subl(19);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(18) = tl ^ subl(19);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  973|     42|    CamelliaSubkeyR(18) = tr ^ subr(19);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(18) = tr ^ subr(19);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  974|     42|    CamelliaSubkeyL(19) = subl(18) ^ subl(20);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(19) = subl(18) ^ subl(20);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(19) = subl(18) ^ subl(20);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  975|     42|    CamelliaSubkeyR(19) = subr(18) ^ subr(20);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(19) = subr(18) ^ subr(20);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(19) = subr(18) ^ subr(20);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  976|     42|    CamelliaSubkeyL(20) = subl(19) ^ subl(21);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(20) = subl(19) ^ subl(21);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(20) = subl(19) ^ subl(21);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  977|     42|    CamelliaSubkeyR(20) = subr(19) ^ subr(21);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(20) = subr(19) ^ subr(21);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(20) = subr(19) ^ subr(21);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  978|     42|    CamelliaSubkeyL(21) = subl(20) ^ subl(22);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(21) = subl(20) ^ subl(22);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(21) = subl(20) ^ subl(22);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  979|     42|    CamelliaSubkeyR(21) = subr(20) ^ subr(22);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(21) = subr(20) ^ subr(22);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(21) = subr(20) ^ subr(22);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  980|     42|    CamelliaSubkeyL(22) = subl(21) ^ subl(23);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(22) = subl(21) ^ subl(23);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(22) = subl(21) ^ subl(23);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  981|     42|    CamelliaSubkeyR(22) = subr(21) ^ subr(23);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(22) = subr(21) ^ subr(23);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(22) = subr(21) ^ subr(23);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  982|     42|    tl = subl(26) ^ (subr(26) & ~subr(24));
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(26) ^ (subr(26) & ~subr(24));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(26) ^ (subr(26) & ~subr(24));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  983|     42|    dw = tl & subl(24), tr = subr(26) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(24), tr = subr(26) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(24), tr = subr(26) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  984|     42|    CamelliaSubkeyL(23) = subl(22) ^ tl;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(23) = subl(22) ^ tl;
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  985|     42|    CamelliaSubkeyR(23) = subr(22) ^ tr;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(23) = subr(22) ^ tr;
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  986|     42|    CamelliaSubkeyL(24) = subl(24);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(24) = subl(24);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  987|     42|    CamelliaSubkeyR(24) = subr(24);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(24) = subr(24);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  988|     42|    CamelliaSubkeyL(25) = subl(25);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(25) = subl(25);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  989|     42|    CamelliaSubkeyR(25) = subr(25);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(25) = subr(25);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  990|     42|    tl = subl(23) ^ (subr(23) & ~subr(25));
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  tl = subl(23) ^ (subr(23) & ~subr(25));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  tl = subl(23) ^ (subr(23) & ~subr(25));
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  991|     42|    dw = tl & subl(25), tr = subr(23) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  dw = tl & subl(25), tr = subr(23) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  dw = tl & subl(25), tr = subr(23) ^ CAMELLIA_RL1(dw);
  ------------------
  |  |   72|     42|#define CAMELLIA_RL1(x) (((x) << 1) + ((x) >> 31))
  ------------------
  992|     42|    CamelliaSubkeyL(26) = tl ^ subl(27);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(26) = tl ^ subl(27);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  993|     42|    CamelliaSubkeyR(26) = tr ^ subr(27);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(26) = tr ^ subr(27);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  994|     42|    CamelliaSubkeyL(27) = subl(26) ^ subl(28);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(27) = subl(26) ^ subl(28);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(27) = subl(26) ^ subl(28);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  995|     42|    CamelliaSubkeyR(27) = subr(26) ^ subr(28);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(27) = subr(26) ^ subr(28);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(27) = subr(26) ^ subr(28);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  996|     42|    CamelliaSubkeyL(28) = subl(27) ^ subl(29);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(28) = subl(27) ^ subl(29);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(28) = subl(27) ^ subl(29);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  997|     42|    CamelliaSubkeyR(28) = subr(27) ^ subr(29);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(28) = subr(27) ^ subr(29);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(28) = subr(27) ^ subr(29);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
  998|     42|    CamelliaSubkeyL(29) = subl(28) ^ subl(30);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(29) = subl(28) ^ subl(30);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(29) = subl(28) ^ subl(30);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
  999|     42|    CamelliaSubkeyR(29) = subr(28) ^ subr(30);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(29) = subr(28) ^ subr(30);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(29) = subr(28) ^ subr(30);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
 1000|     42|    CamelliaSubkeyL(30) = subl(29) ^ subl(31);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(30) = subl(29) ^ subl(31);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(30) = subl(29) ^ subl(31);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
 1001|     42|    CamelliaSubkeyR(30) = subr(29) ^ subr(31);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(30) = subr(29) ^ subr(31);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(30) = subr(29) ^ subr(31);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
 1002|     42|    CamelliaSubkeyL(31) = subl(30);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(31) = subl(30);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
 1003|     42|    CamelliaSubkeyR(31) = subr(30);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(31) = subr(30);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
 1004|     42|    CamelliaSubkeyL(32) = subl(32) ^ subl(31);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyL(32) = subl(32) ^ subl(31);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
                  CamelliaSubkeyL(32) = subl(32) ^ subl(31);
  ------------------
  |  |  430|     42|#define subl(x) subL[(x)]
  ------------------
 1005|     42|    CamelliaSubkeyR(32) = subr(32) ^ subr(31);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(32) = subr(32) ^ subr(31);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
                  CamelliaSubkeyR(32) = subr(32) ^ subr(31);
  ------------------
  |  |  431|     42|#define subr(x) subR[(x)]
  ------------------
 1006|       |
 1007|       |    /* apply the inverse of the last half of P-function */
 1008|     42|    dw = CamelliaSubkeyL(2) ^ CamelliaSubkeyR(2), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(2) ^ CamelliaSubkeyR(2), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(2) ^ CamelliaSubkeyR(2), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1009|     42|    CamelliaSubkeyR(2) = CamelliaSubkeyL(2) ^ dw, CamelliaSubkeyL(2) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(2) = CamelliaSubkeyL(2) ^ dw, CamelliaSubkeyL(2) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(2) = CamelliaSubkeyL(2) ^ dw, CamelliaSubkeyL(2) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1010|     42|    dw = CamelliaSubkeyL(3) ^ CamelliaSubkeyR(3), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(3) ^ CamelliaSubkeyR(3), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(3) ^ CamelliaSubkeyR(3), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1011|     42|    CamelliaSubkeyR(3) = CamelliaSubkeyL(3) ^ dw, CamelliaSubkeyL(3) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(3) = CamelliaSubkeyL(3) ^ dw, CamelliaSubkeyL(3) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(3) = CamelliaSubkeyL(3) ^ dw, CamelliaSubkeyL(3) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1012|     42|    dw = CamelliaSubkeyL(4) ^ CamelliaSubkeyR(4), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(4) ^ CamelliaSubkeyR(4), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(4) ^ CamelliaSubkeyR(4), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1013|     42|    CamelliaSubkeyR(4) = CamelliaSubkeyL(4) ^ dw, CamelliaSubkeyL(4) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(4) = CamelliaSubkeyL(4) ^ dw, CamelliaSubkeyL(4) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(4) = CamelliaSubkeyL(4) ^ dw, CamelliaSubkeyL(4) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1014|     42|    dw = CamelliaSubkeyL(5) ^ CamelliaSubkeyR(5), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(5) ^ CamelliaSubkeyR(5), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(5) ^ CamelliaSubkeyR(5), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1015|     42|    CamelliaSubkeyR(5) = CamelliaSubkeyL(5) ^ dw, CamelliaSubkeyL(5) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(5) = CamelliaSubkeyL(5) ^ dw, CamelliaSubkeyL(5) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(5) = CamelliaSubkeyL(5) ^ dw, CamelliaSubkeyL(5) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1016|     42|    dw = CamelliaSubkeyL(6) ^ CamelliaSubkeyR(6), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(6) ^ CamelliaSubkeyR(6), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(6) ^ CamelliaSubkeyR(6), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1017|     42|    CamelliaSubkeyR(6) = CamelliaSubkeyL(6) ^ dw, CamelliaSubkeyL(6) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(6) = CamelliaSubkeyL(6) ^ dw, CamelliaSubkeyL(6) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(6) = CamelliaSubkeyL(6) ^ dw, CamelliaSubkeyL(6) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1018|     42|    dw = CamelliaSubkeyL(7) ^ CamelliaSubkeyR(7), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(7) ^ CamelliaSubkeyR(7), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(7) ^ CamelliaSubkeyR(7), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1019|     42|    CamelliaSubkeyR(7) = CamelliaSubkeyL(7) ^ dw, CamelliaSubkeyL(7) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(7) = CamelliaSubkeyL(7) ^ dw, CamelliaSubkeyL(7) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(7) = CamelliaSubkeyL(7) ^ dw, CamelliaSubkeyL(7) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1020|     42|    dw = CamelliaSubkeyL(10) ^ CamelliaSubkeyR(10), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(10) ^ CamelliaSubkeyR(10), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(10) ^ CamelliaSubkeyR(10), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1021|     42|    CamelliaSubkeyR(10) = CamelliaSubkeyL(10) ^ dw, CamelliaSubkeyL(10) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(10) = CamelliaSubkeyL(10) ^ dw, CamelliaSubkeyL(10) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(10) = CamelliaSubkeyL(10) ^ dw, CamelliaSubkeyL(10) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1022|     42|    dw = CamelliaSubkeyL(11) ^ CamelliaSubkeyR(11), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(11) ^ CamelliaSubkeyR(11), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(11) ^ CamelliaSubkeyR(11), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1023|     42|    CamelliaSubkeyR(11) = CamelliaSubkeyL(11) ^ dw, CamelliaSubkeyL(11) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(11) = CamelliaSubkeyL(11) ^ dw, CamelliaSubkeyL(11) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(11) = CamelliaSubkeyL(11) ^ dw, CamelliaSubkeyL(11) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1024|     42|    dw = CamelliaSubkeyL(12) ^ CamelliaSubkeyR(12), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(12) ^ CamelliaSubkeyR(12), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(12) ^ CamelliaSubkeyR(12), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1025|     42|    CamelliaSubkeyR(12) = CamelliaSubkeyL(12) ^ dw, CamelliaSubkeyL(12) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(12) = CamelliaSubkeyL(12) ^ dw, CamelliaSubkeyL(12) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(12) = CamelliaSubkeyL(12) ^ dw, CamelliaSubkeyL(12) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1026|     42|    dw = CamelliaSubkeyL(13) ^ CamelliaSubkeyR(13), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(13) ^ CamelliaSubkeyR(13), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(13) ^ CamelliaSubkeyR(13), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1027|     42|    CamelliaSubkeyR(13) = CamelliaSubkeyL(13) ^ dw, CamelliaSubkeyL(13) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(13) = CamelliaSubkeyL(13) ^ dw, CamelliaSubkeyL(13) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(13) = CamelliaSubkeyL(13) ^ dw, CamelliaSubkeyL(13) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1028|     42|    dw = CamelliaSubkeyL(14) ^ CamelliaSubkeyR(14), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(14) ^ CamelliaSubkeyR(14), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(14) ^ CamelliaSubkeyR(14), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1029|     42|    CamelliaSubkeyR(14) = CamelliaSubkeyL(14) ^ dw, CamelliaSubkeyL(14) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(14) = CamelliaSubkeyL(14) ^ dw, CamelliaSubkeyL(14) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(14) = CamelliaSubkeyL(14) ^ dw, CamelliaSubkeyL(14) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1030|     42|    dw = CamelliaSubkeyL(15) ^ CamelliaSubkeyR(15), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(15) ^ CamelliaSubkeyR(15), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(15) ^ CamelliaSubkeyR(15), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1031|     42|    CamelliaSubkeyR(15) = CamelliaSubkeyL(15) ^ dw, CamelliaSubkeyL(15) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(15) = CamelliaSubkeyL(15) ^ dw, CamelliaSubkeyL(15) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(15) = CamelliaSubkeyL(15) ^ dw, CamelliaSubkeyL(15) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1032|     42|    dw = CamelliaSubkeyL(18) ^ CamelliaSubkeyR(18), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(18) ^ CamelliaSubkeyR(18), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(18) ^ CamelliaSubkeyR(18), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1033|     42|    CamelliaSubkeyR(18) = CamelliaSubkeyL(18) ^ dw, CamelliaSubkeyL(18) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(18) = CamelliaSubkeyL(18) ^ dw, CamelliaSubkeyL(18) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(18) = CamelliaSubkeyL(18) ^ dw, CamelliaSubkeyL(18) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1034|     42|    dw = CamelliaSubkeyL(19) ^ CamelliaSubkeyR(19), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(19) ^ CamelliaSubkeyR(19), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(19) ^ CamelliaSubkeyR(19), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1035|     42|    CamelliaSubkeyR(19) = CamelliaSubkeyL(19) ^ dw, CamelliaSubkeyL(19) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(19) = CamelliaSubkeyL(19) ^ dw, CamelliaSubkeyL(19) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(19) = CamelliaSubkeyL(19) ^ dw, CamelliaSubkeyL(19) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1036|     42|    dw = CamelliaSubkeyL(20) ^ CamelliaSubkeyR(20), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(20) ^ CamelliaSubkeyR(20), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(20) ^ CamelliaSubkeyR(20), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1037|     42|    CamelliaSubkeyR(20) = CamelliaSubkeyL(20) ^ dw, CamelliaSubkeyL(20) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(20) = CamelliaSubkeyL(20) ^ dw, CamelliaSubkeyL(20) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(20) = CamelliaSubkeyL(20) ^ dw, CamelliaSubkeyL(20) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1038|     42|    dw = CamelliaSubkeyL(21) ^ CamelliaSubkeyR(21), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(21) ^ CamelliaSubkeyR(21), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(21) ^ CamelliaSubkeyR(21), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1039|     42|    CamelliaSubkeyR(21) = CamelliaSubkeyL(21) ^ dw, CamelliaSubkeyL(21) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(21) = CamelliaSubkeyL(21) ^ dw, CamelliaSubkeyL(21) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(21) = CamelliaSubkeyL(21) ^ dw, CamelliaSubkeyL(21) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1040|     42|    dw = CamelliaSubkeyL(22) ^ CamelliaSubkeyR(22), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(22) ^ CamelliaSubkeyR(22), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(22) ^ CamelliaSubkeyR(22), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1041|     42|    CamelliaSubkeyR(22) = CamelliaSubkeyL(22) ^ dw, CamelliaSubkeyL(22) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(22) = CamelliaSubkeyL(22) ^ dw, CamelliaSubkeyL(22) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(22) = CamelliaSubkeyL(22) ^ dw, CamelliaSubkeyL(22) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1042|     42|    dw = CamelliaSubkeyL(23) ^ CamelliaSubkeyR(23), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(23) ^ CamelliaSubkeyR(23), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(23) ^ CamelliaSubkeyR(23), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1043|     42|    CamelliaSubkeyR(23) = CamelliaSubkeyL(23) ^ dw, CamelliaSubkeyL(23) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(23) = CamelliaSubkeyL(23) ^ dw, CamelliaSubkeyL(23) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(23) = CamelliaSubkeyL(23) ^ dw, CamelliaSubkeyL(23) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1044|     42|    dw = CamelliaSubkeyL(26) ^ CamelliaSubkeyR(26), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(26) ^ CamelliaSubkeyR(26), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(26) ^ CamelliaSubkeyR(26), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1045|     42|    CamelliaSubkeyR(26) = CamelliaSubkeyL(26) ^ dw, CamelliaSubkeyL(26) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(26) = CamelliaSubkeyL(26) ^ dw, CamelliaSubkeyL(26) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(26) = CamelliaSubkeyL(26) ^ dw, CamelliaSubkeyL(26) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1046|     42|    dw = CamelliaSubkeyL(27) ^ CamelliaSubkeyR(27), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(27) ^ CamelliaSubkeyR(27), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(27) ^ CamelliaSubkeyR(27), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1047|     42|    CamelliaSubkeyR(27) = CamelliaSubkeyL(27) ^ dw, CamelliaSubkeyL(27) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(27) = CamelliaSubkeyL(27) ^ dw, CamelliaSubkeyL(27) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(27) = CamelliaSubkeyL(27) ^ dw, CamelliaSubkeyL(27) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1048|     42|    dw = CamelliaSubkeyL(28) ^ CamelliaSubkeyR(28), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(28) ^ CamelliaSubkeyR(28), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(28) ^ CamelliaSubkeyR(28), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1049|     42|    CamelliaSubkeyR(28) = CamelliaSubkeyL(28) ^ dw, CamelliaSubkeyL(28) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(28) = CamelliaSubkeyL(28) ^ dw, CamelliaSubkeyL(28) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(28) = CamelliaSubkeyL(28) ^ dw, CamelliaSubkeyL(28) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1050|     42|    dw = CamelliaSubkeyL(29) ^ CamelliaSubkeyR(29), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(29) ^ CamelliaSubkeyR(29), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(29) ^ CamelliaSubkeyR(29), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1051|     42|    CamelliaSubkeyR(29) = CamelliaSubkeyL(29) ^ dw, CamelliaSubkeyL(29) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(29) = CamelliaSubkeyL(29) ^ dw, CamelliaSubkeyL(29) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(29) = CamelliaSubkeyL(29) ^ dw, CamelliaSubkeyL(29) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1052|     42|    dw = CamelliaSubkeyL(30) ^ CamelliaSubkeyR(30), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(30) ^ CamelliaSubkeyR(30), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(30) ^ CamelliaSubkeyR(30), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1053|     42|    CamelliaSubkeyR(30) = CamelliaSubkeyL(30) ^ dw, CamelliaSubkeyL(30) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(30) = CamelliaSubkeyL(30) ^ dw, CamelliaSubkeyL(30) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(30) = CamelliaSubkeyL(30) ^ dw, CamelliaSubkeyL(30) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1054|     42|    dw = CamelliaSubkeyL(31) ^ CamelliaSubkeyR(31), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  dw = CamelliaSubkeyL(31) ^ CamelliaSubkeyR(31), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  dw = CamelliaSubkeyL(31) ^ CamelliaSubkeyR(31), dw = CAMELLIA_RL8(dw);
  ------------------
  |  |   74|     42|#define CAMELLIA_RL8(x) (((x) << 8) + ((x) >> 24))
  ------------------
 1055|     42|    CamelliaSubkeyR(31) = CamelliaSubkeyL(31) ^ dw, CamelliaSubkeyL(31) = dw;
  ------------------
  |  |   67|     42|#define CamelliaSubkeyR(INDEX) (subkey[(INDEX)*2 + 1])
  ------------------
                  CamelliaSubkeyR(31) = CamelliaSubkeyL(31) ^ dw, CamelliaSubkeyL(31) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
                  CamelliaSubkeyR(31) = CamelliaSubkeyL(31) ^ dw, CamelliaSubkeyL(31) = dw;
  ------------------
  |  |   66|     42|#define CamelliaSubkeyL(INDEX) (subkey[(INDEX)*2])
  ------------------
 1056|       |
 1057|     42|    return;
 1058|     42|}
camellia_key_expansion:
 1570|     88|{
 1571|     88|    cx->keysize = keysize;
 1572|       |
 1573|     88|    switch (keysize) {
 1574|     46|        case 16:
  ------------------
  |  Branch (1574:9): [True: 46, False: 42]
  ------------------
 1575|     46|            camellia_setup128(key, cx->expandedKey);
 1576|     46|            break;
 1577|      0|        case 24:
  ------------------
  |  Branch (1577:9): [True: 0, False: 88]
  ------------------
 1578|      0|            camellia_setup192(key, cx->expandedKey);
 1579|      0|            break;
 1580|     42|        case 32:
  ------------------
  |  Branch (1580:9): [True: 42, False: 46]
  ------------------
 1581|     42|            camellia_setup256(key, cx->expandedKey);
 1582|     42|            break;
 1583|      0|        default:
  ------------------
  |  Branch (1583:9): [True: 0, False: 88]
  ------------------
 1584|      0|            break;
 1585|     88|    }
 1586|     88|    return SECSuccess;
 1587|     88|}
Camellia_CreateContext:
 1777|     88|{
 1778|     88|    CamelliaContext *cx;
 1779|       |
 1780|     88|    if (key == NULL ||
  ------------------
  |  Branch (1780:9): [True: 0, False: 88]
  ------------------
 1781|     88|        (keysize != 16 && keysize != 24 && keysize != 32)) {
  ------------------
  |  Branch (1781:10): [True: 42, False: 46]
  |  Branch (1781:27): [True: 42, False: 0]
  |  Branch (1781:44): [True: 0, False: 42]
  ------------------
 1782|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1783|      0|        return NULL;
 1784|      0|    }
 1785|     88|    if (mode != NSS_CAMELLIA && mode != NSS_CAMELLIA_CBC) {
  ------------------
  |  |   42|    176|#define NSS_CAMELLIA 0
  ------------------
                  if (mode != NSS_CAMELLIA && mode != NSS_CAMELLIA_CBC) {
  ------------------
  |  |   43|     88|#define NSS_CAMELLIA_CBC 1
  ------------------
  |  Branch (1785:9): [True: 88, False: 0]
  |  Branch (1785:33): [True: 0, False: 88]
  ------------------
 1786|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1787|      0|        return NULL;
 1788|      0|    }
 1789|     88|    if (mode == NSS_CAMELLIA_CBC && iv == NULL) {
  ------------------
  |  |   43|    176|#define NSS_CAMELLIA_CBC 1
  ------------------
  |  Branch (1789:9): [True: 88, False: 0]
  |  Branch (1789:37): [True: 0, False: 88]
  ------------------
 1790|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1791|      0|        return NULL;
 1792|      0|    }
 1793|     88|    cx = PORT_ZNew(CamelliaContext);
  ------------------
  |  |  148|     88|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|     88|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 1794|     88|    if (!cx) {
  ------------------
  |  Branch (1794:9): [True: 0, False: 88]
  ------------------
 1795|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1796|      0|        return NULL;
 1797|      0|    }
 1798|       |
 1799|       |    /* copy in the iv, if neccessary */
 1800|     88|    if (mode == NSS_CAMELLIA_CBC) {
  ------------------
  |  |   43|     88|#define NSS_CAMELLIA_CBC 1
  ------------------
  |  Branch (1800:9): [True: 88, False: 0]
  ------------------
 1801|     88|        memcpy(cx->iv, iv, CAMELLIA_BLOCK_SIZE);
  ------------------
  |  |    8|     88|#define CAMELLIA_BLOCK_SIZE 16  /* bytes */
  ------------------
 1802|     88|        cx->worker = (encrypt) ? &camellia_encryptCBC : &camellia_decryptCBC;
  ------------------
  |  Branch (1802:22): [True: 44, False: 44]
  ------------------
 1803|     88|    } else {
 1804|      0|        cx->worker = (encrypt) ? &camellia_encryptECB : &camellia_decryptECB;
  ------------------
  |  Branch (1804:22): [True: 0, False: 0]
  ------------------
 1805|      0|    }
 1806|       |    /* copy keysize */
 1807|     88|    cx->keysize = keysize;
 1808|       |
 1809|       |    /* Generate expanded key */
 1810|     88|    if (camellia_key_expansion(cx, key, keysize) != SECSuccess)
  ------------------
  |  Branch (1810:9): [True: 0, False: 88]
  ------------------
 1811|      0|        goto cleanup;
 1812|       |
 1813|     88|    return cx;
 1814|      0|cleanup:
 1815|      0|    PORT_ZFree(cx, sizeof *cx);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 1816|      0|    return NULL;
 1817|     88|}
Camellia_DestroyContext:
 1827|     88|{
 1828|     88|    if (cx)
  ------------------
  |  Branch (1828:9): [True: 88, False: 0]
  ------------------
 1829|     88|        memset(cx, 0, sizeof *cx);
 1830|     88|    if (freeit)
  ------------------
  |  Branch (1830:9): [True: 88, False: 0]
  ------------------
 1831|     88|        PORT_Free(cx);
  ------------------
  |  |   60|     88|#define PORT_Free PORT_Free_Util
  ------------------
 1832|     88|}

ChaCha20Poly1305_InitContext:
  153|  33.7k|{
  154|       |#ifdef NSS_DISABLE_CHACHAPOLY
  155|       |    return SECFailure;
  156|       |#else
  157|  33.7k|    if (keyLen != 32) {
  ------------------
  |  Branch (157:9): [True: 0, False: 33.7k]
  ------------------
  158|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  159|      0|        return SECFailure;
  160|      0|    }
  161|  33.7k|    if (tagLen != 16) {
  ------------------
  |  Branch (161:9): [True: 0, False: 33.7k]
  ------------------
  162|      0|        PORT_SetError(SEC_ERROR_INPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  163|      0|        return SECFailure;
  164|      0|    }
  165|       |
  166|  33.7k|    PORT_Memcpy(ctx->key, key, sizeof(ctx->key));
  ------------------
  |  |  180|  33.7k|#define PORT_Memcpy memcpy
  ------------------
  167|  33.7k|    ctx->tagLen = tagLen;
  168|       |
  169|  33.7k|    NSS_CLASSIFY(ctx->key, sizeof(ctx->key));
  170|       |
  171|  33.7k|    return SECSuccess;
  172|  33.7k|#endif
  173|  33.7k|}
ChaCha20Poly1305_CreateContext:
  178|  33.7k|{
  179|       |#ifdef NSS_DISABLE_CHACHAPOLY
  180|       |    return NULL;
  181|       |#else
  182|  33.7k|    ChaCha20Poly1305Context *ctx;
  183|       |
  184|  33.7k|    ctx = PORT_New(ChaCha20Poly1305Context);
  ------------------
  |  |  151|  33.7k|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|  33.7k|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
  185|  33.7k|    if (ctx == NULL) {
  ------------------
  |  Branch (185:9): [True: 0, False: 33.7k]
  ------------------
  186|      0|        return NULL;
  187|      0|    }
  188|       |
  189|  33.7k|    if (ChaCha20Poly1305_InitContext(ctx, key, keyLen, tagLen) != SECSuccess) {
  ------------------
  |  Branch (189:9): [True: 0, False: 33.7k]
  ------------------
  190|      0|        PORT_Free(ctx);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  191|      0|        ctx = NULL;
  192|      0|    }
  193|       |
  194|  33.7k|    return ctx;
  195|  33.7k|#endif
  196|  33.7k|}
ChaCha20Poly1305_DestroyContext:
  200|  33.7k|{
  201|  33.7k|#ifndef NSS_DISABLE_CHACHAPOLY
  202|  33.7k|    PORT_Memset(ctx, 0, sizeof(*ctx));
  ------------------
  |  |  182|  33.7k|#define PORT_Memset memset
  ------------------
  203|  33.7k|    if (freeit) {
  ------------------
  |  Branch (203:9): [True: 33.7k, False: 0]
  ------------------
  204|  33.7k|        PORT_Free(ctx);
  ------------------
  |  |   60|  33.7k|#define PORT_Free PORT_Free_Util
  ------------------
  205|  33.7k|    }
  206|  33.7k|#endif
  207|  33.7k|}

SEED_set_key:
  300|    270|{
  301|    270|    seed_word K0, K1, K2, K3;
  302|    270|    seed_word t0, t1;
  303|       |
  304|    270|    char2word(rawkey, K0);
  ------------------
  |  |   24|    270|    (i) = ((((seed_word)((c)[0])) << 24) | \
  |  |   25|    270|           (((seed_word)((c)[1])) << 16) | \
  |  |   26|    270|           (((seed_word)((c)[2])) << 8) |  \
  |  |   27|    270|           ((seed_word)((c)[3])))
  ------------------
  305|    270|    char2word(rawkey + 4, K1);
  ------------------
  |  |   24|    270|    (i) = ((((seed_word)((c)[0])) << 24) | \
  |  |   25|    270|           (((seed_word)((c)[1])) << 16) | \
  |  |   26|    270|           (((seed_word)((c)[2])) << 8) |  \
  |  |   27|    270|           ((seed_word)((c)[3])))
  ------------------
  306|    270|    char2word(rawkey + 8, K2);
  ------------------
  |  |   24|    270|    (i) = ((((seed_word)((c)[0])) << 24) | \
  |  |   25|    270|           (((seed_word)((c)[1])) << 16) | \
  |  |   26|    270|           (((seed_word)((c)[2])) << 8) |  \
  |  |   27|    270|           ((seed_word)((c)[3])))
  ------------------
  307|    270|    char2word(rawkey + 12, K3);
  ------------------
  |  |   24|    270|    (i) = ((((seed_word)((c)[0])) << 24) | \
  |  |   25|    270|           (((seed_word)((c)[1])) << 16) | \
  |  |   26|    270|           (((seed_word)((c)[2])) << 8) |  \
  |  |   27|    270|           ((seed_word)((c)[3])))
  ------------------
  308|       |
  309|    270|    t0 = (K0 + K2 - KC0);
  ------------------
  |  |  280|    270|#define KC0 0x9e3779b9
  ------------------
  310|    270|    t1 = (K1 - K3 + KC0);
  ------------------
  |  |  280|    270|#define KC0 0x9e3779b9
  ------------------
  311|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[0]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  312|    270|    KEYSCHEDULE_UPDATE1(t0, t1, K0, K1, K2, K3, KC1);
  ------------------
  |  |   43|    270|    (T0) = (K0);                                        \
  |  |   44|    270|    (K0) = (((K0) >> 8) ^ ((K1) << 24));                \
  |  |   45|    270|    (K1) = (((K1) >> 8) ^ ((T0) << 24));                \
  |  |   46|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   47|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  313|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[2]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  314|    270|    KEYSCHEDULE_UPDATE0(t0, t1, K0, K1, K2, K3, KC2);
  ------------------
  |  |   36|    270|    (T0) = (K2);                                        \
  |  |   37|    270|    (K2) = (((K2) << 8) ^ ((K3) >> 24));                \
  |  |   38|    270|    (K3) = (((K3) << 8) ^ ((T0) >> 24));                \
  |  |   39|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   40|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  315|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[4]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  316|    270|    KEYSCHEDULE_UPDATE1(t0, t1, K0, K1, K2, K3, KC3);
  ------------------
  |  |   43|    270|    (T0) = (K0);                                        \
  |  |   44|    270|    (K0) = (((K0) >> 8) ^ ((K1) << 24));                \
  |  |   45|    270|    (K1) = (((K1) >> 8) ^ ((T0) << 24));                \
  |  |   46|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   47|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  317|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[6]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  318|    270|    KEYSCHEDULE_UPDATE0(t0, t1, K0, K1, K2, K3, KC4);
  ------------------
  |  |   36|    270|    (T0) = (K2);                                        \
  |  |   37|    270|    (K2) = (((K2) << 8) ^ ((K3) >> 24));                \
  |  |   38|    270|    (K3) = (((K3) << 8) ^ ((T0) >> 24));                \
  |  |   39|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   40|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  319|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[8]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  320|    270|    KEYSCHEDULE_UPDATE1(t0, t1, K0, K1, K2, K3, KC5);
  ------------------
  |  |   43|    270|    (T0) = (K0);                                        \
  |  |   44|    270|    (K0) = (((K0) >> 8) ^ ((K1) << 24));                \
  |  |   45|    270|    (K1) = (((K1) >> 8) ^ ((T0) << 24));                \
  |  |   46|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   47|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  321|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[10]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  322|    270|    KEYSCHEDULE_UPDATE0(t0, t1, K0, K1, K2, K3, KC6);
  ------------------
  |  |   36|    270|    (T0) = (K2);                                        \
  |  |   37|    270|    (K2) = (((K2) << 8) ^ ((K3) >> 24));                \
  |  |   38|    270|    (K3) = (((K3) << 8) ^ ((T0) >> 24));                \
  |  |   39|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   40|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  323|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[12]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  324|    270|    KEYSCHEDULE_UPDATE1(t0, t1, K0, K1, K2, K3, KC7);
  ------------------
  |  |   43|    270|    (T0) = (K0);                                        \
  |  |   44|    270|    (K0) = (((K0) >> 8) ^ ((K1) << 24));                \
  |  |   45|    270|    (K1) = (((K1) >> 8) ^ ((T0) << 24));                \
  |  |   46|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   47|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  325|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[14]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  326|    270|    KEYSCHEDULE_UPDATE0(t0, t1, K0, K1, K2, K3, KC8);
  ------------------
  |  |   36|    270|    (T0) = (K2);                                        \
  |  |   37|    270|    (K2) = (((K2) << 8) ^ ((K3) >> 24));                \
  |  |   38|    270|    (K3) = (((K3) << 8) ^ ((T0) >> 24));                \
  |  |   39|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   40|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  327|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[16]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  328|    270|    KEYSCHEDULE_UPDATE1(t0, t1, K0, K1, K2, K3, KC9);
  ------------------
  |  |   43|    270|    (T0) = (K0);                                        \
  |  |   44|    270|    (K0) = (((K0) >> 8) ^ ((K1) << 24));                \
  |  |   45|    270|    (K1) = (((K1) >> 8) ^ ((T0) << 24));                \
  |  |   46|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   47|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  329|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[18]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  330|    270|    KEYSCHEDULE_UPDATE0(t0, t1, K0, K1, K2, K3, KC10);
  ------------------
  |  |   36|    270|    (T0) = (K2);                                        \
  |  |   37|    270|    (K2) = (((K2) << 8) ^ ((K3) >> 24));                \
  |  |   38|    270|    (K3) = (((K3) << 8) ^ ((T0) >> 24));                \
  |  |   39|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   40|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  331|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[20]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  332|    270|    KEYSCHEDULE_UPDATE1(t0, t1, K0, K1, K2, K3, KC11);
  ------------------
  |  |   43|    270|    (T0) = (K0);                                        \
  |  |   44|    270|    (K0) = (((K0) >> 8) ^ ((K1) << 24));                \
  |  |   45|    270|    (K1) = (((K1) >> 8) ^ ((T0) << 24));                \
  |  |   46|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   47|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  333|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[22]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  334|    270|    KEYSCHEDULE_UPDATE0(t0, t1, K0, K1, K2, K3, KC12);
  ------------------
  |  |   36|    270|    (T0) = (K2);                                        \
  |  |   37|    270|    (K2) = (((K2) << 8) ^ ((K3) >> 24));                \
  |  |   38|    270|    (K3) = (((K3) << 8) ^ ((T0) >> 24));                \
  |  |   39|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   40|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  335|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[24]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  336|    270|    KEYSCHEDULE_UPDATE1(t0, t1, K0, K1, K2, K3, KC13);
  ------------------
  |  |   43|    270|    (T0) = (K0);                                        \
  |  |   44|    270|    (K0) = (((K0) >> 8) ^ ((K1) << 24));                \
  |  |   45|    270|    (K1) = (((K1) >> 8) ^ ((T0) << 24));                \
  |  |   46|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   47|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  337|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[26]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  338|    270|    KEYSCHEDULE_UPDATE0(t0, t1, K0, K1, K2, K3, KC14);
  ------------------
  |  |   36|    270|    (T0) = (K2);                                        \
  |  |   37|    270|    (K2) = (((K2) << 8) ^ ((K3) >> 24));                \
  |  |   38|    270|    (K3) = (((K3) << 8) ^ ((T0) >> 24));                \
  |  |   39|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   40|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  339|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[28]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  340|    270|    KEYSCHEDULE_UPDATE1(t0, t1, K0, K1, K2, K3, KC15);
  ------------------
  |  |   43|    270|    (T0) = (K0);                                        \
  |  |   44|    270|    (K0) = (((K0) >> 8) ^ ((K1) << 24));                \
  |  |   45|    270|    (K1) = (((K1) >> 8) ^ ((T0) << 24));                \
  |  |   46|    270|    (T0) = ((K0) + (K2) - (KC));                        \
  |  |   47|    270|    (T1) = ((K1) + (KC) - (K3))
  ------------------
  341|    270|    KEYUPDATE_TEMP(t0, t1, &ks->data[30]);
  ------------------
  |  |   50|    270|    (K)[0] = G_FUNC((T0));        \
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  |  |   51|    270|    (K)[1] = G_FUNC((T1))
  |  |  ------------------
  |  |  |  |   18|    270|    SS[0][((v)&0xff)] ^             \
  |  |  |  |   19|    270|        SS[1][((v) >> 8 & 0xff)] ^  \
  |  |  |  |   20|    270|        SS[2][((v) >> 16 & 0xff)] ^ \
  |  |  |  |   21|    270|        SS[3][((v) >> 24 & 0xff)]
  |  |  ------------------
  ------------------
  342|    270|}
SEED_InitContext:
  538|    270|{
  539|    270|    if (!cx) {
  ------------------
  |  Branch (539:9): [True: 0, False: 270]
  ------------------
  540|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  541|      0|        return SECFailure;
  542|      0|    }
  543|       |
  544|    270|    switch (mode) {
  545|      0|        case NSS_SEED:
  ------------------
  |  |   46|      0|#define NSS_SEED 0
  ------------------
  |  Branch (545:9): [True: 0, False: 270]
  ------------------
  546|      0|            SEED_set_key(key, &cx->ks);
  547|      0|            cx->mode = NSS_SEED;
  ------------------
  |  |   46|      0|#define NSS_SEED 0
  ------------------
  548|      0|            cx->encrypt = encrypt;
  549|      0|            break;
  550|       |
  551|    270|        case NSS_SEED_CBC:
  ------------------
  |  |   47|    270|#define NSS_SEED_CBC 1
  ------------------
  |  Branch (551:9): [True: 270, False: 0]
  ------------------
  552|    270|            memcpy(cx->iv, iv, 16);
  553|    270|            SEED_set_key(key, &cx->ks);
  554|    270|            cx->mode = NSS_SEED_CBC;
  ------------------
  |  |   47|    270|#define NSS_SEED_CBC 1
  ------------------
  555|    270|            cx->encrypt = encrypt;
  556|    270|            break;
  557|       |
  558|      0|        default:
  ------------------
  |  Branch (558:9): [True: 0, False: 270]
  ------------------
  559|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  560|      0|            return SECFailure;
  561|    270|    }
  562|       |
  563|    270|    return SECSuccess;
  564|    270|}
SEED_CreateContext:
  569|    270|{
  570|    270|    SEEDContext *cx = PORT_ZNew(SEEDContext);
  ------------------
  |  |  148|    270|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|    270|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  571|    270|    SECStatus rv = SEED_InitContext(cx, key, SEED_KEY_LENGTH, iv, mode,
  ------------------
  |  |  141|    270|#define SEED_KEY_LENGTH 16 /* bytes */
  ------------------
  572|    270|                                    encrypt, 0);
  573|       |
  574|    270|    if (rv != SECSuccess) {
  ------------------
  |  Branch (574:9): [True: 0, False: 270]
  ------------------
  575|      0|        PORT_ZFree(cx, sizeof *cx);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  576|      0|        cx = NULL;
  577|      0|    }
  578|       |
  579|    270|    return cx;
  580|    270|}
SEED_DestroyContext:
  584|    270|{
  585|    270|    if (cx) {
  ------------------
  |  Branch (585:9): [True: 270, False: 0]
  ------------------
  586|    270|        memset(cx, 0, sizeof *cx);
  587|       |
  588|    270|        if (freeit)
  ------------------
  |  Branch (588:13): [True: 270, False: 0]
  ------------------
  589|    270|            PORT_Free(cx);
  ------------------
  |  |   60|    270|#define PORT_Free PORT_Free_Util
  ------------------
  590|    270|    }
  591|    270|}

DES_MakeSchedule:
  404|  4.21k|{
  405|  4.21k|    register HALF left, right;
  406|  4.21k|    register HALF c0, d0;
  407|  4.21k|    register HALF temp;
  408|  4.21k|    int delta;
  409|  4.21k|    unsigned int ls;
  410|       |
  411|  4.21k|#if defined(HAVE_UNALIGNED_ACCESS)
  412|  4.21k|    left = HALFPTR(key)[0];
  ------------------
  |  |   18|  4.21k|#define HALFPTR(x) ((HALF *)(x))
  ------------------
  413|  4.21k|    right = HALFPTR(key)[1];
  ------------------
  |  |   18|  4.21k|#define HALFPTR(x) ((HALF *)(x))
  ------------------
  414|  4.21k|#if defined(IS_LITTLE_ENDIAN)
  415|  4.21k|    BYTESWAP(left, temp);
  ------------------
  |  |  358|  4.21k|    __asm("bswap  %0"        \
  |  |  359|  4.21k|          : "+r"(word));
  ------------------
  416|  4.21k|    BYTESWAP(right, temp);
  ------------------
  |  |  358|  4.21k|    __asm("bswap  %0"        \
  |  |  359|  4.21k|          : "+r"(word));
  ------------------
  417|  4.21k|#endif
  418|       |#else
  419|       |    if (((ptrdiff_t)key & 0x03) == 0) {
  420|       |        left = HALFPTR(key)[0];
  421|       |        right = HALFPTR(key)[1];
  422|       |#if defined(IS_LITTLE_ENDIAN)
  423|       |        BYTESWAP(left, temp);
  424|       |        BYTESWAP(right, temp);
  425|       |#endif
  426|       |    } else {
  427|       |        left = ((HALF)key[0] << 24) | ((HALF)key[1] << 16) |
  428|       |               ((HALF)key[2] << 8) | key[3];
  429|       |        right = ((HALF)key[4] << 24) | ((HALF)key[5] << 16) |
  430|       |                ((HALF)key[6] << 8) | key[7];
  431|       |    }
  432|       |#endif
  433|       |
  434|  4.21k|    PC1(left, right, c0, d0, temp);
  ------------------
  |  |  387|  4.21k|    right ^= temp = ((left >> 4) ^ right) & 0x0f0f0f0f; \
  |  |  388|  4.21k|    left ^= temp << 4;                                  \
  |  |  389|  4.21k|    FLIP_RIGHT_DIAGONAL(left, temp);                    \
  |  |  ------------------
  |  |  |  |  351|  4.21k|    temp = (word ^ (word >> 18)) & 0x00003333; \
  |  |  |  |  352|  4.21k|    word ^= temp | (temp << 18);               \
  |  |  |  |  353|  4.21k|    temp = (word ^ (word >> 9)) & 0x00550055;  \
  |  |  |  |  354|  4.21k|    word ^= temp | (temp << 9);
  |  |  ------------------
  |  |  390|  4.21k|    FLIP_RIGHT_DIAGONAL(right, temp);                   \
  |  |  ------------------
  |  |  |  |  351|  4.21k|    temp = (word ^ (word >> 18)) & 0x00003333; \
  |  |  |  |  352|  4.21k|    word ^= temp | (temp << 18);               \
  |  |  |  |  353|  4.21k|    temp = (word ^ (word >> 9)) & 0x00550055;  \
  |  |  |  |  354|  4.21k|    word ^= temp | (temp << 9);
  |  |  ------------------
  |  |  391|  4.21k|    BYTESWAP(right, temp);                              \
  |  |  ------------------
  |  |  |  |  358|  4.21k|    __asm("bswap  %0"        \
  |  |  |  |  359|  4.21k|          : "+r"(word));
  |  |  ------------------
  |  |  392|  4.21k|    c0 = right >> 4;                                    \
  |  |  393|  4.21k|    d0 = ((left & 0x00ffffff) << 4) | (right & 0xf);
  ------------------
  435|       |
  436|  4.21k|    if (direction == DES_ENCRYPT) {
  ------------------
  |  Branch (436:9): [True: 2.15k, False: 2.06k]
  ------------------
  437|  2.15k|        delta = 2 * (int)sizeof(HALF);
  438|  2.15k|    } else {
  439|  2.06k|        ks += 30;
  440|  2.06k|        delta = (-2) * (int)sizeof(HALF);
  441|  2.06k|    }
  442|       |
  443|  71.6k|    for (ls = 0x8103; ls; ls >>= 1) {
  ------------------
  |  Branch (443:23): [True: 67.4k, False: 4.21k]
  ------------------
  444|  67.4k|        if (ls & 1) {
  ------------------
  |  Branch (444:13): [True: 16.8k, False: 50.6k]
  ------------------
  445|  16.8k|            c0 = LEFT_SHIFT_1(c0);
  ------------------
  |  |  395|  16.8k|#define LEFT_SHIFT_1(reg) (((reg << 1) | (reg >> 27)) & 0x0FFFFFFF)
  ------------------
  446|  16.8k|            d0 = LEFT_SHIFT_1(d0);
  ------------------
  |  |  395|  16.8k|#define LEFT_SHIFT_1(reg) (((reg << 1) | (reg >> 27)) & 0x0FFFFFFF)
  ------------------
  447|  50.6k|        } else {
  448|  50.6k|            c0 = LEFT_SHIFT_2(c0);
  ------------------
  |  |  396|  50.6k|#define LEFT_SHIFT_2(reg) (((reg << 2) | (reg >> 26)) & 0x0FFFFFFF)
  ------------------
  449|  50.6k|            d0 = LEFT_SHIFT_2(d0);
  ------------------
  |  |  396|  50.6k|#define LEFT_SHIFT_2(reg) (((reg << 2) | (reg >> 26)) & 0x0FFFFFFF)
  ------------------
  450|  50.6k|        }
  451|       |
  452|       |#ifdef USE_INDEXING
  453|       |#define PC2LOOKUP(b, c) PC2[b][c]
  454|       |
  455|       |        left = PC2LOOKUP(0, ((c0 >> 22) & 0x3F));
  456|       |        left |= PC2LOOKUP(1, ((c0 >> 13) & 0x3F));
  457|       |        left |= PC2LOOKUP(2, ((c0 >> 4) & 0x38) | (c0 & 0x7));
  458|       |        left |= PC2LOOKUP(3, ((c0 >> 18) & 0xC) | ((c0 >> 11) & 0x3) | (c0 & 0x30));
  459|       |
  460|       |        right = PC2LOOKUP(4, ((d0 >> 22) & 0x3F));
  461|       |        right |= PC2LOOKUP(5, ((d0 >> 15) & 0x30) | ((d0 >> 14) & 0xf));
  462|       |        right |= PC2LOOKUP(6, ((d0 >> 7) & 0x3F));
  463|       |        right |= PC2LOOKUP(7, ((d0 >> 1) & 0x3C) | (d0 & 0x3));
  464|       |#else
  465|  67.4k|#define PC2LOOKUP(b, c) *(HALF *)((BYTE *)&PC2[b][0] + (c))
  466|       |
  467|  67.4k|        left = PC2LOOKUP(0, ((c0 >> 20) & 0xFC));
  ------------------
  |  |  465|  67.4k|#define PC2LOOKUP(b, c) *(HALF *)((BYTE *)&PC2[b][0] + (c))
  ------------------
  468|  67.4k|        left |= PC2LOOKUP(1, ((c0 >> 11) & 0xFC));
  ------------------
  |  |  465|  67.4k|#define PC2LOOKUP(b, c) *(HALF *)((BYTE *)&PC2[b][0] + (c))
  ------------------
  469|  67.4k|        left |= PC2LOOKUP(2, ((c0 >> 2) & 0xE0) | ((c0 << 2) & 0x1C));
  ------------------
  |  |  465|  67.4k|#define PC2LOOKUP(b, c) *(HALF *)((BYTE *)&PC2[b][0] + (c))
  ------------------
  470|  67.4k|        left |= PC2LOOKUP(3, ((c0 >> 16) & 0x30) | ((c0 >> 9) & 0xC) | ((c0 << 2) & 0xC0));
  ------------------
  |  |  465|  67.4k|#define PC2LOOKUP(b, c) *(HALF *)((BYTE *)&PC2[b][0] + (c))
  ------------------
  471|       |
  472|  67.4k|        right = PC2LOOKUP(4, ((d0 >> 20) & 0xFC));
  ------------------
  |  |  465|  67.4k|#define PC2LOOKUP(b, c) *(HALF *)((BYTE *)&PC2[b][0] + (c))
  ------------------
  473|  67.4k|        right |= PC2LOOKUP(5, ((d0 >> 13) & 0xC0) | ((d0 >> 12) & 0x3C));
  ------------------
  |  |  465|  67.4k|#define PC2LOOKUP(b, c) *(HALF *)((BYTE *)&PC2[b][0] + (c))
  ------------------
  474|  67.4k|        right |= PC2LOOKUP(6, ((d0 >> 5) & 0xFC));
  ------------------
  |  |  465|  67.4k|#define PC2LOOKUP(b, c) *(HALF *)((BYTE *)&PC2[b][0] + (c))
  ------------------
  475|  67.4k|        right |= PC2LOOKUP(7, ((d0 << 1) & 0xF0) | ((d0 << 2) & 0x0C));
  ------------------
  |  |  465|  67.4k|#define PC2LOOKUP(b, c) *(HALF *)((BYTE *)&PC2[b][0] + (c))
  ------------------
  476|  67.4k|#endif
  477|       |        /* left  contains key bits for S1 S3 S2 S4 */
  478|       |        /* right contains key bits for S6 S8 S5 S7 */
  479|  67.4k|        temp = (left << 16)     /* S2 S4 XX XX */
  480|  67.4k|               | (right >> 16); /* XX XX S6 S8 */
  481|  67.4k|        ks[0] = temp;
  482|       |
  483|  67.4k|        temp = (left & 0xffff0000)     /* S1 S3 XX XX */
  484|  67.4k|               | (right & 0x0000ffff); /* XX XX S5 S7 */
  485|  67.4k|        ks[1] = temp;
  486|       |
  487|  67.4k|        ks = (HALF *)((BYTE *)ks + delta);
  488|  67.4k|    }
  489|  4.21k|}
DES_Do1Block:
  560|  1.60k|{
  561|  1.60k|    register HALF left, right;
  562|  1.60k|    register HALF temp;
  563|       |
  564|  1.60k|#if defined(HAVE_UNALIGNED_ACCESS)
  565|  1.60k|    left = HALFPTR(inbuf)[0];
  ------------------
  |  |   18|  1.60k|#define HALFPTR(x) ((HALF *)(x))
  ------------------
  566|  1.60k|    right = HALFPTR(inbuf)[1];
  ------------------
  |  |   18|  1.60k|#define HALFPTR(x) ((HALF *)(x))
  ------------------
  567|  1.60k|#if defined(IS_LITTLE_ENDIAN)
  568|  1.60k|    BYTESWAP(left, temp);
  ------------------
  |  |  358|  1.60k|    __asm("bswap  %0"        \
  |  |  359|  1.60k|          : "+r"(word));
  ------------------
  569|  1.60k|    BYTESWAP(right, temp);
  ------------------
  |  |  358|  1.60k|    __asm("bswap  %0"        \
  |  |  359|  1.60k|          : "+r"(word));
  ------------------
  570|  1.60k|#endif
  571|       |#else
  572|       |    if (((ptrdiff_t)inbuf & 0x03) == 0) {
  573|       |        left = HALFPTR(inbuf)[0];
  574|       |        right = HALFPTR(inbuf)[1];
  575|       |#if defined(IS_LITTLE_ENDIAN)
  576|       |        BYTESWAP(left, temp);
  577|       |        BYTESWAP(right, temp);
  578|       |#endif
  579|       |    } else {
  580|       |        left = ((HALF)inbuf[0] << 24) | ((HALF)inbuf[1] << 16) |
  581|       |               ((HALF)inbuf[2] << 8) | inbuf[3];
  582|       |        right = ((HALF)inbuf[4] << 24) | ((HALF)inbuf[5] << 16) |
  583|       |                ((HALF)inbuf[6] << 8) | inbuf[7];
  584|       |    }
  585|       |#endif
  586|       |
  587|  1.60k|    IP(left, right, temp);
  ------------------
  |  |  531|  1.60k|    right ^= temp = ((left >> 4) ^ right) & 0x0f0f0f0f;  \
  |  |  532|  1.60k|    left ^= temp << 4;                                   \
  |  |  533|  1.60k|    right ^= temp = ((left >> 16) ^ right) & 0x0000ffff; \
  |  |  534|  1.60k|    left ^= temp << 16;                                  \
  |  |  535|  1.60k|    right ^= temp = ((left << 2) ^ right) & 0xcccccccc;  \
  |  |  536|  1.60k|    left ^= temp >> 2;                                   \
  |  |  537|  1.60k|    right ^= temp = ((left << 8) ^ right) & 0xff00ff00;  \
  |  |  538|  1.60k|    left ^= temp >> 8;                                   \
  |  |  539|  1.60k|    right ^= temp = ((left >> 1) ^ right) & 0x55555555;  \
  |  |  540|  1.60k|    left ^= temp << 1;
  ------------------
  588|       |
  589|       |    /* shift the values left circularly 3 bits. */
  590|  1.60k|    left = (left << 3) | (left >> 29);
  591|  1.60k|    right = (right << 3) | (right >> 29);
  592|       |
  593|       |#ifdef USE_INDEXING
  594|       |#define KSLOOKUP(s, b) SP[s][((temp >> (b + 2)) & 0x3f)]
  595|       |#else
  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  597|  1.60k|#endif
  598|  1.60k|#define ROUND(out, in, r)                            \
  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  609|       |
  610|       |    /* Do the 16 Feistel rounds */
  611|  1.60k|    ROUND(left, right, 0)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  612|  1.60k|    ROUND(right, left, 1)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  613|  1.60k|    ROUND(left, right, 2)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  614|  1.60k|    ROUND(right, left, 3)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  615|  1.60k|    ROUND(left, right, 4)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  616|  1.60k|    ROUND(right, left, 5)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  617|  1.60k|    ROUND(left, right, 6)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  618|  1.60k|    ROUND(right, left, 7)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  619|  1.60k|    ROUND(left, right, 8)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  620|  1.60k|    ROUND(right, left, 9)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  621|  1.60k|    ROUND(left, right, 10)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  622|  1.60k|    ROUND(right, left, 11)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  623|  1.60k|    ROUND(left, right, 12)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  624|  1.60k|    ROUND(right, left, 13)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  625|  1.60k|    ROUND(left, right, 14)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  626|  1.60k|    ROUND(right, left, 15)
  ------------------
  |  |  599|  1.60k|    temp = in ^ ks[2 * r];                           \
  |  |  600|  1.60k|    out ^= KSLOOKUP(1, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  601|  1.60k|    out ^= KSLOOKUP(3, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  602|  1.60k|    out ^= KSLOOKUP(5, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  603|  1.60k|    out ^= KSLOOKUP(7, 0);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  604|  1.60k|    temp = ((in >> 4) | (in << 28)) ^ ks[2 * r + 1]; \
  |  |  605|  1.60k|    out ^= KSLOOKUP(0, 24);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  606|  1.60k|    out ^= KSLOOKUP(2, 16);                          \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  607|  1.60k|    out ^= KSLOOKUP(4, 8);                           \
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  |  |  608|  1.60k|    out ^= KSLOOKUP(6, 0);
  |  |  ------------------
  |  |  |  |  596|  1.60k|#define KSLOOKUP(s, b) *(HALF *)((BYTE *)&SP[s][0] + ((temp >> b) & 0xFC))
  |  |  ------------------
  ------------------
  627|       |
  628|       |    /* now shift circularly right 3 bits to undo the shifting done
  629|       |    ** above.  switch left and right here.
  630|       |    */
  631|  1.60k|    temp = (left >> 3) | (left << 29);
  632|  1.60k|    left = (right >> 3) | (right << 29);
  633|  1.60k|    right = temp;
  634|       |
  635|  1.60k|    FP(left, right, temp);
  ------------------
  |  |  547|  1.60k|    right ^= temp = ((left >> 1) ^ right) & 0x55555555;  \
  |  |  548|  1.60k|    left ^= temp << 1;                                   \
  |  |  549|  1.60k|    right ^= temp = ((left << 8) ^ right) & 0xff00ff00;  \
  |  |  550|  1.60k|    left ^= temp >> 8;                                   \
  |  |  551|  1.60k|    right ^= temp = ((left << 2) ^ right) & 0xcccccccc;  \
  |  |  552|  1.60k|    left ^= temp >> 2;                                   \
  |  |  553|  1.60k|    right ^= temp = ((left >> 16) ^ right) & 0x0000ffff; \
  |  |  554|  1.60k|    left ^= temp << 16;                                  \
  |  |  555|  1.60k|    right ^= temp = ((left >> 4) ^ right) & 0x0f0f0f0f;  \
  |  |  556|  1.60k|    left ^= temp << 4;
  ------------------
  636|       |
  637|  1.60k|#if defined(HAVE_UNALIGNED_ACCESS)
  638|  1.60k|#if defined(IS_LITTLE_ENDIAN)
  639|  1.60k|    BYTESWAP(left, temp);
  ------------------
  |  |  358|  1.60k|    __asm("bswap  %0"        \
  |  |  359|  1.60k|          : "+r"(word));
  ------------------
  640|  1.60k|    BYTESWAP(right, temp);
  ------------------
  |  |  358|  1.60k|    __asm("bswap  %0"        \
  |  |  359|  1.60k|          : "+r"(word));
  ------------------
  641|  1.60k|#endif
  642|  1.60k|    HALFPTR(outbuf)
  ------------------
  |  |   18|  1.60k|#define HALFPTR(x) ((HALF *)(x))
  ------------------
  643|  1.60k|    [0] = left;
  644|  1.60k|    HALFPTR(outbuf)
  ------------------
  |  |   18|  1.60k|#define HALFPTR(x) ((HALF *)(x))
  ------------------
  645|  1.60k|    [1] = right;
  646|       |#else
  647|       |    if (((ptrdiff_t)outbuf & 0x03) == 0) {
  648|       |#if defined(IS_LITTLE_ENDIAN)
  649|       |        BYTESWAP(left, temp);
  650|       |        BYTESWAP(right, temp);
  651|       |#endif
  652|       |        HALFPTR(outbuf)
  653|       |        [0] = left;
  654|       |        HALFPTR(outbuf)
  655|       |        [1] = right;
  656|       |    } else {
  657|       |        outbuf[0] = (BYTE)(left >> 24);
  658|       |        outbuf[1] = (BYTE)(left >> 16);
  659|       |        outbuf[2] = (BYTE)(left >> 8);
  660|       |        outbuf[3] = (BYTE)(left);
  661|       |
  662|       |        outbuf[4] = (BYTE)(right >> 24);
  663|       |        outbuf[5] = (BYTE)(right >> 16);
  664|       |        outbuf[6] = (BYTE)(right >> 8);
  665|       |        outbuf[7] = (BYTE)(right);
  666|       |    }
  667|       |#endif
  668|  1.60k|}

DES_InitContext:
  146|  1.60k|{
  147|  1.60k|    DESDirection opposite;
  148|  1.60k|    if (!cx) {
  ------------------
  |  Branch (148:9): [True: 0, False: 1.60k]
  ------------------
  149|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  150|      0|        return SECFailure;
  151|      0|    }
  152|  1.60k|    cx->direction = encrypt ? DES_ENCRYPT : DES_DECRYPT;
  ------------------
  |  Branch (152:21): [True: 848, False: 759]
  ------------------
  153|  1.60k|    opposite = encrypt ? DES_DECRYPT : DES_ENCRYPT;
  ------------------
  |  Branch (153:16): [True: 848, False: 759]
  ------------------
  154|  1.60k|    switch (mode) {
  155|      0|        case NSS_DES: /* DES ECB */
  ------------------
  |  |   25|      0|#define NSS_DES 0
  ------------------
  |  Branch (155:9): [True: 0, False: 1.60k]
  ------------------
  156|      0|            DES_MakeSchedule(cx->ks0, key, cx->direction);
  157|      0|            cx->worker = &DES_ECB;
  158|      0|            break;
  159|       |
  160|     89|        case NSS_DES_EDE3: /* DES EDE ECB */
  ------------------
  |  |   27|     89|#define NSS_DES_EDE3 2
  ------------------
  |  Branch (160:9): [True: 89, False: 1.51k]
  ------------------
  161|     89|            cx->worker = &DES_EDE3_ECB;
  162|     89|            if (encrypt) {
  ------------------
  |  Branch (162:17): [True: 89, False: 0]
  ------------------
  163|     89|                DES_MakeSchedule(cx->ks0, key, cx->direction);
  164|     89|                DES_MakeSchedule(cx->ks1, key + 8, opposite);
  165|     89|                DES_MakeSchedule(cx->ks2, key + 16, cx->direction);
  166|     89|            } else {
  167|      0|                DES_MakeSchedule(cx->ks2, key, cx->direction);
  168|      0|                DES_MakeSchedule(cx->ks1, key + 8, opposite);
  169|      0|                DES_MakeSchedule(cx->ks0, key + 16, cx->direction);
  170|      0|            }
  171|     89|            break;
  172|       |
  173|    302|        case NSS_DES_CBC: /* DES CBC */
  ------------------
  |  |   26|    302|#define NSS_DES_CBC 1
  ------------------
  |  Branch (173:9): [True: 302, False: 1.30k]
  ------------------
  174|    302|            COPY8BTOHALF(cx->iv, iv);
  ------------------
  |  |   31|    302|#define COPY8BTOHALF(to, from) COPY8B(to, from, from)
  |  |  ------------------
  |  |  |  |   24|    302|    HALFPTR(to)               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|    302|#define HALFPTR(x) ((HALF *)(x))
  |  |  |  |  ------------------
  |  |  |  |   25|    302|    [0] = HALFPTR(from)[0];   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|    302|#define HALFPTR(x) ((HALF *)(x))
  |  |  |  |  ------------------
  |  |  |  |   26|    302|    HALFPTR(to)               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|    302|#define HALFPTR(x) ((HALF *)(x))
  |  |  |  |  ------------------
  |  |  |  |   27|    302|    [1] = HALFPTR(from)[1];
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|    302|#define HALFPTR(x) ((HALF *)(x))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|    302|            cx->worker = encrypt ? &DES_CBCEn : &DES_CBCDe;
  ------------------
  |  Branch (175:26): [True: 151, False: 151]
  ------------------
  176|    302|            DES_MakeSchedule(cx->ks0, key, cx->direction);
  177|    302|            break;
  178|       |
  179|  1.21k|        case NSS_DES_EDE3_CBC: /* DES EDE CBC */
  ------------------
  |  |   28|  1.21k|#define NSS_DES_EDE3_CBC 3
  ------------------
  |  Branch (179:9): [True: 1.21k, False: 391]
  ------------------
  180|  1.21k|            COPY8BTOHALF(cx->iv, iv);
  ------------------
  |  |   31|  1.21k|#define COPY8BTOHALF(to, from) COPY8B(to, from, from)
  |  |  ------------------
  |  |  |  |   24|  1.21k|    HALFPTR(to)               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|  1.21k|#define HALFPTR(x) ((HALF *)(x))
  |  |  |  |  ------------------
  |  |  |  |   25|  1.21k|    [0] = HALFPTR(from)[0];   \
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|  1.21k|#define HALFPTR(x) ((HALF *)(x))
  |  |  |  |  ------------------
  |  |  |  |   26|  1.21k|    HALFPTR(to)               \
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|  1.21k|#define HALFPTR(x) ((HALF *)(x))
  |  |  |  |  ------------------
  |  |  |  |   27|  1.21k|    [1] = HALFPTR(from)[1];
  |  |  |  |  ------------------
  |  |  |  |  |  |   18|  1.21k|#define HALFPTR(x) ((HALF *)(x))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  181|  1.21k|            if (encrypt) {
  ------------------
  |  Branch (181:17): [True: 608, False: 608]
  ------------------
  182|    608|                cx->worker = &DES_EDE3CBCEn;
  183|    608|                DES_MakeSchedule(cx->ks0, key, cx->direction);
  184|    608|                DES_MakeSchedule(cx->ks1, key + 8, opposite);
  185|    608|                DES_MakeSchedule(cx->ks2, key + 16, cx->direction);
  186|    608|            } else {
  187|    608|                cx->worker = &DES_EDE3CBCDe;
  188|    608|                DES_MakeSchedule(cx->ks2, key, cx->direction);
  189|    608|                DES_MakeSchedule(cx->ks1, key + 8, opposite);
  190|    608|                DES_MakeSchedule(cx->ks0, key + 16, cx->direction);
  191|    608|            }
  192|  1.21k|            break;
  193|       |
  194|      0|        default:
  ------------------
  |  Branch (194:9): [True: 0, False: 1.60k]
  ------------------
  195|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  196|      0|            return SECFailure;
  197|  1.60k|    }
  198|  1.60k|    return SECSuccess;
  199|  1.60k|}
DES_CreateContext:
  203|  1.60k|{
  204|  1.60k|    DESContext *cx = PORT_ZNew(DESContext);
  ------------------
  |  |  148|  1.60k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  1.60k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  205|  1.60k|    SECStatus rv = DES_InitContext(cx, key, 0, iv, mode, encrypt, 0);
  206|       |
  207|  1.60k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (207:9): [True: 0, False: 1.60k]
  ------------------
  208|      0|        PORT_ZFree(cx, sizeof *cx);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  209|      0|        cx = NULL;
  210|      0|    }
  211|  1.60k|    return cx;
  212|  1.60k|}
DES_DestroyContext:
  216|  1.60k|{
  217|  1.60k|    if (cx) {
  ------------------
  |  Branch (217:9): [True: 1.60k, False: 0]
  ------------------
  218|  1.60k|        memset(cx, 0, sizeof *cx);
  219|  1.60k|        if (freeit)
  ------------------
  |  Branch (219:13): [True: 1.60k, False: 0]
  ------------------
  220|  1.60k|            PORT_Free(cx);
  ------------------
  |  |   60|  1.60k|#define PORT_Free PORT_Free_Util
  ------------------
  221|  1.60k|    }
  222|  1.60k|}
DES_Encrypt:
  227|     89|{
  228|       |
  229|     89|    if ((inLen % 8) != 0 || maxOutLen < inLen || !cx ||
  ------------------
  |  Branch (229:9): [True: 0, False: 89]
  |  Branch (229:29): [True: 0, False: 89]
  |  Branch (229:50): [True: 0, False: 89]
  ------------------
  230|     89|        cx->direction != DES_ENCRYPT) {
  ------------------
  |  Branch (230:9): [True: 0, False: 89]
  ------------------
  231|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  232|      0|        return SECFailure;
  233|      0|    }
  234|       |
  235|     89|    cx->worker(cx, out, in, inLen);
  236|     89|    if (outLen)
  ------------------
  |  Branch (236:9): [True: 89, False: 0]
  ------------------
  237|     89|        *outLen = inLen;
  238|     89|    return SECSuccess;
  239|     89|}
desblapi.c:DES_EDE3_ECB:
   47|     89|{
   48|    623|    while (len) {
  ------------------
  |  Branch (48:12): [True: 534, False: 89]
  ------------------
   49|    534|        DES_Do1Block(cx->ks0, in, out);
   50|    534|        len -= 8;
   51|    534|        in += 8;
   52|    534|        DES_Do1Block(cx->ks1, out, out);
   53|    534|        DES_Do1Block(cx->ks2, out, out);
   54|    534|        out += 8;
   55|    534|    }
   56|     89|}

RNG_RNGInit:
   39|      1|{
   40|       |    /* Allow only one call to initialize the context */
   41|      1|    if (PR_CallOnce(&coRNGInit, rng_init) != PR_SUCCESS) {
  ------------------
  |  Branch (41:9): [True: 0, False: 1]
  ------------------
   42|      0|        return SECFailure;
   43|      0|    }
   44|       |
   45|      1|    return SECSuccess;
   46|      1|}
RNG_RandomUpdate:
   52|  8.85k|{
   53|       |    /* Check for a valid RNG lock. */
   54|  8.85k|    PORT_Assert(rng_lock != NULL);
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   55|  8.85k|    if (rng_lock == NULL) {
  ------------------
  |  Branch (55:9): [True: 0, False: 8.85k]
  ------------------
   56|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   57|      0|        return SECFailure;
   58|      0|    }
   59|       |
   60|       |    /* --- LOCKED --- */
   61|  8.85k|    PZ_Lock(rng_lock);
  ------------------
  |  |  245|  8.85k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
   62|  8.85k|    memset(globalBytes, 0, GLOBAL_BYTES_SIZE);
  ------------------
  |  |   13|  8.85k|#define GLOBAL_BYTES_SIZE 100
  ------------------
   63|  8.85k|    globalNumCalls = 0;
   64|  8.85k|    if (data) {
  ------------------
  |  Branch (64:9): [True: 0, False: 8.85k]
  ------------------
   65|      0|        memcpy(globalBytes, (PRUint8 *)data, PR_MIN(bytes, GLOBAL_BYTES_SIZE));
  ------------------
  |  |  158|      0|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
   66|      0|    }
   67|  8.85k|    PZ_Unlock(rng_lock);
  ------------------
  |  |  246|  8.85k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
   68|       |    /* --- UNLOCKED --- */
   69|       |
   70|  8.85k|    return SECSuccess;
   71|  8.85k|}
RNG_GenerateGlobalRandomBytes:
   75|  33.6k|{
   76|  33.6k|    static const uint8_t key[32] = { 0 };
   77|  33.6k|    uint8_t nonce[12] = { 0 };
   78|       |
   79|       |    /* Check for a valid RNG lock. */
   80|  33.6k|    PORT_Assert(rng_lock != NULL);
  ------------------
  |  |  120|  33.6k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  33.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 33.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  33.6k|    if (rng_lock == NULL) {
  ------------------
  |  Branch (81:9): [True: 0, False: 33.6k]
  ------------------
   82|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   83|      0|        return SECFailure;
   84|      0|    }
   85|       |
   86|       |    /* --- LOCKED --- */
   87|  33.6k|    PZ_Lock(rng_lock);
  ------------------
  |  |  245|  33.6k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
   88|       |
   89|  33.6k|    memcpy(nonce, &globalNumCalls, sizeof(globalNumCalls));
   90|  33.6k|    globalNumCalls++;
   91|       |
   92|  33.6k|    ChaCha20Poly1305Context *cx =
   93|  33.6k|        ChaCha20Poly1305_CreateContext(key, sizeof(key), 16);
   94|  33.6k|    if (!cx) {
  ------------------
  |  Branch (94:9): [True: 0, False: 33.6k]
  ------------------
   95|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   96|      0|        PZ_Unlock(rng_lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
   97|      0|        return SECFailure;
   98|      0|    }
   99|       |
  100|  33.6k|    memset(dest, 0, len);
  101|  33.6k|    memcpy(dest, globalBytes, PR_MIN(len, GLOBAL_BYTES_SIZE));
  ------------------
  |  |  158|  33.6k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 32.6k, False: 1.08k]
  |  |  ------------------
  ------------------
  102|  33.6k|    Hacl_Chacha20_chacha20_encrypt(len, (uint8_t *)dest, (uint8_t *)dest,
  103|  33.6k|                                   (uint8_t *)key, nonce, 0);
  104|  33.6k|    ChaCha20Poly1305_DestroyContext(cx, PR_TRUE);
  ------------------
  |  |  437|  33.6k|#define PR_TRUE 1
  ------------------
  105|       |
  106|  33.6k|    PZ_Unlock(rng_lock);
  ------------------
  |  |  246|  33.6k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  107|       |    /* --- UNLOCKED --- */
  108|       |
  109|  33.6k|    return SECSuccess;
  110|  33.6k|}
RNG_RNGShutdown:
  114|      1|{
  115|      1|    if (rng_lock) {
  ------------------
  |  Branch (115:9): [True: 1, False: 0]
  ------------------
  116|      1|        PZ_DestroyLock(rng_lock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  117|      1|        rng_lock = NULL;
  118|      1|    }
  119|      1|    coRNGInit = pristineCallOnce;
  120|      1|}
det_rng.c:rng_init:
   22|      1|{
   23|      1|    rng_lock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
   24|      1|    if (!rng_lock) {
  ------------------
  |  Branch (24:9): [True: 0, False: 1]
  ------------------
   25|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   26|      0|        return PR_FAILURE;
   27|      0|    }
   28|       |    /* --- LOCKED --- */
   29|      1|    PZ_Lock(rng_lock);
  ------------------
  |  |  245|      1|#define PZ_Lock(k) PR_Lock((k))
  ------------------
   30|      1|    memset(globalBytes, 0, GLOBAL_BYTES_SIZE);
  ------------------
  |  |   13|      1|#define GLOBAL_BYTES_SIZE 100
  ------------------
   31|      1|    PZ_Unlock(rng_lock);
  ------------------
  |  |  246|      1|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
   32|       |    /* --- UNLOCKED --- */
   33|       |
   34|      1|    return PR_SUCCESS;
   35|      1|}

DH_NewKey:
  137|  1.91k|{
  138|  1.91k|    PLArenaPool *arena;
  139|  1.91k|    DHPrivateKey *key;
  140|  1.91k|    mp_int g, xa, p, Ya;
  141|  1.91k|    mp_err err = MP_OKAY;
  ------------------
  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  142|  1.91k|    SECStatus rv = SECSuccess;
  143|  1.91k|    if (!params || !privKey) {
  ------------------
  |  Branch (143:9): [True: 0, False: 1.91k]
  |  Branch (143:20): [True: 0, False: 1.91k]
  ------------------
  144|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  145|      0|        return SECFailure;
  146|      0|    }
  147|  1.91k|    arena = PORT_NewArena(NSS_FREEBL_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  1.91k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(NSS_FREEBL_DEFAULT_CHUNKSIZE);
  ------------------
  |  |  143|  1.91k|#define NSS_FREEBL_DEFAULT_CHUNKSIZE 2048
  ------------------
  148|  1.91k|    if (!arena) {
  ------------------
  |  Branch (148:9): [True: 0, False: 1.91k]
  ------------------
  149|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  150|      0|        return SECFailure;
  151|      0|    }
  152|  1.91k|    key = (DHPrivateKey *)PORT_ArenaZAlloc(arena, sizeof(DHPrivateKey));
  ------------------
  |  |   59|  1.91k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  153|  1.91k|    if (!key) {
  ------------------
  |  Branch (153:9): [True: 0, False: 1.91k]
  ------------------
  154|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  155|      0|        PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  156|      0|        return SECFailure;
  157|      0|    }
  158|  1.91k|    key->arena = arena;
  159|  1.91k|    MP_DIGITS(&g) = 0;
  ------------------
  |  |  152|  1.91k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  160|  1.91k|    MP_DIGITS(&xa) = 0;
  ------------------
  |  |  152|  1.91k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  161|  1.91k|    MP_DIGITS(&p) = 0;
  ------------------
  |  |  152|  1.91k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  162|  1.91k|    MP_DIGITS(&Ya) = 0;
  ------------------
  |  |  152|  1.91k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  163|  1.91k|    CHECK_MPI_OK(mp_init(&g));
  ------------------
  |  |   12|  1.91k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |   13|  1.91k|    goto cleanup
  ------------------
  164|  1.91k|    CHECK_MPI_OK(mp_init(&xa));
  ------------------
  |  |   12|  1.91k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |   13|  1.91k|    goto cleanup
  ------------------
  165|  1.91k|    CHECK_MPI_OK(mp_init(&p));
  ------------------
  |  |   12|  1.91k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |   13|  1.91k|    goto cleanup
  ------------------
  166|  1.91k|    CHECK_MPI_OK(mp_init(&Ya));
  ------------------
  |  |   12|  1.91k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |   13|  1.91k|    goto cleanup
  ------------------
  167|       |    /* Set private key's p */
  168|  1.91k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->prime, &params->prime));
  ------------------
  |  |    8|  1.91k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |    9|  1.91k|    goto cleanup
  ------------------
  169|  1.91k|    SECITEM_TO_MPINT(key->prime, &p);
  ------------------
  |  |   19|  1.91k|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|  1.91k|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 1.91k]
  |  |  |  |  ------------------
  |  |  |  |   13|  1.91k|    goto cleanup
  |  |  ------------------
  ------------------
  170|       |    /* Set private key's g */
  171|  1.91k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->base, &params->base));
  ------------------
  |  |    8|  1.91k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |    9|  1.91k|    goto cleanup
  ------------------
  172|  1.91k|    SECITEM_TO_MPINT(key->base, &g);
  ------------------
  |  |   19|  1.91k|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|  1.91k|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 1.91k]
  |  |  |  |  ------------------
  |  |  |  |   13|  1.91k|    goto cleanup
  |  |  ------------------
  ------------------
  173|       |    /* Generate private key xa */
  174|  1.91k|    SECITEM_AllocItem(arena, &key->privateValue,
  ------------------
  |  |  103|  1.91k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  175|  1.91k|                      dh_GetSecretKeyLen(params->prime.len));
  176|  1.91k|    CHECK_SEC_OK(RNG_GenerateGlobalRandomBytes(key->privateValue.data,
  ------------------
  |  |    8|  1.91k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |    9|  1.91k|    goto cleanup
  ------------------
  177|  1.91k|                                               key->privateValue.len));
  178|  1.91k|    SECITEM_TO_MPINT(key->privateValue, &xa);
  ------------------
  |  |   19|  1.91k|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|  1.91k|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 1.91k]
  |  |  |  |  ------------------
  |  |  |  |   13|  1.91k|    goto cleanup
  |  |  ------------------
  ------------------
  179|       |    /* xa < p */
  180|  1.91k|    CHECK_MPI_OK(mp_mod(&xa, &p, &xa));
  ------------------
  |  |   12|  1.91k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |   13|  1.91k|    goto cleanup
  ------------------
  181|       |    /* Compute public key Ya = g ** xa mod p */
  182|  1.91k|    CHECK_MPI_OK(mp_exptmod(&g, &xa, &p, &Ya));
  ------------------
  |  |   12|  1.91k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |   13|  1.91k|    goto cleanup
  ------------------
  183|  1.91k|    MPINT_TO_SECITEM(&Ya, &key->publicValue, key->arena);
  ------------------
  |  |   22|  1.91k|    do {                                                        \
  |  |   23|  1.91k|        int mpintLen = mp_unsigned_octet_size(mp);              \
  |  |   24|  1.91k|        if (mpintLen <= 0) {                                    \
  |  |  ------------------
  |  |  |  Branch (24:13): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |   25|      0|            err = MP_RANGE;                                     \
  |  |  ------------------
  |  |  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  |  |  ------------------
  |  |   26|      0|            goto cleanup;                                       \
  |  |   27|      0|        }                                                       \
  |  |   28|  1.91k|        SECITEM_AllocItem(arena, (it), mpintLen);               \
  |  |  ------------------
  |  |  |  |  103|  1.91k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  |  |  ------------------
  |  |   29|  1.91k|        if ((it)->data == NULL) {                               \
  |  |  ------------------
  |  |  |  Branch (29:13): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |   30|      0|            err = MP_MEM;                                       \
  |  |  ------------------
  |  |  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  |  |  ------------------
  |  |   31|      0|            goto cleanup;                                       \
  |  |   32|      0|        }                                                       \
  |  |   33|  1.91k|        err = mp_to_unsigned_octets(mp, (it)->data, (it)->len); \
  |  |   34|  1.91k|        if (err < 0)                                            \
  |  |  ------------------
  |  |  |  Branch (34:13): [True: 0, False: 1.91k]
  |  |  ------------------
  |  |   35|  1.91k|            goto cleanup;                                       \
  |  |   36|  1.91k|        else                                                    \
  |  |   37|  1.91k|            err = MP_OKAY;                                      \
  |  |  ------------------
  |  |  |  |   39|  1.91k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |   38|  1.91k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (38:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  184|  1.91k|    *privKey = key;
  185|  1.91k|cleanup:
  186|  1.91k|    mp_clear(&g);
  187|  1.91k|    mp_clear(&xa);
  188|  1.91k|    mp_clear(&p);
  189|  1.91k|    mp_clear(&Ya);
  190|  1.91k|    if (err) {
  ------------------
  |  Branch (190:9): [True: 0, False: 1.91k]
  ------------------
  191|      0|        MP_TO_SEC_ERROR(err);
  ------------------
  |  |   41|      0|    switch (err) {                                    \
  |  |   42|      0|        case MP_MEM:                                  \
  |  |  ------------------
  |  |  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   43|      0|            PORT_SetError(SEC_ERROR_NO_MEMORY);       \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   44|      0|            break;                                    \
  |  |   45|      0|        case MP_RANGE:                                \
  |  |  ------------------
  |  |  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  |  |  ------------------
  |  |  |  Branch (45:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   46|      0|            PORT_SetError(SEC_ERROR_BAD_DATA);        \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   47|      0|            break;                                    \
  |  |   48|      0|        case MP_BADARG:                               \
  |  |  ------------------
  |  |  |  |   44|      0|#define MP_BADARG -4 /* invalid parameter     */
  |  |  ------------------
  |  |  |  Branch (48:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   50|      0|            break;                                    \
  |  |   51|      0|        default:                                      \
  |  |  ------------------
  |  |  |  Branch (51:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   52|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE); \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   53|      0|            break;                                    \
  |  |   54|      0|    }
  ------------------
  192|      0|        rv = SECFailure;
  193|      0|    }
  194|  1.91k|    if (rv) {
  ------------------
  |  Branch (194:9): [True: 0, False: 1.91k]
  ------------------
  195|      0|        *privKey = NULL;
  196|      0|        PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  197|      0|    }
  198|  1.91k|    return rv;
  199|  1.91k|}
DH_Derive:
  207|  3.02k|{
  208|  3.02k|    mp_int p, Xa, Yb, ZZ, psub1;
  209|  3.02k|    mp_err err = MP_OKAY;
  ------------------
  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  210|  3.02k|    unsigned int len = 0;
  211|  3.02k|    unsigned int nb;
  212|  3.02k|    unsigned char *secret = NULL;
  213|  3.02k|    if (!publicValue || !publicValue->len || !prime || !prime->len ||
  ------------------
  |  Branch (213:9): [True: 0, False: 3.02k]
  |  Branch (213:25): [True: 0, False: 3.02k]
  |  Branch (213:46): [True: 0, False: 3.02k]
  |  Branch (213:56): [True: 0, False: 3.02k]
  ------------------
  214|  3.02k|        !privateValue || !privateValue->len || !derivedSecret) {
  ------------------
  |  Branch (214:9): [True: 0, False: 3.02k]
  |  Branch (214:26): [True: 0, False: 3.02k]
  |  Branch (214:48): [True: 0, False: 3.02k]
  ------------------
  215|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  216|      0|        return SECFailure;
  217|      0|    }
  218|  3.02k|    memset(derivedSecret, 0, sizeof *derivedSecret);
  219|  3.02k|    MP_DIGITS(&p) = 0;
  ------------------
  |  |  152|  3.02k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  220|  3.02k|    MP_DIGITS(&Xa) = 0;
  ------------------
  |  |  152|  3.02k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  221|  3.02k|    MP_DIGITS(&Yb) = 0;
  ------------------
  |  |  152|  3.02k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  222|  3.02k|    MP_DIGITS(&ZZ) = 0;
  ------------------
  |  |  152|  3.02k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  223|  3.02k|    MP_DIGITS(&psub1) = 0;
  ------------------
  |  |  152|  3.02k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  224|  3.02k|    CHECK_MPI_OK(mp_init(&p));
  ------------------
  |  |   12|  3.02k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 3.02k]
  |  |  ------------------
  |  |   13|  3.02k|    goto cleanup
  ------------------
  225|  3.02k|    CHECK_MPI_OK(mp_init(&Xa));
  ------------------
  |  |   12|  3.02k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 3.02k]
  |  |  ------------------
  |  |   13|  3.02k|    goto cleanup
  ------------------
  226|  3.02k|    CHECK_MPI_OK(mp_init(&Yb));
  ------------------
  |  |   12|  3.02k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 3.02k]
  |  |  ------------------
  |  |   13|  3.02k|    goto cleanup
  ------------------
  227|  3.02k|    CHECK_MPI_OK(mp_init(&ZZ));
  ------------------
  |  |   12|  3.02k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 3.02k]
  |  |  ------------------
  |  |   13|  3.02k|    goto cleanup
  ------------------
  228|  3.02k|    CHECK_MPI_OK(mp_init(&psub1));
  ------------------
  |  |   12|  3.02k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 3.02k]
  |  |  ------------------
  |  |   13|  3.02k|    goto cleanup
  ------------------
  229|  3.02k|    SECITEM_TO_MPINT(*publicValue, &Yb);
  ------------------
  |  |   19|  3.02k|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|  3.02k|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 3.02k]
  |  |  |  |  ------------------
  |  |  |  |   13|  3.02k|    goto cleanup
  |  |  ------------------
  ------------------
  230|  3.02k|    SECITEM_TO_MPINT(*privateValue, &Xa);
  ------------------
  |  |   19|  3.02k|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|  3.02k|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 3.02k]
  |  |  |  |  ------------------
  |  |  |  |   13|  3.02k|    goto cleanup
  |  |  ------------------
  ------------------
  231|  3.02k|    SECITEM_TO_MPINT(*prime, &p);
  ------------------
  |  |   19|  3.02k|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|  3.02k|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 3.02k]
  |  |  |  |  ------------------
  |  |  |  |   13|  3.02k|    goto cleanup
  |  |  ------------------
  ------------------
  232|  3.02k|    CHECK_MPI_OK(mp_sub_d(&p, 1, &psub1));
  ------------------
  |  |   12|  3.02k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 3.02k]
  |  |  ------------------
  |  |   13|  3.02k|    goto cleanup
  ------------------
  233|       |
  234|       |    /* We assume that the modulus, p, is a safe prime. That is, p = 2q+1 where
  235|       |     * q is also a prime. Thus the orders of the subgroups are factors of 2q:
  236|       |     * namely 1, 2, q and 2q.
  237|       |     *
  238|       |     * We check that the peer's public value isn't zero (which isn't in the
  239|       |     * group), one (subgroup of order one) or p-1 (subgroup of order 2). We
  240|       |     * also check that the public value is less than p, to avoid being fooled
  241|       |     * by values like p+1 or 2*p-1.
  242|       |     *
  243|       |     * Thus we must be operating in the subgroup of size q or 2q. */
  244|  3.02k|    if (mp_cmp_d(&Yb, 1) <= 0 ||
  ------------------
  |  Branch (244:9): [True: 0, False: 3.02k]
  ------------------
  245|  3.02k|        mp_cmp(&Yb, &psub1) >= 0) {
  ------------------
  |  Branch (245:9): [True: 616, False: 2.41k]
  ------------------
  246|    616|        err = MP_BADARG;
  ------------------
  |  |   44|    616|#define MP_BADARG -4 /* invalid parameter     */
  ------------------
  247|    616|        goto cleanup;
  248|    616|    }
  249|       |
  250|       |    /* ZZ = (Yb)**Xa mod p */
  251|  2.41k|    CHECK_MPI_OK(mp_exptmod(&Yb, &Xa, &p, &ZZ));
  ------------------
  |  |   12|  2.41k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  2.41k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 2.41k]
  |  |  ------------------
  |  |   13|  2.41k|    goto cleanup
  ------------------
  252|       |    /* number of bytes in the derived secret */
  253|  2.41k|    len = mp_unsigned_octet_size(&ZZ);
  254|  2.41k|    if (len <= 0) {
  ------------------
  |  Branch (254:9): [True: 0, False: 2.41k]
  ------------------
  255|      0|        err = MP_BADARG;
  ------------------
  |  |   44|      0|#define MP_BADARG -4 /* invalid parameter     */
  ------------------
  256|      0|        goto cleanup;
  257|      0|    }
  258|       |
  259|       |    /*
  260|       |     * We check to make sure that ZZ is not equal to 0, 1 or -1 mod p.
  261|       |     * This helps guard against small subgroup attacks, since an attacker
  262|       |     * using a subgroup of size N will produce 0, 1 or -1 with probability 1/N.
  263|       |     * When the protocol is executed within a properly large subgroup, the
  264|       |     * probability of this result will be negligibly small.  For example,
  265|       |     * with a safe prime of the form 2q+1, the probability will be 1/q.
  266|       |     *
  267|       |     * We return MP_BADARG because this is probably the result of a bad
  268|       |     * public value or a bad prime having been provided.
  269|       |     */
  270|  2.41k|    if (mp_cmp_d(&ZZ, 0) == 0 || mp_cmp_d(&ZZ, 1) == 0 ||
  ------------------
  |  Branch (270:9): [True: 0, False: 2.41k]
  |  Branch (270:34): [True: 2, False: 2.40k]
  ------------------
  271|  2.41k|        mp_cmp(&ZZ, &psub1) == 0) {
  ------------------
  |  Branch (271:9): [True: 0, False: 2.40k]
  ------------------
  272|      2|        err = MP_BADARG;
  ------------------
  |  |   44|      2|#define MP_BADARG -4 /* invalid parameter     */
  ------------------
  273|      2|        goto cleanup;
  274|      2|    }
  275|       |
  276|       |    /* allocate a buffer which can hold the entire derived secret. */
  277|  2.40k|    secret = PORT_Alloc(len);
  ------------------
  |  |   52|  2.40k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  278|  2.40k|    if (secret == NULL) {
  ------------------
  |  Branch (278:9): [True: 0, False: 2.40k]
  ------------------
  279|      0|        err = MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  280|      0|        goto cleanup;
  281|      0|    }
  282|       |    /* grab the derived secret */
  283|  2.40k|    err = mp_to_unsigned_octets(&ZZ, secret, len);
  284|  2.40k|    if (err >= 0)
  ------------------
  |  Branch (284:9): [True: 2.40k, False: 0]
  ------------------
  285|  2.40k|        err = MP_OKAY;
  ------------------
  |  |   39|  2.40k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  286|       |    /*
  287|       |    ** if outBytes is 0 take all of the bytes from the derived secret.
  288|       |    ** if outBytes is not 0 take exactly outBytes from the derived secret, zero
  289|       |    ** pad at the beginning if necessary, and truncate beginning bytes
  290|       |    ** if necessary.
  291|       |    */
  292|  2.40k|    if (outBytes > 0)
  ------------------
  |  Branch (292:9): [True: 703, False: 1.70k]
  ------------------
  293|    703|        nb = outBytes;
  294|  1.70k|    else
  295|  1.70k|        nb = len;
  296|  2.40k|    if (SECITEM_AllocItem(NULL, derivedSecret, nb) == NULL) {
  ------------------
  |  |  103|  2.40k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  |  Branch (296:9): [True: 0, False: 2.40k]
  ------------------
  297|      0|        err = MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  298|      0|        goto cleanup;
  299|      0|    }
  300|  2.40k|    if (len < nb) {
  ------------------
  |  Branch (300:9): [True: 6, False: 2.40k]
  ------------------
  301|      6|        unsigned int offset = nb - len;
  302|      6|        memset(derivedSecret->data, 0, offset);
  303|      6|        memcpy(derivedSecret->data + offset, secret, len);
  304|  2.40k|    } else {
  305|  2.40k|        memcpy(derivedSecret->data, secret + len - nb, nb);
  306|  2.40k|    }
  307|  3.02k|cleanup:
  308|  3.02k|    mp_clear(&p);
  309|  3.02k|    mp_clear(&Xa);
  310|  3.02k|    mp_clear(&Yb);
  311|  3.02k|    mp_clear(&ZZ);
  312|  3.02k|    mp_clear(&psub1);
  313|  3.02k|    if (secret) {
  ------------------
  |  Branch (313:9): [True: 2.40k, False: 618]
  ------------------
  314|       |        /* free the buffer allocated for the full secret. */
  315|  2.40k|        PORT_ZFree(secret, len);
  ------------------
  |  |   75|  2.40k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  316|  2.40k|    }
  317|  3.02k|    if (err) {
  ------------------
  |  Branch (317:9): [True: 618, False: 2.40k]
  ------------------
  318|    618|        MP_TO_SEC_ERROR(err);
  ------------------
  |  |   41|    618|    switch (err) {                                    \
  |  |   42|      0|        case MP_MEM:                                  \
  |  |  ------------------
  |  |  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 0, False: 618]
  |  |  ------------------
  |  |   43|      0|            PORT_SetError(SEC_ERROR_NO_MEMORY);       \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   44|      0|            break;                                    \
  |  |   45|      0|        case MP_RANGE:                                \
  |  |  ------------------
  |  |  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  |  |  ------------------
  |  |  |  Branch (45:9): [True: 0, False: 618]
  |  |  ------------------
  |  |   46|      0|            PORT_SetError(SEC_ERROR_BAD_DATA);        \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   47|      0|            break;                                    \
  |  |   48|    618|        case MP_BADARG:                               \
  |  |  ------------------
  |  |  |  |   44|    618|#define MP_BADARG -4 /* invalid parameter     */
  |  |  ------------------
  |  |  |  Branch (48:9): [True: 618, False: 0]
  |  |  ------------------
  |  |   49|    618|            PORT_SetError(SEC_ERROR_INVALID_ARGS);    \
  |  |  ------------------
  |  |  |  |   65|    618|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   50|    618|            break;                                    \
  |  |   51|      0|        default:                                      \
  |  |  ------------------
  |  |  |  Branch (51:9): [True: 0, False: 618]
  |  |  ------------------
  |  |   52|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE); \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   53|      0|            break;                                    \
  |  |   54|    618|    }
  ------------------
  319|    618|        if (derivedSecret->data)
  ------------------
  |  Branch (319:13): [True: 0, False: 618]
  ------------------
  320|      0|            PORT_ZFree(derivedSecret->data, derivedSecret->len);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  321|    618|        return SECFailure;
  322|    618|    }
  323|  2.40k|    return SECSuccess;
  324|  3.02k|}
dh.c:dh_GetSecretKeyLen:
   27|  1.91k|{
   28|       |    /* Based on Table 2 in NIST SP 800-57. */
   29|  1.91k|    if (primeLen >= 1920) { /* 15360 bits */
  ------------------
  |  Branch (29:9): [True: 0, False: 1.91k]
  ------------------
   30|      0|        return 64;          /* 512 bits */
   31|      0|    }
   32|  1.91k|    if (primeLen >= 960) { /* 7680 bits */
  ------------------
  |  Branch (32:9): [True: 102, False: 1.80k]
  ------------------
   33|    102|        return 48;         /* 384 bits */
   34|    102|    }
   35|  1.80k|    if (primeLen >= 384) { /* 3072 bits */
  ------------------
  |  Branch (35:9): [True: 1.16k, False: 647]
  ------------------
   36|  1.16k|        return 32;         /* 256 bits */
   37|  1.16k|    }
   38|    647|    if (primeLen >= 256) { /* 2048 bits */
  ------------------
  |  Branch (38:9): [True: 647, False: 0]
  ------------------
   39|    647|        return 28;         /* 224 bits */
   40|    647|    }
   41|      0|    return 20; /* 160 bits */
   42|    647|}

DSA_VerifyDigest:
  558|    913|{
  559|       |    /* FIPS-compliance dictates that digest is a SHA hash. */
  560|    913|    mp_int p, q, g;      /* PQG parameters */
  561|    913|    mp_int r_, s_;       /* tuple (r', s') is received signature) */
  562|    913|    mp_int u1, u2, v, w; /* intermediate values used in verification */
  563|    913|    mp_int y;            /* public key */
  564|    913|    mp_err err;
  565|    913|    unsigned int dsa_subprime_len, dsa_signature_len, offset;
  566|    913|    SECItem localDigest;
  567|    913|    unsigned char localDigestData[DSA_MAX_SUBPRIME_LEN];
  568|    913|    SECStatus verified = SECFailure;
  569|       |
  570|       |    /* Check args. */
  571|    913|    if (!key || !signature || !digest) {
  ------------------
  |  Branch (571:9): [True: 0, False: 913]
  |  Branch (571:17): [True: 0, False: 913]
  |  Branch (571:31): [True: 0, False: 913]
  ------------------
  572|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  573|      0|        return SECFailure;
  574|      0|    }
  575|       |
  576|    913|    dsa_subprime_len = PQG_GetLength(&key->params.subPrime);
  577|    913|    dsa_signature_len = dsa_subprime_len * 2;
  578|    913|    if ((signature->len != dsa_signature_len) ||
  ------------------
  |  Branch (578:9): [True: 0, False: 913]
  ------------------
  579|    913|        (digest->len > HASH_LENGTH_MAX) ||
  ------------------
  |  |   48|    913|#define HASH_LENGTH_MAX SHA512_LENGTH
  |  |  ------------------
  |  |  |  |   43|    913|#define SHA512_LENGTH 64
  |  |  ------------------
  ------------------
  |  Branch (579:9): [True: 0, False: 913]
  ------------------
  580|    913|        (digest->len < SHA1_LENGTH)) {
  ------------------
  |  |   39|    913|#define SHA1_LENGTH 20
  ------------------
  |  Branch (580:9): [True: 0, False: 913]
  ------------------
  581|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  582|      0|        return SECFailure;
  583|      0|    }
  584|       |
  585|       |    /* DSA accepts digests not equal to dsa_subprime_len, if the
  586|       |     * digests are greater, than they are truncated to the size of
  587|       |     * dsa_subprime_len, using the left most bits. If they are less
  588|       |     * then they are padded on the left.*/
  589|    913|    PORT_Memset(localDigestData, 0, dsa_subprime_len);
  ------------------
  |  |  182|    913|#define PORT_Memset memset
  ------------------
  590|    913|    offset = (digest->len < dsa_subprime_len) ? (dsa_subprime_len - digest->len) : 0;
  ------------------
  |  Branch (590:14): [True: 224, False: 689]
  ------------------
  591|    913|    PORT_Memcpy(localDigestData + offset, digest->data,
  ------------------
  |  |  180|    913|#define PORT_Memcpy memcpy
  ------------------
  592|    913|                dsa_subprime_len - offset);
  593|    913|    localDigest.data = localDigestData;
  594|    913|    localDigest.len = dsa_subprime_len;
  595|       |
  596|       |    /* Initialize MPI integers. */
  597|    913|    MP_DIGITS(&p) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  598|    913|    MP_DIGITS(&q) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  599|    913|    MP_DIGITS(&g) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  600|    913|    MP_DIGITS(&y) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  601|    913|    MP_DIGITS(&r_) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  602|    913|    MP_DIGITS(&s_) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  603|    913|    MP_DIGITS(&u1) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  604|    913|    MP_DIGITS(&u2) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  605|    913|    MP_DIGITS(&v) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  606|    913|    MP_DIGITS(&w) = 0;
  ------------------
  |  |  152|    913|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  607|    913|    CHECK_MPI_OK(mp_init(&p));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  608|    913|    CHECK_MPI_OK(mp_init(&q));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  609|    913|    CHECK_MPI_OK(mp_init(&g));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  610|    913|    CHECK_MPI_OK(mp_init(&y));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  611|    913|    CHECK_MPI_OK(mp_init(&r_));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  612|    913|    CHECK_MPI_OK(mp_init(&s_));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  613|    913|    CHECK_MPI_OK(mp_init(&u1));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  614|    913|    CHECK_MPI_OK(mp_init(&u2));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  615|    913|    CHECK_MPI_OK(mp_init(&v));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  616|    913|    CHECK_MPI_OK(mp_init(&w));
  ------------------
  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  ------------------
  |  |   13|    913|    goto cleanup
  ------------------
  617|       |    /*
  618|       |    ** Convert stored PQG and public key into MPI integers.
  619|       |    */
  620|    913|    SECITEM_TO_MPINT(key->params.prime, &p);
  ------------------
  |  |   19|    913|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  |  |  ------------------
  |  |  |  |   13|    913|    goto cleanup
  |  |  ------------------
  ------------------
  621|    913|    SECITEM_TO_MPINT(key->params.subPrime, &q);
  ------------------
  |  |   19|    913|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  |  |  ------------------
  |  |  |  |   13|    913|    goto cleanup
  |  |  ------------------
  ------------------
  622|    913|    SECITEM_TO_MPINT(key->params.base, &g);
  ------------------
  |  |   19|    913|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  |  |  ------------------
  |  |  |  |   13|    913|    goto cleanup
  |  |  ------------------
  ------------------
  623|    913|    SECITEM_TO_MPINT(key->publicValue, &y);
  ------------------
  |  |   19|    913|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  |  |  ------------------
  |  |  |  |   13|    913|    goto cleanup
  |  |  ------------------
  ------------------
  624|       |    /*
  625|       |    ** Convert received signature (r', s') into MPI integers.
  626|       |    */
  627|    913|    OCTETS_TO_MPINT(signature->data, &r_, dsa_subprime_len);
  ------------------
  |  |   16|    913|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), oc, len))
  |  |  ------------------
  |  |  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  |  |  ------------------
  |  |  |  |   13|    913|    goto cleanup
  |  |  ------------------
  ------------------
  628|    913|    OCTETS_TO_MPINT(signature->data + dsa_subprime_len, &s_, dsa_subprime_len);
  ------------------
  |  |   16|    913|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), oc, len))
  |  |  ------------------
  |  |  |  |   12|    913|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|    913|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 913]
  |  |  |  |  ------------------
  |  |  |  |   13|    913|    goto cleanup
  |  |  ------------------
  ------------------
  629|       |    /*
  630|       |    ** Verify that 0 < r' < q and 0 < s' < q
  631|       |    */
  632|    913|    if (mp_cmp_z(&r_) <= 0 || mp_cmp_z(&s_) <= 0 ||
  ------------------
  |  Branch (632:9): [True: 0, False: 913]
  |  Branch (632:31): [True: 0, False: 913]
  ------------------
  633|    913|        mp_cmp(&r_, &q) >= 0 || mp_cmp(&s_, &q) >= 0) {
  ------------------
  |  Branch (633:9): [True: 1, False: 912]
  |  Branch (633:33): [True: 1, False: 911]
  ------------------
  634|       |        /* err is zero here. */
  635|      2|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
  636|      2|        goto cleanup; /* will return verified == SECFailure */
  637|      2|    }
  638|       |    /*
  639|       |    ** FIPS 186-1, Section 6, Step 1
  640|       |    **
  641|       |    ** w = (s')**-1 mod q
  642|       |    */
  643|    911|    CHECK_MPI_OK(mp_invmod(&s_, &q, &w)); /* w = (s')**-1 mod q */
  ------------------
  |  |   12|    911|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    911|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 51, False: 860]
  |  |  ------------------
  |  |   13|    911|    goto cleanup
  ------------------
  644|       |    /*
  645|       |    ** FIPS 186-1, Section 6, Step 2
  646|       |    **
  647|       |    ** u1 = ((Hash(M')) * w) mod q
  648|       |    */
  649|    860|    SECITEM_TO_MPINT(localDigest, &u1);        /* u1 = HASH(M')     */
  ------------------
  |  |   19|    860|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|    860|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|    860|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 860]
  |  |  |  |  ------------------
  |  |  |  |   13|    860|    goto cleanup
  |  |  ------------------
  ------------------
  650|    860|    CHECK_MPI_OK(mp_mulmod(&u1, &w, &q, &u1)); /* u1 = u1 * w mod q */
  ------------------
  |  |   12|    860|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    860|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 860]
  |  |  ------------------
  |  |   13|    860|    goto cleanup
  ------------------
  651|       |    /*
  652|       |    ** FIPS 186-1, Section 6, Step 3
  653|       |    **
  654|       |    ** u2 = ((r') * w) mod q
  655|       |    */
  656|    860|    CHECK_MPI_OK(mp_mulmod(&r_, &w, &q, &u2));
  ------------------
  |  |   12|    860|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    860|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 860]
  |  |  ------------------
  |  |   13|    860|    goto cleanup
  ------------------
  657|       |    /*
  658|       |    ** FIPS 186-1, Section 6, Step 4
  659|       |    **
  660|       |    ** v = ((g**u1 * y**u2) mod p) mod q
  661|       |    */
  662|    860|    CHECK_MPI_OK(mp_exptmod(&g, &u1, &p, &g)); /* g = g**u1 mod p */
  ------------------
  |  |   12|    860|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    860|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 860]
  |  |  ------------------
  |  |   13|    860|    goto cleanup
  ------------------
  663|    860|    CHECK_MPI_OK(mp_exptmod(&y, &u2, &p, &y)); /* y = y**u2 mod p */
  ------------------
  |  |   12|    860|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    860|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 860]
  |  |  ------------------
  |  |   13|    860|    goto cleanup
  ------------------
  664|    860|    CHECK_MPI_OK(mp_mulmod(&g, &y, &p, &v));   /* v = g * y mod p */
  ------------------
  |  |   12|    860|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    860|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 860]
  |  |  ------------------
  |  |   13|    860|    goto cleanup
  ------------------
  665|    860|    CHECK_MPI_OK(mp_mod(&v, &q, &v));          /* v = v mod q     */
  ------------------
  |  |   12|    860|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|    860|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 860]
  |  |  ------------------
  |  |   13|    860|    goto cleanup
  ------------------
  666|       |    /*
  667|       |    ** Verification:  v == r'
  668|       |    */
  669|    860|    if (mp_cmp(&v, &r_)) {
  ------------------
  |  Branch (669:9): [True: 860, False: 0]
  ------------------
  670|    860|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|    860|#define PORT_SetError PORT_SetError_Util
  ------------------
  671|    860|        verified = SECFailure; /* Signature failed to verify. */
  672|    860|    } else {
  673|      0|        verified = SECSuccess; /* Signature verified. */
  674|      0|    }
  675|    913|cleanup:
  676|    913|    PORT_SafeZero(localDigestData, sizeof localDigestData);
  677|    913|    mp_clear(&p);
  678|    913|    mp_clear(&q);
  679|    913|    mp_clear(&g);
  680|    913|    mp_clear(&y);
  681|    913|    mp_clear(&r_);
  682|    913|    mp_clear(&s_);
  683|    913|    mp_clear(&u1);
  684|    913|    mp_clear(&u2);
  685|    913|    mp_clear(&v);
  686|    913|    mp_clear(&w);
  687|    913|    if (err) {
  ------------------
  |  Branch (687:9): [True: 51, False: 862]
  ------------------
  688|     51|        translate_mpi_error(err);
  689|     51|    }
  690|    913|    return verified;
  691|    860|}
dsa.c:translate_mpi_error:
  149|     51|{
  150|     51|    MP_TO_SEC_ERROR(err);
  ------------------
  |  |   41|     51|    switch (err) {                                    \
  |  |   42|      0|        case MP_MEM:                                  \
  |  |  ------------------
  |  |  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 0, False: 51]
  |  |  ------------------
  |  |   43|      0|            PORT_SetError(SEC_ERROR_NO_MEMORY);       \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   44|      0|            break;                                    \
  |  |   45|      0|        case MP_RANGE:                                \
  |  |  ------------------
  |  |  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  |  |  ------------------
  |  |  |  Branch (45:9): [True: 0, False: 51]
  |  |  ------------------
  |  |   46|      0|            PORT_SetError(SEC_ERROR_BAD_DATA);        \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   47|      0|            break;                                    \
  |  |   48|      0|        case MP_BADARG:                               \
  |  |  ------------------
  |  |  |  |   44|      0|#define MP_BADARG -4 /* invalid parameter     */
  |  |  ------------------
  |  |  |  Branch (48:9): [True: 0, False: 51]
  |  |  ------------------
  |  |   49|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   50|      0|            break;                                    \
  |  |   51|     51|        default:                                      \
  |  |  ------------------
  |  |  |  Branch (51:9): [True: 51, False: 0]
  |  |  ------------------
  |  |   52|     51|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE); \
  |  |  ------------------
  |  |  |  |   65|     51|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   53|     51|            break;                                    \
  |  |   54|     51|    }
  ------------------
  151|     51|}

ec_NewKey:
  104|  7.90k|{
  105|  7.90k|    SECStatus rv = SECFailure;
  106|  7.90k|    PLArenaPool *arena;
  107|  7.90k|    ECPrivateKey *key;
  108|  7.90k|    int len;
  109|       |
  110|  7.90k|    if (!ecParams || ecParams->name == ECCurve_noName ||
  ------------------
  |  Branch (110:9): [True: 0, False: 7.90k]
  |  Branch (110:22): [True: 0, False: 7.90k]
  ------------------
  111|  7.90k|        !privKey || !privKeyBytes || privKeyLen <= 0) {
  ------------------
  |  Branch (111:9): [True: 0, False: 7.90k]
  |  Branch (111:21): [True: 0, False: 7.90k]
  |  Branch (111:38): [True: 0, False: 7.90k]
  ------------------
  112|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  113|      0|        return SECFailure;
  114|      0|    }
  115|       |
  116|  7.90k|    if (ecParams->fieldID.type != ec_field_plain) {
  ------------------
  |  Branch (116:9): [True: 0, False: 7.90k]
  ------------------
  117|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  118|      0|        return SECFailure;
  119|      0|    }
  120|       |
  121|       |    /* Initialize an arena for the EC key. */
  122|  7.90k|    if (!(arena = PORT_NewArena(NSS_FREEBL_DEFAULT_CHUNKSIZE)))
  ------------------
  |  |   63|  7.90k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  if (!(arena = PORT_NewArena(NSS_FREEBL_DEFAULT_CHUNKSIZE)))
  ------------------
  |  |  143|  7.90k|#define NSS_FREEBL_DEFAULT_CHUNKSIZE 2048
  ------------------
  |  Branch (122:9): [True: 0, False: 7.90k]
  ------------------
  123|      0|        return SECFailure;
  124|       |
  125|  7.90k|    key = (ECPrivateKey *)PORT_ArenaZAlloc(arena, sizeof(ECPrivateKey));
  ------------------
  |  |   59|  7.90k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  126|  7.90k|    if (!key) {
  ------------------
  |  Branch (126:9): [True: 0, False: 7.90k]
  ------------------
  127|      0|        goto cleanup;
  128|      0|    }
  129|       |
  130|       |    /* Set the version number (SEC 1 section C.4 says it should be 1) */
  131|  7.90k|    SECITEM_AllocItem(arena, &key->version, 1);
  ------------------
  |  |  103|  7.90k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  132|  7.90k|    key->version.data[0] = 1;
  133|       |
  134|       |    /* Copy all of the fields from the ECParams argument to the
  135|       |     * ECParams structure within the private key.
  136|       |     */
  137|  7.90k|    key->ecParams.arena = arena;
  138|  7.90k|    key->ecParams.type = ecParams->type;
  139|  7.90k|    key->ecParams.fieldID.size = ecParams->fieldID.size;
  140|  7.90k|    key->ecParams.fieldID.type = ecParams->fieldID.type;
  141|  7.90k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->ecParams.fieldID.u.prime,
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  142|  7.90k|                                  &ecParams->fieldID.u.prime));
  143|  7.90k|    key->ecParams.fieldID.k1 = ecParams->fieldID.k1;
  144|  7.90k|    key->ecParams.fieldID.k2 = ecParams->fieldID.k2;
  145|  7.90k|    key->ecParams.fieldID.k3 = ecParams->fieldID.k3;
  146|  7.90k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->ecParams.curve.a,
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  147|  7.90k|                                  &ecParams->curve.a));
  148|  7.90k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->ecParams.curve.b,
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  149|  7.90k|                                  &ecParams->curve.b));
  150|  7.90k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->ecParams.curve.seed,
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  151|  7.90k|                                  &ecParams->curve.seed));
  152|  7.90k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->ecParams.base,
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  153|  7.90k|                                  &ecParams->base));
  154|  7.90k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->ecParams.order,
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  155|  7.90k|                                  &ecParams->order));
  156|  7.90k|    key->ecParams.cofactor = ecParams->cofactor;
  157|  7.90k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->ecParams.DEREncoding,
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  158|  7.90k|                                  &ecParams->DEREncoding));
  159|  7.90k|    key->ecParams.name = ecParams->name;
  160|  7.90k|    CHECK_SEC_OK(SECITEM_CopyItem(arena, &key->ecParams.curveOID,
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  161|  7.90k|                                  &ecParams->curveOID));
  162|       |
  163|  7.90k|    SECITEM_AllocItem(arena, &key->publicValue, EC_GetPointSize(ecParams));
  ------------------
  |  |  103|  7.90k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  164|  7.90k|    len = ecParams->order.len;
  165|  7.90k|    SECITEM_AllocItem(arena, &key->privateValue, len);
  ------------------
  |  |  103|  7.90k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  166|       |
  167|       |    /* Copy private key */
  168|  7.90k|    if (privKeyLen >= len) {
  ------------------
  |  Branch (168:9): [True: 7.90k, False: 0]
  ------------------
  169|  7.90k|        memcpy(key->privateValue.data, privKeyBytes, len);
  170|  7.90k|    } else {
  171|      0|        memset(key->privateValue.data, 0, (len - privKeyLen));
  172|      0|        memcpy(key->privateValue.data + (len - privKeyLen), privKeyBytes, privKeyLen);
  173|      0|    }
  174|       |
  175|       |    /* Compute corresponding public key */
  176|       |
  177|       |    /* Use curve specific code for point multiplication */
  178|  7.90k|    if (ecParams->name == ECCurve_Ed25519) {
  ------------------
  |  Branch (178:9): [True: 0, False: 7.90k]
  ------------------
  179|      0|        CHECK_SEC_OK(ED_DerivePublicKey(&key->privateValue, &key->publicValue));
  ------------------
  |  |    8|      0|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 0]
  |  |  ------------------
  |  |    9|      0|    goto cleanup
  ------------------
  180|  7.90k|    } else {
  181|  7.90k|        const ECMethod *method = ec_get_method_from_name(ecParams->name);
  182|  7.90k|        if (method == NULL || method->pt_mul == NULL) {
  ------------------
  |  Branch (182:13): [True: 0, False: 7.90k]
  |  Branch (182:31): [True: 0, False: 7.90k]
  ------------------
  183|      0|            PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  184|      0|            rv = SECFailure;
  185|      0|            goto cleanup;
  186|      0|        }
  187|  7.90k|        CHECK_SEC_OK(method->pt_mul(&key->publicValue, &key->privateValue, NULL));
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  188|  7.90k|    }
  189|       |
  190|  7.90k|    NSS_DECLASSIFY(key->publicValue.data, key->publicValue.len); /* Declassifying public key to avoid false positive */
  191|  7.90k|    *privKey = key;
  192|  7.90k|    return SECSuccess;
  193|       |
  194|      0|cleanup:
  195|      0|    PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                  PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  196|      0|    return rv;
  197|  7.90k|}
ec_GenerateRandomPrivateKey:
  218|  7.90k|{
  219|  7.90k|    SECStatus rv = SECFailure;
  220|       |
  221|  7.90k|    unsigned int len = EC_GetScalarSize(ecParams);
  222|       |
  223|  7.90k|    if (privKey->len != len || privKey->data == NULL) {
  ------------------
  |  Branch (223:9): [True: 0, False: 7.90k]
  |  Branch (223:32): [True: 0, False: 7.90k]
  ------------------
  224|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  225|      0|        return SECFailure;
  226|      0|    }
  227|       |
  228|  7.90k|    const ECMethod *method = ec_get_method_from_name(ecParams->name);
  229|  7.90k|    if (method == NULL || method->scalar_validate == NULL) {
  ------------------
  |  Branch (229:9): [True: 0, False: 7.90k]
  |  Branch (229:27): [True: 0, False: 7.90k]
  ------------------
  230|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  231|      0|        return SECFailure;
  232|      0|    }
  233|       |
  234|  7.90k|    uint8_t leading_coeff_mask;
  235|  7.90k|    switch (ecParams->name) {
  236|      0|        case ECCurve_Ed25519:
  ------------------
  |  Branch (236:9): [True: 0, False: 7.90k]
  ------------------
  237|  7.55k|        case ECCurve25519:
  ------------------
  |  Branch (237:9): [True: 7.55k, False: 346]
  ------------------
  238|  7.72k|        case ECCurve_NIST_P256:
  ------------------
  |  Branch (238:9): [True: 169, False: 7.73k]
  ------------------
  239|  7.86k|        case ECCurve_NIST_P384:
  ------------------
  |  Branch (239:9): [True: 145, False: 7.75k]
  ------------------
  240|  7.86k|            leading_coeff_mask = 0xff;
  241|  7.86k|            break;
  242|     32|        case ECCurve_NIST_P521:
  ------------------
  |  Branch (242:9): [True: 32, False: 7.86k]
  ------------------
  243|     32|            leading_coeff_mask = 0x01;
  244|     32|            break;
  245|      0|        default:
  ------------------
  |  Branch (245:9): [True: 0, False: 7.90k]
  ------------------
  246|      0|            PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  247|      0|            return SECFailure;
  248|  7.90k|    }
  249|       |
  250|       |    /* The rejection sampling method from FIPS 186-5 A.4.2 */
  251|  7.90k|    int count = 100;
  252|  7.90k|    do {
  253|  7.90k|        rv = RNG_GenerateGlobalRandomBytes(privKey->data, len);
  254|  7.90k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (254:13): [True: 0, False: 7.90k]
  ------------------
  255|      0|            PORT_SetError(SEC_ERROR_NEED_RANDOM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  256|      0|            return SECFailure;
  257|      0|        }
  258|  7.90k|        privKey->data[0] &= leading_coeff_mask;
  259|  7.90k|        NSS_CLASSIFY(privKey->data, privKey->len);
  260|  7.90k|        rv = method->scalar_validate(privKey);
  261|  7.90k|    } while (rv != SECSuccess && --count > 0);
  ------------------
  |  Branch (261:14): [True: 0, False: 7.90k]
  |  Branch (261:34): [True: 0, False: 0]
  ------------------
  262|       |
  263|  7.90k|    if (rv != SECSuccess) { // implies count == 0
  ------------------
  |  Branch (263:9): [True: 0, False: 7.90k]
  ------------------
  264|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  265|      0|    }
  266|       |
  267|  7.90k|    return rv;
  268|  7.90k|}
EC_NewKey:
  276|  7.90k|{
  277|  7.90k|    SECStatus rv = SECFailure;
  278|  7.90k|    SECItem privKeyRand = { siBuffer, NULL, 0 };
  279|       |
  280|  7.90k|    if (!ecParams || ecParams->name == ECCurve_noName || !privKey) {
  ------------------
  |  Branch (280:9): [True: 0, False: 7.90k]
  |  Branch (280:22): [True: 0, False: 7.90k]
  |  Branch (280:58): [True: 0, False: 7.90k]
  ------------------
  281|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  282|      0|        return SECFailure;
  283|      0|    }
  284|       |
  285|  7.90k|    SECITEM_AllocItem(NULL, &privKeyRand, EC_GetScalarSize(ecParams));
  ------------------
  |  |  103|  7.90k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  286|  7.90k|    if (privKeyRand.data == NULL) {
  ------------------
  |  Branch (286:9): [True: 0, False: 7.90k]
  ------------------
  287|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  288|      0|        rv = SECFailure;
  289|      0|        goto cleanup;
  290|      0|    }
  291|  7.90k|    rv = ec_GenerateRandomPrivateKey(ecParams, &privKeyRand);
  292|  7.90k|    if (rv != SECSuccess || privKeyRand.data == NULL) {
  ------------------
  |  Branch (292:9): [True: 0, False: 7.90k]
  |  Branch (292:29): [True: 0, False: 7.90k]
  ------------------
  293|      0|        goto cleanup;
  294|      0|    }
  295|       |    /* generate public key */
  296|  7.90k|    CHECK_SEC_OK(ec_NewKey(ecParams, privKey, privKeyRand.data, privKeyRand.len));
  ------------------
  |  |    8|  7.90k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (8:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |    9|  7.90k|    goto cleanup
  ------------------
  297|       |
  298|  7.90k|cleanup:
  299|  7.90k|    if (privKeyRand.data) {
  ------------------
  |  Branch (299:9): [True: 7.90k, False: 0]
  ------------------
  300|  7.90k|        SECITEM_ZfreeItem(&privKeyRand, PR_FALSE);
  ------------------
  |  |  110|  7.90k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                      SECITEM_ZfreeItem(&privKeyRand, PR_FALSE);
  ------------------
  |  |  438|  7.90k|#define PR_FALSE 0
  ------------------
  301|  7.90k|    }
  302|       |#if EC_DEBUG
  303|       |    printf("EC_NewKey returning %s\n",
  304|       |           (rv == SECSuccess) ? "success" : "failure");
  305|       |#endif
  306|       |
  307|  7.90k|    return rv;
  308|  7.90k|}
EC_ValidatePublicKey:
  318|  8.63k|{
  319|  8.63k|    if (!ecParams || ecParams->name == ECCurve_noName ||
  ------------------
  |  Branch (319:9): [True: 0, False: 8.63k]
  |  Branch (319:22): [True: 0, False: 8.63k]
  ------------------
  320|  8.63k|        !publicValue || !publicValue->len) {
  ------------------
  |  Branch (320:9): [True: 0, False: 8.63k]
  |  Branch (320:25): [True: 0, False: 8.63k]
  ------------------
  321|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  322|      0|        return SECFailure;
  323|      0|    }
  324|       |
  325|       |    /* Uses curve specific code for point validation. */
  326|  8.63k|    if (ecParams->fieldID.type != ec_field_plain) {
  ------------------
  |  Branch (326:9): [True: 0, False: 8.63k]
  ------------------
  327|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  328|      0|        return SECFailure;
  329|      0|    }
  330|       |
  331|  8.63k|    const ECMethod *method = ec_get_method_from_name(ecParams->name);
  332|  8.63k|    if (method == NULL || method->pt_validate == NULL) {
  ------------------
  |  Branch (332:9): [True: 0, False: 8.63k]
  |  Branch (332:27): [True: 0, False: 8.63k]
  ------------------
  333|       |        /* unknown curve */
  334|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  335|      0|        return SECFailure;
  336|      0|    }
  337|       |
  338|  8.63k|    SECStatus rv = method->pt_validate(publicValue);
  339|  8.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (339:9): [True: 235, False: 8.40k]
  ------------------
  340|    235|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|    235|#define PORT_SetError PORT_SetError_Util
  ------------------
  341|    235|    }
  342|  8.63k|    return rv;
  343|  8.63k|}
ECDH_Derive:
  361|    542|{
  362|    542|    if (!publicValue || !publicValue->len ||
  ------------------
  |  Branch (362:9): [True: 0, False: 542]
  |  Branch (362:25): [True: 0, False: 542]
  ------------------
  363|    542|        !ecParams || ecParams->name == ECCurve_noName ||
  ------------------
  |  Branch (363:9): [True: 0, False: 542]
  |  Branch (363:22): [True: 0, False: 542]
  ------------------
  364|    542|        !privateValue || !privateValue->len || !derivedSecret) {
  ------------------
  |  Branch (364:9): [True: 0, False: 542]
  |  Branch (364:26): [True: 0, False: 542]
  |  Branch (364:48): [True: 0, False: 542]
  ------------------
  365|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  366|      0|        return SECFailure;
  367|      0|    }
  368|       |
  369|       |    /*
  370|       |     * Make sure the point is on the requested curve to avoid
  371|       |     * certain small subgroup attacks.
  372|       |     */
  373|    542|    if (EC_ValidatePublicKey(ecParams, publicValue) != SECSuccess) {
  ------------------
  |  Branch (373:9): [True: 131, False: 411]
  ------------------
  374|    131|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|    131|#define PORT_SetError PORT_SetError_Util
  ------------------
  375|    131|        return SECFailure;
  376|    131|    }
  377|       |
  378|       |    /* Perform curve specific multiplication using ECMethod */
  379|    411|    if (ecParams->fieldID.type != ec_field_plain) {
  ------------------
  |  Branch (379:9): [True: 0, False: 411]
  ------------------
  380|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  381|      0|        return SECFailure;
  382|      0|    }
  383|       |
  384|    411|    const ECMethod *method = ec_get_method_from_name(ecParams->name);
  385|    411|    if (method == NULL || method->pt_validate == NULL ||
  ------------------
  |  Branch (385:9): [True: 0, False: 411]
  |  Branch (385:27): [True: 0, False: 411]
  ------------------
  386|    411|        method->pt_mul == NULL) {
  ------------------
  |  Branch (386:9): [True: 0, False: 411]
  ------------------
  387|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  388|      0|        return SECFailure;
  389|      0|    }
  390|       |
  391|    411|    memset(derivedSecret, 0, sizeof(*derivedSecret));
  392|    411|    derivedSecret = SECITEM_AllocItem(NULL, derivedSecret, EC_GetScalarSize(ecParams));
  ------------------
  |  |  103|    411|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  393|    411|    if (derivedSecret == NULL) {
  ------------------
  |  Branch (393:9): [True: 0, False: 411]
  ------------------
  394|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  395|      0|        return SECFailure;
  396|      0|    }
  397|       |
  398|    411|    SECStatus rv = method->pt_mul(derivedSecret, privateValue, publicValue);
  399|    411|    if (rv != SECSuccess) {
  ------------------
  |  Branch (399:9): [True: 1, False: 410]
  ------------------
  400|      1|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
  401|      1|        SECITEM_ZfreeItem(derivedSecret, PR_FALSE);
  ------------------
  |  |  110|      1|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                      SECITEM_ZfreeItem(derivedSecret, PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  402|      1|    }
  403|    411|    return rv;
  404|    411|}
ECDSA_VerifyDigest:
  540|     79|{
  541|     79|    SECStatus rv = SECFailure;
  542|     79|    ECParams *ecParams = NULL;
  543|       |
  544|       |    /* Check args */
  545|     79|    if (!key || !signature || !digest) {
  ------------------
  |  Branch (545:9): [True: 0, False: 79]
  |  Branch (545:17): [True: 0, False: 79]
  |  Branch (545:31): [True: 0, False: 79]
  ------------------
  546|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  547|      0|        return SECFailure;
  548|      0|    }
  549|       |
  550|     79|    ecParams = &(key->ecParams);
  551|       |
  552|       |    /* Perform curve specific signature verification using ECMethod */
  553|     79|    if (ecParams->fieldID.type != ec_field_plain) {
  ------------------
  |  Branch (553:9): [True: 0, False: 79]
  ------------------
  554|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  555|      0|        return SECFailure;
  556|      0|    }
  557|       |
  558|     79|    const ECMethod *method = ec_get_method_from_name(ecParams->name);
  559|     79|    if (method == NULL || method->verify_digest == NULL) {
  ------------------
  |  Branch (559:9): [True: 0, False: 79]
  |  Branch (559:27): [True: 0, False: 79]
  ------------------
  560|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  561|      0|        return SECFailure;
  562|      0|    }
  563|       |
  564|     79|    rv = method->verify_digest(key, signature, digest);
  565|     79|    if (rv != SECSuccess) {
  ------------------
  |  Branch (565:9): [True: 79, False: 0]
  ------------------
  566|     79|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|     79|#define PORT_SetError PORT_SetError_Util
  ------------------
  567|     79|    }
  568|       |
  569|       |#if EC_DEBUG
  570|       |    printf("ECDSA verification %s\n",
  571|       |           (rv == SECSuccess) ? "succeeded" : "failed");
  572|       |#endif
  573|       |
  574|     79|    return rv;
  575|     79|}
ec.c:ec_get_method_from_name:
   87|  24.9k|{
   88|  24.9k|    unsigned long i;
   89|  27.8k|    for (i = 0; i < sizeof(kMethods) / sizeof(kMethods[0]); ++i) {
  ------------------
  |  Branch (89:17): [True: 27.8k, False: 0]
  ------------------
   90|  27.8k|        if (kMethods[i].name == name) {
  ------------------
  |  Branch (90:13): [True: 24.9k, False: 2.90k]
  ------------------
   91|  24.9k|            return &kMethods[i];
   92|  24.9k|        }
   93|  27.8k|    }
   94|      0|    return NULL;
   95|  24.9k|}

EC_FillParams:
  100|  24.0k|{
  101|  24.0k|    SECStatus rv = SECFailure;
  102|  24.0k|    SECOidTag tag;
  103|  24.0k|    SECItem oid = { siBuffer, NULL, 0 };
  104|       |
  105|       |#if EC_DEBUG
  106|       |    int i;
  107|       |
  108|       |    printf("Encoded params in EC_DecodeParams: ");
  109|       |    for (i = 0; i < encodedParams->len; i++) {
  110|       |        printf("%02x:", encodedParams->data[i]);
  111|       |    }
  112|       |    printf("\n");
  113|       |#endif
  114|       |
  115|  24.0k|    if ((encodedParams->len != ANSI_X962_CURVE_OID_TOTAL_LEN) &&
  ------------------
  |  |   10|  24.0k|#define ANSI_X962_CURVE_OID_TOTAL_LEN 10
  ------------------
  |  Branch (115:9): [True: 23.3k, False: 758]
  ------------------
  116|  24.0k|        (encodedParams->len != SECG_CURVE_OID_TOTAL_LEN) &&
  ------------------
  |  |   11|  23.3k|#define SECG_CURVE_OID_TOTAL_LEN 7
  ------------------
  |  Branch (116:9): [True: 22.6k, False: 666]
  ------------------
  117|  24.0k|        (encodedParams->len != PKIX_NEWCURVES_OID_TOTAL_LEN) &&
  ------------------
  |  |   12|  22.6k|#define PKIX_NEWCURVES_OID_TOTAL_LEN 11
  ------------------
  |  Branch (117:9): [True: 0, False: 22.6k]
  ------------------
  118|  24.0k|        (encodedParams->len != ED25519_OID_TOTAL_LEN)) {
  ------------------
  |  |   13|      0|#define ED25519_OID_TOTAL_LEN 5
  ------------------
  |  Branch (118:9): [True: 0, False: 0]
  ------------------
  119|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  120|      0|        return SECFailure;
  121|  24.0k|    };
  122|       |
  123|  24.0k|    oid.len = encodedParams->len - 2;
  124|  24.0k|    oid.data = encodedParams->data + 2;
  125|  24.0k|    if ((encodedParams->data[0] != SEC_ASN1_OBJECT_ID) ||
  ------------------
  |  |   82|  24.0k|#define SEC_ASN1_OBJECT_ID 0x06
  ------------------
  |  Branch (125:9): [True: 0, False: 24.0k]
  ------------------
  126|  24.0k|        ((tag = SECOID_FindOIDTag(&oid)) == SEC_OID_UNKNOWN)) {
  ------------------
  |  |  117|  24.0k|#define SECOID_FindOIDTag SECOID_FindOIDTag_Util
  ------------------
  |  Branch (126:9): [True: 0, False: 24.0k]
  ------------------
  127|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  128|      0|        return SECFailure;
  129|      0|    }
  130|       |
  131|  24.0k|    params->arena = arena;
  132|  24.0k|    params->cofactor = 0;
  133|  24.0k|    params->type = ec_params_named;
  134|  24.0k|    params->name = ECCurve_noName;
  135|       |
  136|       |    /* Fill out curveOID */
  137|  24.0k|    params->curveOID.len = oid.len;
  138|  24.0k|    params->curveOID.data = (unsigned char *)PORT_ArenaAlloc(arena, oid.len);
  ------------------
  |  |   53|  24.0k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  139|  24.0k|    if (params->curveOID.data == NULL)
  ------------------
  |  Branch (139:9): [True: 0, False: 24.0k]
  ------------------
  140|      0|        goto cleanup;
  141|  24.0k|    memcpy(params->curveOID.data, oid.data, oid.len);
  142|       |
  143|       |#if EC_DEBUG
  144|       |    printf("Curve: %s\n", SECOID_FindOIDTagDescription(tag));
  145|       |#endif
  146|       |
  147|  24.0k|    switch (tag) {
  148|    676|        case SEC_OID_ANSIX962_EC_PRIME256V1:
  ------------------
  |  Branch (148:9): [True: 676, False: 23.4k]
  ------------------
  149|       |            /* Populate params for prime256v1 aka secp256r1
  150|       |             * (the NIST P-256 curve)
  151|       |             */
  152|    676|            CHECK_SEC_OK(gf_populate_params_bytes(ECCurve_X9_62_PRIME_256V1,
  ------------------
  |  |   20|    676|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 676]
  |  |  ------------------
  |  |   21|    676|    goto cleanup
  ------------------
  153|    676|                                                  ec_field_plain, params));
  154|    676|            break;
  155|       |
  156|    676|        case SEC_OID_SECG_EC_SECP384R1:
  ------------------
  |  Branch (156:9): [True: 466, False: 23.6k]
  ------------------
  157|       |            /* Populate params for secp384r1
  158|       |             * (the NIST P-384 curve)
  159|       |             */
  160|    466|            CHECK_SEC_OK(gf_populate_params_bytes(ECCurve_SECG_PRIME_384R1,
  ------------------
  |  |   20|    466|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 466]
  |  |  ------------------
  |  |   21|    466|    goto cleanup
  ------------------
  161|    466|                                                  ec_field_plain, params));
  162|    466|            break;
  163|       |
  164|    466|        case SEC_OID_SECG_EC_SECP521R1:
  ------------------
  |  Branch (164:9): [True: 110, False: 23.9k]
  ------------------
  165|       |            /* Populate params for secp521r1
  166|       |             * (the NIST P-521 curve)
  167|       |             */
  168|    110|            CHECK_SEC_OK(gf_populate_params_bytes(ECCurve_SECG_PRIME_521R1,
  ------------------
  |  |   20|    110|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 110]
  |  |  ------------------
  |  |   21|    110|    goto cleanup
  ------------------
  169|    110|                                                  ec_field_plain, params));
  170|    110|            break;
  171|       |
  172|    110|        case SEC_OID_ED25519_PUBLIC_KEY:
  ------------------
  |  Branch (172:9): [True: 0, False: 24.0k]
  ------------------
  173|      0|            params->type = ec_params_edwards_named;
  174|      0|            CHECK_SEC_OK(gf_populate_params_bytes(ECCurve_Ed25519,
  ------------------
  |  |   20|      0|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   21|      0|    goto cleanup
  ------------------
  175|      0|                                                  ec_field_plain, params));
  176|       |
  177|      0|            break;
  178|       |
  179|      0|        case SEC_OID_X25519:
  ------------------
  |  Branch (179:9): [True: 0, False: 24.0k]
  ------------------
  180|  22.6k|        case SEC_OID_CURVE25519:
  ------------------
  |  Branch (180:9): [True: 22.6k, False: 1.42k]
  ------------------
  181|       |            /* Populate params for Curve25519 */
  182|  22.6k|            params->type = ec_params_montgomery_named;
  183|  22.6k|            CHECK_SEC_OK(gf_populate_params_bytes(ECCurve25519,
  ------------------
  |  |   20|  22.6k|    if (SECSuccess != (rv = func)) \
  |  |  ------------------
  |  |  |  Branch (20:9): [True: 0, False: 22.6k]
  |  |  ------------------
  |  |   21|  22.6k|    goto cleanup
  ------------------
  184|  22.6k|                                                  ec_field_plain,
  185|  22.6k|                                                  params));
  186|  22.6k|            break;
  187|       |
  188|  22.6k|        default:
  ------------------
  |  Branch (188:9): [True: 172, False: 23.9k]
  ------------------
  189|    172|            break;
  190|  24.0k|    };
  191|       |
  192|  24.0k|cleanup:
  193|  24.0k|    if (!params->cofactor) {
  ------------------
  |  Branch (193:9): [True: 172, False: 23.9k]
  ------------------
  194|    172|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|    172|#define PORT_SetError PORT_SetError_Util
  ------------------
  195|       |#if EC_DEBUG
  196|       |        printf("Unrecognized curve, returning NULL params\n");
  197|       |#endif
  198|    172|    }
  199|       |
  200|  24.0k|    return rv;
  201|  24.0k|}
EC_DecodeParams:
  205|  7.96k|{
  206|  7.96k|    PLArenaPool *arena;
  207|  7.96k|    ECParams *params;
  208|  7.96k|    SECStatus rv = SECFailure;
  209|       |
  210|       |    /* Initialize an arena for the ECParams structure */
  211|  7.96k|    if (!(arena = PORT_NewArena(NSS_FREEBL_DEFAULT_CHUNKSIZE)))
  ------------------
  |  |   63|  7.96k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  if (!(arena = PORT_NewArena(NSS_FREEBL_DEFAULT_CHUNKSIZE)))
  ------------------
  |  |  143|  7.96k|#define NSS_FREEBL_DEFAULT_CHUNKSIZE 2048
  ------------------
  |  Branch (211:9): [True: 0, False: 7.96k]
  ------------------
  212|      0|        return SECFailure;
  213|       |
  214|  7.96k|    params = (ECParams *)PORT_ArenaZAlloc(arena, sizeof(ECParams));
  ------------------
  |  |   59|  7.96k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  215|  7.96k|    if (!params) {
  ------------------
  |  Branch (215:9): [True: 0, False: 7.96k]
  ------------------
  216|      0|        PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  217|      0|        return SECFailure;
  218|      0|    }
  219|       |
  220|       |    /* Copy the encoded params */
  221|  7.96k|    SECITEM_AllocItem(arena, &(params->DEREncoding),
  ------------------
  |  |  103|  7.96k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  222|  7.96k|                      encodedParams->len);
  223|  7.96k|    memcpy(params->DEREncoding.data, encodedParams->data, encodedParams->len);
  224|       |
  225|       |    /* Fill out the rest of the ECParams structure based on
  226|       |     * the encoded params
  227|       |     */
  228|  7.96k|    rv = EC_FillParams(arena, encodedParams, params);
  229|  7.96k|    if (rv == SECFailure) {
  ------------------
  |  Branch (229:9): [True: 64, False: 7.90k]
  ------------------
  230|     64|        PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |   61|     64|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |  437|     64|#define PR_TRUE 1
  ------------------
  231|     64|        return SECFailure;
  232|  7.90k|    } else {
  233|  7.90k|        *ecparams = params;
  234|  7.90k|        ;
  235|  7.90k|        return SECSuccess;
  236|  7.90k|    }
  237|  7.96k|}
EC_GetPointSize:
  241|  16.5k|{
  242|  16.5k|    ECCurveName name = params->name;
  243|  16.5k|    const ECCurveBytes *curveParams;
  244|       |
  245|  16.5k|    if ((name < ECCurve_noName) || (name > ECCurve_pastLastCurve) ||
  ------------------
  |  Branch (245:9): [True: 0, False: 16.5k]
  |  Branch (245:36): [True: 0, False: 16.5k]
  ------------------
  246|  16.5k|        ((curveParams = ecCurve_map[name]) == NULL)) {
  ------------------
  |  Branch (246:9): [True: 0, False: 16.5k]
  ------------------
  247|       |        /* unknown curve, calculate point size from params. assume standard curves with 2 points
  248|       |         * and a point compression indicator byte */
  249|      0|        int sizeInBytes = (params->fieldID.size + 7) / 8;
  250|      0|        return sizeInBytes * 2 + 1;
  251|      0|    }
  252|       |
  253|  16.5k|    if (params->type == ec_params_edwards_named || params->type == ec_params_montgomery_named) {
  ------------------
  |  Branch (253:9): [True: 0, False: 16.5k]
  |  Branch (253:52): [True: 15.3k, False: 1.27k]
  ------------------
  254|  15.3k|        return curveParams->scalarSize;
  255|  15.3k|    }
  256|       |
  257|  1.27k|    return curveParams->pointSize - 1;
  258|  16.5k|}
EC_GetScalarSize:
  262|  16.2k|{
  263|  16.2k|    ECCurveName name = params->name;
  264|  16.2k|    const ECCurveBytes *curveParams;
  265|       |
  266|  16.2k|    if ((name < ECCurve_noName) || (name > ECCurve_pastLastCurve) ||
  ------------------
  |  Branch (266:9): [True: 0, False: 16.2k]
  |  Branch (266:36): [True: 0, False: 16.2k]
  ------------------
  267|  16.2k|        ((curveParams = ecCurve_map[name]) == NULL)) {
  ------------------
  |  Branch (267:9): [True: 0, False: 16.2k]
  ------------------
  268|       |        /* unknown curve, calculate scalar size from field size in params */
  269|      0|        int sizeInBytes = (params->fieldID.size + 7) / 8;
  270|      0|        return sizeInBytes;
  271|      0|    }
  272|  16.2k|    return curveParams->scalarSize;
  273|  16.2k|}
ecdecode.c:gf_populate_params_bytes:
   65|  23.9k|{
   66|  23.9k|    SECStatus rv = SECFailure;
   67|  23.9k|    const ECCurveBytes *curveParams;
   68|       |
   69|  23.9k|    if ((name < ECCurve_noName) || (name > ECCurve_pastLastCurve))
  ------------------
  |  Branch (69:9): [True: 0, False: 23.9k]
  |  Branch (69:36): [True: 0, False: 23.9k]
  ------------------
   70|      0|        goto cleanup;
   71|  23.9k|    params->name = name;
   72|  23.9k|    curveParams = ecCurve_map[params->name];
   73|  23.9k|    CHECK_OK(curveParams);
  ------------------
  |  |   17|  23.9k|    if (func == NULL)  \
  |  |  ------------------
  |  |  |  Branch (17:9): [True: 0, False: 23.9k]
  |  |  ------------------
  |  |   18|  23.9k|    goto cleanup
  ------------------
   74|  23.9k|    params->fieldID.size = curveParams->size;
   75|  23.9k|    params->fieldID.type = field_type;
   76|  23.9k|    if (field_type != ec_field_plain) {
  ------------------
  |  Branch (76:9): [True: 0, False: 23.9k]
  ------------------
   77|      0|        return SECFailure;
   78|      0|    }
   79|  23.9k|    params->fieldID.u.prime.len = curveParams->scalarSize;
   80|  23.9k|    params->fieldID.u.prime.data = (unsigned char *)curveParams->irr;
   81|  23.9k|    params->curve.a.len = curveParams->scalarSize;
   82|  23.9k|    params->curve.a.data = (unsigned char *)curveParams->curvea;
   83|  23.9k|    params->curve.b.len = curveParams->scalarSize;
   84|  23.9k|    params->curve.b.data = (unsigned char *)curveParams->curveb;
   85|  23.9k|    params->base.len = curveParams->pointSize;
   86|  23.9k|    params->base.data = (unsigned char *)curveParams->base;
   87|  23.9k|    params->order.len = curveParams->scalarSize;
   88|  23.9k|    params->order.data = (unsigned char *)curveParams->order;
   89|  23.9k|    params->cofactor = curveParams->cofactor;
   90|       |
   91|  23.9k|    rv = SECSuccess;
   92|       |
   93|  23.9k|cleanup:
   94|  23.9k|    return rv;
   95|  23.9k|}

ec_Curve25519_mul:
   15|  7.73k|{
   16|       |// Note: this cast is safe because HaCl* state has a post-condition that only "mypublic" changed.
   17|       |#if defined HACL_CAN_COMPILE_INLINE_ASM
   18|       |    Hacl_Curve25519_64_ecdh(mypublic, (uint8_t *)secret, (uint8_t *)basepoint);
   19|       |#else
   20|  7.73k|    Hacl_Curve25519_51_ecdh(mypublic, (uint8_t *)secret, (uint8_t *)basepoint);
   21|  7.73k|#endif
   22|       |
   23|  7.73k|    return 0;
   24|  7.73k|}

ec_Curve25519_pt_validate:
   24|  7.73k|{
   25|  7.73k|    PRUint8 *p;
   26|  7.73k|    PRUint64 i;
   27|  7.73k|    PRUint8 forbiddenValues[12][32] = {
   28|  7.73k|        { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   29|  7.73k|          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   30|  7.73k|          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   31|  7.73k|          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
   32|  7.73k|        { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   33|  7.73k|          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   34|  7.73k|          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   35|  7.73k|          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
   36|  7.73k|        { 0xe0, 0xeb, 0x7a, 0x7c, 0x3b, 0x41, 0xb8, 0xae,
   37|  7.73k|          0x16, 0x56, 0xe3, 0xfa, 0xf1, 0x9f, 0xc4, 0x6a,
   38|  7.73k|          0xda, 0x09, 0x8d, 0xeb, 0x9c, 0x32, 0xb1, 0xfd,
   39|  7.73k|          0x86, 0x62, 0x05, 0x16, 0x5f, 0x49, 0xb8, 0x00 },
   40|  7.73k|        { 0x5f, 0x9c, 0x95, 0xbc, 0xa3, 0x50, 0x8c, 0x24,
   41|  7.73k|          0xb1, 0xd0, 0xb1, 0x55, 0x9c, 0x83, 0xef, 0x5b,
   42|  7.73k|          0x04, 0x44, 0x5c, 0xc4, 0x58, 0x1c, 0x8e, 0x86,
   43|  7.73k|          0xd8, 0x22, 0x4e, 0xdd, 0xd0, 0x9f, 0x11, 0x57 },
   44|  7.73k|        { 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   45|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   46|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   47|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
   48|  7.73k|        { 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   49|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   50|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   51|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
   52|  7.73k|        { 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   53|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   54|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   55|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f },
   56|  7.73k|        { 0xcd, 0xeb, 0x7a, 0x7c, 0x3b, 0x41, 0xb8, 0xae,
   57|  7.73k|          0x16, 0x56, 0xe3, 0xfa, 0xf1, 0x9f, 0xc4, 0x6a,
   58|  7.73k|          0xda, 0x09, 0x8d, 0xeb, 0x9c, 0x32, 0xb1, 0xfd,
   59|  7.73k|          0x86, 0x62, 0x05, 0x16, 0x5f, 0x49, 0xb8, 0x80 },
   60|  7.73k|        { 0x4c, 0x9c, 0x95, 0xbc, 0xa3, 0x50, 0x8c, 0x24,
   61|  7.73k|          0xb1, 0xd0, 0xb1, 0x55, 0x9c, 0x83, 0xef, 0x5b,
   62|  7.73k|          0x04, 0x44, 0x5c, 0xc4, 0x58, 0x1c, 0x8e, 0x86,
   63|  7.73k|          0xd8, 0x22, 0x4e, 0xdd, 0xd0, 0x9f, 0x11, 0xd7 },
   64|  7.73k|        { 0xd9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   65|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   66|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   67|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
   68|  7.73k|        { 0xda, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   69|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   70|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   71|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
   72|  7.73k|        { 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   73|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   74|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
   75|  7.73k|          0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff },
   76|  7.73k|    };
   77|       |
   78|  7.73k|    if (px->len == 32) {
  ------------------
  |  Branch (78:9): [True: 7.73k, False: 1]
  ------------------
   79|  7.73k|        p = px->data;
   80|  7.73k|    } else {
   81|      1|        return SECFailure;
   82|      1|    }
   83|       |
   84|   100k|    for (i = 0; i < PR_ARRAY_SIZE(forbiddenValues); ++i) {
  ------------------
  |  |  167|   100k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (84:17): [True: 92.7k, False: 7.73k]
  ------------------
   85|  92.7k|        if (NSS_SecureMemcmp(p, forbiddenValues[i], px->len) == 0) {
  ------------------
  |  Branch (85:13): [True: 3, False: 92.7k]
  ------------------
   86|      3|            return SECFailure;
   87|      3|        }
   88|  92.7k|    }
   89|       |
   90|  7.73k|    return SECSuccess;
   91|  7.73k|}
ec_Curve25519_scalar_validate:
   98|  7.55k|{
   99|  7.55k|    if (!scalar || !scalar->data) {
  ------------------
  |  Branch (99:9): [True: 0, False: 7.55k]
  |  Branch (99:20): [True: 0, False: 7.55k]
  ------------------
  100|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  101|      0|        return SECFailure;
  102|      0|    }
  103|       |
  104|  7.55k|    if (scalar->len != 32) {
  ------------------
  |  Branch (104:9): [True: 0, False: 7.55k]
  ------------------
  105|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  106|      0|        return SECFailure;
  107|      0|    }
  108|  7.55k|    return SECSuccess;
  109|  7.55k|}
ec_Curve25519_pt_mul:
  118|  7.73k|{
  119|  7.73k|    PRUint8 *px;
  120|  7.73k|    PRUint8 basePoint[32] = { 9 };
  121|       |
  122|  7.73k|    if (!P) {
  ------------------
  |  Branch (122:9): [True: 7.55k, False: 176]
  ------------------
  123|  7.55k|        px = basePoint;
  124|  7.55k|    } else {
  125|    176|        PORT_Assert(P->len == 32);
  ------------------
  |  |  120|    176|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    176|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 176, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  126|    176|        if (P->len != 32) {
  ------------------
  |  Branch (126:13): [True: 0, False: 176]
  ------------------
  127|      0|            return SECFailure;
  128|      0|        }
  129|    176|        px = P->data;
  130|    176|    }
  131|  7.73k|    if (k->len != 32) {
  ------------------
  |  Branch (131:9): [True: 0, False: 7.73k]
  ------------------
  132|      0|        return SECFailure;
  133|      0|    }
  134|       |
  135|  7.73k|    SECStatus rv = ec_Curve25519_mul(X->data, k->data, px);
  136|  7.73k|    if (NSS_SecureMemcmpZero(X->data, X->len) == 0) {
  ------------------
  |  Branch (136:9): [True: 1, False: 7.73k]
  ------------------
  137|      1|        return SECFailure;
  138|      1|    }
  139|  7.73k|    return rv;
  140|  7.73k|}

ec_secp256r1_pt_validate:
   19|    517|{
   20|    517|    SECStatus res = SECSuccess;
   21|    517|    if (!pt || !pt->data) {
  ------------------
  |  Branch (21:9): [True: 0, False: 517]
  |  Branch (21:16): [True: 0, False: 517]
  ------------------
   22|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   23|      0|        res = SECFailure;
   24|      0|        return res;
   25|      0|    }
   26|       |
   27|    517|    if (pt->len != 65) {
  ------------------
  |  Branch (27:9): [True: 12, False: 505]
  ------------------
   28|     12|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|     12|#define PORT_SetError PORT_SetError_Util
  ------------------
   29|     12|        res = SECFailure;
   30|     12|        return res;
   31|     12|    }
   32|       |
   33|    505|    if (pt->data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|    505|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (33:9): [True: 14, False: 491]
  ------------------
   34|     14|        PORT_SetError(SEC_ERROR_UNSUPPORTED_EC_POINT_FORM);
  ------------------
  |  |   65|     14|#define PORT_SetError PORT_SetError_Util
  ------------------
   35|     14|        res = SECFailure;
   36|     14|        return res;
   37|     14|    }
   38|       |
   39|    491|    bool b = Hacl_P256_validate_public_key(pt->data + 1);
   40|       |
   41|    491|    if (!b) {
  ------------------
  |  Branch (41:9): [True: 127, False: 364]
  ------------------
   42|    127|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|    127|#define PORT_SetError PORT_SetError_Util
  ------------------
   43|    127|        res = SECFailure;
   44|    127|    }
   45|    491|    return res;
   46|    505|}
ec_secp256r1_scalar_validate:
   54|    169|{
   55|    169|    SECStatus res = SECSuccess;
   56|    169|    if (!scalar || !scalar->data) {
  ------------------
  |  Branch (56:9): [True: 0, False: 169]
  |  Branch (56:20): [True: 0, False: 169]
  ------------------
   57|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   58|      0|        res = SECFailure;
   59|      0|        return res;
   60|      0|    }
   61|       |
   62|    169|    if (scalar->len != 32) {
  ------------------
  |  Branch (62:9): [True: 0, False: 169]
  ------------------
   63|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   64|      0|        res = SECFailure;
   65|      0|        return res;
   66|      0|    }
   67|       |
   68|    169|    bool b = Hacl_P256_validate_private_key(scalar->data);
   69|       |
   70|    169|    if (!b) {
  ------------------
  |  Branch (70:9): [True: 0, False: 169]
  ------------------
   71|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   72|      0|        res = SECFailure;
   73|      0|    }
   74|    169|    return res;
   75|    169|}
ec_secp256r1_pt_mul:
   85|    288|{
   86|    288|    SECStatus res = SECSuccess;
   87|    288|    if (!P) {
  ------------------
  |  Branch (87:9): [True: 169, False: 119]
  ------------------
   88|    169|        uint8_t derived[64] = { 0 };
   89|       |
   90|    169|        if (!X || !k || !X->data || !k->data ||
  ------------------
  |  Branch (90:13): [True: 0, False: 169]
  |  Branch (90:19): [True: 0, False: 169]
  |  Branch (90:25): [True: 0, False: 169]
  |  Branch (90:37): [True: 0, False: 169]
  ------------------
   91|    169|            X->len < 65 || k->len != 32) {
  ------------------
  |  Branch (91:13): [True: 0, False: 169]
  |  Branch (91:28): [True: 0, False: 169]
  ------------------
   92|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   93|      0|            res = SECFailure;
   94|      0|            return res;
   95|      0|        }
   96|       |
   97|    169|        bool b = Hacl_P256_dh_initiator(derived, k->data);
   98|       |
   99|    169|        if (!b) {
  ------------------
  |  Branch (99:13): [True: 0, False: 169]
  ------------------
  100|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  101|      0|            res = SECFailure;
  102|      0|            return res;
  103|      0|        }
  104|       |
  105|    169|        X->len = 65;
  106|    169|        X->data[0] = EC_POINT_FORM_UNCOMPRESSED;
  ------------------
  |  |   92|    169|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  107|    169|        memcpy(X->data + 1, derived, 64);
  108|       |
  109|    169|    } else {
  110|    119|        uint8_t full_key[32] = { 0 };
  111|    119|        uint8_t *key;
  112|    119|        uint8_t derived[64] = { 0 };
  113|       |
  114|    119|        if (!X || !k || !P || !X->data || !k->data || !P->data ||
  ------------------
  |  Branch (114:13): [True: 0, False: 119]
  |  Branch (114:19): [True: 0, False: 119]
  |  Branch (114:25): [True: 0, False: 119]
  |  Branch (114:31): [True: 0, False: 119]
  |  Branch (114:43): [True: 0, False: 119]
  |  Branch (114:55): [True: 0, False: 119]
  ------------------
  115|    119|            X->len < 32 || P->len != 65 ||
  ------------------
  |  Branch (115:13): [True: 0, False: 119]
  |  Branch (115:28): [True: 0, False: 119]
  ------------------
  116|    119|            P->data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|    119|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (116:13): [True: 0, False: 119]
  ------------------
  117|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  118|      0|            res = SECFailure;
  119|      0|            return res;
  120|      0|        }
  121|       |
  122|       |        /* We consider keys of up to size 32, or of size 33 with a single leading 0 */
  123|    119|        if (k->len < 32) {
  ------------------
  |  Branch (123:13): [True: 0, False: 119]
  ------------------
  124|      0|            memcpy(full_key + 32 - k->len, k->data, k->len);
  125|      0|            key = full_key;
  126|    119|        } else if (k->len == 32) {
  ------------------
  |  Branch (126:20): [True: 119, False: 0]
  ------------------
  127|    119|            key = k->data;
  128|    119|        } else if (k->len == 33 && k->data[0] == 0) {
  ------------------
  |  Branch (128:20): [True: 0, False: 0]
  |  Branch (128:36): [True: 0, False: 0]
  ------------------
  129|      0|            key = k->data + 1;
  130|      0|        } else {
  131|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  132|      0|            res = SECFailure;
  133|      0|            return res;
  134|      0|        }
  135|       |
  136|    119|        bool b = Hacl_P256_dh_responder(derived, P->data + 1, key);
  137|       |
  138|    119|        if (!b) {
  ------------------
  |  Branch (138:13): [True: 0, False: 119]
  ------------------
  139|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  140|      0|            res = SECFailure;
  141|      0|            return res;
  142|      0|        }
  143|       |
  144|    119|        X->len = 32;
  145|    119|        memcpy(X->data, derived, 32);
  146|    119|    }
  147|       |
  148|    288|    return res;
  149|    288|}
ec_secp256r1_verify_digest:
  228|     68|{
  229|     68|    SECStatus res = SECSuccess;
  230|       |
  231|     68|    unsigned char _padded_sig_data[64] = { 0 };
  232|     68|    unsigned char *sig_r, *sig_s;
  233|       |
  234|     68|    if (!key || !signature || !digest ||
  ------------------
  |  Branch (234:9): [True: 0, False: 68]
  |  Branch (234:17): [True: 0, False: 68]
  |  Branch (234:31): [True: 0, False: 68]
  ------------------
  235|     68|        !key->publicValue.data ||
  ------------------
  |  Branch (235:9): [True: 0, False: 68]
  ------------------
  236|     68|        !signature->data || !digest->data ||
  ------------------
  |  Branch (236:9): [True: 0, False: 68]
  |  Branch (236:29): [True: 0, False: 68]
  ------------------
  237|     68|        key->ecParams.name != ECCurve_NIST_P256) {
  ------------------
  |  Branch (237:9): [True: 0, False: 68]
  ------------------
  238|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  239|      0|        res = SECFailure;
  240|      0|        return res;
  241|      0|    }
  242|       |
  243|     68|    unsigned int olen = key->ecParams.order.len;
  244|     68|    if (signature->len == 0 || signature->len % 2 != 0 ||
  ------------------
  |  Branch (244:9): [True: 0, False: 68]
  |  Branch (244:32): [True: 0, False: 68]
  ------------------
  245|     68|        signature->len > 2 * olen ||
  ------------------
  |  Branch (245:9): [True: 0, False: 68]
  ------------------
  246|     68|        digest->len == 0 || key->publicValue.len != 65) {
  ------------------
  |  Branch (246:9): [True: 0, False: 68]
  |  Branch (246:29): [True: 0, False: 68]
  ------------------
  247|      0|        PORT_SetError(SEC_ERROR_INPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  248|      0|        res = SECFailure;
  249|      0|        return res;
  250|      0|    }
  251|       |
  252|     68|    if (key->publicValue.data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|     68|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (252:9): [True: 0, False: 68]
  ------------------
  253|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_EC_POINT_FORM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  254|      0|        res = SECFailure;
  255|      0|        return res;
  256|      0|    }
  257|       |
  258|       |    /* P-256 signature has to be 64 bytes long, pad it with 0s if it isn't */
  259|     68|    if (signature->len != 64) {
  ------------------
  |  Branch (259:9): [True: 0, False: 68]
  ------------------
  260|      0|        unsigned split = signature->len / 2;
  261|      0|        unsigned pad = 32 - split;
  262|       |
  263|      0|        unsigned char *o_sig = signature->data;
  264|      0|        unsigned char *p_sig = _padded_sig_data;
  265|       |
  266|      0|        memcpy(p_sig + pad, o_sig, split);
  267|      0|        memcpy(p_sig + 32 + pad, o_sig + split, split);
  268|       |
  269|      0|        sig_r = p_sig;
  270|      0|        sig_s = p_sig + 32;
  271|     68|    } else {
  272|     68|        sig_r = signature->data;
  273|     68|        sig_s = signature->data + 32;
  274|     68|    }
  275|       |
  276|     68|    uint8_t hash[32] = { 0 };
  277|     68|    if (digest->len < 32) {
  ------------------
  |  Branch (277:9): [True: 26, False: 42]
  ------------------
  278|     26|        memcpy(hash + 32 - digest->len, digest->data, digest->len);
  279|     42|    } else {
  280|     42|        memcpy(hash, digest->data, 32);
  281|     42|    }
  282|       |
  283|     68|    bool b = Hacl_P256_ecdsa_verif_without_hash(
  284|     68|        32, hash,
  285|     68|        key->publicValue.data + 1,
  286|     68|        sig_r, sig_s);
  287|     68|    if (!b) {
  ------------------
  |  Branch (287:9): [True: 68, False: 0]
  ------------------
  288|     68|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|     68|#define PORT_SetError PORT_SetError_Util
  ------------------
  289|     68|        res = SECFailure;
  290|     68|        return res;
  291|     68|    }
  292|       |
  293|      0|    return res;
  294|     68|}

ec_secp384r1_pt_validate:
   21|    332|{
   22|    332|    SECStatus res = SECSuccess;
   23|    332|    if (!pt || !pt->data) {
  ------------------
  |  Branch (23:9): [True: 0, False: 332]
  |  Branch (23:16): [True: 0, False: 332]
  ------------------
   24|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   25|      0|        res = SECFailure;
   26|      0|        return res;
   27|      0|    }
   28|       |
   29|    332|    if (pt->len != 97) {
  ------------------
  |  Branch (29:9): [True: 3, False: 329]
  ------------------
   30|      3|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      3|#define PORT_SetError PORT_SetError_Util
  ------------------
   31|      3|        res = SECFailure;
   32|      3|        return res;
   33|      3|    }
   34|       |
   35|    329|    if (pt->data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|    329|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (35:9): [True: 4, False: 325]
  ------------------
   36|      4|        PORT_SetError(SEC_ERROR_UNSUPPORTED_EC_POINT_FORM);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
   37|      4|        res = SECFailure;
   38|      4|        return res;
   39|      4|    }
   40|       |
   41|    325|    bool b = Hacl_P384_validate_public_key(pt->data + 1);
   42|       |
   43|    325|    if (!b) {
  ------------------
  |  Branch (43:9): [True: 57, False: 268]
  ------------------
   44|     57|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|     57|#define PORT_SetError PORT_SetError_Util
  ------------------
   45|     57|        res = SECFailure;
   46|     57|    }
   47|    325|    return res;
   48|    329|}
ec_secp384r1_scalar_validate:
   56|    145|{
   57|    145|    SECStatus res = SECSuccess;
   58|    145|    if (!scalar || !scalar->data) {
  ------------------
  |  Branch (58:9): [True: 0, False: 145]
  |  Branch (58:20): [True: 0, False: 145]
  ------------------
   59|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   60|      0|        res = SECFailure;
   61|      0|        return res;
   62|      0|    }
   63|       |
   64|    145|    if (scalar->len != 48) {
  ------------------
  |  Branch (64:9): [True: 0, False: 145]
  ------------------
   65|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   66|      0|        res = SECFailure;
   67|      0|        return res;
   68|      0|    }
   69|       |
   70|    145|    bool b = Hacl_P384_validate_private_key(scalar->data);
   71|       |
   72|    145|    if (!b) {
  ------------------
  |  Branch (72:9): [True: 0, False: 145]
  ------------------
   73|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   74|      0|        res = SECFailure;
   75|      0|    }
   76|    145|    return res;
   77|    145|}
ec_secp384r1_pt_mul:
   87|    259|{
   88|    259|    SECStatus res = SECSuccess;
   89|    259|    if (!P) {
  ------------------
  |  Branch (89:9): [True: 145, False: 114]
  ------------------
   90|    145|        uint8_t derived[96] = { 0 };
   91|       |
   92|    145|        if (!X || !k || !X->data || !k->data ||
  ------------------
  |  Branch (92:13): [True: 0, False: 145]
  |  Branch (92:19): [True: 0, False: 145]
  |  Branch (92:25): [True: 0, False: 145]
  |  Branch (92:37): [True: 0, False: 145]
  ------------------
   93|    145|            X->len < 97 || k->len != 48) {
  ------------------
  |  Branch (93:13): [True: 0, False: 145]
  |  Branch (93:28): [True: 0, False: 145]
  ------------------
   94|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   95|      0|            res = SECFailure;
   96|      0|            return res;
   97|      0|        }
   98|       |
   99|    145|        bool b = Hacl_P384_dh_initiator(derived, k->data);
  100|       |
  101|    145|        if (!b) {
  ------------------
  |  Branch (101:13): [True: 0, False: 145]
  ------------------
  102|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  103|      0|            res = SECFailure;
  104|      0|            return res;
  105|      0|        }
  106|       |
  107|    145|        X->len = 97;
  108|    145|        X->data[0] = EC_POINT_FORM_UNCOMPRESSED;
  ------------------
  |  |   92|    145|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  109|    145|        memcpy(X->data + 1, derived, 96);
  110|       |
  111|    145|    } else {
  112|    114|        uint8_t full_key[48] = { 0 };
  113|    114|        uint8_t *key;
  114|    114|        uint8_t derived[96] = { 0 };
  115|       |
  116|    114|        if (!X || !k || !P || !X->data || !k->data || !P->data ||
  ------------------
  |  Branch (116:13): [True: 0, False: 114]
  |  Branch (116:19): [True: 0, False: 114]
  |  Branch (116:25): [True: 0, False: 114]
  |  Branch (116:31): [True: 0, False: 114]
  |  Branch (116:43): [True: 0, False: 114]
  |  Branch (116:55): [True: 0, False: 114]
  ------------------
  117|    114|            X->len < 48 || P->len != 97 ||
  ------------------
  |  Branch (117:13): [True: 0, False: 114]
  |  Branch (117:28): [True: 0, False: 114]
  ------------------
  118|    114|            P->data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|    114|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (118:13): [True: 0, False: 114]
  ------------------
  119|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  120|      0|            res = SECFailure;
  121|      0|            return res;
  122|      0|        }
  123|       |
  124|       |        /* We consider keys of up to size 48, or of size 49 with a single leading 0 */
  125|    114|        if (k->len < 48) {
  ------------------
  |  Branch (125:13): [True: 0, False: 114]
  ------------------
  126|      0|            memcpy(full_key + 48 - k->len, k->data, k->len);
  127|      0|            key = full_key;
  128|    114|        } else if (k->len == 48) {
  ------------------
  |  Branch (128:20): [True: 114, False: 0]
  ------------------
  129|    114|            key = k->data;
  130|    114|        } else if (k->len == 49 && k->data[0] == 0) {
  ------------------
  |  Branch (130:20): [True: 0, False: 0]
  |  Branch (130:36): [True: 0, False: 0]
  ------------------
  131|      0|            key = k->data + 1;
  132|      0|        } else {
  133|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  134|      0|            res = SECFailure;
  135|      0|            return res;
  136|      0|        }
  137|       |
  138|    114|        bool b = Hacl_P384_dh_responder(derived, P->data + 1, key);
  139|       |
  140|    114|        if (!b) {
  ------------------
  |  Branch (140:13): [True: 0, False: 114]
  ------------------
  141|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  142|      0|            res = SECFailure;
  143|      0|            return res;
  144|      0|        }
  145|       |
  146|    114|        X->len = 48;
  147|    114|        memcpy(X->data, derived, 48);
  148|    114|    }
  149|       |
  150|    259|    return res;
  151|    259|}
ec_secp384r1_verify_digest:
  230|      7|{
  231|      7|    SECStatus res = SECSuccess;
  232|       |
  233|      7|    if (!key || !signature || !digest ||
  ------------------
  |  Branch (233:9): [True: 0, False: 7]
  |  Branch (233:17): [True: 0, False: 7]
  |  Branch (233:31): [True: 0, False: 7]
  ------------------
  234|      7|        !key->publicValue.data ||
  ------------------
  |  Branch (234:9): [True: 0, False: 7]
  ------------------
  235|      7|        !signature->data || !digest->data ||
  ------------------
  |  Branch (235:9): [True: 0, False: 7]
  |  Branch (235:29): [True: 0, False: 7]
  ------------------
  236|      7|        key->ecParams.name != ECCurve_NIST_P384) {
  ------------------
  |  Branch (236:9): [True: 0, False: 7]
  ------------------
  237|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  238|      0|        res = SECFailure;
  239|      0|        return res;
  240|      0|    }
  241|       |
  242|      7|    if (signature->len == 0 || signature->len % 2 != 0 ||
  ------------------
  |  Branch (242:9): [True: 0, False: 7]
  |  Branch (242:32): [True: 0, False: 7]
  ------------------
  243|      7|        signature->len > 96 || digest->len == 0 ||
  ------------------
  |  Branch (243:9): [True: 0, False: 7]
  |  Branch (243:32): [True: 0, False: 7]
  ------------------
  244|      7|        key->publicValue.len != 97) {
  ------------------
  |  Branch (244:9): [True: 0, False: 7]
  ------------------
  245|      0|        PORT_SetError(SEC_ERROR_INPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  246|      0|        res = SECFailure;
  247|      0|        return res;
  248|      0|    }
  249|       |
  250|      7|    if (key->publicValue.data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|      7|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (250:9): [True: 0, False: 7]
  ------------------
  251|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_EC_POINT_FORM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  252|      0|        res = SECFailure;
  253|      0|        return res;
  254|      0|    }
  255|       |
  256|       |    // Signatures should be 96 bytes, but some software produces short signatures.
  257|       |    // Pad components with zeros if necessary.
  258|      7|    uint8_t paddedSigData[96] = { 0 };
  259|      7|    uint8_t *sig;
  260|      7|    if (signature->len != 96) {
  ------------------
  |  Branch (260:9): [True: 0, False: 7]
  ------------------
  261|      0|        size_t split = signature->len / 2;
  262|       |
  263|      0|        memcpy(paddedSigData + 48 - split, signature->data, split);
  264|      0|        memcpy(paddedSigData + 96 - split, signature->data + split, split);
  265|       |
  266|      0|        sig = paddedSigData;
  267|      7|    } else {
  268|      7|        sig = signature->data;
  269|      7|    }
  270|       |
  271|      7|    uint8_t hash[48] = { 0 };
  272|      7|    if (digest->len < 48) {
  ------------------
  |  Branch (272:9): [True: 6, False: 1]
  ------------------
  273|      6|        memcpy(hash + 48 - digest->len, digest->data, digest->len);
  274|      6|    } else {
  275|      1|        memcpy(hash, digest->data, 48);
  276|      1|    }
  277|       |
  278|      7|    bool b = Hacl_P384_ecdsa_verif_without_hash(
  279|      7|        48, hash, key->publicValue.data + 1, sig, sig + 48);
  280|      7|    if (!b) {
  ------------------
  |  Branch (280:9): [True: 7, False: 0]
  ------------------
  281|      7|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      7|#define PORT_SetError PORT_SetError_Util
  ------------------
  282|      7|        res = SECFailure;
  283|      7|        return res;
  284|      7|    }
  285|       |
  286|      0|    return res;
  287|      7|}

ec_secp521r1_pt_validate:
   21|     54|{
   22|     54|    SECStatus res = SECSuccess;
   23|     54|    if (!pt || !pt->data) {
  ------------------
  |  Branch (23:9): [True: 0, False: 54]
  |  Branch (23:16): [True: 0, False: 54]
  ------------------
   24|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   25|      0|        res = SECFailure;
   26|      0|        return res;
   27|      0|    }
   28|       |
   29|     54|    if (pt->len != 133) {
  ------------------
  |  Branch (29:9): [True: 4, False: 50]
  ------------------
   30|      4|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
   31|      4|        res = SECFailure;
   32|      4|        return res;
   33|      4|    }
   34|       |
   35|     50|    if (pt->data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|     50|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (35:9): [True: 2, False: 48]
  ------------------
   36|      2|        PORT_SetError(SEC_ERROR_UNSUPPORTED_EC_POINT_FORM);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
   37|      2|        res = SECFailure;
   38|      2|        return res;
   39|      2|    }
   40|       |
   41|     48|    bool b = Hacl_P521_validate_public_key(pt->data + 1);
   42|       |
   43|     48|    if (!b) {
  ------------------
  |  Branch (43:9): [True: 8, False: 40]
  ------------------
   44|      8|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      8|#define PORT_SetError PORT_SetError_Util
  ------------------
   45|      8|        res = SECFailure;
   46|      8|    }
   47|     48|    return res;
   48|     50|}
ec_secp521r1_scalar_validate:
   56|     32|{
   57|     32|    SECStatus res = SECSuccess;
   58|     32|    if (!scalar || !scalar->data) {
  ------------------
  |  Branch (58:9): [True: 0, False: 32]
  |  Branch (58:20): [True: 0, False: 32]
  ------------------
   59|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   60|      0|        res = SECFailure;
   61|      0|        return res;
   62|      0|    }
   63|       |
   64|     32|    if (scalar->len != 66) {
  ------------------
  |  Branch (64:9): [True: 0, False: 32]
  ------------------
   65|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   66|      0|        res = SECFailure;
   67|      0|        return res;
   68|      0|    }
   69|       |
   70|     32|    bool b = Hacl_P521_validate_private_key(scalar->data);
   71|       |
   72|     32|    if (!b) {
  ------------------
  |  Branch (72:9): [True: 0, False: 32]
  ------------------
   73|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   74|      0|        res = SECFailure;
   75|      0|    }
   76|     32|    return res;
   77|     32|}
ec_secp521r1_pt_mul:
   87|     34|{
   88|     34|    SECStatus res = SECSuccess;
   89|     34|    if (!P) {
  ------------------
  |  Branch (89:9): [True: 32, False: 2]
  ------------------
   90|     32|        uint8_t derived[132] = { 0 };
   91|       |
   92|     32|        if (!X || !k || !X->data || !k->data ||
  ------------------
  |  Branch (92:13): [True: 0, False: 32]
  |  Branch (92:19): [True: 0, False: 32]
  |  Branch (92:25): [True: 0, False: 32]
  |  Branch (92:37): [True: 0, False: 32]
  ------------------
   93|     32|            X->len < 133 || k->len != 66) {
  ------------------
  |  Branch (93:13): [True: 0, False: 32]
  |  Branch (93:29): [True: 0, False: 32]
  ------------------
   94|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   95|      0|            res = SECFailure;
   96|      0|            return res;
   97|      0|        }
   98|       |
   99|     32|        bool b = Hacl_P521_dh_initiator(derived, k->data);
  100|       |
  101|     32|        if (!b) {
  ------------------
  |  Branch (101:13): [True: 0, False: 32]
  ------------------
  102|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  103|      0|            res = SECFailure;
  104|      0|            return res;
  105|      0|        }
  106|       |
  107|     32|        X->len = 133;
  108|     32|        X->data[0] = EC_POINT_FORM_UNCOMPRESSED;
  ------------------
  |  |   92|     32|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  109|     32|        memcpy(X->data + 1, derived, 132);
  110|       |
  111|     32|    } else {
  112|      2|        uint8_t full_key[66] = { 0 };
  113|      2|        uint8_t *key;
  114|      2|        uint8_t derived[132] = { 0 };
  115|       |
  116|      2|        if (!X || !k || !P || !X->data || !k->data || !P->data ||
  ------------------
  |  Branch (116:13): [True: 0, False: 2]
  |  Branch (116:19): [True: 0, False: 2]
  |  Branch (116:25): [True: 0, False: 2]
  |  Branch (116:31): [True: 0, False: 2]
  |  Branch (116:43): [True: 0, False: 2]
  |  Branch (116:55): [True: 0, False: 2]
  ------------------
  117|      2|            X->len < 66 || P->len != 133 ||
  ------------------
  |  Branch (117:13): [True: 0, False: 2]
  |  Branch (117:28): [True: 0, False: 2]
  ------------------
  118|      2|            P->data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|      2|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (118:13): [True: 0, False: 2]
  ------------------
  119|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  120|      0|            res = SECFailure;
  121|      0|            return res;
  122|      0|        }
  123|       |
  124|       |        /* We consider keys of up to size 66, or of size 67 with a single leading 0 */
  125|      2|        if (k->len < 66) {
  ------------------
  |  Branch (125:13): [True: 0, False: 2]
  ------------------
  126|      0|            memcpy(full_key + 66 - k->len, k->data, k->len);
  127|      0|            key = full_key;
  128|      2|        } else if (k->len == 66) {
  ------------------
  |  Branch (128:20): [True: 2, False: 0]
  ------------------
  129|      2|            key = k->data;
  130|      2|        } else if (k->len == 67 && k->data[0] == 0) {
  ------------------
  |  Branch (130:20): [True: 0, False: 0]
  |  Branch (130:36): [True: 0, False: 0]
  ------------------
  131|      0|            key = k->data + 1;
  132|      0|        } else {
  133|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  134|      0|            res = SECFailure;
  135|      0|            return res;
  136|      0|        }
  137|       |
  138|      2|        bool b = Hacl_P521_dh_responder(derived, P->data + 1, key);
  139|       |
  140|      2|        if (!b) {
  ------------------
  |  Branch (140:13): [True: 0, False: 2]
  ------------------
  141|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  142|      0|            res = SECFailure;
  143|      0|            return res;
  144|      0|        }
  145|       |
  146|      2|        X->len = 66;
  147|      2|        memcpy(X->data, derived, 66);
  148|      2|    }
  149|       |
  150|     34|    return res;
  151|     34|}
ec_secp521r1_verify_digest:
  232|      4|{
  233|      4|    SECStatus res = SECSuccess;
  234|       |
  235|      4|    if (!key || !signature || !digest ||
  ------------------
  |  Branch (235:9): [True: 0, False: 4]
  |  Branch (235:17): [True: 0, False: 4]
  |  Branch (235:31): [True: 0, False: 4]
  ------------------
  236|      4|        !key->publicValue.data ||
  ------------------
  |  Branch (236:9): [True: 0, False: 4]
  ------------------
  237|      4|        !signature->data || !digest->data ||
  ------------------
  |  Branch (237:9): [True: 0, False: 4]
  |  Branch (237:29): [True: 0, False: 4]
  ------------------
  238|      4|        key->ecParams.name != ECCurve_NIST_P521) {
  ------------------
  |  Branch (238:9): [True: 0, False: 4]
  ------------------
  239|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  240|      0|        res = SECFailure;
  241|      0|        return res;
  242|      0|    }
  243|       |
  244|      4|    if (signature->len == 0 || signature->len % 2 != 0 ||
  ------------------
  |  Branch (244:9): [True: 0, False: 4]
  |  Branch (244:32): [True: 0, False: 4]
  ------------------
  245|      4|        signature->len > 132 || digest->len == 0 ||
  ------------------
  |  Branch (245:9): [True: 0, False: 4]
  |  Branch (245:33): [True: 0, False: 4]
  ------------------
  246|      4|        key->publicValue.len != 133) {
  ------------------
  |  Branch (246:9): [True: 0, False: 4]
  ------------------
  247|      0|        PORT_SetError(SEC_ERROR_INPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  248|      0|        res = SECFailure;
  249|      0|        return res;
  250|      0|    }
  251|       |
  252|      4|    if (key->publicValue.data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|      4|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (252:9): [True: 0, False: 4]
  ------------------
  253|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_EC_POINT_FORM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  254|      0|        res = SECFailure;
  255|      0|        return res;
  256|      0|    }
  257|       |
  258|       |    // Signatures should be 132 bytes, but some software produces short signatures.
  259|       |    // Pad components with zeros if necessary.
  260|      4|    uint8_t paddedSigData[132] = { 0 };
  261|      4|    uint8_t *sig;
  262|      4|    if (signature->len != 132) {
  ------------------
  |  Branch (262:9): [True: 0, False: 4]
  ------------------
  263|      0|        size_t split = signature->len / 2;
  264|       |
  265|      0|        memcpy(paddedSigData + 66 - split, signature->data, split);
  266|      0|        memcpy(paddedSigData + 132 - split, signature->data + split, split);
  267|       |
  268|      0|        sig = paddedSigData;
  269|      4|    } else {
  270|      4|        sig = signature->data;
  271|      4|    }
  272|       |
  273|      4|    uint8_t hash[66] = { 0 };
  274|      4|    if (digest->len < 66) {
  ------------------
  |  Branch (274:9): [True: 4, False: 0]
  ------------------
  275|      4|        memcpy(hash + 66 - digest->len, digest->data, digest->len);
  276|      4|    } else {
  277|       |        // SEC 1 takes the most significant ceil(log(n)) bits of hash output when the hash output is longer than log(n).
  278|      0|        hash[0] = digest->data[0] >> 7;
  279|      0|        for (size_t i = 1; i < 66; i++) {
  ------------------
  |  Branch (279:28): [True: 0, False: 0]
  ------------------
  280|      0|            hash[i] = (digest->data[i - 1] << 1) | (digest->data[i] >> 7);
  281|      0|        }
  282|      0|    }
  283|       |
  284|      4|    bool b = Hacl_P521_ecdsa_verif_without_hash(
  285|      4|        66, hash, key->publicValue.data + 1, sig, sig + 66);
  286|      4|    if (!b) {
  ------------------
  |  Branch (286:9): [True: 4, False: 0]
  ------------------
  287|      4|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
  288|      4|        res = SECFailure;
  289|      4|        return res;
  290|      4|    }
  291|       |
  292|      0|    return res;
  293|      4|}

gcm_HashInit_hw:
  112|  1.24k|{
  113|  1.24k|    ghash->ghash_mul = gcm_HashMult_hw;
  114|  1.24k|    ghash->x = _mm_setzero_si128();
  115|       |    /* MSVC requires __m64 to load epi64. */
  116|  1.24k|    ghash->h = _mm_set_epi32(ghash->h_high >> 32, (uint32_t)ghash->h_high,
  117|  1.24k|                             ghash->h_low >> 32, (uint32_t)ghash->h_low);
  118|  1.24k|    ghash->hw = PR_TRUE;
  ------------------
  |  |  437|  1.24k|#define PR_TRUE 1
  ------------------
  119|  1.24k|    return SECSuccess;
  120|  1.24k|}

get64:
   81|  2.48k|{
   82|  2.48k|    return ((uint64_t)bytes[0]) << 56 |
   83|  2.48k|           ((uint64_t)bytes[1]) << 48 |
   84|  2.48k|           ((uint64_t)bytes[2]) << 40 |
   85|  2.48k|           ((uint64_t)bytes[3]) << 32 |
   86|  2.48k|           ((uint64_t)bytes[4]) << 24 |
   87|  2.48k|           ((uint64_t)bytes[5]) << 16 |
   88|  2.48k|           ((uint64_t)bytes[6]) << 8 |
   89|  2.48k|           ((uint64_t)bytes[7]);
   90|  2.48k|}
gcmHash_InitContext:
   95|  1.24k|{
   96|  1.24k|    SECStatus rv = SECSuccess;
   97|       |
   98|  1.24k|    ghash->cLen = 0;
   99|  1.24k|    ghash->bufLen = 0;
  100|  1.24k|    PORT_Memset(ghash->counterBuf, 0, sizeof(ghash->counterBuf));
  ------------------
  |  |  182|  1.24k|#define PORT_Memset memset
  ------------------
  101|       |
  102|  1.24k|    ghash->h_low = get64(H + 8);
  103|  1.24k|    ghash->h_high = get64(H);
  104|       |#ifdef USE_ARM_GCM
  105|       |#if defined(__aarch64__)
  106|       |    if (arm_pmull_support() && !sw) {
  107|       |#else
  108|       |    if (arm_neon_support() && !sw) {
  109|       |#endif
  110|       |#elif defined(USE_PPC_CRYPTO)
  111|       |    if (ppc_crypto_support() && !sw) {
  112|       |#else
  113|  1.24k|    if (clmul_support() && !sw) {
  ------------------
  |  Branch (113:9): [True: 1.24k, False: 0]
  |  Branch (113:28): [True: 1.24k, False: 0]
  ------------------
  114|  1.24k|#endif
  115|  1.24k|        rv = gcm_HashInit_hw(ghash);
  116|  1.24k|    } else {
  117|       |/* We fall back to the software implementation if we can't use / don't
  118|       | * want to use pclmul. */
  119|      0|#ifdef HAVE_INT128_SUPPORT
  120|      0|        ghash->ghash_mul = gcm_HashMult_sftw;
  121|       |#else
  122|       |        ghash->ghash_mul = gcm_HashMult_sftw32;
  123|       |#endif
  124|      0|        ghash->x_high = ghash->x_low = 0;
  125|      0|        ghash->hw = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  126|      0|    }
  127|  1.24k|    return rv;
  128|  1.24k|}
GCM_CreateContext:
  551|  1.24k|{
  552|  1.24k|    GCMContext *gcm = NULL;
  553|  1.24k|    gcmHashContext *ghash = NULL;
  554|  1.24k|    unsigned char H[MAX_BLOCK_SIZE];
  555|  1.24k|    unsigned int tmp;
  556|  1.24k|    const CK_NSS_GCM_PARAMS *gcmParams = (const CK_NSS_GCM_PARAMS *)params;
  557|  1.24k|    SECStatus rv;
  558|       |#ifdef DISABLE_HW_GCM
  559|       |    const PRBool sw = PR_TRUE;
  560|       |#else
  561|  1.24k|    const PRBool sw = PR_FALSE;
  ------------------
  |  |  438|  1.24k|#define PR_FALSE 0
  ------------------
  562|  1.24k|#endif
  563|       |
  564|  1.24k|    gcm = PORT_ZNew(GCMContext);
  ------------------
  |  |  148|  1.24k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  1.24k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  565|  1.24k|    if (gcm == NULL) {
  ------------------
  |  Branch (565:9): [True: 0, False: 1.24k]
  ------------------
  566|      0|        return NULL;
  567|      0|    }
  568|  1.24k|    gcm->cipher = cipher;
  569|  1.24k|    gcm->cipher_context = context;
  570|  1.24k|    ghash = PORT_ZNewAligned(gcmHashContext, 16, mem);
  ------------------
  |  |  150|  1.24k|    (type *)PORT_ZAllocAlignedOffset(sizeof(type), alignment, offsetof(type, mem))
  |  |  ------------------
  |  |  |  |   74|  1.24k|#define PORT_ZAllocAlignedOffset PORT_ZAllocAlignedOffset_Util
  |  |  ------------------
  ------------------
  571|       |
  572|       |    /* first plug in the ghash context */
  573|  1.24k|    gcm->ghash_context = ghash;
  574|  1.24k|    PORT_Memset(H, 0, AES_BLOCK_SIZE);
  ------------------
  |  |  182|  1.24k|#define PORT_Memset memset
  ------------------
                  PORT_Memset(H, 0, AES_BLOCK_SIZE);
  ------------------
  |  |  130|  1.24k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  575|  1.24k|    rv = (*cipher)(context, H, &tmp, AES_BLOCK_SIZE, H, AES_BLOCK_SIZE, AES_BLOCK_SIZE);
  ------------------
  |  |  130|  1.24k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
                  rv = (*cipher)(context, H, &tmp, AES_BLOCK_SIZE, H, AES_BLOCK_SIZE, AES_BLOCK_SIZE);
  ------------------
  |  |  130|  1.24k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
                  rv = (*cipher)(context, H, &tmp, AES_BLOCK_SIZE, H, AES_BLOCK_SIZE, AES_BLOCK_SIZE);
  ------------------
  |  |  130|  1.24k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  576|  1.24k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (576:9): [True: 0, False: 1.24k]
  ------------------
  577|      0|        goto loser;
  578|      0|    }
  579|  1.24k|    rv = gcmHash_InitContext(ghash, H, sw);
  580|  1.24k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (580:9): [True: 0, False: 1.24k]
  ------------------
  581|      0|        goto loser;
  582|      0|    }
  583|       |
  584|  1.24k|    gcm_InitIVContext(&gcm->gcm_iv);
  585|  1.24k|    gcm->ctr_context_init = PR_FALSE;
  ------------------
  |  |  438|  1.24k|#define PR_FALSE 0
  ------------------
  586|       |
  587|       |    /* if gcmPara/ms is NULL, then we are creating an PKCS #11 MESSAGE
  588|       |     * style context, in which we initialize the key once, then do separate
  589|       |     * iv/aad's for each message. In that case we only initialize the key
  590|       |     * and ghash. We initialize the counter in each separate message */
  591|  1.24k|    if (gcmParams == NULL) {
  ------------------
  |  Branch (591:9): [True: 1.24k, False: 0]
  ------------------
  592|       |        /* OK we are finished with init, if we are doing MESSAGE interface,
  593|       |         * return from here */
  594|  1.24k|        return gcm;
  595|  1.24k|    }
  596|       |
  597|      0|    rv = gcm_InitCounter(gcm, gcmParams->pIv, gcmParams->ulIvLen,
  598|      0|                         gcmParams->ulTagBits, gcmParams->pAAD,
  599|      0|                         gcmParams->ulAADLen);
  600|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (600:9): [True: 0, False: 0]
  ------------------
  601|      0|        goto loser;
  602|      0|    }
  603|      0|    PORT_SafeZero(H, AES_BLOCK_SIZE);
  ------------------
  |  |  130|      0|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  604|      0|    gcm->ctr_context_init = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  605|      0|    return gcm;
  606|       |
  607|      0|loser:
  608|      0|    PORT_SafeZero(H, AES_BLOCK_SIZE);
  ------------------
  |  |  130|      0|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  609|      0|    if (ghash && ghash->mem) {
  ------------------
  |  Branch (609:9): [True: 0, False: 0]
  |  Branch (609:18): [True: 0, False: 0]
  ------------------
  610|      0|        void *mem = ghash->mem;
  611|      0|        PORT_SafeZero(ghash, sizeof(gcmHashContext));
  612|      0|        PORT_Free(mem);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  613|      0|    }
  614|      0|    if (gcm) {
  ------------------
  |  Branch (614:9): [True: 0, False: 0]
  ------------------
  615|      0|        PORT_ZFree(gcm, sizeof(GCMContext));
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  616|      0|    }
  617|      0|    return NULL;
  618|      0|}
GCM_DestroyContext:
  816|  1.24k|{
  817|  1.24k|    void *mem = gcm->ghash_context->mem;
  818|       |    /* ctr_context is statically allocated and will be freed when we free
  819|       |     * gcm. call their destroy functions to free up any locally
  820|       |     * allocated data (like mp_int's) */
  821|  1.24k|    if (gcm->ctr_context_init) {
  ------------------
  |  Branch (821:9): [True: 0, False: 1.24k]
  ------------------
  822|      0|        CTR_DestroyContext(&gcm->ctr_context, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  823|      0|    }
  824|  1.24k|    PORT_Memset(gcm->ghash_context, 0, sizeof(gcmHashContext));
  ------------------
  |  |  182|  1.24k|#define PORT_Memset memset
  ------------------
  825|  1.24k|    PORT_Free(mem);
  ------------------
  |  |   60|  1.24k|#define PORT_Free PORT_Free_Util
  ------------------
  826|  1.24k|    PORT_Memset(&gcm->tagBits, 0, sizeof(gcm->tagBits));
  ------------------
  |  |  182|  1.24k|#define PORT_Memset memset
  ------------------
  827|  1.24k|    PORT_Memset(gcm->tagKey, 0, sizeof(gcm->tagKey));
  ------------------
  |  |  182|  1.24k|#define PORT_Memset memset
  ------------------
  828|  1.24k|    if (freeit) {
  ------------------
  |  Branch (828:9): [True: 1.24k, False: 0]
  ------------------
  829|  1.24k|        PORT_Free(gcm);
  ------------------
  |  |   60|  1.24k|#define PORT_Free PORT_Free_Util
  ------------------
  830|  1.24k|    }
  831|  1.24k|}
gcm_InitIVContext:
  998|  1.24k|{
  999|  1.24k|    gcmIv->counter = 0;
 1000|  1.24k|    gcmIv->max_count = 0;
 1001|  1.24k|    gcmIv->ivGen = CKG_GENERATE;
  ------------------
  |  | 1992|  1.24k|#define CKG_GENERATE 0x00000001UL
  ------------------
 1002|  1.24k|    gcmIv->ivLen = 0;
 1003|  1.24k|    gcmIv->fixedBits = 0;
 1004|  1.24k|}

MD5_NewContext:
  216|  3.11k|{
  217|       |    /* no need to ZAlloc, MD5_Begin will init the context */
  218|  3.11k|    MD5Context *cx = (MD5Context *)PORT_Alloc(sizeof(MD5Context));
  ------------------
  |  |   52|  3.11k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  219|  3.11k|    if (cx == NULL) {
  ------------------
  |  Branch (219:9): [True: 0, False: 3.11k]
  ------------------
  220|      0|        PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_OUT_OF_MEMORY_ERROR);
  ------------------
  |  |   16|      0|#define PR_OUT_OF_MEMORY_ERROR                   (-6000L)
  ------------------
  221|      0|        return NULL;
  222|      0|    }
  223|  3.11k|    return cx;
  224|  3.11k|}
MD5_DestroyContext:
  228|  3.11k|{
  229|  3.11k|    memset(cx, 0, sizeof *cx);
  230|  3.11k|    if (freeit) {
  ------------------
  |  Branch (230:9): [True: 3.11k, False: 0]
  ------------------
  231|  3.11k|        PORT_Free(cx);
  ------------------
  |  |   60|  3.11k|#define PORT_Free PORT_Free_Util
  ------------------
  232|  3.11k|    }
  233|  3.11k|}
MD5_Begin:
  237|  8.88k|{
  238|  8.88k|    cx->lsbInput = 0;
  239|  8.88k|    cx->msbInput = 0;
  240|       |    /*  memset(cx->inBuf, 0, sizeof(cx->inBuf)); */
  241|  8.88k|    cx->cv[0] = CV0_1;
  ------------------
  |  |   22|  8.88k|#define CV0_1 0x67452301
  ------------------
  242|  8.88k|    cx->cv[1] = CV0_2;
  ------------------
  |  |   23|  8.88k|#define CV0_2 0xefcdab89
  ------------------
  243|  8.88k|    cx->cv[2] = CV0_3;
  ------------------
  |  |   24|  8.88k|#define CV0_3 0x98badcfe
  ------------------
  244|  8.88k|    cx->cv[3] = CV0_4;
  ------------------
  |  |   25|  8.88k|#define CV0_4 0x10325476
  ------------------
  245|  8.88k|}
MD5_Update:
  423|  33.7k|{
  424|  33.7k|    PRUint32 bytesToConsume;
  425|  33.7k|    PRUint32 inBufIndex = cx->lsbInput & 63;
  426|  33.7k|    const PRUint32 *wBuf;
  427|       |
  428|       |    /* Add the number of input bytes to the 64-bit input counter. */
  429|  33.7k|    addto64(cx->msbInput, cx->lsbInput, inputLen);
  ------------------
  |  |  255|  33.7k|    sumlow += addend;                    \
  |  |  256|  33.7k|    if (sumlow < addend)                 \
  |  |  ------------------
  |  |  |  Branch (256:9): [True: 0, False: 33.7k]
  |  |  ------------------
  |  |  257|  33.7k|        ++sumhigh;
  ------------------
  430|  33.7k|    if (inBufIndex) {
  ------------------
  |  Branch (430:9): [True: 16.7k, False: 16.9k]
  ------------------
  431|       |        /* There is already data in the buffer.  Fill with input. */
  432|  16.7k|        bytesToConsume = PR_MIN(inputLen, MD5_BUFFER_SIZE - inBufIndex);
  ------------------
  |  |  158|  16.7k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 13.4k, False: 3.32k]
  |  |  ------------------
  ------------------
  433|  16.7k|        memcpy(&cx->inBuf[inBufIndex], input, bytesToConsume);
  ------------------
  |  |  193|  16.7k|#define inBuf u.b
  ------------------
  434|  16.7k|        if (inBufIndex + bytesToConsume >= MD5_BUFFER_SIZE) {
  ------------------
  |  |   19|  16.7k|#define MD5_BUFFER_SIZE 64
  ------------------
  |  Branch (434:13): [True: 3.32k, False: 13.4k]
  ------------------
  435|       |/* The buffer is filled.  Run the compression function. */
  436|       |#ifndef IS_LITTLE_ENDIAN
  437|       |            md5_prep_state_le(cx);
  438|       |#endif
  439|  3.32k|            md5_compress(cx, cx->u.w);
  440|  3.32k|        }
  441|       |        /* Remaining input. */
  442|  16.7k|        inputLen -= bytesToConsume;
  443|  16.7k|        input += bytesToConsume;
  444|  16.7k|    }
  445|       |
  446|       |    /* Iterate over 64-byte chunks of the message. */
  447|  50.1k|    while (inputLen >= MD5_BUFFER_SIZE) {
  ------------------
  |  |   19|  50.1k|#define MD5_BUFFER_SIZE 64
  ------------------
  |  Branch (447:12): [True: 16.4k, False: 33.7k]
  ------------------
  448|  16.4k|#ifdef IS_LITTLE_ENDIAN
  449|  16.4k|#ifdef HAVE_UNALIGNED_ACCESS
  450|       |        /* x86 can handle arithmetic on non-word-aligned buffers */
  451|  16.4k|        wBuf = (PRUint32 *)input;
  452|       |#else
  453|       |        if ((ptrdiff_t)input & 0x3) {
  454|       |            /* buffer not aligned, copy it to force alignment */
  455|       |            memcpy(cx->inBuf, input, MD5_BUFFER_SIZE);
  456|       |            wBuf = cx->u.w;
  457|       |        } else {
  458|       |            /* buffer is aligned */
  459|       |            wBuf = (PRUint32 *)input;
  460|       |        }
  461|       |#endif
  462|       |#else
  463|       |        md5_prep_buffer_le(cx, input);
  464|       |        wBuf = cx->u.w;
  465|       |#endif
  466|  16.4k|        md5_compress(cx, wBuf);
  467|  16.4k|        inputLen -= MD5_BUFFER_SIZE;
  ------------------
  |  |   19|  16.4k|#define MD5_BUFFER_SIZE 64
  ------------------
  468|  16.4k|        input += MD5_BUFFER_SIZE;
  ------------------
  |  |   19|  16.4k|#define MD5_BUFFER_SIZE 64
  ------------------
  469|  16.4k|    }
  470|       |
  471|       |    /* Tail of message (message bytes mod 64). */
  472|  33.7k|    if (inputLen)
  ------------------
  |  Branch (472:9): [True: 11.8k, False: 21.9k]
  ------------------
  473|  11.8k|        memcpy(cx->inBuf, input, inputLen);
  ------------------
  |  |  193|  11.8k|#define inBuf u.b
  ------------------
  474|  33.7k|}
MD5_End:
  494|  8.33k|{
  495|       |#ifndef IS_LITTLE_ENDIAN
  496|       |    PRUint32 tmp;
  497|       |#endif
  498|  8.33k|    PRUint32 lowInput, highInput;
  499|  8.33k|    PRUint32 inBufIndex = cx->lsbInput & 63;
  500|       |
  501|  8.33k|    if (maxDigestLen < MD5_HASH_LEN) {
  ------------------
  |  |   18|  8.33k|#define MD5_HASH_LEN 16
  ------------------
  |  Branch (501:9): [True: 0, False: 8.33k]
  ------------------
  502|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  503|      0|        return;
  504|      0|    }
  505|       |
  506|       |    /* Copy out the length of bits input before padding. */
  507|  8.33k|    lowInput = cx->lsbInput;
  508|  8.33k|    highInput = (cx->msbInput << 3) | (lowInput >> 29);
  509|  8.33k|    lowInput <<= 3;
  510|       |
  511|  8.33k|    if (inBufIndex < MD5_END_BUFFER) {
  ------------------
  |  |   20|  8.33k|#define MD5_END_BUFFER (MD5_BUFFER_SIZE - 8)
  |  |  ------------------
  |  |  |  |   19|  8.33k|#define MD5_BUFFER_SIZE 64
  |  |  ------------------
  ------------------
  |  Branch (511:9): [True: 8.28k, False: 54]
  ------------------
  512|  8.28k|        MD5_Update(cx, padbytes, MD5_END_BUFFER - inBufIndex);
  ------------------
  |  |   20|  8.28k|#define MD5_END_BUFFER (MD5_BUFFER_SIZE - 8)
  |  |  ------------------
  |  |  |  |   19|  8.28k|#define MD5_BUFFER_SIZE 64
  |  |  ------------------
  ------------------
  513|  8.28k|    } else {
  514|     54|        MD5_Update(cx, padbytes,
  515|     54|                   MD5_END_BUFFER + MD5_BUFFER_SIZE - inBufIndex);
  ------------------
  |  |   20|     54|#define MD5_END_BUFFER (MD5_BUFFER_SIZE - 8)
  |  |  ------------------
  |  |  |  |   19|     54|#define MD5_BUFFER_SIZE 64
  |  |  ------------------
  ------------------
                                 MD5_END_BUFFER + MD5_BUFFER_SIZE - inBufIndex);
  ------------------
  |  |   19|     54|#define MD5_BUFFER_SIZE 64
  ------------------
  516|     54|    }
  517|       |
  518|       |    /* Store the number of bytes input (before padding) in final 64 bits. */
  519|  8.33k|    cx->u.w[14] = lendian(lowInput);
  ------------------
  |  |  263|  8.33k|    (i32)
  ------------------
  520|  8.33k|    cx->u.w[15] = lendian(highInput);
  ------------------
  |  |  263|  8.33k|    (i32)
  ------------------
  521|       |
  522|       |/* Final call to compress. */
  523|       |#ifndef IS_LITTLE_ENDIAN
  524|       |    md5_prep_state_le(cx);
  525|       |#endif
  526|  8.33k|    md5_compress(cx, cx->u.w);
  527|       |
  528|       |    /* Copy the resulting values out of the chain variables into return buf. */
  529|  8.33k|    if (digestLen)
  ------------------
  |  Branch (529:9): [True: 8.33k, False: 0]
  ------------------
  530|  8.33k|        *digestLen = MD5_HASH_LEN;
  ------------------
  |  |   18|  8.33k|#define MD5_HASH_LEN 16
  ------------------
  531|       |#ifndef IS_LITTLE_ENDIAN
  532|       |    cx->cv[0] = lendian(cx->cv[0]);
  533|       |    cx->cv[1] = lendian(cx->cv[1]);
  534|       |    cx->cv[2] = lendian(cx->cv[2]);
  535|       |    cx->cv[3] = lendian(cx->cv[3]);
  536|       |#endif
  537|  8.33k|    memcpy(digest, cx->cv, MD5_HASH_LEN);
  ------------------
  |  |   18|  8.33k|#define MD5_HASH_LEN 16
  ------------------
  538|  8.33k|}
MD5_FlattenSize:
  568|    673|{
  569|    673|    return sizeof(*cx);
  570|    673|}
md5.c:md5_compress:
  344|  28.1k|{
  345|  28.1k|    PRUint32 a, b, c, d;
  346|  28.1k|    PRUint32 tmp;
  347|  28.1k|    a = cx->cv[0];
  348|  28.1k|    b = cx->cv[1];
  349|  28.1k|    c = cx->cv[2];
  350|  28.1k|    d = cx->cv[3];
  351|  28.1k|    FF(a, b, c, d, wBuf[R1B0], S1_0, T1_0);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  352|  28.1k|    FF(d, a, b, c, wBuf[R1B1], S1_1, T1_1);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  353|  28.1k|    FF(c, d, a, b, wBuf[R1B2], S1_2, T1_2);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  354|  28.1k|    FF(b, c, d, a, wBuf[R1B3], S1_3, T1_3);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  355|  28.1k|    FF(a, b, c, d, wBuf[R1B4], S1_0, T1_4);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  356|  28.1k|    FF(d, a, b, c, wBuf[R1B5], S1_1, T1_5);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  357|  28.1k|    FF(c, d, a, b, wBuf[R1B6], S1_2, T1_6);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  358|  28.1k|    FF(b, c, d, a, wBuf[R1B7], S1_3, T1_7);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  359|  28.1k|    FF(a, b, c, d, wBuf[R1B8], S1_0, T1_8);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  360|  28.1k|    FF(d, a, b, c, wBuf[R1B9], S1_1, T1_9);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  361|  28.1k|    FF(c, d, a, b, wBuf[R1B10], S1_2, T1_10);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  362|  28.1k|    FF(b, c, d, a, wBuf[R1B11], S1_3, T1_11);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  363|  28.1k|    FF(a, b, c, d, wBuf[R1B12], S1_0, T1_12);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  364|  28.1k|    FF(d, a, b, c, wBuf[R1B13], S1_1, T1_13);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  365|  28.1k|    FF(c, d, a, b, wBuf[R1B14], S1_2, T1_14);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  366|  28.1k|    FF(b, c, d, a, wBuf[R1B15], S1_3, T1_15);
  ------------------
  |  |  331|  28.1k|    a = b + cls(a + F(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  367|  28.1k|    GG(a, b, c, d, wBuf[R2B0], S2_0, T2_0);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  368|  28.1k|    GG(d, a, b, c, wBuf[R2B1], S2_1, T2_1);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  369|  28.1k|    GG(c, d, a, b, wBuf[R2B2], S2_2, T2_2);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  370|  28.1k|    GG(b, c, d, a, wBuf[R2B3], S2_3, T2_3);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  371|  28.1k|    GG(a, b, c, d, wBuf[R2B4], S2_0, T2_4);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  372|  28.1k|    GG(d, a, b, c, wBuf[R2B5], S2_1, T2_5);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  373|  28.1k|    GG(c, d, a, b, wBuf[R2B6], S2_2, T2_6);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  374|  28.1k|    GG(b, c, d, a, wBuf[R2B7], S2_3, T2_7);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  375|  28.1k|    GG(a, b, c, d, wBuf[R2B8], S2_0, T2_8);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  376|  28.1k|    GG(d, a, b, c, wBuf[R2B9], S2_1, T2_9);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  377|  28.1k|    GG(c, d, a, b, wBuf[R2B10], S2_2, T2_10);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  378|  28.1k|    GG(b, c, d, a, wBuf[R2B11], S2_3, T2_11);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  379|  28.1k|    GG(a, b, c, d, wBuf[R2B12], S2_0, T2_12);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  380|  28.1k|    GG(d, a, b, c, wBuf[R2B13], S2_1, T2_13);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  381|  28.1k|    GG(c, d, a, b, wBuf[R2B14], S2_2, T2_14);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  382|  28.1k|    GG(b, c, d, a, wBuf[R2B15], S2_3, T2_15);
  ------------------
  |  |  334|  28.1k|    a = b + cls(a + G(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  383|  28.1k|    HH(a, b, c, d, wBuf[R3B0], S3_0, T3_0);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  384|  28.1k|    HH(d, a, b, c, wBuf[R3B1], S3_1, T3_1);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  385|  28.1k|    HH(c, d, a, b, wBuf[R3B2], S3_2, T3_2);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  386|  28.1k|    HH(b, c, d, a, wBuf[R3B3], S3_3, T3_3);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  387|  28.1k|    HH(a, b, c, d, wBuf[R3B4], S3_0, T3_4);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  388|  28.1k|    HH(d, a, b, c, wBuf[R3B5], S3_1, T3_5);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  389|  28.1k|    HH(c, d, a, b, wBuf[R3B6], S3_2, T3_6);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  390|  28.1k|    HH(b, c, d, a, wBuf[R3B7], S3_3, T3_7);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  391|  28.1k|    HH(a, b, c, d, wBuf[R3B8], S3_0, T3_8);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  392|  28.1k|    HH(d, a, b, c, wBuf[R3B9], S3_1, T3_9);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  393|  28.1k|    HH(c, d, a, b, wBuf[R3B10], S3_2, T3_10);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  394|  28.1k|    HH(b, c, d, a, wBuf[R3B11], S3_3, T3_11);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  395|  28.1k|    HH(a, b, c, d, wBuf[R3B12], S3_0, T3_12);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  396|  28.1k|    HH(d, a, b, c, wBuf[R3B13], S3_1, T3_13);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  397|  28.1k|    HH(c, d, a, b, wBuf[R3B14], S3_2, T3_14);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  398|  28.1k|    HH(b, c, d, a, wBuf[R3B15], S3_3, T3_15);
  ------------------
  |  |  337|  28.1k|    a = b + cls(a + H(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  399|  28.1k|    II(a, b, c, d, wBuf[R4B0], S4_0, T4_0);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  400|  28.1k|    II(d, a, b, c, wBuf[R4B1], S4_1, T4_1);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  401|  28.1k|    II(c, d, a, b, wBuf[R4B2], S4_2, T4_2);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  402|  28.1k|    II(b, c, d, a, wBuf[R4B3], S4_3, T4_3);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  403|  28.1k|    II(a, b, c, d, wBuf[R4B4], S4_0, T4_4);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  404|  28.1k|    II(d, a, b, c, wBuf[R4B5], S4_1, T4_5);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  405|  28.1k|    II(c, d, a, b, wBuf[R4B6], S4_2, T4_6);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  406|  28.1k|    II(b, c, d, a, wBuf[R4B7], S4_3, T4_7);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  407|  28.1k|    II(a, b, c, d, wBuf[R4B8], S4_0, T4_8);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  408|  28.1k|    II(d, a, b, c, wBuf[R4B9], S4_1, T4_9);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  409|  28.1k|    II(c, d, a, b, wBuf[R4B10], S4_2, T4_10);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  410|  28.1k|    II(b, c, d, a, wBuf[R4B11], S4_3, T4_11);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  411|  28.1k|    II(a, b, c, d, wBuf[R4B12], S4_0, T4_12);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  412|  28.1k|    II(d, a, b, c, wBuf[R4B13], S4_1, T4_13);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  413|  28.1k|    II(c, d, a, b, wBuf[R4B14], S4_2, T4_14);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  414|  28.1k|    II(b, c, d, a, wBuf[R4B15], S4_3, T4_15);
  ------------------
  |  |  340|  28.1k|    a = b + cls(a + I(b, c, d) + bufint + ti, s)
  |  |  ------------------
  |  |  |  |  247|  28.1k|#define cls(i32, s) (tmp = i32, tmp << s | tmp >> (32 - s))
  |  |  ------------------
  ------------------
  415|  28.1k|    cx->cv[0] += a;
  416|  28.1k|    cx->cv[1] += b;
  417|  28.1k|    cx->cv[2] += c;
  418|  28.1k|    cx->cv[3] += d;
  419|  28.1k|}

s_mp_mul_comba_4:
  142|  2.14k|{
  143|  2.14k|    mp_digit c0, c1, c2, at[8];
  144|       |
  145|  2.14k|    memcpy(at, A->dp, 4 * sizeof(mp_digit));
  146|  2.14k|    memcpy(at + 4, B->dp, 4 * sizeof(mp_digit));
  147|  2.14k|    COMBA_START;
  148|       |
  149|  2.14k|    COMBA_CLEAR;
  ------------------
  |  |   37|  2.14k|    c0 = c1 = c2 = 0;
  ------------------
  150|       |    /* 0 */
  151|  2.14k|    MULADD(at[0], at[4]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  152|  2.14k|    COMBA_STORE(C->dp[0]);
  ------------------
  |  |   67|  2.14k|    x = c0;
  ------------------
  153|       |    /* 1 */
  154|  2.14k|    COMBA_FORWARD;
  ------------------
  |  |   41|  2.14k|    do {              \
  |  |   42|  2.14k|        c0 = c1;      \
  |  |   43|  2.14k|        c1 = c2;      \
  |  |   44|  2.14k|        c2 = 0;       \
  |  |   45|  2.14k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  155|  2.14k|    MULADD(at[0], at[5]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  156|  2.14k|    MULADD(at[1], at[4]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  157|  2.14k|    COMBA_STORE(C->dp[1]);
  ------------------
  |  |   67|  2.14k|    x = c0;
  ------------------
  158|       |    /* 2 */
  159|  2.14k|    COMBA_FORWARD;
  ------------------
  |  |   41|  2.14k|    do {              \
  |  |   42|  2.14k|        c0 = c1;      \
  |  |   43|  2.14k|        c1 = c2;      \
  |  |   44|  2.14k|        c2 = 0;       \
  |  |   45|  2.14k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  160|  2.14k|    MULADD(at[0], at[6]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  161|  2.14k|    MULADD(at[1], at[5]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  162|  2.14k|    MULADD(at[2], at[4]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  163|  2.14k|    COMBA_STORE(C->dp[2]);
  ------------------
  |  |   67|  2.14k|    x = c0;
  ------------------
  164|       |    /* 3 */
  165|  2.14k|    COMBA_FORWARD;
  ------------------
  |  |   41|  2.14k|    do {              \
  |  |   42|  2.14k|        c0 = c1;      \
  |  |   43|  2.14k|        c1 = c2;      \
  |  |   44|  2.14k|        c2 = 0;       \
  |  |   45|  2.14k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  166|  2.14k|    MULADD(at[0], at[7]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  167|  2.14k|    MULADD(at[1], at[6]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  168|  2.14k|    MULADD(at[2], at[5]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  169|  2.14k|    MULADD(at[3], at[4]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  170|  2.14k|    COMBA_STORE(C->dp[3]);
  ------------------
  |  |   67|  2.14k|    x = c0;
  ------------------
  171|       |    /* 4 */
  172|  2.14k|    COMBA_FORWARD;
  ------------------
  |  |   41|  2.14k|    do {              \
  |  |   42|  2.14k|        c0 = c1;      \
  |  |   43|  2.14k|        c1 = c2;      \
  |  |   44|  2.14k|        c2 = 0;       \
  |  |   45|  2.14k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  173|  2.14k|    MULADD(at[1], at[7]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  174|  2.14k|    MULADD(at[2], at[6]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  175|  2.14k|    MULADD(at[3], at[5]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  176|  2.14k|    COMBA_STORE(C->dp[4]);
  ------------------
  |  |   67|  2.14k|    x = c0;
  ------------------
  177|       |    /* 5 */
  178|  2.14k|    COMBA_FORWARD;
  ------------------
  |  |   41|  2.14k|    do {              \
  |  |   42|  2.14k|        c0 = c1;      \
  |  |   43|  2.14k|        c1 = c2;      \
  |  |   44|  2.14k|        c2 = 0;       \
  |  |   45|  2.14k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  179|  2.14k|    MULADD(at[2], at[7]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  180|  2.14k|    MULADD(at[3], at[6]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  181|  2.14k|    COMBA_STORE(C->dp[5]);
  ------------------
  |  |   67|  2.14k|    x = c0;
  ------------------
  182|       |    /* 6 */
  183|  2.14k|    COMBA_FORWARD;
  ------------------
  |  |   41|  2.14k|    do {              \
  |  |   42|  2.14k|        c0 = c1;      \
  |  |   43|  2.14k|        c1 = c2;      \
  |  |   44|  2.14k|        c2 = 0;       \
  |  |   45|  2.14k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  184|  2.14k|    MULADD(at[3], at[7]);
  ------------------
  |  |   52|  2.14k|    __asm__(                                        \
  |  |   53|  2.14k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  2.14k|        "mulq  %7           \n\t"                   \
  |  |   55|  2.14k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  2.14k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  2.14k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  2.14k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  2.14k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  2.14k|        : "%rax", "%rdx", "cc");
  ------------------
  185|  2.14k|    COMBA_STORE(C->dp[6]);
  ------------------
  |  |   67|  2.14k|    x = c0;
  ------------------
  186|  2.14k|    COMBA_STORE2(C->dp[7]);
  ------------------
  |  |   70|  2.14k|    x = c1;
  ------------------
  187|  2.14k|    C->used = 8;
  188|  2.14k|    C->sign = A->sign ^ B->sign;
  189|  2.14k|    mp_clamp(C);
  ------------------
  |  |   26|  2.14k|    {                                                    \
  |  |   27|  2.90k|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 2.90k, False: 0]
  |  |  |  Branch (27:29): [True: 754, False: 2.14k]
  |  |  ------------------
  |  |   28|  2.14k|            --((a)->used);                               \
  |  |   29|  2.14k|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  2.14k|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 2.14k, False: 0]
  |  |  ------------------
  |  |   30|  2.14k|    }
  ------------------
  190|  2.14k|    COMBA_FINI;
  191|  2.14k|}
s_mp_mul_comba_8:
  195|     60|{
  196|     60|    mp_digit c0, c1, c2, at[16];
  197|       |
  198|     60|    memcpy(at, A->dp, 8 * sizeof(mp_digit));
  199|     60|    memcpy(at + 8, B->dp, 8 * sizeof(mp_digit));
  200|     60|    COMBA_START;
  201|       |
  202|     60|    COMBA_CLEAR;
  ------------------
  |  |   37|     60|    c0 = c1 = c2 = 0;
  ------------------
  203|       |    /* 0 */
  204|     60|    MULADD(at[0], at[8]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  205|     60|    COMBA_STORE(C->dp[0]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  206|       |    /* 1 */
  207|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  208|     60|    MULADD(at[0], at[9]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  209|     60|    MULADD(at[1], at[8]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  210|     60|    COMBA_STORE(C->dp[1]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  211|       |    /* 2 */
  212|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  213|     60|    MULADD(at[0], at[10]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  214|     60|    MULADD(at[1], at[9]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  215|     60|    MULADD(at[2], at[8]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  216|     60|    COMBA_STORE(C->dp[2]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  217|       |    /* 3 */
  218|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  219|     60|    MULADD(at[0], at[11]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  220|     60|    MULADD(at[1], at[10]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  221|     60|    MULADD(at[2], at[9]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  222|     60|    MULADD(at[3], at[8]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  223|     60|    COMBA_STORE(C->dp[3]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  224|       |    /* 4 */
  225|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  226|     60|    MULADD(at[0], at[12]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  227|     60|    MULADD(at[1], at[11]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  228|     60|    MULADD(at[2], at[10]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  229|     60|    MULADD(at[3], at[9]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  230|     60|    MULADD(at[4], at[8]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  231|     60|    COMBA_STORE(C->dp[4]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  232|       |    /* 5 */
  233|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  234|     60|    MULADD(at[0], at[13]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  235|     60|    MULADD(at[1], at[12]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  236|     60|    MULADD(at[2], at[11]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  237|     60|    MULADD(at[3], at[10]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  238|     60|    MULADD(at[4], at[9]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  239|     60|    MULADD(at[5], at[8]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  240|     60|    COMBA_STORE(C->dp[5]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  241|       |    /* 6 */
  242|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  243|     60|    MULADD(at[0], at[14]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  244|     60|    MULADD(at[1], at[13]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  245|     60|    MULADD(at[2], at[12]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  246|     60|    MULADD(at[3], at[11]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  247|     60|    MULADD(at[4], at[10]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  248|     60|    MULADD(at[5], at[9]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  249|     60|    MULADD(at[6], at[8]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  250|     60|    COMBA_STORE(C->dp[6]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  251|       |    /* 7 */
  252|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  253|     60|    MULADD(at[0], at[15]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  254|     60|    MULADD(at[1], at[14]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  255|     60|    MULADD(at[2], at[13]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  256|     60|    MULADD(at[3], at[12]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  257|     60|    MULADD(at[4], at[11]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  258|     60|    MULADD(at[5], at[10]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  259|     60|    MULADD(at[6], at[9]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  260|     60|    MULADD(at[7], at[8]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  261|     60|    COMBA_STORE(C->dp[7]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  262|       |    /* 8 */
  263|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  264|     60|    MULADD(at[1], at[15]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  265|     60|    MULADD(at[2], at[14]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  266|     60|    MULADD(at[3], at[13]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  267|     60|    MULADD(at[4], at[12]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  268|     60|    MULADD(at[5], at[11]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  269|     60|    MULADD(at[6], at[10]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  270|     60|    MULADD(at[7], at[9]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  271|     60|    COMBA_STORE(C->dp[8]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  272|       |    /* 9 */
  273|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  274|     60|    MULADD(at[2], at[15]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  275|     60|    MULADD(at[3], at[14]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  276|     60|    MULADD(at[4], at[13]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  277|     60|    MULADD(at[5], at[12]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  278|     60|    MULADD(at[6], at[11]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  279|     60|    MULADD(at[7], at[10]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  280|     60|    COMBA_STORE(C->dp[9]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  281|       |    /* 10 */
  282|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  283|     60|    MULADD(at[3], at[15]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  284|     60|    MULADD(at[4], at[14]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  285|     60|    MULADD(at[5], at[13]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  286|     60|    MULADD(at[6], at[12]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  287|     60|    MULADD(at[7], at[11]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  288|     60|    COMBA_STORE(C->dp[10]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  289|       |    /* 11 */
  290|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  291|     60|    MULADD(at[4], at[15]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  292|     60|    MULADD(at[5], at[14]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  293|     60|    MULADD(at[6], at[13]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  294|     60|    MULADD(at[7], at[12]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  295|     60|    COMBA_STORE(C->dp[11]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  296|       |    /* 12 */
  297|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  298|     60|    MULADD(at[5], at[15]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  299|     60|    MULADD(at[6], at[14]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  300|     60|    MULADD(at[7], at[13]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  301|     60|    COMBA_STORE(C->dp[12]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  302|       |    /* 13 */
  303|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  304|     60|    MULADD(at[6], at[15]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  305|     60|    MULADD(at[7], at[14]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  306|     60|    COMBA_STORE(C->dp[13]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  307|       |    /* 14 */
  308|     60|    COMBA_FORWARD;
  ------------------
  |  |   41|     60|    do {              \
  |  |   42|     60|        c0 = c1;      \
  |  |   43|     60|        c1 = c2;      \
  |  |   44|     60|        c2 = 0;       \
  |  |   45|     60|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  309|     60|    MULADD(at[7], at[15]);
  ------------------
  |  |   52|     60|    __asm__(                                        \
  |  |   53|     60|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|     60|        "mulq  %7           \n\t"                   \
  |  |   55|     60|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|     60|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|     60|        "adcq  $0,%2        \n\t"                   \
  |  |   58|     60|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|     60|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|     60|        : "%rax", "%rdx", "cc");
  ------------------
  310|     60|    COMBA_STORE(C->dp[14]);
  ------------------
  |  |   67|     60|    x = c0;
  ------------------
  311|     60|    COMBA_STORE2(C->dp[15]);
  ------------------
  |  |   70|     60|    x = c1;
  ------------------
  312|     60|    C->used = 16;
  313|     60|    C->sign = A->sign ^ B->sign;
  314|     60|    mp_clamp(C);
  ------------------
  |  |   26|     60|    {                                                    \
  |  |   27|     84|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 84, False: 0]
  |  |  |  Branch (27:29): [True: 24, False: 60]
  |  |  ------------------
  |  |   28|     60|            --((a)->used);                               \
  |  |   29|     60|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     60|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 60, False: 0]
  |  |  ------------------
  |  |   30|     60|    }
  ------------------
  315|     60|    COMBA_FINI;
  316|     60|}
s_mp_mul_comba_16:
  320|  39.7k|{
  321|  39.7k|    mp_digit c0, c1, c2, at[32];
  322|       |
  323|  39.7k|    memcpy(at, A->dp, 16 * sizeof(mp_digit));
  324|  39.7k|    memcpy(at + 16, B->dp, 16 * sizeof(mp_digit));
  325|  39.7k|    COMBA_START;
  326|       |
  327|  39.7k|    COMBA_CLEAR;
  ------------------
  |  |   37|  39.7k|    c0 = c1 = c2 = 0;
  ------------------
  328|       |    /* 0 */
  329|  39.7k|    MULADD(at[0], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  330|  39.7k|    COMBA_STORE(C->dp[0]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  331|       |    /* 1 */
  332|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  333|  39.7k|    MULADD(at[0], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  334|  39.7k|    MULADD(at[1], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  335|  39.7k|    COMBA_STORE(C->dp[1]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  336|       |    /* 2 */
  337|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  338|  39.7k|    MULADD(at[0], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  339|  39.7k|    MULADD(at[1], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  340|  39.7k|    MULADD(at[2], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  341|  39.7k|    COMBA_STORE(C->dp[2]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  342|       |    /* 3 */
  343|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  344|  39.7k|    MULADD(at[0], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  345|  39.7k|    MULADD(at[1], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  346|  39.7k|    MULADD(at[2], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  347|  39.7k|    MULADD(at[3], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  348|  39.7k|    COMBA_STORE(C->dp[3]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  349|       |    /* 4 */
  350|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  351|  39.7k|    MULADD(at[0], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  352|  39.7k|    MULADD(at[1], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  353|  39.7k|    MULADD(at[2], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  354|  39.7k|    MULADD(at[3], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  355|  39.7k|    MULADD(at[4], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  356|  39.7k|    COMBA_STORE(C->dp[4]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  357|       |    /* 5 */
  358|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  359|  39.7k|    MULADD(at[0], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  360|  39.7k|    MULADD(at[1], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  361|  39.7k|    MULADD(at[2], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  362|  39.7k|    MULADD(at[3], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  363|  39.7k|    MULADD(at[4], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  364|  39.7k|    MULADD(at[5], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  365|  39.7k|    COMBA_STORE(C->dp[5]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  366|       |    /* 6 */
  367|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  368|  39.7k|    MULADD(at[0], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  369|  39.7k|    MULADD(at[1], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  370|  39.7k|    MULADD(at[2], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  371|  39.7k|    MULADD(at[3], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  372|  39.7k|    MULADD(at[4], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  373|  39.7k|    MULADD(at[5], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  374|  39.7k|    MULADD(at[6], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  375|  39.7k|    COMBA_STORE(C->dp[6]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  376|       |    /* 7 */
  377|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  378|  39.7k|    MULADD(at[0], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  379|  39.7k|    MULADD(at[1], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  380|  39.7k|    MULADD(at[2], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  381|  39.7k|    MULADD(at[3], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  382|  39.7k|    MULADD(at[4], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  383|  39.7k|    MULADD(at[5], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  384|  39.7k|    MULADD(at[6], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  385|  39.7k|    MULADD(at[7], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  386|  39.7k|    COMBA_STORE(C->dp[7]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  387|       |    /* 8 */
  388|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  389|  39.7k|    MULADD(at[0], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  390|  39.7k|    MULADD(at[1], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  391|  39.7k|    MULADD(at[2], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  392|  39.7k|    MULADD(at[3], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  393|  39.7k|    MULADD(at[4], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  394|  39.7k|    MULADD(at[5], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  395|  39.7k|    MULADD(at[6], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  396|  39.7k|    MULADD(at[7], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  397|  39.7k|    MULADD(at[8], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  398|  39.7k|    COMBA_STORE(C->dp[8]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  399|       |    /* 9 */
  400|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  401|  39.7k|    MULADD(at[0], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  402|  39.7k|    MULADD(at[1], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  403|  39.7k|    MULADD(at[2], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  404|  39.7k|    MULADD(at[3], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  405|  39.7k|    MULADD(at[4], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  406|  39.7k|    MULADD(at[5], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  407|  39.7k|    MULADD(at[6], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  408|  39.7k|    MULADD(at[7], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  409|  39.7k|    MULADD(at[8], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  410|  39.7k|    MULADD(at[9], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  411|  39.7k|    COMBA_STORE(C->dp[9]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  412|       |    /* 10 */
  413|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  414|  39.7k|    MULADD(at[0], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  415|  39.7k|    MULADD(at[1], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  416|  39.7k|    MULADD(at[2], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  417|  39.7k|    MULADD(at[3], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  418|  39.7k|    MULADD(at[4], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  419|  39.7k|    MULADD(at[5], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  420|  39.7k|    MULADD(at[6], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  421|  39.7k|    MULADD(at[7], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  422|  39.7k|    MULADD(at[8], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  423|  39.7k|    MULADD(at[9], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  424|  39.7k|    MULADD(at[10], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  425|  39.7k|    COMBA_STORE(C->dp[10]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  426|       |    /* 11 */
  427|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  428|  39.7k|    MULADD(at[0], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  429|  39.7k|    MULADD(at[1], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  430|  39.7k|    MULADD(at[2], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  431|  39.7k|    MULADD(at[3], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  432|  39.7k|    MULADD(at[4], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  433|  39.7k|    MULADD(at[5], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  434|  39.7k|    MULADD(at[6], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  435|  39.7k|    MULADD(at[7], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  436|  39.7k|    MULADD(at[8], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  437|  39.7k|    MULADD(at[9], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  438|  39.7k|    MULADD(at[10], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  439|  39.7k|    MULADD(at[11], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  440|  39.7k|    COMBA_STORE(C->dp[11]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  441|       |    /* 12 */
  442|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  443|  39.7k|    MULADD(at[0], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  444|  39.7k|    MULADD(at[1], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  445|  39.7k|    MULADD(at[2], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  446|  39.7k|    MULADD(at[3], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  447|  39.7k|    MULADD(at[4], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  448|  39.7k|    MULADD(at[5], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  449|  39.7k|    MULADD(at[6], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  450|  39.7k|    MULADD(at[7], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  451|  39.7k|    MULADD(at[8], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  452|  39.7k|    MULADD(at[9], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  453|  39.7k|    MULADD(at[10], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  454|  39.7k|    MULADD(at[11], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  455|  39.7k|    MULADD(at[12], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  456|  39.7k|    COMBA_STORE(C->dp[12]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  457|       |    /* 13 */
  458|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  459|  39.7k|    MULADD(at[0], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  460|  39.7k|    MULADD(at[1], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  461|  39.7k|    MULADD(at[2], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  462|  39.7k|    MULADD(at[3], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  463|  39.7k|    MULADD(at[4], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  464|  39.7k|    MULADD(at[5], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  465|  39.7k|    MULADD(at[6], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  466|  39.7k|    MULADD(at[7], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  467|  39.7k|    MULADD(at[8], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  468|  39.7k|    MULADD(at[9], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  469|  39.7k|    MULADD(at[10], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  470|  39.7k|    MULADD(at[11], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  471|  39.7k|    MULADD(at[12], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  472|  39.7k|    MULADD(at[13], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  473|  39.7k|    COMBA_STORE(C->dp[13]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  474|       |    /* 14 */
  475|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  476|  39.7k|    MULADD(at[0], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  477|  39.7k|    MULADD(at[1], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  478|  39.7k|    MULADD(at[2], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  479|  39.7k|    MULADD(at[3], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  480|  39.7k|    MULADD(at[4], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  481|  39.7k|    MULADD(at[5], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  482|  39.7k|    MULADD(at[6], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  483|  39.7k|    MULADD(at[7], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  484|  39.7k|    MULADD(at[8], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  485|  39.7k|    MULADD(at[9], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  486|  39.7k|    MULADD(at[10], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  487|  39.7k|    MULADD(at[11], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  488|  39.7k|    MULADD(at[12], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  489|  39.7k|    MULADD(at[13], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  490|  39.7k|    MULADD(at[14], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  491|  39.7k|    COMBA_STORE(C->dp[14]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  492|       |    /* 15 */
  493|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  494|  39.7k|    MULADD(at[0], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  495|  39.7k|    MULADD(at[1], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  496|  39.7k|    MULADD(at[2], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  497|  39.7k|    MULADD(at[3], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  498|  39.7k|    MULADD(at[4], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  499|  39.7k|    MULADD(at[5], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  500|  39.7k|    MULADD(at[6], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  501|  39.7k|    MULADD(at[7], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  502|  39.7k|    MULADD(at[8], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  503|  39.7k|    MULADD(at[9], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  504|  39.7k|    MULADD(at[10], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  505|  39.7k|    MULADD(at[11], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  506|  39.7k|    MULADD(at[12], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  507|  39.7k|    MULADD(at[13], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  508|  39.7k|    MULADD(at[14], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  509|  39.7k|    MULADD(at[15], at[16]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  510|  39.7k|    COMBA_STORE(C->dp[15]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  511|       |    /* 16 */
  512|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  513|  39.7k|    MULADD(at[1], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  514|  39.7k|    MULADD(at[2], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  515|  39.7k|    MULADD(at[3], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  516|  39.7k|    MULADD(at[4], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  517|  39.7k|    MULADD(at[5], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  518|  39.7k|    MULADD(at[6], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  519|  39.7k|    MULADD(at[7], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  520|  39.7k|    MULADD(at[8], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  521|  39.7k|    MULADD(at[9], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  522|  39.7k|    MULADD(at[10], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  523|  39.7k|    MULADD(at[11], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  524|  39.7k|    MULADD(at[12], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  525|  39.7k|    MULADD(at[13], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  526|  39.7k|    MULADD(at[14], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  527|  39.7k|    MULADD(at[15], at[17]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  528|  39.7k|    COMBA_STORE(C->dp[16]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  529|       |    /* 17 */
  530|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  531|  39.7k|    MULADD(at[2], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  532|  39.7k|    MULADD(at[3], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  533|  39.7k|    MULADD(at[4], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  534|  39.7k|    MULADD(at[5], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  535|  39.7k|    MULADD(at[6], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  536|  39.7k|    MULADD(at[7], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  537|  39.7k|    MULADD(at[8], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  538|  39.7k|    MULADD(at[9], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  539|  39.7k|    MULADD(at[10], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  540|  39.7k|    MULADD(at[11], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  541|  39.7k|    MULADD(at[12], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  542|  39.7k|    MULADD(at[13], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  543|  39.7k|    MULADD(at[14], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  544|  39.7k|    MULADD(at[15], at[18]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  545|  39.7k|    COMBA_STORE(C->dp[17]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  546|       |    /* 18 */
  547|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  548|  39.7k|    MULADD(at[3], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  549|  39.7k|    MULADD(at[4], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  550|  39.7k|    MULADD(at[5], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  551|  39.7k|    MULADD(at[6], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  552|  39.7k|    MULADD(at[7], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  553|  39.7k|    MULADD(at[8], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  554|  39.7k|    MULADD(at[9], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  555|  39.7k|    MULADD(at[10], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  556|  39.7k|    MULADD(at[11], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  557|  39.7k|    MULADD(at[12], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  558|  39.7k|    MULADD(at[13], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  559|  39.7k|    MULADD(at[14], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  560|  39.7k|    MULADD(at[15], at[19]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  561|  39.7k|    COMBA_STORE(C->dp[18]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  562|       |    /* 19 */
  563|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  564|  39.7k|    MULADD(at[4], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  565|  39.7k|    MULADD(at[5], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  566|  39.7k|    MULADD(at[6], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  567|  39.7k|    MULADD(at[7], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  568|  39.7k|    MULADD(at[8], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  569|  39.7k|    MULADD(at[9], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  570|  39.7k|    MULADD(at[10], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  571|  39.7k|    MULADD(at[11], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  572|  39.7k|    MULADD(at[12], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  573|  39.7k|    MULADD(at[13], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  574|  39.7k|    MULADD(at[14], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  575|  39.7k|    MULADD(at[15], at[20]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  576|  39.7k|    COMBA_STORE(C->dp[19]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  577|       |    /* 20 */
  578|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  579|  39.7k|    MULADD(at[5], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  580|  39.7k|    MULADD(at[6], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  581|  39.7k|    MULADD(at[7], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  582|  39.7k|    MULADD(at[8], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  583|  39.7k|    MULADD(at[9], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  584|  39.7k|    MULADD(at[10], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  585|  39.7k|    MULADD(at[11], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  586|  39.7k|    MULADD(at[12], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  587|  39.7k|    MULADD(at[13], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  588|  39.7k|    MULADD(at[14], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  589|  39.7k|    MULADD(at[15], at[21]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  590|  39.7k|    COMBA_STORE(C->dp[20]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  591|       |    /* 21 */
  592|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  593|  39.7k|    MULADD(at[6], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  594|  39.7k|    MULADD(at[7], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  595|  39.7k|    MULADD(at[8], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  596|  39.7k|    MULADD(at[9], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  597|  39.7k|    MULADD(at[10], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  598|  39.7k|    MULADD(at[11], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  599|  39.7k|    MULADD(at[12], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  600|  39.7k|    MULADD(at[13], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  601|  39.7k|    MULADD(at[14], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  602|  39.7k|    MULADD(at[15], at[22]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  603|  39.7k|    COMBA_STORE(C->dp[21]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  604|       |    /* 22 */
  605|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  606|  39.7k|    MULADD(at[7], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  607|  39.7k|    MULADD(at[8], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  608|  39.7k|    MULADD(at[9], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  609|  39.7k|    MULADD(at[10], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  610|  39.7k|    MULADD(at[11], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  611|  39.7k|    MULADD(at[12], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  612|  39.7k|    MULADD(at[13], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  613|  39.7k|    MULADD(at[14], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  614|  39.7k|    MULADD(at[15], at[23]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  615|  39.7k|    COMBA_STORE(C->dp[22]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  616|       |    /* 23 */
  617|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  618|  39.7k|    MULADD(at[8], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  619|  39.7k|    MULADD(at[9], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  620|  39.7k|    MULADD(at[10], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  621|  39.7k|    MULADD(at[11], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  622|  39.7k|    MULADD(at[12], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  623|  39.7k|    MULADD(at[13], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  624|  39.7k|    MULADD(at[14], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  625|  39.7k|    MULADD(at[15], at[24]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  626|  39.7k|    COMBA_STORE(C->dp[23]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  627|       |    /* 24 */
  628|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  629|  39.7k|    MULADD(at[9], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  630|  39.7k|    MULADD(at[10], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  631|  39.7k|    MULADD(at[11], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  632|  39.7k|    MULADD(at[12], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  633|  39.7k|    MULADD(at[13], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  634|  39.7k|    MULADD(at[14], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  635|  39.7k|    MULADD(at[15], at[25]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  636|  39.7k|    COMBA_STORE(C->dp[24]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  637|       |    /* 25 */
  638|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  639|  39.7k|    MULADD(at[10], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  640|  39.7k|    MULADD(at[11], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  641|  39.7k|    MULADD(at[12], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  642|  39.7k|    MULADD(at[13], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  643|  39.7k|    MULADD(at[14], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  644|  39.7k|    MULADD(at[15], at[26]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  645|  39.7k|    COMBA_STORE(C->dp[25]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  646|       |    /* 26 */
  647|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  648|  39.7k|    MULADD(at[11], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  649|  39.7k|    MULADD(at[12], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  650|  39.7k|    MULADD(at[13], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  651|  39.7k|    MULADD(at[14], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  652|  39.7k|    MULADD(at[15], at[27]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  653|  39.7k|    COMBA_STORE(C->dp[26]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  654|       |    /* 27 */
  655|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  656|  39.7k|    MULADD(at[12], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  657|  39.7k|    MULADD(at[13], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  658|  39.7k|    MULADD(at[14], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  659|  39.7k|    MULADD(at[15], at[28]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  660|  39.7k|    COMBA_STORE(C->dp[27]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  661|       |    /* 28 */
  662|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  663|  39.7k|    MULADD(at[13], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  664|  39.7k|    MULADD(at[14], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  665|  39.7k|    MULADD(at[15], at[29]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  666|  39.7k|    COMBA_STORE(C->dp[28]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  667|       |    /* 29 */
  668|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  669|  39.7k|    MULADD(at[14], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  670|  39.7k|    MULADD(at[15], at[30]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  671|  39.7k|    COMBA_STORE(C->dp[29]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  672|       |    /* 30 */
  673|  39.7k|    COMBA_FORWARD;
  ------------------
  |  |   41|  39.7k|    do {              \
  |  |   42|  39.7k|        c0 = c1;      \
  |  |   43|  39.7k|        c1 = c2;      \
  |  |   44|  39.7k|        c2 = 0;       \
  |  |   45|  39.7k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  674|  39.7k|    MULADD(at[15], at[31]);
  ------------------
  |  |   52|  39.7k|    __asm__(                                        \
  |  |   53|  39.7k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|  39.7k|        "mulq  %7           \n\t"                   \
  |  |   55|  39.7k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|  39.7k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|  39.7k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|  39.7k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|  39.7k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|  39.7k|        : "%rax", "%rdx", "cc");
  ------------------
  675|  39.7k|    COMBA_STORE(C->dp[30]);
  ------------------
  |  |   67|  39.7k|    x = c0;
  ------------------
  676|  39.7k|    COMBA_STORE2(C->dp[31]);
  ------------------
  |  |   70|  39.7k|    x = c1;
  ------------------
  677|  39.7k|    C->used = 32;
  678|  39.7k|    C->sign = A->sign ^ B->sign;
  679|  39.7k|    mp_clamp(C);
  ------------------
  |  |   26|  39.7k|    {                                                    \
  |  |   27|  39.8k|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 39.8k, False: 0]
  |  |  |  Branch (27:29): [True: 73, False: 39.7k]
  |  |  ------------------
  |  |   28|  39.7k|            --((a)->used);                               \
  |  |   29|  39.7k|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  39.7k|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 39.7k, False: 0]
  |  |  ------------------
  |  |   30|  39.7k|    }
  ------------------
  680|  39.7k|    COMBA_FINI;
  681|  39.7k|}
s_mp_mul_comba_32:
  685|   597k|{
  686|   597k|    mp_digit c0, c1, c2, at[64];
  687|       |
  688|   597k|    memcpy(at, A->dp, 32 * sizeof(mp_digit));
  689|   597k|    memcpy(at + 32, B->dp, 32 * sizeof(mp_digit));
  690|   597k|    COMBA_START;
  691|       |
  692|   597k|    COMBA_CLEAR;
  ------------------
  |  |   37|   597k|    c0 = c1 = c2 = 0;
  ------------------
  693|       |    /* 0 */
  694|   597k|    MULADD(at[0], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  695|   597k|    COMBA_STORE(C->dp[0]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  696|       |    /* 1 */
  697|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  698|   597k|    MULADD(at[0], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  699|   597k|    MULADD(at[1], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  700|   597k|    COMBA_STORE(C->dp[1]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  701|       |    /* 2 */
  702|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  703|   597k|    MULADD(at[0], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  704|   597k|    MULADD(at[1], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  705|   597k|    MULADD(at[2], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  706|   597k|    COMBA_STORE(C->dp[2]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  707|       |    /* 3 */
  708|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  709|   597k|    MULADD(at[0], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  710|   597k|    MULADD(at[1], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  711|   597k|    MULADD(at[2], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  712|   597k|    MULADD(at[3], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  713|   597k|    COMBA_STORE(C->dp[3]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  714|       |    /* 4 */
  715|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  716|   597k|    MULADD(at[0], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  717|   597k|    MULADD(at[1], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  718|   597k|    MULADD(at[2], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  719|   597k|    MULADD(at[3], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  720|   597k|    MULADD(at[4], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  721|   597k|    COMBA_STORE(C->dp[4]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  722|       |    /* 5 */
  723|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  724|   597k|    MULADD(at[0], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  725|   597k|    MULADD(at[1], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  726|   597k|    MULADD(at[2], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  727|   597k|    MULADD(at[3], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  728|   597k|    MULADD(at[4], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  729|   597k|    MULADD(at[5], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  730|   597k|    COMBA_STORE(C->dp[5]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  731|       |    /* 6 */
  732|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  733|   597k|    MULADD(at[0], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  734|   597k|    MULADD(at[1], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  735|   597k|    MULADD(at[2], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  736|   597k|    MULADD(at[3], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  737|   597k|    MULADD(at[4], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  738|   597k|    MULADD(at[5], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  739|   597k|    MULADD(at[6], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  740|   597k|    COMBA_STORE(C->dp[6]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  741|       |    /* 7 */
  742|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  743|   597k|    MULADD(at[0], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  744|   597k|    MULADD(at[1], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  745|   597k|    MULADD(at[2], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  746|   597k|    MULADD(at[3], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  747|   597k|    MULADD(at[4], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  748|   597k|    MULADD(at[5], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  749|   597k|    MULADD(at[6], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  750|   597k|    MULADD(at[7], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  751|   597k|    COMBA_STORE(C->dp[7]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  752|       |    /* 8 */
  753|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  754|   597k|    MULADD(at[0], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  755|   597k|    MULADD(at[1], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  756|   597k|    MULADD(at[2], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  757|   597k|    MULADD(at[3], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  758|   597k|    MULADD(at[4], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  759|   597k|    MULADD(at[5], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  760|   597k|    MULADD(at[6], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  761|   597k|    MULADD(at[7], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  762|   597k|    MULADD(at[8], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  763|   597k|    COMBA_STORE(C->dp[8]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  764|       |    /* 9 */
  765|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  766|   597k|    MULADD(at[0], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  767|   597k|    MULADD(at[1], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  768|   597k|    MULADD(at[2], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  769|   597k|    MULADD(at[3], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  770|   597k|    MULADD(at[4], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  771|   597k|    MULADD(at[5], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  772|   597k|    MULADD(at[6], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  773|   597k|    MULADD(at[7], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  774|   597k|    MULADD(at[8], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  775|   597k|    MULADD(at[9], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  776|   597k|    COMBA_STORE(C->dp[9]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  777|       |    /* 10 */
  778|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  779|   597k|    MULADD(at[0], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  780|   597k|    MULADD(at[1], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  781|   597k|    MULADD(at[2], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  782|   597k|    MULADD(at[3], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  783|   597k|    MULADD(at[4], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  784|   597k|    MULADD(at[5], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  785|   597k|    MULADD(at[6], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  786|   597k|    MULADD(at[7], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  787|   597k|    MULADD(at[8], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  788|   597k|    MULADD(at[9], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  789|   597k|    MULADD(at[10], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  790|   597k|    COMBA_STORE(C->dp[10]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  791|       |    /* 11 */
  792|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  793|   597k|    MULADD(at[0], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  794|   597k|    MULADD(at[1], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  795|   597k|    MULADD(at[2], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  796|   597k|    MULADD(at[3], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  797|   597k|    MULADD(at[4], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  798|   597k|    MULADD(at[5], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  799|   597k|    MULADD(at[6], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  800|   597k|    MULADD(at[7], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  801|   597k|    MULADD(at[8], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  802|   597k|    MULADD(at[9], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  803|   597k|    MULADD(at[10], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  804|   597k|    MULADD(at[11], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  805|   597k|    COMBA_STORE(C->dp[11]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  806|       |    /* 12 */
  807|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  808|   597k|    MULADD(at[0], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  809|   597k|    MULADD(at[1], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  810|   597k|    MULADD(at[2], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  811|   597k|    MULADD(at[3], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  812|   597k|    MULADD(at[4], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  813|   597k|    MULADD(at[5], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  814|   597k|    MULADD(at[6], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  815|   597k|    MULADD(at[7], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  816|   597k|    MULADD(at[8], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  817|   597k|    MULADD(at[9], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  818|   597k|    MULADD(at[10], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  819|   597k|    MULADD(at[11], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  820|   597k|    MULADD(at[12], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  821|   597k|    COMBA_STORE(C->dp[12]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  822|       |    /* 13 */
  823|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  824|   597k|    MULADD(at[0], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  825|   597k|    MULADD(at[1], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  826|   597k|    MULADD(at[2], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  827|   597k|    MULADD(at[3], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  828|   597k|    MULADD(at[4], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  829|   597k|    MULADD(at[5], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  830|   597k|    MULADD(at[6], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  831|   597k|    MULADD(at[7], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  832|   597k|    MULADD(at[8], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  833|   597k|    MULADD(at[9], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  834|   597k|    MULADD(at[10], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  835|   597k|    MULADD(at[11], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  836|   597k|    MULADD(at[12], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  837|   597k|    MULADD(at[13], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  838|   597k|    COMBA_STORE(C->dp[13]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  839|       |    /* 14 */
  840|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  841|   597k|    MULADD(at[0], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  842|   597k|    MULADD(at[1], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  843|   597k|    MULADD(at[2], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  844|   597k|    MULADD(at[3], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  845|   597k|    MULADD(at[4], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  846|   597k|    MULADD(at[5], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  847|   597k|    MULADD(at[6], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  848|   597k|    MULADD(at[7], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  849|   597k|    MULADD(at[8], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  850|   597k|    MULADD(at[9], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  851|   597k|    MULADD(at[10], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  852|   597k|    MULADD(at[11], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  853|   597k|    MULADD(at[12], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  854|   597k|    MULADD(at[13], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  855|   597k|    MULADD(at[14], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  856|   597k|    COMBA_STORE(C->dp[14]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  857|       |    /* 15 */
  858|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  859|   597k|    MULADD(at[0], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  860|   597k|    MULADD(at[1], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  861|   597k|    MULADD(at[2], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  862|   597k|    MULADD(at[3], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  863|   597k|    MULADD(at[4], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  864|   597k|    MULADD(at[5], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  865|   597k|    MULADD(at[6], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  866|   597k|    MULADD(at[7], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  867|   597k|    MULADD(at[8], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  868|   597k|    MULADD(at[9], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  869|   597k|    MULADD(at[10], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  870|   597k|    MULADD(at[11], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  871|   597k|    MULADD(at[12], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  872|   597k|    MULADD(at[13], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  873|   597k|    MULADD(at[14], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  874|   597k|    MULADD(at[15], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  875|   597k|    COMBA_STORE(C->dp[15]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  876|       |    /* 16 */
  877|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  878|   597k|    MULADD(at[0], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  879|   597k|    MULADD(at[1], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  880|   597k|    MULADD(at[2], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  881|   597k|    MULADD(at[3], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  882|   597k|    MULADD(at[4], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  883|   597k|    MULADD(at[5], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  884|   597k|    MULADD(at[6], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  885|   597k|    MULADD(at[7], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  886|   597k|    MULADD(at[8], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  887|   597k|    MULADD(at[9], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  888|   597k|    MULADD(at[10], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  889|   597k|    MULADD(at[11], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  890|   597k|    MULADD(at[12], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  891|   597k|    MULADD(at[13], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  892|   597k|    MULADD(at[14], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  893|   597k|    MULADD(at[15], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  894|   597k|    MULADD(at[16], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  895|   597k|    COMBA_STORE(C->dp[16]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  896|       |    /* 17 */
  897|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  898|   597k|    MULADD(at[0], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  899|   597k|    MULADD(at[1], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  900|   597k|    MULADD(at[2], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  901|   597k|    MULADD(at[3], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  902|   597k|    MULADD(at[4], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  903|   597k|    MULADD(at[5], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  904|   597k|    MULADD(at[6], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  905|   597k|    MULADD(at[7], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  906|   597k|    MULADD(at[8], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  907|   597k|    MULADD(at[9], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  908|   597k|    MULADD(at[10], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  909|   597k|    MULADD(at[11], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  910|   597k|    MULADD(at[12], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  911|   597k|    MULADD(at[13], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  912|   597k|    MULADD(at[14], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  913|   597k|    MULADD(at[15], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  914|   597k|    MULADD(at[16], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  915|   597k|    MULADD(at[17], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  916|   597k|    COMBA_STORE(C->dp[17]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  917|       |    /* 18 */
  918|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  919|   597k|    MULADD(at[0], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  920|   597k|    MULADD(at[1], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  921|   597k|    MULADD(at[2], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  922|   597k|    MULADD(at[3], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  923|   597k|    MULADD(at[4], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  924|   597k|    MULADD(at[5], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  925|   597k|    MULADD(at[6], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  926|   597k|    MULADD(at[7], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  927|   597k|    MULADD(at[8], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  928|   597k|    MULADD(at[9], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  929|   597k|    MULADD(at[10], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  930|   597k|    MULADD(at[11], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  931|   597k|    MULADD(at[12], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  932|   597k|    MULADD(at[13], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  933|   597k|    MULADD(at[14], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  934|   597k|    MULADD(at[15], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  935|   597k|    MULADD(at[16], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  936|   597k|    MULADD(at[17], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  937|   597k|    MULADD(at[18], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  938|   597k|    COMBA_STORE(C->dp[18]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  939|       |    /* 19 */
  940|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  941|   597k|    MULADD(at[0], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  942|   597k|    MULADD(at[1], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  943|   597k|    MULADD(at[2], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  944|   597k|    MULADD(at[3], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  945|   597k|    MULADD(at[4], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  946|   597k|    MULADD(at[5], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  947|   597k|    MULADD(at[6], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  948|   597k|    MULADD(at[7], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  949|   597k|    MULADD(at[8], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  950|   597k|    MULADD(at[9], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  951|   597k|    MULADD(at[10], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  952|   597k|    MULADD(at[11], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  953|   597k|    MULADD(at[12], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  954|   597k|    MULADD(at[13], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  955|   597k|    MULADD(at[14], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  956|   597k|    MULADD(at[15], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  957|   597k|    MULADD(at[16], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  958|   597k|    MULADD(at[17], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  959|   597k|    MULADD(at[18], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  960|   597k|    MULADD(at[19], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  961|   597k|    COMBA_STORE(C->dp[19]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  962|       |    /* 20 */
  963|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  964|   597k|    MULADD(at[0], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  965|   597k|    MULADD(at[1], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  966|   597k|    MULADD(at[2], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  967|   597k|    MULADD(at[3], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  968|   597k|    MULADD(at[4], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  969|   597k|    MULADD(at[5], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  970|   597k|    MULADD(at[6], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  971|   597k|    MULADD(at[7], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  972|   597k|    MULADD(at[8], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  973|   597k|    MULADD(at[9], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  974|   597k|    MULADD(at[10], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  975|   597k|    MULADD(at[11], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  976|   597k|    MULADD(at[12], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  977|   597k|    MULADD(at[13], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  978|   597k|    MULADD(at[14], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  979|   597k|    MULADD(at[15], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  980|   597k|    MULADD(at[16], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  981|   597k|    MULADD(at[17], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  982|   597k|    MULADD(at[18], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  983|   597k|    MULADD(at[19], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  984|   597k|    MULADD(at[20], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  985|   597k|    COMBA_STORE(C->dp[20]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
  986|       |    /* 21 */
  987|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  988|   597k|    MULADD(at[0], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  989|   597k|    MULADD(at[1], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  990|   597k|    MULADD(at[2], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  991|   597k|    MULADD(at[3], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  992|   597k|    MULADD(at[4], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  993|   597k|    MULADD(at[5], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  994|   597k|    MULADD(at[6], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  995|   597k|    MULADD(at[7], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  996|   597k|    MULADD(at[8], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  997|   597k|    MULADD(at[9], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  998|   597k|    MULADD(at[10], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
  999|   597k|    MULADD(at[11], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1000|   597k|    MULADD(at[12], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1001|   597k|    MULADD(at[13], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1002|   597k|    MULADD(at[14], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1003|   597k|    MULADD(at[15], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1004|   597k|    MULADD(at[16], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1005|   597k|    MULADD(at[17], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1006|   597k|    MULADD(at[18], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1007|   597k|    MULADD(at[19], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1008|   597k|    MULADD(at[20], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1009|   597k|    MULADD(at[21], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1010|   597k|    COMBA_STORE(C->dp[21]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1011|       |    /* 22 */
 1012|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1013|   597k|    MULADD(at[0], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1014|   597k|    MULADD(at[1], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1015|   597k|    MULADD(at[2], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1016|   597k|    MULADD(at[3], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1017|   597k|    MULADD(at[4], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1018|   597k|    MULADD(at[5], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1019|   597k|    MULADD(at[6], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1020|   597k|    MULADD(at[7], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1021|   597k|    MULADD(at[8], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1022|   597k|    MULADD(at[9], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1023|   597k|    MULADD(at[10], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1024|   597k|    MULADD(at[11], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1025|   597k|    MULADD(at[12], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1026|   597k|    MULADD(at[13], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1027|   597k|    MULADD(at[14], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1028|   597k|    MULADD(at[15], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1029|   597k|    MULADD(at[16], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1030|   597k|    MULADD(at[17], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1031|   597k|    MULADD(at[18], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1032|   597k|    MULADD(at[19], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1033|   597k|    MULADD(at[20], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1034|   597k|    MULADD(at[21], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1035|   597k|    MULADD(at[22], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1036|   597k|    COMBA_STORE(C->dp[22]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1037|       |    /* 23 */
 1038|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1039|   597k|    MULADD(at[0], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1040|   597k|    MULADD(at[1], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1041|   597k|    MULADD(at[2], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1042|   597k|    MULADD(at[3], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1043|   597k|    MULADD(at[4], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1044|   597k|    MULADD(at[5], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1045|   597k|    MULADD(at[6], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1046|   597k|    MULADD(at[7], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1047|   597k|    MULADD(at[8], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1048|   597k|    MULADD(at[9], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1049|   597k|    MULADD(at[10], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1050|   597k|    MULADD(at[11], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1051|   597k|    MULADD(at[12], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1052|   597k|    MULADD(at[13], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1053|   597k|    MULADD(at[14], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1054|   597k|    MULADD(at[15], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1055|   597k|    MULADD(at[16], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1056|   597k|    MULADD(at[17], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1057|   597k|    MULADD(at[18], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1058|   597k|    MULADD(at[19], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1059|   597k|    MULADD(at[20], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1060|   597k|    MULADD(at[21], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1061|   597k|    MULADD(at[22], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1062|   597k|    MULADD(at[23], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1063|   597k|    COMBA_STORE(C->dp[23]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1064|       |    /* 24 */
 1065|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1066|   597k|    MULADD(at[0], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1067|   597k|    MULADD(at[1], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1068|   597k|    MULADD(at[2], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1069|   597k|    MULADD(at[3], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1070|   597k|    MULADD(at[4], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1071|   597k|    MULADD(at[5], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1072|   597k|    MULADD(at[6], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1073|   597k|    MULADD(at[7], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1074|   597k|    MULADD(at[8], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1075|   597k|    MULADD(at[9], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1076|   597k|    MULADD(at[10], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1077|   597k|    MULADD(at[11], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1078|   597k|    MULADD(at[12], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1079|   597k|    MULADD(at[13], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1080|   597k|    MULADD(at[14], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1081|   597k|    MULADD(at[15], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1082|   597k|    MULADD(at[16], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1083|   597k|    MULADD(at[17], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1084|   597k|    MULADD(at[18], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1085|   597k|    MULADD(at[19], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1086|   597k|    MULADD(at[20], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1087|   597k|    MULADD(at[21], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1088|   597k|    MULADD(at[22], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1089|   597k|    MULADD(at[23], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1090|   597k|    MULADD(at[24], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1091|   597k|    COMBA_STORE(C->dp[24]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1092|       |    /* 25 */
 1093|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1094|   597k|    MULADD(at[0], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1095|   597k|    MULADD(at[1], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1096|   597k|    MULADD(at[2], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1097|   597k|    MULADD(at[3], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1098|   597k|    MULADD(at[4], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1099|   597k|    MULADD(at[5], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1100|   597k|    MULADD(at[6], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1101|   597k|    MULADD(at[7], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1102|   597k|    MULADD(at[8], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1103|   597k|    MULADD(at[9], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1104|   597k|    MULADD(at[10], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1105|   597k|    MULADD(at[11], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1106|   597k|    MULADD(at[12], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1107|   597k|    MULADD(at[13], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1108|   597k|    MULADD(at[14], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1109|   597k|    MULADD(at[15], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1110|   597k|    MULADD(at[16], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1111|   597k|    MULADD(at[17], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1112|   597k|    MULADD(at[18], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1113|   597k|    MULADD(at[19], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1114|   597k|    MULADD(at[20], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1115|   597k|    MULADD(at[21], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1116|   597k|    MULADD(at[22], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1117|   597k|    MULADD(at[23], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1118|   597k|    MULADD(at[24], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1119|   597k|    MULADD(at[25], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1120|   597k|    COMBA_STORE(C->dp[25]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1121|       |    /* 26 */
 1122|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1123|   597k|    MULADD(at[0], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1124|   597k|    MULADD(at[1], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1125|   597k|    MULADD(at[2], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1126|   597k|    MULADD(at[3], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1127|   597k|    MULADD(at[4], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1128|   597k|    MULADD(at[5], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1129|   597k|    MULADD(at[6], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1130|   597k|    MULADD(at[7], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1131|   597k|    MULADD(at[8], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1132|   597k|    MULADD(at[9], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1133|   597k|    MULADD(at[10], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1134|   597k|    MULADD(at[11], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1135|   597k|    MULADD(at[12], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1136|   597k|    MULADD(at[13], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1137|   597k|    MULADD(at[14], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1138|   597k|    MULADD(at[15], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1139|   597k|    MULADD(at[16], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1140|   597k|    MULADD(at[17], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1141|   597k|    MULADD(at[18], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1142|   597k|    MULADD(at[19], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1143|   597k|    MULADD(at[20], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1144|   597k|    MULADD(at[21], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1145|   597k|    MULADD(at[22], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1146|   597k|    MULADD(at[23], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1147|   597k|    MULADD(at[24], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1148|   597k|    MULADD(at[25], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1149|   597k|    MULADD(at[26], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1150|   597k|    COMBA_STORE(C->dp[26]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1151|       |    /* 27 */
 1152|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1153|   597k|    MULADD(at[0], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1154|   597k|    MULADD(at[1], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1155|   597k|    MULADD(at[2], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1156|   597k|    MULADD(at[3], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1157|   597k|    MULADD(at[4], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1158|   597k|    MULADD(at[5], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1159|   597k|    MULADD(at[6], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1160|   597k|    MULADD(at[7], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1161|   597k|    MULADD(at[8], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1162|   597k|    MULADD(at[9], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1163|   597k|    MULADD(at[10], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1164|   597k|    MULADD(at[11], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1165|   597k|    MULADD(at[12], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1166|   597k|    MULADD(at[13], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1167|   597k|    MULADD(at[14], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1168|   597k|    MULADD(at[15], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1169|   597k|    MULADD(at[16], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1170|   597k|    MULADD(at[17], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1171|   597k|    MULADD(at[18], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1172|   597k|    MULADD(at[19], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1173|   597k|    MULADD(at[20], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1174|   597k|    MULADD(at[21], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1175|   597k|    MULADD(at[22], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1176|   597k|    MULADD(at[23], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1177|   597k|    MULADD(at[24], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1178|   597k|    MULADD(at[25], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1179|   597k|    MULADD(at[26], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1180|   597k|    MULADD(at[27], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1181|   597k|    COMBA_STORE(C->dp[27]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1182|       |    /* 28 */
 1183|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1184|   597k|    MULADD(at[0], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1185|   597k|    MULADD(at[1], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1186|   597k|    MULADD(at[2], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1187|   597k|    MULADD(at[3], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1188|   597k|    MULADD(at[4], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1189|   597k|    MULADD(at[5], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1190|   597k|    MULADD(at[6], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1191|   597k|    MULADD(at[7], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1192|   597k|    MULADD(at[8], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1193|   597k|    MULADD(at[9], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1194|   597k|    MULADD(at[10], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1195|   597k|    MULADD(at[11], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1196|   597k|    MULADD(at[12], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1197|   597k|    MULADD(at[13], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1198|   597k|    MULADD(at[14], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1199|   597k|    MULADD(at[15], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1200|   597k|    MULADD(at[16], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1201|   597k|    MULADD(at[17], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1202|   597k|    MULADD(at[18], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1203|   597k|    MULADD(at[19], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1204|   597k|    MULADD(at[20], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1205|   597k|    MULADD(at[21], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1206|   597k|    MULADD(at[22], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1207|   597k|    MULADD(at[23], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1208|   597k|    MULADD(at[24], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1209|   597k|    MULADD(at[25], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1210|   597k|    MULADD(at[26], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1211|   597k|    MULADD(at[27], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1212|   597k|    MULADD(at[28], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1213|   597k|    COMBA_STORE(C->dp[28]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1214|       |    /* 29 */
 1215|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1216|   597k|    MULADD(at[0], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1217|   597k|    MULADD(at[1], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1218|   597k|    MULADD(at[2], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1219|   597k|    MULADD(at[3], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1220|   597k|    MULADD(at[4], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1221|   597k|    MULADD(at[5], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1222|   597k|    MULADD(at[6], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1223|   597k|    MULADD(at[7], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1224|   597k|    MULADD(at[8], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1225|   597k|    MULADD(at[9], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1226|   597k|    MULADD(at[10], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1227|   597k|    MULADD(at[11], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1228|   597k|    MULADD(at[12], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1229|   597k|    MULADD(at[13], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1230|   597k|    MULADD(at[14], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1231|   597k|    MULADD(at[15], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1232|   597k|    MULADD(at[16], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1233|   597k|    MULADD(at[17], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1234|   597k|    MULADD(at[18], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1235|   597k|    MULADD(at[19], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1236|   597k|    MULADD(at[20], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1237|   597k|    MULADD(at[21], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1238|   597k|    MULADD(at[22], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1239|   597k|    MULADD(at[23], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1240|   597k|    MULADD(at[24], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1241|   597k|    MULADD(at[25], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1242|   597k|    MULADD(at[26], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1243|   597k|    MULADD(at[27], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1244|   597k|    MULADD(at[28], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1245|   597k|    MULADD(at[29], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1246|   597k|    COMBA_STORE(C->dp[29]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1247|       |    /* 30 */
 1248|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1249|   597k|    MULADD(at[0], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1250|   597k|    MULADD(at[1], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1251|   597k|    MULADD(at[2], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1252|   597k|    MULADD(at[3], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1253|   597k|    MULADD(at[4], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1254|   597k|    MULADD(at[5], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1255|   597k|    MULADD(at[6], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1256|   597k|    MULADD(at[7], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1257|   597k|    MULADD(at[8], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1258|   597k|    MULADD(at[9], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1259|   597k|    MULADD(at[10], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1260|   597k|    MULADD(at[11], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1261|   597k|    MULADD(at[12], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1262|   597k|    MULADD(at[13], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1263|   597k|    MULADD(at[14], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1264|   597k|    MULADD(at[15], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1265|   597k|    MULADD(at[16], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1266|   597k|    MULADD(at[17], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1267|   597k|    MULADD(at[18], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1268|   597k|    MULADD(at[19], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1269|   597k|    MULADD(at[20], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1270|   597k|    MULADD(at[21], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1271|   597k|    MULADD(at[22], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1272|   597k|    MULADD(at[23], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1273|   597k|    MULADD(at[24], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1274|   597k|    MULADD(at[25], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1275|   597k|    MULADD(at[26], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1276|   597k|    MULADD(at[27], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1277|   597k|    MULADD(at[28], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1278|   597k|    MULADD(at[29], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1279|   597k|    MULADD(at[30], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1280|   597k|    COMBA_STORE(C->dp[30]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1281|       |    /* 31 */
 1282|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1283|   597k|    MULADD(at[0], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1284|   597k|    MULADD(at[1], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1285|   597k|    MULADD(at[2], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1286|   597k|    MULADD(at[3], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1287|   597k|    MULADD(at[4], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1288|   597k|    MULADD(at[5], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1289|   597k|    MULADD(at[6], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1290|   597k|    MULADD(at[7], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1291|   597k|    MULADD(at[8], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1292|   597k|    MULADD(at[9], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1293|   597k|    MULADD(at[10], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1294|   597k|    MULADD(at[11], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1295|   597k|    MULADD(at[12], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1296|   597k|    MULADD(at[13], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1297|   597k|    MULADD(at[14], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1298|   597k|    MULADD(at[15], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1299|   597k|    MULADD(at[16], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1300|   597k|    MULADD(at[17], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1301|   597k|    MULADD(at[18], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1302|   597k|    MULADD(at[19], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1303|   597k|    MULADD(at[20], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1304|   597k|    MULADD(at[21], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1305|   597k|    MULADD(at[22], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1306|   597k|    MULADD(at[23], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1307|   597k|    MULADD(at[24], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1308|   597k|    MULADD(at[25], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1309|   597k|    MULADD(at[26], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1310|   597k|    MULADD(at[27], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1311|   597k|    MULADD(at[28], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1312|   597k|    MULADD(at[29], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1313|   597k|    MULADD(at[30], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1314|   597k|    MULADD(at[31], at[32]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1315|   597k|    COMBA_STORE(C->dp[31]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1316|       |    /* 32 */
 1317|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1318|   597k|    MULADD(at[1], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1319|   597k|    MULADD(at[2], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1320|   597k|    MULADD(at[3], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1321|   597k|    MULADD(at[4], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1322|   597k|    MULADD(at[5], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1323|   597k|    MULADD(at[6], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1324|   597k|    MULADD(at[7], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1325|   597k|    MULADD(at[8], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1326|   597k|    MULADD(at[9], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1327|   597k|    MULADD(at[10], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1328|   597k|    MULADD(at[11], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1329|   597k|    MULADD(at[12], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1330|   597k|    MULADD(at[13], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1331|   597k|    MULADD(at[14], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1332|   597k|    MULADD(at[15], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1333|   597k|    MULADD(at[16], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1334|   597k|    MULADD(at[17], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1335|   597k|    MULADD(at[18], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1336|   597k|    MULADD(at[19], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1337|   597k|    MULADD(at[20], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1338|   597k|    MULADD(at[21], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1339|   597k|    MULADD(at[22], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1340|   597k|    MULADD(at[23], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1341|   597k|    MULADD(at[24], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1342|   597k|    MULADD(at[25], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1343|   597k|    MULADD(at[26], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1344|   597k|    MULADD(at[27], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1345|   597k|    MULADD(at[28], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1346|   597k|    MULADD(at[29], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1347|   597k|    MULADD(at[30], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1348|   597k|    MULADD(at[31], at[33]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1349|   597k|    COMBA_STORE(C->dp[32]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1350|       |    /* 33 */
 1351|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1352|   597k|    MULADD(at[2], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1353|   597k|    MULADD(at[3], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1354|   597k|    MULADD(at[4], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1355|   597k|    MULADD(at[5], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1356|   597k|    MULADD(at[6], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1357|   597k|    MULADD(at[7], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1358|   597k|    MULADD(at[8], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1359|   597k|    MULADD(at[9], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1360|   597k|    MULADD(at[10], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1361|   597k|    MULADD(at[11], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1362|   597k|    MULADD(at[12], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1363|   597k|    MULADD(at[13], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1364|   597k|    MULADD(at[14], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1365|   597k|    MULADD(at[15], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1366|   597k|    MULADD(at[16], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1367|   597k|    MULADD(at[17], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1368|   597k|    MULADD(at[18], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1369|   597k|    MULADD(at[19], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1370|   597k|    MULADD(at[20], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1371|   597k|    MULADD(at[21], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1372|   597k|    MULADD(at[22], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1373|   597k|    MULADD(at[23], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1374|   597k|    MULADD(at[24], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1375|   597k|    MULADD(at[25], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1376|   597k|    MULADD(at[26], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1377|   597k|    MULADD(at[27], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1378|   597k|    MULADD(at[28], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1379|   597k|    MULADD(at[29], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1380|   597k|    MULADD(at[30], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1381|   597k|    MULADD(at[31], at[34]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1382|   597k|    COMBA_STORE(C->dp[33]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1383|       |    /* 34 */
 1384|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1385|   597k|    MULADD(at[3], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1386|   597k|    MULADD(at[4], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1387|   597k|    MULADD(at[5], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1388|   597k|    MULADD(at[6], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1389|   597k|    MULADD(at[7], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1390|   597k|    MULADD(at[8], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1391|   597k|    MULADD(at[9], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1392|   597k|    MULADD(at[10], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1393|   597k|    MULADD(at[11], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1394|   597k|    MULADD(at[12], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1395|   597k|    MULADD(at[13], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1396|   597k|    MULADD(at[14], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1397|   597k|    MULADD(at[15], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1398|   597k|    MULADD(at[16], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1399|   597k|    MULADD(at[17], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1400|   597k|    MULADD(at[18], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1401|   597k|    MULADD(at[19], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1402|   597k|    MULADD(at[20], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1403|   597k|    MULADD(at[21], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1404|   597k|    MULADD(at[22], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1405|   597k|    MULADD(at[23], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1406|   597k|    MULADD(at[24], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1407|   597k|    MULADD(at[25], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1408|   597k|    MULADD(at[26], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1409|   597k|    MULADD(at[27], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1410|   597k|    MULADD(at[28], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1411|   597k|    MULADD(at[29], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1412|   597k|    MULADD(at[30], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1413|   597k|    MULADD(at[31], at[35]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1414|   597k|    COMBA_STORE(C->dp[34]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1415|       |    /* 35 */
 1416|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1417|   597k|    MULADD(at[4], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1418|   597k|    MULADD(at[5], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1419|   597k|    MULADD(at[6], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1420|   597k|    MULADD(at[7], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1421|   597k|    MULADD(at[8], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1422|   597k|    MULADD(at[9], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1423|   597k|    MULADD(at[10], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1424|   597k|    MULADD(at[11], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1425|   597k|    MULADD(at[12], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1426|   597k|    MULADD(at[13], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1427|   597k|    MULADD(at[14], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1428|   597k|    MULADD(at[15], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1429|   597k|    MULADD(at[16], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1430|   597k|    MULADD(at[17], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1431|   597k|    MULADD(at[18], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1432|   597k|    MULADD(at[19], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1433|   597k|    MULADD(at[20], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1434|   597k|    MULADD(at[21], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1435|   597k|    MULADD(at[22], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1436|   597k|    MULADD(at[23], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1437|   597k|    MULADD(at[24], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1438|   597k|    MULADD(at[25], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1439|   597k|    MULADD(at[26], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1440|   597k|    MULADD(at[27], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1441|   597k|    MULADD(at[28], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1442|   597k|    MULADD(at[29], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1443|   597k|    MULADD(at[30], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1444|   597k|    MULADD(at[31], at[36]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1445|   597k|    COMBA_STORE(C->dp[35]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1446|       |    /* 36 */
 1447|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1448|   597k|    MULADD(at[5], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1449|   597k|    MULADD(at[6], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1450|   597k|    MULADD(at[7], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1451|   597k|    MULADD(at[8], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1452|   597k|    MULADD(at[9], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1453|   597k|    MULADD(at[10], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1454|   597k|    MULADD(at[11], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1455|   597k|    MULADD(at[12], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1456|   597k|    MULADD(at[13], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1457|   597k|    MULADD(at[14], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1458|   597k|    MULADD(at[15], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1459|   597k|    MULADD(at[16], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1460|   597k|    MULADD(at[17], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1461|   597k|    MULADD(at[18], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1462|   597k|    MULADD(at[19], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1463|   597k|    MULADD(at[20], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1464|   597k|    MULADD(at[21], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1465|   597k|    MULADD(at[22], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1466|   597k|    MULADD(at[23], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1467|   597k|    MULADD(at[24], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1468|   597k|    MULADD(at[25], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1469|   597k|    MULADD(at[26], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1470|   597k|    MULADD(at[27], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1471|   597k|    MULADD(at[28], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1472|   597k|    MULADD(at[29], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1473|   597k|    MULADD(at[30], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1474|   597k|    MULADD(at[31], at[37]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1475|   597k|    COMBA_STORE(C->dp[36]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1476|       |    /* 37 */
 1477|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1478|   597k|    MULADD(at[6], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1479|   597k|    MULADD(at[7], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1480|   597k|    MULADD(at[8], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1481|   597k|    MULADD(at[9], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1482|   597k|    MULADD(at[10], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1483|   597k|    MULADD(at[11], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1484|   597k|    MULADD(at[12], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1485|   597k|    MULADD(at[13], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1486|   597k|    MULADD(at[14], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1487|   597k|    MULADD(at[15], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1488|   597k|    MULADD(at[16], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1489|   597k|    MULADD(at[17], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1490|   597k|    MULADD(at[18], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1491|   597k|    MULADD(at[19], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1492|   597k|    MULADD(at[20], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1493|   597k|    MULADD(at[21], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1494|   597k|    MULADD(at[22], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1495|   597k|    MULADD(at[23], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1496|   597k|    MULADD(at[24], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1497|   597k|    MULADD(at[25], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1498|   597k|    MULADD(at[26], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1499|   597k|    MULADD(at[27], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1500|   597k|    MULADD(at[28], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1501|   597k|    MULADD(at[29], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1502|   597k|    MULADD(at[30], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1503|   597k|    MULADD(at[31], at[38]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1504|   597k|    COMBA_STORE(C->dp[37]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1505|       |    /* 38 */
 1506|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1507|   597k|    MULADD(at[7], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1508|   597k|    MULADD(at[8], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1509|   597k|    MULADD(at[9], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1510|   597k|    MULADD(at[10], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1511|   597k|    MULADD(at[11], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1512|   597k|    MULADD(at[12], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1513|   597k|    MULADD(at[13], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1514|   597k|    MULADD(at[14], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1515|   597k|    MULADD(at[15], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1516|   597k|    MULADD(at[16], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1517|   597k|    MULADD(at[17], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1518|   597k|    MULADD(at[18], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1519|   597k|    MULADD(at[19], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1520|   597k|    MULADD(at[20], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1521|   597k|    MULADD(at[21], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1522|   597k|    MULADD(at[22], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1523|   597k|    MULADD(at[23], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1524|   597k|    MULADD(at[24], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1525|   597k|    MULADD(at[25], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1526|   597k|    MULADD(at[26], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1527|   597k|    MULADD(at[27], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1528|   597k|    MULADD(at[28], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1529|   597k|    MULADD(at[29], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1530|   597k|    MULADD(at[30], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1531|   597k|    MULADD(at[31], at[39]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1532|   597k|    COMBA_STORE(C->dp[38]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1533|       |    /* 39 */
 1534|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1535|   597k|    MULADD(at[8], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1536|   597k|    MULADD(at[9], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1537|   597k|    MULADD(at[10], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1538|   597k|    MULADD(at[11], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1539|   597k|    MULADD(at[12], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1540|   597k|    MULADD(at[13], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1541|   597k|    MULADD(at[14], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1542|   597k|    MULADD(at[15], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1543|   597k|    MULADD(at[16], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1544|   597k|    MULADD(at[17], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1545|   597k|    MULADD(at[18], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1546|   597k|    MULADD(at[19], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1547|   597k|    MULADD(at[20], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1548|   597k|    MULADD(at[21], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1549|   597k|    MULADD(at[22], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1550|   597k|    MULADD(at[23], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1551|   597k|    MULADD(at[24], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1552|   597k|    MULADD(at[25], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1553|   597k|    MULADD(at[26], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1554|   597k|    MULADD(at[27], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1555|   597k|    MULADD(at[28], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1556|   597k|    MULADD(at[29], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1557|   597k|    MULADD(at[30], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1558|   597k|    MULADD(at[31], at[40]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1559|   597k|    COMBA_STORE(C->dp[39]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1560|       |    /* 40 */
 1561|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1562|   597k|    MULADD(at[9], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1563|   597k|    MULADD(at[10], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1564|   597k|    MULADD(at[11], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1565|   597k|    MULADD(at[12], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1566|   597k|    MULADD(at[13], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1567|   597k|    MULADD(at[14], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1568|   597k|    MULADD(at[15], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1569|   597k|    MULADD(at[16], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1570|   597k|    MULADD(at[17], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1571|   597k|    MULADD(at[18], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1572|   597k|    MULADD(at[19], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1573|   597k|    MULADD(at[20], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1574|   597k|    MULADD(at[21], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1575|   597k|    MULADD(at[22], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1576|   597k|    MULADD(at[23], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1577|   597k|    MULADD(at[24], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1578|   597k|    MULADD(at[25], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1579|   597k|    MULADD(at[26], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1580|   597k|    MULADD(at[27], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1581|   597k|    MULADD(at[28], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1582|   597k|    MULADD(at[29], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1583|   597k|    MULADD(at[30], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1584|   597k|    MULADD(at[31], at[41]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1585|   597k|    COMBA_STORE(C->dp[40]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1586|       |    /* 41 */
 1587|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1588|   597k|    MULADD(at[10], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1589|   597k|    MULADD(at[11], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1590|   597k|    MULADD(at[12], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1591|   597k|    MULADD(at[13], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1592|   597k|    MULADD(at[14], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1593|   597k|    MULADD(at[15], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1594|   597k|    MULADD(at[16], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1595|   597k|    MULADD(at[17], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1596|   597k|    MULADD(at[18], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1597|   597k|    MULADD(at[19], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1598|   597k|    MULADD(at[20], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1599|   597k|    MULADD(at[21], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1600|   597k|    MULADD(at[22], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1601|   597k|    MULADD(at[23], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1602|   597k|    MULADD(at[24], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1603|   597k|    MULADD(at[25], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1604|   597k|    MULADD(at[26], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1605|   597k|    MULADD(at[27], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1606|   597k|    MULADD(at[28], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1607|   597k|    MULADD(at[29], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1608|   597k|    MULADD(at[30], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1609|   597k|    MULADD(at[31], at[42]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1610|   597k|    COMBA_STORE(C->dp[41]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1611|       |    /* 42 */
 1612|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1613|   597k|    MULADD(at[11], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1614|   597k|    MULADD(at[12], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1615|   597k|    MULADD(at[13], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1616|   597k|    MULADD(at[14], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1617|   597k|    MULADD(at[15], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1618|   597k|    MULADD(at[16], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1619|   597k|    MULADD(at[17], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1620|   597k|    MULADD(at[18], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1621|   597k|    MULADD(at[19], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1622|   597k|    MULADD(at[20], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1623|   597k|    MULADD(at[21], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1624|   597k|    MULADD(at[22], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1625|   597k|    MULADD(at[23], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1626|   597k|    MULADD(at[24], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1627|   597k|    MULADD(at[25], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1628|   597k|    MULADD(at[26], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1629|   597k|    MULADD(at[27], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1630|   597k|    MULADD(at[28], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1631|   597k|    MULADD(at[29], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1632|   597k|    MULADD(at[30], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1633|   597k|    MULADD(at[31], at[43]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1634|   597k|    COMBA_STORE(C->dp[42]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1635|       |    /* 43 */
 1636|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1637|   597k|    MULADD(at[12], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1638|   597k|    MULADD(at[13], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1639|   597k|    MULADD(at[14], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1640|   597k|    MULADD(at[15], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1641|   597k|    MULADD(at[16], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1642|   597k|    MULADD(at[17], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1643|   597k|    MULADD(at[18], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1644|   597k|    MULADD(at[19], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1645|   597k|    MULADD(at[20], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1646|   597k|    MULADD(at[21], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1647|   597k|    MULADD(at[22], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1648|   597k|    MULADD(at[23], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1649|   597k|    MULADD(at[24], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1650|   597k|    MULADD(at[25], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1651|   597k|    MULADD(at[26], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1652|   597k|    MULADD(at[27], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1653|   597k|    MULADD(at[28], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1654|   597k|    MULADD(at[29], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1655|   597k|    MULADD(at[30], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1656|   597k|    MULADD(at[31], at[44]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1657|   597k|    COMBA_STORE(C->dp[43]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1658|       |    /* 44 */
 1659|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1660|   597k|    MULADD(at[13], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1661|   597k|    MULADD(at[14], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1662|   597k|    MULADD(at[15], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1663|   597k|    MULADD(at[16], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1664|   597k|    MULADD(at[17], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1665|   597k|    MULADD(at[18], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1666|   597k|    MULADD(at[19], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1667|   597k|    MULADD(at[20], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1668|   597k|    MULADD(at[21], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1669|   597k|    MULADD(at[22], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1670|   597k|    MULADD(at[23], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1671|   597k|    MULADD(at[24], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1672|   597k|    MULADD(at[25], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1673|   597k|    MULADD(at[26], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1674|   597k|    MULADD(at[27], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1675|   597k|    MULADD(at[28], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1676|   597k|    MULADD(at[29], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1677|   597k|    MULADD(at[30], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1678|   597k|    MULADD(at[31], at[45]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1679|   597k|    COMBA_STORE(C->dp[44]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1680|       |    /* 45 */
 1681|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1682|   597k|    MULADD(at[14], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1683|   597k|    MULADD(at[15], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1684|   597k|    MULADD(at[16], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1685|   597k|    MULADD(at[17], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1686|   597k|    MULADD(at[18], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1687|   597k|    MULADD(at[19], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1688|   597k|    MULADD(at[20], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1689|   597k|    MULADD(at[21], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1690|   597k|    MULADD(at[22], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1691|   597k|    MULADD(at[23], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1692|   597k|    MULADD(at[24], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1693|   597k|    MULADD(at[25], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1694|   597k|    MULADD(at[26], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1695|   597k|    MULADD(at[27], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1696|   597k|    MULADD(at[28], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1697|   597k|    MULADD(at[29], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1698|   597k|    MULADD(at[30], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1699|   597k|    MULADD(at[31], at[46]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1700|   597k|    COMBA_STORE(C->dp[45]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1701|       |    /* 46 */
 1702|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1703|   597k|    MULADD(at[15], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1704|   597k|    MULADD(at[16], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1705|   597k|    MULADD(at[17], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1706|   597k|    MULADD(at[18], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1707|   597k|    MULADD(at[19], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1708|   597k|    MULADD(at[20], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1709|   597k|    MULADD(at[21], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1710|   597k|    MULADD(at[22], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1711|   597k|    MULADD(at[23], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1712|   597k|    MULADD(at[24], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1713|   597k|    MULADD(at[25], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1714|   597k|    MULADD(at[26], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1715|   597k|    MULADD(at[27], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1716|   597k|    MULADD(at[28], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1717|   597k|    MULADD(at[29], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1718|   597k|    MULADD(at[30], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1719|   597k|    MULADD(at[31], at[47]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1720|   597k|    COMBA_STORE(C->dp[46]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1721|       |    /* 47 */
 1722|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1723|   597k|    MULADD(at[16], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1724|   597k|    MULADD(at[17], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1725|   597k|    MULADD(at[18], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1726|   597k|    MULADD(at[19], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1727|   597k|    MULADD(at[20], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1728|   597k|    MULADD(at[21], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1729|   597k|    MULADD(at[22], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1730|   597k|    MULADD(at[23], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1731|   597k|    MULADD(at[24], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1732|   597k|    MULADD(at[25], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1733|   597k|    MULADD(at[26], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1734|   597k|    MULADD(at[27], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1735|   597k|    MULADD(at[28], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1736|   597k|    MULADD(at[29], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1737|   597k|    MULADD(at[30], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1738|   597k|    MULADD(at[31], at[48]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1739|   597k|    COMBA_STORE(C->dp[47]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1740|       |    /* 48 */
 1741|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1742|   597k|    MULADD(at[17], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1743|   597k|    MULADD(at[18], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1744|   597k|    MULADD(at[19], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1745|   597k|    MULADD(at[20], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1746|   597k|    MULADD(at[21], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1747|   597k|    MULADD(at[22], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1748|   597k|    MULADD(at[23], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1749|   597k|    MULADD(at[24], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1750|   597k|    MULADD(at[25], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1751|   597k|    MULADD(at[26], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1752|   597k|    MULADD(at[27], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1753|   597k|    MULADD(at[28], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1754|   597k|    MULADD(at[29], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1755|   597k|    MULADD(at[30], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1756|   597k|    MULADD(at[31], at[49]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1757|   597k|    COMBA_STORE(C->dp[48]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1758|       |    /* 49 */
 1759|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1760|   597k|    MULADD(at[18], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1761|   597k|    MULADD(at[19], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1762|   597k|    MULADD(at[20], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1763|   597k|    MULADD(at[21], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1764|   597k|    MULADD(at[22], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1765|   597k|    MULADD(at[23], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1766|   597k|    MULADD(at[24], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1767|   597k|    MULADD(at[25], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1768|   597k|    MULADD(at[26], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1769|   597k|    MULADD(at[27], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1770|   597k|    MULADD(at[28], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1771|   597k|    MULADD(at[29], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1772|   597k|    MULADD(at[30], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1773|   597k|    MULADD(at[31], at[50]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1774|   597k|    COMBA_STORE(C->dp[49]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1775|       |    /* 50 */
 1776|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1777|   597k|    MULADD(at[19], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1778|   597k|    MULADD(at[20], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1779|   597k|    MULADD(at[21], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1780|   597k|    MULADD(at[22], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1781|   597k|    MULADD(at[23], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1782|   597k|    MULADD(at[24], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1783|   597k|    MULADD(at[25], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1784|   597k|    MULADD(at[26], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1785|   597k|    MULADD(at[27], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1786|   597k|    MULADD(at[28], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1787|   597k|    MULADD(at[29], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1788|   597k|    MULADD(at[30], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1789|   597k|    MULADD(at[31], at[51]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1790|   597k|    COMBA_STORE(C->dp[50]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1791|       |    /* 51 */
 1792|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1793|   597k|    MULADD(at[20], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1794|   597k|    MULADD(at[21], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1795|   597k|    MULADD(at[22], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1796|   597k|    MULADD(at[23], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1797|   597k|    MULADD(at[24], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1798|   597k|    MULADD(at[25], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1799|   597k|    MULADD(at[26], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1800|   597k|    MULADD(at[27], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1801|   597k|    MULADD(at[28], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1802|   597k|    MULADD(at[29], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1803|   597k|    MULADD(at[30], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1804|   597k|    MULADD(at[31], at[52]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1805|   597k|    COMBA_STORE(C->dp[51]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1806|       |    /* 52 */
 1807|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1808|   597k|    MULADD(at[21], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1809|   597k|    MULADD(at[22], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1810|   597k|    MULADD(at[23], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1811|   597k|    MULADD(at[24], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1812|   597k|    MULADD(at[25], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1813|   597k|    MULADD(at[26], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1814|   597k|    MULADD(at[27], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1815|   597k|    MULADD(at[28], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1816|   597k|    MULADD(at[29], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1817|   597k|    MULADD(at[30], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1818|   597k|    MULADD(at[31], at[53]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1819|   597k|    COMBA_STORE(C->dp[52]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1820|       |    /* 53 */
 1821|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1822|   597k|    MULADD(at[22], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1823|   597k|    MULADD(at[23], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1824|   597k|    MULADD(at[24], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1825|   597k|    MULADD(at[25], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1826|   597k|    MULADD(at[26], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1827|   597k|    MULADD(at[27], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1828|   597k|    MULADD(at[28], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1829|   597k|    MULADD(at[29], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1830|   597k|    MULADD(at[30], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1831|   597k|    MULADD(at[31], at[54]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1832|   597k|    COMBA_STORE(C->dp[53]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1833|       |    /* 54 */
 1834|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1835|   597k|    MULADD(at[23], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1836|   597k|    MULADD(at[24], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1837|   597k|    MULADD(at[25], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1838|   597k|    MULADD(at[26], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1839|   597k|    MULADD(at[27], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1840|   597k|    MULADD(at[28], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1841|   597k|    MULADD(at[29], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1842|   597k|    MULADD(at[30], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1843|   597k|    MULADD(at[31], at[55]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1844|   597k|    COMBA_STORE(C->dp[54]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1845|       |    /* 55 */
 1846|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1847|   597k|    MULADD(at[24], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1848|   597k|    MULADD(at[25], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1849|   597k|    MULADD(at[26], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1850|   597k|    MULADD(at[27], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1851|   597k|    MULADD(at[28], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1852|   597k|    MULADD(at[29], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1853|   597k|    MULADD(at[30], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1854|   597k|    MULADD(at[31], at[56]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1855|   597k|    COMBA_STORE(C->dp[55]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1856|       |    /* 56 */
 1857|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1858|   597k|    MULADD(at[25], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1859|   597k|    MULADD(at[26], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1860|   597k|    MULADD(at[27], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1861|   597k|    MULADD(at[28], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1862|   597k|    MULADD(at[29], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1863|   597k|    MULADD(at[30], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1864|   597k|    MULADD(at[31], at[57]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1865|   597k|    COMBA_STORE(C->dp[56]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1866|       |    /* 57 */
 1867|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1868|   597k|    MULADD(at[26], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1869|   597k|    MULADD(at[27], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1870|   597k|    MULADD(at[28], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1871|   597k|    MULADD(at[29], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1872|   597k|    MULADD(at[30], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1873|   597k|    MULADD(at[31], at[58]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1874|   597k|    COMBA_STORE(C->dp[57]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1875|       |    /* 58 */
 1876|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1877|   597k|    MULADD(at[27], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1878|   597k|    MULADD(at[28], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1879|   597k|    MULADD(at[29], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1880|   597k|    MULADD(at[30], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1881|   597k|    MULADD(at[31], at[59]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1882|   597k|    COMBA_STORE(C->dp[58]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1883|       |    /* 59 */
 1884|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1885|   597k|    MULADD(at[28], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1886|   597k|    MULADD(at[29], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1887|   597k|    MULADD(at[30], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1888|   597k|    MULADD(at[31], at[60]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1889|   597k|    COMBA_STORE(C->dp[59]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1890|       |    /* 60 */
 1891|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1892|   597k|    MULADD(at[29], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1893|   597k|    MULADD(at[30], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1894|   597k|    MULADD(at[31], at[61]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1895|   597k|    COMBA_STORE(C->dp[60]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1896|       |    /* 61 */
 1897|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1898|   597k|    MULADD(at[30], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1899|   597k|    MULADD(at[31], at[62]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1900|   597k|    COMBA_STORE(C->dp[61]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1901|       |    /* 62 */
 1902|   597k|    COMBA_FORWARD;
  ------------------
  |  |   41|   597k|    do {              \
  |  |   42|   597k|        c0 = c1;      \
  |  |   43|   597k|        c1 = c2;      \
  |  |   44|   597k|        c2 = 0;       \
  |  |   45|   597k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (45:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1903|   597k|    MULADD(at[31], at[63]);
  ------------------
  |  |   52|   597k|    __asm__(                                        \
  |  |   53|   597k|        "movq  %6,%%rax     \n\t"                   \
  |  |   54|   597k|        "mulq  %7           \n\t"                   \
  |  |   55|   597k|        "addq  %%rax,%0     \n\t"                   \
  |  |   56|   597k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   57|   597k|        "adcq  $0,%2        \n\t"                   \
  |  |   58|   597k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |   59|   597k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |   60|   597k|        : "%rax", "%rdx", "cc");
  ------------------
 1904|   597k|    COMBA_STORE(C->dp[62]);
  ------------------
  |  |   67|   597k|    x = c0;
  ------------------
 1905|   597k|    COMBA_STORE2(C->dp[63]);
  ------------------
  |  |   70|   597k|    x = c1;
  ------------------
 1906|   597k|    C->used = 64;
 1907|   597k|    C->sign = A->sign ^ B->sign;
 1908|   597k|    mp_clamp(C);
  ------------------
  |  |   26|   597k|    {                                                    \
  |  |   27|   597k|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 597k, False: 0]
  |  |  |  Branch (27:29): [True: 704, False: 597k]
  |  |  ------------------
  |  |   28|   597k|            --((a)->used);                               \
  |  |   29|   597k|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   597k|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 597k, False: 0]
  |  |  ------------------
  |  |   30|   597k|    }
  ------------------
 1909|   597k|    COMBA_FINI;
 1910|   597k|}
s_mp_sqr_comba_4:
 1914|  1.13k|{
 1915|  1.13k|    mp_digit *a, b[8], c0, c1, c2;
 1916|       |
 1917|  1.13k|    a = A->dp;
 1918|  1.13k|    COMBA_START;
 1919|       |
 1920|       |    /* clear carries */
 1921|  1.13k|    CLEAR_CARRY;
  ------------------
  |  |   64|  1.13k|    c0 = c1 = c2 = 0;
  ------------------
 1922|       |
 1923|       |    /* output 0 */
 1924|  1.13k|    SQRADD(a[0], a[0]);
  ------------------
  |  |   82|  1.13k|    __asm__(                                \
  |  |   83|  1.13k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.13k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.13k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.13k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.13k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1925|  1.13k|    COMBA_STORE(b[0]);
  ------------------
  |  |   67|  1.13k|    x = c0;
  ------------------
 1926|       |
 1927|       |    /* output 1 */
 1928|  1.13k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.13k|    do {              \
  |  |   74|  1.13k|        c0 = c1;      \
  |  |   75|  1.13k|        c1 = c2;      \
  |  |   76|  1.13k|        c2 = 0;       \
  |  |   77|  1.13k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1929|  1.13k|    SQRADD2(a[0], a[1]);
  ------------------
  |  |   93|  1.13k|    __asm__(                                        \
  |  |   94|  1.13k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.13k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1930|  1.13k|    COMBA_STORE(b[1]);
  ------------------
  |  |   67|  1.13k|    x = c0;
  ------------------
 1931|       |
 1932|       |    /* output 2 */
 1933|  1.13k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.13k|    do {              \
  |  |   74|  1.13k|        c0 = c1;      \
  |  |   75|  1.13k|        c1 = c2;      \
  |  |   76|  1.13k|        c2 = 0;       \
  |  |   77|  1.13k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1934|  1.13k|    SQRADD2(a[0], a[2]);
  ------------------
  |  |   93|  1.13k|    __asm__(                                        \
  |  |   94|  1.13k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.13k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1935|  1.13k|    SQRADD(a[1], a[1]);
  ------------------
  |  |   82|  1.13k|    __asm__(                                \
  |  |   83|  1.13k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.13k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.13k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.13k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.13k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1936|  1.13k|    COMBA_STORE(b[2]);
  ------------------
  |  |   67|  1.13k|    x = c0;
  ------------------
 1937|       |
 1938|       |    /* output 3 */
 1939|  1.13k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.13k|    do {              \
  |  |   74|  1.13k|        c0 = c1;      \
  |  |   75|  1.13k|        c1 = c2;      \
  |  |   76|  1.13k|        c2 = 0;       \
  |  |   77|  1.13k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1940|  1.13k|    SQRADD2(a[0], a[3]);
  ------------------
  |  |   93|  1.13k|    __asm__(                                        \
  |  |   94|  1.13k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.13k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1941|  1.13k|    SQRADD2(a[1], a[2]);
  ------------------
  |  |   93|  1.13k|    __asm__(                                        \
  |  |   94|  1.13k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.13k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1942|  1.13k|    COMBA_STORE(b[3]);
  ------------------
  |  |   67|  1.13k|    x = c0;
  ------------------
 1943|       |
 1944|       |    /* output 4 */
 1945|  1.13k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.13k|    do {              \
  |  |   74|  1.13k|        c0 = c1;      \
  |  |   75|  1.13k|        c1 = c2;      \
  |  |   76|  1.13k|        c2 = 0;       \
  |  |   77|  1.13k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1946|  1.13k|    SQRADD2(a[1], a[3]);
  ------------------
  |  |   93|  1.13k|    __asm__(                                        \
  |  |   94|  1.13k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.13k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1947|  1.13k|    SQRADD(a[2], a[2]);
  ------------------
  |  |   82|  1.13k|    __asm__(                                \
  |  |   83|  1.13k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.13k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.13k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.13k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.13k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1948|  1.13k|    COMBA_STORE(b[4]);
  ------------------
  |  |   67|  1.13k|    x = c0;
  ------------------
 1949|       |
 1950|       |    /* output 5 */
 1951|  1.13k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.13k|    do {              \
  |  |   74|  1.13k|        c0 = c1;      \
  |  |   75|  1.13k|        c1 = c2;      \
  |  |   76|  1.13k|        c2 = 0;       \
  |  |   77|  1.13k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1952|  1.13k|    SQRADD2(a[2], a[3]);
  ------------------
  |  |   93|  1.13k|    __asm__(                                        \
  |  |   94|  1.13k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.13k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.13k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.13k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.13k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1953|  1.13k|    COMBA_STORE(b[5]);
  ------------------
  |  |   67|  1.13k|    x = c0;
  ------------------
 1954|       |
 1955|       |    /* output 6 */
 1956|  1.13k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.13k|    do {              \
  |  |   74|  1.13k|        c0 = c1;      \
  |  |   75|  1.13k|        c1 = c2;      \
  |  |   76|  1.13k|        c2 = 0;       \
  |  |   77|  1.13k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1957|  1.13k|    SQRADD(a[3], a[3]);
  ------------------
  |  |   82|  1.13k|    __asm__(                                \
  |  |   83|  1.13k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.13k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.13k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.13k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.13k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.13k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.13k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.13k|        : "%rax", "%rdx", "cc");
  ------------------
 1958|  1.13k|    COMBA_STORE(b[6]);
  ------------------
  |  |   67|  1.13k|    x = c0;
  ------------------
 1959|  1.13k|    COMBA_STORE2(b[7]);
  ------------------
  |  |   70|  1.13k|    x = c1;
  ------------------
 1960|  1.13k|    COMBA_FINI;
 1961|       |
 1962|  1.13k|    B->used = 8;
 1963|  1.13k|    B->sign = ZPOS;
  ------------------
  |  |  326|  1.13k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  1.13k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 1964|  1.13k|    memcpy(B->dp, b, 8 * sizeof(mp_digit));
 1965|  1.13k|    mp_clamp(B);
  ------------------
  |  |   26|  1.13k|    {                                                    \
  |  |   27|  1.63k|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 1.63k, False: 0]
  |  |  |  Branch (27:29): [True: 501, False: 1.13k]
  |  |  ------------------
  |  |   28|  1.13k|            --((a)->used);                               \
  |  |   29|  1.13k|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  1.13k|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 1.13k, False: 0]
  |  |  ------------------
  |  |   30|  1.13k|    }
  ------------------
 1966|  1.13k|}
s_mp_sqr_comba_8:
 1970|  1.04k|{
 1971|  1.04k|    mp_digit *a, b[16], c0, c1, c2, sc0, sc1, sc2;
 1972|       |
 1973|  1.04k|    a = A->dp;
 1974|  1.04k|    COMBA_START;
 1975|       |
 1976|       |    /* clear carries */
 1977|  1.04k|    CLEAR_CARRY;
  ------------------
  |  |   64|  1.04k|    c0 = c1 = c2 = 0;
  ------------------
 1978|       |
 1979|       |    /* output 0 */
 1980|  1.04k|    SQRADD(a[0], a[0]);
  ------------------
  |  |   82|  1.04k|    __asm__(                                \
  |  |   83|  1.04k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.04k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.04k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.04k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.04k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 1981|  1.04k|    COMBA_STORE(b[0]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 1982|       |
 1983|       |    /* output 1 */
 1984|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1985|  1.04k|    SQRADD2(a[0], a[1]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 1986|  1.04k|    COMBA_STORE(b[1]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 1987|       |
 1988|       |    /* output 2 */
 1989|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1990|  1.04k|    SQRADD2(a[0], a[2]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 1991|  1.04k|    SQRADD(a[1], a[1]);
  ------------------
  |  |   82|  1.04k|    __asm__(                                \
  |  |   83|  1.04k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.04k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.04k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.04k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.04k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 1992|  1.04k|    COMBA_STORE(b[2]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 1993|       |
 1994|       |    /* output 3 */
 1995|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1996|  1.04k|    SQRADD2(a[0], a[3]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 1997|  1.04k|    SQRADD2(a[1], a[2]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 1998|  1.04k|    COMBA_STORE(b[3]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 1999|       |
 2000|       |    /* output 4 */
 2001|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2002|  1.04k|    SQRADD2(a[0], a[4]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2003|  1.04k|    SQRADD2(a[1], a[3]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2004|  1.04k|    SQRADD(a[2], a[2]);
  ------------------
  |  |   82|  1.04k|    __asm__(                                \
  |  |   83|  1.04k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.04k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.04k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.04k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.04k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2005|  1.04k|    COMBA_STORE(b[4]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2006|       |
 2007|       |    /* output 5 */
 2008|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2009|  1.04k|    SQRADDSC(a[0], a[5]);
  ------------------
  |  |  107|  1.04k|    __asm__(                              \
  |  |  108|  1.04k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.04k|        "mulq  %4           \n\t"         \
  |  |  110|  1.04k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.04k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.04k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.04k|        : "g"(i), "g"(j)                  \
  |  |  115|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2010|  1.04k|    SQRADDAC(a[1], a[4]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2011|  1.04k|    SQRADDAC(a[2], a[3]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2012|  1.04k|    SQRADDDB;
  ------------------
  |  |  129|  1.04k|    __asm__(                                                      \
  |  |  130|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.04k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.04k|        : "cc");
  ------------------
 2013|  1.04k|    COMBA_STORE(b[5]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2014|       |
 2015|       |    /* output 6 */
 2016|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2017|  1.04k|    SQRADDSC(a[0], a[6]);
  ------------------
  |  |  107|  1.04k|    __asm__(                              \
  |  |  108|  1.04k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.04k|        "mulq  %4           \n\t"         \
  |  |  110|  1.04k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.04k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.04k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.04k|        : "g"(i), "g"(j)                  \
  |  |  115|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2018|  1.04k|    SQRADDAC(a[1], a[5]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2019|  1.04k|    SQRADDAC(a[2], a[4]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2020|  1.04k|    SQRADDDB;
  ------------------
  |  |  129|  1.04k|    __asm__(                                                      \
  |  |  130|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.04k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.04k|        : "cc");
  ------------------
 2021|  1.04k|    SQRADD(a[3], a[3]);
  ------------------
  |  |   82|  1.04k|    __asm__(                                \
  |  |   83|  1.04k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.04k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.04k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.04k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.04k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2022|  1.04k|    COMBA_STORE(b[6]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2023|       |
 2024|       |    /* output 7 */
 2025|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2026|  1.04k|    SQRADDSC(a[0], a[7]);
  ------------------
  |  |  107|  1.04k|    __asm__(                              \
  |  |  108|  1.04k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.04k|        "mulq  %4           \n\t"         \
  |  |  110|  1.04k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.04k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.04k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.04k|        : "g"(i), "g"(j)                  \
  |  |  115|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2027|  1.04k|    SQRADDAC(a[1], a[6]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2028|  1.04k|    SQRADDAC(a[2], a[5]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2029|  1.04k|    SQRADDAC(a[3], a[4]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2030|  1.04k|    SQRADDDB;
  ------------------
  |  |  129|  1.04k|    __asm__(                                                      \
  |  |  130|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.04k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.04k|        : "cc");
  ------------------
 2031|  1.04k|    COMBA_STORE(b[7]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2032|       |
 2033|       |    /* output 8 */
 2034|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2035|  1.04k|    SQRADDSC(a[1], a[7]);
  ------------------
  |  |  107|  1.04k|    __asm__(                              \
  |  |  108|  1.04k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.04k|        "mulq  %4           \n\t"         \
  |  |  110|  1.04k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.04k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.04k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.04k|        : "g"(i), "g"(j)                  \
  |  |  115|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2036|  1.04k|    SQRADDAC(a[2], a[6]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2037|  1.04k|    SQRADDAC(a[3], a[5]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2038|  1.04k|    SQRADDDB;
  ------------------
  |  |  129|  1.04k|    __asm__(                                                      \
  |  |  130|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.04k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.04k|        : "cc");
  ------------------
 2039|  1.04k|    SQRADD(a[4], a[4]);
  ------------------
  |  |   82|  1.04k|    __asm__(                                \
  |  |   83|  1.04k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.04k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.04k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.04k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.04k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2040|  1.04k|    COMBA_STORE(b[8]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2041|       |
 2042|       |    /* output 9 */
 2043|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2044|  1.04k|    SQRADDSC(a[2], a[7]);
  ------------------
  |  |  107|  1.04k|    __asm__(                              \
  |  |  108|  1.04k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  1.04k|        "mulq  %4           \n\t"         \
  |  |  110|  1.04k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  1.04k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  1.04k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  1.04k|        : "g"(i), "g"(j)                  \
  |  |  115|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2045|  1.04k|    SQRADDAC(a[3], a[6]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2046|  1.04k|    SQRADDAC(a[4], a[5]);
  ------------------
  |  |  118|  1.04k|    __asm__(                                           \
  |  |  119|  1.04k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  1.04k|        "mulq  %7           \n\t"                      \
  |  |  121|  1.04k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  1.04k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  1.04k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  1.04k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  1.04k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2047|  1.04k|    SQRADDDB;
  ------------------
  |  |  129|  1.04k|    __asm__(                                                      \
  |  |  130|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  1.04k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  1.04k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  1.04k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  1.04k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  1.04k|        : "cc");
  ------------------
 2048|  1.04k|    COMBA_STORE(b[9]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2049|       |
 2050|       |    /* output 10 */
 2051|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2052|  1.04k|    SQRADD2(a[3], a[7]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2053|  1.04k|    SQRADD2(a[4], a[6]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2054|  1.04k|    SQRADD(a[5], a[5]);
  ------------------
  |  |   82|  1.04k|    __asm__(                                \
  |  |   83|  1.04k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.04k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.04k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.04k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.04k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2055|  1.04k|    COMBA_STORE(b[10]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2056|       |
 2057|       |    /* output 11 */
 2058|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2059|  1.04k|    SQRADD2(a[4], a[7]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2060|  1.04k|    SQRADD2(a[5], a[6]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2061|  1.04k|    COMBA_STORE(b[11]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2062|       |
 2063|       |    /* output 12 */
 2064|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2065|  1.04k|    SQRADD2(a[5], a[7]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2066|  1.04k|    SQRADD(a[6], a[6]);
  ------------------
  |  |   82|  1.04k|    __asm__(                                \
  |  |   83|  1.04k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.04k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.04k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.04k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.04k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2067|  1.04k|    COMBA_STORE(b[12]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2068|       |
 2069|       |    /* output 13 */
 2070|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2071|  1.04k|    SQRADD2(a[6], a[7]);
  ------------------
  |  |   93|  1.04k|    __asm__(                                        \
  |  |   94|  1.04k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  1.04k|        "mulq  %7           \n\t"                   \
  |  |   96|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  1.04k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  1.04k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  1.04k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2072|  1.04k|    COMBA_STORE(b[13]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2073|       |
 2074|       |    /* output 14 */
 2075|  1.04k|    CARRY_FORWARD;
  ------------------
  |  |   73|  1.04k|    do {              \
  |  |   74|  1.04k|        c0 = c1;      \
  |  |   75|  1.04k|        c1 = c2;      \
  |  |   76|  1.04k|        c2 = 0;       \
  |  |   77|  1.04k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2076|  1.04k|    SQRADD(a[7], a[7]);
  ------------------
  |  |   82|  1.04k|    __asm__(                                \
  |  |   83|  1.04k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  1.04k|        "mulq  %%rax        \n\t"           \
  |  |   85|  1.04k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  1.04k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  1.04k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  1.04k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  1.04k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  1.04k|        : "%rax", "%rdx", "cc");
  ------------------
 2077|  1.04k|    COMBA_STORE(b[14]);
  ------------------
  |  |   67|  1.04k|    x = c0;
  ------------------
 2078|  1.04k|    COMBA_STORE2(b[15]);
  ------------------
  |  |   70|  1.04k|    x = c1;
  ------------------
 2079|  1.04k|    COMBA_FINI;
 2080|       |
 2081|  1.04k|    B->used = 16;
 2082|  1.04k|    B->sign = ZPOS;
  ------------------
  |  |  326|  1.04k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  1.04k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 2083|  1.04k|    memcpy(B->dp, b, 16 * sizeof(mp_digit));
 2084|  1.04k|    mp_clamp(B);
  ------------------
  |  |   26|  1.04k|    {                                                    \
  |  |   27|  1.53k|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 1.53k, False: 0]
  |  |  |  Branch (27:29): [True: 490, False: 1.04k]
  |  |  ------------------
  |  |   28|  1.04k|            --((a)->used);                               \
  |  |   29|  1.04k|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  1.04k|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 1.04k, False: 0]
  |  |  ------------------
  |  |   30|  1.04k|    }
  ------------------
 2085|  1.04k|}
s_mp_sqr_comba_16:
 2089|  41.9k|{
 2090|  41.9k|    mp_digit *a, b[32], c0, c1, c2, sc0, sc1, sc2;
 2091|       |
 2092|  41.9k|    a = A->dp;
 2093|  41.9k|    COMBA_START;
 2094|       |
 2095|       |    /* clear carries */
 2096|  41.9k|    CLEAR_CARRY;
  ------------------
  |  |   64|  41.9k|    c0 = c1 = c2 = 0;
  ------------------
 2097|       |
 2098|       |    /* output 0 */
 2099|  41.9k|    SQRADD(a[0], a[0]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2100|  41.9k|    COMBA_STORE(b[0]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2101|       |
 2102|       |    /* output 1 */
 2103|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2104|  41.9k|    SQRADD2(a[0], a[1]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2105|  41.9k|    COMBA_STORE(b[1]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2106|       |
 2107|       |    /* output 2 */
 2108|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2109|  41.9k|    SQRADD2(a[0], a[2]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2110|  41.9k|    SQRADD(a[1], a[1]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2111|  41.9k|    COMBA_STORE(b[2]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2112|       |
 2113|       |    /* output 3 */
 2114|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2115|  41.9k|    SQRADD2(a[0], a[3]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2116|  41.9k|    SQRADD2(a[1], a[2]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2117|  41.9k|    COMBA_STORE(b[3]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2118|       |
 2119|       |    /* output 4 */
 2120|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2121|  41.9k|    SQRADD2(a[0], a[4]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2122|  41.9k|    SQRADD2(a[1], a[3]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2123|  41.9k|    SQRADD(a[2], a[2]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2124|  41.9k|    COMBA_STORE(b[4]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2125|       |
 2126|       |    /* output 5 */
 2127|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2128|  41.9k|    SQRADDSC(a[0], a[5]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2129|  41.9k|    SQRADDAC(a[1], a[4]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2130|  41.9k|    SQRADDAC(a[2], a[3]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2131|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2132|  41.9k|    COMBA_STORE(b[5]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2133|       |
 2134|       |    /* output 6 */
 2135|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2136|  41.9k|    SQRADDSC(a[0], a[6]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2137|  41.9k|    SQRADDAC(a[1], a[5]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2138|  41.9k|    SQRADDAC(a[2], a[4]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2139|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2140|  41.9k|    SQRADD(a[3], a[3]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2141|  41.9k|    COMBA_STORE(b[6]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2142|       |
 2143|       |    /* output 7 */
 2144|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2145|  41.9k|    SQRADDSC(a[0], a[7]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2146|  41.9k|    SQRADDAC(a[1], a[6]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2147|  41.9k|    SQRADDAC(a[2], a[5]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2148|  41.9k|    SQRADDAC(a[3], a[4]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2149|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2150|  41.9k|    COMBA_STORE(b[7]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2151|       |
 2152|       |    /* output 8 */
 2153|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2154|  41.9k|    SQRADDSC(a[0], a[8]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2155|  41.9k|    SQRADDAC(a[1], a[7]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2156|  41.9k|    SQRADDAC(a[2], a[6]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2157|  41.9k|    SQRADDAC(a[3], a[5]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2158|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2159|  41.9k|    SQRADD(a[4], a[4]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2160|  41.9k|    COMBA_STORE(b[8]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2161|       |
 2162|       |    /* output 9 */
 2163|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2164|  41.9k|    SQRADDSC(a[0], a[9]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2165|  41.9k|    SQRADDAC(a[1], a[8]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2166|  41.9k|    SQRADDAC(a[2], a[7]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2167|  41.9k|    SQRADDAC(a[3], a[6]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2168|  41.9k|    SQRADDAC(a[4], a[5]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2169|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2170|  41.9k|    COMBA_STORE(b[9]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2171|       |
 2172|       |    /* output 10 */
 2173|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2174|  41.9k|    SQRADDSC(a[0], a[10]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2175|  41.9k|    SQRADDAC(a[1], a[9]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2176|  41.9k|    SQRADDAC(a[2], a[8]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2177|  41.9k|    SQRADDAC(a[3], a[7]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2178|  41.9k|    SQRADDAC(a[4], a[6]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2179|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2180|  41.9k|    SQRADD(a[5], a[5]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2181|  41.9k|    COMBA_STORE(b[10]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2182|       |
 2183|       |    /* output 11 */
 2184|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2185|  41.9k|    SQRADDSC(a[0], a[11]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2186|  41.9k|    SQRADDAC(a[1], a[10]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2187|  41.9k|    SQRADDAC(a[2], a[9]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2188|  41.9k|    SQRADDAC(a[3], a[8]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2189|  41.9k|    SQRADDAC(a[4], a[7]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2190|  41.9k|    SQRADDAC(a[5], a[6]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2191|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2192|  41.9k|    COMBA_STORE(b[11]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2193|       |
 2194|       |    /* output 12 */
 2195|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2196|  41.9k|    SQRADDSC(a[0], a[12]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2197|  41.9k|    SQRADDAC(a[1], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2198|  41.9k|    SQRADDAC(a[2], a[10]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2199|  41.9k|    SQRADDAC(a[3], a[9]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2200|  41.9k|    SQRADDAC(a[4], a[8]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2201|  41.9k|    SQRADDAC(a[5], a[7]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2202|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2203|  41.9k|    SQRADD(a[6], a[6]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2204|  41.9k|    COMBA_STORE(b[12]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2205|       |
 2206|       |    /* output 13 */
 2207|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2208|  41.9k|    SQRADDSC(a[0], a[13]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2209|  41.9k|    SQRADDAC(a[1], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2210|  41.9k|    SQRADDAC(a[2], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2211|  41.9k|    SQRADDAC(a[3], a[10]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2212|  41.9k|    SQRADDAC(a[4], a[9]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2213|  41.9k|    SQRADDAC(a[5], a[8]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2214|  41.9k|    SQRADDAC(a[6], a[7]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2215|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2216|  41.9k|    COMBA_STORE(b[13]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2217|       |
 2218|       |    /* output 14 */
 2219|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2220|  41.9k|    SQRADDSC(a[0], a[14]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2221|  41.9k|    SQRADDAC(a[1], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2222|  41.9k|    SQRADDAC(a[2], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2223|  41.9k|    SQRADDAC(a[3], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2224|  41.9k|    SQRADDAC(a[4], a[10]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2225|  41.9k|    SQRADDAC(a[5], a[9]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2226|  41.9k|    SQRADDAC(a[6], a[8]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2227|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2228|  41.9k|    SQRADD(a[7], a[7]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2229|  41.9k|    COMBA_STORE(b[14]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2230|       |
 2231|       |    /* output 15 */
 2232|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2233|  41.9k|    SQRADDSC(a[0], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2234|  41.9k|    SQRADDAC(a[1], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2235|  41.9k|    SQRADDAC(a[2], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2236|  41.9k|    SQRADDAC(a[3], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2237|  41.9k|    SQRADDAC(a[4], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2238|  41.9k|    SQRADDAC(a[5], a[10]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2239|  41.9k|    SQRADDAC(a[6], a[9]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2240|  41.9k|    SQRADDAC(a[7], a[8]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2241|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2242|  41.9k|    COMBA_STORE(b[15]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2243|       |
 2244|       |    /* output 16 */
 2245|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2246|  41.9k|    SQRADDSC(a[1], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2247|  41.9k|    SQRADDAC(a[2], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2248|  41.9k|    SQRADDAC(a[3], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2249|  41.9k|    SQRADDAC(a[4], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2250|  41.9k|    SQRADDAC(a[5], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2251|  41.9k|    SQRADDAC(a[6], a[10]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2252|  41.9k|    SQRADDAC(a[7], a[9]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2253|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2254|  41.9k|    SQRADD(a[8], a[8]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2255|  41.9k|    COMBA_STORE(b[16]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2256|       |
 2257|       |    /* output 17 */
 2258|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2259|  41.9k|    SQRADDSC(a[2], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2260|  41.9k|    SQRADDAC(a[3], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2261|  41.9k|    SQRADDAC(a[4], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2262|  41.9k|    SQRADDAC(a[5], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2263|  41.9k|    SQRADDAC(a[6], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2264|  41.9k|    SQRADDAC(a[7], a[10]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2265|  41.9k|    SQRADDAC(a[8], a[9]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2266|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2267|  41.9k|    COMBA_STORE(b[17]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2268|       |
 2269|       |    /* output 18 */
 2270|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2271|  41.9k|    SQRADDSC(a[3], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2272|  41.9k|    SQRADDAC(a[4], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2273|  41.9k|    SQRADDAC(a[5], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2274|  41.9k|    SQRADDAC(a[6], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2275|  41.9k|    SQRADDAC(a[7], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2276|  41.9k|    SQRADDAC(a[8], a[10]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2277|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2278|  41.9k|    SQRADD(a[9], a[9]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2279|  41.9k|    COMBA_STORE(b[18]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2280|       |
 2281|       |    /* output 19 */
 2282|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2283|  41.9k|    SQRADDSC(a[4], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2284|  41.9k|    SQRADDAC(a[5], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2285|  41.9k|    SQRADDAC(a[6], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2286|  41.9k|    SQRADDAC(a[7], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2287|  41.9k|    SQRADDAC(a[8], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2288|  41.9k|    SQRADDAC(a[9], a[10]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2289|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2290|  41.9k|    COMBA_STORE(b[19]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2291|       |
 2292|       |    /* output 20 */
 2293|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2294|  41.9k|    SQRADDSC(a[5], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2295|  41.9k|    SQRADDAC(a[6], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2296|  41.9k|    SQRADDAC(a[7], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2297|  41.9k|    SQRADDAC(a[8], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2298|  41.9k|    SQRADDAC(a[9], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2299|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2300|  41.9k|    SQRADD(a[10], a[10]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2301|  41.9k|    COMBA_STORE(b[20]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2302|       |
 2303|       |    /* output 21 */
 2304|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2305|  41.9k|    SQRADDSC(a[6], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2306|  41.9k|    SQRADDAC(a[7], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2307|  41.9k|    SQRADDAC(a[8], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2308|  41.9k|    SQRADDAC(a[9], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2309|  41.9k|    SQRADDAC(a[10], a[11]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2310|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2311|  41.9k|    COMBA_STORE(b[21]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2312|       |
 2313|       |    /* output 22 */
 2314|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2315|  41.9k|    SQRADDSC(a[7], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2316|  41.9k|    SQRADDAC(a[8], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2317|  41.9k|    SQRADDAC(a[9], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2318|  41.9k|    SQRADDAC(a[10], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2319|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2320|  41.9k|    SQRADD(a[11], a[11]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2321|  41.9k|    COMBA_STORE(b[22]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2322|       |
 2323|       |    /* output 23 */
 2324|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2325|  41.9k|    SQRADDSC(a[8], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2326|  41.9k|    SQRADDAC(a[9], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2327|  41.9k|    SQRADDAC(a[10], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2328|  41.9k|    SQRADDAC(a[11], a[12]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2329|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2330|  41.9k|    COMBA_STORE(b[23]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2331|       |
 2332|       |    /* output 24 */
 2333|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2334|  41.9k|    SQRADDSC(a[9], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2335|  41.9k|    SQRADDAC(a[10], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2336|  41.9k|    SQRADDAC(a[11], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2337|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2338|  41.9k|    SQRADD(a[12], a[12]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2339|  41.9k|    COMBA_STORE(b[24]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2340|       |
 2341|       |    /* output 25 */
 2342|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2343|  41.9k|    SQRADDSC(a[10], a[15]);
  ------------------
  |  |  107|  41.9k|    __asm__(                              \
  |  |  108|  41.9k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|  41.9k|        "mulq  %4           \n\t"         \
  |  |  110|  41.9k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|  41.9k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|  41.9k|        "xorq  %2,%2        \n\t"         \
  |  |  113|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|  41.9k|        : "g"(i), "g"(j)                  \
  |  |  115|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2344|  41.9k|    SQRADDAC(a[11], a[14]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2345|  41.9k|    SQRADDAC(a[12], a[13]);
  ------------------
  |  |  118|  41.9k|    __asm__(                                           \
  |  |  119|  41.9k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|  41.9k|        "mulq  %7           \n\t"                      \
  |  |  121|  41.9k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|  41.9k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|  41.9k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|  41.9k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|  41.9k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2346|  41.9k|    SQRADDDB;
  ------------------
  |  |  129|  41.9k|    __asm__(                                                      \
  |  |  130|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  131|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|  41.9k|        "addq %6,%0         \n\t"                                 \
  |  |  134|  41.9k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|  41.9k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|  41.9k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|  41.9k|        : "cc");
  ------------------
 2347|  41.9k|    COMBA_STORE(b[25]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2348|       |
 2349|       |    /* output 26 */
 2350|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2351|  41.9k|    SQRADD2(a[11], a[15]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2352|  41.9k|    SQRADD2(a[12], a[14]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2353|  41.9k|    SQRADD(a[13], a[13]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2354|  41.9k|    COMBA_STORE(b[26]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2355|       |
 2356|       |    /* output 27 */
 2357|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2358|  41.9k|    SQRADD2(a[12], a[15]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2359|  41.9k|    SQRADD2(a[13], a[14]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2360|  41.9k|    COMBA_STORE(b[27]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2361|       |
 2362|       |    /* output 28 */
 2363|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2364|  41.9k|    SQRADD2(a[13], a[15]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2365|  41.9k|    SQRADD(a[14], a[14]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2366|  41.9k|    COMBA_STORE(b[28]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2367|       |
 2368|       |    /* output 29 */
 2369|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2370|  41.9k|    SQRADD2(a[14], a[15]);
  ------------------
  |  |   93|  41.9k|    __asm__(                                        \
  |  |   94|  41.9k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|  41.9k|        "mulq  %7           \n\t"                   \
  |  |   96|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|  41.9k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|  41.9k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|  41.9k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2371|  41.9k|    COMBA_STORE(b[29]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2372|       |
 2373|       |    /* output 30 */
 2374|  41.9k|    CARRY_FORWARD;
  ------------------
  |  |   73|  41.9k|    do {              \
  |  |   74|  41.9k|        c0 = c1;      \
  |  |   75|  41.9k|        c1 = c2;      \
  |  |   76|  41.9k|        c2 = 0;       \
  |  |   77|  41.9k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2375|  41.9k|    SQRADD(a[15], a[15]);
  ------------------
  |  |   82|  41.9k|    __asm__(                                \
  |  |   83|  41.9k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|  41.9k|        "mulq  %%rax        \n\t"           \
  |  |   85|  41.9k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|  41.9k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|  41.9k|        "adcq  $0,%2        \n\t"           \
  |  |   88|  41.9k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|  41.9k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|  41.9k|        : "%rax", "%rdx", "cc");
  ------------------
 2376|  41.9k|    COMBA_STORE(b[30]);
  ------------------
  |  |   67|  41.9k|    x = c0;
  ------------------
 2377|  41.9k|    COMBA_STORE2(b[31]);
  ------------------
  |  |   70|  41.9k|    x = c1;
  ------------------
 2378|  41.9k|    COMBA_FINI;
 2379|       |
 2380|  41.9k|    B->used = 32;
 2381|  41.9k|    B->sign = ZPOS;
  ------------------
  |  |  326|  41.9k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  41.9k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 2382|  41.9k|    memcpy(B->dp, b, 32 * sizeof(mp_digit));
 2383|  41.9k|    mp_clamp(B);
  ------------------
  |  |   26|  41.9k|    {                                                    \
  |  |   27|  42.7k|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 42.7k, False: 0]
  |  |  |  Branch (27:29): [True: 757, False: 41.9k]
  |  |  ------------------
  |  |   28|  41.9k|            --((a)->used);                               \
  |  |   29|  41.9k|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  41.9k|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 41.9k, False: 0]
  |  |  ------------------
  |  |   30|  41.9k|    }
  ------------------
 2384|  41.9k|}
s_mp_sqr_comba_32:
 2388|   633k|{
 2389|   633k|    mp_digit *a, b[64], c0, c1, c2, sc0, sc1, sc2;
 2390|       |
 2391|   633k|    a = A->dp;
 2392|   633k|    COMBA_START;
 2393|       |
 2394|       |    /* clear carries */
 2395|   633k|    CLEAR_CARRY;
  ------------------
  |  |   64|   633k|    c0 = c1 = c2 = 0;
  ------------------
 2396|       |
 2397|       |    /* output 0 */
 2398|   633k|    SQRADD(a[0], a[0]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2399|   633k|    COMBA_STORE(b[0]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2400|       |
 2401|       |    /* output 1 */
 2402|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2403|   633k|    SQRADD2(a[0], a[1]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2404|   633k|    COMBA_STORE(b[1]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2405|       |
 2406|       |    /* output 2 */
 2407|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2408|   633k|    SQRADD2(a[0], a[2]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2409|   633k|    SQRADD(a[1], a[1]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2410|   633k|    COMBA_STORE(b[2]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2411|       |
 2412|       |    /* output 3 */
 2413|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2414|   633k|    SQRADD2(a[0], a[3]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2415|   633k|    SQRADD2(a[1], a[2]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2416|   633k|    COMBA_STORE(b[3]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2417|       |
 2418|       |    /* output 4 */
 2419|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2420|   633k|    SQRADD2(a[0], a[4]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2421|   633k|    SQRADD2(a[1], a[3]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2422|   633k|    SQRADD(a[2], a[2]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2423|   633k|    COMBA_STORE(b[4]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2424|       |
 2425|       |    /* output 5 */
 2426|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2427|   633k|    SQRADDSC(a[0], a[5]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2428|   633k|    SQRADDAC(a[1], a[4]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2429|   633k|    SQRADDAC(a[2], a[3]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2430|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2431|   633k|    COMBA_STORE(b[5]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2432|       |
 2433|       |    /* output 6 */
 2434|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2435|   633k|    SQRADDSC(a[0], a[6]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2436|   633k|    SQRADDAC(a[1], a[5]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2437|   633k|    SQRADDAC(a[2], a[4]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2438|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2439|   633k|    SQRADD(a[3], a[3]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2440|   633k|    COMBA_STORE(b[6]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2441|       |
 2442|       |    /* output 7 */
 2443|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2444|   633k|    SQRADDSC(a[0], a[7]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2445|   633k|    SQRADDAC(a[1], a[6]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2446|   633k|    SQRADDAC(a[2], a[5]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2447|   633k|    SQRADDAC(a[3], a[4]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2448|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2449|   633k|    COMBA_STORE(b[7]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2450|       |
 2451|       |    /* output 8 */
 2452|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2453|   633k|    SQRADDSC(a[0], a[8]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2454|   633k|    SQRADDAC(a[1], a[7]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2455|   633k|    SQRADDAC(a[2], a[6]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2456|   633k|    SQRADDAC(a[3], a[5]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2457|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2458|   633k|    SQRADD(a[4], a[4]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2459|   633k|    COMBA_STORE(b[8]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2460|       |
 2461|       |    /* output 9 */
 2462|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2463|   633k|    SQRADDSC(a[0], a[9]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2464|   633k|    SQRADDAC(a[1], a[8]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2465|   633k|    SQRADDAC(a[2], a[7]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2466|   633k|    SQRADDAC(a[3], a[6]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2467|   633k|    SQRADDAC(a[4], a[5]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2468|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2469|   633k|    COMBA_STORE(b[9]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2470|       |
 2471|       |    /* output 10 */
 2472|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2473|   633k|    SQRADDSC(a[0], a[10]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2474|   633k|    SQRADDAC(a[1], a[9]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2475|   633k|    SQRADDAC(a[2], a[8]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2476|   633k|    SQRADDAC(a[3], a[7]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2477|   633k|    SQRADDAC(a[4], a[6]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2478|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2479|   633k|    SQRADD(a[5], a[5]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2480|   633k|    COMBA_STORE(b[10]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2481|       |
 2482|       |    /* output 11 */
 2483|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2484|   633k|    SQRADDSC(a[0], a[11]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2485|   633k|    SQRADDAC(a[1], a[10]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2486|   633k|    SQRADDAC(a[2], a[9]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2487|   633k|    SQRADDAC(a[3], a[8]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2488|   633k|    SQRADDAC(a[4], a[7]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2489|   633k|    SQRADDAC(a[5], a[6]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2490|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2491|   633k|    COMBA_STORE(b[11]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2492|       |
 2493|       |    /* output 12 */
 2494|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2495|   633k|    SQRADDSC(a[0], a[12]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2496|   633k|    SQRADDAC(a[1], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2497|   633k|    SQRADDAC(a[2], a[10]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2498|   633k|    SQRADDAC(a[3], a[9]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2499|   633k|    SQRADDAC(a[4], a[8]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2500|   633k|    SQRADDAC(a[5], a[7]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2501|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2502|   633k|    SQRADD(a[6], a[6]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2503|   633k|    COMBA_STORE(b[12]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2504|       |
 2505|       |    /* output 13 */
 2506|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2507|   633k|    SQRADDSC(a[0], a[13]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2508|   633k|    SQRADDAC(a[1], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2509|   633k|    SQRADDAC(a[2], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2510|   633k|    SQRADDAC(a[3], a[10]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2511|   633k|    SQRADDAC(a[4], a[9]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2512|   633k|    SQRADDAC(a[5], a[8]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2513|   633k|    SQRADDAC(a[6], a[7]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2514|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2515|   633k|    COMBA_STORE(b[13]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2516|       |
 2517|       |    /* output 14 */
 2518|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2519|   633k|    SQRADDSC(a[0], a[14]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2520|   633k|    SQRADDAC(a[1], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2521|   633k|    SQRADDAC(a[2], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2522|   633k|    SQRADDAC(a[3], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2523|   633k|    SQRADDAC(a[4], a[10]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2524|   633k|    SQRADDAC(a[5], a[9]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2525|   633k|    SQRADDAC(a[6], a[8]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2526|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2527|   633k|    SQRADD(a[7], a[7]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2528|   633k|    COMBA_STORE(b[14]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2529|       |
 2530|       |    /* output 15 */
 2531|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2532|   633k|    SQRADDSC(a[0], a[15]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2533|   633k|    SQRADDAC(a[1], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2534|   633k|    SQRADDAC(a[2], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2535|   633k|    SQRADDAC(a[3], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2536|   633k|    SQRADDAC(a[4], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2537|   633k|    SQRADDAC(a[5], a[10]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2538|   633k|    SQRADDAC(a[6], a[9]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2539|   633k|    SQRADDAC(a[7], a[8]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2540|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2541|   633k|    COMBA_STORE(b[15]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2542|       |
 2543|       |    /* output 16 */
 2544|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2545|   633k|    SQRADDSC(a[0], a[16]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2546|   633k|    SQRADDAC(a[1], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2547|   633k|    SQRADDAC(a[2], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2548|   633k|    SQRADDAC(a[3], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2549|   633k|    SQRADDAC(a[4], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2550|   633k|    SQRADDAC(a[5], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2551|   633k|    SQRADDAC(a[6], a[10]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2552|   633k|    SQRADDAC(a[7], a[9]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2553|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2554|   633k|    SQRADD(a[8], a[8]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2555|   633k|    COMBA_STORE(b[16]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2556|       |
 2557|       |    /* output 17 */
 2558|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2559|   633k|    SQRADDSC(a[0], a[17]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2560|   633k|    SQRADDAC(a[1], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2561|   633k|    SQRADDAC(a[2], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2562|   633k|    SQRADDAC(a[3], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2563|   633k|    SQRADDAC(a[4], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2564|   633k|    SQRADDAC(a[5], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2565|   633k|    SQRADDAC(a[6], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2566|   633k|    SQRADDAC(a[7], a[10]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2567|   633k|    SQRADDAC(a[8], a[9]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2568|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2569|   633k|    COMBA_STORE(b[17]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2570|       |
 2571|       |    /* output 18 */
 2572|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2573|   633k|    SQRADDSC(a[0], a[18]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2574|   633k|    SQRADDAC(a[1], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2575|   633k|    SQRADDAC(a[2], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2576|   633k|    SQRADDAC(a[3], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2577|   633k|    SQRADDAC(a[4], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2578|   633k|    SQRADDAC(a[5], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2579|   633k|    SQRADDAC(a[6], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2580|   633k|    SQRADDAC(a[7], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2581|   633k|    SQRADDAC(a[8], a[10]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2582|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2583|   633k|    SQRADD(a[9], a[9]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2584|   633k|    COMBA_STORE(b[18]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2585|       |
 2586|       |    /* output 19 */
 2587|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2588|   633k|    SQRADDSC(a[0], a[19]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2589|   633k|    SQRADDAC(a[1], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2590|   633k|    SQRADDAC(a[2], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2591|   633k|    SQRADDAC(a[3], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2592|   633k|    SQRADDAC(a[4], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2593|   633k|    SQRADDAC(a[5], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2594|   633k|    SQRADDAC(a[6], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2595|   633k|    SQRADDAC(a[7], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2596|   633k|    SQRADDAC(a[8], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2597|   633k|    SQRADDAC(a[9], a[10]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2598|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2599|   633k|    COMBA_STORE(b[19]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2600|       |
 2601|       |    /* output 20 */
 2602|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2603|   633k|    SQRADDSC(a[0], a[20]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2604|   633k|    SQRADDAC(a[1], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2605|   633k|    SQRADDAC(a[2], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2606|   633k|    SQRADDAC(a[3], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2607|   633k|    SQRADDAC(a[4], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2608|   633k|    SQRADDAC(a[5], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2609|   633k|    SQRADDAC(a[6], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2610|   633k|    SQRADDAC(a[7], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2611|   633k|    SQRADDAC(a[8], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2612|   633k|    SQRADDAC(a[9], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2613|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2614|   633k|    SQRADD(a[10], a[10]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2615|   633k|    COMBA_STORE(b[20]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2616|       |
 2617|       |    /* output 21 */
 2618|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2619|   633k|    SQRADDSC(a[0], a[21]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2620|   633k|    SQRADDAC(a[1], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2621|   633k|    SQRADDAC(a[2], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2622|   633k|    SQRADDAC(a[3], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2623|   633k|    SQRADDAC(a[4], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2624|   633k|    SQRADDAC(a[5], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2625|   633k|    SQRADDAC(a[6], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2626|   633k|    SQRADDAC(a[7], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2627|   633k|    SQRADDAC(a[8], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2628|   633k|    SQRADDAC(a[9], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2629|   633k|    SQRADDAC(a[10], a[11]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2630|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2631|   633k|    COMBA_STORE(b[21]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2632|       |
 2633|       |    /* output 22 */
 2634|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2635|   633k|    SQRADDSC(a[0], a[22]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2636|   633k|    SQRADDAC(a[1], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2637|   633k|    SQRADDAC(a[2], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2638|   633k|    SQRADDAC(a[3], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2639|   633k|    SQRADDAC(a[4], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2640|   633k|    SQRADDAC(a[5], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2641|   633k|    SQRADDAC(a[6], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2642|   633k|    SQRADDAC(a[7], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2643|   633k|    SQRADDAC(a[8], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2644|   633k|    SQRADDAC(a[9], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2645|   633k|    SQRADDAC(a[10], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2646|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2647|   633k|    SQRADD(a[11], a[11]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2648|   633k|    COMBA_STORE(b[22]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2649|       |
 2650|       |    /* output 23 */
 2651|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2652|   633k|    SQRADDSC(a[0], a[23]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2653|   633k|    SQRADDAC(a[1], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2654|   633k|    SQRADDAC(a[2], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2655|   633k|    SQRADDAC(a[3], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2656|   633k|    SQRADDAC(a[4], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2657|   633k|    SQRADDAC(a[5], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2658|   633k|    SQRADDAC(a[6], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2659|   633k|    SQRADDAC(a[7], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2660|   633k|    SQRADDAC(a[8], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2661|   633k|    SQRADDAC(a[9], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2662|   633k|    SQRADDAC(a[10], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2663|   633k|    SQRADDAC(a[11], a[12]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2664|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2665|   633k|    COMBA_STORE(b[23]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2666|       |
 2667|       |    /* output 24 */
 2668|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2669|   633k|    SQRADDSC(a[0], a[24]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2670|   633k|    SQRADDAC(a[1], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2671|   633k|    SQRADDAC(a[2], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2672|   633k|    SQRADDAC(a[3], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2673|   633k|    SQRADDAC(a[4], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2674|   633k|    SQRADDAC(a[5], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2675|   633k|    SQRADDAC(a[6], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2676|   633k|    SQRADDAC(a[7], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2677|   633k|    SQRADDAC(a[8], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2678|   633k|    SQRADDAC(a[9], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2679|   633k|    SQRADDAC(a[10], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2680|   633k|    SQRADDAC(a[11], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2681|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2682|   633k|    SQRADD(a[12], a[12]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2683|   633k|    COMBA_STORE(b[24]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2684|       |
 2685|       |    /* output 25 */
 2686|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2687|   633k|    SQRADDSC(a[0], a[25]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2688|   633k|    SQRADDAC(a[1], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2689|   633k|    SQRADDAC(a[2], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2690|   633k|    SQRADDAC(a[3], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2691|   633k|    SQRADDAC(a[4], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2692|   633k|    SQRADDAC(a[5], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2693|   633k|    SQRADDAC(a[6], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2694|   633k|    SQRADDAC(a[7], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2695|   633k|    SQRADDAC(a[8], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2696|   633k|    SQRADDAC(a[9], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2697|   633k|    SQRADDAC(a[10], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2698|   633k|    SQRADDAC(a[11], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2699|   633k|    SQRADDAC(a[12], a[13]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2700|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2701|   633k|    COMBA_STORE(b[25]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2702|       |
 2703|       |    /* output 26 */
 2704|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2705|   633k|    SQRADDSC(a[0], a[26]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2706|   633k|    SQRADDAC(a[1], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2707|   633k|    SQRADDAC(a[2], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2708|   633k|    SQRADDAC(a[3], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2709|   633k|    SQRADDAC(a[4], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2710|   633k|    SQRADDAC(a[5], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2711|   633k|    SQRADDAC(a[6], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2712|   633k|    SQRADDAC(a[7], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2713|   633k|    SQRADDAC(a[8], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2714|   633k|    SQRADDAC(a[9], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2715|   633k|    SQRADDAC(a[10], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2716|   633k|    SQRADDAC(a[11], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2717|   633k|    SQRADDAC(a[12], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2718|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2719|   633k|    SQRADD(a[13], a[13]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2720|   633k|    COMBA_STORE(b[26]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2721|       |
 2722|       |    /* output 27 */
 2723|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2724|   633k|    SQRADDSC(a[0], a[27]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2725|   633k|    SQRADDAC(a[1], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2726|   633k|    SQRADDAC(a[2], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2727|   633k|    SQRADDAC(a[3], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2728|   633k|    SQRADDAC(a[4], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2729|   633k|    SQRADDAC(a[5], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2730|   633k|    SQRADDAC(a[6], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2731|   633k|    SQRADDAC(a[7], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2732|   633k|    SQRADDAC(a[8], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2733|   633k|    SQRADDAC(a[9], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2734|   633k|    SQRADDAC(a[10], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2735|   633k|    SQRADDAC(a[11], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2736|   633k|    SQRADDAC(a[12], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2737|   633k|    SQRADDAC(a[13], a[14]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2738|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2739|   633k|    COMBA_STORE(b[27]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2740|       |
 2741|       |    /* output 28 */
 2742|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2743|   633k|    SQRADDSC(a[0], a[28]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2744|   633k|    SQRADDAC(a[1], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2745|   633k|    SQRADDAC(a[2], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2746|   633k|    SQRADDAC(a[3], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2747|   633k|    SQRADDAC(a[4], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2748|   633k|    SQRADDAC(a[5], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2749|   633k|    SQRADDAC(a[6], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2750|   633k|    SQRADDAC(a[7], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2751|   633k|    SQRADDAC(a[8], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2752|   633k|    SQRADDAC(a[9], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2753|   633k|    SQRADDAC(a[10], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2754|   633k|    SQRADDAC(a[11], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2755|   633k|    SQRADDAC(a[12], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2756|   633k|    SQRADDAC(a[13], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2757|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2758|   633k|    SQRADD(a[14], a[14]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2759|   633k|    COMBA_STORE(b[28]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2760|       |
 2761|       |    /* output 29 */
 2762|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2763|   633k|    SQRADDSC(a[0], a[29]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2764|   633k|    SQRADDAC(a[1], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2765|   633k|    SQRADDAC(a[2], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2766|   633k|    SQRADDAC(a[3], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2767|   633k|    SQRADDAC(a[4], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2768|   633k|    SQRADDAC(a[5], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2769|   633k|    SQRADDAC(a[6], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2770|   633k|    SQRADDAC(a[7], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2771|   633k|    SQRADDAC(a[8], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2772|   633k|    SQRADDAC(a[9], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2773|   633k|    SQRADDAC(a[10], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2774|   633k|    SQRADDAC(a[11], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2775|   633k|    SQRADDAC(a[12], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2776|   633k|    SQRADDAC(a[13], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2777|   633k|    SQRADDAC(a[14], a[15]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2778|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2779|   633k|    COMBA_STORE(b[29]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2780|       |
 2781|       |    /* output 30 */
 2782|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2783|   633k|    SQRADDSC(a[0], a[30]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2784|   633k|    SQRADDAC(a[1], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2785|   633k|    SQRADDAC(a[2], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2786|   633k|    SQRADDAC(a[3], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2787|   633k|    SQRADDAC(a[4], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2788|   633k|    SQRADDAC(a[5], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2789|   633k|    SQRADDAC(a[6], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2790|   633k|    SQRADDAC(a[7], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2791|   633k|    SQRADDAC(a[8], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2792|   633k|    SQRADDAC(a[9], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2793|   633k|    SQRADDAC(a[10], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2794|   633k|    SQRADDAC(a[11], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2795|   633k|    SQRADDAC(a[12], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2796|   633k|    SQRADDAC(a[13], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2797|   633k|    SQRADDAC(a[14], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2798|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2799|   633k|    SQRADD(a[15], a[15]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2800|   633k|    COMBA_STORE(b[30]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2801|       |
 2802|       |    /* output 31 */
 2803|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2804|   633k|    SQRADDSC(a[0], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2805|   633k|    SQRADDAC(a[1], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2806|   633k|    SQRADDAC(a[2], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2807|   633k|    SQRADDAC(a[3], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2808|   633k|    SQRADDAC(a[4], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2809|   633k|    SQRADDAC(a[5], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2810|   633k|    SQRADDAC(a[6], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2811|   633k|    SQRADDAC(a[7], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2812|   633k|    SQRADDAC(a[8], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2813|   633k|    SQRADDAC(a[9], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2814|   633k|    SQRADDAC(a[10], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2815|   633k|    SQRADDAC(a[11], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2816|   633k|    SQRADDAC(a[12], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2817|   633k|    SQRADDAC(a[13], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2818|   633k|    SQRADDAC(a[14], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2819|   633k|    SQRADDAC(a[15], a[16]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2820|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2821|   633k|    COMBA_STORE(b[31]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2822|       |
 2823|       |    /* output 32 */
 2824|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2825|   633k|    SQRADDSC(a[1], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2826|   633k|    SQRADDAC(a[2], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2827|   633k|    SQRADDAC(a[3], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2828|   633k|    SQRADDAC(a[4], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2829|   633k|    SQRADDAC(a[5], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2830|   633k|    SQRADDAC(a[6], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2831|   633k|    SQRADDAC(a[7], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2832|   633k|    SQRADDAC(a[8], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2833|   633k|    SQRADDAC(a[9], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2834|   633k|    SQRADDAC(a[10], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2835|   633k|    SQRADDAC(a[11], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2836|   633k|    SQRADDAC(a[12], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2837|   633k|    SQRADDAC(a[13], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2838|   633k|    SQRADDAC(a[14], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2839|   633k|    SQRADDAC(a[15], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2840|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2841|   633k|    SQRADD(a[16], a[16]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2842|   633k|    COMBA_STORE(b[32]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2843|       |
 2844|       |    /* output 33 */
 2845|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2846|   633k|    SQRADDSC(a[2], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2847|   633k|    SQRADDAC(a[3], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2848|   633k|    SQRADDAC(a[4], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2849|   633k|    SQRADDAC(a[5], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2850|   633k|    SQRADDAC(a[6], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2851|   633k|    SQRADDAC(a[7], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2852|   633k|    SQRADDAC(a[8], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2853|   633k|    SQRADDAC(a[9], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2854|   633k|    SQRADDAC(a[10], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2855|   633k|    SQRADDAC(a[11], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2856|   633k|    SQRADDAC(a[12], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2857|   633k|    SQRADDAC(a[13], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2858|   633k|    SQRADDAC(a[14], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2859|   633k|    SQRADDAC(a[15], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2860|   633k|    SQRADDAC(a[16], a[17]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2861|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2862|   633k|    COMBA_STORE(b[33]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2863|       |
 2864|       |    /* output 34 */
 2865|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2866|   633k|    SQRADDSC(a[3], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2867|   633k|    SQRADDAC(a[4], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2868|   633k|    SQRADDAC(a[5], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2869|   633k|    SQRADDAC(a[6], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2870|   633k|    SQRADDAC(a[7], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2871|   633k|    SQRADDAC(a[8], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2872|   633k|    SQRADDAC(a[9], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2873|   633k|    SQRADDAC(a[10], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2874|   633k|    SQRADDAC(a[11], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2875|   633k|    SQRADDAC(a[12], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2876|   633k|    SQRADDAC(a[13], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2877|   633k|    SQRADDAC(a[14], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2878|   633k|    SQRADDAC(a[15], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2879|   633k|    SQRADDAC(a[16], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2880|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2881|   633k|    SQRADD(a[17], a[17]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2882|   633k|    COMBA_STORE(b[34]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2883|       |
 2884|       |    /* output 35 */
 2885|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2886|   633k|    SQRADDSC(a[4], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2887|   633k|    SQRADDAC(a[5], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2888|   633k|    SQRADDAC(a[6], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2889|   633k|    SQRADDAC(a[7], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2890|   633k|    SQRADDAC(a[8], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2891|   633k|    SQRADDAC(a[9], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2892|   633k|    SQRADDAC(a[10], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2893|   633k|    SQRADDAC(a[11], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2894|   633k|    SQRADDAC(a[12], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2895|   633k|    SQRADDAC(a[13], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2896|   633k|    SQRADDAC(a[14], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2897|   633k|    SQRADDAC(a[15], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2898|   633k|    SQRADDAC(a[16], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2899|   633k|    SQRADDAC(a[17], a[18]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2900|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2901|   633k|    COMBA_STORE(b[35]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2902|       |
 2903|       |    /* output 36 */
 2904|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2905|   633k|    SQRADDSC(a[5], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2906|   633k|    SQRADDAC(a[6], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2907|   633k|    SQRADDAC(a[7], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2908|   633k|    SQRADDAC(a[8], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2909|   633k|    SQRADDAC(a[9], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2910|   633k|    SQRADDAC(a[10], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2911|   633k|    SQRADDAC(a[11], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2912|   633k|    SQRADDAC(a[12], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2913|   633k|    SQRADDAC(a[13], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2914|   633k|    SQRADDAC(a[14], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2915|   633k|    SQRADDAC(a[15], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2916|   633k|    SQRADDAC(a[16], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2917|   633k|    SQRADDAC(a[17], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2918|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2919|   633k|    SQRADD(a[18], a[18]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2920|   633k|    COMBA_STORE(b[36]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2921|       |
 2922|       |    /* output 37 */
 2923|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2924|   633k|    SQRADDSC(a[6], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2925|   633k|    SQRADDAC(a[7], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2926|   633k|    SQRADDAC(a[8], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2927|   633k|    SQRADDAC(a[9], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2928|   633k|    SQRADDAC(a[10], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2929|   633k|    SQRADDAC(a[11], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2930|   633k|    SQRADDAC(a[12], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2931|   633k|    SQRADDAC(a[13], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2932|   633k|    SQRADDAC(a[14], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2933|   633k|    SQRADDAC(a[15], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2934|   633k|    SQRADDAC(a[16], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2935|   633k|    SQRADDAC(a[17], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2936|   633k|    SQRADDAC(a[18], a[19]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2937|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2938|   633k|    COMBA_STORE(b[37]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2939|       |
 2940|       |    /* output 38 */
 2941|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2942|   633k|    SQRADDSC(a[7], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2943|   633k|    SQRADDAC(a[8], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2944|   633k|    SQRADDAC(a[9], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2945|   633k|    SQRADDAC(a[10], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2946|   633k|    SQRADDAC(a[11], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2947|   633k|    SQRADDAC(a[12], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2948|   633k|    SQRADDAC(a[13], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2949|   633k|    SQRADDAC(a[14], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2950|   633k|    SQRADDAC(a[15], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2951|   633k|    SQRADDAC(a[16], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2952|   633k|    SQRADDAC(a[17], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2953|   633k|    SQRADDAC(a[18], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2954|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2955|   633k|    SQRADD(a[19], a[19]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2956|   633k|    COMBA_STORE(b[38]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2957|       |
 2958|       |    /* output 39 */
 2959|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2960|   633k|    SQRADDSC(a[8], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2961|   633k|    SQRADDAC(a[9], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2962|   633k|    SQRADDAC(a[10], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2963|   633k|    SQRADDAC(a[11], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2964|   633k|    SQRADDAC(a[12], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2965|   633k|    SQRADDAC(a[13], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2966|   633k|    SQRADDAC(a[14], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2967|   633k|    SQRADDAC(a[15], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2968|   633k|    SQRADDAC(a[16], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2969|   633k|    SQRADDAC(a[17], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2970|   633k|    SQRADDAC(a[18], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2971|   633k|    SQRADDAC(a[19], a[20]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2972|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2973|   633k|    COMBA_STORE(b[39]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2974|       |
 2975|       |    /* output 40 */
 2976|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2977|   633k|    SQRADDSC(a[9], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2978|   633k|    SQRADDAC(a[10], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2979|   633k|    SQRADDAC(a[11], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2980|   633k|    SQRADDAC(a[12], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2981|   633k|    SQRADDAC(a[13], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2982|   633k|    SQRADDAC(a[14], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2983|   633k|    SQRADDAC(a[15], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2984|   633k|    SQRADDAC(a[16], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2985|   633k|    SQRADDAC(a[17], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2986|   633k|    SQRADDAC(a[18], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2987|   633k|    SQRADDAC(a[19], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2988|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 2989|   633k|    SQRADD(a[20], a[20]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2990|   633k|    COMBA_STORE(b[40]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 2991|       |
 2992|       |    /* output 41 */
 2993|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2994|   633k|    SQRADDSC(a[10], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2995|   633k|    SQRADDAC(a[11], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2996|   633k|    SQRADDAC(a[12], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2997|   633k|    SQRADDAC(a[13], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2998|   633k|    SQRADDAC(a[14], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 2999|   633k|    SQRADDAC(a[15], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3000|   633k|    SQRADDAC(a[16], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3001|   633k|    SQRADDAC(a[17], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3002|   633k|    SQRADDAC(a[18], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3003|   633k|    SQRADDAC(a[19], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3004|   633k|    SQRADDAC(a[20], a[21]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3005|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3006|   633k|    COMBA_STORE(b[41]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3007|       |
 3008|       |    /* output 42 */
 3009|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3010|   633k|    SQRADDSC(a[11], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3011|   633k|    SQRADDAC(a[12], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3012|   633k|    SQRADDAC(a[13], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3013|   633k|    SQRADDAC(a[14], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3014|   633k|    SQRADDAC(a[15], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3015|   633k|    SQRADDAC(a[16], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3016|   633k|    SQRADDAC(a[17], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3017|   633k|    SQRADDAC(a[18], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3018|   633k|    SQRADDAC(a[19], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3019|   633k|    SQRADDAC(a[20], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3020|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3021|   633k|    SQRADD(a[21], a[21]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3022|   633k|    COMBA_STORE(b[42]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3023|       |
 3024|       |    /* output 43 */
 3025|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3026|   633k|    SQRADDSC(a[12], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3027|   633k|    SQRADDAC(a[13], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3028|   633k|    SQRADDAC(a[14], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3029|   633k|    SQRADDAC(a[15], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3030|   633k|    SQRADDAC(a[16], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3031|   633k|    SQRADDAC(a[17], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3032|   633k|    SQRADDAC(a[18], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3033|   633k|    SQRADDAC(a[19], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3034|   633k|    SQRADDAC(a[20], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3035|   633k|    SQRADDAC(a[21], a[22]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3036|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3037|   633k|    COMBA_STORE(b[43]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3038|       |
 3039|       |    /* output 44 */
 3040|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3041|   633k|    SQRADDSC(a[13], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3042|   633k|    SQRADDAC(a[14], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3043|   633k|    SQRADDAC(a[15], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3044|   633k|    SQRADDAC(a[16], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3045|   633k|    SQRADDAC(a[17], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3046|   633k|    SQRADDAC(a[18], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3047|   633k|    SQRADDAC(a[19], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3048|   633k|    SQRADDAC(a[20], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3049|   633k|    SQRADDAC(a[21], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3050|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3051|   633k|    SQRADD(a[22], a[22]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3052|   633k|    COMBA_STORE(b[44]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3053|       |
 3054|       |    /* output 45 */
 3055|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3056|   633k|    SQRADDSC(a[14], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3057|   633k|    SQRADDAC(a[15], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3058|   633k|    SQRADDAC(a[16], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3059|   633k|    SQRADDAC(a[17], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3060|   633k|    SQRADDAC(a[18], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3061|   633k|    SQRADDAC(a[19], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3062|   633k|    SQRADDAC(a[20], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3063|   633k|    SQRADDAC(a[21], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3064|   633k|    SQRADDAC(a[22], a[23]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3065|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3066|   633k|    COMBA_STORE(b[45]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3067|       |
 3068|       |    /* output 46 */
 3069|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3070|   633k|    SQRADDSC(a[15], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3071|   633k|    SQRADDAC(a[16], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3072|   633k|    SQRADDAC(a[17], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3073|   633k|    SQRADDAC(a[18], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3074|   633k|    SQRADDAC(a[19], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3075|   633k|    SQRADDAC(a[20], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3076|   633k|    SQRADDAC(a[21], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3077|   633k|    SQRADDAC(a[22], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3078|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3079|   633k|    SQRADD(a[23], a[23]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3080|   633k|    COMBA_STORE(b[46]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3081|       |
 3082|       |    /* output 47 */
 3083|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3084|   633k|    SQRADDSC(a[16], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3085|   633k|    SQRADDAC(a[17], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3086|   633k|    SQRADDAC(a[18], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3087|   633k|    SQRADDAC(a[19], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3088|   633k|    SQRADDAC(a[20], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3089|   633k|    SQRADDAC(a[21], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3090|   633k|    SQRADDAC(a[22], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3091|   633k|    SQRADDAC(a[23], a[24]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3092|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3093|   633k|    COMBA_STORE(b[47]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3094|       |
 3095|       |    /* output 48 */
 3096|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3097|   633k|    SQRADDSC(a[17], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3098|   633k|    SQRADDAC(a[18], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3099|   633k|    SQRADDAC(a[19], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3100|   633k|    SQRADDAC(a[20], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3101|   633k|    SQRADDAC(a[21], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3102|   633k|    SQRADDAC(a[22], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3103|   633k|    SQRADDAC(a[23], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3104|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3105|   633k|    SQRADD(a[24], a[24]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3106|   633k|    COMBA_STORE(b[48]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3107|       |
 3108|       |    /* output 49 */
 3109|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3110|   633k|    SQRADDSC(a[18], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3111|   633k|    SQRADDAC(a[19], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3112|   633k|    SQRADDAC(a[20], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3113|   633k|    SQRADDAC(a[21], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3114|   633k|    SQRADDAC(a[22], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3115|   633k|    SQRADDAC(a[23], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3116|   633k|    SQRADDAC(a[24], a[25]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3117|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3118|   633k|    COMBA_STORE(b[49]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3119|       |
 3120|       |    /* output 50 */
 3121|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3122|   633k|    SQRADDSC(a[19], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3123|   633k|    SQRADDAC(a[20], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3124|   633k|    SQRADDAC(a[21], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3125|   633k|    SQRADDAC(a[22], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3126|   633k|    SQRADDAC(a[23], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3127|   633k|    SQRADDAC(a[24], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3128|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3129|   633k|    SQRADD(a[25], a[25]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3130|   633k|    COMBA_STORE(b[50]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3131|       |
 3132|       |    /* output 51 */
 3133|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3134|   633k|    SQRADDSC(a[20], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3135|   633k|    SQRADDAC(a[21], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3136|   633k|    SQRADDAC(a[22], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3137|   633k|    SQRADDAC(a[23], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3138|   633k|    SQRADDAC(a[24], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3139|   633k|    SQRADDAC(a[25], a[26]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3140|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3141|   633k|    COMBA_STORE(b[51]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3142|       |
 3143|       |    /* output 52 */
 3144|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3145|   633k|    SQRADDSC(a[21], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3146|   633k|    SQRADDAC(a[22], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3147|   633k|    SQRADDAC(a[23], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3148|   633k|    SQRADDAC(a[24], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3149|   633k|    SQRADDAC(a[25], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3150|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3151|   633k|    SQRADD(a[26], a[26]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3152|   633k|    COMBA_STORE(b[52]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3153|       |
 3154|       |    /* output 53 */
 3155|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3156|   633k|    SQRADDSC(a[22], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3157|   633k|    SQRADDAC(a[23], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3158|   633k|    SQRADDAC(a[24], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3159|   633k|    SQRADDAC(a[25], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3160|   633k|    SQRADDAC(a[26], a[27]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3161|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3162|   633k|    COMBA_STORE(b[53]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3163|       |
 3164|       |    /* output 54 */
 3165|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3166|   633k|    SQRADDSC(a[23], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3167|   633k|    SQRADDAC(a[24], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3168|   633k|    SQRADDAC(a[25], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3169|   633k|    SQRADDAC(a[26], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3170|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3171|   633k|    SQRADD(a[27], a[27]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3172|   633k|    COMBA_STORE(b[54]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3173|       |
 3174|       |    /* output 55 */
 3175|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3176|   633k|    SQRADDSC(a[24], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3177|   633k|    SQRADDAC(a[25], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3178|   633k|    SQRADDAC(a[26], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3179|   633k|    SQRADDAC(a[27], a[28]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3180|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3181|   633k|    COMBA_STORE(b[55]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3182|       |
 3183|       |    /* output 56 */
 3184|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3185|   633k|    SQRADDSC(a[25], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3186|   633k|    SQRADDAC(a[26], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3187|   633k|    SQRADDAC(a[27], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3188|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3189|   633k|    SQRADD(a[28], a[28]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3190|   633k|    COMBA_STORE(b[56]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3191|       |
 3192|       |    /* output 57 */
 3193|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3194|   633k|    SQRADDSC(a[26], a[31]);
  ------------------
  |  |  107|   633k|    __asm__(                              \
  |  |  108|   633k|        "movq  %3,%%rax     \n\t"         \
  |  |  109|   633k|        "mulq  %4           \n\t"         \
  |  |  110|   633k|        "movq  %%rax,%0     \n\t"         \
  |  |  111|   633k|        "movq  %%rdx,%1     \n\t"         \
  |  |  112|   633k|        "xorq  %2,%2        \n\t"         \
  |  |  113|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2) \
  |  |  114|   633k|        : "g"(i), "g"(j)                  \
  |  |  115|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3195|   633k|    SQRADDAC(a[27], a[30]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3196|   633k|    SQRADDAC(a[28], a[29]);
  ------------------
  |  |  118|   633k|    __asm__(                                           \
  |  |  119|   633k|        "movq  %6,%%rax     \n\t"                      \
  |  |  120|   633k|        "mulq  %7           \n\t"                      \
  |  |  121|   633k|        "addq  %%rax,%0     \n\t"                      \
  |  |  122|   633k|        "adcq  %%rdx,%1     \n\t"                      \
  |  |  123|   633k|        "adcq  $0,%2        \n\t"                      \
  |  |  124|   633k|        : "=r"(sc0), "=r"(sc1), "=r"(sc2)              \
  |  |  125|   633k|        : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \
  |  |  126|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3197|   633k|    SQRADDDB;
  ------------------
  |  |  129|   633k|    __asm__(                                                      \
  |  |  130|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  131|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  132|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  133|   633k|        "addq %6,%0         \n\t"                                 \
  |  |  134|   633k|        "adcq %7,%1         \n\t"                                 \
  |  |  135|   633k|        "adcq %8,%2         \n\t"                                 \
  |  |  136|   633k|        : "=&r"(c0), "=&r"(c1), "=&r"(c2)                         \
  |  |  137|   633k|        : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) \
  |  |  138|   633k|        : "cc");
  ------------------
 3198|   633k|    COMBA_STORE(b[57]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3199|       |
 3200|       |    /* output 58 */
 3201|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3202|   633k|    SQRADD2(a[27], a[31]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3203|   633k|    SQRADD2(a[28], a[30]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3204|   633k|    SQRADD(a[29], a[29]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3205|   633k|    COMBA_STORE(b[58]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3206|       |
 3207|       |    /* output 59 */
 3208|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3209|   633k|    SQRADD2(a[28], a[31]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3210|   633k|    SQRADD2(a[29], a[30]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3211|   633k|    COMBA_STORE(b[59]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3212|       |
 3213|       |    /* output 60 */
 3214|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3215|   633k|    SQRADD2(a[29], a[31]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3216|   633k|    SQRADD(a[30], a[30]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3217|   633k|    COMBA_STORE(b[60]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3218|       |
 3219|       |    /* output 61 */
 3220|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3221|   633k|    SQRADD2(a[30], a[31]);
  ------------------
  |  |   93|   633k|    __asm__(                                        \
  |  |   94|   633k|        "movq  %6,%%rax     \n\t"                   \
  |  |   95|   633k|        "mulq  %7           \n\t"                   \
  |  |   96|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |   97|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |   98|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |   99|   633k|        "addq  %%rax,%0     \n\t"                   \
  |  |  100|   633k|        "adcq  %%rdx,%1     \n\t"                   \
  |  |  101|   633k|        "adcq  $0,%2        \n\t"                   \
  |  |  102|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)              \
  |  |  103|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i), "g"(j) \
  |  |  104|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3222|   633k|    COMBA_STORE(b[61]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3223|       |
 3224|       |    /* output 62 */
 3225|   633k|    CARRY_FORWARD;
  ------------------
  |  |   73|   633k|    do {              \
  |  |   74|   633k|        c0 = c1;      \
  |  |   75|   633k|        c1 = c2;      \
  |  |   76|   633k|        c2 = 0;       \
  |  |   77|   633k|    } while (0);
  |  |  ------------------
  |  |  |  Branch (77:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3226|   633k|    SQRADD(a[31], a[31]);
  ------------------
  |  |   82|   633k|    __asm__(                                \
  |  |   83|   633k|        "movq  %6,%%rax     \n\t"           \
  |  |   84|   633k|        "mulq  %%rax        \n\t"           \
  |  |   85|   633k|        "addq  %%rax,%0     \n\t"           \
  |  |   86|   633k|        "adcq  %%rdx,%1     \n\t"           \
  |  |   87|   633k|        "adcq  $0,%2        \n\t"           \
  |  |   88|   633k|        : "=r"(c0), "=r"(c1), "=r"(c2)      \
  |  |   89|   633k|        : "0"(c0), "1"(c1), "2"(c2), "g"(i) \
  |  |   90|   633k|        : "%rax", "%rdx", "cc");
  ------------------
 3227|   633k|    COMBA_STORE(b[62]);
  ------------------
  |  |   67|   633k|    x = c0;
  ------------------
 3228|   633k|    COMBA_STORE2(b[63]);
  ------------------
  |  |   70|   633k|    x = c1;
  ------------------
 3229|   633k|    COMBA_FINI;
 3230|       |
 3231|   633k|    B->used = 64;
 3232|   633k|    B->sign = ZPOS;
  ------------------
  |  |  326|   633k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|   633k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 3233|   633k|    memcpy(B->dp, b, 64 * sizeof(mp_digit));
 3234|   633k|    mp_clamp(B);
  ------------------
  |  |   26|   633k|    {                                                    \
  |  |   27|   651k|        while ((a)->used && (a)->dp[(a)->used - 1] == 0) \
  |  |  ------------------
  |  |  |  Branch (27:16): [True: 651k, False: 0]
  |  |  |  Branch (27:29): [True: 17.3k, False: 633k]
  |  |  ------------------
  |  |   28|   633k|            --((a)->used);                               \
  |  |   29|   633k|        (a)->sign = (a)->used ? (a)->sign : ZPOS;        \
  |  |  ------------------
  |  |  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   633k|#define MP_ZPOS 0
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (29:21): [True: 633k, False: 0]
  |  |  ------------------
  |  |   30|   633k|    }
  ------------------
 3235|   633k|}

freebl_cpuid:
   41|      5|{
   42|      5|    __asm__("xor %%ecx, %%ecx\n\t"
   43|      5|            "cpuid\n\t"
   44|      5|            : "=a"(*eax),
   45|      5|              "=b"(*ebx),
   46|      5|              "=c"(*ecx),
   47|      5|              "=d"(*edx)
   48|      5|            : "0"(op));
   49|      5|}
s_mpi_getProcessorLineSize:
  653|      1|{
  654|      1|    unsigned long eax, ebx, ecx, edx;
  655|      1|    PRUint32 cpuid[3];
  656|      1|    unsigned long cpuidLevel;
  657|      1|    unsigned long cacheLineSize = 0;
  658|      1|    int manufacturer = MAN_UNKNOWN;
  ------------------
  |  |  627|      1|#define MAN_UNKNOWN 9
  ------------------
  659|      1|    int i;
  660|      1|    char string[13];
  661|       |
  662|       |#if !defined(AMD_64)
  663|       |    if (is386()) {
  664|       |        return 0; /* 386 had no cache */
  665|       |    }
  666|       |    if (is486()) {
  667|       |        return 32; /* really? need more info */
  668|       |    }
  669|       |#endif
  670|       |
  671|       |    /* Pentium, cpuid command is available */
  672|      1|    freebl_cpuid(0, &eax, &ebx, &ecx, &edx);
  673|      1|    cpuidLevel = eax;
  674|       |    /* string holds the CPU's manufacturer ID string - a twelve
  675|       |     * character ASCII string stored in ebx, edx, ecx, and
  676|       |     * the 32-bit extended feature flags are in edx, ecx.
  677|       |     */
  678|      1|    cpuid[0] = ebx;
  679|      1|    cpuid[1] = ecx;
  680|      1|    cpuid[2] = edx;
  681|      1|    memcpy(string, cpuid, sizeof(cpuid));
  682|      1|    string[12] = 0;
  683|       |
  684|      1|    manufacturer = MAN_UNKNOWN;
  ------------------
  |  |  627|      1|#define MAN_UNKNOWN 9
  ------------------
  685|     11|    for (i = 0; i < n_manufacturers; i++) {
  ------------------
  |  Branch (685:17): [True: 10, False: 1]
  ------------------
  686|     10|        if (strcmp(manMap[i], string) == 0) {
  ------------------
  |  Branch (686:13): [True: 0, False: 10]
  ------------------
  687|      0|            manufacturer = i;
  688|      0|        }
  689|     10|    }
  690|       |
  691|      1|    if (manufacturer == INTEL) {
  ------------------
  |  |  603|      1|#define INTEL 0
  ------------------
  |  Branch (691:9): [True: 0, False: 1]
  ------------------
  692|      0|        cacheLineSize = getIntelCacheLineSize(cpuidLevel);
  693|      1|    } else {
  694|      1|        cacheLineSize = getOtherCacheLineSize(cpuidLevel);
  695|      1|    }
  696|       |    /* doesn't support cache info based on cpuid. This means
  697|       |     * an old pentium class processor, which have cache lines of
  698|       |     * 32. If we learn differently, we can use a switch based on
  699|       |     * the Manufacturer id  */
  700|      1|    if (cacheLineSize == 0) {
  ------------------
  |  Branch (700:9): [True: 0, False: 1]
  ------------------
  701|      0|        cacheLineSize = 32;
  702|      0|    }
  703|      1|    return cacheLineSize;
  704|      1|}
mpcpucache.c:getOtherCacheLineSize:
  587|      1|{
  588|      1|    unsigned long lineSize = 0;
  589|      1|    unsigned long eax, ebx, ecx, edx;
  590|       |
  591|       |    /* get the Extended CPUID level */
  592|      1|    freebl_cpuid(0x80000000, &eax, &ebx, &ecx, &edx);
  593|      1|    cpuidLevel = eax;
  594|       |
  595|      1|    if (cpuidLevel >= 0x80000005) {
  ------------------
  |  Branch (595:9): [True: 1, False: 0]
  ------------------
  596|      1|        freebl_cpuid(0x80000005, &eax, &ebx, &ecx, &edx);
  597|      1|        lineSize = ecx & 0xff; /* line Size, L1 Data Cache */
  598|      1|    }
  599|      1|    return lineSize;
  600|      1|}

mp_init:
  121|  57.8k|{
  122|  57.8k|    return mp_init_size(mp, s_mp_defprec);
  123|       |
  124|  57.8k|} /* end mp_init() */
mp_init_size:
  140|   489k|{
  141|   489k|    ARGCHK(mp != NULL && prec > 0, MP_BADARG);
  ------------------
  |  |  355|   489k|#define ARGCHK(X, Y) assert(X)
  ------------------
  142|       |
  143|   489k|    prec = MP_ROUNDUP(prec, s_mp_defprec);
  ------------------
  |  |   89|   489k|#define MP_ROUNDUP(a, b) (MP_HOWMANY(a, b) * (b))
  |  |  ------------------
  |  |  |  |   88|   489k|#define MP_HOWMANY(a, b) (((a) + (b)-1) / (b))
  |  |  ------------------
  ------------------
  144|   489k|    if ((DIGITS(mp) = s_mp_alloc(prec, sizeof(mp_digit))) == NULL)
  ------------------
  |  |  335|   489k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|   489k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  |  Branch (144:9): [True: 0, False: 489k]
  ------------------
  145|      0|        return MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  146|       |
  147|   489k|    SIGN(mp) = ZPOS;
  ------------------
  |  |  332|   489k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   489k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(mp) = ZPOS;
  ------------------
  |  |  326|   489k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|   489k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  148|   489k|    USED(mp) = 1;
  ------------------
  |  |  333|   489k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   489k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  149|   489k|    ALLOC(mp) = prec;
  ------------------
  |  |  334|   489k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|   489k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  150|       |
  151|   489k|    return MP_OKAY;
  ------------------
  |  |   39|   489k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  152|       |
  153|   489k|} /* end mp_init_size() */
mp_init_copy:
  169|  1.80M|{
  170|  1.80M|    ARGCHK(mp != NULL && from != NULL, MP_BADARG);
  ------------------
  |  |  355|  1.80M|#define ARGCHK(X, Y) assert(X)
  ------------------
  171|       |
  172|  1.80M|    if (mp == from)
  ------------------
  |  Branch (172:9): [True: 0, False: 1.80M]
  ------------------
  173|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  174|       |
  175|  1.80M|    if ((DIGITS(mp) = s_mp_alloc(ALLOC(from), sizeof(mp_digit))) == NULL)
  ------------------
  |  |  335|  1.80M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  1.80M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                  if ((DIGITS(mp) = s_mp_alloc(ALLOC(from), sizeof(mp_digit))) == NULL)
  ------------------
  |  |  334|  1.80M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|  1.80M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (175:9): [True: 0, False: 1.80M]
  ------------------
  176|      0|        return MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  177|       |
  178|  1.80M|    s_mp_copy(DIGITS(from), DIGITS(mp), USED(from));
  ------------------
  |  |  335|  1.80M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  1.80M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                  s_mp_copy(DIGITS(from), DIGITS(mp), USED(from));
  ------------------
  |  |  335|  1.80M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  1.80M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                  s_mp_copy(DIGITS(from), DIGITS(mp), USED(from));
  ------------------
  |  |  333|  1.80M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  1.80M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  179|  1.80M|    USED(mp) = USED(from);
  ------------------
  |  |  333|  1.80M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  1.80M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  USED(mp) = USED(from);
  ------------------
  |  |  333|  1.80M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  1.80M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  180|  1.80M|    ALLOC(mp) = ALLOC(from);
  ------------------
  |  |  334|  1.80M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|  1.80M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                  ALLOC(mp) = ALLOC(from);
  ------------------
  |  |  334|  1.80M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|  1.80M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  181|  1.80M|    SIGN(mp) = SIGN(from);
  ------------------
  |  |  332|  1.80M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  1.80M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(mp) = SIGN(from);
  ------------------
  |  |  332|  1.80M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  1.80M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
  182|       |
  183|  1.80M|    return MP_OKAY;
  ------------------
  |  |   39|  1.80M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  184|       |
  185|  1.80M|} /* end mp_init_copy() */
mp_copy:
  201|   235k|{
  202|   235k|    ARGCHK(from != NULL && to != NULL, MP_BADARG);
  ------------------
  |  |  355|   235k|#define ARGCHK(X, Y) assert(X)
  ------------------
  203|       |
  204|   235k|    if (from == to)
  ------------------
  |  Branch (204:9): [True: 5.43k, False: 230k]
  ------------------
  205|  5.43k|        return MP_OKAY;
  ------------------
  |  |   39|  5.43k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  206|       |
  207|   230k|    { /* copy */
  208|   230k|        mp_digit *tmp;
  209|       |
  210|       |        /*
  211|       |          If the allocated buffer in 'to' already has enough space to hold
  212|       |          all the used digits of 'from', we'll re-use it to avoid hitting
  213|       |          the memory allocater more than necessary; otherwise, we'd have
  214|       |          to grow anyway, so we just allocate a hunk and make the copy as
  215|       |          usual
  216|       |         */
  217|   230k|        if (ALLOC(to) >= USED(from)) {
  ------------------
  |  |  334|   230k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|   230k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                      if (ALLOC(to) >= USED(from)) {
  ------------------
  |  |  333|   230k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   230k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (217:13): [True: 230k, False: 0]
  ------------------
  218|   230k|            s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
  ------------------
  |  |  335|   230k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|   230k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
  ------------------
  |  |  333|   230k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   230k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
  ------------------
  |  |  334|   230k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|   230k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
  ------------------
  |  |  333|   230k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   230k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  219|   230k|            s_mp_copy(DIGITS(from), DIGITS(to), USED(from));
  ------------------
  |  |  335|   230k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|   230k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_copy(DIGITS(from), DIGITS(to), USED(from));
  ------------------
  |  |  335|   230k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|   230k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_copy(DIGITS(from), DIGITS(to), USED(from));
  ------------------
  |  |  333|   230k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   230k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  220|       |
  221|   230k|        } else {
  222|      0|            if ((tmp = s_mp_alloc(ALLOC(from), sizeof(mp_digit))) == NULL)
  ------------------
  |  |  334|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (222:17): [True: 0, False: 0]
  ------------------
  223|      0|                return MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  224|       |
  225|      0|            s_mp_copy(DIGITS(from), tmp, USED(from));
  ------------------
  |  |  335|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_copy(DIGITS(from), tmp, USED(from));
  ------------------
  |  |  333|      0|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|      0|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  226|       |
  227|      0|            if (DIGITS(to) != NULL) {
  ------------------
  |  |  335|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  |  Branch (227:17): [True: 0, False: 0]
  ------------------
  228|      0|                s_mp_setz(DIGITS(to), ALLOC(to));
  ------------------
  |  |  335|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                              s_mp_setz(DIGITS(to), ALLOC(to));
  ------------------
  |  |  334|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  229|      0|                s_mp_free(DIGITS(to));
  ------------------
  |  |  335|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  230|      0|            }
  231|       |
  232|      0|            DIGITS(to) = tmp;
  ------------------
  |  |  335|      0|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|      0|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  233|      0|            ALLOC(to) = ALLOC(from);
  ------------------
  |  |  334|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                          ALLOC(to) = ALLOC(from);
  ------------------
  |  |  334|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  234|      0|        }
  235|       |
  236|       |        /* Copy the precision and sign from the original */
  237|   230k|        USED(to) = USED(from);
  ------------------
  |  |  333|   230k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   230k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                      USED(to) = USED(from);
  ------------------
  |  |  333|   230k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   230k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  238|   230k|        SIGN(to) = SIGN(from);
  ------------------
  |  |  332|   230k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   230k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(to) = SIGN(from);
  ------------------
  |  |  332|   230k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   230k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
  239|   230k|    } /* end copy */
  240|       |
  241|   230k|    return MP_OKAY;
  ------------------
  |  |   39|   230k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  242|       |
  243|   230k|} /* end mp_copy() */
mp_exch:
  259|  6.41k|{
  260|  6.41k|#if MP_ARGCHK == 2
  261|  6.41k|    assert(mp1 != NULL && mp2 != NULL);
  262|       |#else
  263|       |    if (mp1 == NULL || mp2 == NULL)
  264|       |        return;
  265|       |#endif
  266|       |
  267|  6.41k|    s_mp_exch(mp1, mp2);
  268|       |
  269|  6.41k|} /* end mp_exch() */
mp_clear:
  285|  3.84M|{
  286|  3.84M|    if (mp == NULL)
  ------------------
  |  Branch (286:9): [True: 0, False: 3.84M]
  ------------------
  287|      0|        return;
  288|       |
  289|  3.84M|    if (DIGITS(mp) != NULL) {
  ------------------
  |  |  335|  3.84M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  3.84M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  |  Branch (289:9): [True: 2.29M, False: 1.55M]
  ------------------
  290|  2.29M|        s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  335|  2.29M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  2.29M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                      s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  334|  2.29M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|  2.29M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  291|  2.29M|        s_mp_free(DIGITS(mp));
  ------------------
  |  |  335|  2.29M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  2.29M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  292|  2.29M|        DIGITS(mp) = NULL;
  ------------------
  |  |  335|  2.29M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  2.29M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  293|  2.29M|    }
  294|       |
  295|  3.84M|    USED(mp) = 0;
  ------------------
  |  |  333|  3.84M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  3.84M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  296|  3.84M|    ALLOC(mp) = 0;
  ------------------
  |  |  334|  3.84M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|  3.84M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  297|       |
  298|  3.84M|} /* end mp_clear() */
mp_zero:
  312|  80.1k|{
  313|  80.1k|    if (mp == NULL)
  ------------------
  |  Branch (313:9): [True: 0, False: 80.1k]
  ------------------
  314|      0|        return;
  315|       |
  316|  80.1k|    s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  335|  80.1k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  80.1k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                  s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  334|  80.1k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|  80.1k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  317|  80.1k|    USED(mp) = 1;
  ------------------
  |  |  333|  80.1k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  80.1k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  318|  80.1k|    SIGN(mp) = ZPOS;
  ------------------
  |  |  332|  80.1k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  80.1k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(mp) = ZPOS;
  ------------------
  |  |  326|  80.1k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  80.1k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  319|       |
  320|  80.1k|} /* end mp_zero() */
mp_set:
  328|  27.1k|{
  329|  27.1k|    if (mp == NULL)
  ------------------
  |  Branch (329:9): [True: 0, False: 27.1k]
  ------------------
  330|      0|        return;
  331|       |
  332|  27.1k|    mp_zero(mp);
  333|  27.1k|    DIGIT(mp, 0) = d;
  ------------------
  |  |  336|  27.1k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  27.1k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  334|       |
  335|  27.1k|} /* end mp_set() */
mp_sub_d:
  453|  3.02k|{
  454|  3.02k|    mp_int tmp;
  455|  3.02k|    mp_err res;
  456|       |
  457|  3.02k|    ARGCHK(a != NULL && b != NULL, MP_BADARG);
  ------------------
  |  |  355|  3.02k|#define ARGCHK(X, Y) assert(X)
  ------------------
  458|       |
  459|  3.02k|    if ((res = mp_init_copy(&tmp, a)) != MP_OKAY)
  ------------------
  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (459:9): [True: 0, False: 3.02k]
  ------------------
  460|      0|        return res;
  461|       |
  462|  3.02k|    if (SIGN(&tmp) == NEG) {
  ------------------
  |  |  332|  3.02k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  3.02k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(&tmp) == NEG) {
  ------------------
  |  |  325|  3.02k|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  3.02k|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (462:9): [True: 0, False: 3.02k]
  ------------------
  463|      0|        if ((res = s_mp_add_d(&tmp, d)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (463:13): [True: 0, False: 0]
  ------------------
  464|      0|            goto CLEANUP;
  465|  3.02k|    } else if (s_mp_cmp_d(&tmp, d) >= 0) {
  ------------------
  |  Branch (465:16): [True: 3.02k, False: 0]
  ------------------
  466|  3.02k|        if ((res = s_mp_sub_d(&tmp, d)) != MP_OKAY)
  ------------------
  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (466:13): [True: 0, False: 3.02k]
  ------------------
  467|      0|            goto CLEANUP;
  468|  3.02k|    } else {
  469|      0|        mp_neg(&tmp, &tmp);
  470|       |
  471|      0|        DIGIT(&tmp, 0) = d - DIGIT(&tmp, 0);
  ------------------
  |  |  336|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
                      DIGIT(&tmp, 0) = d - DIGIT(&tmp, 0);
  ------------------
  |  |  336|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  472|      0|        SIGN(&tmp) = NEG;
  ------------------
  |  |  332|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(&tmp) = NEG;
  ------------------
  |  |  325|      0|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|      0|#define MP_NEG 1
  |  |  ------------------
  ------------------
  473|      0|    }
  474|       |
  475|  3.02k|    if (s_mp_cmp_d(&tmp, 0) == 0)
  ------------------
  |  Branch (475:9): [True: 0, False: 3.02k]
  ------------------
  476|      0|        SIGN(&tmp) = ZPOS;
  ------------------
  |  |  332|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(&tmp) = ZPOS;
  ------------------
  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|      0|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  477|       |
  478|  3.02k|    s_mp_exch(&tmp, b);
  479|       |
  480|  3.02k|CLEANUP:
  481|  3.02k|    mp_clear(&tmp);
  482|  3.02k|    return res;
  483|       |
  484|  3.02k|} /* end mp_sub_d() */
mp_add:
  741|  1.86M|{
  742|  1.86M|    mp_err res;
  743|       |
  744|  1.86M|    ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  355|  1.86M|#define ARGCHK(X, Y) assert(X)
  ------------------
  745|       |
  746|  1.86M|    if (SIGN(a) == SIGN(b)) { /* same sign:  add values, keep sign */
  ------------------
  |  |  332|  1.86M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  1.86M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == SIGN(b)) { /* same sign:  add values, keep sign */
  ------------------
  |  |  332|  1.86M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  1.86M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
  |  Branch (746:9): [True: 1.28M, False: 575k]
  ------------------
  747|  1.28M|        MP_CHECKOK(s_mp_add_3arg(a, b, c));
  ------------------
  |  |  319|  1.28M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.28M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 1.28M]
  |  |  ------------------
  |  |  320|  1.28M|    goto CLEANUP
  ------------------
  748|  1.28M|    } else if (s_mp_cmp(a, b) >= 0) { /* different sign: |a| >= |b|   */
  ------------------
  |  Branch (748:16): [True: 200k, False: 374k]
  ------------------
  749|   200k|        MP_CHECKOK(s_mp_sub_3arg(a, b, c));
  ------------------
  |  |  319|   200k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   200k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 200k]
  |  |  ------------------
  |  |  320|   200k|    goto CLEANUP
  ------------------
  750|   374k|    } else { /* different sign: |a|  < |b|   */
  751|   374k|        MP_CHECKOK(s_mp_sub_3arg(b, a, c));
  ------------------
  |  |  319|   374k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   374k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 374k]
  |  |  ------------------
  |  |  320|   374k|    goto CLEANUP
  ------------------
  752|   374k|    }
  753|       |
  754|  1.86M|    if (s_mp_cmp_d(c, 0) == MP_EQ)
  ------------------
  |  |   50|  1.86M|#define MP_EQ 0
  ------------------
  |  Branch (754:9): [True: 1.56k, False: 1.85M]
  ------------------
  755|  1.56k|        SIGN(c) = ZPOS;
  ------------------
  |  |  332|  1.56k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  1.56k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(c) = ZPOS;
  ------------------
  |  |  326|  1.56k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  1.56k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  756|       |
  757|  1.86M|CLEANUP:
  758|  1.86M|    return res;
  759|       |
  760|  1.86M|} /* end mp_add() */
mp_sub:
  774|   532k|{
  775|   532k|    mp_err res;
  776|   532k|    int magDiff;
  777|       |
  778|   532k|    ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  355|   532k|#define ARGCHK(X, Y) assert(X)
  ------------------
  779|       |
  780|   532k|    if (a == b) {
  ------------------
  |  Branch (780:9): [True: 0, False: 532k]
  ------------------
  781|      0|        mp_zero(c);
  782|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  783|      0|    }
  784|       |
  785|   532k|    if (MP_SIGN(a) != MP_SIGN(b)) {
  ------------------
  |  |  149|   532k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  if (MP_SIGN(a) != MP_SIGN(b)) {
  ------------------
  |  |  149|   532k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
  |  Branch (785:9): [True: 0, False: 532k]
  ------------------
  786|      0|        MP_CHECKOK(s_mp_add_3arg(a, b, c));
  ------------------
  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  320|      0|    goto CLEANUP
  ------------------
  787|   532k|    } else if (!(magDiff = s_mp_cmp(a, b))) {
  ------------------
  |  Branch (787:16): [True: 22.9k, False: 509k]
  ------------------
  788|  22.9k|        mp_zero(c);
  789|  22.9k|        res = MP_OKAY;
  ------------------
  |  |   39|  22.9k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  790|   509k|    } else if (magDiff > 0) {
  ------------------
  |  Branch (790:16): [True: 487k, False: 22.1k]
  ------------------
  791|   487k|        MP_CHECKOK(s_mp_sub_3arg(a, b, c));
  ------------------
  |  |  319|   487k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   487k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 487k]
  |  |  ------------------
  |  |  320|   487k|    goto CLEANUP
  ------------------
  792|   487k|    } else {
  793|  22.1k|        MP_CHECKOK(s_mp_sub_3arg(b, a, c));
  ------------------
  |  |  319|  22.1k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  22.1k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 22.1k]
  |  |  ------------------
  |  |  320|  22.1k|    goto CLEANUP
  ------------------
  794|  22.1k|        MP_SIGN(c) = !MP_SIGN(a);
  ------------------
  |  |  149|  22.1k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                      MP_SIGN(c) = !MP_SIGN(a);
  ------------------
  |  |  149|  22.1k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
  795|  22.1k|    }
  796|       |
  797|   532k|    if (s_mp_cmp_d(c, 0) == MP_EQ)
  ------------------
  |  |   50|   532k|#define MP_EQ 0
  ------------------
  |  Branch (797:9): [True: 22.9k, False: 509k]
  ------------------
  798|  22.9k|        MP_SIGN(c) = MP_ZPOS;
  ------------------
  |  |  149|  22.9k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                      MP_SIGN(c) = MP_ZPOS;
  ------------------
  |  |   37|  22.9k|#define MP_ZPOS 0
  ------------------
  799|       |
  800|   532k|CLEANUP:
  801|   532k|    return res;
  802|       |
  803|   532k|} /* end mp_sub() */
s_mp_mulg:
  819|  1.24M|{
  820|  1.24M|    mp_digit *pb;
  821|  1.24M|    mp_int tmp;
  822|  1.24M|    mp_err res;
  823|  1.24M|    mp_size ib;
  824|  1.24M|    mp_size useda, usedb;
  825|       |
  826|  1.24M|    ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  355|  1.24M|#define ARGCHK(X, Y) assert(X)
  ------------------
  827|       |
  828|  1.24M|    if (a == c) {
  ------------------
  |  Branch (828:9): [True: 1.23M, False: 8.39k]
  ------------------
  829|  1.23M|        if ((res = mp_init_copy(&tmp, a)) != MP_OKAY)
  ------------------
  |  |   39|  1.23M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (829:13): [True: 0, False: 1.23M]
  ------------------
  830|      0|            return res;
  831|  1.23M|        if (a == b)
  ------------------
  |  Branch (831:13): [True: 0, False: 1.23M]
  ------------------
  832|      0|            b = &tmp;
  833|  1.23M|        a = &tmp;
  834|  1.23M|    } else if (b == c) {
  ------------------
  |  Branch (834:16): [True: 0, False: 8.39k]
  ------------------
  835|      0|        if ((res = mp_init_copy(&tmp, b)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (835:13): [True: 0, False: 0]
  ------------------
  836|      0|            return res;
  837|      0|        b = &tmp;
  838|  8.39k|    } else {
  839|  8.39k|        MP_DIGITS(&tmp) = 0;
  ------------------
  |  |  152|  8.39k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  840|  8.39k|    }
  841|       |
  842|  1.24M|    if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  150|  1.24M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  150|  1.24M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (842:9): [True: 98.7k, False: 1.14M]
  ------------------
  843|  98.7k|        const mp_int *xch = b; /* switch a and b, to do fewer outer loops */
  844|  98.7k|        b = a;
  845|  98.7k|        a = xch;
  846|  98.7k|    }
  847|       |
  848|  1.24M|    MP_USED(c) = 1;
  ------------------
  |  |  150|  1.24M|#define MP_USED(MP) ((MP)->used)
  ------------------
  849|  1.24M|    MP_DIGIT(c, 0) = 0;
  ------------------
  |  |  153|  1.24M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  850|  1.24M|    if ((res = s_mp_pad(c, USED(a) + USED(b))) != MP_OKAY)
  ------------------
  |  |  333|  1.24M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  1.24M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  if ((res = s_mp_pad(c, USED(a) + USED(b))) != MP_OKAY)
  ------------------
  |  |  333|  1.24M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  1.24M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  if ((res = s_mp_pad(c, USED(a) + USED(b))) != MP_OKAY)
  ------------------
  |  |   39|  1.24M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (850:9): [True: 0, False: 1.24M]
  ------------------
  851|      0|        goto CLEANUP;
  852|       |
  853|  1.24M|#ifdef NSS_USE_COMBA
  854|       |    /* comba isn't constant time because it clamps! If we cared
  855|       |     * (we needed a constant time version of multiply that was 'faster'
  856|       |     * we could easily pass constantTime down to the comba code and
  857|       |     * get it to skip the clamp... but here are assembler versions
  858|       |     * which add comba to platforms that can't compile the normal
  859|       |     * comba's imbedded assembler which would also need to change, so
  860|       |     * for now we just skip comba when we are running constant time. */
  861|  1.24M|    if (!constantTime && (MP_USED(a) == MP_USED(b)) && IS_POWER_OF_2(MP_USED(b))) {
  ------------------
  |  |  150|  1.24M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (!constantTime && (MP_USED(a) == MP_USED(b)) && IS_POWER_OF_2(MP_USED(b))) {
  ------------------
  |  |  150|  1.24M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (!constantTime && (MP_USED(a) == MP_USED(b)) && IS_POWER_OF_2(MP_USED(b))) {
  ------------------
  |  |  153|  1.14M|#define IS_POWER_OF_2(a) ((a) && !((a) & ((a)-1)))
  |  |  ------------------
  |  |  |  Branch (153:27): [True: 1.14M, False: 0]
  |  |  |  Branch (153:34): [True: 650k, False: 490k]
  |  |  ------------------
  ------------------
  |  Branch (861:9): [True: 1.24M, False: 0]
  |  Branch (861:26): [True: 1.14M, False: 100k]
  ------------------
  862|   650k|        if (MP_USED(a) == 4) {
  ------------------
  |  |  150|   650k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (862:13): [True: 2.14k, False: 648k]
  ------------------
  863|  2.14k|            s_mp_mul_comba_4(a, b, c);
  864|  2.14k|            goto CLEANUP;
  865|  2.14k|        }
  866|   648k|        if (MP_USED(a) == 8) {
  ------------------
  |  |  150|   648k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (866:13): [True: 60, False: 648k]
  ------------------
  867|     60|            s_mp_mul_comba_8(a, b, c);
  868|     60|            goto CLEANUP;
  869|     60|        }
  870|   648k|        if (MP_USED(a) == 16) {
  ------------------
  |  |  150|   648k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (870:13): [True: 39.7k, False: 608k]
  ------------------
  871|  39.7k|            s_mp_mul_comba_16(a, b, c);
  872|  39.7k|            goto CLEANUP;
  873|  39.7k|        }
  874|   608k|        if (MP_USED(a) == 32) {
  ------------------
  |  |  150|   608k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (874:13): [True: 597k, False: 11.1k]
  ------------------
  875|   597k|            s_mp_mul_comba_32(a, b, c);
  876|   597k|            goto CLEANUP;
  877|   597k|        }
  878|   608k|    }
  879|   602k|#endif
  880|       |
  881|   602k|    pb = MP_DIGITS(b);
  ------------------
  |  |  152|   602k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  882|   602k|    s_mpv_mul_d(MP_DIGITS(a), MP_USED(a), *pb++, MP_DIGITS(c));
  ------------------
  |  |  181|   602k|    ((mp_digit *)c)[a_len] = s_mpv_mul_set_vec64(c, a, a_len, b)
  ------------------
  883|       |
  884|       |    /* Outer loop:  Digits of b */
  885|   602k|    useda = MP_USED(a);
  ------------------
  |  |  150|   602k|#define MP_USED(MP) ((MP)->used)
  ------------------
  886|   602k|    usedb = MP_USED(b);
  ------------------
  |  |  150|   602k|#define MP_USED(MP) ((MP)->used)
  ------------------
  887|  16.1M|    for (ib = 1; ib < usedb; ib++) {
  ------------------
  |  Branch (887:18): [True: 15.5M, False: 602k]
  ------------------
  888|  15.5M|        mp_digit b_i = *pb++;
  889|       |
  890|       |        /* Inner product:  Digits of a */
  891|  15.5M|        if (constantTime || b_i)
  ------------------
  |  Branch (891:13): [True: 0, False: 15.5M]
  |  Branch (891:29): [True: 14.2M, False: 1.29M]
  ------------------
  892|  14.2M|            s_mpv_mul_d_add(MP_DIGITS(a), useda, b_i, MP_DIGITS(c) + ib);
  ------------------
  |  |  185|  14.2M|    ((mp_digit *)c)[a_len] = s_mpv_mul_add_vec64(c, a, a_len, b)
  ------------------
  893|  1.29M|        else
  894|  1.29M|            MP_DIGIT(c, ib + useda) = b_i;
  ------------------
  |  |  153|  1.29M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  895|  15.5M|    }
  896|       |
  897|   602k|    if (!constantTime) {
  ------------------
  |  Branch (897:9): [True: 602k, False: 0]
  ------------------
  898|   602k|        s_mp_clamp(c);
  899|   602k|    }
  900|       |
  901|   602k|    if (SIGN(a) == SIGN(b) || s_mp_cmp_d(c, 0) == MP_EQ)
  ------------------
  |  |  332|   602k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   602k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == SIGN(b) || s_mp_cmp_d(c, 0) == MP_EQ)
  ------------------
  |  |  332|   602k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  1.20M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == SIGN(b) || s_mp_cmp_d(c, 0) == MP_EQ)
  ------------------
  |  |   50|  5.35k|#define MP_EQ 0
  ------------------
  |  Branch (901:9): [True: 596k, False: 5.35k]
  |  Branch (901:31): [True: 0, False: 5.35k]
  ------------------
  902|   596k|        SIGN(c) = ZPOS;
  ------------------
  |  |  332|   596k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   596k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(c) = ZPOS;
  ------------------
  |  |  326|   596k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|   596k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  903|  5.35k|    else
  904|  5.35k|        SIGN(c) = NEG;
  ------------------
  |  |  332|  5.35k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  5.35k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(c) = NEG;
  ------------------
  |  |  325|  5.35k|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  5.35k|#define MP_NEG 1
  |  |  ------------------
  ------------------
  905|       |
  906|  1.24M|CLEANUP:
  907|  1.24M|    mp_clear(&tmp);
  908|  1.24M|    return res;
  909|   602k|} /* end smp_mulg() */
mp_mul:
  923|  1.24M|{
  924|  1.24M|    return s_mp_mulg(a, b, c, 0);
  925|  1.24M|} /* end mp_mul() */
mp_sqr:
  971|  1.53M|{
  972|  1.53M|    mp_digit *pa;
  973|  1.53M|    mp_digit d;
  974|  1.53M|    mp_err res;
  975|  1.53M|    mp_size ix;
  976|  1.53M|    mp_int tmp;
  977|  1.53M|    int count;
  978|       |
  979|  1.53M|    ARGCHK(a != NULL && sqr != NULL, MP_BADARG);
  ------------------
  |  |  355|  1.53M|#define ARGCHK(X, Y) assert(X)
  ------------------
  980|       |
  981|  1.53M|    if (a == sqr) {
  ------------------
  |  Branch (981:9): [True: 0, False: 1.53M]
  ------------------
  982|      0|        if ((res = mp_init_copy(&tmp, a)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (982:13): [True: 0, False: 0]
  ------------------
  983|      0|            return res;
  984|      0|        a = &tmp;
  985|  1.53M|    } else {
  986|  1.53M|        DIGITS(&tmp) = 0;
  ------------------
  |  |  335|  1.53M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  1.53M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  987|  1.53M|        res = MP_OKAY;
  ------------------
  |  |   39|  1.53M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  988|  1.53M|    }
  989|       |
  990|  1.53M|    ix = 2 * MP_USED(a);
  ------------------
  |  |  150|  1.53M|#define MP_USED(MP) ((MP)->used)
  ------------------
  991|  1.53M|    if (ix > MP_ALLOC(sqr)) {
  ------------------
  |  |  151|  1.53M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
  |  Branch (991:9): [True: 0, False: 1.53M]
  ------------------
  992|      0|        MP_USED(sqr) = 1;
  ------------------
  |  |  150|      0|#define MP_USED(MP) ((MP)->used)
  ------------------
  993|      0|        MP_CHECKOK(s_mp_grow(sqr, ix));
  ------------------
  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  320|      0|    goto CLEANUP
  ------------------
  994|      0|    }
  995|  1.53M|    MP_USED(sqr) = ix;
  ------------------
  |  |  150|  1.53M|#define MP_USED(MP) ((MP)->used)
  ------------------
  996|  1.53M|    MP_DIGIT(sqr, 0) = 0;
  ------------------
  |  |  153|  1.53M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  997|       |
  998|  1.53M|#ifdef NSS_USE_COMBA
  999|  1.53M|    if (IS_POWER_OF_2(MP_USED(a))) {
  ------------------
  |  |  153|  1.53M|#define IS_POWER_OF_2(a) ((a) && !((a) & ((a)-1)))
  |  |  ------------------
  |  |  |  Branch (153:27): [True: 1.53M, False: 0]
  |  |  |  Branch (153:34): [True: 1.15M, False: 383k]
  |  |  ------------------
  ------------------
 1000|  1.15M|        if (MP_USED(a) == 4) {
  ------------------
  |  |  150|  1.15M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (1000:13): [True: 1.13k, False: 1.15M]
  ------------------
 1001|  1.13k|            s_mp_sqr_comba_4(a, sqr);
 1002|  1.13k|            goto CLEANUP;
 1003|  1.13k|        }
 1004|  1.15M|        if (MP_USED(a) == 8) {
  ------------------
  |  |  150|  1.15M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (1004:13): [True: 1.04k, False: 1.14M]
  ------------------
 1005|  1.04k|            s_mp_sqr_comba_8(a, sqr);
 1006|  1.04k|            goto CLEANUP;
 1007|  1.04k|        }
 1008|  1.14M|        if (MP_USED(a) == 16) {
  ------------------
  |  |  150|  1.14M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (1008:13): [True: 41.9k, False: 1.10M]
  ------------------
 1009|  41.9k|            s_mp_sqr_comba_16(a, sqr);
 1010|  41.9k|            goto CLEANUP;
 1011|  41.9k|        }
 1012|  1.10M|        if (MP_USED(a) == 32) {
  ------------------
  |  |  150|  1.10M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (1012:13): [True: 633k, False: 473k]
  ------------------
 1013|   633k|            s_mp_sqr_comba_32(a, sqr);
 1014|   633k|            goto CLEANUP;
 1015|   633k|        }
 1016|  1.10M|    }
 1017|   857k|#endif
 1018|       |
 1019|   857k|    pa = MP_DIGITS(a);
  ------------------
  |  |  152|   857k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 1020|   857k|    count = MP_USED(a) - 1;
  ------------------
  |  |  150|   857k|#define MP_USED(MP) ((MP)->used)
  ------------------
 1021|   857k|    if (count > 0) {
  ------------------
  |  Branch (1021:9): [True: 839k, False: 18.2k]
  ------------------
 1022|   839k|        d = *pa++;
 1023|   839k|        s_mpv_mul_d(pa, count, d, MP_DIGITS(sqr) + 1);
  ------------------
  |  |  181|   839k|    ((mp_digit *)c)[a_len] = s_mpv_mul_set_vec64(c, a, a_len, b)
  ------------------
 1024|  48.1M|        for (ix = 3; --count > 0; ix += 2) {
  ------------------
  |  Branch (1024:22): [True: 47.3M, False: 839k]
  ------------------
 1025|  47.3M|            d = *pa++;
 1026|  47.3M|            s_mpv_mul_d_add(pa, count, d, MP_DIGITS(sqr) + ix);
  ------------------
  |  |  185|  47.3M|    ((mp_digit *)c)[a_len] = s_mpv_mul_add_vec64(c, a, a_len, b)
  ------------------
 1027|  47.3M|        }                                    /* for(ix ...) */
 1028|   839k|        MP_DIGIT(sqr, MP_USED(sqr) - 1) = 0; /* above loop stopped short of this. */
  ------------------
  |  |  153|   839k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 1029|       |
 1030|       |        /* now sqr *= 2 */
 1031|   839k|        s_mp_mul_2(sqr);
 1032|   839k|    } else {
 1033|  18.2k|        MP_DIGIT(sqr, 1) = 0;
  ------------------
  |  |  153|  18.2k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 1034|  18.2k|    }
 1035|       |
 1036|       |    /* now add the squares of the digits of a to sqr. */
 1037|   857k|    s_mpv_sqr_add_prop(MP_DIGITS(a), MP_USED(a), MP_DIGITS(sqr));
  ------------------
  |  |  152|   857k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
                  s_mpv_sqr_add_prop(MP_DIGITS(a), MP_USED(a), MP_DIGITS(sqr));
  ------------------
  |  |  150|   857k|#define MP_USED(MP) ((MP)->used)
  ------------------
                  s_mpv_sqr_add_prop(MP_DIGITS(a), MP_USED(a), MP_DIGITS(sqr));
  ------------------
  |  |  152|   857k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 1038|       |
 1039|   857k|    SIGN(sqr) = ZPOS;
  ------------------
  |  |  332|   857k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   857k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(sqr) = ZPOS;
  ------------------
  |  |  326|   857k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|   857k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 1040|   857k|    s_mp_clamp(sqr);
 1041|       |
 1042|  1.53M|CLEANUP:
 1043|  1.53M|    mp_clear(&tmp);
 1044|  1.53M|    return res;
 1045|       |
 1046|   857k|} /* end mp_sqr() */
mp_div:
 1062|  18.2k|{
 1063|  18.2k|    mp_err res;
 1064|  18.2k|    mp_int *pQ, *pR;
 1065|  18.2k|    mp_int qtmp, rtmp, btmp;
 1066|  18.2k|    int cmp;
 1067|  18.2k|    mp_sign signA;
 1068|  18.2k|    mp_sign signB;
 1069|       |
 1070|  18.2k|    ARGCHK(a != NULL && b != NULL, MP_BADARG);
  ------------------
  |  |  355|  18.2k|#define ARGCHK(X, Y) assert(X)
  ------------------
 1071|       |
 1072|  18.2k|    signA = MP_SIGN(a);
  ------------------
  |  |  149|  18.2k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 1073|  18.2k|    signB = MP_SIGN(b);
  ------------------
  |  |  149|  18.2k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 1074|       |
 1075|  18.2k|    if (mp_cmp_z(b) == MP_EQ)
  ------------------
  |  |   50|  18.2k|#define MP_EQ 0
  ------------------
  |  Branch (1075:9): [True: 0, False: 18.2k]
  ------------------
 1076|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 1077|       |
 1078|  18.2k|    DIGITS(&qtmp) = 0;
  ------------------
  |  |  335|  18.2k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  18.2k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 1079|  18.2k|    DIGITS(&rtmp) = 0;
  ------------------
  |  |  335|  18.2k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  18.2k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 1080|  18.2k|    DIGITS(&btmp) = 0;
  ------------------
  |  |  335|  18.2k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  18.2k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 1081|       |
 1082|       |    /* Set up some temporaries... */
 1083|  18.2k|    if (!r || r == a || r == b) {
  ------------------
  |  Branch (1083:9): [True: 2.98k, False: 15.2k]
  |  Branch (1083:15): [True: 14.3k, False: 955]
  |  Branch (1083:25): [True: 0, False: 955]
  ------------------
 1084|  17.3k|        MP_CHECKOK(mp_init_copy(&rtmp, a));
  ------------------
  |  |  319|  17.3k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  17.3k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 17.3k]
  |  |  ------------------
  |  |  320|  17.3k|    goto CLEANUP
  ------------------
 1085|  17.3k|        pR = &rtmp;
 1086|  17.3k|    } else {
 1087|    955|        MP_CHECKOK(mp_copy(a, r));
  ------------------
  |  |  319|    955|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    955|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 955]
  |  |  ------------------
  |  |  320|    955|    goto CLEANUP
  ------------------
 1088|    955|        pR = r;
 1089|    955|    }
 1090|       |
 1091|  18.2k|    if (!q || q == a || q == b) {
  ------------------
  |  Branch (1091:9): [True: 15.2k, False: 2.98k]
  |  Branch (1091:15): [True: 2.98k, False: 0]
  |  Branch (1091:25): [True: 0, False: 0]
  ------------------
 1092|  18.2k|        MP_CHECKOK(mp_init_size(&qtmp, MP_USED(a)));
  ------------------
  |  |  319|  18.2k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  18.2k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 18.2k]
  |  |  ------------------
  |  |  320|  18.2k|    goto CLEANUP
  ------------------
 1093|  18.2k|        pQ = &qtmp;
 1094|  18.2k|    } else {
 1095|      0|        MP_CHECKOK(s_mp_pad(q, MP_USED(a)));
  ------------------
  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  320|      0|    goto CLEANUP
  ------------------
 1096|      0|        pQ = q;
 1097|      0|        mp_zero(pQ);
 1098|      0|    }
 1099|       |
 1100|       |    /*
 1101|       |      If |a| <= |b|, we can compute the solution without division;
 1102|       |      otherwise, we actually do the work required.
 1103|       |     */
 1104|  18.2k|    if ((cmp = s_mp_cmp(a, b)) <= 0) {
  ------------------
  |  Branch (1104:9): [True: 3, False: 18.2k]
  ------------------
 1105|      3|        if (cmp) {
  ------------------
  |  Branch (1105:13): [True: 3, False: 0]
  ------------------
 1106|       |            /* r was set to a above. */
 1107|      3|            mp_zero(pQ);
 1108|      3|        } else {
 1109|      0|            mp_set(pQ, 1);
 1110|      0|            mp_zero(pR);
 1111|      0|        }
 1112|  18.2k|    } else {
 1113|  18.2k|        MP_CHECKOK(mp_init_copy(&btmp, b));
  ------------------
  |  |  319|  18.2k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  18.2k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 18.2k]
  |  |  ------------------
  |  |  320|  18.2k|    goto CLEANUP
  ------------------
 1114|  18.2k|        MP_CHECKOK(s_mp_div(pR, &btmp, pQ));
  ------------------
  |  |  319|  18.2k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  18.2k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 18.2k]
  |  |  ------------------
  |  |  320|  18.2k|    goto CLEANUP
  ------------------
 1115|  18.2k|    }
 1116|       |
 1117|       |    /* Compute the signs for the output  */
 1118|  18.2k|    MP_SIGN(pR) = signA;        /* Sr = Sa              */
  ------------------
  |  |  149|  18.2k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 1119|       |    /* Sq = ZPOS if Sa == Sb */ /* Sq = NEG if Sa != Sb */
 1120|  18.2k|    MP_SIGN(pQ) = (signA == signB) ? ZPOS : NEG;
  ------------------
  |  |  149|  18.2k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(pQ) = (signA == signB) ? ZPOS : NEG;
  ------------------
  |  |  326|  18.1k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  18.1k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
                  MP_SIGN(pQ) = (signA == signB) ? ZPOS : NEG;
  ------------------
  |  |  325|    129|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  18.3k|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1120:19): [True: 18.1k, False: 129]
  ------------------
 1121|       |
 1122|  18.2k|    if (s_mp_cmp_d(pQ, 0) == MP_EQ)
  ------------------
  |  |   50|  18.2k|#define MP_EQ 0
  ------------------
  |  Branch (1122:9): [True: 3, False: 18.2k]
  ------------------
 1123|      3|        SIGN(pQ) = ZPOS;
  ------------------
  |  |  332|      3|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|      3|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(pQ) = ZPOS;
  ------------------
  |  |  326|      3|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|      3|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 1124|  18.2k|    if (s_mp_cmp_d(pR, 0) == MP_EQ)
  ------------------
  |  |   50|  18.2k|#define MP_EQ 0
  ------------------
  |  Branch (1124:9): [True: 221, False: 18.0k]
  ------------------
 1125|    221|        SIGN(pR) = ZPOS;
  ------------------
  |  |  332|    221|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|    221|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(pR) = ZPOS;
  ------------------
  |  |  326|    221|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|    221|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 1126|       |
 1127|       |    /* Copy output, if it is needed      */
 1128|  18.2k|    if (q && q != pQ)
  ------------------
  |  Branch (1128:9): [True: 2.98k, False: 15.2k]
  |  Branch (1128:14): [True: 2.98k, False: 0]
  ------------------
 1129|  2.98k|        s_mp_exch(pQ, q);
 1130|       |
 1131|  18.2k|    if (r && r != pR)
  ------------------
  |  Branch (1131:9): [True: 15.2k, False: 2.98k]
  |  Branch (1131:14): [True: 14.3k, False: 955]
  ------------------
 1132|  14.3k|        s_mp_exch(pR, r);
 1133|       |
 1134|  18.2k|CLEANUP:
 1135|  18.2k|    mp_clear(&btmp);
 1136|  18.2k|    mp_clear(&rtmp);
 1137|  18.2k|    mp_clear(&qtmp);
 1138|       |
 1139|  18.2k|    return res;
 1140|       |
 1141|  18.2k|} /* end mp_div() */
mp_mod:
 1279|  10.7k|{
 1280|  10.7k|    mp_err res;
 1281|  10.7k|    int mag;
 1282|       |
 1283|  10.7k|    ARGCHK(a != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  355|  10.7k|#define ARGCHK(X, Y) assert(X)
  ------------------
 1284|       |
 1285|  10.7k|    if (SIGN(m) == NEG)
  ------------------
  |  |  332|  10.7k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  10.7k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(m) == NEG)
  ------------------
  |  |  325|  10.7k|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  10.7k|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1285:9): [True: 0, False: 10.7k]
  ------------------
 1286|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 1287|       |
 1288|       |    /*
 1289|       |     If |a| > m, we need to divide to get the remainder and take the
 1290|       |     absolute value.
 1291|       |
 1292|       |     If |a| < m, we don't need to do any division, just copy and adjust
 1293|       |     the sign (if a is negative).
 1294|       |
 1295|       |     If |a| == m, we can simply set the result to zero.
 1296|       |
 1297|       |     This order is intended to minimize the average path length of the
 1298|       |     comparison chain on common workloads -- the most frequent cases are
 1299|       |     that |a| != m, so we do those first.
 1300|       |     */
 1301|  10.7k|    if ((mag = s_mp_cmp(a, m)) > 0) {
  ------------------
  |  Branch (1301:9): [True: 4.67k, False: 6.05k]
  ------------------
 1302|  4.67k|        if ((res = mp_div(a, m, NULL, c)) != MP_OKAY)
  ------------------
  |  |   39|  4.67k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1302:13): [True: 0, False: 4.67k]
  ------------------
 1303|      0|            return res;
 1304|       |
 1305|  4.67k|        if (SIGN(c) == NEG) {
  ------------------
  |  |  332|  4.67k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  4.67k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      if (SIGN(c) == NEG) {
  ------------------
  |  |  325|  4.67k|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  4.67k|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1305:13): [True: 129, False: 4.54k]
  ------------------
 1306|    129|            if ((res = mp_add(c, m, c)) != MP_OKAY)
  ------------------
  |  |   39|    129|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1306:17): [True: 0, False: 129]
  ------------------
 1307|      0|                return res;
 1308|    129|        }
 1309|       |
 1310|  6.05k|    } else if (mag < 0) {
  ------------------
  |  Branch (1310:16): [True: 6.05k, False: 1]
  ------------------
 1311|  6.05k|        if ((res = mp_copy(a, c)) != MP_OKAY)
  ------------------
  |  |   39|  6.05k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1311:13): [True: 0, False: 6.05k]
  ------------------
 1312|      0|            return res;
 1313|       |
 1314|  6.05k|        if (mp_cmp_z(a) < 0) {
  ------------------
  |  Branch (1314:13): [True: 324, False: 5.73k]
  ------------------
 1315|    324|            if ((res = mp_add(c, m, c)) != MP_OKAY)
  ------------------
  |  |   39|    324|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1315:17): [True: 0, False: 324]
  ------------------
 1316|      0|                return res;
 1317|    324|        }
 1318|       |
 1319|  6.05k|    } else {
 1320|      1|        mp_zero(c);
 1321|      1|    }
 1322|       |
 1323|  10.7k|    return MP_OKAY;
  ------------------
  |  |   39|  10.7k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 1324|       |
 1325|  10.7k|} /* end mp_mod() */
mp_mulmod:
 1562|  2.58k|{
 1563|  2.58k|    mp_err res;
 1564|       |
 1565|  2.58k|    ARGCHK(a != NULL && b != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  355|  2.58k|#define ARGCHK(X, Y) assert(X)
  ------------------
 1566|       |
 1567|  2.58k|    if ((res = mp_mul(a, b, c)) != MP_OKAY)
  ------------------
  |  |   39|  2.58k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1567:9): [True: 0, False: 2.58k]
  ------------------
 1568|      0|        return res;
 1569|  2.58k|    if ((res = mp_mod(c, m, c)) != MP_OKAY)
  ------------------
  |  |   39|  2.58k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1569:9): [True: 0, False: 2.58k]
  ------------------
 1570|      0|        return res;
 1571|       |
 1572|  2.58k|    return MP_OKAY;
  ------------------
  |  |   39|  2.58k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 1573|  2.58k|}
s_mp_exptmod:
 1645|  2.98k|{
 1646|  2.98k|    mp_int s, x, mu;
 1647|  2.98k|    mp_err res;
 1648|  2.98k|    mp_digit d;
 1649|  2.98k|    unsigned int dig, bit;
 1650|       |
 1651|  2.98k|    ARGCHK(a != NULL && b != NULL && c != NULL && m != NULL, MP_BADARG);
  ------------------
  |  |  355|  2.98k|#define ARGCHK(X, Y) assert(X)
  ------------------
 1652|       |
 1653|  2.98k|    if (mp_cmp_z(b) < 0 || mp_cmp_z(m) <= 0)
  ------------------
  |  Branch (1653:9): [True: 0, False: 2.98k]
  |  Branch (1653:28): [True: 0, False: 2.98k]
  ------------------
 1654|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 1655|       |
 1656|  2.98k|    if ((res = mp_init(&s)) != MP_OKAY)
  ------------------
  |  |   39|  2.98k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1656:9): [True: 0, False: 2.98k]
  ------------------
 1657|      0|        return res;
 1658|  2.98k|    if ((res = mp_init_copy(&x, a)) != MP_OKAY ||
  ------------------
  |  |   39|  5.96k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1658:9): [True: 0, False: 2.98k]
  ------------------
 1659|  2.98k|        (res = mp_mod(&x, m, &x)) != MP_OKAY)
  ------------------
  |  |   39|  2.98k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1659:9): [True: 0, False: 2.98k]
  ------------------
 1660|      0|        goto X;
 1661|  2.98k|    if ((res = mp_init(&mu)) != MP_OKAY)
  ------------------
  |  |   39|  2.98k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1661:9): [True: 0, False: 2.98k]
  ------------------
 1662|      0|        goto MU;
 1663|       |
 1664|  2.98k|    mp_set(&s, 1);
 1665|       |
 1666|       |    /* mu = b^2k / m */
 1667|  2.98k|    if ((res = s_mp_add_d(&mu, 1)) != MP_OKAY)
  ------------------
  |  |   39|  2.98k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1667:9): [True: 0, False: 2.98k]
  ------------------
 1668|      0|        goto CLEANUP;
 1669|  2.98k|    if ((res = s_mp_lshd(&mu, 2 * USED(m))) != MP_OKAY)
  ------------------
  |  |  333|  2.98k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  2.98k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  if ((res = s_mp_lshd(&mu, 2 * USED(m))) != MP_OKAY)
  ------------------
  |  |   39|  2.98k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1669:9): [True: 0, False: 2.98k]
  ------------------
 1670|      0|        goto CLEANUP;
 1671|  2.98k|    if ((res = mp_div(&mu, m, &mu, NULL)) != MP_OKAY)
  ------------------
  |  |   39|  2.98k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1671:9): [True: 0, False: 2.98k]
  ------------------
 1672|      0|        goto CLEANUP;
 1673|       |
 1674|       |    /* Loop over digits of b in ascending order, except highest order */
 1675|  7.16k|    for (dig = 0; dig < (USED(b) - 1); dig++) {
  ------------------
  |  |  333|  7.16k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  7.16k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (1675:19): [True: 4.18k, False: 2.98k]
  ------------------
 1676|  4.18k|        d = DIGIT(b, dig);
  ------------------
  |  |  336|  4.18k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  4.18k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 1677|       |
 1678|       |        /* Loop over the bits of the lower-order digits */
 1679|   272k|        for (bit = 0; bit < DIGIT_BIT; bit++) {
  ------------------
  |  |  328|   272k|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|   272k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   272k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1679:23): [True: 267k, False: 4.18k]
  ------------------
 1680|   267k|            if (d & 1) {
  ------------------
  |  Branch (1680:17): [True: 131k, False: 136k]
  ------------------
 1681|   131k|                if ((res = s_mp_mul(&s, &x)) != MP_OKAY)
  ------------------
  |  |   39|   131k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1681:21): [True: 0, False: 131k]
  ------------------
 1682|      0|                    goto CLEANUP;
 1683|   131k|                if ((res = s_mp_reduce(&s, m, &mu)) != MP_OKAY)
  ------------------
  |  |   39|   131k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1683:21): [True: 0, False: 131k]
  ------------------
 1684|      0|                    goto CLEANUP;
 1685|   131k|            }
 1686|       |
 1687|   267k|            d >>= 1;
 1688|       |
 1689|   267k|            if ((res = s_mp_sqr(&x)) != MP_OKAY)
  ------------------
  |  |   39|   267k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1689:17): [True: 0, False: 267k]
  ------------------
 1690|      0|                goto CLEANUP;
 1691|   267k|            if ((res = s_mp_reduce(&x, m, &mu)) != MP_OKAY)
  ------------------
  |  |   39|   267k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1691:17): [True: 0, False: 267k]
  ------------------
 1692|      0|                goto CLEANUP;
 1693|   267k|        }
 1694|  4.18k|    }
 1695|       |
 1696|       |    /* Now do the last digit... */
 1697|  2.98k|    d = DIGIT(b, dig);
  ------------------
  |  |  336|  2.98k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  2.98k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 1698|       |
 1699|  88.1k|    while (d) {
  ------------------
  |  Branch (1699:12): [True: 85.1k, False: 2.98k]
  ------------------
 1700|  85.1k|        if (d & 1) {
  ------------------
  |  Branch (1700:13): [True: 41.7k, False: 43.3k]
  ------------------
 1701|  41.7k|            if ((res = s_mp_mul(&s, &x)) != MP_OKAY)
  ------------------
  |  |   39|  41.7k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1701:17): [True: 0, False: 41.7k]
  ------------------
 1702|      0|                goto CLEANUP;
 1703|  41.7k|            if ((res = s_mp_reduce(&s, m, &mu)) != MP_OKAY)
  ------------------
  |  |   39|  41.7k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1703:17): [True: 0, False: 41.7k]
  ------------------
 1704|      0|                goto CLEANUP;
 1705|  41.7k|        }
 1706|       |
 1707|  85.1k|        d >>= 1;
 1708|       |
 1709|  85.1k|        if ((res = s_mp_sqr(&x)) != MP_OKAY)
  ------------------
  |  |   39|  85.1k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1709:13): [True: 0, False: 85.1k]
  ------------------
 1710|      0|            goto CLEANUP;
 1711|  85.1k|        if ((res = s_mp_reduce(&x, m, &mu)) != MP_OKAY)
  ------------------
  |  |   39|  85.1k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (1711:13): [True: 0, False: 85.1k]
  ------------------
 1712|      0|            goto CLEANUP;
 1713|  85.1k|    }
 1714|       |
 1715|  2.98k|    s_mp_exch(&s, c);
 1716|       |
 1717|  2.98k|CLEANUP:
 1718|  2.98k|    mp_clear(&mu);
 1719|  2.98k|MU:
 1720|  2.98k|    mp_clear(&x);
 1721|  2.98k|X:
 1722|  2.98k|    mp_clear(&s);
 1723|       |
 1724|  2.98k|    return res;
 1725|       |
 1726|  2.98k|} /* end s_mp_exptmod() */
mp_cmp_z:
 1790|  1.12M|{
 1791|  1.12M|    ARGMPCHK(a != NULL);
  ------------------
  |  |  354|  1.12M|#define ARGMPCHK(X) assert(X)
  ------------------
 1792|       |
 1793|  1.12M|    if (SIGN(a) == NEG)
  ------------------
  |  |  332|  1.12M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  1.12M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == NEG)
  ------------------
  |  |  325|  1.12M|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  1.12M|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1793:9): [True: 16.8k, False: 1.10M]
  ------------------
 1794|  16.8k|        return MP_LT;
  ------------------
  |  |   49|  16.8k|#define MP_LT -1
  ------------------
 1795|  1.10M|    else if (USED(a) == 1 && DIGIT(a, 0) == 0)
  ------------------
  |  |  333|  1.10M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  1.10M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  else if (USED(a) == 1 && DIGIT(a, 0) == 0)
  ------------------
  |  |  336|  89.0k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  89.0k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (1795:14): [True: 89.0k, False: 1.01M]
  |  Branch (1795:30): [True: 59.7k, False: 29.3k]
  ------------------
 1796|  59.7k|        return MP_EQ;
  ------------------
  |  |   50|  59.7k|#define MP_EQ 0
  ------------------
 1797|  1.04M|    else
 1798|  1.04M|        return MP_GT;
  ------------------
  |  |   51|  1.04M|#define MP_GT 1
  ------------------
 1799|       |
 1800|  1.12M|} /* end mp_cmp_z() */
mp_cmp_d:
 1814|  9.64k|{
 1815|  9.64k|    ARGCHK(a != NULL, MP_EQ);
  ------------------
  |  |  355|  9.64k|#define ARGCHK(X, Y) assert(X)
  ------------------
 1816|       |
 1817|  9.64k|    if (SIGN(a) == NEG)
  ------------------
  |  |  332|  9.64k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  9.64k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == NEG)
  ------------------
  |  |  325|  9.64k|#define NEG MP_NEG
  |  |  ------------------
  |  |  |  |   36|  9.64k|#define MP_NEG 1
  |  |  ------------------
  ------------------
  |  Branch (1817:9): [True: 0, False: 9.64k]
  ------------------
 1818|      0|        return MP_LT;
  ------------------
  |  |   49|      0|#define MP_LT -1
  ------------------
 1819|       |
 1820|  9.64k|    return s_mp_cmp_d(a, d);
 1821|       |
 1822|  9.64k|} /* end mp_cmp_d() */
mp_cmp:
 1830|   879k|{
 1831|   879k|    ARGCHK(a != NULL && b != NULL, MP_EQ);
  ------------------
  |  |  355|   879k|#define ARGCHK(X, Y) assert(X)
  ------------------
 1832|       |
 1833|   879k|    if (SIGN(a) == SIGN(b)) {
  ------------------
  |  |  332|   879k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   879k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  if (SIGN(a) == SIGN(b)) {
  ------------------
  |  |  332|   879k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   879k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
  |  Branch (1833:9): [True: 879k, False: 0]
  ------------------
 1834|   879k|        int mag;
 1835|       |
 1836|   879k|        if ((mag = s_mp_cmp(a, b)) == MP_EQ)
  ------------------
  |  |   50|   879k|#define MP_EQ 0
  ------------------
  |  Branch (1836:13): [True: 1.05k, False: 878k]
  ------------------
 1837|  1.05k|            return MP_EQ;
  ------------------
  |  |   50|  1.05k|#define MP_EQ 0
  ------------------
 1838|       |
 1839|   878k|        if (SIGN(a) == ZPOS)
  ------------------
  |  |  332|   878k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   878k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      if (SIGN(a) == ZPOS)
  ------------------
  |  |  326|   878k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|   878k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  |  Branch (1839:13): [True: 878k, False: 0]
  ------------------
 1840|   878k|            return mag;
 1841|      0|        else
 1842|      0|            return -mag;
 1843|       |
 1844|   878k|    } else if (SIGN(a) == ZPOS) {
  ------------------
  |  |  332|      0|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|      0|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  } else if (SIGN(a) == ZPOS) {
  ------------------
  |  |  326|      0|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|      0|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
  |  Branch (1844:16): [True: 0, False: 0]
  ------------------
 1845|      0|        return MP_GT;
  ------------------
  |  |   51|      0|#define MP_GT 1
  ------------------
 1846|      0|    } else {
 1847|      0|        return MP_LT;
  ------------------
  |  |   49|      0|#define MP_LT -1
  ------------------
 1848|      0|    }
 1849|       |
 1850|   879k|} /* end mp_cmp() */
mp_isodd:
 1882|  12.6k|{
 1883|  12.6k|    ARGMPCHK(a != NULL);
  ------------------
  |  |  354|  12.6k|#define ARGMPCHK(X) assert(X)
  ------------------
 1884|       |
 1885|  12.6k|    return (int)(DIGIT(a, 0) & 1);
  ------------------
  |  |  336|  12.6k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  12.6k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 1886|       |
 1887|  12.6k|} /* end mp_isodd() */
mp_iseven:
 1895|  3.40k|{
 1896|  3.40k|    return !mp_isodd(a);
 1897|       |
 1898|  3.40k|} /* end mp_iseven() */
mp_trailing_zeros:
 2185|    858|{
 2186|    858|    mp_digit d;
 2187|    858|    mp_size n = 0;
 2188|    858|    unsigned int ix;
 2189|       |
 2190|    858|    if (!mp || !MP_DIGITS(mp) || !mp_cmp_z(mp))
  ------------------
  |  |  152|  1.71k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  |  Branch (2190:9): [True: 0, False: 858]
  |  Branch (2190:16): [True: 0, False: 858]
  |  Branch (2190:34): [True: 0, False: 858]
  ------------------
 2191|      0|        return n;
 2192|       |
 2193|  1.69k|    for (ix = 0; !(d = MP_DIGIT(mp, ix)) && (ix < MP_USED(mp)); ++ix)
  ------------------
  |  |  153|  1.69k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
                  for (ix = 0; !(d = MP_DIGIT(mp, ix)) && (ix < MP_USED(mp)); ++ix)
  ------------------
  |  |  150|    840|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (2193:18): [True: 840, False: 858]
  |  Branch (2193:45): [True: 840, False: 0]
  ------------------
 2194|    840|        n += MP_DIGIT_BIT;
  ------------------
  |  |  137|  1.69k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|    840|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 2195|    858|    if (!d)
  ------------------
  |  Branch (2195:9): [True: 0, False: 858]
  ------------------
 2196|      0|        return 0; /* shouldn't happen, but ... */
 2197|    858|#if !defined(MP_USE_UINT_DIGIT)
 2198|    858|    if (!(d & 0xffffffffU)) {
  ------------------
  |  Branch (2198:9): [True: 343, False: 515]
  ------------------
 2199|    343|        d >>= 32;
 2200|    343|        n += 32;
 2201|    343|    }
 2202|    858|#endif
 2203|    858|    if (!(d & 0xffffU)) {
  ------------------
  |  Branch (2203:9): [True: 184, False: 674]
  ------------------
 2204|    184|        d >>= 16;
 2205|    184|        n += 16;
 2206|    184|    }
 2207|    858|    if (!(d & 0xffU)) {
  ------------------
  |  Branch (2207:9): [True: 305, False: 553]
  ------------------
 2208|    305|        d >>= 8;
 2209|    305|        n += 8;
 2210|    305|    }
 2211|    858|    if (!(d & 0xfU)) {
  ------------------
  |  Branch (2211:9): [True: 118, False: 740]
  ------------------
 2212|    118|        d >>= 4;
 2213|    118|        n += 4;
 2214|    118|    }
 2215|    858|    if (!(d & 0x3U)) {
  ------------------
  |  Branch (2215:9): [True: 352, False: 506]
  ------------------
 2216|    352|        d >>= 2;
 2217|    352|        n += 2;
 2218|    352|    }
 2219|    858|    if (!(d & 0x1U)) {
  ------------------
  |  Branch (2219:9): [True: 314, False: 544]
  ------------------
 2220|    314|        d >>= 1;
 2221|    314|        n += 1;
 2222|    314|    }
 2223|    858|#if MP_ARGCHK == 2
 2224|    858|    assert(0 != (d & 1));
 2225|    858|#endif
 2226|    858|    return n;
 2227|    858|}
s_mp_invmod_radix:
 2311|  5.97k|{
 2312|  5.97k|    mp_digit T = P;
 2313|  5.97k|    T *= 2 - (P * T);
 2314|  5.97k|    T *= 2 - (P * T);
 2315|  5.97k|    T *= 2 - (P * T);
 2316|  5.97k|    T *= 2 - (P * T);
 2317|  5.97k|#if !defined(MP_USE_UINT_DIGIT)
 2318|  5.97k|    T *= 2 - (P * T);
 2319|  5.97k|    T *= 2 - (P * T);
 2320|  5.97k|#endif
 2321|  5.97k|    return T;
 2322|  5.97k|}
s_mp_invmod_odd_m:
 2374|    898|{
 2375|    898|    mp_err res;
 2376|    898|    mp_digit cond = 0;
 2377|    898|    mp_int g, f, v, r, temp;
 2378|    898|    int i, its, delta = 1, last = -1;
 2379|    898|    mp_size top, flen, glen;
 2380|    898|    mp_int *clear[6];
 2381|       |
 2382|    898|    ARGCHK(a != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  355|    898|#define ARGCHK(X, Y) assert(X)
  ------------------
 2383|       |    /* Check for invalid inputs. */
 2384|    898|    if (mp_cmp_z(a) == MP_EQ || mp_cmp_d(m, 2) == MP_LT)
  ------------------
  |  |   50|  1.79k|#define MP_EQ 0
  ------------------
                  if (mp_cmp_z(a) == MP_EQ || mp_cmp_d(m, 2) == MP_LT)
  ------------------
  |  |   49|    898|#define MP_LT -1
  ------------------
  |  Branch (2384:9): [True: 0, False: 898]
  |  Branch (2384:33): [True: 0, False: 898]
  ------------------
 2385|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 2386|       |
 2387|    898|    if (a == m || mp_iseven(m))
  ------------------
  |  Branch (2387:9): [True: 0, False: 898]
  |  Branch (2387:19): [True: 0, False: 898]
  ------------------
 2388|      0|        return MP_UNDEF;
  ------------------
  |  |   45|      0|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
 2389|       |
 2390|    898|    MP_CHECKOK(mp_init(&temp));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2391|    898|    clear[++last] = &temp;
 2392|    898|    MP_CHECKOK(mp_init(&v));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2393|    898|    clear[++last] = &v;
 2394|    898|    MP_CHECKOK(mp_init(&r));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2395|    898|    clear[++last] = &r;
 2396|    898|    MP_CHECKOK(mp_init_copy(&g, a));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2397|    898|    clear[++last] = &g;
 2398|    898|    MP_CHECKOK(mp_init_copy(&f, m));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2399|    898|    clear[++last] = &f;
 2400|       |
 2401|    898|    mp_set(&v, 0);
 2402|    898|    mp_set(&r, 1);
 2403|       |
 2404|       |    /* Allocate to the size of largest mp_int. */
 2405|    898|    top = (mp_size)1 + ((USED(&f) >= USED(&g)) ? USED(&f) : USED(&g));
  ------------------
  |  |  333|    898|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|    898|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  top = (mp_size)1 + ((USED(&f) >= USED(&g)) ? USED(&f) : USED(&g));
  ------------------
  |  |  333|    898|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|    898|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  top = (mp_size)1 + ((USED(&f) >= USED(&g)) ? USED(&f) : USED(&g));
  ------------------
  |  |  333|    313|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|    313|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  top = (mp_size)1 + ((USED(&f) >= USED(&g)) ? USED(&f) : USED(&g));
  ------------------
  |  |  333|    585|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|    585|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (2405:25): [True: 313, False: 585]
  ------------------
 2406|    898|    MP_CHECKOK(s_mp_grow(&f, top));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2407|    898|    MP_CHECKOK(s_mp_grow(&g, top));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2408|    898|    MP_CHECKOK(s_mp_grow(&temp, top));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2409|    898|    MP_CHECKOK(s_mp_grow(&v, top));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2410|    898|    MP_CHECKOK(s_mp_grow(&r, top));
  ------------------
  |  |  319|    898|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    898|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 898]
  |  |  ------------------
  |  |  320|    898|    goto CLEANUP
  ------------------
 2411|       |
 2412|       |    /* Upper bound for the total iterations. */
 2413|    898|    flen = mpl_significant_bits(&f);
 2414|    898|    glen = mpl_significant_bits(&g);
 2415|    898|    its = 4 + 3 * ((flen >= glen) ? flen : glen);
  ------------------
  |  Branch (2415:20): [True: 226, False: 672]
  ------------------
 2416|       |
 2417|       |#if defined(_MSC_VER)
 2418|       |#pragma warning(push)
 2419|       |#pragma warning(disable : 4146) // Thanks MSVC, we know what we're negating an unsigned mp_digit
 2420|       |#endif
 2421|       |
 2422|   613k|    for (i = 0; i < its; i++) {
  ------------------
  |  Branch (2422:17): [True: 612k, False: 898]
  ------------------
 2423|       |        /* Step 1: conditional swap. */
 2424|       |        /* Set cond if delta > 0 and g is odd. */
 2425|   612k|        cond = (-delta >> (8 * sizeof(delta) - 1)) & DIGIT(&g, 0) & 1;
  ------------------
  |  |  336|   612k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|   612k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 2426|       |        /* If cond is set replace (delta,f,v) with (-delta,-f,-v). */
 2427|   612k|        delta = (-cond & -delta) | ((cond - 1) & delta);
 2428|   612k|        SIGN(&f) ^= cond;
  ------------------
  |  |  332|   612k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   612k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 2429|   612k|        SIGN(&v) ^= cond;
  ------------------
  |  |  332|   612k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|   612k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 2430|       |        /* If cond is set swap (f,v) with (g,r). */
 2431|   612k|        MP_CHECKOK(mp_cswap(cond, &f, &g, top));
  ------------------
  |  |  319|   612k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   612k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 612k]
  |  |  ------------------
  |  |  320|   612k|    goto CLEANUP
  ------------------
 2432|   612k|        MP_CHECKOK(mp_cswap(cond, &v, &r, top));
  ------------------
  |  |  319|   612k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   612k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 612k]
  |  |  ------------------
  |  |  320|   612k|    goto CLEANUP
  ------------------
 2433|       |
 2434|       |        /* Step 2: elemination. */
 2435|       |        /* Update delta */
 2436|   612k|        delta++;
 2437|       |        /* If g is odd replace r with (r+v). */
 2438|   612k|        MP_CHECKOK(mp_add(&r, &v, &temp));
  ------------------
  |  |  319|   612k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   612k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 612k]
  |  |  ------------------
  |  |  320|   612k|    goto CLEANUP
  ------------------
 2439|   612k|        MP_CHECKOK(mp_cswap((DIGIT(&g, 0) & 1), &r, &temp, top));
  ------------------
  |  |  319|   612k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   612k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 612k]
  |  |  ------------------
  |  |  320|   612k|    goto CLEANUP
  ------------------
 2440|       |        /* If g is odd, right shift (g+f) else right shift g. */
 2441|   612k|        MP_CHECKOK(mp_add(&g, &f, &temp));
  ------------------
  |  |  319|   612k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   612k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 612k]
  |  |  ------------------
  |  |  320|   612k|    goto CLEANUP
  ------------------
 2442|   612k|        MP_CHECKOK(mp_cswap((DIGIT(&g, 0) & 1), &g, &temp, top));
  ------------------
  |  |  319|   612k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   612k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 612k]
  |  |  ------------------
  |  |  320|   612k|    goto CLEANUP
  ------------------
 2443|   612k|        s_mp_div_2(&g);
 2444|       |        /*
 2445|       |        If r is even, right shift it.
 2446|       |        If r is odd, right shift (r+m) which is even because m is odd.
 2447|       |        We want the result modulo m so adding in multiples of m here vanish.
 2448|       |        */
 2449|   612k|        MP_CHECKOK(mp_add(&r, m, &temp));
  ------------------
  |  |  319|   612k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   612k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 612k]
  |  |  ------------------
  |  |  320|   612k|    goto CLEANUP
  ------------------
 2450|   612k|        MP_CHECKOK(mp_cswap((DIGIT(&r, 0) & 1), &r, &temp, top));
  ------------------
  |  |  319|   612k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   612k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 612k]
  |  |  ------------------
  |  |  320|   612k|    goto CLEANUP
  ------------------
 2451|   612k|        s_mp_div_2(&r);
 2452|   612k|    }
 2453|       |
 2454|       |#if defined(_MSC_VER)
 2455|       |#pragma warning(pop)
 2456|       |#endif
 2457|       |
 2458|       |    /* We have the inverse in v, propagate sign from f. */
 2459|    898|    SIGN(&v) ^= SIGN(&f);
  ------------------
  |  |  332|    898|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|    898|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(&v) ^= SIGN(&f);
  ------------------
  |  |  332|    898|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|    898|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 2460|       |    /* GCD is in f, take the absolute value. */
 2461|    898|    SIGN(&f) = ZPOS;
  ------------------
  |  |  332|    898|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|    898|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  SIGN(&f) = ZPOS;
  ------------------
  |  |  326|    898|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|    898|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 2462|       |
 2463|       |    /* If gcd != 1, not invertible. */
 2464|    898|    if (mp_cmp_d(&f, 1) != MP_EQ) {
  ------------------
  |  |   50|    898|#define MP_EQ 0
  ------------------
  |  Branch (2464:9): [True: 47, False: 851]
  ------------------
 2465|     47|        res = MP_UNDEF;
  ------------------
  |  |   45|     47|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
 2466|     47|        goto CLEANUP;
 2467|     47|    }
 2468|       |
 2469|       |    /* Return inverse modulo m. */
 2470|    851|    MP_CHECKOK(mp_mod(&v, m, c));
  ------------------
  |  |  319|    851|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    851|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 851]
  |  |  ------------------
  |  |  320|    851|    goto CLEANUP
  ------------------
 2471|       |
 2472|    898|CLEANUP:
 2473|  5.38k|    while (last >= 0)
  ------------------
  |  Branch (2473:12): [True: 4.49k, False: 898]
  ------------------
 2474|  4.49k|        mp_clear(clear[last--]);
 2475|    898|    return res;
 2476|    851|}
s_mp_invmod_2d:
 2516|  1.63k|{
 2517|  1.63k|    mp_err res;
 2518|  1.63k|    mp_size ix = k + 4;
 2519|  1.63k|    mp_int t0, t1, val, tmp, two2k;
 2520|       |
 2521|  1.63k|    static const mp_digit d2 = 2;
 2522|  1.63k|    static const mp_int two = { MP_ZPOS, 1, 1, (mp_digit *)&d2 };
  ------------------
  |  |   37|  1.63k|#define MP_ZPOS 0
  ------------------
 2523|       |
 2524|  1.63k|    if (mp_iseven(a))
  ------------------
  |  Branch (2524:9): [True: 0, False: 1.63k]
  ------------------
 2525|      0|        return MP_UNDEF;
  ------------------
  |  |   45|      0|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
 2526|       |
 2527|       |#if defined(_MSC_VER)
 2528|       |#pragma warning(push)
 2529|       |#pragma warning(disable : 4146) // Thanks MSVC, we know what we're negating an unsigned mp_digit
 2530|       |#endif
 2531|  1.63k|    if (k <= MP_DIGIT_BIT) {
  ------------------
  |  |  137|  1.63k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|  1.63k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  |  Branch (2531:9): [True: 600, False: 1.03k]
  ------------------
 2532|    600|        mp_digit i = s_mp_invmod_radix(MP_DIGIT(a, 0));
  ------------------
  |  |  153|    600|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 2533|       |        /* propagate the sign from mp_int */
 2534|    600|        i = (i ^ -(mp_digit)SIGN(a)) + (mp_digit)SIGN(a);
  ------------------
  |  |  332|    600|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|    600|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      i = (i ^ -(mp_digit)SIGN(a)) + (mp_digit)SIGN(a);
  ------------------
  |  |  332|    600|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|    600|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 2535|    600|        if (k < MP_DIGIT_BIT)
  ------------------
  |  |  137|    600|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|    600|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  |  Branch (2535:13): [True: 592, False: 8]
  ------------------
 2536|    592|            i &= ((mp_digit)1 << k) - (mp_digit)1;
 2537|    600|        mp_set(c, i);
 2538|    600|        return MP_OKAY;
  ------------------
  |  |   39|    600|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 2539|    600|    }
 2540|       |#if defined(_MSC_VER)
 2541|       |#pragma warning(pop)
 2542|       |#endif
 2543|       |
 2544|  1.03k|    MP_DIGITS(&t0) = 0;
  ------------------
  |  |  152|  1.03k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2545|  1.03k|    MP_DIGITS(&t1) = 0;
  ------------------
  |  |  152|  1.03k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2546|  1.03k|    MP_DIGITS(&val) = 0;
  ------------------
  |  |  152|  1.03k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2547|  1.03k|    MP_DIGITS(&tmp) = 0;
  ------------------
  |  |  152|  1.03k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2548|  1.03k|    MP_DIGITS(&two2k) = 0;
  ------------------
  |  |  152|  1.03k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2549|  1.03k|    MP_CHECKOK(mp_init_copy(&val, a));
  ------------------
  |  |  319|  1.03k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.03k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 1.03k]
  |  |  ------------------
  |  |  320|  1.03k|    goto CLEANUP
  ------------------
 2550|  1.03k|    s_mp_mod_2d(&val, k);
 2551|  1.03k|    MP_CHECKOK(mp_init_copy(&t0, &val));
  ------------------
  |  |  319|  1.03k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.03k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 1.03k]
  |  |  ------------------
  |  |  320|  1.03k|    goto CLEANUP
  ------------------
 2552|  1.03k|    MP_CHECKOK(mp_init_copy(&t1, &t0));
  ------------------
  |  |  319|  1.03k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.03k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 1.03k]
  |  |  ------------------
  |  |  320|  1.03k|    goto CLEANUP
  ------------------
 2553|  1.03k|    MP_CHECKOK(mp_init(&tmp));
  ------------------
  |  |  319|  1.03k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.03k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 1.03k]
  |  |  ------------------
  |  |  320|  1.03k|    goto CLEANUP
  ------------------
 2554|  1.03k|    MP_CHECKOK(mp_init(&two2k));
  ------------------
  |  |  319|  1.03k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.03k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 1.03k]
  |  |  ------------------
  |  |  320|  1.03k|    goto CLEANUP
  ------------------
 2555|  1.03k|    MP_CHECKOK(s_mp_2expt(&two2k, k));
  ------------------
  |  |  319|  1.03k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.03k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 1.03k]
  |  |  ------------------
  |  |  320|  1.03k|    goto CLEANUP
  ------------------
 2556|  5.04k|    do {
 2557|  5.04k|        MP_CHECKOK(mp_mul(&val, &t1, &tmp));
  ------------------
  |  |  319|  5.04k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.04k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.04k]
  |  |  ------------------
  |  |  320|  5.04k|    goto CLEANUP
  ------------------
 2558|  5.04k|        MP_CHECKOK(mp_sub(&two, &tmp, &tmp));
  ------------------
  |  |  319|  5.04k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.04k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.04k]
  |  |  ------------------
  |  |  320|  5.04k|    goto CLEANUP
  ------------------
 2559|  5.04k|        MP_CHECKOK(mp_mul(&t1, &tmp, &t1));
  ------------------
  |  |  319|  5.04k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.04k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.04k]
  |  |  ------------------
  |  |  320|  5.04k|    goto CLEANUP
  ------------------
 2560|  5.04k|        s_mp_mod_2d(&t1, k);
 2561|  10.0k|        while (MP_SIGN(&t1) != MP_ZPOS) {
  ------------------
  |  |  149|  10.0k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                      while (MP_SIGN(&t1) != MP_ZPOS) {
  ------------------
  |  |   37|  10.0k|#define MP_ZPOS 0
  ------------------
  |  Branch (2561:16): [True: 5.02k, False: 5.04k]
  ------------------
 2562|  5.02k|            MP_CHECKOK(mp_add(&t1, &two2k, &t1));
  ------------------
  |  |  319|  5.02k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.02k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.02k]
  |  |  ------------------
  |  |  320|  5.02k|    goto CLEANUP
  ------------------
 2563|  5.02k|        }
 2564|  5.04k|        if (mp_cmp(&t1, &t0) == MP_EQ)
  ------------------
  |  |   50|  5.04k|#define MP_EQ 0
  ------------------
  |  Branch (2564:13): [True: 1.03k, False: 4.00k]
  ------------------
 2565|  1.03k|            break;
 2566|  4.00k|        MP_CHECKOK(mp_copy(&t1, &t0));
  ------------------
  |  |  319|  4.00k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.00k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 4.00k]
  |  |  ------------------
  |  |  320|  4.00k|    goto CLEANUP
  ------------------
 2567|  4.00k|    } while (--ix > 0);
  ------------------
  |  Branch (2567:14): [True: 4.00k, False: 0]
  ------------------
 2568|  1.03k|    if (!ix) {
  ------------------
  |  Branch (2568:9): [True: 0, False: 1.03k]
  ------------------
 2569|      0|        res = MP_UNDEF;
  ------------------
  |  |   45|      0|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
 2570|  1.03k|    } else {
 2571|  1.03k|        mp_exch(c, &t1);
 2572|  1.03k|    }
 2573|       |
 2574|  1.03k|CLEANUP:
 2575|  1.03k|    mp_clear(&t0);
 2576|  1.03k|    mp_clear(&t1);
 2577|  1.03k|    mp_clear(&val);
 2578|  1.03k|    mp_clear(&tmp);
 2579|  1.03k|    mp_clear(&two2k);
 2580|  1.03k|    return res;
 2581|  1.03k|}
s_mp_invmod_even_m:
 2585|    867|{
 2586|    867|    mp_err res;
 2587|    867|    mp_size k;
 2588|    867|    mp_int oddFactor, evenFactor; /* factors of the modulus */
 2589|    867|    mp_int oddPart, evenPart;     /* parts to combine via CRT. */
 2590|    867|    mp_int C2, tmp1, tmp2;
 2591|       |
 2592|    867|    ARGCHK(a != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  355|    867|#define ARGCHK(X, Y) assert(X)
  ------------------
 2593|       |
 2594|       |    /*static const mp_digit d1 = 1; */
 2595|       |    /*static const mp_int one = { MP_ZPOS, 1, 1, (mp_digit *)&d1 }; */
 2596|       |
 2597|    867|    if ((res = s_mp_ispow2(m)) >= 0) {
  ------------------
  |  Branch (2597:9): [True: 9, False: 858]
  ------------------
 2598|      9|        k = res;
 2599|      9|        return s_mp_invmod_2d(a, k, c);
 2600|      9|    }
 2601|    858|    MP_DIGITS(&oddFactor) = 0;
  ------------------
  |  |  152|    858|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2602|    858|    MP_DIGITS(&evenFactor) = 0;
  ------------------
  |  |  152|    858|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2603|    858|    MP_DIGITS(&oddPart) = 0;
  ------------------
  |  |  152|    858|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2604|    858|    MP_DIGITS(&evenPart) = 0;
  ------------------
  |  |  152|    858|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2605|    858|    MP_DIGITS(&C2) = 0;
  ------------------
  |  |  152|    858|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2606|    858|    MP_DIGITS(&tmp1) = 0;
  ------------------
  |  |  152|    858|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2607|    858|    MP_DIGITS(&tmp2) = 0;
  ------------------
  |  |  152|    858|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 2608|       |
 2609|    858|    MP_CHECKOK(mp_init_copy(&oddFactor, m)); /* oddFactor = m */
  ------------------
  |  |  319|    858|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    858|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 858]
  |  |  ------------------
  |  |  320|    858|    goto CLEANUP
  ------------------
 2610|    858|    MP_CHECKOK(mp_init(&evenFactor));
  ------------------
  |  |  319|    858|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    858|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 858]
  |  |  ------------------
  |  |  320|    858|    goto CLEANUP
  ------------------
 2611|    858|    MP_CHECKOK(mp_init(&oddPart));
  ------------------
  |  |  319|    858|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    858|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 858]
  |  |  ------------------
  |  |  320|    858|    goto CLEANUP
  ------------------
 2612|    858|    MP_CHECKOK(mp_init(&evenPart));
  ------------------
  |  |  319|    858|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    858|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 858]
  |  |  ------------------
  |  |  320|    858|    goto CLEANUP
  ------------------
 2613|    858|    MP_CHECKOK(mp_init(&C2));
  ------------------
  |  |  319|    858|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    858|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 858]
  |  |  ------------------
  |  |  320|    858|    goto CLEANUP
  ------------------
 2614|    858|    MP_CHECKOK(mp_init(&tmp1));
  ------------------
  |  |  319|    858|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    858|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 858]
  |  |  ------------------
  |  |  320|    858|    goto CLEANUP
  ------------------
 2615|    858|    MP_CHECKOK(mp_init(&tmp2));
  ------------------
  |  |  319|    858|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    858|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 858]
  |  |  ------------------
  |  |  320|    858|    goto CLEANUP
  ------------------
 2616|       |
 2617|    858|    k = mp_trailing_zeros(m);
 2618|    858|    s_mp_div_2d(&oddFactor, k);
 2619|    858|    MP_CHECKOK(s_mp_2expt(&evenFactor, k));
  ------------------
  |  |  319|    858|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    858|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 858]
  |  |  ------------------
  |  |  320|    858|    goto CLEANUP
  ------------------
 2620|       |
 2621|       |    /* compute a**-1 mod oddFactor. */
 2622|    858|    MP_CHECKOK(s_mp_invmod_odd_m(a, &oddFactor, &oddPart));
  ------------------
  |  |  319|    858|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    858|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 43, False: 815]
  |  |  ------------------
  |  |  320|    858|    goto CLEANUP
  ------------------
 2623|       |    /* compute a**-1 mod evenFactor, where evenFactor == 2**k. */
 2624|    815|    MP_CHECKOK(s_mp_invmod_2d(a, k, &evenPart));
  ------------------
  |  |  319|    815|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    815|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 815]
  |  |  ------------------
  |  |  320|    815|    goto CLEANUP
  ------------------
 2625|       |
 2626|       |    /* Use Chinese Remainer theorem to compute a**-1 mod m. */
 2627|       |    /* let m1 = oddFactor,  v1 = oddPart,
 2628|       |     * let m2 = evenFactor, v2 = evenPart.
 2629|       |     */
 2630|       |
 2631|       |    /* Compute C2 = m1**-1 mod m2. */
 2632|    815|    MP_CHECKOK(s_mp_invmod_2d(&oddFactor, k, &C2));
  ------------------
  |  |  319|    815|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    815|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 815]
  |  |  ------------------
  |  |  320|    815|    goto CLEANUP
  ------------------
 2633|       |
 2634|       |    /* compute u = (v2 - v1)*C2 mod m2 */
 2635|    815|    MP_CHECKOK(mp_sub(&evenPart, &oddPart, &tmp1));
  ------------------
  |  |  319|    815|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    815|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 815]
  |  |  ------------------
  |  |  320|    815|    goto CLEANUP
  ------------------
 2636|    815|    MP_CHECKOK(mp_mul(&tmp1, &C2, &tmp2));
  ------------------
  |  |  319|    815|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    815|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 815]
  |  |  ------------------
  |  |  320|    815|    goto CLEANUP
  ------------------
 2637|    815|    s_mp_mod_2d(&tmp2, k);
 2638|  1.33k|    while (MP_SIGN(&tmp2) != MP_ZPOS) {
  ------------------
  |  |  149|  1.33k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  while (MP_SIGN(&tmp2) != MP_ZPOS) {
  ------------------
  |  |   37|  1.33k|#define MP_ZPOS 0
  ------------------
  |  Branch (2638:12): [True: 516, False: 815]
  ------------------
 2639|    516|        MP_CHECKOK(mp_add(&tmp2, &evenFactor, &tmp2));
  ------------------
  |  |  319|    516|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    516|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 516]
  |  |  ------------------
  |  |  320|    516|    goto CLEANUP
  ------------------
 2640|    516|    }
 2641|       |
 2642|       |    /* compute answer = v1 + u*m1 */
 2643|    815|    MP_CHECKOK(mp_mul(&tmp2, &oddFactor, c));
  ------------------
  |  |  319|    815|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    815|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 815]
  |  |  ------------------
  |  |  320|    815|    goto CLEANUP
  ------------------
 2644|    815|    MP_CHECKOK(mp_add(&oddPart, c, c));
  ------------------
  |  |  319|    815|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    815|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 815]
  |  |  ------------------
  |  |  320|    815|    goto CLEANUP
  ------------------
 2645|       |    /* not sure this is necessary, but it's low cost if not. */
 2646|    815|    MP_CHECKOK(mp_mod(c, m, c));
  ------------------
  |  |  319|    815|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    815|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 815]
  |  |  ------------------
  |  |  320|    815|    goto CLEANUP
  ------------------
 2647|       |
 2648|    858|CLEANUP:
 2649|    858|    mp_clear(&oddFactor);
 2650|    858|    mp_clear(&evenFactor);
 2651|    858|    mp_clear(&oddPart);
 2652|    858|    mp_clear(&evenPart);
 2653|    858|    mp_clear(&C2);
 2654|    858|    mp_clear(&tmp1);
 2655|    858|    mp_clear(&tmp2);
 2656|    858|    return res;
 2657|    815|}
mp_invmod:
 2671|    911|{
 2672|    911|    ARGCHK(a != NULL && m != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  355|    911|#define ARGCHK(X, Y) assert(X)
  ------------------
 2673|       |
 2674|    911|    if (mp_cmp_z(a) == 0 || mp_cmp_z(m) == 0)
  ------------------
  |  Branch (2674:9): [True: 0, False: 911]
  |  Branch (2674:29): [True: 0, False: 911]
  ------------------
 2675|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 2676|       |
 2677|    911|    if (mp_isodd(m)) {
  ------------------
  |  Branch (2677:9): [True: 40, False: 871]
  ------------------
 2678|     40|        return s_mp_invmod_odd_m(a, m, c);
 2679|     40|    }
 2680|    871|    if (mp_iseven(a))
  ------------------
  |  Branch (2680:9): [True: 4, False: 867]
  ------------------
 2681|      4|        return MP_UNDEF; /* not invertable */
  ------------------
  |  |   45|      4|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
 2682|       |
 2683|    867|    return s_mp_invmod_even_m(a, m, c);
 2684|       |
 2685|    871|} /* end mp_invmod() */
s_mp_grow:
 3038|   456k|{
 3039|   456k|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  355|   456k|#define ARGCHK(X, Y) assert(X)
  ------------------
 3040|       |
 3041|   456k|    if (min > ALLOC(mp)) {
  ------------------
  |  |  334|   456k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|   456k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (3041:9): [True: 451k, False: 4.49k]
  ------------------
 3042|   451k|        mp_digit *tmp;
 3043|       |
 3044|       |        /* Set min to next nearest default precision block size */
 3045|   451k|        min = MP_ROUNDUP(min, s_mp_defprec);
  ------------------
  |  |   89|   451k|#define MP_ROUNDUP(a, b) (MP_HOWMANY(a, b) * (b))
  |  |  ------------------
  |  |  |  |   88|   451k|#define MP_HOWMANY(a, b) (((a) + (b)-1) / (b))
  |  |  ------------------
  ------------------
 3046|       |
 3047|   451k|        if ((tmp = s_mp_alloc(min, sizeof(mp_digit))) == NULL)
  ------------------
  |  Branch (3047:13): [True: 0, False: 451k]
  ------------------
 3048|      0|            return MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
 3049|       |
 3050|   451k|        s_mp_copy(DIGITS(mp), tmp, USED(mp));
  ------------------
  |  |  335|   451k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|   451k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                      s_mp_copy(DIGITS(mp), tmp, USED(mp));
  ------------------
  |  |  333|   451k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   451k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3051|       |
 3052|   451k|        s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  335|   451k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|   451k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                      s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  334|   451k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|   451k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
 3053|   451k|        s_mp_free(DIGITS(mp));
  ------------------
  |  |  335|   451k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|   451k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 3054|   451k|        DIGITS(mp) = tmp;
  ------------------
  |  |  335|   451k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|   451k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 3055|   451k|        ALLOC(mp) = min;
  ------------------
  |  |  334|   451k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|   451k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
 3056|   451k|    }
 3057|       |
 3058|   456k|    return MP_OKAY;
  ------------------
  |  |   39|   456k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3059|       |
 3060|   456k|} /* end s_mp_grow() */
s_mp_pad:
 3069|  5.92M|{
 3070|  5.92M|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  355|  5.92M|#define ARGCHK(X, Y) assert(X)
  ------------------
 3071|       |
 3072|  5.92M|    if (min > USED(mp)) {
  ------------------
  |  |  333|  5.92M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  5.92M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3072:9): [True: 4.04M, False: 1.87M]
  ------------------
 3073|  4.04M|        mp_err res;
 3074|       |
 3075|       |        /* Make sure there is room to increase precision  */
 3076|  4.04M|        if (min > ALLOC(mp)) {
  ------------------
  |  |  334|  4.04M|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|  4.04M|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (3076:13): [True: 451k, False: 3.59M]
  ------------------
 3077|   451k|            if ((res = s_mp_grow(mp, min)) != MP_OKAY)
  ------------------
  |  |   39|   451k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3077:17): [True: 0, False: 451k]
  ------------------
 3078|      0|                return res;
 3079|  3.59M|        } else {
 3080|  3.59M|            s_mp_setz(DIGITS(mp) + USED(mp), min - USED(mp));
  ------------------
  |  |  335|  3.59M|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  3.59M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(mp) + USED(mp), min - USED(mp));
  ------------------
  |  |  333|  3.59M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  3.59M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                          s_mp_setz(DIGITS(mp) + USED(mp), min - USED(mp));
  ------------------
  |  |  333|  3.59M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  3.59M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3081|  3.59M|        }
 3082|       |
 3083|       |        /* Increase precision; should already be 0-filled */
 3084|  4.04M|        USED(mp) = min;
  ------------------
  |  |  333|  4.04M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  4.04M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3085|  4.04M|    }
 3086|       |
 3087|  5.92M|    return MP_OKAY;
  ------------------
  |  |   39|  5.92M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3088|       |
 3089|  5.92M|} /* end s_mp_pad() */
s_mp_setz:
 3098|  7.03M|{
 3099|  7.03M|    memset(dp, 0, count * sizeof(mp_digit));
 3100|  7.03M|} /* end s_mp_setz() */
s_mp_copy:
 3109|  2.48M|{
 3110|  2.48M|    memcpy(dp, sp, count * sizeof(mp_digit));
 3111|  2.48M|} /* end s_mp_copy() */
s_mp_alloc:
 3120|  2.74M|{
 3121|  2.74M|    return calloc(nb, ni);
 3122|       |
 3123|  2.74M|} /* end s_mp_alloc() */
s_mp_free:
 3132|  2.74M|{
 3133|  2.74M|    if (ptr) {
  ------------------
  |  Branch (3133:9): [True: 2.74M, False: 0]
  ------------------
 3134|  2.74M|        free(ptr);
 3135|  2.74M|    }
 3136|  2.74M|} /* end s_mp_free() */
s_mp_clamp:
 3145|  7.61M|{
 3146|  7.61M|    mp_size used = MP_USED(mp);
  ------------------
  |  |  150|  7.61M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3147|  44.0M|    while (used > 1 && DIGIT(mp, used - 1) == 0)
  ------------------
  |  |  336|  43.1M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  43.1M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (3147:12): [True: 43.1M, False: 844k]
  |  Branch (3147:24): [True: 36.4M, False: 6.77M]
  ------------------
 3148|  36.4M|        --used;
 3149|  7.61M|    MP_USED(mp) = used;
  ------------------
  |  |  150|  7.61M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3150|  7.61M|    if (used == 1 && DIGIT(mp, 0) == 0)
  ------------------
  |  |  336|   844k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|   844k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (3150:9): [True: 844k, False: 6.77M]
  |  Branch (3150:22): [True: 390k, False: 453k]
  ------------------
 3151|   390k|        MP_SIGN(mp) = ZPOS;
  ------------------
  |  |  149|   390k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                      MP_SIGN(mp) = ZPOS;
  ------------------
  |  |  326|   390k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|   390k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 3152|  7.61M|} /* end s_mp_clamp() */
s_mp_exch:
 3161|   382k|{
 3162|   382k|    mp_int tmp;
 3163|   382k|    if (!a || !b) {
  ------------------
  |  Branch (3163:9): [True: 0, False: 382k]
  |  Branch (3163:15): [True: 0, False: 382k]
  ------------------
 3164|      0|        return;
 3165|      0|    }
 3166|       |
 3167|   382k|    tmp = *a;
 3168|   382k|    *a = *b;
 3169|   382k|    *b = tmp;
 3170|       |
 3171|   382k|} /* end s_mp_exch() */
s_mp_lshd:
 3189|   533k|{
 3190|   533k|    mp_err res;
 3191|   533k|    unsigned int ix;
 3192|       |
 3193|   533k|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  355|   533k|#define ARGCHK(X, Y) assert(X)
  ------------------
 3194|       |
 3195|   533k|    if (p == 0)
  ------------------
  |  Branch (3195:9): [True: 0, False: 533k]
  ------------------
 3196|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3197|       |
 3198|   533k|    if (MP_USED(mp) == 1 && MP_DIGIT(mp, 0) == 0)
  ------------------
  |  |  150|   533k|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (MP_USED(mp) == 1 && MP_DIGIT(mp, 0) == 0)
  ------------------
  |  |  153|  50.4k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  |  Branch (3198:9): [True: 50.4k, False: 482k]
  |  Branch (3198:29): [True: 3, False: 50.4k]
  ------------------
 3199|      3|        return MP_OKAY;
  ------------------
  |  |   39|      3|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3200|       |
 3201|   533k|    if ((res = s_mp_pad(mp, USED(mp) + p)) != MP_OKAY)
  ------------------
  |  |  333|   533k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   533k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  if ((res = s_mp_pad(mp, USED(mp) + p)) != MP_OKAY)
  ------------------
  |  |   39|   533k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3201:9): [True: 0, False: 533k]
  ------------------
 3202|      0|        return res;
 3203|       |
 3204|       |    /* Shift all the significant figures over as needed */
 3205|  11.6M|    for (ix = USED(mp) - p; ix-- > 0;) {
  ------------------
  |  |  333|   533k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   533k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3205:29): [True: 11.1M, False: 533k]
  ------------------
 3206|  11.1M|        DIGIT(mp, ix + p) = DIGIT(mp, ix);
  ------------------
  |  |  336|  11.1M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  11.1M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
                      DIGIT(mp, ix + p) = DIGIT(mp, ix);
  ------------------
  |  |  336|  11.1M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  11.1M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3207|  11.1M|    }
 3208|       |
 3209|       |    /* Fill the bottom digits with zeroes */
 3210|  2.17M|    for (ix = 0; (mp_size)ix < p; ix++)
  ------------------
  |  Branch (3210:18): [True: 1.63M, False: 533k]
  ------------------
 3211|  1.63M|        DIGIT(mp, ix) = 0;
  ------------------
  |  |  336|  1.63M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  1.63M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3212|       |
 3213|   533k|    return MP_OKAY;
  ------------------
  |  |   39|   533k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3214|       |
 3215|   533k|} /* end s_mp_lshd() */
s_mp_mul_2d:
 3227|  18.0k|{
 3228|  18.0k|    mp_err res;
 3229|  18.0k|    mp_digit dshift, rshift, mask, x, prev = 0;
 3230|  18.0k|    mp_digit *pa = NULL;
 3231|  18.0k|    int i;
 3232|       |
 3233|  18.0k|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  355|  18.0k|#define ARGCHK(X, Y) assert(X)
  ------------------
 3234|       |
 3235|  18.0k|    dshift = d / MP_DIGIT_BIT;
  ------------------
  |  |  137|  18.0k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|  18.0k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 3236|  18.0k|    d %= MP_DIGIT_BIT;
  ------------------
  |  |  137|  18.0k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|  18.0k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 3237|       |    /* mp_digit >> rshift is undefined behavior for rshift >= MP_DIGIT_BIT */
 3238|       |    /* mod and corresponding mask logic avoid that when d = 0 */
 3239|  18.0k|    rshift = MP_DIGIT_BIT - d;
  ------------------
  |  |  137|  18.0k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|  18.0k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 3240|  18.0k|    rshift %= MP_DIGIT_BIT;
  ------------------
  |  |  137|  18.0k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|  18.0k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 3241|       |    /* mask = (2**d - 1) * 2**(w-d) mod 2**w */
 3242|  18.0k|    mask = (DIGIT_MAX << rshift) + 1;
  ------------------
  |  |  327|  18.0k|#define DIGIT_MAX MP_DIGIT_MAX
  |  |  ------------------
  |  |  |  |   79|  18.0k|#define MP_DIGIT_MAX ULONG_MAX
  |  |  ------------------
  ------------------
 3243|  18.0k|    mask &= DIGIT_MAX - 1;
  ------------------
  |  |  327|  18.0k|#define DIGIT_MAX MP_DIGIT_MAX
  |  |  ------------------
  |  |  |  |   79|  18.0k|#define MP_DIGIT_MAX ULONG_MAX
  |  |  ------------------
  ------------------
 3244|       |    /* bits to be shifted out of the top word */
 3245|  18.0k|    x = MP_DIGIT(mp, MP_USED(mp) - 1) & mask;
  ------------------
  |  |  153|  18.0k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 3246|       |
 3247|  18.0k|    if (MP_OKAY != (res = s_mp_pad(mp, MP_USED(mp) + dshift + (x != 0))))
  ------------------
  |  |   39|  18.0k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
                  if (MP_OKAY != (res = s_mp_pad(mp, MP_USED(mp) + dshift + (x != 0))))
  ------------------
  |  |  150|  18.0k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3247:9): [True: 0, False: 18.0k]
  ------------------
 3248|      0|        return res;
 3249|       |
 3250|  18.0k|    if (dshift && MP_OKAY != (res = s_mp_lshd(mp, dshift)))
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3250:9): [True: 0, False: 18.0k]
  |  Branch (3250:19): [True: 0, False: 0]
  ------------------
 3251|      0|        return res;
 3252|       |
 3253|  18.0k|    pa = MP_DIGITS(mp) + dshift;
  ------------------
  |  |  152|  18.0k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3254|       |
 3255|   553k|    for (i = MP_USED(mp) - dshift; i > 0; i--) {
  ------------------
  |  |  150|  18.0k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3255:36): [True: 535k, False: 18.0k]
  ------------------
 3256|   535k|        x = *pa;
 3257|   535k|        *pa++ = (x << d) | prev;
 3258|   535k|        prev = (x & mask) >> rshift;
 3259|   535k|    }
 3260|       |
 3261|  18.0k|    s_mp_clamp(mp);
 3262|  18.0k|    return MP_OKAY;
  ------------------
  |  |   39|  18.0k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3263|  18.0k|} /* end s_mp_mul_2d() */
s_mp_rshd:
 3275|  3.79M|{
 3276|  3.79M|    mp_size ix;
 3277|  3.79M|    mp_digit *src, *dst;
 3278|       |
 3279|  3.79M|    if (p == 0)
  ------------------
  |  Branch (3279:9): [True: 1.23M, False: 2.56M]
  ------------------
 3280|  1.23M|        return;
 3281|       |
 3282|       |    /* Shortcut when all digits are to be shifted off */
 3283|  2.56M|    if (p >= USED(mp)) {
  ------------------
  |  |  333|  2.56M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  2.56M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3283:9): [True: 55.8k, False: 2.50M]
  ------------------
 3284|  55.8k|        s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  335|  55.8k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  55.8k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
                      s_mp_setz(DIGITS(mp), ALLOC(mp));
  ------------------
  |  |  334|  55.8k|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|  55.8k|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
 3285|  55.8k|        USED(mp) = 1;
  ------------------
  |  |  333|  55.8k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  55.8k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3286|  55.8k|        SIGN(mp) = ZPOS;
  ------------------
  |  |  332|  55.8k|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  55.8k|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                      SIGN(mp) = ZPOS;
  ------------------
  |  |  326|  55.8k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  55.8k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 3287|  55.8k|        return;
 3288|  55.8k|    }
 3289|       |
 3290|       |    /* Shift all the significant figures over as needed */
 3291|  2.50M|    dst = MP_DIGITS(mp);
  ------------------
  |  |  152|  2.50M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3292|  2.50M|    src = dst + p;
 3293|   109M|    for (ix = USED(mp) - p; ix > 0; ix--)
  ------------------
  |  |  333|  2.50M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  2.50M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3293:29): [True: 106M, False: 2.50M]
  ------------------
 3294|   106M|        *dst++ = *src++;
 3295|       |
 3296|  2.50M|    MP_USED(mp) -= p;
  ------------------
  |  |  150|  2.50M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3297|       |    /* Fill the top digits with zeroes */
 3298|   108M|    while (p-- > 0)
  ------------------
  |  Branch (3298:12): [True: 106M, False: 2.50M]
  ------------------
 3299|   106M|        *dst++ = 0;
 3300|       |
 3301|  2.50M|} /* end s_mp_rshd() */
s_mp_div_2:
 3310|  1.22M|{
 3311|  1.22M|    s_mp_div_2d(mp, 1);
 3312|       |
 3313|  1.22M|} /* end s_mp_div_2() */
s_mp_mul_2:
 3321|   839k|{
 3322|   839k|    mp_digit *pd;
 3323|   839k|    unsigned int ix, used;
 3324|   839k|    mp_digit kin = 0;
 3325|       |
 3326|   839k|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  355|   839k|#define ARGCHK(X, Y) assert(X)
  ------------------
 3327|       |
 3328|       |    /* Shift digits leftward by 1 bit */
 3329|   839k|    used = MP_USED(mp);
  ------------------
  |  |  150|   839k|#define MP_USED(MP) ((MP)->used)
  ------------------
 3330|   839k|    pd = MP_DIGITS(mp);
  ------------------
  |  |  152|   839k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3331|  98.7M|    for (ix = 0; ix < used; ix++) {
  ------------------
  |  Branch (3331:18): [True: 97.9M, False: 839k]
  ------------------
 3332|  97.9M|        mp_digit d = *pd;
 3333|  97.9M|        *pd++ = (d << 1) | kin;
 3334|  97.9M|        kin = (d >> (DIGIT_BIT - 1));
  ------------------
  |  |  328|  97.9M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|  97.9M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  97.9M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3335|  97.9M|    }
 3336|       |
 3337|       |    /* Deal with rollover from last digit */
 3338|   839k|    if (kin) {
  ------------------
  |  Branch (3338:9): [True: 0, False: 839k]
  ------------------
 3339|      0|        if (ix >= ALLOC(mp)) {
  ------------------
  |  |  334|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
  |  Branch (3339:13): [True: 0, False: 0]
  ------------------
 3340|      0|            mp_err res;
 3341|      0|            if ((res = s_mp_grow(mp, ALLOC(mp) + 1)) != MP_OKAY)
  ------------------
  |  |  334|      0|#define ALLOC(MP) MP_ALLOC(MP)
  |  |  ------------------
  |  |  |  |  151|      0|#define MP_ALLOC(MP) ((MP)->alloc)
  |  |  ------------------
  ------------------
                          if ((res = s_mp_grow(mp, ALLOC(mp) + 1)) != MP_OKAY)
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3341:17): [True: 0, False: 0]
  ------------------
 3342|      0|                return res;
 3343|      0|        }
 3344|       |
 3345|      0|        DIGIT(mp, ix) = kin;
  ------------------
  |  |  336|      0|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3346|      0|        USED(mp) += 1;
  ------------------
  |  |  333|      0|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|      0|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 3347|      0|    }
 3348|       |
 3349|   839k|    return MP_OKAY;
  ------------------
  |  |   39|   839k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3350|       |
 3351|   839k|} /* end s_mp_mul_2() */
s_mp_mod_2d:
 3364|  1.06M|{
 3365|  1.06M|    mp_size ndig = (d / DIGIT_BIT), nbit = (d % DIGIT_BIT);
  ------------------
  |  |  328|  1.06M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|  1.06M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  1.06M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  mp_size ndig = (d / DIGIT_BIT), nbit = (d % DIGIT_BIT);
  ------------------
  |  |  328|  1.06M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|  1.06M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  1.06M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3366|  1.06M|    mp_size ix;
 3367|  1.06M|    mp_digit dmask;
 3368|       |
 3369|  1.06M|    if (ndig >= USED(mp))
  ------------------
  |  |  333|  1.06M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  1.06M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3369:9): [True: 59.2k, False: 1.00M]
  ------------------
 3370|  59.2k|        return;
 3371|       |
 3372|       |    /* Flush all the bits above 2^d in its digit */
 3373|  1.00M|    dmask = ((mp_digit)1 << nbit) - 1;
 3374|  1.00M|    DIGIT(mp, ndig) &= dmask;
  ------------------
  |  |  336|  1.00M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  1.00M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3375|       |
 3376|       |    /* Flush all digits above the one with 2^d in it */
 3377|  29.3M|    for (ix = ndig + 1; ix < USED(mp); ix++)
  ------------------
  |  |  333|  29.3M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  29.3M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3377:25): [True: 28.3M, False: 1.00M]
  ------------------
 3378|  28.3M|        DIGIT(mp, ix) = 0;
  ------------------
  |  |  336|  28.3M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  28.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3379|       |
 3380|  1.00M|    s_mp_clamp(mp);
 3381|       |
 3382|  1.00M|} /* end s_mp_mod_2d() */
s_mp_div_2d:
 3395|  1.23M|{
 3396|  1.23M|    int ix;
 3397|  1.23M|    mp_digit save, next, mask, lshift;
 3398|       |
 3399|  1.23M|    s_mp_rshd(mp, d / DIGIT_BIT);
  ------------------
  |  |  328|  1.23M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|  1.23M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  1.23M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3400|  1.23M|    d %= DIGIT_BIT;
  ------------------
  |  |  328|  1.23M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|  1.23M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  1.23M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3401|       |    /* mp_digit << lshift is undefined behavior for lshift >= MP_DIGIT_BIT */
 3402|       |    /* mod and corresponding mask logic avoid that when d = 0 */
 3403|  1.23M|    lshift = DIGIT_BIT - d;
  ------------------
  |  |  328|  1.23M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|  1.23M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  1.23M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3404|  1.23M|    lshift %= DIGIT_BIT;
  ------------------
  |  |  328|  1.23M|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|  1.23M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  1.23M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3405|  1.23M|    mask = ((mp_digit)1 << d) - 1;
 3406|  1.23M|    save = 0;
 3407|  4.04M|    for (ix = USED(mp) - 1; ix >= 0; ix--) {
  ------------------
  |  |  333|  1.23M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  1.23M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (3407:29): [True: 2.81M, False: 1.23M]
  ------------------
 3408|  2.81M|        next = DIGIT(mp, ix) & mask;
  ------------------
  |  |  336|  2.81M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  2.81M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3409|  2.81M|        DIGIT(mp, ix) = (save << lshift) | (DIGIT(mp, ix) >> d);
  ------------------
  |  |  336|  2.81M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  2.81M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
                      DIGIT(mp, ix) = (save << lshift) | (DIGIT(mp, ix) >> d);
  ------------------
  |  |  336|  2.81M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  2.81M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3410|  2.81M|        save = next;
 3411|  2.81M|    }
 3412|  1.23M|    s_mp_clamp(mp);
 3413|       |
 3414|  1.23M|} /* end s_mp_div_2d() */
s_mp_norm:
 3433|  17.8k|{
 3434|  17.8k|    mp_digit d;
 3435|  17.8k|    mp_digit mask;
 3436|  17.8k|    mp_digit b_msd;
 3437|  17.8k|    mp_err res = MP_OKAY;
  ------------------
  |  |   39|  17.8k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3438|       |
 3439|  17.8k|    ARGCHK(a != NULL && b != NULL && pd != NULL, MP_BADARG);
  ------------------
  |  |  355|  17.8k|#define ARGCHK(X, Y) assert(X)
  ------------------
 3440|       |
 3441|  17.8k|    d = 0;
 3442|  17.8k|    mask = DIGIT_MAX & ~(DIGIT_MAX >> 1); /* mask is msb of digit */
  ------------------
  |  |  327|  17.8k|#define DIGIT_MAX MP_DIGIT_MAX
  |  |  ------------------
  |  |  |  |   79|  17.8k|#define MP_DIGIT_MAX ULONG_MAX
  |  |  ------------------
  ------------------
                  mask = DIGIT_MAX & ~(DIGIT_MAX >> 1); /* mask is msb of digit */
  ------------------
  |  |  327|  17.8k|#define DIGIT_MAX MP_DIGIT_MAX
  |  |  ------------------
  |  |  |  |   79|  17.8k|#define MP_DIGIT_MAX ULONG_MAX
  |  |  ------------------
  ------------------
 3443|  17.8k|    b_msd = DIGIT(b, USED(b) - 1);
  ------------------
  |  |  336|  17.8k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  17.8k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3444|   184k|    while (!(b_msd & mask)) {
  ------------------
  |  Branch (3444:12): [True: 166k, False: 17.8k]
  ------------------
 3445|   166k|        b_msd <<= 1;
 3446|   166k|        ++d;
 3447|   166k|    }
 3448|       |
 3449|  17.8k|    if (d) {
  ------------------
  |  Branch (3449:9): [True: 6.39k, False: 11.4k]
  ------------------
 3450|  6.39k|        MP_CHECKOK(s_mp_mul_2d(a, d));
  ------------------
  |  |  319|  6.39k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.39k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 6.39k]
  |  |  ------------------
  |  |  320|  6.39k|    goto CLEANUP
  ------------------
 3451|  6.39k|        MP_CHECKOK(s_mp_mul_2d(b, d));
  ------------------
  |  |  319|  6.39k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  6.39k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 6.39k]
  |  |  ------------------
  |  |  320|  6.39k|    goto CLEANUP
  ------------------
 3452|  6.39k|    }
 3453|       |
 3454|  17.8k|    *pd = d;
 3455|  17.8k|CLEANUP:
 3456|  17.8k|    return res;
 3457|       |
 3458|  17.8k|} /* end s_mp_norm() */
s_mp_add_d:
 3471|  2.98k|{
 3472|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3473|       |    mp_word w, k = 0;
 3474|       |    mp_size ix = 1;
 3475|       |
 3476|       |    w = (mp_word)DIGIT(mp, 0) + d;
 3477|       |    DIGIT(mp, 0) = ACCUM(w);
 3478|       |    k = CARRYOUT(w);
 3479|       |
 3480|       |    while (ix < USED(mp) && k) {
 3481|       |        w = (mp_word)DIGIT(mp, ix) + k;
 3482|       |        DIGIT(mp, ix) = ACCUM(w);
 3483|       |        k = CARRYOUT(w);
 3484|       |        ++ix;
 3485|       |    }
 3486|       |
 3487|       |    if (k != 0) {
 3488|       |        mp_err res;
 3489|       |
 3490|       |        if ((res = s_mp_pad(mp, USED(mp) + 1)) != MP_OKAY)
 3491|       |            return res;
 3492|       |
 3493|       |        DIGIT(mp, ix) = (mp_digit)k;
 3494|       |    }
 3495|       |
 3496|       |    return MP_OKAY;
 3497|       |#else
 3498|  2.98k|    mp_digit *pmp = MP_DIGITS(mp);
  ------------------
  |  |  152|  2.98k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3499|  2.98k|    mp_digit sum, mp_i, carry = 0;
 3500|  2.98k|    mp_err res = MP_OKAY;
  ------------------
  |  |   39|  2.98k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3501|  2.98k|    int used = (int)MP_USED(mp);
  ------------------
  |  |  150|  2.98k|#define MP_USED(MP) ((MP)->used)
  ------------------
 3502|       |
 3503|  2.98k|    mp_i = *pmp;
 3504|  2.98k|    *pmp++ = sum = d + mp_i;
 3505|  2.98k|    carry = (sum < d);
 3506|  2.98k|    while (carry && --used > 0) {
  ------------------
  |  Branch (3506:12): [True: 0, False: 2.98k]
  |  Branch (3506:21): [True: 0, False: 0]
  ------------------
 3507|      0|        mp_i = *pmp;
 3508|      0|        *pmp++ = sum = carry + mp_i;
 3509|      0|        carry = !sum;
 3510|      0|    }
 3511|  2.98k|    if (carry && !used) {
  ------------------
  |  Branch (3511:9): [True: 0, False: 2.98k]
  |  Branch (3511:18): [True: 0, False: 0]
  ------------------
 3512|       |        /* mp is growing */
 3513|      0|        used = MP_USED(mp);
  ------------------
  |  |  150|      0|#define MP_USED(MP) ((MP)->used)
  ------------------
 3514|      0|        MP_CHECKOK(s_mp_pad(mp, used + 1));
  ------------------
  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  320|      0|    goto CLEANUP
  ------------------
 3515|      0|        MP_DIGIT(mp, used) = carry;
  ------------------
  |  |  153|      0|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 3516|      0|    }
 3517|  2.98k|CLEANUP:
 3518|  2.98k|    return res;
 3519|  2.98k|#endif
 3520|  2.98k|} /* end s_mp_add_d() */
s_mp_sub_d:
 3529|  3.02k|{
 3530|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 3531|       |    mp_word w, b = 0;
 3532|       |    mp_size ix = 1;
 3533|       |
 3534|       |    /* Compute initial subtraction    */
 3535|       |    w = (RADIX + (mp_word)DIGIT(mp, 0)) - d;
 3536|       |    b = CARRYOUT(w) ? 0 : 1;
 3537|       |    DIGIT(mp, 0) = ACCUM(w);
 3538|       |
 3539|       |    /* Propagate borrows leftward     */
 3540|       |    while (b && ix < USED(mp)) {
 3541|       |        w = (RADIX + (mp_word)DIGIT(mp, ix)) - b;
 3542|       |        b = CARRYOUT(w) ? 0 : 1;
 3543|       |        DIGIT(mp, ix) = ACCUM(w);
 3544|       |        ++ix;
 3545|       |    }
 3546|       |
 3547|       |    /* Remove leading zeroes          */
 3548|       |    s_mp_clamp(mp);
 3549|       |
 3550|       |    /* If we have a borrow out, it's a violation of the input invariant */
 3551|       |    if (b)
 3552|       |        return MP_RANGE;
 3553|       |    else
 3554|       |        return MP_OKAY;
 3555|       |#else
 3556|  3.02k|    mp_digit *pmp = MP_DIGITS(mp);
  ------------------
  |  |  152|  3.02k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3557|  3.02k|    mp_digit mp_i, diff, borrow;
 3558|  3.02k|    mp_size used = MP_USED(mp);
  ------------------
  |  |  150|  3.02k|#define MP_USED(MP) ((MP)->used)
  ------------------
 3559|       |
 3560|  3.02k|    mp_i = *pmp;
 3561|  3.02k|    *pmp++ = diff = mp_i - d;
 3562|  3.02k|    borrow = (diff > mp_i);
 3563|  3.02k|    while (borrow && --used) {
  ------------------
  |  Branch (3563:12): [True: 0, False: 3.02k]
  |  Branch (3563:22): [True: 0, False: 0]
  ------------------
 3564|      0|        mp_i = *pmp;
 3565|      0|        *pmp++ = diff = mp_i - borrow;
 3566|      0|        borrow = (diff > mp_i);
 3567|      0|    }
 3568|  3.02k|    s_mp_clamp(mp);
 3569|  3.02k|    return (borrow && !used) ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
                  return (borrow && !used) ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   39|  3.02k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3569:13): [True: 0, False: 3.02k]
  |  Branch (3569:23): [True: 0, False: 0]
  ------------------
 3570|  3.02k|#endif
 3571|  3.02k|} /* end s_mp_sub_d() */
s_mp_mul_d:
 3580|   202k|{
 3581|   202k|    mp_err res;
 3582|   202k|    mp_size used;
 3583|   202k|    int pow;
 3584|       |
 3585|   202k|    if (!d) {
  ------------------
  |  Branch (3585:9): [True: 0, False: 202k]
  ------------------
 3586|      0|        mp_zero(a);
 3587|      0|        return MP_OKAY;
  ------------------
  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3588|      0|    }
 3589|   202k|    if (d == 1)
  ------------------
  |  Branch (3589:9): [True: 7.35k, False: 195k]
  ------------------
 3590|  7.35k|        return MP_OKAY;
  ------------------
  |  |   39|  7.35k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3591|   195k|    if (0 <= (pow = s_mp_ispow2d(d))) {
  ------------------
  |  Branch (3591:9): [True: 5.29k, False: 190k]
  ------------------
 3592|  5.29k|        return s_mp_mul_2d(a, (mp_digit)pow);
 3593|  5.29k|    }
 3594|       |
 3595|   190k|    used = MP_USED(a);
  ------------------
  |  |  150|   190k|#define MP_USED(MP) ((MP)->used)
  ------------------
 3596|   190k|    MP_CHECKOK(s_mp_pad(a, used + 1));
  ------------------
  |  |  319|   190k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   190k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 190k]
  |  |  ------------------
  |  |  320|   190k|    goto CLEANUP
  ------------------
 3597|       |
 3598|   190k|    s_mpv_mul_d(MP_DIGITS(a), used, d, MP_DIGITS(a));
  ------------------
  |  |  181|   190k|    ((mp_digit *)c)[a_len] = s_mpv_mul_set_vec64(c, a, a_len, b)
  ------------------
 3599|       |
 3600|   190k|    s_mp_clamp(a);
 3601|       |
 3602|   190k|CLEANUP:
 3603|   190k|    return res;
 3604|       |
 3605|   190k|} /* end s_mp_mul_d() */
s_mp_add_3arg:
 3824|  1.28M|{
 3825|  1.28M|    mp_digit *pa, *pb, *pc;
 3826|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3827|       |    mp_word w = 0;
 3828|       |#else
 3829|  1.28M|    mp_digit sum, carry = 0, d;
 3830|  1.28M|#endif
 3831|  1.28M|    mp_size ix;
 3832|  1.28M|    mp_size used;
 3833|  1.28M|    mp_err res;
 3834|       |
 3835|  1.28M|    MP_SIGN(c) = MP_SIGN(a);
  ------------------
  |  |  149|  1.28M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(c) = MP_SIGN(a);
  ------------------
  |  |  149|  1.28M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 3836|  1.28M|    if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  150|  1.28M|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  150|  1.28M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3836:9): [True: 196k, False: 1.08M]
  ------------------
 3837|   196k|        const mp_int *xch = a;
 3838|   196k|        a = b;
 3839|   196k|        b = xch;
 3840|   196k|    }
 3841|       |
 3842|       |    /* Make sure a has enough precision for the output value */
 3843|  1.28M|    if (MP_OKAY != (res = s_mp_pad(c, MP_USED(a))))
  ------------------
  |  |   39|  1.28M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
                  if (MP_OKAY != (res = s_mp_pad(c, MP_USED(a))))
  ------------------
  |  |  150|  1.28M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3843:9): [True: 0, False: 1.28M]
  ------------------
 3844|      0|        return res;
 3845|       |
 3846|       |    /*
 3847|       |     Add up all digits up to the precision of b.  If b had initially
 3848|       |     the same precision as a, or greater, we took care of it by the
 3849|       |     exchange step above, so there is no problem.  If b had initially
 3850|       |     less precision, we'll have to make sure the carry out is duly
 3851|       |     propagated upward among the higher-order digits of the sum.
 3852|       |    */
 3853|  1.28M|    pa = MP_DIGITS(a);
  ------------------
  |  |  152|  1.28M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3854|  1.28M|    pb = MP_DIGITS(b);
  ------------------
  |  |  152|  1.28M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3855|  1.28M|    pc = MP_DIGITS(c);
  ------------------
  |  |  152|  1.28M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 3856|  1.28M|    used = MP_USED(b);
  ------------------
  |  |  150|  1.28M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3857|  4.18M|    for (ix = 0; ix < used; ix++) {
  ------------------
  |  Branch (3857:18): [True: 2.90M, False: 1.28M]
  ------------------
 3858|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3859|       |        w = w + *pa++ + *pb++;
 3860|       |        *pc++ = ACCUM(w);
 3861|       |        w = CARRYOUT(w);
 3862|       |#else
 3863|  2.90M|        d = *pa++;
 3864|  2.90M|        sum = d + *pb++;
 3865|  2.90M|        d = (sum < d); /* detect overflow */
 3866|  2.90M|        *pc++ = sum += carry;
 3867|  2.90M|        carry = d + (sum < carry); /* detect overflow */
 3868|  2.90M|#endif
 3869|  2.90M|    }
 3870|       |
 3871|       |    /* If we run out of 'b' digits before we're actually done, make
 3872|       |     sure the carries get propagated upward...
 3873|       |   */
 3874|  1.69M|    for (used = MP_USED(a); ix < used; ++ix) {
  ------------------
  |  |  150|  1.28M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (3874:29): [True: 414k, False: 1.28M]
  ------------------
 3875|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3876|       |        w = w + *pa++;
 3877|       |        *pc++ = ACCUM(w);
 3878|       |        w = CARRYOUT(w);
 3879|       |#else
 3880|   414k|        *pc++ = sum = carry + *pa++;
 3881|   414k|        carry = (sum < carry);
 3882|   414k|#endif
 3883|   414k|    }
 3884|       |
 3885|       |/* If there's an overall carry out, increase precision and include
 3886|       |     it.  We could have done this initially, but why touch the memory
 3887|       |     allocator unless we're sure we have to?
 3888|       |   */
 3889|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_ADD_WORD)
 3890|       |    if (w) {
 3891|       |        if ((res = s_mp_pad(c, used + 1)) != MP_OKAY)
 3892|       |            return res;
 3893|       |
 3894|       |        DIGIT(c, used) = (mp_digit)w;
 3895|       |        ++used;
 3896|       |    }
 3897|       |#else
 3898|  1.28M|    if (carry) {
  ------------------
  |  Branch (3898:9): [True: 62.3k, False: 1.22M]
  ------------------
 3899|  62.3k|        if ((res = s_mp_pad(c, used + 1)) != MP_OKAY)
  ------------------
  |  |   39|  62.3k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (3899:13): [True: 0, False: 62.3k]
  ------------------
 3900|      0|            return res;
 3901|       |
 3902|  62.3k|        DIGIT(c, used) = carry;
  ------------------
  |  |  336|  62.3k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  62.3k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 3903|  62.3k|        ++used;
 3904|  62.3k|    }
 3905|  1.28M|#endif
 3906|  1.28M|    MP_USED(c) = used;
  ------------------
  |  |  150|  1.28M|#define MP_USED(MP) ((MP)->used)
  ------------------
 3907|  1.28M|    return MP_OKAY;
  ------------------
  |  |   39|  1.28M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 3908|  1.28M|}
s_mp_sub:
 4001|   598k|{
 4002|   598k|    mp_digit *pa, *pb, *limit;
 4003|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4004|       |    mp_sword w = 0;
 4005|       |#else
 4006|   598k|    mp_digit d, diff, borrow = 0;
 4007|   598k|#endif
 4008|       |
 4009|       |    /*
 4010|       |    Subtract and propagate borrow.  Up to the precision of b, this
 4011|       |    accounts for the digits of b; after that, we just make sure the
 4012|       |    carries get to the right place.  This saves having to pad b out to
 4013|       |    the precision of a just to make the loops work right...
 4014|       |   */
 4015|   598k|    pa = MP_DIGITS(a);
  ------------------
  |  |  152|   598k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4016|   598k|    pb = MP_DIGITS(b);
  ------------------
  |  |  152|   598k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4017|   598k|    limit = pb + MP_USED(b);
  ------------------
  |  |  150|   598k|#define MP_USED(MP) ((MP)->used)
  ------------------
 4018|  26.9M|    while (pb < limit) {
  ------------------
  |  Branch (4018:12): [True: 26.3M, False: 598k]
  ------------------
 4019|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4020|       |        w = w + *pa - *pb++;
 4021|       |        *pa++ = ACCUM(w);
 4022|       |        w >>= MP_DIGIT_BIT;
 4023|       |#else
 4024|  26.3M|        d = *pa;
 4025|  26.3M|        diff = d - *pb++;
 4026|  26.3M|        d = (diff > d); /* detect borrow */
 4027|  26.3M|        if (borrow && --diff == MP_DIGIT_MAX)
  ------------------
  |  |   79|  12.2M|#define MP_DIGIT_MAX ULONG_MAX
  ------------------
  |  Branch (4027:13): [True: 12.2M, False: 14.0M]
  |  Branch (4027:23): [True: 96.9k, False: 12.2M]
  ------------------
 4028|  96.9k|            ++d;
 4029|  26.3M|        *pa++ = diff;
 4030|  26.3M|        borrow = d;
 4031|  26.3M|#endif
 4032|  26.3M|    }
 4033|   598k|    limit = MP_DIGITS(a) + MP_USED(a);
  ------------------
  |  |  152|   598k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
                  limit = MP_DIGITS(a) + MP_USED(a);
  ------------------
  |  |  150|   598k|#define MP_USED(MP) ((MP)->used)
  ------------------
 4034|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4035|       |    while (w && pa < limit) {
 4036|       |        w = w + *pa;
 4037|       |        *pa++ = ACCUM(w);
 4038|       |        w >>= MP_DIGIT_BIT;
 4039|       |    }
 4040|       |#else
 4041|   934k|    while (borrow && pa < limit) {
  ------------------
  |  Branch (4041:12): [True: 335k, False: 598k]
  |  Branch (4041:22): [True: 335k, False: 0]
  ------------------
 4042|   335k|        d = *pa;
 4043|   335k|        *pa++ = diff = d - borrow;
 4044|   335k|        borrow = (diff > d);
 4045|   335k|    }
 4046|   598k|#endif
 4047|       |
 4048|       |    /* Clobber any leading zeroes we created    */
 4049|   598k|    s_mp_clamp(a);
 4050|       |
 4051|       |/*
 4052|       |     If there was a borrow out, then |b| > |a| in violation
 4053|       |     of our input invariant.  We've already done the work,
 4054|       |     but we'll at least complain about it...
 4055|       |   */
 4056|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4057|       |    return w ? MP_RANGE : MP_OKAY;
 4058|       |#else
 4059|   598k|    return borrow ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
                  return borrow ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   39|   598k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4059:12): [True: 0, False: 598k]
  ------------------
 4060|   598k|#endif
 4061|   598k|} /* end s_mp_sub() */
s_mp_sub_3arg:
 4068|  1.08M|{
 4069|  1.08M|    mp_digit *pa, *pb, *pc;
 4070|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4071|       |    mp_sword w = 0;
 4072|       |#else
 4073|  1.08M|    mp_digit d, diff, borrow = 0;
 4074|  1.08M|#endif
 4075|  1.08M|    int ix, limit;
 4076|  1.08M|    mp_err res;
 4077|       |
 4078|  1.08M|    MP_SIGN(c) = MP_SIGN(a);
  ------------------
  |  |  149|  1.08M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(c) = MP_SIGN(a);
  ------------------
  |  |  149|  1.08M|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
 4079|       |
 4080|       |    /* Make sure a has enough precision for the output value */
 4081|  1.08M|    if (MP_OKAY != (res = s_mp_pad(c, MP_USED(a))))
  ------------------
  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
                  if (MP_OKAY != (res = s_mp_pad(c, MP_USED(a))))
  ------------------
  |  |  150|  1.08M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (4081:9): [True: 0, False: 1.08M]
  ------------------
 4082|      0|        return res;
 4083|       |
 4084|       |    /*
 4085|       |    Subtract and propagate borrow.  Up to the precision of b, this
 4086|       |    accounts for the digits of b; after that, we just make sure the
 4087|       |    carries get to the right place.  This saves having to pad b out to
 4088|       |    the precision of a just to make the loops work right...
 4089|       |   */
 4090|  1.08M|    pa = MP_DIGITS(a);
  ------------------
  |  |  152|  1.08M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4091|  1.08M|    pb = MP_DIGITS(b);
  ------------------
  |  |  152|  1.08M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4092|  1.08M|    pc = MP_DIGITS(c);
  ------------------
  |  |  152|  1.08M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4093|  1.08M|    limit = MP_USED(b);
  ------------------
  |  |  150|  1.08M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4094|  18.4M|    for (ix = 0; ix < limit; ++ix) {
  ------------------
  |  Branch (4094:18): [True: 17.3M, False: 1.08M]
  ------------------
 4095|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4096|       |        w = w + *pa++ - *pb++;
 4097|       |        *pc++ = ACCUM(w);
 4098|       |        w >>= MP_DIGIT_BIT;
 4099|       |#else
 4100|  17.3M|        d = *pa++;
 4101|  17.3M|        diff = d - *pb++;
 4102|  17.3M|        d = (diff > d);
 4103|  17.3M|        if (borrow && --diff == MP_DIGIT_MAX)
  ------------------
  |  |   79|  7.13M|#define MP_DIGIT_MAX ULONG_MAX
  ------------------
  |  Branch (4103:13): [True: 7.13M, False: 10.2M]
  |  Branch (4103:23): [True: 32.9k, False: 7.10M]
  ------------------
 4104|  32.9k|            ++d;
 4105|  17.3M|        *pc++ = diff;
 4106|  17.3M|        borrow = d;
 4107|  17.3M|#endif
 4108|  17.3M|    }
 4109|  1.31M|    for (limit = MP_USED(a); ix < limit; ++ix) {
  ------------------
  |  |  150|  1.08M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (4109:30): [True: 233k, False: 1.08M]
  ------------------
 4110|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4111|       |        w = w + *pa++;
 4112|       |        *pc++ = ACCUM(w);
 4113|       |        w >>= MP_DIGIT_BIT;
 4114|       |#else
 4115|   233k|        d = *pa++;
 4116|   233k|        *pc++ = diff = d - borrow;
 4117|   233k|        borrow = (diff > d);
 4118|   233k|#endif
 4119|   233k|    }
 4120|       |
 4121|       |    /* Clobber any leading zeroes we created    */
 4122|  1.08M|    MP_USED(c) = ix;
  ------------------
  |  |  150|  1.08M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4123|  1.08M|    s_mp_clamp(c);
 4124|       |
 4125|       |/*
 4126|       |     If there was a borrow out, then |b| > |a| in violation
 4127|       |     of our input invariant.  We've already done the work,
 4128|       |     but we'll at least complain about it...
 4129|       |   */
 4130|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_SUB_WORD)
 4131|       |    return w ? MP_RANGE : MP_OKAY;
 4132|       |#else
 4133|  1.08M|    return borrow ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
                  return borrow ? MP_RANGE : MP_OKAY;
  ------------------
  |  |   39|  1.08M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4133:12): [True: 0, False: 1.08M]
  ------------------
 4134|  1.08M|#endif
 4135|  1.08M|}
s_mp_mul:
 4141|  1.22M|{
 4142|  1.22M|    return mp_mul(a, b, a);
 4143|  1.22M|} /* end s_mp_mul() */
s_mpv_sqr_add_prop:
 4364|   857k|{
 4365|       |#if !defined(MP_NO_MP_WORD) && !defined(MP_NO_MUL_WORD)
 4366|       |    mp_word w;
 4367|       |    mp_digit d;
 4368|       |    mp_size ix;
 4369|       |
 4370|       |    w = 0;
 4371|       |#define ADD_SQUARE(n)                     \
 4372|       |    d = pa[n];                            \
 4373|       |    w += (d * (mp_word)d) + ps[2 * n];    \
 4374|       |    ps[2 * n] = ACCUM(w);                 \
 4375|       |    w = (w >> DIGIT_BIT) + ps[2 * n + 1]; \
 4376|       |    ps[2 * n + 1] = ACCUM(w);             \
 4377|       |    w = (w >> DIGIT_BIT)
 4378|       |
 4379|       |    for (ix = a_len; ix >= 4; ix -= 4) {
 4380|       |        ADD_SQUARE(0);
 4381|       |        ADD_SQUARE(1);
 4382|       |        ADD_SQUARE(2);
 4383|       |        ADD_SQUARE(3);
 4384|       |        pa += 4;
 4385|       |        ps += 8;
 4386|       |    }
 4387|       |    if (ix) {
 4388|       |        ps += 2 * ix;
 4389|       |        pa += ix;
 4390|       |        switch (ix) {
 4391|       |            case 3:
 4392|       |                ADD_SQUARE(-3); /* FALLTHRU */
 4393|       |            case 2:
 4394|       |                ADD_SQUARE(-2); /* FALLTHRU */
 4395|       |            case 1:
 4396|       |                ADD_SQUARE(-1); /* FALLTHRU */
 4397|       |            case 0:
 4398|       |                break;
 4399|       |        }
 4400|       |    }
 4401|       |    while (w) {
 4402|       |        w += *ps;
 4403|       |        *ps++ = ACCUM(w);
 4404|       |        w = (w >> DIGIT_BIT);
 4405|       |    }
 4406|       |#else
 4407|   857k|    mp_digit carry = 0;
 4408|  49.8M|    while (a_len--) {
  ------------------
  |  Branch (4408:12): [True: 48.9M, False: 857k]
  ------------------
 4409|  48.9M|        mp_digit a_i = *pa++;
 4410|  48.9M|        mp_digit a0a0, a1a1;
 4411|       |
 4412|  48.9M|        MP_SQR_D(a_i, a1a1, a0a0);
  ------------------
  |  | 4347|  48.9M|    {                                                              \
  |  | 4348|  48.9M|        mp_digit Pmid;                                             \
  |  | 4349|  48.9M|        Plo = (a & MP_HALF_DIGIT_MAX) * (a & MP_HALF_DIGIT_MAX);   \
  |  |  ------------------
  |  |  |  |   81|  48.9M|#define MP_HALF_DIGIT_MAX UINT_MAX
  |  |  ------------------
  |  |                       Plo = (a & MP_HALF_DIGIT_MAX) * (a & MP_HALF_DIGIT_MAX);   \
  |  |  ------------------
  |  |  |  |   81|  48.9M|#define MP_HALF_DIGIT_MAX UINT_MAX
  |  |  ------------------
  |  | 4350|  48.9M|        Phi = (a >> MP_HALF_DIGIT_BIT) * (a >> MP_HALF_DIGIT_BIT); \
  |  |  ------------------
  |  |  |  |  141|  48.9M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  48.9M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  48.9M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                       Phi = (a >> MP_HALF_DIGIT_BIT) * (a >> MP_HALF_DIGIT_BIT); \
  |  |  ------------------
  |  |  |  |  141|  48.9M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  48.9M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  48.9M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4351|  48.9M|        Pmid = (a & MP_HALF_DIGIT_MAX) * (a >> MP_HALF_DIGIT_BIT); \
  |  |  ------------------
  |  |  |  |   81|  48.9M|#define MP_HALF_DIGIT_MAX UINT_MAX
  |  |  ------------------
  |  |                       Pmid = (a & MP_HALF_DIGIT_MAX) * (a >> MP_HALF_DIGIT_BIT); \
  |  |  ------------------
  |  |  |  |  141|  48.9M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  48.9M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  48.9M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4352|  48.9M|        Phi += Pmid >> (MP_HALF_DIGIT_BIT - 1);                    \
  |  |  ------------------
  |  |  |  |  141|  48.9M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  48.9M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  48.9M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4353|  48.9M|        Pmid <<= (MP_HALF_DIGIT_BIT + 1);                          \
  |  |  ------------------
  |  |  |  |  141|  48.9M|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  48.9M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  136|  48.9M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4354|  48.9M|        Plo += Pmid;                                               \
  |  | 4355|  48.9M|        if (Plo < Pmid)                                            \
  |  |  ------------------
  |  |  |  Branch (4355:13): [True: 16.2M, False: 32.7M]
  |  |  ------------------
  |  | 4356|  48.9M|            ++Phi;                                                 \
  |  | 4357|  48.9M|    }
  ------------------
 4413|       |
 4414|       |        /* here a1a1 and a0a0 constitute a_i ** 2 */
 4415|  48.9M|        a0a0 += carry;
 4416|  48.9M|        if (a0a0 < carry)
  ------------------
  |  Branch (4416:13): [True: 0, False: 48.9M]
  ------------------
 4417|      0|            ++a1a1;
 4418|       |
 4419|       |        /* now add to ps */
 4420|  48.9M|        a0a0 += a_i = *ps;
 4421|  48.9M|        if (a0a0 < a_i)
  ------------------
  |  Branch (4421:13): [True: 23.7M, False: 25.2M]
  ------------------
 4422|  23.7M|            ++a1a1;
 4423|  48.9M|        *ps++ = a0a0;
 4424|  48.9M|        a1a1 += a_i = *ps;
 4425|  48.9M|        carry = (a1a1 < a_i);
 4426|  48.9M|        *ps++ = a1a1;
 4427|  48.9M|    }
 4428|   857k|    while (carry) {
  ------------------
  |  Branch (4428:12): [True: 0, False: 857k]
  ------------------
 4429|      0|        mp_digit s_i = *ps;
 4430|      0|        carry += s_i;
 4431|      0|        *ps++ = carry;
 4432|      0|        carry = carry < s_i;
 4433|      0|    }
 4434|   857k|#endif
 4435|   857k|}
s_mpv_div_2dx1d:
 4446|   198k|{
 4447|   198k|    mp_digit d1, d0, q1, q0;
 4448|   198k|    mp_digit r1, r0, m;
 4449|       |
 4450|   198k|    d1 = divisor >> MP_HALF_DIGIT_BIT;
  ------------------
  |  |  141|   198k|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  137|   198k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   198k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4451|   198k|    d0 = divisor & MP_HALF_DIGIT_MAX;
  ------------------
  |  |   81|   198k|#define MP_HALF_DIGIT_MAX UINT_MAX
  ------------------
 4452|   198k|    r1 = Nhi % d1;
 4453|   198k|    q1 = Nhi / d1;
 4454|   198k|    m = q1 * d0;
 4455|   198k|    r1 = (r1 << MP_HALF_DIGIT_BIT) | (Nlo >> MP_HALF_DIGIT_BIT);
  ------------------
  |  |  141|   198k|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  137|   198k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   198k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  r1 = (r1 << MP_HALF_DIGIT_BIT) | (Nlo >> MP_HALF_DIGIT_BIT);
  ------------------
  |  |  141|   198k|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  137|   198k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   198k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4456|   198k|    if (r1 < m) {
  ------------------
  |  Branch (4456:9): [True: 57.2k, False: 141k]
  ------------------
 4457|  57.2k|        q1--, r1 += divisor;
 4458|  57.2k|        if (r1 >= divisor && r1 < m) {
  ------------------
  |  Branch (4458:13): [True: 17.5k, False: 39.7k]
  |  Branch (4458:30): [True: 1.39k, False: 16.1k]
  ------------------
 4459|  1.39k|            q1--, r1 += divisor;
 4460|  1.39k|        }
 4461|  57.2k|    }
 4462|   198k|    r1 -= m;
 4463|   198k|    r0 = r1 % d1;
 4464|   198k|    q0 = r1 / d1;
 4465|   198k|    m = q0 * d0;
 4466|   198k|    r0 = (r0 << MP_HALF_DIGIT_BIT) | (Nlo & MP_HALF_DIGIT_MAX);
  ------------------
  |  |  141|   198k|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  137|   198k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   198k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  r0 = (r0 << MP_HALF_DIGIT_BIT) | (Nlo & MP_HALF_DIGIT_MAX);
  ------------------
  |  |   81|   198k|#define MP_HALF_DIGIT_MAX UINT_MAX
  ------------------
 4467|   198k|    if (r0 < m) {
  ------------------
  |  Branch (4467:9): [True: 58.4k, False: 140k]
  ------------------
 4468|  58.4k|        q0--, r0 += divisor;
 4469|  58.4k|        if (r0 >= divisor && r0 < m) {
  ------------------
  |  Branch (4469:13): [True: 18.9k, False: 39.5k]
  |  Branch (4469:30): [True: 1.57k, False: 17.3k]
  ------------------
 4470|  1.57k|            q0--, r0 += divisor;
 4471|  1.57k|        }
 4472|  58.4k|    }
 4473|   198k|    if (qp)
  ------------------
  |  Branch (4473:9): [True: 198k, False: 0]
  ------------------
 4474|   198k|        *qp = (q1 << MP_HALF_DIGIT_BIT) | q0;
  ------------------
  |  |  141|   198k|#define MP_HALF_DIGIT_BIT (MP_DIGIT_BIT / 2)
  |  |  ------------------
  |  |  |  |  137|   198k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   198k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4475|   198k|    if (rp)
  ------------------
  |  Branch (4475:9): [True: 198k, False: 0]
  ------------------
 4476|   198k|        *rp = r0 - m;
 4477|   198k|    return MP_OKAY;
  ------------------
  |  |   39|   198k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 4478|   198k|}
s_mp_sqr:
 4486|   353k|{
 4487|   353k|    mp_err res;
 4488|   353k|    mp_int tmp;
 4489|       |
 4490|   353k|    if ((res = mp_init_size(&tmp, 2 * USED(a))) != MP_OKAY)
  ------------------
  |  |  333|   353k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   353k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  if ((res = mp_init_size(&tmp, 2 * USED(a))) != MP_OKAY)
  ------------------
  |  |   39|   353k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4490:9): [True: 0, False: 353k]
  ------------------
 4491|      0|        return res;
 4492|   353k|    res = mp_sqr(a, &tmp);
 4493|   353k|    if (res == MP_OKAY) {
  ------------------
  |  |   39|   353k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4493:9): [True: 353k, False: 0]
  ------------------
 4494|   353k|        s_mp_exch(&tmp, a);
 4495|   353k|    }
 4496|   353k|    mp_clear(&tmp);
 4497|   353k|    return res;
 4498|   353k|}
s_mp_div:
 4515|  18.2k|{
 4516|  18.2k|    mp_int part, t;
 4517|  18.2k|    mp_digit q_msd;
 4518|  18.2k|    mp_err res;
 4519|  18.2k|    mp_digit d;
 4520|  18.2k|    mp_digit div_msd;
 4521|  18.2k|    int ix;
 4522|       |
 4523|  18.2k|    if (mp_cmp_z(div) == 0)
  ------------------
  |  Branch (4523:9): [True: 0, False: 18.2k]
  ------------------
 4524|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 4525|       |
 4526|  18.2k|    DIGITS(&t) = 0;
  ------------------
  |  |  335|  18.2k|#define DIGITS(MP) MP_DIGITS(MP)
  |  |  ------------------
  |  |  |  |  152|  18.2k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
 4527|       |    /* Shortcut if divisor is power of two */
 4528|  18.2k|    if ((ix = s_mp_ispow2(div)) >= 0) {
  ------------------
  |  Branch (4528:9): [True: 392, False: 17.8k]
  ------------------
 4529|    392|        MP_CHECKOK(mp_copy(rem, quot));
  ------------------
  |  |  319|    392|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    392|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 392]
  |  |  ------------------
  |  |  320|    392|    goto CLEANUP
  ------------------
 4530|    392|        s_mp_div_2d(quot, (mp_digit)ix);
 4531|    392|        s_mp_mod_2d(rem, (mp_digit)ix);
 4532|       |
 4533|    392|        return MP_OKAY;
  ------------------
  |  |   39|    392|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 4534|    392|    }
 4535|       |
 4536|  17.8k|    MP_SIGN(rem) = ZPOS;
  ------------------
  |  |  149|  17.8k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(rem) = ZPOS;
  ------------------
  |  |  326|  17.8k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  17.8k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 4537|  17.8k|    MP_SIGN(div) = ZPOS;
  ------------------
  |  |  149|  17.8k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(div) = ZPOS;
  ------------------
  |  |  326|  17.8k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  17.8k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 4538|  17.8k|    MP_SIGN(&part) = ZPOS;
  ------------------
  |  |  149|  17.8k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(&part) = ZPOS;
  ------------------
  |  |  326|  17.8k|#define ZPOS MP_ZPOS
  |  |  ------------------
  |  |  |  |   37|  17.8k|#define MP_ZPOS 0
  |  |  ------------------
  ------------------
 4539|       |
 4540|       |    /* A working temporary for division     */
 4541|  17.8k|    MP_CHECKOK(mp_init_size(&t, MP_ALLOC(rem)));
  ------------------
  |  |  319|  17.8k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  17.8k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 17.8k]
  |  |  ------------------
  |  |  320|  17.8k|    goto CLEANUP
  ------------------
 4542|       |
 4543|       |    /* Normalize to optimize guessing       */
 4544|  17.8k|    MP_CHECKOK(s_mp_norm(rem, div, &d));
  ------------------
  |  |  319|  17.8k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  17.8k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 17.8k]
  |  |  ------------------
  |  |  320|  17.8k|    goto CLEANUP
  ------------------
 4545|       |
 4546|       |    /* Perform the division itself...woo!   */
 4547|  17.8k|    MP_USED(quot) = MP_ALLOC(quot);
  ------------------
  |  |  150|  17.8k|#define MP_USED(MP) ((MP)->used)
  ------------------
                  MP_USED(quot) = MP_ALLOC(quot);
  ------------------
  |  |  151|  17.8k|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
 4548|       |
 4549|       |    /* Find a partial substring of rem which is at least div */
 4550|       |    /* If we didn't find one, we're finished dividing    */
 4551|   220k|    while (MP_USED(rem) > MP_USED(div) || s_mp_cmp(rem, div) >= 0) {
  ------------------
  |  |  150|   220k|#define MP_USED(MP) ((MP)->used)
  ------------------
                  while (MP_USED(rem) > MP_USED(div) || s_mp_cmp(rem, div) >= 0) {
  ------------------
  |  |  150|   441k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (4551:12): [True: 201k, False: 19.0k]
  |  Branch (4551:43): [True: 1.22k, False: 17.8k]
  ------------------
 4552|   202k|        int i;
 4553|   202k|        int unusedRem;
 4554|   202k|        int partExtended = 0; /* set to true if we need to extend part */
 4555|       |
 4556|   202k|        unusedRem = MP_USED(rem) - MP_USED(div);
  ------------------
  |  |  150|   202k|#define MP_USED(MP) ((MP)->used)
  ------------------
                      unusedRem = MP_USED(rem) - MP_USED(div);
  ------------------
  |  |  150|   202k|#define MP_USED(MP) ((MP)->used)
  ------------------
 4557|   202k|        MP_DIGITS(&part) = MP_DIGITS(rem) + unusedRem;
  ------------------
  |  |  152|   202k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
                      MP_DIGITS(&part) = MP_DIGITS(rem) + unusedRem;
  ------------------
  |  |  152|   202k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4558|   202k|        MP_ALLOC(&part) = MP_ALLOC(rem) - unusedRem;
  ------------------
  |  |  151|   202k|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
                      MP_ALLOC(&part) = MP_ALLOC(rem) - unusedRem;
  ------------------
  |  |  151|   202k|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
 4559|   202k|        MP_USED(&part) = MP_USED(div);
  ------------------
  |  |  150|   202k|#define MP_USED(MP) ((MP)->used)
  ------------------
                      MP_USED(&part) = MP_USED(div);
  ------------------
  |  |  150|   202k|#define MP_USED(MP) ((MP)->used)
  ------------------
 4560|       |
 4561|       |        /* We have now truncated the part of the remainder to the same length as
 4562|       |         * the divisor. If part is smaller than div, extend part by one digit. */
 4563|   202k|        if (s_mp_cmp(&part, div) < 0) {
  ------------------
  |  Branch (4563:13): [True: 201k, False: 1.31k]
  ------------------
 4564|   201k|            --unusedRem;
 4565|   201k|#if MP_ARGCHK == 2
 4566|   201k|            assert(unusedRem >= 0);
 4567|   201k|#endif
 4568|   201k|            --MP_DIGITS(&part);
  ------------------
  |  |  152|   201k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4569|   201k|            ++MP_USED(&part);
  ------------------
  |  |  150|   201k|#define MP_USED(MP) ((MP)->used)
  ------------------
 4570|   201k|            ++MP_ALLOC(&part);
  ------------------
  |  |  151|   201k|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
 4571|   201k|            partExtended = 1;
 4572|   201k|        }
 4573|       |
 4574|       |        /* Compute a guess for the next quotient digit       */
 4575|   202k|        q_msd = MP_DIGIT(&part, MP_USED(&part) - 1);
  ------------------
  |  |  153|   202k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 4576|   202k|        div_msd = MP_DIGIT(div, MP_USED(div) - 1);
  ------------------
  |  |  153|   202k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 4577|   202k|        if (!partExtended) {
  ------------------
  |  Branch (4577:13): [True: 1.31k, False: 201k]
  ------------------
 4578|       |            /* In this case, q_msd /= div_msd is always 1. First, since div_msd is
 4579|       |             * normalized to have the high bit set, 2*div_msd > MP_DIGIT_MAX. Since
 4580|       |             * we didn't extend part, q_msd >= div_msd. Therefore we know that
 4581|       |             * div_msd <= q_msd <= MP_DIGIT_MAX < 2*div_msd. Dividing by div_msd we
 4582|       |             * get 1 <= q_msd/div_msd < 2. So q_msd /= div_msd must be 1. */
 4583|  1.31k|            q_msd = 1;
 4584|   201k|        } else {
 4585|   201k|            if (q_msd == div_msd) {
  ------------------
  |  Branch (4585:17): [True: 2.90k, False: 198k]
  ------------------
 4586|  2.90k|                q_msd = MP_DIGIT_MAX;
  ------------------
  |  |   79|  2.90k|#define MP_DIGIT_MAX ULONG_MAX
  ------------------
 4587|   198k|            } else {
 4588|   198k|                mp_digit r;
 4589|   198k|                MP_CHECKOK(s_mpv_div_2dx1d(q_msd, MP_DIGIT(&part, MP_USED(&part) - 2),
  ------------------
  |  |  319|   198k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   198k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 198k]
  |  |  ------------------
  |  |  320|   198k|    goto CLEANUP
  ------------------
 4590|   198k|                                           div_msd, &q_msd, &r));
 4591|   198k|            }
 4592|   201k|        }
 4593|   202k|#if MP_ARGCHK == 2
 4594|   202k|        assert(q_msd > 0); /* This case should never occur any more. */
 4595|   202k|#endif
 4596|   202k|        if (q_msd <= 0)
  ------------------
  |  Branch (4596:13): [True: 0, False: 202k]
  ------------------
 4597|      0|            break;
 4598|       |
 4599|       |        /* See what that multiplies out to                   */
 4600|   202k|        mp_copy(div, &t);
 4601|   202k|        MP_CHECKOK(s_mp_mul_d(&t, q_msd));
  ------------------
  |  |  319|   202k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   202k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 202k]
  |  |  ------------------
  |  |  320|   202k|    goto CLEANUP
  ------------------
 4602|       |
 4603|       |        /*
 4604|       |           If it's too big, back it off.  We should not have to do this
 4605|       |           more than once, or, in rare cases, twice.  Knuth describes a
 4606|       |           method by which this could be reduced to a maximum of once, but
 4607|       |           I didn't implement that here.
 4608|       |           When using s_mpv_div_2dx1d, we may have to do this 3 times.
 4609|       |         */
 4610|   240k|        for (i = 4; s_mp_cmp(&t, &part) > 0 && i > 0; --i) {
  ------------------
  |  Branch (4610:21): [True: 37.9k, False: 202k]
  |  Branch (4610:48): [True: 37.9k, False: 0]
  ------------------
 4611|  37.9k|            --q_msd;
 4612|  37.9k|            MP_CHECKOK(s_mp_sub(&t, div)); /* t -= div */
  ------------------
  |  |  319|  37.9k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  37.9k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 37.9k]
  |  |  ------------------
  |  |  320|  37.9k|    goto CLEANUP
  ------------------
 4613|  37.9k|        }
 4614|   202k|        if (i < 0) {
  ------------------
  |  Branch (4614:13): [True: 0, False: 202k]
  ------------------
 4615|      0|            res = MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 4616|      0|            goto CLEANUP;
 4617|      0|        }
 4618|       |
 4619|       |        /* At this point, q_msd should be the right next digit   */
 4620|   202k|        MP_CHECKOK(s_mp_sub(&part, &t)); /* part -= t */
  ------------------
  |  |  319|   202k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   202k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 202k]
  |  |  ------------------
  |  |  320|   202k|    goto CLEANUP
  ------------------
 4621|   202k|        s_mp_clamp(rem);
 4622|       |
 4623|       |        /*
 4624|       |          Include the digit in the quotient.  We allocated enough memory
 4625|       |          for any quotient we could ever possibly get, so we should not
 4626|       |          have to check for failures here
 4627|       |         */
 4628|   202k|        MP_DIGIT(quot, unusedRem) = q_msd;
  ------------------
  |  |  153|   202k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 4629|   202k|    }
 4630|       |
 4631|       |    /* Denormalize remainder                */
 4632|  17.8k|    if (d) {
  ------------------
  |  Branch (4632:9): [True: 6.39k, False: 11.4k]
  ------------------
 4633|  6.39k|        s_mp_div_2d(rem, d);
 4634|  6.39k|    }
 4635|       |
 4636|  17.8k|    s_mp_clamp(quot);
 4637|       |
 4638|  17.8k|CLEANUP:
 4639|  17.8k|    mp_clear(&t);
 4640|       |
 4641|  17.8k|    return res;
 4642|       |
 4643|  17.8k|} /* end s_mp_div() */
s_mp_2expt:
 4651|  1.89k|{
 4652|  1.89k|    mp_err res;
 4653|  1.89k|    mp_size dig, bit;
 4654|       |
 4655|  1.89k|    dig = k / DIGIT_BIT;
  ------------------
  |  |  328|  1.89k|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|  1.89k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  1.89k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4656|  1.89k|    bit = k % DIGIT_BIT;
  ------------------
  |  |  328|  1.89k|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|  1.89k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  1.89k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4657|       |
 4658|  1.89k|    mp_zero(a);
 4659|  1.89k|    if ((res = s_mp_pad(a, dig + 1)) != MP_OKAY)
  ------------------
  |  |   39|  1.89k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4659:9): [True: 0, False: 1.89k]
  ------------------
 4660|      0|        return res;
 4661|       |
 4662|  1.89k|    DIGIT(a, dig) |= ((mp_digit)1 << bit);
  ------------------
  |  |  336|  1.89k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  1.89k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 4663|       |
 4664|  1.89k|    return MP_OKAY;
  ------------------
  |  |   39|  1.89k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 4665|       |
 4666|  1.89k|} /* end s_mp_2expt() */
s_mp_reduce:
 4687|   526k|{
 4688|   526k|    mp_int q;
 4689|   526k|    mp_err res;
 4690|       |
 4691|   526k|    if ((res = mp_init_copy(&q, x)) != MP_OKAY)
  ------------------
  |  |   39|   526k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4691:9): [True: 0, False: 526k]
  ------------------
 4692|      0|        return res;
 4693|       |
 4694|   526k|    s_mp_rshd(&q, USED(m) - 1); /* q1 = x / b^(k-1)  */
  ------------------
  |  |  333|   526k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   526k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 4695|   526k|    s_mp_mul(&q, mu);           /* q2 = q1 * mu      */
 4696|   526k|    s_mp_rshd(&q, USED(m) + 1); /* q3 = q2 / b^(k+1) */
  ------------------
  |  |  333|   526k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   526k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 4697|       |
 4698|       |    /* x = x mod b^(k+1), quick (no division) */
 4699|   526k|    s_mp_mod_2d(x, DIGIT_BIT * (USED(m) + 1));
  ------------------
  |  |  328|   526k|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|   526k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   526k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  s_mp_mod_2d(x, DIGIT_BIT * (USED(m) + 1));
  ------------------
  |  |  333|   526k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   526k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 4700|       |
 4701|       |    /* q = q * m mod b^(k+1), quick (no division) */
 4702|   526k|    s_mp_mul(&q, m);
 4703|   526k|    s_mp_mod_2d(&q, DIGIT_BIT * (USED(m) + 1));
  ------------------
  |  |  328|   526k|#define DIGIT_BIT MP_DIGIT_BIT
  |  |  ------------------
  |  |  |  |  137|   526k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|   526k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  s_mp_mod_2d(&q, DIGIT_BIT * (USED(m) + 1));
  ------------------
  |  |  333|   526k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|   526k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 4704|       |
 4705|       |    /* x = x - q */
 4706|   526k|    if ((res = mp_sub(x, &q, x)) != MP_OKAY)
  ------------------
  |  |   39|   526k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4706:9): [True: 0, False: 526k]
  ------------------
 4707|      0|        goto CLEANUP;
 4708|       |
 4709|       |    /* If x < 0, add b^(k+1) to it */
 4710|   526k|    if (mp_cmp_z(x) < 0) {
  ------------------
  |  Branch (4710:9): [True: 16.5k, False: 510k]
  ------------------
 4711|  16.5k|        mp_set(&q, 1);
 4712|  16.5k|        if ((res = s_mp_lshd(&q, USED(m) + 1)) != MP_OKAY)
  ------------------
  |  |  333|  16.5k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  16.5k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                      if ((res = s_mp_lshd(&q, USED(m) + 1)) != MP_OKAY)
  ------------------
  |  |   39|  16.5k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4712:13): [True: 0, False: 16.5k]
  ------------------
 4713|      0|            goto CLEANUP;
 4714|  16.5k|        if ((res = mp_add(x, &q, x)) != MP_OKAY)
  ------------------
  |  |   39|  16.5k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4714:13): [True: 0, False: 16.5k]
  ------------------
 4715|      0|            goto CLEANUP;
 4716|  16.5k|    }
 4717|       |
 4718|       |    /* Back off if it's too big */
 4719|   581k|    while (mp_cmp(x, m) >= 0) {
  ------------------
  |  Branch (4719:12): [True: 55.2k, False: 526k]
  ------------------
 4720|  55.2k|        if ((res = s_mp_sub(x, m)) != MP_OKAY)
  ------------------
  |  |   39|  55.2k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (4720:13): [True: 0, False: 55.2k]
  ------------------
 4721|      0|            break;
 4722|  55.2k|    }
 4723|       |
 4724|   526k|CLEANUP:
 4725|   526k|    mp_clear(&q);
 4726|       |
 4727|   526k|    return res;
 4728|       |
 4729|   526k|} /* end s_mp_reduce() */
s_mp_cmp:
 4742|  3.98M|{
 4743|  3.98M|    ARGMPCHK(a != NULL && b != NULL);
  ------------------
  |  |  354|  3.98M|#define ARGMPCHK(X) assert(X)
  ------------------
 4744|       |
 4745|  3.98M|    mp_size used_a = MP_USED(a);
  ------------------
  |  |  150|  3.98M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4746|  3.98M|    {
 4747|  3.98M|        mp_size used_b = MP_USED(b);
  ------------------
  |  |  150|  3.98M|#define MP_USED(MP) ((MP)->used)
  ------------------
 4748|       |
 4749|  3.98M|        if (used_a > used_b)
  ------------------
  |  Branch (4749:13): [True: 338k, False: 3.64M]
  ------------------
 4750|   338k|            goto IS_GT;
 4751|  3.64M|        if (used_a < used_b)
  ------------------
  |  Branch (4751:13): [True: 158k, False: 3.49M]
  ------------------
 4752|   158k|            goto IS_LT;
 4753|  3.64M|    }
 4754|  3.49M|    {
 4755|  3.49M|        mp_digit *pa, *pb;
 4756|  3.49M|        mp_digit da = 0, db = 0;
 4757|       |
 4758|  3.49M|#define CMP_AB(n)                     \
 4759|  3.49M|    if ((da = pa[n]) != (db = pb[n])) \
 4760|  3.49M|    goto done
 4761|       |
 4762|  3.49M|        pa = MP_DIGITS(a) + used_a;
  ------------------
  |  |  152|  3.49M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4763|  3.49M|        pb = MP_DIGITS(b) + used_a;
  ------------------
  |  |  152|  3.49M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 4764|  3.51M|        while (used_a >= 4) {
  ------------------
  |  Branch (4764:16): [True: 3.06M, False: 455k]
  ------------------
 4765|  3.06M|            pa -= 4;
 4766|  3.06M|            pb -= 4;
 4767|  3.06M|            used_a -= 4;
 4768|  3.06M|            CMP_AB(3);
  ------------------
  |  | 4759|  3.06M|    if ((da = pa[n]) != (db = pb[n])) \
  |  |  ------------------
  |  |  |  Branch (4759:9): [True: 2.63M, False: 431k]
  |  |  ------------------
  |  | 4760|  3.06M|    goto done
  ------------------
 4769|   431k|            CMP_AB(2);
  ------------------
  |  | 4759|   431k|    if ((da = pa[n]) != (db = pb[n])) \
  |  |  ------------------
  |  |  |  Branch (4759:9): [True: 393k, False: 37.6k]
  |  |  ------------------
  |  | 4760|   431k|    goto done
  ------------------
 4770|  37.6k|            CMP_AB(1);
  ------------------
  |  | 4759|  37.6k|    if ((da = pa[n]) != (db = pb[n])) \
  |  |  ------------------
  |  |  |  Branch (4759:9): [True: 5.38k, False: 32.2k]
  |  |  ------------------
  |  | 4760|  37.6k|    goto done
  ------------------
 4771|  32.2k|            CMP_AB(0);
  ------------------
  |  | 4759|  32.2k|    if ((da = pa[n]) != (db = pb[n])) \
  |  |  ------------------
  |  |  |  Branch (4759:9): [True: 4.92k, False: 27.3k]
  |  |  ------------------
  |  | 4760|  32.2k|    goto done
  ------------------
 4772|  32.2k|        }
 4773|   484k|        while (used_a-- > 0 && ((da = *--pa) == (db = *--pb)))
  ------------------
  |  Branch (4773:16): [True: 459k, False: 25.6k]
  |  Branch (4773:32): [True: 29.4k, False: 429k]
  ------------------
 4774|  29.4k|            /* do nothing */;
 4775|  3.49M|    done:
 4776|  3.49M|        if (da > db)
  ------------------
  |  Branch (4776:13): [True: 773k, False: 2.71M]
  ------------------
 4777|   773k|            goto IS_GT;
 4778|  2.71M|        if (da < db)
  ------------------
  |  Branch (4778:13): [True: 2.69M, False: 25.6k]
  ------------------
 4779|  2.69M|            goto IS_LT;
 4780|  2.71M|    }
 4781|  25.6k|    return MP_EQ;
  ------------------
  |  |   50|  25.6k|#define MP_EQ 0
  ------------------
 4782|  2.85M|IS_LT:
 4783|  2.85M|    return MP_LT;
  ------------------
  |  |   49|  2.85M|#define MP_LT -1
  ------------------
 4784|  1.11M|IS_GT:
 4785|  1.11M|    return MP_GT;
  ------------------
  |  |   51|  1.11M|#define MP_GT 1
  ------------------
 4786|  2.71M|} /* end s_mp_cmp() */
s_mp_cmp_d:
 4795|  2.45M|{
 4796|  2.45M|    ARGMPCHK(a != NULL);
  ------------------
  |  |  354|  2.45M|#define ARGMPCHK(X) assert(X)
  ------------------
 4797|       |
 4798|  2.45M|    if (USED(a) > 1)
  ------------------
  |  |  333|  2.45M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  2.45M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (4798:9): [True: 1.91M, False: 530k]
  ------------------
 4799|  1.91M|        return MP_GT;
  ------------------
  |  |   51|  1.91M|#define MP_GT 1
  ------------------
 4800|       |
 4801|   530k|    if (DIGIT(a, 0) < d)
  ------------------
  |  |  336|   530k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|   530k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (4801:9): [True: 0, False: 530k]
  ------------------
 4802|      0|        return MP_LT;
  ------------------
  |  |   49|      0|#define MP_LT -1
  ------------------
 4803|   530k|    else if (DIGIT(a, 0) > d)
  ------------------
  |  |  336|   530k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|   530k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (4803:14): [True: 505k, False: 25.6k]
  ------------------
 4804|   505k|        return MP_GT;
  ------------------
  |  |   51|   505k|#define MP_GT 1
  ------------------
 4805|  25.6k|    else
 4806|  25.6k|        return MP_EQ;
  ------------------
  |  |   50|  25.6k|#define MP_EQ 0
  ------------------
 4807|       |
 4808|   530k|} /* end s_mp_cmp_d() */
s_mp_ispow2:
 4820|  19.1k|{
 4821|  19.1k|    mp_digit d;
 4822|  19.1k|    int extra = 0, ix;
 4823|       |
 4824|  19.1k|    ARGMPCHK(v != NULL);
  ------------------
  |  |  354|  19.1k|#define ARGMPCHK(X) assert(X)
  ------------------
 4825|       |
 4826|  19.1k|    ix = MP_USED(v) - 1;
  ------------------
  |  |  150|  19.1k|#define MP_USED(MP) ((MP)->used)
  ------------------
 4827|  19.1k|    d = MP_DIGIT(v, ix); /* most significant digit of v */
  ------------------
  |  |  153|  19.1k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 4828|       |
 4829|  19.1k|    extra = s_mp_ispow2d(d);
 4830|  19.1k|    if (extra < 0 || ix == 0)
  ------------------
  |  Branch (4830:9): [True: 16.4k, False: 2.62k]
  |  Branch (4830:22): [True: 0, False: 2.62k]
  ------------------
 4831|  16.4k|        return extra;
 4832|       |
 4833|  25.4k|    while (--ix >= 0) {
  ------------------
  |  Branch (4833:12): [True: 25.0k, False: 401]
  ------------------
 4834|  25.0k|        if (DIGIT(v, ix) != 0)
  ------------------
  |  |  336|  25.0k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  25.0k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
  |  Branch (4834:13): [True: 2.22k, False: 22.8k]
  ------------------
 4835|  2.22k|            return -1; /* not a power of two */
 4836|  22.8k|        extra += MP_DIGIT_BIT;
  ------------------
  |  |  137|  22.8k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|  22.8k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 4837|  22.8k|    }
 4838|       |
 4839|    401|    return extra;
 4840|       |
 4841|  2.62k|} /* end s_mp_ispow2() */
s_mp_ispow2d:
 4849|   214k|{
 4850|   214k|    if ((d != 0) && ((d & (d - 1)) == 0)) { /* d is a power of 2 */
  ------------------
  |  Branch (4850:9): [True: 214k, False: 0]
  |  Branch (4850:21): [True: 7.91k, False: 206k]
  ------------------
 4851|  7.91k|        int pow = 0;
 4852|       |#if defined(MP_USE_UINT_DIGIT)
 4853|       |        if (d & 0xffff0000U)
 4854|       |            pow += 16;
 4855|       |        if (d & 0xff00ff00U)
 4856|       |            pow += 8;
 4857|       |        if (d & 0xf0f0f0f0U)
 4858|       |            pow += 4;
 4859|       |        if (d & 0xccccccccU)
 4860|       |            pow += 2;
 4861|       |        if (d & 0xaaaaaaaaU)
 4862|       |            pow += 1;
 4863|       |#elif defined(MP_USE_LONG_LONG_DIGIT)
 4864|       |        if (d & 0xffffffff00000000ULL)
 4865|       |            pow += 32;
 4866|       |        if (d & 0xffff0000ffff0000ULL)
 4867|       |            pow += 16;
 4868|       |        if (d & 0xff00ff00ff00ff00ULL)
 4869|       |            pow += 8;
 4870|       |        if (d & 0xf0f0f0f0f0f0f0f0ULL)
 4871|       |            pow += 4;
 4872|       |        if (d & 0xccccccccccccccccULL)
 4873|       |            pow += 2;
 4874|       |        if (d & 0xaaaaaaaaaaaaaaaaULL)
 4875|       |            pow += 1;
 4876|       |#elif defined(MP_USE_LONG_DIGIT)
 4877|  7.91k|        if (d & 0xffffffff00000000UL)
  ------------------
  |  Branch (4877:13): [True: 2.70k, False: 5.20k]
  ------------------
 4878|  2.70k|            pow += 32;
 4879|  7.91k|        if (d & 0xffff0000ffff0000UL)
  ------------------
  |  Branch (4879:13): [True: 2.46k, False: 5.45k]
  ------------------
 4880|  2.46k|            pow += 16;
 4881|  7.91k|        if (d & 0xff00ff00ff00ff00UL)
  ------------------
  |  Branch (4881:13): [True: 2.57k, False: 5.34k]
  ------------------
 4882|  2.57k|            pow += 8;
 4883|  7.91k|        if (d & 0xf0f0f0f0f0f0f0f0UL)
  ------------------
  |  Branch (4883:13): [True: 2.65k, False: 5.26k]
  ------------------
 4884|  2.65k|            pow += 4;
 4885|  7.91k|        if (d & 0xccccccccccccccccUL)
  ------------------
  |  Branch (4885:13): [True: 2.89k, False: 5.02k]
  ------------------
 4886|  2.89k|            pow += 2;
 4887|  7.91k|        if (d & 0xaaaaaaaaaaaaaaaaUL)
  ------------------
  |  Branch (4887:13): [True: 5.20k, False: 2.71k]
  ------------------
 4888|  5.20k|            pow += 1;
 4889|       |#else
 4890|       |#error "unknown type for mp_digit"
 4891|       |#endif
 4892|  7.91k|        return pow;
 4893|  7.91k|    }
 4894|   206k|    return -1;
 4895|       |
 4896|   214k|} /* end s_mp_ispow2d() */
mp_read_unsigned_octets:
 5002|  28.1k|{
 5003|  28.1k|    int count;
 5004|  28.1k|    mp_err res;
 5005|  28.1k|    mp_digit d;
 5006|       |
 5007|  28.1k|    ARGCHK(mp != NULL && str != NULL && len > 0, MP_BADARG);
  ------------------
  |  |  355|  28.1k|#define ARGCHK(X, Y) assert(X)
  ------------------
 5008|       |
 5009|  28.1k|    mp_zero(mp);
 5010|       |
 5011|  28.1k|    count = len % sizeof(mp_digit);
 5012|  28.1k|    if (count) {
  ------------------
  |  Branch (5012:9): [True: 11.5k, False: 16.5k]
  ------------------
 5013|  48.0k|        for (d = 0; count-- > 0; --len) {
  ------------------
  |  Branch (5013:21): [True: 36.5k, False: 11.5k]
  ------------------
 5014|  36.5k|            d = (d << 8) | *str++;
 5015|  36.5k|        }
 5016|  11.5k|        MP_DIGIT(mp, 0) = d;
  ------------------
  |  |  153|  11.5k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 5017|  11.5k|    }
 5018|       |
 5019|       |    /* Read the rest of the digits */
 5020|   567k|    for (; len > 0; len -= sizeof(mp_digit)) {
  ------------------
  |  Branch (5020:12): [True: 539k, False: 28.1k]
  ------------------
 5021|  4.85M|        for (d = 0, count = sizeof(mp_digit); count > 0; --count) {
  ------------------
  |  Branch (5021:47): [True: 4.31M, False: 539k]
  ------------------
 5022|  4.31M|            d = (d << 8) | *str++;
 5023|  4.31M|        }
 5024|   539k|        if (MP_EQ == mp_cmp_z(mp)) {
  ------------------
  |  |   50|   539k|#define MP_EQ 0
  ------------------
  |  Branch (5024:13): [True: 36.6k, False: 503k]
  ------------------
 5025|  36.6k|            if (!d)
  ------------------
  |  Branch (5025:17): [True: 19.3k, False: 17.3k]
  ------------------
 5026|  19.3k|                continue;
 5027|   503k|        } else {
 5028|   503k|            if ((res = s_mp_lshd(mp, 1)) != MP_OKAY)
  ------------------
  |  |   39|   503k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (5028:17): [True: 0, False: 503k]
  ------------------
 5029|      0|                return res;
 5030|   503k|        }
 5031|   520k|        MP_DIGIT(mp, 0) = d;
  ------------------
  |  |  153|   520k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
 5032|   520k|    }
 5033|  28.1k|    return MP_OKAY;
  ------------------
  |  |   39|  28.1k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 5034|  28.1k|} /* end mp_read_unsigned_octets() */
mp_unsigned_octet_size:
 5040|  8.63k|{
 5041|  8.63k|    unsigned int bytes;
 5042|  8.63k|    int ix;
 5043|  8.63k|    mp_digit d = 0;
 5044|       |
 5045|  8.63k|    ARGCHK(mp != NULL, MP_BADARG);
  ------------------
  |  |  355|  8.63k|#define ARGCHK(X, Y) assert(X)
  ------------------
 5046|  8.63k|    ARGCHK(MP_ZPOS == SIGN(mp), MP_BADARG);
  ------------------
  |  |  355|  8.63k|#define ARGCHK(X, Y) assert(X)
  ------------------
 5047|       |
 5048|  8.63k|    bytes = (USED(mp) * sizeof(mp_digit));
  ------------------
  |  |  333|  8.63k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  8.63k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 5049|       |
 5050|       |    /* subtract leading zeros. */
 5051|       |    /* Iterate over each digit... */
 5052|  8.63k|    for (ix = USED(mp) - 1; ix >= 0; ix--) {
  ------------------
  |  |  333|  8.63k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  8.63k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (5052:29): [True: 8.63k, False: 0]
  ------------------
 5053|  8.63k|        d = DIGIT(mp, ix);
  ------------------
  |  |  336|  8.63k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  8.63k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5054|  8.63k|        if (d)
  ------------------
  |  Branch (5054:13): [True: 8.63k, False: 0]
  ------------------
 5055|  8.63k|            break;
 5056|      0|        bytes -= sizeof(d);
 5057|      0|    }
 5058|  8.63k|    if (!bytes)
  ------------------
  |  Branch (5058:9): [True: 0, False: 8.63k]
  ------------------
 5059|      0|        return 1;
 5060|       |
 5061|       |    /* Have MSD, check digit bytes, high order first */
 5062|  13.7k|    for (ix = sizeof(mp_digit) - 1; ix >= 0; ix--) {
  ------------------
  |  Branch (5062:37): [True: 13.7k, False: 0]
  ------------------
 5063|  13.7k|        unsigned char x = (unsigned char)(d >> (ix * CHAR_BIT));
 5064|  13.7k|        if (x)
  ------------------
  |  Branch (5064:13): [True: 8.63k, False: 5.11k]
  ------------------
 5065|  8.63k|            break;
 5066|  5.11k|        --bytes;
 5067|  5.11k|    }
 5068|  8.63k|    return bytes;
 5069|  8.63k|} /* end mp_unsigned_octet_size() */
mp_to_unsigned_octets:
 5076|  4.31k|{
 5077|  4.31k|    int ix, pos = 0;
 5078|  4.31k|    unsigned int bytes;
 5079|       |
 5080|  4.31k|    ARGCHK(mp != NULL && str != NULL && !SIGN(mp), MP_BADARG);
  ------------------
  |  |  355|  4.31k|#define ARGCHK(X, Y) assert(X)
  ------------------
 5081|       |
 5082|  4.31k|    bytes = mp_unsigned_octet_size(mp);
 5083|  4.31k|    ARGCHK(bytes <= maxlen, MP_BADARG);
  ------------------
  |  |  355|  4.31k|#define ARGCHK(X, Y) assert(X)
  ------------------
 5084|       |
 5085|       |    /* Iterate over each digit... */
 5086|   215k|    for (ix = USED(mp) - 1; ix >= 0; ix--) {
  ------------------
  |  |  333|  4.31k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  4.31k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
  |  Branch (5086:29): [True: 211k, False: 4.31k]
  ------------------
 5087|   211k|        mp_digit d = DIGIT(mp, ix);
  ------------------
  |  |  336|   211k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|   211k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5088|   211k|        int jx;
 5089|       |
 5090|       |        /* Unpack digit bytes, high order first */
 5091|  1.90M|        for (jx = sizeof(mp_digit) - 1; jx >= 0; jx--) {
  ------------------
  |  Branch (5091:41): [True: 1.69M, False: 211k]
  ------------------
 5092|  1.69M|            unsigned char x = (unsigned char)(d >> (jx * CHAR_BIT));
 5093|  1.69M|            if (!pos && !x) /* suppress leading zeros */
  ------------------
  |  Branch (5093:17): [True: 6.86k, False: 1.68M]
  |  Branch (5093:25): [True: 2.54k, False: 4.31k]
  ------------------
 5094|  2.54k|                continue;
 5095|  1.68M|            str[pos++] = x;
 5096|  1.68M|        }
 5097|   211k|    }
 5098|  4.31k|    if (!pos)
  ------------------
  |  Branch (5098:9): [True: 0, False: 4.31k]
  ------------------
 5099|      0|        str[pos++] = 0;
 5100|  4.31k|    return pos;
 5101|  4.31k|} /* end mp_to_unsigned_octets() */
mp_to_fixlen_octets:
 5149|  2.31k|{
 5150|  2.31k|    int ix, jx;
 5151|  2.31k|    unsigned int bytes;
 5152|       |
 5153|  2.31k|    ARGCHK(mp != NULL && str != NULL && !SIGN(mp) && length > 0, MP_BADARG);
  ------------------
  |  |  355|  2.31k|#define ARGCHK(X, Y) assert(X)
  ------------------
 5154|       |
 5155|       |    /* Constant time on the value of mp.  Don't use mp_unsigned_octet_size. */
 5156|  2.31k|    bytes = USED(mp) * MP_DIGIT_SIZE;
  ------------------
  |  |  333|  2.31k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  2.31k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  bytes = USED(mp) * MP_DIGIT_SIZE;
  ------------------
  |  |  136|  2.31k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  ------------------
 5157|       |
 5158|       |    /* If the output is shorter than the native size of mp, then check that any
 5159|       |     * bytes not written have zero values.  This check isn't constant time on
 5160|       |     * the assumption that timing-sensitive callers can guarantee that mp fits
 5161|       |     * in the allocated space. */
 5162|  2.31k|    ix = USED(mp) - 1;
  ------------------
  |  |  333|  2.31k|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  2.31k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 5163|  2.31k|    if (bytes > length) {
  ------------------
  |  Branch (5163:9): [True: 353, False: 1.96k]
  ------------------
 5164|    353|        unsigned int zeros = bytes - length;
 5165|       |
 5166|    353|        while (zeros >= MP_DIGIT_SIZE) {
  ------------------
  |  |  136|    353|#define MP_DIGIT_SIZE sizeof(mp_digit)
  ------------------
  |  Branch (5166:16): [True: 0, False: 353]
  ------------------
 5167|      0|            ARGCHK(DIGIT(mp, ix) == 0, MP_BADARG);
  ------------------
  |  |  355|      0|#define ARGCHK(X, Y) assert(X)
  ------------------
 5168|      0|            zeros -= MP_DIGIT_SIZE;
  ------------------
  |  |  136|      0|#define MP_DIGIT_SIZE sizeof(mp_digit)
  ------------------
 5169|      0|            ix--;
 5170|      0|        }
 5171|       |
 5172|    353|        if (zeros > 0) {
  ------------------
  |  Branch (5172:13): [True: 353, False: 0]
  ------------------
 5173|    353|            mp_digit d = DIGIT(mp, ix);
  ------------------
  |  |  336|    353|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|    353|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5174|    353|            mp_digit m = ~0ULL << ((MP_DIGIT_SIZE - zeros) * CHAR_BIT);
  ------------------
  |  |  136|    353|#define MP_DIGIT_SIZE sizeof(mp_digit)
  ------------------
 5175|    353|            ARGCHK((d & m) == 0, MP_BADARG);
  ------------------
  |  |  355|    353|#define ARGCHK(X, Y) assert(X)
  ------------------
 5176|    765|            for (jx = MP_DIGIT_SIZE - zeros - 1; jx >= 0; jx--) {
  ------------------
  |  |  136|    353|#define MP_DIGIT_SIZE sizeof(mp_digit)
  ------------------
  |  Branch (5176:50): [True: 412, False: 353]
  ------------------
 5177|    412|                *str++ = d >> (jx * CHAR_BIT);
 5178|    412|            }
 5179|    353|            ix--;
 5180|    353|        }
 5181|  1.96k|    } else if (bytes < length) {
  ------------------
  |  Branch (5181:16): [True: 283, False: 1.67k]
  ------------------
 5182|       |        /* Place any needed leading zeros. */
 5183|    283|        unsigned int zeros = length - bytes;
 5184|    283|        memset(str, 0, zeros);
 5185|    283|        str += zeros;
 5186|    283|    }
 5187|       |
 5188|       |    /* Iterate over each whole digit... */
 5189|  39.9k|    for (; ix >= 0; ix--) {
  ------------------
  |  Branch (5189:12): [True: 37.6k, False: 2.31k]
  ------------------
 5190|  37.6k|        mp_digit d = DIGIT(mp, ix);
  ------------------
  |  |  336|  37.6k|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  37.6k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5191|       |
 5192|       |        /* Unpack digit bytes, high order first */
 5193|   339k|        for (jx = MP_DIGIT_SIZE - 1; jx >= 0; jx--) {
  ------------------
  |  |  136|  37.6k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  ------------------
  |  Branch (5193:38): [True: 301k, False: 37.6k]
  ------------------
 5194|   301k|            *str++ = d >> (jx * CHAR_BIT);
 5195|   301k|        }
 5196|  37.6k|    }
 5197|  2.31k|    return MP_OKAY;
  ------------------
  |  |   39|  2.31k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
 5198|  2.31k|} /* end mp_to_fixlen_octets() */
mp_cswap:
 5205|  3.06M|{
 5206|  3.06M|    mp_digit x;
 5207|  3.06M|    unsigned int i;
 5208|  3.06M|    mp_err res = 0;
 5209|       |
 5210|       |    /* if pointers are equal return */
 5211|  3.06M|    if (a == b)
  ------------------
  |  Branch (5211:9): [True: 0, False: 3.06M]
  ------------------
 5212|      0|        return res;
 5213|       |
 5214|  3.06M|    if (MP_ALLOC(a) < numdigits || MP_ALLOC(b) < numdigits) {
  ------------------
  |  |  151|  3.06M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
                  if (MP_ALLOC(a) < numdigits || MP_ALLOC(b) < numdigits) {
  ------------------
  |  |  151|  3.06M|#define MP_ALLOC(MP) ((MP)->alloc)
  ------------------
  |  Branch (5214:9): [True: 0, False: 3.06M]
  |  Branch (5214:36): [True: 0, False: 3.06M]
  ------------------
 5215|      0|        MP_CHECKOK(s_mp_grow(a, numdigits));
  ------------------
  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  320|      0|    goto CLEANUP
  ------------------
 5216|      0|        MP_CHECKOK(s_mp_grow(b, numdigits));
  ------------------
  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  320|      0|    goto CLEANUP
  ------------------
 5217|      0|    }
 5218|       |
 5219|  3.06M|    condition = ((~condition & ((condition - 1))) >> (MP_DIGIT_BIT - 1)) - 1;
  ------------------
  |  |  137|  3.06M|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|  3.06M|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
 5220|       |
 5221|  3.06M|    x = (USED(a) ^ USED(b)) & condition;
  ------------------
  |  |  333|  3.06M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  3.06M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
                  x = (USED(a) ^ USED(b)) & condition;
  ------------------
  |  |  333|  3.06M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  3.06M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 5222|  3.06M|    USED(a) ^= x;
  ------------------
  |  |  333|  3.06M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  3.06M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 5223|  3.06M|    USED(b) ^= x;
  ------------------
  |  |  333|  3.06M|#define USED(MP) MP_USED(MP)
  |  |  ------------------
  |  |  |  |  150|  3.06M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  ------------------
 5224|       |
 5225|  3.06M|    x = (SIGN(a) ^ SIGN(b)) & condition;
  ------------------
  |  |  332|  3.06M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  3.06M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
                  x = (SIGN(a) ^ SIGN(b)) & condition;
  ------------------
  |  |  332|  3.06M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  3.06M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 5226|  3.06M|    SIGN(a) ^= x;
  ------------------
  |  |  332|  3.06M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  3.06M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 5227|  3.06M|    SIGN(b) ^= x;
  ------------------
  |  |  332|  3.06M|#define SIGN(MP) MP_SIGN(MP)
  |  |  ------------------
  |  |  |  |  149|  3.06M|#define MP_SIGN(MP) ((MP)->sign)
  |  |  ------------------
  ------------------
 5228|       |
 5229|  18.3M|    for (i = 0; i < numdigits; i++) {
  ------------------
  |  Branch (5229:17): [True: 15.3M, False: 3.06M]
  ------------------
 5230|  15.3M|        x = (DIGIT(a, i) ^ DIGIT(b, i)) & condition;
  ------------------
  |  |  336|  15.3M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  15.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
                      x = (DIGIT(a, i) ^ DIGIT(b, i)) & condition;
  ------------------
  |  |  336|  15.3M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  15.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5231|  15.3M|        DIGIT(a, i) ^= x;
  ------------------
  |  |  336|  15.3M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  15.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5232|  15.3M|        DIGIT(b, i) ^= x;
  ------------------
  |  |  336|  15.3M|#define DIGIT(MP, N) MP_DIGIT(MP, N)
  |  |  ------------------
  |  |  |  |  153|  15.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  |  |  ------------------
  ------------------
 5233|  15.3M|    }
 5234|       |
 5235|  3.06M|CLEANUP:
 5236|  3.06M|    return res;
 5237|  3.06M|} /* end mp_cswap() */

s_mpv_mul_d_add_prop:
   21|  91.0M|{
   22|  91.0M|    mp_digit w;
   23|  91.0M|    mp_digit d;
   24|       |
   25|  91.0M|    d = s_mpv_mul_add_vec64(c, a, a_len, b);
   26|  91.0M|    c += a_len;
   27|   208M|    while (d) {
  ------------------
  |  Branch (27:12): [True: 117M, False: 91.0M]
  ------------------
   28|   117M|        w = c[0] + d;
   29|   117M|        d = (w < c[0] || w < d);
  ------------------
  |  Branch (29:14): [True: 27.3M, False: 90.3M]
  |  Branch (29:26): [True: 0, False: 90.3M]
  ------------------
   30|   117M|        *c++ = w;
   31|   117M|    }
   32|  91.0M|}

mpl_get_bits:
  392|   288k|{
  393|   288k|    mp_size rshift = (lsbNum % MP_DIGIT_BIT);
  ------------------
  |  |  137|   288k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|   288k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  394|   288k|    mp_size lsWndx = (lsbNum / MP_DIGIT_BIT);
  ------------------
  |  |  137|   288k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|   288k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  395|   288k|    mp_digit *digit = MP_DIGITS(a) + lsWndx;
  ------------------
  |  |  152|   288k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  396|   288k|    mp_digit mask = ((1 << numBits) - 1);
  397|       |
  398|   288k|    ARGCHK(numBits < CHAR_BIT * sizeof mask, MP_BADARG);
  ------------------
  |  |  355|   288k|#define ARGCHK(X, Y) assert(X)
  ------------------
  399|   288k|    ARGCHK(MP_HOWMANY(lsbNum, MP_DIGIT_BIT) <= MP_USED(a), MP_RANGE);
  ------------------
  |  |  355|   288k|#define ARGCHK(X, Y) assert(X)
  ------------------
  400|       |
  401|   288k|    if ((numBits + lsbNum % MP_DIGIT_BIT <= MP_DIGIT_BIT) ||
  ------------------
  |  |  137|   288k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|   288k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
                  if ((numBits + lsbNum % MP_DIGIT_BIT <= MP_DIGIT_BIT) ||
  ------------------
  |  |  137|   288k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|   288k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  |  Branch (401:9): [True: 287k, False: 1.14k]
  ------------------
  402|   288k|        (lsWndx + 1 >= MP_USED(a))) {
  ------------------
  |  |  150|  1.14k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (402:9): [True: 229, False: 916]
  ------------------
  403|   287k|        mask &= (digit[0] >> rshift);
  404|   287k|    } else {
  405|    916|        mask &= ((digit[0] >> rshift) | (digit[1] << (MP_DIGIT_BIT - rshift)));
  ------------------
  |  |  137|    916|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|    916|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  406|    916|    }
  407|   288k|    return (mp_err)mask;
  408|   288k|}
mpl_significant_bits:
  427|  7.16k|{
  428|       |    /*
  429|       |      start bits at 1.
  430|       |      lg(0) = 0 => bits = 1 by function semantics.
  431|       |      below does a binary search for the _position_ of the top bit set,
  432|       |      which is floor(lg(abs(a))) for a != 0.
  433|       |     */
  434|  7.16k|    mp_size bits = 1;
  435|  7.16k|    int ix;
  436|       |
  437|  7.16k|    ARGCHK(a != NULL, MP_BADARG);
  ------------------
  |  |  355|  7.16k|#define ARGCHK(X, Y) assert(X)
  ------------------
  438|       |
  439|  7.16k|    for (ix = MP_USED(a); ix > 0;) {
  ------------------
  |  |  150|  7.16k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (439:27): [True: 7.16k, False: 0]
  ------------------
  440|  7.16k|        mp_digit d, x, mask;
  441|  7.16k|        if ((d = MP_DIGIT(a, --ix)) == 0)
  ------------------
  |  |  153|  7.16k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  |  Branch (441:13): [True: 0, False: 7.16k]
  ------------------
  442|      0|            continue;
  443|  7.16k|#if !defined(MP_USE_UINT_DIGIT)
  444|  7.16k|        LZCNTLOOP(32);
  ------------------
  |  |  411|  7.16k|    do {                                           \
  |  |  412|  7.16k|        x = d >> (i);                              \
  |  |  413|  7.16k|        mask = (0 - x);                            \
  |  |  414|  7.16k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  137|  7.16k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  7.16k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|  7.16k|        bits += (i)&mask;                          \
  |  |  416|  7.16k|        d ^= (x ^ d) & mask;                       \
  |  |  417|  7.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  445|  7.16k|#endif
  446|  7.16k|        LZCNTLOOP(16);
  ------------------
  |  |  411|  7.16k|    do {                                           \
  |  |  412|  7.16k|        x = d >> (i);                              \
  |  |  413|  7.16k|        mask = (0 - x);                            \
  |  |  414|  7.16k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  137|  7.16k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  7.16k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|  7.16k|        bits += (i)&mask;                          \
  |  |  416|  7.16k|        d ^= (x ^ d) & mask;                       \
  |  |  417|  7.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  447|  7.16k|        LZCNTLOOP(8);
  ------------------
  |  |  411|  7.16k|    do {                                           \
  |  |  412|  7.16k|        x = d >> (i);                              \
  |  |  413|  7.16k|        mask = (0 - x);                            \
  |  |  414|  7.16k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  137|  7.16k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  7.16k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|  7.16k|        bits += (i)&mask;                          \
  |  |  416|  7.16k|        d ^= (x ^ d) & mask;                       \
  |  |  417|  7.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  448|  7.16k|        LZCNTLOOP(4);
  ------------------
  |  |  411|  7.16k|    do {                                           \
  |  |  412|  7.16k|        x = d >> (i);                              \
  |  |  413|  7.16k|        mask = (0 - x);                            \
  |  |  414|  7.16k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  137|  7.16k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  7.16k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|  7.16k|        bits += (i)&mask;                          \
  |  |  416|  7.16k|        d ^= (x ^ d) & mask;                       \
  |  |  417|  7.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  449|  7.16k|        LZCNTLOOP(2);
  ------------------
  |  |  411|  7.16k|    do {                                           \
  |  |  412|  7.16k|        x = d >> (i);                              \
  |  |  413|  7.16k|        mask = (0 - x);                            \
  |  |  414|  7.16k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  137|  7.16k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  7.16k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|  7.16k|        bits += (i)&mask;                          \
  |  |  416|  7.16k|        d ^= (x ^ d) & mask;                       \
  |  |  417|  7.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  450|  7.16k|        LZCNTLOOP(1);
  ------------------
  |  |  411|  7.16k|    do {                                           \
  |  |  412|  7.16k|        x = d >> (i);                              \
  |  |  413|  7.16k|        mask = (0 - x);                            \
  |  |  414|  7.16k|        mask = (0 - (mask >> (MP_DIGIT_BIT - 1))); \
  |  |  ------------------
  |  |  |  |  137|  7.16k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  136|  7.16k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  415|  7.16k|        bits += (i)&mask;                          \
  |  |  416|  7.16k|        d ^= (x ^ d) & mask;                       \
  |  |  417|  7.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (417:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  451|  7.16k|        break;
  452|  7.16k|    }
  453|  7.16k|    bits += ix * MP_DIGIT_BIT;
  ------------------
  |  |  137|  7.16k|#define MP_DIGIT_BIT (CHAR_BIT * MP_DIGIT_SIZE)
  |  |  ------------------
  |  |  |  |  136|  7.16k|#define MP_DIGIT_SIZE sizeof(mp_digit)
  |  |  ------------------
  ------------------
  454|  7.16k|    return bits;
  455|  7.16k|}

s_mp_redc:
   34|  1.18M|{
   35|  1.18M|    mp_err res;
   36|  1.18M|    mp_size i;
   37|       |
   38|  1.18M|    i = (MP_USED(&mmm->N) << 1) + 1;
  ------------------
  |  |  150|  1.18M|#define MP_USED(MP) ((MP)->used)
  ------------------
   39|  1.18M|    MP_CHECKOK(s_mp_pad(T, i));
  ------------------
  |  |  319|  1.18M|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  1.18M|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 1.18M]
  |  |  ------------------
  |  |  320|  1.18M|    goto CLEANUP
  ------------------
   40|  61.2M|    for (i = 0; i < MP_USED(&mmm->N); ++i) {
  ------------------
  |  |  150|  61.2M|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (40:17): [True: 60.1M, False: 1.18M]
  ------------------
   41|  60.1M|        mp_digit m_i = MP_DIGIT(T, i) * mmm->n0prime;
  ------------------
  |  |  153|  60.1M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
   42|       |        /* T += N * m_i * (MP_RADIX ** i); */
   43|  60.1M|        s_mp_mul_d_add_offset(&mmm->N, m_i, T, i);
  ------------------
  |  |  213|  60.1M|    s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  152|  60.1M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  150|  60.1M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  152|  60.1M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
   44|  60.1M|    }
   45|  1.18M|    s_mp_clamp(T);
   46|       |
   47|       |    /* T /= R */
   48|  1.18M|    s_mp_rshd(T, MP_USED(&mmm->N));
  ------------------
  |  |  150|  1.18M|#define MP_USED(MP) ((MP)->used)
  ------------------
   49|       |
   50|  1.18M|    if (s_mp_cmp(T, &mmm->N) >= 0) {
  ------------------
  |  Branch (50:9): [True: 278k, False: 908k]
  ------------------
   51|       |        /* T = T - N */
   52|   278k|        MP_CHECKOK(s_mp_sub(T, &mmm->N));
  ------------------
  |  |  319|   278k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   278k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 278k]
  |  |  ------------------
  |  |  320|   278k|    goto CLEANUP
  ------------------
   53|   278k|#ifdef DEBUG
   54|   278k|        if (mp_cmp(T, &mmm->N) >= 0) {
  ------------------
  |  Branch (54:13): [True: 0, False: 278k]
  ------------------
   55|      0|            res = MP_UNDEF;
  ------------------
  |  |   45|      0|#define MP_UNDEF -5  /* answer is undefined   */
  ------------------
   56|      0|            goto CLEANUP;
   57|      0|        }
   58|   278k|#endif
   59|   278k|    }
   60|  1.18M|    res = MP_OKAY;
  ------------------
  |  |   39|  1.18M|#define MP_OKAY 0    /* no error, all is well */
  ------------------
   61|  1.18M|CLEANUP:
   62|  1.18M|    return res;
   63|  1.18M|}
s_mp_mul_mont:
   75|   320k|{
   76|   320k|    mp_digit *pb;
   77|   320k|    mp_digit m_i;
   78|   320k|    mp_err res;
   79|   320k|    mp_size ib; /* "index b": index of current digit of B */
   80|   320k|    mp_size useda, usedb;
   81|       |
   82|   320k|    ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG);
  ------------------
  |  |  355|   320k|#define ARGCHK(X, Y) assert(X)
  ------------------
   83|       |
   84|   320k|    if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  150|   320k|#define MP_USED(MP) ((MP)->used)
  ------------------
                  if (MP_USED(a) < MP_USED(b)) {
  ------------------
  |  |  150|   320k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (84:9): [True: 2.83k, False: 317k]
  ------------------
   85|  2.83k|        const mp_int *xch = b; /* switch a and b, to do fewer outer loops */
   86|  2.83k|        b = a;
   87|  2.83k|        a = xch;
   88|  2.83k|    }
   89|       |
   90|   320k|    MP_USED(c) = 1;
  ------------------
  |  |  150|   320k|#define MP_USED(MP) ((MP)->used)
  ------------------
   91|   320k|    MP_DIGIT(c, 0) = 0;
  ------------------
  |  |  153|   320k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
   92|   320k|    ib = (MP_USED(&mmm->N) << 1) + 1;
  ------------------
  |  |  150|   320k|#define MP_USED(MP) ((MP)->used)
  ------------------
   93|   320k|    if ((res = s_mp_pad(c, ib)) != MP_OKAY)
  ------------------
  |  |   39|   320k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  |  Branch (93:9): [True: 0, False: 320k]
  ------------------
   94|      0|        goto CLEANUP;
   95|       |
   96|   320k|    useda = MP_USED(a);
  ------------------
  |  |  150|   320k|#define MP_USED(MP) ((MP)->used)
  ------------------
   97|   320k|    pb = MP_DIGITS(b);
  ------------------
  |  |  152|   320k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
   98|   320k|    s_mpv_mul_d(MP_DIGITS(a), useda, *pb++, MP_DIGITS(c));
  ------------------
  |  |  181|   320k|    ((mp_digit *)c)[a_len] = s_mpv_mul_set_vec64(c, a, a_len, b)
  ------------------
   99|   320k|    s_mp_setz(MP_DIGITS(c) + useda + 1, ib - (useda + 1));
  ------------------
  |  |  152|   320k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  100|   320k|    m_i = MP_DIGIT(c, 0) * mmm->n0prime;
  ------------------
  |  |  153|   320k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  101|   320k|    s_mp_mul_d_add_offset(&mmm->N, m_i, c, 0);
  ------------------
  |  |  213|   320k|    s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  152|   320k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  150|   320k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  152|   320k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  102|       |
  103|       |    /* Outer loop:  Digits of b */
  104|   320k|    usedb = MP_USED(b);
  ------------------
  |  |  150|   320k|#define MP_USED(MP) ((MP)->used)
  ------------------
  105|  15.6M|    for (ib = 1; ib < usedb; ib++) {
  ------------------
  |  Branch (105:18): [True: 15.3M, False: 320k]
  ------------------
  106|  15.3M|        mp_digit b_i = *pb++;
  107|       |
  108|       |        /* Inner product:  Digits of a */
  109|  15.3M|        if (b_i)
  ------------------
  |  Branch (109:13): [True: 15.1M, False: 214k]
  ------------------
  110|  15.1M|            s_mpv_mul_d_add_prop(MP_DIGITS(a), useda, b_i, MP_DIGITS(c) + ib);
  ------------------
  |  |  152|  15.1M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
                          s_mpv_mul_d_add_prop(MP_DIGITS(a), useda, b_i, MP_DIGITS(c) + ib);
  ------------------
  |  |  152|  15.1M|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  111|  15.3M|        m_i = MP_DIGIT(c, ib) * mmm->n0prime;
  ------------------
  |  |  153|  15.3M|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  112|  15.3M|        s_mp_mul_d_add_offset(&mmm->N, m_i, c, ib);
  ------------------
  |  |  213|  15.3M|    s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  152|  15.3M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  150|  15.3M|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  152|  15.3M|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  113|  15.3M|    }
  114|   320k|    if (usedb < MP_USED(&mmm->N)) {
  ------------------
  |  |  150|   320k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (114:9): [True: 46.1k, False: 274k]
  ------------------
  115|   198k|        for (usedb = MP_USED(&mmm->N); ib < usedb; ++ib) {
  ------------------
  |  |  150|  46.1k|#define MP_USED(MP) ((MP)->used)
  ------------------
  |  Branch (115:40): [True: 152k, False: 46.1k]
  ------------------
  116|   152k|            m_i = MP_DIGIT(c, ib) * mmm->n0prime;
  ------------------
  |  |  153|   152k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  117|   152k|            s_mp_mul_d_add_offset(&mmm->N, m_i, c, ib);
  ------------------
  |  |  213|   152k|    s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  152|   152k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  150|   152k|#define MP_USED(MP) ((MP)->used)
  |  |  ------------------
  |  |                   s_mpv_mul_d_add_prop(MP_DIGITS(a), MP_USED(a), b, MP_DIGITS(c) + off)
  |  |  ------------------
  |  |  |  |  152|   152k|#define MP_DIGITS(MP) ((MP)->dp)
  |  |  ------------------
  ------------------
  118|   152k|        }
  119|  46.1k|    }
  120|   320k|    s_mp_clamp(c);
  121|   320k|    s_mp_rshd(c, MP_USED(&mmm->N)); /* c /= R */
  ------------------
  |  |  150|   320k|#define MP_USED(MP) ((MP)->used)
  ------------------
  122|   320k|    if (s_mp_cmp(c, &mmm->N) >= 0) {
  ------------------
  |  Branch (122:9): [True: 23.4k, False: 297k]
  ------------------
  123|  23.4k|        MP_CHECKOK(s_mp_sub(c, &mmm->N));
  ------------------
  |  |  319|  23.4k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  23.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 23.4k]
  |  |  ------------------
  |  |  320|  23.4k|    goto CLEANUP
  ------------------
  124|  23.4k|    }
  125|   320k|    res = MP_OKAY;
  ------------------
  |  |   39|   320k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  126|       |
  127|   320k|CLEANUP:
  128|   320k|    return res;
  129|   320k|}
mp_to_mont:
  134|  10.6k|{
  135|  10.6k|    mp_err res;
  136|       |
  137|       |    /* xMont = x * R mod N   where  N is modulus */
  138|  10.6k|    if (x != xMont) {
  ------------------
  |  Branch (138:9): [True: 5.37k, False: 5.23k]
  ------------------
  139|  5.37k|        MP_CHECKOK(mp_copy(x, xMont));
  ------------------
  |  |  319|  5.37k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.37k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.37k]
  |  |  ------------------
  |  |  320|  5.37k|    goto CLEANUP
  ------------------
  140|  5.37k|    }
  141|  10.6k|    MP_CHECKOK(s_mp_lshd(xMont, MP_USED(N))); /* xMont = x << b */
  ------------------
  |  |  319|  10.6k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  10.6k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 10.6k]
  |  |  ------------------
  |  |  320|  10.6k|    goto CLEANUP
  ------------------
  142|  10.6k|    MP_CHECKOK(mp_div(xMont, N, 0, xMont));   /*         mod N */
  ------------------
  |  |  319|  10.6k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  10.6k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 10.6k]
  |  |  ------------------
  |  |  320|  10.6k|    goto CLEANUP
  ------------------
  143|  10.6k|CLEANUP:
  144|  10.6k|    return res;
  145|  10.6k|}
mp_calculate_mont_n0i:
  149|  5.37k|{
  150|  5.37k|    return 0 - s_mp_invmod_radix(MP_DIGIT(N, 0));
  ------------------
  |  |  153|  5.37k|#define MP_DIGIT(MP, N) (MP)->dp[(N)]
  ------------------
  151|  5.37k|}
mpi_to_weave:
  738|  21.8k|{
  739|  21.8k|    mp_size i;
  740|  21.8k|    mp_digit *endDest = weaved + (nDigits * nBignums);
  741|       |
  742|   109k|    for (i = 0; i < WEAVE_WORD_SIZE; i++) {
  ------------------
  |  |  694|   109k|#define WEAVE_WORD_SIZE 4
  ------------------
  |  Branch (742:17): [True: 87.3k, False: 21.8k]
  ------------------
  743|  87.3k|        mp_size used = MP_USED(&bignums[i]);
  ------------------
  |  |  150|  87.3k|#define MP_USED(MP) ((MP)->used)
  ------------------
  744|  87.3k|        mp_digit *pSrc = MP_DIGITS(&bignums[i]);
  ------------------
  |  |  152|  87.3k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  745|  87.3k|        mp_digit *endSrc = pSrc + used;
  746|  87.3k|        mp_digit *pDest = weaved + i;
  747|       |
  748|  87.3k|        ARGCHK(MP_SIGN(&bignums[i]) == MP_ZPOS, MP_BADARG);
  ------------------
  |  |  355|  87.3k|#define ARGCHK(X, Y) assert(X)
  ------------------
  749|  87.3k|        ARGCHK(used <= nDigits, MP_BADARG);
  ------------------
  |  |  355|  87.3k|#define ARGCHK(X, Y) assert(X)
  ------------------
  750|       |
  751|  4.22M|        for (; pSrc < endSrc; pSrc++) {
  ------------------
  |  Branch (751:16): [True: 4.13M, False: 87.3k]
  ------------------
  752|  4.13M|            *pDest = *pSrc;
  753|  4.13M|            pDest += nBignums;
  754|  4.13M|        }
  755|   128k|        while (pDest < endDest) {
  ------------------
  |  Branch (755:16): [True: 41.5k, False: 87.3k]
  ------------------
  756|  41.5k|            *pDest = 0;
  757|  41.5k|            pDest += nBignums;
  758|  41.5k|        }
  759|  87.3k|    }
  760|       |
  761|  21.8k|    return MP_OKAY;
  ------------------
  |  |   39|  21.8k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  762|  21.8k|}
weave_to_mpi:
  782|   298k|{
  783|       |    /* these are indices, but need to be the same size as mp_digit
  784|       |     * because of the CONST_TIME operations */
  785|   298k|    mp_digit i, j;
  786|   298k|    mp_digit d;
  787|   298k|    mp_digit *pDest = MP_DIGITS(a);
  ------------------
  |  |  152|   298k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  788|       |
  789|   298k|    MP_SIGN(a) = MP_ZPOS;
  ------------------
  |  |  149|   298k|#define MP_SIGN(MP) ((MP)->sign)
  ------------------
                  MP_SIGN(a) = MP_ZPOS;
  ------------------
  |  |   37|   298k|#define MP_ZPOS 0
  ------------------
  790|   298k|    MP_USED(a) = nDigits;
  ------------------
  |  |  150|   298k|#define MP_USED(MP) ((MP)->used)
  ------------------
  791|       |
  792|   298k|    assert(weaved != NULL);
  793|       |
  794|       |    /* Fetch the proper column in constant time, indexing over the whole array */
  795|  15.1M|    for (i = 0; i < nDigits; ++i) {
  ------------------
  |  Branch (795:17): [True: 14.8M, False: 298k]
  ------------------
  796|  14.8M|        d = 0;
  797|   293M|        for (j = 0; j < nBignums; ++j) {
  ------------------
  |  Branch (797:21): [True: 278M, False: 14.8M]
  ------------------
  798|   278M|            d |= weaved[i * nBignums + j] & CONST_TIME_EQ(j, index);
  ------------------
  |  |  769|   278M|#define CONST_TIME_EQ(a, b) CONST_TIME_EQ_Z((a) ^ (b))
  |  |  ------------------
  |  |  |  |  768|   278M|#define CONST_TIME_EQ_Z(x) CONST_TIME_MSB(~(x) & ((x)-1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  767|   278M|#define CONST_TIME_MSB(x) (0L - ((x) >> (8 * sizeof(x) - 1)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|   278M|        }
  800|  14.8M|        pDest[i] = d;
  801|  14.8M|    }
  802|       |
  803|   298k|    s_mp_clamp(a);
  804|   298k|    return MP_OKAY;
  ------------------
  |  |   39|   298k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  805|   298k|}
mp_exptmod_safe_i:
  841|  5.37k|{
  842|  5.37k|    mp_int *pa1, *pa2, *ptmp;
  843|  5.37k|    mp_size i;
  844|  5.37k|    mp_size first_window;
  845|  5.37k|    mp_err res;
  846|  5.37k|    int expOff;
  847|  5.37k|    mp_int accum1, accum2, accum[WEAVE_WORD_SIZE];
  848|  5.37k|    mp_int tmp;
  849|  5.37k|    mp_digit *powersArray = NULL;
  850|  5.37k|    mp_digit *powers = NULL;
  851|       |
  852|  5.37k|    MP_DIGITS(&accum1) = 0;
  ------------------
  |  |  152|  5.37k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  853|  5.37k|    MP_DIGITS(&accum2) = 0;
  ------------------
  |  |  152|  5.37k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  854|  5.37k|    MP_DIGITS(&accum[0]) = 0;
  ------------------
  |  |  152|  5.37k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  855|  5.37k|    MP_DIGITS(&accum[1]) = 0;
  ------------------
  |  |  152|  5.37k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  856|  5.37k|    MP_DIGITS(&accum[2]) = 0;
  ------------------
  |  |  152|  5.37k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  857|  5.37k|    MP_DIGITS(&accum[3]) = 0;
  ------------------
  |  |  152|  5.37k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  858|  5.37k|    MP_DIGITS(&tmp) = 0;
  ------------------
  |  |  152|  5.37k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  859|       |
  860|       |    /* grab the first window value. This allows us to preload accumulator1
  861|       |     * and save a conversion, some squares and a multiple*/
  862|  5.37k|    MP_CHECKOK(mpl_get_bits(exponent,
  ------------------
  |  |  319|  5.37k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.37k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.37k]
  |  |  ------------------
  |  |  320|  5.37k|    goto CLEANUP
  ------------------
  863|  5.37k|                            bits_in_exponent - window_bits, window_bits));
  864|  5.37k|    first_window = (mp_size)res;
  865|       |
  866|  5.37k|    MP_CHECKOK(mp_init_size(&accum1, 3 * nLen + 2));
  ------------------
  |  |  319|  5.37k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.37k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.37k]
  |  |  ------------------
  |  |  320|  5.37k|    goto CLEANUP
  ------------------
  867|  5.37k|    MP_CHECKOK(mp_init_size(&accum2, 3 * nLen + 2));
  ------------------
  |  |  319|  5.37k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.37k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.37k]
  |  |  ------------------
  |  |  320|  5.37k|    goto CLEANUP
  ------------------
  868|       |
  869|       |    /* build the first WEAVE_WORD powers inline */
  870|       |    /* if WEAVE_WORD_SIZE is not 4, this code will have to change */
  871|  5.37k|    if (num_powers > 2) {
  ------------------
  |  Branch (871:9): [True: 5.23k, False: 139]
  ------------------
  872|  5.23k|        MP_CHECKOK(mp_init_size(&accum[0], 3 * nLen + 2));
  ------------------
  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  320|  5.23k|    goto CLEANUP
  ------------------
  873|  5.23k|        MP_CHECKOK(mp_init_size(&accum[1], 3 * nLen + 2));
  ------------------
  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  320|  5.23k|    goto CLEANUP
  ------------------
  874|  5.23k|        MP_CHECKOK(mp_init_size(&accum[2], 3 * nLen + 2));
  ------------------
  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  320|  5.23k|    goto CLEANUP
  ------------------
  875|  5.23k|        MP_CHECKOK(mp_init_size(&accum[3], 3 * nLen + 2));
  ------------------
  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  320|  5.23k|    goto CLEANUP
  ------------------
  876|  5.23k|        mp_set(&accum[0], 1);
  877|  5.23k|        MP_CHECKOK(mp_to_mont(&accum[0], &(mmm->N), &accum[0]));
  ------------------
  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  320|  5.23k|    goto CLEANUP
  ------------------
  878|  5.23k|        MP_CHECKOK(mp_copy(montBase, &accum[1]));
  ------------------
  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  320|  5.23k|    goto CLEANUP
  ------------------
  879|  10.4k|        SQR(montBase, &accum[2]);
  ------------------
  |  |  808|  5.23k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  |  |  ------------------
  |  |  |  |  320|  5.23k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  5.23k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  |  |  ------------------
  |  |  |  |  320|  5.23k|    goto CLEANUP
  |  |  ------------------
  ------------------
  880|  5.23k|        MUL_NOWEAVE(montBase, &accum[2], &accum[3]);
  ------------------
  |  |  817|  5.23k|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  ------------------
  |  |  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  |  |  ------------------
  |  |  |  |  320|  5.23k|    goto CLEANUP
  |  |  ------------------
  ------------------
  881|  5.23k|        powersArray = (mp_digit *)malloc(num_powers * (nLen * sizeof(mp_digit) + 1));
  882|  5.23k|        if (!powersArray) {
  ------------------
  |  Branch (882:13): [True: 0, False: 5.23k]
  ------------------
  883|      0|            res = MP_MEM;
  ------------------
  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  ------------------
  884|      0|            goto CLEANUP;
  885|      0|        }
  886|       |        /* powers[i] = base ** (i); */
  887|  5.23k|        powers = (mp_digit *)MP_ALIGN(powersArray, num_powers);
  ------------------
  |  |  828|  5.23k|#define MP_ALIGN(x, y) ((((ptrdiff_t)(x)) + ((y)-1)) & (((ptrdiff_t)0) - (y)))
  ------------------
  888|  5.23k|        MP_CHECKOK(mpi_to_weave(accum, powers, nLen, num_powers));
  ------------------
  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  320|  5.23k|    goto CLEANUP
  ------------------
  889|  5.23k|        if (first_window < 4) {
  ------------------
  |  Branch (889:13): [True: 956, False: 4.27k]
  ------------------
  890|    956|            MP_CHECKOK(mp_copy(&accum[first_window], &accum1));
  ------------------
  |  |  319|    956|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    956|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 956]
  |  |  ------------------
  |  |  320|    956|    goto CLEANUP
  ------------------
  891|    956|            first_window = num_powers;
  892|    956|        }
  893|  5.23k|    } else {
  894|    139|        if (first_window == 0) {
  ------------------
  |  Branch (894:13): [True: 0, False: 139]
  ------------------
  895|      0|            mp_set(&accum1, 1);
  896|      0|            MP_CHECKOK(mp_to_mont(&accum1, &(mmm->N), &accum1));
  ------------------
  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  320|      0|    goto CLEANUP
  ------------------
  897|    139|        } else {
  898|       |            /* assert first_window == 1? */
  899|    139|            MP_CHECKOK(mp_copy(montBase, &accum1));
  ------------------
  |  |  319|    139|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    139|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 139]
  |  |  ------------------
  |  |  320|    139|    goto CLEANUP
  ------------------
  900|    139|        }
  901|    139|    }
  902|       |
  903|       |    /*
  904|       |     * calculate all the powers in the powers array.
  905|       |     * this adds 2**(k-1)-2 square operations over just calculating the
  906|       |     * odd powers where k is the window size in the two other mp_modexpt
  907|       |     * implementations in this file. We will get some of that
  908|       |     * back by not needing the first 'k' squares and one multiply for the
  909|       |     * first window.
  910|       |     * Given the value of 4 for WEAVE_WORD_SIZE, this loop will only execute if
  911|       |     * num_powers > 2, in which case powers will have been allocated.
  912|       |     */
  913|  71.8k|    for (i = WEAVE_WORD_SIZE; i < num_powers; i++) {
  ------------------
  |  |  694|  5.37k|#define WEAVE_WORD_SIZE 4
  ------------------
  |  Branch (913:31): [True: 66.4k, False: 5.37k]
  ------------------
  914|  66.4k|        int acc_index = i & (WEAVE_WORD_SIZE - 1); /* i % WEAVE_WORD_SIZE */
  ------------------
  |  |  694|  66.4k|#define WEAVE_WORD_SIZE 4
  ------------------
  915|  66.4k|        if (i & 1) {
  ------------------
  |  Branch (915:13): [True: 33.2k, False: 33.2k]
  ------------------
  916|  33.2k|            MUL_NOWEAVE(montBase, &accum[acc_index - 1], &accum[acc_index]);
  ------------------
  |  |  817|  33.2k|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  ------------------
  |  |  |  |  319|  33.2k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  33.2k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 33.2k]
  |  |  |  |  ------------------
  |  |  |  |  320|  33.2k|    goto CLEANUP
  |  |  ------------------
  ------------------
  917|       |            /* we've filled the array do our 'per array' processing */
  918|  33.2k|            if (acc_index == (WEAVE_WORD_SIZE - 1)) {
  ------------------
  |  |  694|  33.2k|#define WEAVE_WORD_SIZE 4
  ------------------
  |  Branch (918:17): [True: 16.6k, False: 16.6k]
  ------------------
  919|  16.6k|                MP_CHECKOK(mpi_to_weave(accum, powers + i - (WEAVE_WORD_SIZE - 1),
  ------------------
  |  |  319|  16.6k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  16.6k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 16.6k]
  |  |  ------------------
  |  |  320|  16.6k|    goto CLEANUP
  ------------------
  920|  16.6k|                                        nLen, num_powers));
  921|       |
  922|  16.6k|                if (first_window <= i) {
  ------------------
  |  Branch (922:21): [True: 4.27k, False: 12.3k]
  ------------------
  923|  4.27k|                    MP_CHECKOK(mp_copy(&accum[first_window & (WEAVE_WORD_SIZE - 1)],
  ------------------
  |  |  319|  4.27k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  4.27k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 4.27k]
  |  |  ------------------
  |  |  320|  4.27k|    goto CLEANUP
  ------------------
  924|  4.27k|                                       &accum1));
  925|  4.27k|                    first_window = num_powers;
  926|  4.27k|                }
  927|  16.6k|            }
  928|  33.2k|        } else {
  929|       |            /* up to 8 we can find 2^i-1 in the accum array, but at 8 we our source
  930|       |             * and target are the same so we need to copy.. After that, the
  931|       |             * value is overwritten, so we need to fetch it from the stored
  932|       |             * weave array */
  933|  33.2k|            if (i > 2 * WEAVE_WORD_SIZE) {
  ------------------
  |  |  694|  33.2k|#define WEAVE_WORD_SIZE 4
  ------------------
  |  Branch (933:17): [True: 17.5k, False: 15.6k]
  ------------------
  934|  17.5k|                MP_CHECKOK(weave_to_mpi(&accum2, powers, i / 2, nLen, num_powers));
  ------------------
  |  |  319|  17.5k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  17.5k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 17.5k]
  |  |  ------------------
  |  |  320|  17.5k|    goto CLEANUP
  ------------------
  935|  35.0k|                SQR(&accum2, &accum[acc_index]);
  ------------------
  |  |  808|  17.5k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  17.5k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.5k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.5k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.5k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  17.5k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  17.5k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.5k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.5k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.5k|    goto CLEANUP
  |  |  ------------------
  ------------------
  936|  35.0k|            } else {
  937|  15.6k|                int half_power_index = (i / 2) & (WEAVE_WORD_SIZE - 1);
  ------------------
  |  |  694|  15.6k|#define WEAVE_WORD_SIZE 4
  ------------------
  938|  15.6k|                if (half_power_index == acc_index) {
  ------------------
  |  Branch (938:21): [True: 5.23k, False: 10.4k]
  ------------------
  939|       |                    /* copy is cheaper than weave_to_mpi */
  940|  5.23k|                    MP_CHECKOK(mp_copy(&accum[half_power_index], &accum2));
  ------------------
  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  320|  5.23k|    goto CLEANUP
  ------------------
  941|  10.4k|                    SQR(&accum2, &accum[acc_index]);
  ------------------
  |  |  808|  5.23k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  |  |  ------------------
  |  |  |  |  320|  5.23k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  5.23k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  |  |  ------------------
  |  |  |  |  320|  5.23k|    goto CLEANUP
  |  |  ------------------
  ------------------
  942|  10.4k|                } else {
  943|  10.4k|                    SQR(&accum[half_power_index], &accum[acc_index]);
  ------------------
  |  |  808|  10.4k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  10.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  10.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  10.4k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  10.4k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  10.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  10.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  10.4k|    goto CLEANUP
  |  |  ------------------
  ------------------
  944|  10.4k|                }
  945|  15.6k|            }
  946|  33.2k|        }
  947|  66.4k|    }
  948|       |/* if the accum1 isn't set, Then there is something wrong with our logic
  949|       | * above and is an internal programming error.
  950|       | */
  951|  5.37k|#if MP_ARGCHK == 2
  952|  5.37k|    assert(MP_USED(&accum1) != 0);
  953|  5.37k|#endif
  954|       |
  955|       |    /* set accumulator to montgomery residue of 1 */
  956|  5.37k|    pa1 = &accum1;
  957|  5.37k|    pa2 = &accum2;
  958|       |
  959|       |    /* tmp is not used if window_bits == 1. */
  960|  5.37k|    if (window_bits != 1) {
  ------------------
  |  Branch (960:9): [True: 5.23k, False: 139]
  ------------------
  961|  5.23k|        MP_CHECKOK(mp_init_size(&tmp, 3 * nLen + 2));
  ------------------
  |  |  319|  5.23k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.23k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.23k]
  |  |  ------------------
  |  |  320|  5.23k|    goto CLEANUP
  ------------------
  962|  5.23k|    }
  963|       |
  964|   288k|    for (expOff = bits_in_exponent - window_bits * 2; expOff >= 0; expOff -= window_bits) {
  ------------------
  |  Branch (964:55): [True: 283k, False: 5.37k]
  ------------------
  965|   283k|        mp_size smallExp;
  966|   283k|        MP_CHECKOK(mpl_get_bits(exponent, expOff, window_bits));
  ------------------
  |  |  319|   283k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|   283k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 283k]
  |  |  ------------------
  |  |  320|   283k|    goto CLEANUP
  ------------------
  967|   283k|        smallExp = (mp_size)res;
  968|       |
  969|       |        /* handle unroll the loops */
  970|   283k|        switch (window_bits) {
  971|  2.23k|            case 1:
  ------------------
  |  Branch (971:13): [True: 2.23k, False: 281k]
  ------------------
  972|  2.23k|                if (!smallExp) {
  ------------------
  |  Branch (972:21): [True: 1.18k, False: 1.05k]
  ------------------
  973|  1.18k|                    SQR(pa1, pa2);
  ------------------
  |  |  808|  1.18k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  1.18k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.18k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.18k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  1.18k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  1.18k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.18k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.18k|    goto CLEANUP
  |  |  ------------------
  ------------------
  974|  1.18k|                    SWAPPA;
  ------------------
  |  |  825|  1.18k|    ptmp = pa1; \
  |  |  826|  1.18k|    pa1 = pa2;  \
  |  |  827|  1.18k|    pa2 = ptmp
  ------------------
  975|  1.18k|                } else if (smallExp & 1) {
  ------------------
  |  Branch (975:28): [True: 1.05k, False: 0]
  ------------------
  976|  1.05k|                    SQR(pa1, pa2);
  ------------------
  |  |  808|  1.05k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  1.05k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.05k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 1.05k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.05k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  1.05k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  1.05k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.05k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 1.05k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.05k|    goto CLEANUP
  |  |  ------------------
  ------------------
  977|  1.05k|                    MUL_NOWEAVE(montBase, pa2, pa1);
  ------------------
  |  |  817|  1.05k|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  ------------------
  |  |  |  |  319|  1.05k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  1.05k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 1.05k]
  |  |  |  |  ------------------
  |  |  |  |  320|  1.05k|    goto CLEANUP
  |  |  ------------------
  ------------------
  978|  1.05k|                } else {
  979|      0|                    abort();
  980|      0|                }
  981|  2.23k|                break;
  982|  2.23k|            case 6:
  ------------------
  |  Branch (982:13): [True: 0, False: 283k]
  ------------------
  983|      0|                SQR(pa1, pa2);
  ------------------
  |  |  808|      0|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|    goto CLEANUP
  |  |  ------------------
  |  |  809|      0|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|    goto CLEANUP
  |  |  ------------------
  ------------------
  984|      0|                SQR(pa2, pa1);
  ------------------
  |  |  808|      0|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|    goto CLEANUP
  |  |  ------------------
  |  |  809|      0|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|      0|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|      0|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  320|      0|    goto CLEANUP
  |  |  ------------------
  ------------------
  985|       |            /* fall through */
  986|   263k|            case 4:
  ------------------
  |  Branch (986:13): [True: 263k, False: 19.6k]
  ------------------
  987|   263k|                SQR(pa1, pa2);
  ------------------
  |  |  808|   263k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   263k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  ------------------
  ------------------
  988|   527k|                SQR(pa2, pa1);
  ------------------
  |  |  808|   263k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   263k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  ------------------
  ------------------
  989|   527k|                SQR(pa1, pa2);
  ------------------
  |  |  808|   263k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   263k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  ------------------
  ------------------
  990|   527k|                SQR(pa2, pa1);
  ------------------
  |  |  808|   263k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  ------------------
  |  |  809|   263k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  ------------------
  ------------------
  991|   527k|                MUL(smallExp, pa1, pa2);
  ------------------
  |  |  821|   263k|    MP_CHECKOK(weave_to_mpi(&tmp, powers, (x), nLen, num_powers)); \
  |  |  ------------------
  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  ------------------
  |  |  822|   263k|    MUL_NOWEAVE(&tmp, a, b)
  |  |  ------------------
  |  |  |  |  817|   263k|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|   263k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|   263k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:9): [True: 0, False: 263k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|   263k|    goto CLEANUP
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  992|   263k|                SWAPPA;
  ------------------
  |  |  825|   263k|    ptmp = pa1; \
  |  |  826|   263k|    pa1 = pa2;  \
  |  |  827|   263k|    pa2 = ptmp
  ------------------
  993|   263k|                break;
  994|  17.4k|            case 5:
  ------------------
  |  Branch (994:13): [True: 17.4k, False: 265k]
  ------------------
  995|  17.4k|                SQR(pa1, pa2);
  ------------------
  |  |  808|  17.4k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  17.4k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  ------------------
  996|  34.8k|                SQR(pa2, pa1);
  ------------------
  |  |  808|  17.4k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  17.4k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  ------------------
  997|  34.8k|                SQR(pa1, pa2);
  ------------------
  |  |  808|  17.4k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  17.4k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  ------------------
  998|  34.8k|                SQR(pa2, pa1);
  ------------------
  |  |  808|  17.4k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  17.4k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  ------------------
  999|  34.8k|                SQR(pa1, pa2);
  ------------------
  |  |  808|  17.4k|    MP_CHECKOK(mp_sqr(a, b)); \
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  |  |  809|  17.4k|    MP_CHECKOK(s_mp_redc(b, mmm))
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  ------------------
 1000|  34.8k|                MUL(smallExp, pa2, pa1);
  ------------------
  |  |  821|  17.4k|    MP_CHECKOK(weave_to_mpi(&tmp, powers, (x), nLen, num_powers)); \
  |  |  ------------------
  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  ------------------
  |  |  822|  17.4k|    MUL_NOWEAVE(&tmp, a, b)
  |  |  ------------------
  |  |  |  |  817|  17.4k|    MP_CHECKOK(s_mp_mul_mont(a, x, b, mmm))
  |  |  |  |  ------------------
  |  |  |  |  |  |  319|  17.4k|    if (MP_OKAY > (res = (x))) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   39|  17.4k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (319:9): [True: 0, False: 17.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  320|  17.4k|    goto CLEANUP
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1001|  17.4k|                break;
 1002|  17.4k|            default:
  ------------------
  |  Branch (1002:13): [True: 0, False: 283k]
  ------------------
 1003|      0|                abort(); /* could do a loop? */
 1004|   283k|        }
 1005|   283k|    }
 1006|       |
 1007|  5.37k|    res = s_mp_redc(pa1, mmm);
 1008|  5.37k|    mp_exch(pa1, result);
 1009|       |
 1010|  5.37k|CLEANUP:
 1011|  5.37k|    mp_clear(&accum1);
 1012|  5.37k|    mp_clear(&accum2);
 1013|  5.37k|    mp_clear(&accum[0]);
 1014|  5.37k|    mp_clear(&accum[1]);
 1015|  5.37k|    mp_clear(&accum[2]);
 1016|  5.37k|    mp_clear(&accum[3]);
 1017|  5.37k|    mp_clear(&tmp);
 1018|       |    /* zero required by FIPS here, can't use PORT_ZFree
 1019|       |     * because mpi doesn't link with util */
 1020|  5.37k|    if (powers) {
  ------------------
  |  Branch (1020:9): [True: 5.23k, False: 139]
  ------------------
 1021|  5.23k|        PORT_Memset(powers, 0, num_powers * sizeof(mp_digit));
  ------------------
  |  |  182|  5.23k|#define PORT_Memset memset
  ------------------
 1022|  5.23k|    }
 1023|  5.37k|    free(powersArray);
 1024|  5.37k|    return res;
 1025|  5.37k|}
mp_exptmod:
 1033|  8.35k|{
 1034|  8.35k|    const mp_int *base;
 1035|  8.35k|    mp_size bits_in_exponent, i, window_bits, odd_ints;
 1036|  8.35k|    mp_err res;
 1037|  8.35k|    int nLen;
 1038|  8.35k|    mp_int montBase, goodBase;
 1039|  8.35k|    mp_mont_modulus mmm;
 1040|  8.35k|#ifdef MP_USING_CACHE_SAFE_MOD_EXP
 1041|  8.35k|    static unsigned int max_window_bits;
 1042|  8.35k|#endif
 1043|       |
 1044|       |    /* function for computing n0prime only works if n0 is odd */
 1045|  8.35k|    if (!mp_isodd(modulus))
  ------------------
  |  Branch (1045:9): [True: 2.98k, False: 5.37k]
  ------------------
 1046|  2.98k|        return s_mp_exptmod(inBase, exponent, modulus, result);
 1047|       |
 1048|  5.37k|    if (mp_cmp_z(inBase) == MP_LT)
  ------------------
  |  |   49|  5.37k|#define MP_LT -1
  ------------------
  |  Branch (1048:9): [True: 0, False: 5.37k]
  ------------------
 1049|      0|        return MP_RANGE;
  ------------------
  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  ------------------
 1050|  5.37k|    MP_DIGITS(&montBase) = 0;
  ------------------
  |  |  152|  5.37k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 1051|  5.37k|    MP_DIGITS(&goodBase) = 0;
  ------------------
  |  |  152|  5.37k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
 1052|       |
 1053|  5.37k|    if (mp_cmp(inBase, modulus) < 0) {
  ------------------
  |  Branch (1053:9): [True: 4.64k, False: 729]
  ------------------
 1054|  4.64k|        base = inBase;
 1055|  4.64k|    } else {
 1056|    729|        MP_CHECKOK(mp_init(&goodBase));
  ------------------
  |  |  319|    729|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    729|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 729]
  |  |  ------------------
  |  |  320|    729|    goto CLEANUP
  ------------------
 1057|    729|        base = &goodBase;
 1058|    729|        MP_CHECKOK(mp_mod(inBase, modulus, &goodBase));
  ------------------
  |  |  319|    729|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|    729|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 729]
  |  |  ------------------
  |  |  320|    729|    goto CLEANUP
  ------------------
 1059|    729|    }
 1060|       |
 1061|  5.37k|    nLen = MP_USED(modulus);
  ------------------
  |  |  150|  5.37k|#define MP_USED(MP) ((MP)->used)
  ------------------
 1062|  5.37k|    MP_CHECKOK(mp_init_size(&montBase, 2 * nLen + 2));
  ------------------
  |  |  319|  5.37k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.37k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.37k]
  |  |  ------------------
  |  |  320|  5.37k|    goto CLEANUP
  ------------------
 1063|       |
 1064|  5.37k|    mmm.N = *modulus; /* a copy of the mp_int struct */
 1065|       |
 1066|       |    /* compute n0', given n0, n0' = -(n0 ** -1) mod MP_RADIX
 1067|       |    **        where n0 = least significant mp_digit of N, the modulus.
 1068|       |    */
 1069|  5.37k|    mmm.n0prime = mp_calculate_mont_n0i(modulus);
 1070|       |
 1071|  5.37k|    MP_CHECKOK(mp_to_mont(base, modulus, &montBase));
  ------------------
  |  |  319|  5.37k|    if (MP_OKAY > (res = (x))) \
  |  |  ------------------
  |  |  |  |   39|  5.37k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (319:9): [True: 0, False: 5.37k]
  |  |  ------------------
  |  |  320|  5.37k|    goto CLEANUP
  ------------------
 1072|       |
 1073|  5.37k|    bits_in_exponent = mpl_significant_bits(exponent);
 1074|  5.37k|#ifdef MP_USING_CACHE_SAFE_MOD_EXP
 1075|  5.37k|    if (mp_using_cache_safe_exp) {
  ------------------
  |  Branch (1075:9): [True: 5.37k, False: 0]
  ------------------
 1076|  5.37k|        if (bits_in_exponent > 780)
  ------------------
  |  Branch (1076:13): [True: 0, False: 5.37k]
  ------------------
 1077|      0|            window_bits = 6;
 1078|  5.37k|        else if (bits_in_exponent > 256)
  ------------------
  |  Branch (1078:18): [True: 229, False: 5.14k]
  ------------------
 1079|    229|            window_bits = 5;
 1080|  5.14k|        else if (bits_in_exponent > 20)
  ------------------
  |  Branch (1080:18): [True: 5.00k, False: 139]
  ------------------
 1081|  5.00k|            window_bits = 4;
 1082|       |        /* RSA public key exponents are typically under 20 bits (common values
 1083|       |         * are: 3, 17, 65537) and a 4-bit window is inefficient
 1084|       |         */
 1085|    139|        else
 1086|    139|            window_bits = 1;
 1087|  5.37k|    } else
 1088|      0|#endif
 1089|      0|        if (bits_in_exponent > 480)
  ------------------
  |  Branch (1089:13): [True: 0, False: 0]
  ------------------
 1090|      0|        window_bits = 6;
 1091|      0|    else if (bits_in_exponent > 160)
  ------------------
  |  Branch (1091:14): [True: 0, False: 0]
  ------------------
 1092|      0|        window_bits = 5;
 1093|      0|    else if (bits_in_exponent > 20)
  ------------------
  |  Branch (1093:14): [True: 0, False: 0]
  ------------------
 1094|      0|        window_bits = 4;
 1095|       |    /* RSA public key exponents are typically under 20 bits (common values
 1096|       |     * are: 3, 17, 65537) and a 4-bit window is inefficient
 1097|       |     */
 1098|      0|    else
 1099|      0|        window_bits = 1;
 1100|       |
 1101|  5.37k|#ifdef MP_USING_CACHE_SAFE_MOD_EXP
 1102|       |    /*
 1103|       |     * clamp the window size based on
 1104|       |     * the cache line size.
 1105|       |     */
 1106|  5.37k|    if (!max_window_bits) {
  ------------------
  |  Branch (1106:9): [True: 1, False: 5.37k]
  ------------------
 1107|      1|        unsigned long cache_size = s_mpi_getProcessorLineSize();
 1108|       |        /* processor has no cache, use 'fast' code always */
 1109|      1|        if (cache_size == 0) {
  ------------------
  |  Branch (1109:13): [True: 0, False: 1]
  ------------------
 1110|      0|            mp_using_cache_safe_exp = 0;
 1111|      0|        }
 1112|      1|        if ((cache_size == 0) || (cache_size >= 64)) {
  ------------------
  |  Branch (1112:13): [True: 0, False: 1]
  |  Branch (1112:34): [True: 1, False: 0]
  ------------------
 1113|      1|            max_window_bits = 6;
 1114|      1|        } else if (cache_size >= 32) {
  ------------------
  |  Branch (1114:20): [True: 0, False: 0]
  ------------------
 1115|      0|            max_window_bits = 5;
 1116|      0|        } else if (cache_size >= 16) {
  ------------------
  |  Branch (1116:20): [True: 0, False: 0]
  ------------------
 1117|      0|            max_window_bits = 4;
 1118|      0|        } else
 1119|      0|            max_window_bits = 1; /* should this be an assert? */
 1120|      1|    }
 1121|       |
 1122|       |    /* clamp the window size down before we caclulate bits_in_exponent */
 1123|  5.37k|    if (mp_using_cache_safe_exp) {
  ------------------
  |  Branch (1123:9): [True: 5.37k, False: 0]
  ------------------
 1124|  5.37k|        if (window_bits > max_window_bits) {
  ------------------
  |  Branch (1124:13): [True: 0, False: 5.37k]
  ------------------
 1125|      0|            window_bits = max_window_bits;
 1126|      0|        }
 1127|  5.37k|    }
 1128|  5.37k|#endif
 1129|       |
 1130|  5.37k|    odd_ints = 1 << (window_bits - 1);
 1131|  5.37k|    i = bits_in_exponent % window_bits;
 1132|  5.37k|    if (i != 0) {
  ------------------
  |  Branch (1132:9): [True: 4.33k, False: 1.04k]
  ------------------
 1133|  4.33k|        bits_in_exponent += window_bits - i;
 1134|  4.33k|    }
 1135|       |
 1136|       |#ifdef MP_USING_MONT_MULF
 1137|       |    if (mp_using_mont_mulf) {
 1138|       |        MP_CHECKOK(s_mp_pad(&montBase, nLen));
 1139|       |        res = mp_exptmod_f(&montBase, exponent, modulus, result, &mmm, nLen,
 1140|       |                           bits_in_exponent, window_bits, odd_ints);
 1141|       |    } else
 1142|       |#endif
 1143|  5.37k|#ifdef MP_USING_CACHE_SAFE_MOD_EXP
 1144|  5.37k|        if (mp_using_cache_safe_exp) {
  ------------------
  |  Branch (1144:13): [True: 5.37k, False: 0]
  ------------------
 1145|  5.37k|        res = mp_exptmod_safe_i(&montBase, exponent, modulus, result, &mmm, nLen,
 1146|  5.37k|                                bits_in_exponent, window_bits, 1 << window_bits);
 1147|  5.37k|    } else
 1148|      0|#endif
 1149|      0|        res = mp_exptmod_i(&montBase, exponent, modulus, result, &mmm, nLen,
 1150|      0|                           bits_in_exponent, window_bits, odd_ints);
 1151|       |
 1152|  5.37k|CLEANUP:
 1153|  5.37k|    mp_clear(&montBase);
 1154|  5.37k|    mp_clear(&goodBase);
 1155|       |    /* Don't mp_clear mmm.N because it is merely a copy of modulus.
 1156|       |    ** Just zap it.
 1157|       |    */
 1158|  5.37k|    memset(&mmm, 0, sizeof mmm);
 1159|  5.37k|    return res;
 1160|  5.37k|}

PQG_GetLength:
  214|    913|{
  215|    913|    unsigned int len = obj->len;
  216|       |
  217|    913|    if (obj->data == NULL) {
  ------------------
  |  Branch (217:9): [True: 0, False: 913]
  ------------------
  218|      0|        return 0;
  219|      0|    }
  220|    913|    if (len > 1 && obj->data[0] == 0) {
  ------------------
  |  Branch (220:9): [True: 913, False: 0]
  |  Branch (220:20): [True: 0, False: 913]
  ------------------
  221|      0|        len--;
  222|      0|    }
  223|    913|    return len;
  224|    913|}

HASH_GetRawHashObject:
  238|  35.3k|{
  239|  35.3k|    if (hashType <= HASH_AlgNULL || hashType >= HASH_AlgTOTAL) {
  ------------------
  |  Branch (239:9): [True: 0, False: 35.3k]
  |  Branch (239:37): [True: 0, False: 35.3k]
  ------------------
  240|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  241|      0|        return NULL;
  242|      0|    }
  243|  35.3k|    return &SECRawHashObjects[hashType];
  244|  35.3k|}
rawhash.c:RawHash_MD5_NewContext:
   17|    681|    {                                                                                    \
   18|    681|        ctxtype *ctx = mmm##_NewContext();                                               \
   19|    681|        return ctx;                                                                      \
   20|    681|    }                                                                                    \
rawhash.c:RawHash_MD5_DestroyContext:
   42|    681|    {                                                                                    \
   43|    681|        ctxtype *ctx = vctx;                                                             \
   44|    681|        mmm##_DestroyContext(ctx, freeit);                                               \
   45|    681|    }
rawhash.c:RawHash_MD5_Begin:
   23|  8.21k|    {                                                                                    \
   24|  8.21k|        ctxtype *ctx = vctx;                                                             \
   25|  8.21k|        mmm##_Begin(ctx);                                                                \
   26|  8.21k|    }                                                                                    \
rawhash.c:RawHash_MD5_Update:
   29|  19.9k|    {                                                                                    \
   30|  19.9k|        ctxtype *ctx = vctx;                                                             \
   31|  19.9k|        mmm##_Update(ctx, input, len);                                                   \
   32|  19.9k|    }                                                                                    \
rawhash.c:RawHash_MD5_End:
   36|  8.01k|    {                                                                                    \
   37|  8.01k|        ctxtype *ctx = vctx;                                                             \
   38|  8.01k|        mmm##_End(ctx, digest, len, maxLen);                                             \
   39|  8.01k|    }                                                                                    \
rawhash.c:RawHash_SHA1_NewContext:
   17|  3.08k|    {                                                                                    \
   18|  3.08k|        ctxtype *ctx = mmm##_NewContext();                                               \
   19|  3.08k|        return ctx;                                                                      \
   20|  3.08k|    }                                                                                    \
rawhash.c:RawHash_SHA1_DestroyContext:
   42|  3.08k|    {                                                                                    \
   43|  3.08k|        ctxtype *ctx = vctx;                                                             \
   44|  3.08k|        mmm##_DestroyContext(ctx, freeit);                                               \
   45|  3.08k|    }
rawhash.c:RawHash_SHA1_Begin:
   23|  9.91k|    {                                                                                    \
   24|  9.91k|        ctxtype *ctx = vctx;                                                             \
   25|  9.91k|        mmm##_Begin(ctx);                                                                \
   26|  9.91k|    }                                                                                    \
rawhash.c:RawHash_SHA1_Update:
   29|  20.6k|    {                                                                                    \
   30|  20.6k|        ctxtype *ctx = vctx;                                                             \
   31|  20.6k|        mmm##_Update(ctx, input, len);                                                   \
   32|  20.6k|    }                                                                                    \
rawhash.c:RawHash_SHA1_End:
   36|  7.32k|    {                                                                                    \
   37|  7.32k|        ctxtype *ctx = vctx;                                                             \
   38|  7.32k|        mmm##_End(ctx, digest, len, maxLen);                                             \
   39|  7.32k|    }                                                                                    \
rawhash.c:RawHash_SHA256_NewContext:
   17|  17.3k|    {                                                                                    \
   18|  17.3k|        ctxtype *ctx = mmm##_NewContext();                                               \
   19|  17.3k|        return ctx;                                                                      \
   20|  17.3k|    }                                                                                    \
rawhash.c:RawHash_SHA256_DestroyContext:
   42|  17.3k|    {                                                                                    \
   43|  17.3k|        ctxtype *ctx = vctx;                                                             \
   44|  17.3k|        mmm##_DestroyContext(ctx, freeit);                                               \
   45|  17.3k|    }
rawhash.c:RawHash_SHA256_Begin:
   23|  72.6k|    {                                                                                    \
   24|  72.6k|        ctxtype *ctx = vctx;                                                             \
   25|  72.6k|        mmm##_Begin(ctx);                                                                \
   26|  72.6k|    }                                                                                    \
rawhash.c:RawHash_SHA256_Update:
   29|   174k|    {                                                                                    \
   30|   174k|        ctxtype *ctx = vctx;                                                             \
   31|   174k|        mmm##_Update(ctx, input, len);                                                   \
   32|   174k|    }                                                                                    \
rawhash.c:RawHash_SHA256_End:
   36|  72.3k|    {                                                                                    \
   37|  72.3k|        ctxtype *ctx = vctx;                                                             \
   38|  72.3k|        mmm##_End(ctx, digest, len, maxLen);                                             \
   39|  72.3k|    }                                                                                    \
rawhash.c:RawHash_SHA384_NewContext:
   17|  13.3k|    {                                                                                    \
   18|  13.3k|        ctxtype *ctx = mmm##_NewContext();                                               \
   19|  13.3k|        return ctx;                                                                      \
   20|  13.3k|    }                                                                                    \
rawhash.c:RawHash_SHA384_DestroyContext:
   42|  13.3k|    {                                                                                    \
   43|  13.3k|        ctxtype *ctx = vctx;                                                             \
   44|  13.3k|        mmm##_DestroyContext(ctx, freeit);                                               \
   45|  13.3k|    }
rawhash.c:RawHash_SHA384_Begin:
   23|  28.8k|    {                                                                                    \
   24|  28.8k|        ctxtype *ctx = vctx;                                                             \
   25|  28.8k|        mmm##_Begin(ctx);                                                                \
   26|  28.8k|    }                                                                                    \
rawhash.c:RawHash_SHA384_Update:
   29|  65.6k|    {                                                                                    \
   30|  65.6k|        ctxtype *ctx = vctx;                                                             \
   31|  65.6k|        mmm##_Update(ctx, input, len);                                                   \
   32|  65.6k|    }                                                                                    \
rawhash.c:RawHash_SHA384_End:
   36|  28.8k|    {                                                                                    \
   37|  28.8k|        ctxtype *ctx = vctx;                                                             \
   38|  28.8k|        mmm##_End(ctx, digest, len, maxLen);                                             \
   39|  28.8k|    }                                                                                    \
rawhash.c:RawHash_SHA512_NewContext:
   17|      3|    {                                                                                    \
   18|      3|        ctxtype *ctx = mmm##_NewContext();                                               \
   19|      3|        return ctx;                                                                      \
   20|      3|    }                                                                                    \
rawhash.c:RawHash_SHA512_DestroyContext:
   42|      3|    {                                                                                    \
   43|      3|        ctxtype *ctx = vctx;                                                             \
   44|      3|        mmm##_DestroyContext(ctx, freeit);                                               \
   45|      3|    }
rawhash.c:RawHash_SHA512_Begin:
   23|      7|    {                                                                                    \
   24|      7|        ctxtype *ctx = vctx;                                                             \
   25|      7|        mmm##_Begin(ctx);                                                                \
   26|      7|    }                                                                                    \
rawhash.c:RawHash_SHA512_Update:
   29|     15|    {                                                                                    \
   30|     15|        ctxtype *ctx = vctx;                                                             \
   31|     15|        mmm##_Update(ctx, input, len);                                                   \
   32|     15|    }                                                                                    \
rawhash.c:RawHash_SHA512_End:
   36|      7|    {                                                                                    \
   37|      7|        ctxtype *ctx = vctx;                                                             \
   38|      7|        mmm##_End(ctx, digest, len, maxLen);                                             \
   39|      7|    }                                                                                    \

AES_AllocateContext:
 1009|  1.76k|{
 1010|  1.76k|    return PORT_ZNewAligned(AESContext, 16, mem);
  ------------------
  |  |  150|  1.76k|    (type *)PORT_ZAllocAlignedOffset(sizeof(type), alignment, offsetof(type, mem))
  |  |  ------------------
  |  |  |  |   74|  1.76k|#define PORT_ZAllocAlignedOffset PORT_ZAllocAlignedOffset_Util
  |  |  ------------------
  ------------------
 1011|  1.76k|}
AES_InitContext:
 1116|  1.76k|{
 1117|  1.76k|    int basemode = mode;
 1118|  1.76k|    PRBool baseencrypt = encrypt;
 1119|  1.76k|    SECStatus rv;
 1120|       |
 1121|  1.76k|    if (blocksize != AES_BLOCK_SIZE) {
  ------------------
  |  |  130|  1.76k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  |  Branch (1121:9): [True: 0, False: 1.76k]
  ------------------
 1122|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1123|      0|        return SECFailure;
 1124|      0|    }
 1125|       |
 1126|  1.76k|    switch (mode) {
  ------------------
  |  Branch (1126:13): [True: 526, False: 1.24k]
  ------------------
 1127|      0|        case NSS_AES_CTS:
  ------------------
  |  |   37|      0|#define NSS_AES_CTS 2
  ------------------
  |  Branch (1127:9): [True: 0, False: 1.76k]
  ------------------
 1128|      0|            basemode = NSS_AES_CBC;
  ------------------
  |  |   36|      0|#define NSS_AES_CBC 1
  ------------------
 1129|      0|            break;
 1130|  1.24k|        case NSS_AES_GCM:
  ------------------
  |  |   39|  1.24k|#define NSS_AES_GCM 4
  ------------------
  |  Branch (1130:9): [True: 1.24k, False: 526]
  ------------------
 1131|  1.24k|        case NSS_AES_CTR:
  ------------------
  |  |   38|  1.24k|#define NSS_AES_CTR 3
  ------------------
  |  Branch (1131:9): [True: 0, False: 1.76k]
  ------------------
 1132|  1.24k|            basemode = NSS_AES;
  ------------------
  |  |   35|  1.24k|#define NSS_AES 0
  ------------------
 1133|  1.24k|            baseencrypt = PR_TRUE;
  ------------------
  |  |  437|  1.24k|#define PR_TRUE 1
  ------------------
 1134|  1.24k|            break;
 1135|  1.76k|    }
 1136|       |    /* Make sure enough is initialized so we can safely call Destroy. */
 1137|  1.76k|    cx->worker_cx = NULL;
 1138|  1.76k|    cx->destroy = NULL;
 1139|  1.76k|    cx->mode = mode;
 1140|  1.76k|    rv = aes_InitContext(cx, key, keysize, iv, basemode, baseencrypt);
 1141|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1141:9): [True: 0, False: 1.76k]
  ------------------
 1142|      0|        AES_DestroyContext(cx, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1143|      0|        return rv;
 1144|      0|    }
 1145|       |
 1146|       |    /* finally, set up any mode specific contexts */
 1147|  1.76k|    cx->worker_aead = 0;
 1148|  1.76k|    switch (mode) {
 1149|      0|        case NSS_AES_CTS:
  ------------------
  |  |   37|      0|#define NSS_AES_CTS 2
  ------------------
  |  Branch (1149:9): [True: 0, False: 1.76k]
  ------------------
 1150|      0|            cx->worker_cx = CTS_CreateContext(cx, cx->worker, iv);
 1151|      0|            cx->worker = encrypt ? freeblCipher_CTS_EncryptUpdate : freeblCipher_CTS_DecryptUpdate;
  ------------------
  |  Branch (1151:26): [True: 0, False: 0]
  ------------------
 1152|      0|            cx->destroy = freeblDestroy_CTS_DestroyContext;
 1153|      0|            cx->isBlock = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1154|      0|            break;
 1155|  1.24k|        case NSS_AES_GCM:
  ------------------
  |  |   39|  1.24k|#define NSS_AES_GCM 4
  ------------------
  |  Branch (1155:9): [True: 1.24k, False: 526]
  ------------------
 1156|       |#if defined(INTEL_GCM) && defined(USE_HW_AES)
 1157|       |            if (aesni_support() && (keysize % 8) == 0 && avx_support() &&
 1158|       |                clmul_support()) {
 1159|       |                cx->worker_cx = intel_AES_GCM_CreateContext(cx, cx->worker, iv);
 1160|       |                cx->worker = encrypt ? freeblCipher_intel_AES_GCM_EncryptUpdate
 1161|       |                                     : freeblCipher_intel_AES_GCM_DecryptUpdate;
 1162|       |                cx->worker_aead = encrypt ? freeblAead_intel_AES_GCM_EncryptAEAD
 1163|       |                                          : freeblAead_intel_AES_GCM_DecryptAEAD;
 1164|       |                cx->destroy = freeblDestroy_intel_AES_GCM_DestroyContext;
 1165|       |                cx->isBlock = PR_FALSE;
 1166|       |            } else
 1167|       |#elif defined(USE_PPC_CRYPTO) && defined(PPC_GCM)
 1168|       |            if (ppc_crypto_support() && (keysize % 8) == 0) {
 1169|       |                cx->worker_cx = ppc_AES_GCM_CreateContext(cx, cx->worker, iv);
 1170|       |                cx->worker = encrypt ? freeblCipher_ppc_AES_GCM_EncryptUpdate
 1171|       |                                     : freeblCipher_ppc_AES_GCM_DecryptUpdate;
 1172|       |                cx->worker_aead = encrypt ? freeblAead_ppc_AES_GCM_EncryptAEAD
 1173|       |                                          : freeblAead_ppc_AES_GCM_DecryptAEAD;
 1174|       |                cx->destroy = freeblDestroy_ppc_AES_GCM_DestroyContext;
 1175|       |                cx->isBlock = PR_FALSE;
 1176|       |            } else
 1177|       |#endif
 1178|  1.24k|            {
 1179|  1.24k|                cx->worker_cx = GCM_CreateContext(cx, cx->worker, iv);
 1180|  1.24k|                cx->worker = encrypt ? freeblCipher_GCM_EncryptUpdate
  ------------------
  |  Branch (1180:30): [True: 227, False: 1.01k]
  ------------------
 1181|  1.24k|                                     : freeblCipher_GCM_DecryptUpdate;
 1182|  1.24k|                cx->worker_aead = encrypt ? freeblAead_GCM_EncryptAEAD
  ------------------
  |  Branch (1182:35): [True: 227, False: 1.01k]
  ------------------
 1183|  1.24k|                                          : freeblAead_GCM_DecryptAEAD;
 1184|       |
 1185|  1.24k|                cx->destroy = freeblDestroy_GCM_DestroyContext;
 1186|  1.24k|                cx->isBlock = PR_FALSE;
  ------------------
  |  |  438|  1.24k|#define PR_FALSE 0
  ------------------
 1187|  1.24k|            }
 1188|  1.24k|            break;
 1189|      0|        case NSS_AES_CTR:
  ------------------
  |  |   38|      0|#define NSS_AES_CTR 3
  ------------------
  |  Branch (1189:9): [True: 0, False: 1.76k]
  ------------------
 1190|      0|            cx->worker_cx = CTR_CreateContext(cx, cx->worker, iv);
 1191|       |#if defined(USE_HW_AES) && defined(_MSC_VER) && defined(NSS_X86_OR_X64)
 1192|       |            if (aesni_support() && (keysize % 8) == 0) {
 1193|       |                cx->worker = freeblCipher_CTR_Update_HW_AES;
 1194|       |            } else
 1195|       |#endif
 1196|      0|            {
 1197|      0|                cx->worker = freeblCipher_CTR_Update;
 1198|      0|            }
 1199|      0|            cx->destroy = freeblDestroy_CTR_DestroyContext;
 1200|      0|            cx->isBlock = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1201|      0|            break;
 1202|    526|        default:
  ------------------
  |  Branch (1202:9): [True: 526, False: 1.24k]
  ------------------
 1203|       |            /* everything has already been set up by aes_InitContext, just
 1204|       |             * return */
 1205|    526|            return SECSuccess;
 1206|  1.76k|    }
 1207|       |    /* check to see if we succeeded in getting the worker context */
 1208|  1.24k|    if (cx->worker_cx == NULL) {
  ------------------
  |  Branch (1208:9): [True: 0, False: 1.24k]
  ------------------
 1209|       |        /* no, just destroy the existing context */
 1210|      0|        cx->destroy = NULL; /* paranoia, though you can see a dozen lines */
 1211|       |                            /* below that this isn't necessary */
 1212|      0|        AES_DestroyContext(cx, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1213|      0|        return SECFailure;
 1214|      0|    }
 1215|  1.24k|    return SECSuccess;
 1216|  1.24k|}
AES_CreateContext:
 1226|  1.76k|{
 1227|  1.76k|    AESContext *cx = AES_AllocateContext();
 1228|  1.76k|    if (cx) {
  ------------------
  |  Branch (1228:9): [True: 1.76k, False: 0]
  ------------------
 1229|  1.76k|        SECStatus rv = AES_InitContext(cx, key, keysize, iv, mode, encrypt,
 1230|  1.76k|                                       blocksize);
 1231|  1.76k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1231:13): [True: 0, False: 1.76k]
  ------------------
 1232|      0|            AES_DestroyContext(cx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1233|      0|            cx = NULL;
 1234|      0|        }
 1235|  1.76k|    }
 1236|  1.76k|    return cx;
 1237|  1.76k|}
AES_DestroyContext:
 1247|  1.76k|{
 1248|  1.76k|    void *mem = cx->mem;
 1249|  1.76k|    if (cx->worker_cx && cx->destroy) {
  ------------------
  |  Branch (1249:9): [True: 1.76k, False: 0]
  |  Branch (1249:26): [True: 1.24k, False: 526]
  ------------------
 1250|  1.24k|        (*cx->destroy)(cx->worker_cx, PR_TRUE);
  ------------------
  |  |  437|  1.24k|#define PR_TRUE 1
  ------------------
 1251|  1.24k|        cx->worker_cx = NULL;
 1252|  1.24k|        cx->destroy = NULL;
 1253|  1.24k|    }
 1254|  1.76k|    PORT_SafeZero(cx, sizeof(AESContext));
 1255|  1.76k|    if (freeit) {
  ------------------
  |  Branch (1255:9): [True: 1.76k, False: 0]
  ------------------
 1256|  1.76k|        PORT_Free(mem);
  ------------------
  |  |   60|  1.76k|#define PORT_Free PORT_Free_Util
  ------------------
 1257|  1.76k|    } else {
 1258|       |        /* if we are not freeing the context, restore mem, We may get called
 1259|       |         * again to actually free the context */
 1260|      0|        cx->mem = mem;
 1261|      0|    }
 1262|  1.76k|}
rijndael.c:aes_InitContext:
 1021|  1.76k|{
 1022|  1.76k|    unsigned int Nk;
 1023|  1.76k|    PRBool use_hw_aes;
 1024|       |    /* According to AES, block lengths are 128 and key lengths are 128, 192, or
 1025|       |     * 256 bits. We support other key sizes as well [128, 256] as long as the
 1026|       |     * length in bytes is divisible by 4.
 1027|       |     */
 1028|       |
 1029|  1.76k|    if (key == NULL ||
  ------------------
  |  Branch (1029:9): [True: 0, False: 1.76k]
  ------------------
 1030|  1.76k|        keysize < AES_BLOCK_SIZE ||
  ------------------
  |  |  130|  3.53k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  |  Branch (1030:9): [True: 0, False: 1.76k]
  ------------------
 1031|  1.76k|        keysize > 32 ||
  ------------------
  |  Branch (1031:9): [True: 0, False: 1.76k]
  ------------------
 1032|  1.76k|        keysize % 4 != 0) {
  ------------------
  |  Branch (1032:9): [True: 0, False: 1.76k]
  ------------------
 1033|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1034|      0|        return SECFailure;
 1035|      0|    }
 1036|  1.76k|    if (mode != NSS_AES && mode != NSS_AES_CBC) {
  ------------------
  |  |   35|  3.53k|#define NSS_AES 0
  ------------------
                  if (mode != NSS_AES && mode != NSS_AES_CBC) {
  ------------------
  |  |   36|    526|#define NSS_AES_CBC 1
  ------------------
  |  Branch (1036:9): [True: 526, False: 1.24k]
  |  Branch (1036:28): [True: 0, False: 526]
  ------------------
 1037|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1038|      0|        return SECFailure;
 1039|      0|    }
 1040|  1.76k|    if (mode == NSS_AES_CBC && iv == NULL) {
  ------------------
  |  |   36|  3.53k|#define NSS_AES_CBC 1
  ------------------
  |  Branch (1040:9): [True: 526, False: 1.24k]
  |  Branch (1040:32): [True: 0, False: 526]
  ------------------
 1041|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1042|      0|        return SECFailure;
 1043|      0|    }
 1044|  1.76k|    if (!cx) {
  ------------------
  |  Branch (1044:9): [True: 0, False: 1.76k]
  ------------------
 1045|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1046|      0|        return SECFailure;
 1047|      0|    }
 1048|  1.76k|#if defined(NSS_X86_OR_X64) || defined(USE_HW_AES)
 1049|  1.76k|    use_hw_aes = (aesni_support() || arm_aes_support()) && (keysize % 8) == 0;
  ------------------
  |  Branch (1049:19): [True: 1.76k, False: 0]
  |  Branch (1049:38): [True: 0, False: 0]
  |  Branch (1049:60): [True: 1.76k, False: 0]
  ------------------
 1050|       |#else
 1051|       |    use_hw_aes = PR_FALSE;
 1052|       |#endif
 1053|       |    /* Nb = (block size in bits) / 32 */
 1054|  1.76k|    cx->Nb = AES_BLOCK_SIZE / 4;
  ------------------
  |  |  130|  1.76k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
 1055|       |    /* Nk = (key size in bits) / 32 */
 1056|  1.76k|    Nk = keysize / 4;
 1057|       |    /* Obtain number of rounds from "table" */
 1058|  1.76k|    cx->Nr = RIJNDAEL_NUM_ROUNDS(Nk, cx->Nb);
  ------------------
  |  |   36|  1.76k|    (PR_MAX(Nk, Nb) + 6)
  |  |  ------------------
  |  |  |  |  159|  1.76k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (159:26): [True: 660, False: 1.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1059|       |    /* copy in the iv, if neccessary */
 1060|  1.76k|    if (mode == NSS_AES_CBC) {
  ------------------
  |  |   36|  1.76k|#define NSS_AES_CBC 1
  ------------------
  |  Branch (1060:9): [True: 526, False: 1.24k]
  ------------------
 1061|    526|        memcpy(cx->iv, iv, AES_BLOCK_SIZE);
  ------------------
  |  |  130|    526|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
 1062|       |#ifdef USE_HW_AES
 1063|       |        if (use_hw_aes) {
 1064|       |            cx->worker = freeblCipher_native_aes_cbc_worker(encrypt, keysize);
 1065|       |        } else
 1066|       |#endif
 1067|    526|        {
 1068|    526|            cx->worker = encrypt ? freeblCipher_rijndael_encryptCBC : freeblCipher_rijndael_decryptCBC;
  ------------------
  |  Branch (1068:26): [True: 263, False: 263]
  ------------------
 1069|    526|        }
 1070|  1.24k|    } else {
 1071|       |#ifdef USE_HW_AES
 1072|       |        if (use_hw_aes) {
 1073|       |            cx->worker = freeblCipher_native_aes_ecb_worker(encrypt, keysize);
 1074|       |        } else
 1075|       |#endif
 1076|  1.24k|        {
 1077|  1.24k|            cx->worker = encrypt ? freeblCipher_rijndael_encryptECB : freeblCipher_rijndael_decryptECB;
  ------------------
  |  Branch (1077:26): [True: 1.24k, False: 0]
  ------------------
 1078|  1.24k|        }
 1079|  1.24k|    }
 1080|  1.76k|    PORT_Assert((cx->Nb * (cx->Nr + 1)) <= RIJNDAEL_MAX_EXP_KEY_SIZE);
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1081|  1.76k|    if ((cx->Nb * (cx->Nr + 1)) > RIJNDAEL_MAX_EXP_KEY_SIZE) {
  ------------------
  |  |   43|  1.76k|#define RIJNDAEL_MAX_EXP_KEY_SIZE (4 * 15)
  ------------------
  |  Branch (1081:9): [True: 0, False: 1.76k]
  ------------------
 1082|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1083|      0|        return SECFailure;
 1084|      0|    }
 1085|       |#ifdef USE_HW_AES
 1086|       |    if (use_hw_aes) {
 1087|       |        native_aes_init(encrypt, keysize);
 1088|       |    } else
 1089|       |#endif
 1090|  1.76k|    {
 1091|       |        /* Generate expanded key */
 1092|  1.76k|        if (encrypt) {
  ------------------
  |  Branch (1092:13): [True: 1.50k, False: 263]
  ------------------
 1093|  1.50k|            if (use_hw_aes && (cx->mode == NSS_AES_GCM || cx->mode == NSS_AES ||
  ------------------
  |  |   39|  3.00k|#define NSS_AES_GCM 4
  ------------------
                          if (use_hw_aes && (cx->mode == NSS_AES_GCM || cx->mode == NSS_AES ||
  ------------------
  |  |   35|  1.76k|#define NSS_AES 0
  ------------------
  |  Branch (1093:17): [True: 1.50k, False: 0]
  |  Branch (1093:32): [True: 1.24k, False: 263]
  |  Branch (1093:59): [True: 0, False: 263]
  ------------------
 1094|  1.50k|                               cx->mode == NSS_AES_CTR)) {
  ------------------
  |  |   38|    263|#define NSS_AES_CTR 3
  ------------------
  |  Branch (1094:32): [True: 0, False: 263]
  ------------------
 1095|  1.24k|                PORT_Assert(keysize == 16 || keysize == 24 || keysize == 32);
  ------------------
  |  |  120|  1.24k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.16k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 901, False: 340]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 340]
  |  |  |  |  |  Branch (208:7): [True: 340, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1096|       |                /* Prepare hardware key for normal AES parameters. */
 1097|  1.24k|                rijndael_native_key_expansion(cx, key, Nk);
 1098|  1.24k|            } else {
 1099|    263|                rijndael_key_expansion(cx, key, Nk);
 1100|    263|            }
 1101|  1.50k|        } else {
 1102|    263|            rijndael_invkey_expansion(cx, key, Nk);
 1103|    263|        }
 1104|  1.76k|        BLAPI_CLEAR_STACK(256)
 1105|  1.76k|    }
 1106|  1.76k|    cx->worker_cx = cx;
 1107|  1.76k|    cx->destroy = NULL;
 1108|  1.76k|    cx->isBlock = PR_TRUE;
  ------------------
  |  |  437|  1.76k|#define PR_TRUE 1
  ------------------
 1109|  1.76k|    return SECSuccess;
 1110|  1.76k|}
rijndael.c:freeblCipher_rijndael_encryptECB:
  865|  1.24k|    {                                                                                       \
  866|  1.24k|        ctxtype *ctx = vctx;                                                                \
  867|  1.24k|        return mmm(ctx, output, outputLen, maxOutputLen, input, inputLen, blocksize);       \
  868|  1.24k|    }
rijndael.c:rijndael_encryptECB:
  748|  1.24k|{
  749|  1.24k|    PORT_Assert(blocksize == AES_BLOCK_SIZE);
  ------------------
  |  |  120|  1.24k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.24k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.24k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  750|  1.24k|    PRBool aesni = aesni_support();
  751|  2.48k|    while (inputLen > 0) {
  ------------------
  |  Branch (751:12): [True: 1.24k, False: 1.24k]
  ------------------
  752|  1.24k|        if (aesni) {
  ------------------
  |  Branch (752:13): [True: 1.24k, False: 0]
  ------------------
  753|  1.24k|            rijndael_native_encryptBlock(cx, output, input);
  754|  1.24k|        } else {
  755|      0|            rijndael_encryptBlock128(cx, output, input);
  756|      0|        }
  757|  1.24k|        output += AES_BLOCK_SIZE;
  ------------------
  |  |  130|  1.24k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  758|  1.24k|        input += AES_BLOCK_SIZE;
  ------------------
  |  |  130|  1.24k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  759|  1.24k|        inputLen -= AES_BLOCK_SIZE;
  ------------------
  |  |  130|  1.24k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  760|  1.24k|    }
  761|  1.24k|    return SECSuccess;
  762|  1.24k|}
rijndael.c:rijndael_key_expansion:
  386|    526|{
  387|    526|    unsigned int i;
  388|    526|    PRUint32 *W;
  389|    526|    PRUint32 *pW;
  390|    526|    PRUint32 tmp;
  391|    526|    unsigned int round_key_words = cx->Nb * (cx->Nr + 1);
  392|    526|    if (Nk == 7) {
  ------------------
  |  Branch (392:9): [True: 0, False: 526]
  ------------------
  393|      0|        rijndael_key_expansion7(cx, key, Nk);
  394|      0|        return;
  395|      0|    }
  396|    526|    W = cx->k.expandedKey;
  397|       |    /* The first Nk words contain the input cipher key */
  398|    526|    memcpy(W, key, Nk * 4);
  399|    526|    i = Nk;
  400|    526|    pW = W + i - 1;
  401|       |    /* Loop over all sets of Nk words, except the last */
  402|  4.30k|    while (i < round_key_words - Nk) {
  ------------------
  |  Branch (402:12): [True: 3.77k, False: 526]
  ------------------
  403|  3.77k|        tmp = *pW++;
  404|  3.77k|        tmp = SUBBYTE(ROTBYTE(tmp)) ^ Rcon[i / Nk - 1];
  ------------------
  |  |  334|  3.77k|    ((((PRUint32)SBOX((w >> 24) & 0xff)) << 24) | \
  |  |  ------------------
  |  |  |  |  135|  3.77k|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  335|  3.77k|     (((PRUint32)SBOX((w >> 16) & 0xff)) << 16) | \
  |  |  ------------------
  |  |  |  |  135|  3.77k|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  336|  3.77k|     (((PRUint32)SBOX((w >> 8) & 0xff)) << 8) |   \
  |  |  ------------------
  |  |  |  |  135|  3.77k|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  337|  3.77k|     (((PRUint32)SBOX((w)&0xff))))
  |  |  ------------------
  |  |  |  |  135|  3.77k|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  ------------------
  405|  3.77k|        *pW = W[i++ - Nk] ^ tmp;
  406|  3.77k|        tmp = *pW++;
  407|  3.77k|        *pW = W[i++ - Nk] ^ tmp;
  408|  3.77k|        tmp = *pW++;
  409|  3.77k|        *pW = W[i++ - Nk] ^ tmp;
  410|  3.77k|        tmp = *pW++;
  411|  3.77k|        *pW = W[i++ - Nk] ^ tmp;
  412|  3.77k|        if (Nk == 4)
  ------------------
  |  Branch (412:13): [True: 1.85k, False: 1.92k]
  ------------------
  413|  1.85k|            continue;
  414|  1.92k|        switch (Nk) {
  ------------------
  |  Branch (414:17): [True: 0, False: 1.92k]
  ------------------
  415|  1.92k|            case 8:
  ------------------
  |  Branch (415:13): [True: 1.92k, False: 0]
  ------------------
  416|  1.92k|                tmp = *pW++;
  417|  1.92k|                tmp = SUBBYTE(tmp);
  ------------------
  |  |  334|  1.92k|    ((((PRUint32)SBOX((w >> 24) & 0xff)) << 24) | \
  |  |  ------------------
  |  |  |  |  135|  1.92k|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  335|  1.92k|     (((PRUint32)SBOX((w >> 16) & 0xff)) << 16) | \
  |  |  ------------------
  |  |  |  |  135|  1.92k|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  336|  1.92k|     (((PRUint32)SBOX((w >> 8) & 0xff)) << 8) |   \
  |  |  ------------------
  |  |  |  |  135|  1.92k|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  337|  1.92k|     (((PRUint32)SBOX((w)&0xff))))
  |  |  ------------------
  |  |  |  |  135|  1.92k|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  ------------------
  418|  1.92k|                *pW = W[i++ - Nk] ^ tmp;
  419|  1.92k|            case 7:
  ------------------
  |  Branch (419:13): [True: 0, False: 1.92k]
  ------------------
  420|  1.92k|                tmp = *pW++;
  421|  1.92k|                *pW = W[i++ - Nk] ^ tmp;
  422|  1.92k|            case 6:
  ------------------
  |  Branch (422:13): [True: 0, False: 1.92k]
  ------------------
  423|  1.92k|                tmp = *pW++;
  424|  1.92k|                *pW = W[i++ - Nk] ^ tmp;
  425|  1.92k|            case 5:
  ------------------
  |  Branch (425:13): [True: 0, False: 1.92k]
  ------------------
  426|  1.92k|                tmp = *pW++;
  427|  1.92k|                *pW = W[i++ - Nk] ^ tmp;
  428|  1.92k|        }
  429|  1.92k|    }
  430|       |    /* Generate the last word */
  431|    526|    tmp = *pW++;
  432|    526|    tmp = SUBBYTE(ROTBYTE(tmp)) ^ Rcon[i / Nk - 1];
  ------------------
  |  |  334|    526|    ((((PRUint32)SBOX((w >> 24) & 0xff)) << 24) | \
  |  |  ------------------
  |  |  |  |  135|    526|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  335|    526|     (((PRUint32)SBOX((w >> 16) & 0xff)) << 16) | \
  |  |  ------------------
  |  |  |  |  135|    526|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  336|    526|     (((PRUint32)SBOX((w >> 8) & 0xff)) << 8) |   \
  |  |  ------------------
  |  |  |  |  135|    526|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  337|    526|     (((PRUint32)SBOX((w)&0xff))))
  |  |  ------------------
  |  |  |  |  135|    526|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  ------------------
  433|    526|    *pW = W[i++ - Nk] ^ tmp;
  434|       |    /* There may be overflow here, if Nk % (Nb * (Nr + 1)) > 0.  However,
  435|       |     * since the above loop generated all but the last Nk key words, there
  436|       |     * is no more need for the SubByte transformation.
  437|       |     */
  438|    526|    if (Nk < 8) {
  ------------------
  |  Branch (438:9): [True: 206, False: 320]
  ------------------
  439|    824|        for (; i < round_key_words; ++i) {
  ------------------
  |  Branch (439:16): [True: 618, False: 206]
  ------------------
  440|    618|            tmp = *pW++;
  441|    618|            *pW = W[i - Nk] ^ tmp;
  442|    618|        }
  443|    320|    } else {
  444|       |        /* except in the case when Nk == 8.  Then one more SubByte may have
  445|       |         * to be performed, at i % Nk == 4.
  446|       |         */
  447|  1.28k|        for (; i < round_key_words; ++i) {
  ------------------
  |  Branch (447:16): [True: 960, False: 320]
  ------------------
  448|    960|            tmp = *pW++;
  449|    960|            if (i % Nk == 4)
  ------------------
  |  Branch (449:17): [True: 0, False: 960]
  ------------------
  450|      0|                tmp = SUBBYTE(tmp);
  ------------------
  |  |  334|      0|    ((((PRUint32)SBOX((w >> 24) & 0xff)) << 24) | \
  |  |  ------------------
  |  |  |  |  135|      0|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  335|      0|     (((PRUint32)SBOX((w >> 16) & 0xff)) << 16) | \
  |  |  ------------------
  |  |  |  |  135|      0|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  336|      0|     (((PRUint32)SBOX((w >> 8) & 0xff)) << 8) |   \
  |  |  ------------------
  |  |  |  |  135|      0|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  |  |  337|      0|     (((PRUint32)SBOX((w)&0xff))))
  |  |  ------------------
  |  |  |  |  135|      0|#define SBOX(b) ((PRUint8)_T3[b])
  |  |  ------------------
  ------------------
  451|    960|            *pW = W[i - Nk] ^ tmp;
  452|    960|        }
  453|    320|    }
  454|    526|}
rijndael.c:rijndael_invkey_expansion:
  463|    263|{
  464|    263|    unsigned int r;
  465|    263|    PRUint32 *roundkeyw;
  466|    263|    PRUint8 *b;
  467|    263|    int Nb = cx->Nb;
  468|       |    /* begins like usual key expansion ... */
  469|    263|    rijndael_key_expansion(cx, key, Nk);
  470|       |    /* ... but has the additional step of InvMixColumn,
  471|       |     * excepting the first and last round keys.
  472|       |     */
  473|    263|    roundkeyw = cx->k.expandedKey + cx->Nb;
  474|  3.27k|    for (r = 1; r < cx->Nr; ++r) {
  ------------------
  |  Branch (474:17): [True: 3.00k, False: 263]
  ------------------
  475|       |        /* each key word, roundkeyw, represents a column in the key
  476|       |         * matrix.  Each column is multiplied by the InvMixColumn matrix.
  477|       |         *   [ 0E 0B 0D 09 ]   [ b0 ]
  478|       |         *   [ 09 0E 0B 0D ] * [ b1 ]
  479|       |         *   [ 0D 09 0E 0B ]   [ b2 ]
  480|       |         *   [ 0B 0D 09 0E ]   [ b3 ]
  481|       |         */
  482|  3.00k|        b = (PRUint8 *)roundkeyw;
  483|  3.00k|        *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  129|  3.00k|#define IMXC0(b) _IMXC0[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  130|  3.00k|#define IMXC1(b) _IMXC1[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  131|  3.00k|#define IMXC2(b) _IMXC2[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  132|  3.00k|#define IMXC3(b) _IMXC3[b]
  ------------------
  484|  3.00k|        b = (PRUint8 *)roundkeyw;
  485|  3.00k|        *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  129|  3.00k|#define IMXC0(b) _IMXC0[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  130|  3.00k|#define IMXC1(b) _IMXC1[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  131|  3.00k|#define IMXC2(b) _IMXC2[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  132|  3.00k|#define IMXC3(b) _IMXC3[b]
  ------------------
  486|  3.00k|        b = (PRUint8 *)roundkeyw;
  487|  3.00k|        *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  129|  3.00k|#define IMXC0(b) _IMXC0[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  130|  3.00k|#define IMXC1(b) _IMXC1[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  131|  3.00k|#define IMXC2(b) _IMXC2[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  132|  3.00k|#define IMXC3(b) _IMXC3[b]
  ------------------
  488|  3.00k|        b = (PRUint8 *)roundkeyw;
  489|  3.00k|        *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  129|  3.00k|#define IMXC0(b) _IMXC0[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  130|  3.00k|#define IMXC1(b) _IMXC1[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  131|  3.00k|#define IMXC2(b) _IMXC2[b]
  ------------------
                      *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^ IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  132|  3.00k|#define IMXC3(b) _IMXC3[b]
  ------------------
  490|  3.00k|        if (Nb <= 4)
  ------------------
  |  Branch (490:13): [True: 3.00k, False: 0]
  ------------------
  491|  3.00k|            continue;
  492|      0|        switch (Nb) {
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|            case 8:
  ------------------
  |  Branch (493:13): [True: 0, False: 0]
  ------------------
  494|      0|                b = (PRUint8 *)roundkeyw;
  495|      0|                *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^
  ------------------
  |  |  129|      0|#define IMXC0(b) _IMXC0[b]
  ------------------
                              *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^
  ------------------
  |  |  130|      0|#define IMXC1(b) _IMXC1[b]
  ------------------
  496|      0|                               IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  131|      0|#define IMXC2(b) _IMXC2[b]
  ------------------
                                             IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  132|      0|#define IMXC3(b) _IMXC3[b]
  ------------------
  497|      0|            case 7:
  ------------------
  |  Branch (497:13): [True: 0, False: 0]
  ------------------
  498|      0|                b = (PRUint8 *)roundkeyw;
  499|      0|                *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^
  ------------------
  |  |  129|      0|#define IMXC0(b) _IMXC0[b]
  ------------------
                              *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^
  ------------------
  |  |  130|      0|#define IMXC1(b) _IMXC1[b]
  ------------------
  500|      0|                               IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  131|      0|#define IMXC2(b) _IMXC2[b]
  ------------------
                                             IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  132|      0|#define IMXC3(b) _IMXC3[b]
  ------------------
  501|      0|            case 6:
  ------------------
  |  Branch (501:13): [True: 0, False: 0]
  ------------------
  502|      0|                b = (PRUint8 *)roundkeyw;
  503|      0|                *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^
  ------------------
  |  |  129|      0|#define IMXC0(b) _IMXC0[b]
  ------------------
                              *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^
  ------------------
  |  |  130|      0|#define IMXC1(b) _IMXC1[b]
  ------------------
  504|      0|                               IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  131|      0|#define IMXC2(b) _IMXC2[b]
  ------------------
                                             IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  132|      0|#define IMXC3(b) _IMXC3[b]
  ------------------
  505|      0|            case 5:
  ------------------
  |  Branch (505:13): [True: 0, False: 0]
  ------------------
  506|      0|                b = (PRUint8 *)roundkeyw;
  507|      0|                *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^
  ------------------
  |  |  129|      0|#define IMXC0(b) _IMXC0[b]
  ------------------
                              *roundkeyw++ = IMXC0(b[0]) ^ IMXC1(b[1]) ^
  ------------------
  |  |  130|      0|#define IMXC1(b) _IMXC1[b]
  ------------------
  508|      0|                               IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  131|      0|#define IMXC2(b) _IMXC2[b]
  ------------------
                                             IMXC2(b[2]) ^ IMXC3(b[3]);
  ------------------
  |  |  132|      0|#define IMXC3(b) _IMXC3[b]
  ------------------
  509|      0|        }
  510|      0|    }
  511|    263|}
rijndael.c:freeblDestroy_GCM_DestroyContext:
  983|  1.24k|    {                                                          \
  984|  1.24k|        ctxtype *ctx = vctx;                                   \
  985|  1.24k|        mmm(ctx, freeit);                                      \
  986|  1.24k|    }

RSA_PublicKeyOp:
  934|  2.33k|{
  935|  2.33k|    unsigned int modLen, expLen, offset;
  936|  2.33k|    mp_int n, e, m, c;
  937|  2.33k|    mp_err err = MP_OKAY;
  ------------------
  |  |   39|  2.33k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  938|  2.33k|    SECStatus rv = SECSuccess;
  939|  2.33k|    if (!key || !output || !input) {
  ------------------
  |  Branch (939:9): [True: 0, False: 2.33k]
  |  Branch (939:17): [True: 0, False: 2.33k]
  |  Branch (939:28): [True: 0, False: 2.33k]
  ------------------
  940|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  941|      0|        return SECFailure;
  942|      0|    }
  943|  2.33k|    MP_DIGITS(&n) = 0;
  ------------------
  |  |  152|  2.33k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  944|  2.33k|    MP_DIGITS(&e) = 0;
  ------------------
  |  |  152|  2.33k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  945|  2.33k|    MP_DIGITS(&m) = 0;
  ------------------
  |  |  152|  2.33k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  946|  2.33k|    MP_DIGITS(&c) = 0;
  ------------------
  |  |  152|  2.33k|#define MP_DIGITS(MP) ((MP)->dp)
  ------------------
  947|  2.33k|    CHECK_MPI_OK(mp_init(&n));
  ------------------
  |  |   12|  2.33k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  2.33k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 2.33k]
  |  |  ------------------
  |  |   13|  2.33k|    goto cleanup
  ------------------
  948|  2.33k|    CHECK_MPI_OK(mp_init(&e));
  ------------------
  |  |   12|  2.33k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  2.33k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 2.33k]
  |  |  ------------------
  |  |   13|  2.33k|    goto cleanup
  ------------------
  949|  2.33k|    CHECK_MPI_OK(mp_init(&m));
  ------------------
  |  |   12|  2.33k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  2.33k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 2.33k]
  |  |  ------------------
  |  |   13|  2.33k|    goto cleanup
  ------------------
  950|  2.33k|    CHECK_MPI_OK(mp_init(&c));
  ------------------
  |  |   12|  2.33k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  2.33k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 2.33k]
  |  |  ------------------
  |  |   13|  2.33k|    goto cleanup
  ------------------
  951|  2.33k|    modLen = rsa_modulusLen(&key->modulus);
  952|  2.33k|    expLen = rsa_modulusLen(&key->publicExponent);
  953|       |
  954|  2.33k|    if (modLen == 0) {
  ------------------
  |  Branch (954:9): [True: 0, False: 2.33k]
  ------------------
  955|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  956|      0|        rv = SECFailure;
  957|      0|        goto cleanup;
  958|      0|    }
  959|       |
  960|       |    /* 1.  Obtain public key (n, e) */
  961|  2.33k|    if (BAD_RSA_KEY_SIZE(modLen, expLen)) {
  ------------------
  |  |   47|  2.33k|    ((expLen) > (modLen) || (modLen) > RSA_MAX_MODULUS_BITS / 8 || \
  |  |  ------------------
  |  |  |  |  152|  2.33k|#define RSA_MAX_MODULUS_BITS 16384
  |  |  ------------------
  |  |  |  Branch (47:6): [True: 0, False: 2.33k]
  |  |  |  Branch (47:29): [True: 0, False: 2.33k]
  |  |  ------------------
  |  |   48|  2.33k|     (expLen) > RSA_MAX_EXPONENT_BITS / 8)
  |  |  ------------------
  |  |  |  |  153|  2.33k|#define RSA_MAX_EXPONENT_BITS 64
  |  |  ------------------
  |  |  |  Branch (48:6): [True: 0, False: 2.33k]
  |  |  ------------------
  ------------------
  962|      0|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  963|      0|        rv = SECFailure;
  964|      0|        goto cleanup;
  965|      0|    }
  966|  2.33k|    SECITEM_TO_MPINT(key->modulus, &n);
  ------------------
  |  |   19|  2.33k|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|  2.33k|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  2.33k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 2.33k]
  |  |  |  |  ------------------
  |  |  |  |   13|  2.33k|    goto cleanup
  |  |  ------------------
  ------------------
  967|  2.33k|    SECITEM_TO_MPINT(key->publicExponent, &e);
  ------------------
  |  |   19|  2.33k|    CHECK_MPI_OK(mp_read_unsigned_octets((mp), (it).data, (it).len))
  |  |  ------------------
  |  |  |  |   12|  2.33k|    if (MP_OKAY > (err = func)) \
  |  |  |  |  ------------------
  |  |  |  |  |  |   39|  2.33k|#define MP_OKAY 0    /* no error, all is well */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (12:9): [True: 0, False: 2.33k]
  |  |  |  |  ------------------
  |  |  |  |   13|  2.33k|    goto cleanup
  |  |  ------------------
  ------------------
  968|  2.33k|    if (e.used > n.used) {
  ------------------
  |  Branch (968:9): [True: 0, False: 2.33k]
  ------------------
  969|       |        /* exponent should not be greater than modulus */
  970|      0|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  971|      0|        rv = SECFailure;
  972|      0|        goto cleanup;
  973|      0|    }
  974|       |    /* 2. check input out of range (needs to be in range [0..n-1]) */
  975|  2.33k|    offset = (key->modulus.data[0] == 0) ? 1 : 0; /* may be leading 0 */
  ------------------
  |  Branch (975:14): [True: 0, False: 2.33k]
  ------------------
  976|  2.33k|    if (memcmp(input, key->modulus.data + offset, modLen) >= 0) {
  ------------------
  |  Branch (976:9): [True: 17, False: 2.31k]
  ------------------
  977|     17|        PORT_SetError(SEC_ERROR_INPUT_LEN);
  ------------------
  |  |   65|     17|#define PORT_SetError PORT_SetError_Util
  ------------------
  978|     17|        rv = SECFailure;
  979|     17|        goto cleanup;
  980|     17|    }
  981|       |    /* 2 bis.  Represent message as integer in range [0..n-1] */
  982|  2.31k|    CHECK_MPI_OK(mp_read_unsigned_octets(&m, input, modLen));
  ------------------
  |  |   12|  2.31k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  2.31k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 2.31k]
  |  |  ------------------
  |  |   13|  2.31k|    goto cleanup
  ------------------
  983|       |/* 3.  Compute c = m**e mod n */
  984|       |#ifdef USE_MPI_EXPT_D
  985|       |    /* XXX see which is faster */
  986|       |    if (MP_USED(&e) == 1) {
  987|       |        CHECK_MPI_OK(mp_exptmod_d(&m, MP_DIGIT(&e, 0), &n, &c));
  988|       |    } else
  989|       |#endif
  990|  2.31k|        CHECK_MPI_OK(mp_exptmod(&m, &e, &n, &c));
  ------------------
  |  |   12|  2.31k|    if (MP_OKAY > (err = func)) \
  |  |  ------------------
  |  |  |  |   39|  2.31k|#define MP_OKAY 0    /* no error, all is well */
  |  |  ------------------
  |  |  |  Branch (12:9): [True: 0, False: 2.31k]
  |  |  ------------------
  |  |   13|  2.31k|    goto cleanup
  ------------------
  991|       |    /* 4.  result c is ciphertext */
  992|  2.31k|    err = mp_to_fixlen_octets(&c, output, modLen);
  993|  2.31k|    if (err >= 0)
  ------------------
  |  Branch (993:9): [True: 2.31k, False: 0]
  ------------------
  994|  2.31k|        err = MP_OKAY;
  ------------------
  |  |   39|  2.31k|#define MP_OKAY 0    /* no error, all is well */
  ------------------
  995|  2.33k|cleanup:
  996|  2.33k|    mp_clear(&n);
  997|  2.33k|    mp_clear(&e);
  998|  2.33k|    mp_clear(&m);
  999|  2.33k|    mp_clear(&c);
 1000|  2.33k|    if (err) {
  ------------------
  |  Branch (1000:9): [True: 0, False: 2.33k]
  ------------------
 1001|      0|        MP_TO_SEC_ERROR(err);
  ------------------
  |  |   41|      0|    switch (err) {                                    \
  |  |   42|      0|        case MP_MEM:                                  \
  |  |  ------------------
  |  |  |  |   42|      0|#define MP_MEM -2    /* out of memory         */
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   43|      0|            PORT_SetError(SEC_ERROR_NO_MEMORY);       \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   44|      0|            break;                                    \
  |  |   45|      0|        case MP_RANGE:                                \
  |  |  ------------------
  |  |  |  |   43|      0|#define MP_RANGE -3  /* argument out of range */
  |  |  ------------------
  |  |  |  Branch (45:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   46|      0|            PORT_SetError(SEC_ERROR_BAD_DATA);        \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   47|      0|            break;                                    \
  |  |   48|      0|        case MP_BADARG:                               \
  |  |  ------------------
  |  |  |  |   44|      0|#define MP_BADARG -4 /* invalid parameter     */
  |  |  ------------------
  |  |  |  Branch (48:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   49|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   50|      0|            break;                                    \
  |  |   51|      0|        default:                                      \
  |  |  ------------------
  |  |  |  Branch (51:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   52|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE); \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   53|      0|            break;                                    \
  |  |   54|      0|    }
  ------------------
 1002|      0|        rv = SECFailure;
 1003|      0|    }
 1004|  2.33k|    return rv;
 1005|  2.33k|}
RSA_Init:
 1670|      1|{
 1671|      1|    if (PR_CallOnce(&coBPInit, init_blinding_params_list) != PR_SUCCESS) {
  ------------------
  |  Branch (1671:9): [True: 0, False: 1]
  ------------------
 1672|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1673|      0|        return SECFailure;
 1674|      0|    }
 1675|      1|    return SECSuccess;
 1676|      1|}
RSA_Cleanup:
 1681|      1|{
 1682|      1|    blindingParams *bp = NULL;
 1683|      1|    if (!coBPInit.initialized)
  ------------------
  |  Branch (1683:9): [True: 0, False: 1]
  ------------------
 1684|      0|        return;
 1685|       |
 1686|      1|    while (!PR_CLIST_IS_EMPTY(&blindingParamsList.head)) {
  ------------------
  |  |   94|      1|    ((_l)->next == (_l))
  ------------------
  |  Branch (1686:12): [True: 0, False: 1]
  ------------------
 1687|      0|        RSABlindingParams *rsabp =
 1688|      0|            (RSABlindingParams *)PR_LIST_HEAD(&blindingParamsList.head);
  ------------------
  |  |   65|      0|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
 1689|      0|        PR_REMOVE_LINK(&rsabp->link);
  ------------------
  |  |   72|      0|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|      0|    (_e)->prev->next = (_e)->next; \
  |  |   74|      0|    (_e)->next->prev = (_e)->prev; \
  |  |   75|      0|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1690|       |        /* clear parameters cache */
 1691|      0|        while (rsabp->bp != NULL) {
  ------------------
  |  Branch (1691:16): [True: 0, False: 0]
  ------------------
 1692|      0|            bp = rsabp->bp;
 1693|      0|            rsabp->bp = rsabp->bp->next;
 1694|      0|            mp_clear(&bp->f);
 1695|      0|            mp_clear(&bp->g);
 1696|      0|        }
 1697|      0|        SECITEM_ZfreeItem(&rsabp->modulus, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                      SECITEM_ZfreeItem(&rsabp->modulus, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1698|      0|        PORT_Free(rsabp);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1699|      0|    }
 1700|       |
 1701|      1|    if (blindingParamsList.cVar) {
  ------------------
  |  Branch (1701:9): [True: 1, False: 0]
  ------------------
 1702|      1|        PR_DestroyCondVar(blindingParamsList.cVar);
 1703|      1|        blindingParamsList.cVar = NULL;
 1704|      1|    }
 1705|       |
 1706|      1|    if (blindingParamsList.lock) {
  ------------------
  |  Branch (1706:9): [True: 1, False: 0]
  ------------------
 1707|      1|        SKIP_AFTER_FORK(PZ_DestroyLock(blindingParamsList.lock));
  ------------------
  |  |   42|      1|    if (!bl_parentForkedAfterC_Initialize) \
  |  |  ------------------
  |  |  |  Branch (42:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   43|      1|    x
  ------------------
 1708|      1|        blindingParamsList.lock = NULL;
 1709|      1|    }
 1710|       |
 1711|      1|    coBPInit.initialized = 0;
 1712|      1|    coBPInit.inProgress = 0;
 1713|      1|    coBPInit.status = 0;
 1714|      1|}
BL_Cleanup:
 1723|      1|{
 1724|      1|    RSA_Cleanup();
 1725|      1|}
BL_SetForkState:
 1734|      2|{
 1735|      2|    bl_parentForkedAfterC_Initialize = forked;
 1736|      2|}
rsa.c:rsa_modulusLen:
  917|  4.66k|{
  918|  4.66k|    if (modulus->len == 0) {
  ------------------
  |  Branch (918:9): [True: 0, False: 4.66k]
  ------------------
  919|      0|        return 0;
  920|  4.66k|    };
  921|  4.66k|    unsigned char byteZero = modulus->data[0];
  922|  4.66k|    unsigned int modLen = modulus->len - !byteZero;
  923|  4.66k|    return modLen;
  924|  4.66k|}
rsa.c:init_blinding_params_list:
 1187|      1|{
 1188|      1|    blindingParamsList.lock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 1189|      1|    if (!blindingParamsList.lock) {
  ------------------
  |  Branch (1189:9): [True: 0, False: 1]
  ------------------
 1190|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1191|      0|        return PR_FAILURE;
 1192|      0|    }
 1193|      1|    blindingParamsList.cVar = PR_NewCondVar(blindingParamsList.lock);
 1194|      1|    if (!blindingParamsList.cVar) {
  ------------------
  |  Branch (1194:9): [True: 0, False: 1]
  ------------------
 1195|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1196|      0|        return PR_FAILURE;
 1197|      0|    }
 1198|      1|    blindingParamsList.waitCount = 0;
 1199|      1|    PR_INIT_CLIST(&blindingParamsList.head);
  ------------------
  |  |  100|      1|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|      1|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|      1|    (_l)->next = (_l); \
  |  |  102|      1|    (_l)->prev = (_l); \
  |  |  103|      1|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      1|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1200|      1|    return PR_SUCCESS;
 1201|      1|}

RSA_EncryptBlock:
  916|  1.08k|{
  917|  1.08k|    SECStatus rv;
  918|  1.08k|    unsigned int modulusLen = rsa_modulusLen(&key->modulus);
  919|  1.08k|    SECItem formatted;
  920|  1.08k|    SECItem unformatted;
  921|       |
  922|  1.08k|    formatted.data = NULL;
  923|  1.08k|    if (maxOutputLen < modulusLen)
  ------------------
  |  Branch (923:9): [True: 0, False: 1.08k]
  ------------------
  924|      0|        goto failure;
  925|       |
  926|  1.08k|    unformatted.len = inputLen;
  927|  1.08k|    unformatted.data = (unsigned char *)input;
  928|  1.08k|    formatted.data = NULL;
  929|  1.08k|    rv = rsa_FormatBlock(&formatted, modulusLen, RSA_BlockPublic,
  930|  1.08k|                         &unformatted);
  931|  1.08k|    if (rv != SECSuccess)
  ------------------
  |  Branch (931:9): [True: 0, False: 1.08k]
  ------------------
  932|      0|        goto failure;
  933|       |
  934|  1.08k|    rv = RSA_PublicKeyOp(key, output, formatted.data);
  935|  1.08k|    if (rv != SECSuccess)
  ------------------
  |  Branch (935:9): [True: 0, False: 1.08k]
  ------------------
  936|      0|        goto failure;
  937|       |
  938|  1.08k|    PORT_ZFree(formatted.data, modulusLen);
  ------------------
  |  |   75|  1.08k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  939|  1.08k|    *outputLen = modulusLen;
  940|  1.08k|    return SECSuccess;
  941|       |
  942|      0|failure:
  943|      0|    if (formatted.data != NULL)
  ------------------
  |  Branch (943:9): [True: 0, False: 0]
  ------------------
  944|      0|        PORT_ZFree(formatted.data, modulusLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  945|      0|    return SECFailure;
  946|  1.08k|}
RSA_CheckSignPSS:
 1484|    913|{
 1485|    913|    SECStatus rv;
 1486|    913|    unsigned int modulusLen = rsa_modulusLen(&key->modulus);
 1487|    913|    unsigned int modulusBits = rsa_modulusBits(&key->modulus);
 1488|    913|    unsigned int emLen = modulusLen;
 1489|    913|    unsigned char *buffer, *em;
 1490|       |
 1491|    913|    if (sigLen != modulusLen) {
  ------------------
  |  Branch (1491:9): [True: 17, False: 896]
  ------------------
 1492|     17|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|     17|#define PORT_SetError PORT_SetError_Util
  ------------------
 1493|     17|        return SECFailure;
 1494|     17|    }
 1495|       |
 1496|    896|    if ((hashAlg == HASH_AlgNULL) || (maskHashAlg == HASH_AlgNULL)) {
  ------------------
  |  Branch (1496:9): [True: 0, False: 896]
  |  Branch (1496:38): [True: 0, False: 896]
  ------------------
 1497|      0|        PORT_SetError(SEC_ERROR_INVALID_ALGORITHM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1498|      0|        return SECFailure;
 1499|      0|    }
 1500|       |
 1501|    896|    buffer = em = (unsigned char *)PORT_Alloc(modulusLen);
  ------------------
  |  |   52|    896|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1502|    896|    if (!buffer) {
  ------------------
  |  Branch (1502:9): [True: 0, False: 896]
  ------------------
 1503|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1504|      0|        return SECFailure;
 1505|      0|    }
 1506|       |
 1507|    896|    rv = RSA_PublicKeyOp(key, buffer, sig);
 1508|    896|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1508:9): [True: 7, False: 889]
  ------------------
 1509|      7|        PORT_Free(buffer);
  ------------------
  |  |   60|      7|#define PORT_Free PORT_Free_Util
  ------------------
 1510|      7|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      7|#define PORT_SetError PORT_SetError_Util
  ------------------
 1511|      7|        return SECFailure;
 1512|      7|    }
 1513|       |
 1514|       |    /* len(em) == ceil((modulusBits - 1) / 8). */
 1515|    889|    if (modulusBits % 8 == 1) {
  ------------------
  |  Branch (1515:9): [True: 0, False: 889]
  ------------------
 1516|      0|        emLen--;
 1517|      0|        em++;
 1518|      0|    }
 1519|    889|    rv = emsa_pss_verify(hash, em, emLen, modulusBits - 1, hashAlg,
 1520|    889|                         maskHashAlg, saltLength);
 1521|       |
 1522|    889|    PORT_Free(buffer);
  ------------------
  |  |   60|    889|#define PORT_Free PORT_Free_Util
  ------------------
 1523|    889|    return rv;
 1524|    896|}
RSA_CheckSign:
 1568|     47|{
 1569|     47|    SECStatus rv = SECFailure;
 1570|     47|    unsigned int modulusLen = rsa_modulusLen(&key->modulus);
 1571|     47|    unsigned int i;
 1572|     47|    unsigned char *buffer = NULL;
 1573|       |
 1574|     47|    if (sigLen != modulusLen) {
  ------------------
  |  Branch (1574:9): [True: 8, False: 39]
  ------------------
 1575|      8|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      8|#define PORT_SetError PORT_SetError_Util
  ------------------
 1576|      8|        goto done;
 1577|      8|    }
 1578|       |
 1579|       |    /*
 1580|       |     * 0x00 || BT || Pad || 0x00 || ActualData
 1581|       |     *
 1582|       |     * The "3" below is the first octet + the second octet + the 0x00
 1583|       |     * octet that always comes just before the ActualData.
 1584|       |     */
 1585|     39|    if (dataLen > modulusLen - (3 + RSA_BLOCK_MIN_PAD_LEN)) {
  ------------------
  |  |   19|     39|#define RSA_BLOCK_MIN_PAD_LEN 8
  ------------------
  |  Branch (1585:9): [True: 0, False: 39]
  ------------------
 1586|      0|        PORT_SetError(SEC_ERROR_BAD_DATA);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1587|      0|        goto done;
 1588|      0|    }
 1589|       |
 1590|     39|    buffer = (unsigned char *)PORT_Alloc(modulusLen + 1);
  ------------------
  |  |   52|     39|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1591|     39|    if (!buffer) {
  ------------------
  |  Branch (1591:9): [True: 0, False: 39]
  ------------------
 1592|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1593|      0|        goto done;
 1594|      0|    }
 1595|       |
 1596|     39|    if (RSA_PublicKeyOp(key, buffer, sig) != SECSuccess) {
  ------------------
  |  Branch (1596:9): [True: 6, False: 33]
  ------------------
 1597|      6|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      6|#define PORT_SetError PORT_SetError_Util
  ------------------
 1598|      6|        goto done;
 1599|      6|    }
 1600|       |
 1601|       |    /*
 1602|       |     * check the padding that was used
 1603|       |     */
 1604|     33|    if (buffer[0] != RSA_BLOCK_FIRST_OCTET ||
  ------------------
  |  |   20|     66|#define RSA_BLOCK_FIRST_OCTET 0x00
  ------------------
  |  Branch (1604:9): [True: 16, False: 17]
  ------------------
 1605|     33|        buffer[1] != (unsigned char)RSA_BlockPrivate) {
  ------------------
  |  Branch (1605:9): [True: 3, False: 14]
  ------------------
 1606|     19|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|     19|#define PORT_SetError PORT_SetError_Util
  ------------------
 1607|     19|        goto done;
 1608|     19|    }
 1609|  1.29k|    for (i = 2; i < modulusLen - dataLen - 1; i++) {
  ------------------
  |  Branch (1609:17): [True: 1.28k, False: 13]
  ------------------
 1610|  1.28k|        if (buffer[i] != RSA_BLOCK_PRIVATE_PAD_OCTET) {
  ------------------
  |  |   21|  1.28k|#define RSA_BLOCK_PRIVATE_PAD_OCTET 0xff
  ------------------
  |  Branch (1610:13): [True: 1, False: 1.28k]
  ------------------
 1611|      1|            PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
 1612|      1|            goto done;
 1613|      1|        }
 1614|  1.28k|    }
 1615|     13|    if (buffer[i] != RSA_BLOCK_AFTER_PAD_OCTET) {
  ------------------
  |  |   22|     13|#define RSA_BLOCK_AFTER_PAD_OCTET 0x00
  ------------------
  |  Branch (1615:9): [True: 1, False: 12]
  ------------------
 1616|      1|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
 1617|      1|        goto done;
 1618|      1|    }
 1619|       |
 1620|       |    /*
 1621|       |     * make sure we get the same results
 1622|       |     */
 1623|     12|    if (PORT_Memcmp(buffer + modulusLen - dataLen, data, dataLen) == 0) {
  ------------------
  |  |  179|     12|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (1623:9): [True: 0, False: 12]
  ------------------
 1624|      0|        rv = SECSuccess;
 1625|      0|    }
 1626|       |
 1627|     47|done:
 1628|     47|    if (buffer) {
  ------------------
  |  Branch (1628:9): [True: 39, False: 8]
  ------------------
 1629|     39|        PORT_Free(buffer);
  ------------------
  |  |   60|     39|#define PORT_Free PORT_Free_Util
  ------------------
 1630|     39|    }
 1631|     47|    return rv;
 1632|     12|}
RSA_CheckSignRecover:
 1641|    543|{
 1642|    543|    SECStatus rv = SECFailure;
 1643|    543|    unsigned int modulusLen = rsa_modulusLen(&key->modulus);
 1644|    543|    unsigned int i;
 1645|    543|    unsigned char *buffer = NULL;
 1646|    543|    unsigned int padLen;
 1647|       |
 1648|    543|    if (sigLen != modulusLen) {
  ------------------
  |  Branch (1648:9): [True: 228, False: 315]
  ------------------
 1649|    228|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|    228|#define PORT_SetError PORT_SetError_Util
  ------------------
 1650|    228|        goto done;
 1651|    228|    }
 1652|       |
 1653|    315|    buffer = (unsigned char *)PORT_Alloc(modulusLen + 1);
  ------------------
  |  |   52|    315|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1654|    315|    if (!buffer) {
  ------------------
  |  Branch (1654:9): [True: 0, False: 315]
  ------------------
 1655|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1656|      0|        goto done;
 1657|      0|    }
 1658|       |
 1659|    315|    if (RSA_PublicKeyOp(key, buffer, sig) != SECSuccess) {
  ------------------
  |  Branch (1659:9): [True: 4, False: 311]
  ------------------
 1660|      4|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
 1661|      4|        goto done;
 1662|      4|    }
 1663|       |
 1664|    311|    *outputLen = 0;
 1665|       |
 1666|       |    /*
 1667|       |     * check the padding that was used
 1668|       |     */
 1669|    311|    if (buffer[0] != RSA_BLOCK_FIRST_OCTET ||
  ------------------
  |  |   20|    622|#define RSA_BLOCK_FIRST_OCTET 0x00
  ------------------
  |  Branch (1669:9): [True: 290, False: 21]
  ------------------
 1670|    311|        buffer[1] != (unsigned char)RSA_BlockPrivate) {
  ------------------
  |  Branch (1670:9): [True: 8, False: 13]
  ------------------
 1671|    298|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|    298|#define PORT_SetError PORT_SetError_Util
  ------------------
 1672|    298|        goto done;
 1673|    298|    }
 1674|    809|    for (i = 2; i < modulusLen; i++) {
  ------------------
  |  Branch (1674:17): [True: 809, False: 0]
  ------------------
 1675|    809|        if (buffer[i] == RSA_BLOCK_AFTER_PAD_OCTET) {
  ------------------
  |  |   22|    809|#define RSA_BLOCK_AFTER_PAD_OCTET 0x00
  ------------------
  |  Branch (1675:13): [True: 9, False: 800]
  ------------------
 1676|      9|            *outputLen = modulusLen - i - 1;
 1677|      9|            break;
 1678|      9|        }
 1679|    800|        if (buffer[i] != RSA_BLOCK_PRIVATE_PAD_OCTET) {
  ------------------
  |  |   21|    800|#define RSA_BLOCK_PRIVATE_PAD_OCTET 0xff
  ------------------
  |  Branch (1679:13): [True: 4, False: 796]
  ------------------
 1680|      4|            PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
 1681|      4|            goto done;
 1682|      4|        }
 1683|    800|    }
 1684|      9|    padLen = i - 2;
 1685|      9|    if (padLen < RSA_BLOCK_MIN_PAD_LEN) {
  ------------------
  |  |   19|      9|#define RSA_BLOCK_MIN_PAD_LEN 8
  ------------------
  |  Branch (1685:9): [True: 0, False: 9]
  ------------------
 1686|      0|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1687|      0|        goto done;
 1688|      0|    }
 1689|      9|    if (*outputLen == 0) {
  ------------------
  |  Branch (1689:9): [True: 0, False: 9]
  ------------------
 1690|      0|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1691|      0|        goto done;
 1692|      0|    }
 1693|      9|    if (*outputLen > maxOutputLen) {
  ------------------
  |  Branch (1693:9): [True: 0, False: 9]
  ------------------
 1694|      0|        PORT_SetError(SEC_ERROR_OUTPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1695|      0|        goto done;
 1696|      0|    }
 1697|       |
 1698|      9|    PORT_Memcpy(output, buffer + modulusLen - *outputLen, *outputLen);
  ------------------
  |  |  180|      9|#define PORT_Memcpy memcpy
  ------------------
 1699|      9|    rv = SECSuccess;
 1700|       |
 1701|    543|done:
 1702|    543|    if (buffer) {
  ------------------
  |  Branch (1702:9): [True: 315, False: 228]
  ------------------
 1703|    315|        PORT_Free(buffer);
  ------------------
  |  |   60|    315|#define PORT_Free PORT_Free_Util
  ------------------
 1704|    315|    }
 1705|    543|    return rv;
 1706|      9|}
rsapkcs.c:rsa_modulusLen:
   82|  2.58k|{
   83|  2.58k|    if (modulus->len == 0) {
  ------------------
  |  Branch (83:9): [True: 0, False: 2.58k]
  ------------------
   84|      0|        return 0;
   85|      0|    }
   86|       |
   87|  2.58k|    unsigned char byteZero = modulus->data[0];
   88|  2.58k|    unsigned int modLen = modulus->len - !byteZero;
   89|  2.58k|    return modLen;
   90|  2.58k|}
rsapkcs.c:rsa_FormatBlock:
  244|  1.08k|{
  245|  1.08k|    switch (blockType) {
  246|      0|        case RSA_BlockPrivate:
  ------------------
  |  Branch (246:9): [True: 0, False: 1.08k]
  ------------------
  247|  1.08k|        case RSA_BlockPublic:
  ------------------
  |  Branch (247:9): [True: 1.08k, False: 0]
  ------------------
  248|       |            /*
  249|       |             * 0x00 || BT || Pad || 0x00 || ActualData
  250|       |             *
  251|       |             * The "3" below is the first octet + the second octet + the 0x00
  252|       |             * octet that always comes just before the ActualData.
  253|       |             */
  254|  1.08k|            if (modulusLen < (3 + RSA_BLOCK_MIN_PAD_LEN) || data->len > (modulusLen - (3 + RSA_BLOCK_MIN_PAD_LEN))) {
  ------------------
  |  |   19|  1.08k|#define RSA_BLOCK_MIN_PAD_LEN 8
  ------------------
                          if (modulusLen < (3 + RSA_BLOCK_MIN_PAD_LEN) || data->len > (modulusLen - (3 + RSA_BLOCK_MIN_PAD_LEN))) {
  ------------------
  |  |   19|  1.08k|#define RSA_BLOCK_MIN_PAD_LEN 8
  ------------------
  |  Branch (254:17): [True: 0, False: 1.08k]
  |  Branch (254:61): [True: 0, False: 1.08k]
  ------------------
  255|      0|                return SECFailure;
  256|      0|            }
  257|  1.08k|            result->data = rsa_FormatOneBlock(modulusLen, blockType, data);
  258|  1.08k|            if (result->data == NULL) {
  ------------------
  |  Branch (258:17): [True: 0, False: 1.08k]
  ------------------
  259|      0|                result->len = 0;
  260|      0|                return SECFailure;
  261|      0|            }
  262|  1.08k|            result->len = modulusLen;
  263|       |
  264|  1.08k|            break;
  265|       |
  266|      0|        case RSA_BlockRaw:
  ------------------
  |  Branch (266:9): [True: 0, False: 1.08k]
  ------------------
  267|       |            /*
  268|       |             * Pad || ActualData
  269|       |             * Pad is zeros. The application is responsible for recovering
  270|       |             * the actual data.
  271|       |             */
  272|      0|            if (data->len > modulusLen) {
  ------------------
  |  Branch (272:17): [True: 0, False: 0]
  ------------------
  273|      0|                return SECFailure;
  274|      0|            }
  275|      0|            result->data = (unsigned char *)PORT_ZAlloc(modulusLen);
  ------------------
  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  276|      0|            result->len = modulusLen;
  277|      0|            PORT_Memcpy(result->data + (modulusLen - data->len),
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  278|      0|                        data->data, data->len);
  279|      0|            break;
  280|       |
  281|      0|        default:
  ------------------
  |  Branch (281:9): [True: 0, False: 1.08k]
  ------------------
  282|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  283|      0|            result->data = NULL;
  284|      0|            result->len = 0;
  285|      0|            return SECFailure;
  286|  1.08k|    }
  287|       |
  288|  1.08k|    return SECSuccess;
  289|  1.08k|}
rsapkcs.c:rsa_FormatOneBlock:
  127|  1.08k|{
  128|  1.08k|    unsigned char *block;
  129|  1.08k|    unsigned char *bp;
  130|  1.08k|    unsigned int padLen;
  131|  1.08k|    unsigned int i, j;
  132|  1.08k|    SECStatus rv;
  133|       |
  134|  1.08k|    block = (unsigned char *)PORT_Alloc(modulusLen);
  ------------------
  |  |   52|  1.08k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  135|  1.08k|    if (block == NULL)
  ------------------
  |  Branch (135:9): [True: 0, False: 1.08k]
  ------------------
  136|      0|        return NULL;
  137|       |
  138|  1.08k|    bp = block;
  139|       |
  140|       |    /*
  141|       |     * All RSA blocks start with two octets:
  142|       |     *  0x00 || BlockType
  143|       |     */
  144|  1.08k|    *bp++ = RSA_BLOCK_FIRST_OCTET;
  ------------------
  |  |   20|  1.08k|#define RSA_BLOCK_FIRST_OCTET 0x00
  ------------------
  145|  1.08k|    *bp++ = (unsigned char)blockType;
  146|       |
  147|  1.08k|    switch (blockType) {
  148|       |
  149|       |        /*
  150|       |         * Blocks intended for private-key operation.
  151|       |         */
  152|      0|        case RSA_BlockPrivate: /* preferred method */
  ------------------
  |  Branch (152:9): [True: 0, False: 1.08k]
  ------------------
  153|       |            /*
  154|       |             * 0x00 || BT || Pad || 0x00 || ActualData
  155|       |             *   1      1   padLen    1      data->len
  156|       |             * padLen must be at least RSA_BLOCK_MIN_PAD_LEN (8) bytes.
  157|       |             * Pad is either all 0x00 or all 0xff bytes, depending on blockType.
  158|       |             */
  159|      0|            padLen = modulusLen - data->len - 3;
  160|      0|            PORT_Assert(padLen >= RSA_BLOCK_MIN_PAD_LEN);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  161|      0|            if (padLen < RSA_BLOCK_MIN_PAD_LEN) {
  ------------------
  |  |   19|      0|#define RSA_BLOCK_MIN_PAD_LEN 8
  ------------------
  |  Branch (161:17): [True: 0, False: 0]
  ------------------
  162|      0|                PORT_ZFree(block, modulusLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  163|      0|                return NULL;
  164|      0|            }
  165|      0|            PORT_Memset(bp, RSA_BLOCK_PRIVATE_PAD_OCTET, padLen);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
                          PORT_Memset(bp, RSA_BLOCK_PRIVATE_PAD_OCTET, padLen);
  ------------------
  |  |   21|      0|#define RSA_BLOCK_PRIVATE_PAD_OCTET 0xff
  ------------------
  166|      0|            bp += padLen;
  167|      0|            *bp++ = RSA_BLOCK_AFTER_PAD_OCTET;
  ------------------
  |  |   22|      0|#define RSA_BLOCK_AFTER_PAD_OCTET 0x00
  ------------------
  168|      0|            PORT_Memcpy(bp, data->data, data->len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  169|      0|            break;
  170|       |
  171|       |        /*
  172|       |         * Blocks intended for public-key operation.
  173|       |         */
  174|  1.08k|        case RSA_BlockPublic:
  ------------------
  |  Branch (174:9): [True: 1.08k, False: 0]
  ------------------
  175|       |            /*
  176|       |             * 0x00 || BT || Pad || 0x00 || ActualData
  177|       |             *   1      1   padLen    1      data->len
  178|       |             * Pad is 8 or more non-zero random bytes.
  179|       |             *
  180|       |             * Build the block left to right.
  181|       |             * Fill the entire block from Pad to the end with random bytes.
  182|       |             * Use the bytes after Pad as a supply of extra random bytes from
  183|       |             * which to find replacements for the zero bytes in Pad.
  184|       |             * If we need more than that, refill the bytes after Pad with
  185|       |             * new random bytes as necessary.
  186|       |             */
  187|       |
  188|  1.08k|            padLen = modulusLen - (data->len + 3);
  189|  1.08k|            PORT_Assert(padLen >= RSA_BLOCK_MIN_PAD_LEN);
  ------------------
  |  |  120|  1.08k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.08k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.08k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  190|  1.08k|            if (padLen < RSA_BLOCK_MIN_PAD_LEN) {
  ------------------
  |  |   19|  1.08k|#define RSA_BLOCK_MIN_PAD_LEN 8
  ------------------
  |  Branch (190:17): [True: 0, False: 1.08k]
  ------------------
  191|      0|                PORT_ZFree(block, modulusLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  192|      0|                return NULL;
  193|      0|            }
  194|  1.08k|            j = modulusLen - 2;
  195|  1.08k|            rv = RNG_GenerateGlobalRandomBytes(bp, j);
  196|  1.08k|            if (rv == SECSuccess) {
  ------------------
  |  Branch (196:17): [True: 1.08k, False: 0]
  ------------------
  197|  92.4k|                for (i = 0; i < padLen;) {
  ------------------
  |  Branch (197:29): [True: 91.3k, False: 1.08k]
  ------------------
  198|  91.3k|                    unsigned char repl;
  199|       |                    /* Pad with non-zero random data. */
  200|  91.3k|                    if (bp[i] != RSA_BLOCK_AFTER_PAD_OCTET) {
  ------------------
  |  |   22|  91.3k|#define RSA_BLOCK_AFTER_PAD_OCTET 0x00
  ------------------
  |  Branch (200:25): [True: 91.2k, False: 77]
  ------------------
  201|  91.2k|                        ++i;
  202|  91.2k|                        continue;
  203|  91.2k|                    }
  204|     77|                    if (j <= padLen) {
  ------------------
  |  Branch (204:25): [True: 0, False: 77]
  ------------------
  205|      0|                        rv = RNG_GenerateGlobalRandomBytes(bp + padLen,
  206|      0|                                                           modulusLen - (2 + padLen));
  207|      0|                        if (rv != SECSuccess)
  ------------------
  |  Branch (207:29): [True: 0, False: 0]
  ------------------
  208|      0|                            break;
  209|      0|                        j = modulusLen - 2;
  210|      0|                    }
  211|     77|                    do {
  212|     77|                        repl = bp[--j];
  213|     77|                    } while (repl == RSA_BLOCK_AFTER_PAD_OCTET && j > padLen);
  ------------------
  |  |   22|    154|#define RSA_BLOCK_AFTER_PAD_OCTET 0x00
  ------------------
  |  Branch (213:30): [True: 0, False: 77]
  |  Branch (213:67): [True: 0, False: 0]
  ------------------
  214|     77|                    if (repl != RSA_BLOCK_AFTER_PAD_OCTET) {
  ------------------
  |  |   22|     77|#define RSA_BLOCK_AFTER_PAD_OCTET 0x00
  ------------------
  |  Branch (214:25): [True: 77, False: 0]
  ------------------
  215|     77|                        bp[i++] = repl;
  216|     77|                    }
  217|     77|                }
  218|  1.08k|            }
  219|  1.08k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (219:17): [True: 0, False: 1.08k]
  ------------------
  220|      0|                PORT_ZFree(block, modulusLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  221|      0|                PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  222|      0|                return NULL;
  223|      0|            }
  224|  1.08k|            bp += padLen;
  225|  1.08k|            *bp++ = RSA_BLOCK_AFTER_PAD_OCTET;
  ------------------
  |  |   22|  1.08k|#define RSA_BLOCK_AFTER_PAD_OCTET 0x00
  ------------------
  226|  1.08k|            PORT_Memcpy(bp, data->data, data->len);
  ------------------
  |  |  180|  1.08k|#define PORT_Memcpy memcpy
  ------------------
  227|  1.08k|            break;
  228|       |
  229|      0|        default:
  ------------------
  |  Branch (229:9): [True: 0, False: 1.08k]
  ------------------
  230|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  231|      0|            PORT_ZFree(block, modulusLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  232|      0|            return NULL;
  233|  1.08k|    }
  234|       |
  235|  1.08k|    return block;
  236|  1.08k|}
rsapkcs.c:MGF1:
  300|     23|{
  301|     23|    unsigned int digestLen;
  302|     23|    PRUint32 counter;
  303|     23|    PRUint32 rounds;
  304|     23|    unsigned char *tempHash;
  305|     23|    unsigned char *temp;
  306|     23|    const SECHashObject *hash;
  307|     23|    void *hashContext;
  308|     23|    unsigned char C[4];
  309|     23|    SECStatus rv = SECSuccess;
  310|       |
  311|     23|    hash = HASH_GetRawHashObject(hashAlg);
  312|     23|    if (hash == NULL) {
  ------------------
  |  Branch (312:9): [True: 0, False: 23]
  ------------------
  313|      0|        return SECFailure;
  314|      0|    }
  315|       |
  316|     23|    hashContext = (*hash->create)();
  317|     23|    rounds = (maskLen + hash->length - 1) / hash->length;
  318|    102|    for (counter = 0; counter < rounds; counter++) {
  ------------------
  |  Branch (318:23): [True: 79, False: 23]
  ------------------
  319|     79|        C[0] = (unsigned char)((counter >> 24) & 0xff);
  320|     79|        C[1] = (unsigned char)((counter >> 16) & 0xff);
  321|     79|        C[2] = (unsigned char)((counter >> 8) & 0xff);
  322|     79|        C[3] = (unsigned char)(counter & 0xff);
  323|       |
  324|       |        /* This could be optimized when the clone functions in
  325|       |         * rawhash.c are implemented. */
  326|     79|        (*hash->begin)(hashContext);
  327|     79|        (*hash->update)(hashContext, mgfSeed, mgfSeedLen);
  328|     79|        (*hash->update)(hashContext, C, sizeof C);
  329|       |
  330|     79|        tempHash = mask + counter * hash->length;
  331|     79|        if (counter != (rounds - 1)) {
  ------------------
  |  Branch (331:13): [True: 56, False: 23]
  ------------------
  332|     56|            (*hash->end)(hashContext, tempHash, &digestLen, hash->length);
  333|     56|        } else { /* we're in the last round and need to cut the hash */
  334|     23|            temp = (unsigned char *)PORT_Alloc(hash->length);
  ------------------
  |  |   52|     23|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  335|     23|            if (!temp) {
  ------------------
  |  Branch (335:17): [True: 0, False: 23]
  ------------------
  336|      0|                rv = SECFailure;
  337|      0|                goto done;
  338|      0|            }
  339|     23|            (*hash->end)(hashContext, temp, &digestLen, hash->length);
  340|     23|            PORT_Memcpy(tempHash, temp, maskLen - counter * hash->length);
  ------------------
  |  |  180|     23|#define PORT_Memcpy memcpy
  ------------------
  341|     23|            PORT_Free(temp);
  ------------------
  |  |   60|     23|#define PORT_Free PORT_Free_Util
  ------------------
  342|     23|        }
  343|     79|    }
  344|       |
  345|     23|done:
  346|     23|    (*hash->destroy)(hashContext, PR_TRUE);
  ------------------
  |  |  437|     23|#define PR_TRUE 1
  ------------------
  347|     23|    return rv;
  348|     23|}
rsapkcs.c:rsa_modulusBits:
   94|    913|{
   95|    913|    if (modulus->len == 0) {
  ------------------
  |  Branch (95:9): [True: 0, False: 913]
  ------------------
   96|      0|        return 0;
   97|      0|    }
   98|       |
   99|    913|    unsigned char byteZero = modulus->data[0];
  100|    913|    unsigned int numBits = (modulus->len - 1) * 8;
  101|       |
  102|    913|    if (byteZero == 0 && modulus->len == 1) {
  ------------------
  |  Branch (102:9): [True: 0, False: 913]
  |  Branch (102:26): [True: 0, False: 0]
  ------------------
  103|      0|        return 0;
  104|      0|    }
  105|       |
  106|    913|    if (byteZero == 0) {
  ------------------
  |  Branch (106:9): [True: 0, False: 913]
  ------------------
  107|      0|        numBits -= 8;
  108|      0|        byteZero = modulus->data[1];
  109|      0|    }
  110|       |
  111|  8.13k|    while (byteZero > 0) {
  ------------------
  |  Branch (111:12): [True: 7.21k, False: 913]
  ------------------
  112|  7.21k|        numBits++;
  113|  7.21k|        byteZero >>= 1;
  114|  7.21k|    }
  115|       |
  116|    913|    return numBits;
  117|    913|}
rsapkcs.c:emsa_pss_verify:
 1328|    889|{
 1329|    889|    const SECHashObject *hash;
 1330|    889|    void *hash_context;
 1331|    889|    unsigned char *db;
 1332|    889|    unsigned char *H_; /* H' from the RFC */
 1333|    889|    unsigned int i;
 1334|    889|    unsigned int dbMaskLen;
 1335|    889|    unsigned int zeroBits;
 1336|    889|    SECStatus rv;
 1337|       |
 1338|    889|    hash = HASH_GetRawHashObject(hashAlg);
 1339|    889|    dbMaskLen = emLen - hash->length - 1;
 1340|       |
 1341|       |    /* Step 3 + 4 */
 1342|    889|    if ((emLen < (hash->length + saltLen + 2)) ||
  ------------------
  |  Branch (1342:9): [True: 51, False: 838]
  ------------------
 1343|    889|        (em[emLen - 1] != 0xbc)) {
  ------------------
  |  Branch (1343:9): [True: 809, False: 29]
  ------------------
 1344|    860|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|    860|#define PORT_SetError PORT_SetError_Util
  ------------------
 1345|    860|        return SECFailure;
 1346|    860|    }
 1347|       |
 1348|       |    /* Step 6 */
 1349|     29|    zeroBits = 8 * emLen - emBits;
 1350|     29|    if (em[0] >> (8 - zeroBits)) {
  ------------------
  |  Branch (1350:9): [True: 6, False: 23]
  ------------------
 1351|      6|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      6|#define PORT_SetError PORT_SetError_Util
  ------------------
 1352|      6|        return SECFailure;
 1353|      6|    }
 1354|       |
 1355|       |    /* Step 7 */
 1356|     23|    db = (unsigned char *)PORT_Alloc(dbMaskLen);
  ------------------
  |  |   52|     23|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1357|     23|    if (db == NULL) {
  ------------------
  |  Branch (1357:9): [True: 0, False: 23]
  ------------------
 1358|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1359|      0|        return SECFailure;
 1360|      0|    }
 1361|       |    /* &em[dbMaskLen] points to H, used as mgfSeed */
 1362|     23|    MGF1(maskHashAlg, db, dbMaskLen, &em[dbMaskLen], hash->length);
 1363|       |
 1364|       |    /* Step 8 */
 1365|  2.89k|    for (i = 0; i < dbMaskLen; i++) {
  ------------------
  |  Branch (1365:17): [True: 2.87k, False: 23]
  ------------------
 1366|  2.87k|        db[i] ^= em[i];
 1367|  2.87k|    }
 1368|       |
 1369|       |    /* Step 9 */
 1370|     23|    db[0] &= 0xff >> zeroBits;
 1371|       |
 1372|       |    /* Step 10 */
 1373|    768|    for (i = 0; i < (dbMaskLen - saltLen - 1); i++) {
  ------------------
  |  Branch (1373:17): [True: 756, False: 12]
  ------------------
 1374|    756|        if (db[i] != 0) {
  ------------------
  |  Branch (1374:13): [True: 11, False: 745]
  ------------------
 1375|     11|            PORT_Free(db);
  ------------------
  |  |   60|     11|#define PORT_Free PORT_Free_Util
  ------------------
 1376|     11|            PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|     11|#define PORT_SetError PORT_SetError_Util
  ------------------
 1377|     11|            return SECFailure;
 1378|     11|        }
 1379|    756|    }
 1380|     12|    if (db[dbMaskLen - saltLen - 1] != 0x01) {
  ------------------
  |  Branch (1380:9): [True: 0, False: 12]
  ------------------
 1381|      0|        PORT_Free(db);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1382|      0|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1383|      0|        return SECFailure;
 1384|      0|    }
 1385|       |
 1386|       |    /* Step 12 + 13 */
 1387|     12|    H_ = (unsigned char *)PORT_Alloc(hash->length);
  ------------------
  |  |   52|     12|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1388|     12|    if (H_ == NULL) {
  ------------------
  |  Branch (1388:9): [True: 0, False: 12]
  ------------------
 1389|      0|        PORT_Free(db);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1390|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1391|      0|        return SECFailure;
 1392|      0|    }
 1393|     12|    hash_context = (*hash->create)();
 1394|     12|    if (hash_context == NULL) {
  ------------------
  |  Branch (1394:9): [True: 0, False: 12]
  ------------------
 1395|      0|        PORT_Free(db);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1396|      0|        PORT_Free(H_);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1397|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1398|      0|        return SECFailure;
 1399|      0|    }
 1400|     12|    (*hash->begin)(hash_context);
 1401|     12|    (*hash->update)(hash_context, eightZeros, 8);
 1402|     12|    (*hash->update)(hash_context, mHash, hash->length);
 1403|     12|    (*hash->update)(hash_context, &db[dbMaskLen - saltLen], saltLen);
 1404|     12|    (*hash->end)(hash_context, H_, &i, hash->length);
 1405|     12|    (*hash->destroy)(hash_context, PR_TRUE);
  ------------------
  |  |  437|     12|#define PR_TRUE 1
  ------------------
 1406|       |
 1407|     12|    PORT_Free(db);
  ------------------
  |  |   60|     12|#define PORT_Free PORT_Free_Util
  ------------------
 1408|       |
 1409|       |    /* Step 14 */
 1410|     12|    if (PORT_Memcmp(H_, &em[dbMaskLen], hash->length) != 0) {
  ------------------
  |  |  179|     12|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (1410:9): [True: 12, False: 0]
  ------------------
 1411|     12|        PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|     12|#define PORT_SetError PORT_SetError_Util
  ------------------
 1412|     12|        rv = SECFailure;
 1413|     12|    } else {
 1414|      0|        rv = SECSuccess;
 1415|      0|    }
 1416|       |
 1417|     12|    PORT_Free(H_);
  ------------------
  |  |   60|     12|#define PORT_Free PORT_Free_Util
  ------------------
 1418|     12|    return rv;
 1419|     12|}

SHA256_Compress_Native:
   55|  97.4k|{
   56|  97.4k|    __m128i h0, h1, th;
   57|  97.4k|    __m128i a, b, c, d;
   58|  97.4k|    __m128i w0, w1;
   59|  97.4k|    const __m128i shuffle = _mm_set_epi8(12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3);
   60|       |
   61|  97.4k|    const __m128i *K = (__m128i *)K256;
   62|  97.4k|    const __m128i k0 = _mm_load_si128(K);
   63|  97.4k|    const __m128i k1 = _mm_load_si128(K + 1);
   64|  97.4k|    const __m128i k2 = _mm_load_si128(K + 2);
   65|  97.4k|    const __m128i k3 = _mm_load_si128(K + 3);
   66|  97.4k|    const __m128i k4 = _mm_load_si128(K + 4);
   67|  97.4k|    const __m128i k5 = _mm_load_si128(K + 5);
   68|  97.4k|    const __m128i k6 = _mm_load_si128(K + 6);
   69|  97.4k|    const __m128i k7 = _mm_load_si128(K + 7);
   70|  97.4k|    const __m128i k8 = _mm_load_si128(K + 8);
   71|  97.4k|    const __m128i k9 = _mm_load_si128(K + 9);
   72|  97.4k|    const __m128i k10 = _mm_load_si128(K + 10);
   73|  97.4k|    const __m128i k11 = _mm_load_si128(K + 11);
   74|  97.4k|    const __m128i k12 = _mm_load_si128(K + 12);
   75|  97.4k|    const __m128i k13 = _mm_load_si128(K + 13);
   76|  97.4k|    const __m128i k14 = _mm_load_si128(K + 14);
   77|  97.4k|    const __m128i k15 = _mm_load_si128(K + 15);
   78|       |
   79|  97.4k|    const __m128i *input = (__m128i *)ctx->u.b;
   80|       |
   81|  97.4k|    h0 = _mm_loadu_si128((__m128i *)(ctx->h));
   82|  97.4k|    h1 = _mm_loadu_si128((__m128i *)(ctx->h + 4));
   83|       |
   84|       |    /* H0123:4567 -> H01256:H2367 */
   85|  97.4k|    th = _mm_shuffle_epi32(h0, 0xb1);
   86|  97.4k|    h1 = _mm_shuffle_epi32(h1, 0x1b);
   87|  97.4k|    h0 = _mm_alignr_epi8(th, h1, 8);
   88|  97.4k|    h1 = _mm_blend_epi16(h1, th, 0xf0);
   89|       |
   90|  97.4k|    a = _mm_shuffle_epi8(_mm_loadu_si128(input), shuffle);
   91|  97.4k|    b = _mm_shuffle_epi8(_mm_loadu_si128(input + 1), shuffle);
   92|  97.4k|    c = _mm_shuffle_epi8(_mm_loadu_si128(input + 2), shuffle);
   93|  97.4k|    d = _mm_shuffle_epi8(_mm_loadu_si128(input + 3), shuffle);
   94|       |
   95|  97.4k|    w0 = h0;
   96|  97.4k|    w1 = h1;
   97|       |
   98|  97.4k|    ROUND(0, a, b, c, d)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
   99|  97.4k|    ROUND(1, b, c, d, a)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  100|  97.4k|    ROUND(2, c, d, a, b)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  101|  97.4k|    ROUND(3, d, a, b, c)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  102|  97.4k|    ROUND(4, a, b, c, d)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  103|  97.4k|    ROUND(5, b, c, d, a)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  104|  97.4k|    ROUND(6, c, d, a, b)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  105|  97.4k|    ROUND(7, d, a, b, c)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  106|  97.4k|    ROUND(8, a, b, c, d)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  107|  97.4k|    ROUND(9, b, c, d, a)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  108|  97.4k|    ROUND(10, c, d, a, b)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  109|  97.4k|    ROUND(11, d, a, b, c)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|  97.4k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|  97.4k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|  97.4k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|  97.4k|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  110|  97.4k|    ROUND(12, a, b, c, d)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|      0|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|      0|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|      0|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|      0|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  111|  97.4k|    ROUND(13, b, c, d, a)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|      0|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|      0|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|      0|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|      0|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  112|  97.4k|    ROUND(14, c, d, a, b)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|      0|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|      0|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|      0|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|      0|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  113|  97.4k|    ROUND(15, d, a, b, c)
  ------------------
  |  |   41|  97.4k|    {                                                       \
  |  |   42|  97.4k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|  97.4k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|  97.4k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|  97.4k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|  97.4k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|      0|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|      0|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|      0|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|      0|        }                                                   \
  |  |   51|  97.4k|    }
  ------------------
  114|       |
  115|  97.4k|    h0 = _mm_add_epi32(h0, w0);
  116|  97.4k|    h1 = _mm_add_epi32(h1, w1);
  117|       |
  118|       |    /* H0145:2367 -> H0123:4567 */
  119|  97.4k|    th = _mm_shuffle_epi32(h0, 0x1b);
  120|  97.4k|    h1 = _mm_shuffle_epi32(h1, 0xb1);
  121|  97.4k|    h0 = _mm_blend_epi16(th, h1, 0xf0);
  122|  97.4k|    h1 = _mm_alignr_epi8(h1, th, 8);
  123|       |
  124|  97.4k|    _mm_storeu_si128((__m128i *)ctx->h, h0);
  125|  97.4k|    _mm_storeu_si128((__m128i *)(ctx->h + 4), h1);
  126|  97.4k|}
SHA256_Update_Native:
  131|   266k|{
  132|   266k|    __m128i h0, h1, th;
  133|   266k|    const __m128i shuffle = _mm_set_epi8(12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3);
  134|       |
  135|   266k|    const __m128i *K = (__m128i *)K256;
  136|   266k|    const __m128i k0 = _mm_load_si128(K);
  137|   266k|    const __m128i k1 = _mm_load_si128(K + 1);
  138|   266k|    const __m128i k2 = _mm_load_si128(K + 2);
  139|   266k|    const __m128i k3 = _mm_load_si128(K + 3);
  140|   266k|    const __m128i k4 = _mm_load_si128(K + 4);
  141|   266k|    const __m128i k5 = _mm_load_si128(K + 5);
  142|   266k|    const __m128i k6 = _mm_load_si128(K + 6);
  143|   266k|    const __m128i k7 = _mm_load_si128(K + 7);
  144|   266k|    const __m128i k8 = _mm_load_si128(K + 8);
  145|   266k|    const __m128i k9 = _mm_load_si128(K + 9);
  146|   266k|    const __m128i k10 = _mm_load_si128(K + 10);
  147|   266k|    const __m128i k11 = _mm_load_si128(K + 11);
  148|   266k|    const __m128i k12 = _mm_load_si128(K + 12);
  149|   266k|    const __m128i k13 = _mm_load_si128(K + 13);
  150|   266k|    const __m128i k14 = _mm_load_si128(K + 14);
  151|   266k|    const __m128i k15 = _mm_load_si128(K + 15);
  152|       |
  153|   266k|    unsigned int inBuf = ctx->sizeLo & 0x3f;
  154|   266k|    if (!inputLen) {
  ------------------
  |  Branch (154:9): [True: 1.59k, False: 264k]
  ------------------
  155|  1.59k|        return;
  156|  1.59k|    }
  157|       |
  158|       |    /* Add inputLen into the count of bytes processed, before processing */
  159|   264k|    if ((ctx->sizeLo += inputLen) < inputLen) {
  ------------------
  |  Branch (159:9): [True: 0, False: 264k]
  ------------------
  160|      0|        ctx->sizeHi++;
  161|      0|    }
  162|       |
  163|       |    /* if data already in buffer, attempt to fill rest of buffer */
  164|   264k|    if (inBuf) {
  ------------------
  |  Branch (164:9): [True: 110k, False: 154k]
  ------------------
  165|   110k|        unsigned int todo = SHA256_BLOCK_LENGTH - inBuf;
  ------------------
  |  |  120|   110k|#define SHA256_BLOCK_LENGTH 64    /* bytes */
  ------------------
  166|   110k|        if (inputLen < todo) {
  ------------------
  |  Branch (166:13): [True: 94.6k, False: 15.4k]
  ------------------
  167|  94.6k|            todo = inputLen;
  168|  94.6k|        }
  169|   110k|        memcpy(ctx->u.b + inBuf, input, todo);
  170|   110k|        input += todo;
  171|   110k|        inputLen -= todo;
  172|   110k|        if (inBuf + todo == SHA256_BLOCK_LENGTH) {
  ------------------
  |  |  120|   110k|#define SHA256_BLOCK_LENGTH 64    /* bytes */
  ------------------
  |  Branch (172:13): [True: 15.4k, False: 94.6k]
  ------------------
  173|  15.4k|            SHA256_Compress_Native(ctx);
  174|  15.4k|        }
  175|   110k|    }
  176|       |
  177|   264k|    h0 = _mm_loadu_si128((__m128i *)(ctx->h));
  178|   264k|    h1 = _mm_loadu_si128((__m128i *)(ctx->h + 4));
  179|       |
  180|       |    /* H0123:4567 -> H01256:H2367 */
  181|   264k|    th = _mm_shuffle_epi32(h0, 0xb1);
  182|   264k|    h1 = _mm_shuffle_epi32(h1, 0x1b);
  183|   264k|    h0 = _mm_alignr_epi8(th, h1, 8);
  184|   264k|    h1 = _mm_blend_epi16(h1, th, 0xf0);
  185|       |
  186|       |    /* if enough data to fill one or more whole buffers, process them. */
  187|   408k|    while (inputLen >= SHA256_BLOCK_LENGTH) {
  ------------------
  |  |  120|   408k|#define SHA256_BLOCK_LENGTH 64    /* bytes */
  ------------------
  |  Branch (187:12): [True: 143k, False: 264k]
  ------------------
  188|   143k|        __m128i a, b, c, d;
  189|   143k|        __m128i w0, w1;
  190|   143k|        a = _mm_shuffle_epi8(_mm_loadu_si128((__m128i *)input), shuffle);
  191|   143k|        b = _mm_shuffle_epi8(_mm_loadu_si128((__m128i *)(input + 16)), shuffle);
  192|   143k|        c = _mm_shuffle_epi8(_mm_loadu_si128((__m128i *)(input + 32)), shuffle);
  193|   143k|        d = _mm_shuffle_epi8(_mm_loadu_si128((__m128i *)(input + 48)), shuffle);
  194|   143k|        input += SHA256_BLOCK_LENGTH;
  ------------------
  |  |  120|   143k|#define SHA256_BLOCK_LENGTH 64    /* bytes */
  ------------------
  195|   143k|        inputLen -= SHA256_BLOCK_LENGTH;
  ------------------
  |  |  120|   143k|#define SHA256_BLOCK_LENGTH 64    /* bytes */
  ------------------
  196|       |
  197|   143k|        w0 = h0;
  198|   143k|        w1 = h1;
  199|       |
  200|   143k|        ROUND(0, a, b, c, d)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  201|   143k|        ROUND(1, b, c, d, a)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  202|   143k|        ROUND(2, c, d, a, b)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  203|   143k|        ROUND(3, d, a, b, c)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  204|   143k|        ROUND(4, a, b, c, d)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  205|   143k|        ROUND(5, b, c, d, a)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  206|   143k|        ROUND(6, c, d, a, b)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  207|   143k|        ROUND(7, d, a, b, c)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  208|   143k|        ROUND(8, a, b, c, d)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  209|   143k|        ROUND(9, b, c, d, a)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  210|   143k|        ROUND(10, c, d, a, b)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  211|   143k|        ROUND(11, d, a, b, c)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|   143k|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|   143k|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|   143k|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|   143k|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  212|   143k|        ROUND(12, a, b, c, d)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|      0|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|      0|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|      0|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|      0|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  213|   143k|        ROUND(13, b, c, d, a)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|      0|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|      0|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|      0|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|      0|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  214|   143k|        ROUND(14, c, d, a, b)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|      0|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|      0|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|      0|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|      0|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  215|   143k|        ROUND(15, d, a, b, c)
  ------------------
  |  |   41|   143k|    {                                                       \
  |  |   42|   143k|        __m128i t = _mm_add_epi32(a, k##n);                 \
  |  |   43|   143k|        w1 = _mm_sha256rnds2_epu32(w1, w0, t);              \
  |  |   44|   143k|        t = _mm_shuffle_epi32(t, 0x0e);                     \
  |  |   45|   143k|        w0 = _mm_sha256rnds2_epu32(w0, w1, t);              \
  |  |   46|   143k|        if (n < 12) {                                       \
  |  |  ------------------
  |  |  |  Branch (46:13): [Folded - Ignored]
  |  |  ------------------
  |  |   47|      0|            a = _mm_sha256msg1_epu32(a, b);                 \
  |  |   48|      0|            a = _mm_add_epi32(a, _mm_alignr_epi8(d, c, 4)); \
  |  |   49|      0|            a = _mm_sha256msg2_epu32(a, d);                 \
  |  |   50|      0|        }                                                   \
  |  |   51|   143k|    }
  ------------------
  216|       |
  217|   143k|        h0 = _mm_add_epi32(h0, w0);
  218|   143k|        h1 = _mm_add_epi32(h1, w1);
  219|   143k|    }
  220|       |
  221|       |    // H01234567 -> H01256 and H2367
  222|   264k|    th = _mm_shuffle_epi32(h0, 0x1b);
  223|   264k|    h1 = _mm_shuffle_epi32(h1, 0xb1);
  224|   264k|    h0 = _mm_blend_epi16(th, h1, 0xf0);
  225|   264k|    h1 = _mm_alignr_epi8(h1, th, 8);
  226|       |
  227|   264k|    _mm_storeu_si128((__m128i *)ctx->h, h0);
  228|   264k|    _mm_storeu_si128((__m128i *)(ctx->h + 4), h1);
  229|       |
  230|       |    /* if data left over, fill it into buffer */
  231|   264k|    if (inputLen) {
  ------------------
  |  Branch (231:9): [True: 96.7k, False: 167k]
  ------------------
  232|  96.7k|        memcpy(ctx->u.b, input, inputLen);
  233|  96.7k|    }
  234|   264k|}

SHA256_NewContext:
  186|  29.3k|{
  187|  29.3k|    SHA256Context *ctx = PORT_New(SHA256Context);
  ------------------
  |  |  151|  29.3k|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|  29.3k|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
  188|  29.3k|    return ctx;
  189|  29.3k|}
SHA256_DestroyContext:
  193|  29.3k|{
  194|  29.3k|    memset(ctx, 0, sizeof *ctx);
  195|  29.3k|    if (freeit) {
  ------------------
  |  Branch (195:9): [True: 29.3k, False: 0]
  ------------------
  196|  29.3k|        PORT_Free(ctx);
  ------------------
  |  |   60|  29.3k|#define PORT_Free PORT_Free_Util
  ------------------
  197|  29.3k|    }
  198|  29.3k|}
SHA256_Begin:
  202|  84.6k|{
  203|  84.6k|    PRBool use_hw_sha2 = PR_FALSE;
  ------------------
  |  |  438|  84.6k|#define PR_FALSE 0
  ------------------
  204|       |
  205|  84.6k|    memset(ctx, 0, sizeof *ctx);
  206|  84.6k|    memcpy(H, H256, sizeof H256);
  ------------------
  |  |   31|  84.6k|#define H ctx->h
  ------------------
  207|       |
  208|  84.6k|#if defined(USE_HW_SHA2) && defined(IS_LITTLE_ENDIAN)
  209|       |    /* arm's implementation is tested on little endian only */
  210|  84.6k|    use_hw_sha2 = arm_sha2_support() || (sha_support() && ssse3_support() && sse4_1_support());
  ------------------
  |  Branch (210:19): [True: 0, False: 84.6k]
  |  Branch (210:42): [True: 84.6k, False: 0]
  |  Branch (210:59): [True: 84.6k, False: 0]
  |  Branch (210:78): [True: 84.6k, False: 0]
  ------------------
  211|  84.6k|#endif
  212|       |
  213|  84.6k|    if (use_hw_sha2) {
  ------------------
  |  Branch (213:9): [True: 84.6k, False: 0]
  ------------------
  214|  84.6k|        ctx->compress = SHA256_Compress_Native;
  215|  84.6k|        ctx->update = SHA256_Update_Native;
  216|  84.6k|    } else {
  217|      0|        ctx->compress = SHA256_Compress_Generic;
  218|      0|        ctx->update = SHA256_Update_Generic;
  219|      0|    }
  220|  84.6k|}
SHA256_Update:
  517|   184k|{
  518|   184k|    ctx->update(ctx, input, inputLen);
  519|   184k|}
SHA256_End:
  560|  81.9k|{
  561|  81.9k|    unsigned int inBuf = ctx->sizeLo & 0x3f;
  562|  81.9k|    unsigned int padLen = (inBuf < 56) ? (56 - inBuf) : (56 + 64 - inBuf);
  ------------------
  |  Branch (562:27): [True: 81.1k, False: 795]
  ------------------
  563|  81.9k|    PRUint32 hi, lo;
  564|       |
  565|  81.9k|    hi = (ctx->sizeHi << 3) | (ctx->sizeLo >> 29);
  566|  81.9k|    lo = (ctx->sizeLo << 3);
  567|       |
  568|  81.9k|    ctx->update(ctx, pad, padLen);
  569|       |
  570|  81.9k|#if defined(IS_LITTLE_ENDIAN)
  571|  81.9k|    W[14] = SHA_HTONL(hi);
  ------------------
  |  |   29|  81.9k|#define W ctx->u.w
  ------------------
                  W[14] = SHA_HTONL(hi);
  ------------------
  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  ------------------
  572|  81.9k|    W[15] = SHA_HTONL(lo);
  ------------------
  |  |   29|  81.9k|#define W ctx->u.w
  ------------------
                  W[15] = SHA_HTONL(lo);
  ------------------
  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  ------------------
  573|       |#else
  574|       |    W[14] = hi;
  575|       |    W[15] = lo;
  576|       |#endif
  577|  81.9k|    ctx->compress(ctx);
  578|       |
  579|       |/* now output the answer */
  580|  81.9k|#if defined(IS_LITTLE_ENDIAN)
  581|  81.9k|    BYTESWAP4(H[0]);
  ------------------
  |  |  142|  81.9k|#define BYTESWAP4(x) x = SHA_HTONL(x)
  |  |  ------------------
  |  |  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  582|  81.9k|    BYTESWAP4(H[1]);
  ------------------
  |  |  142|  81.9k|#define BYTESWAP4(x) x = SHA_HTONL(x)
  |  |  ------------------
  |  |  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  583|  81.9k|    BYTESWAP4(H[2]);
  ------------------
  |  |  142|  81.9k|#define BYTESWAP4(x) x = SHA_HTONL(x)
  |  |  ------------------
  |  |  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  584|  81.9k|    BYTESWAP4(H[3]);
  ------------------
  |  |  142|  81.9k|#define BYTESWAP4(x) x = SHA_HTONL(x)
  |  |  ------------------
  |  |  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  585|  81.9k|    BYTESWAP4(H[4]);
  ------------------
  |  |  142|  81.9k|#define BYTESWAP4(x) x = SHA_HTONL(x)
  |  |  ------------------
  |  |  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  586|  81.9k|    BYTESWAP4(H[5]);
  ------------------
  |  |  142|  81.9k|#define BYTESWAP4(x) x = SHA_HTONL(x)
  |  |  ------------------
  |  |  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  587|  81.9k|    BYTESWAP4(H[6]);
  ------------------
  |  |  142|  81.9k|#define BYTESWAP4(x) x = SHA_HTONL(x)
  |  |  ------------------
  |  |  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  588|  81.9k|    BYTESWAP4(H[7]);
  ------------------
  |  |  142|  81.9k|#define BYTESWAP4(x) x = SHA_HTONL(x)
  |  |  ------------------
  |  |  |  |  108|  81.9k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  589|  81.9k|#endif
  590|  81.9k|    padLen = PR_MIN(SHA256_LENGTH, maxDigestLen);
  ------------------
  |  |  158|  81.9k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 61.1k, False: 20.7k]
  |  |  ------------------
  ------------------
  591|  81.9k|    memcpy(digest, H, padLen);
  ------------------
  |  |   31|  81.9k|#define H ctx->h
  ------------------
  592|  81.9k|    if (digestLen)
  ------------------
  |  Branch (592:9): [True: 81.9k, False: 0]
  ------------------
  593|  81.9k|        *digestLen = padLen;
  594|  81.9k|}
SHA256_FlattenSize:
  650|  11.9k|{
  651|  11.9k|    return sizeof *ctx;
  652|  11.9k|}
SHA512_NewContext:
  962|  21.0k|{
  963|  21.0k|    SHA512Context *ctx = PORT_New(SHA512Context);
  ------------------
  |  |  151|  21.0k|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|  21.0k|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
  964|  21.0k|    return ctx;
  965|  21.0k|}
SHA512_DestroyContext:
  969|  21.0k|{
  970|  21.0k|    memset(ctx, 0, sizeof *ctx);
  971|  21.0k|    if (freeit) {
  ------------------
  |  Branch (971:9): [True: 21.0k, False: 0]
  ------------------
  972|  21.0k|        PORT_Free(ctx);
  ------------------
  |  |   60|  21.0k|#define PORT_Free PORT_Free_Util
  ------------------
  973|  21.0k|    }
  974|  21.0k|}
SHA512_Begin:
  978|    511|{
  979|    511|    memset(ctx, 0, sizeof *ctx);
  980|    511|    memcpy(H, H512, sizeof H512);
  ------------------
  |  |   31|    511|#define H ctx->h
  ------------------
  981|    511|}
SHA512_Update:
 1340|   109k|{
 1341|   109k|    unsigned int inBuf;
 1342|   109k|    if (!inputLen)
  ------------------
  |  Branch (1342:9): [True: 136, False: 109k]
  ------------------
 1343|    136|        return;
 1344|       |
 1345|   109k|#if defined(HAVE_LONG_LONG)
 1346|   109k|    inBuf = (unsigned int)ctx->sizeLo & 0x7f;
 1347|       |    /* Add inputLen into the count of bytes processed, before processing */
 1348|   109k|    ctx->sizeLo += inputLen;
 1349|       |#else
 1350|       |    inBuf = (unsigned int)ctx->sizeLo.lo & 0x7f;
 1351|       |    ctx->sizeLo.lo += inputLen;
 1352|       |    if (ctx->sizeLo.lo < inputLen)
 1353|       |        ctx->sizeLo.hi++;
 1354|       |#endif
 1355|       |
 1356|       |    /* if data already in buffer, attemp to fill rest of buffer */
 1357|   109k|    if (inBuf) {
  ------------------
  |  Branch (1357:9): [True: 44.2k, False: 65.0k]
  ------------------
 1358|  44.2k|        unsigned int todo = SHA512_BLOCK_LENGTH - inBuf;
  ------------------
  |  |  122|  44.2k|#define SHA512_BLOCK_LENGTH 128   /* bytes */
  ------------------
 1359|  44.2k|        if (inputLen < todo)
  ------------------
  |  Branch (1359:13): [True: 39.7k, False: 4.44k]
  ------------------
 1360|  39.7k|            todo = inputLen;
 1361|  44.2k|        memcpy(B + inBuf, input, todo);
  ------------------
  |  |   30|  44.2k|#define B ctx->u.b
  ------------------
 1362|  44.2k|        input += todo;
 1363|  44.2k|        inputLen -= todo;
 1364|  44.2k|        if (inBuf + todo == SHA512_BLOCK_LENGTH)
  ------------------
  |  |  122|  44.2k|#define SHA512_BLOCK_LENGTH 128   /* bytes */
  ------------------
  |  Branch (1364:13): [True: 4.44k, False: 39.7k]
  ------------------
 1365|  4.44k|            SHA512_Compress(ctx);
 1366|  44.2k|    }
 1367|       |
 1368|       |    /* if enough data to fill one or more whole buffers, process them. */
 1369|   148k|    while (inputLen >= SHA512_BLOCK_LENGTH) {
  ------------------
  |  |  122|   148k|#define SHA512_BLOCK_LENGTH 128   /* bytes */
  ------------------
  |  Branch (1369:12): [True: 38.7k, False: 109k]
  ------------------
 1370|  38.7k|        memcpy(B, input, SHA512_BLOCK_LENGTH);
  ------------------
  |  |   30|  38.7k|#define B ctx->u.b
  ------------------
                      memcpy(B, input, SHA512_BLOCK_LENGTH);
  ------------------
  |  |  122|  38.7k|#define SHA512_BLOCK_LENGTH 128   /* bytes */
  ------------------
 1371|  38.7k|        input += SHA512_BLOCK_LENGTH;
  ------------------
  |  |  122|  38.7k|#define SHA512_BLOCK_LENGTH 128   /* bytes */
  ------------------
 1372|  38.7k|        inputLen -= SHA512_BLOCK_LENGTH;
  ------------------
  |  |  122|  38.7k|#define SHA512_BLOCK_LENGTH 128   /* bytes */
  ------------------
 1373|  38.7k|        SHA512_Compress(ctx);
 1374|  38.7k|    }
 1375|       |    /* if data left over, fill it into buffer */
 1376|   109k|    if (inputLen)
  ------------------
  |  Branch (1376:9): [True: 40.6k, False: 68.6k]
  ------------------
 1377|  40.6k|        memcpy(B, input, inputLen);
  ------------------
  |  |   30|  40.6k|#define B ctx->u.b
  ------------------
 1378|   109k|}
SHA512_End:
 1383|  36.2k|{
 1384|  36.2k|#if defined(HAVE_LONG_LONG)
 1385|  36.2k|    unsigned int inBuf = (unsigned int)ctx->sizeLo & 0x7f;
 1386|       |#else
 1387|       |    unsigned int inBuf = (unsigned int)ctx->sizeLo.lo & 0x7f;
 1388|       |#endif
 1389|  36.2k|    unsigned int padLen = (inBuf < 112) ? (112 - inBuf) : (112 + 128 - inBuf);
  ------------------
  |  Branch (1389:27): [True: 34.9k, False: 1.28k]
  ------------------
 1390|  36.2k|    PRUint64 lo;
 1391|  36.2k|    LL_SHL(lo, ctx->sizeLo, 3);
  ------------------
  |  |  127|  36.2k|#define LL_SHL(r, a, b)     ((r) = (PRInt64)(a) << (b))
  ------------------
 1392|       |
 1393|  36.2k|    SHA512_Update(ctx, pad, padLen);
 1394|       |
 1395|  36.2k|#if defined(HAVE_LONG_LONG)
 1396|  36.2k|    W[14] = 0;
  ------------------
  |  |   29|  36.2k|#define W ctx->u.w
  ------------------
 1397|       |#else
 1398|       |    W[14].lo = 0;
 1399|       |    W[14].hi = 0;
 1400|       |#endif
 1401|       |
 1402|  36.2k|    W[15] = lo;
  ------------------
  |  |   29|  36.2k|#define W ctx->u.w
  ------------------
 1403|  36.2k|#if defined(IS_LITTLE_ENDIAN)
 1404|  36.2k|    BYTESWAP8(W[15]);
  ------------------
  |  |  810|  36.2k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  36.2k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1405|  36.2k|#endif
 1406|  36.2k|    SHA512_Compress(ctx);
 1407|       |
 1408|       |/* now output the answer */
 1409|  36.2k|#if defined(IS_LITTLE_ENDIAN)
 1410|  36.2k|    BYTESWAP8(H[0]);
  ------------------
  |  |  810|  36.2k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  36.2k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1411|  36.2k|    BYTESWAP8(H[1]);
  ------------------
  |  |  810|  36.2k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  36.2k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1412|  36.2k|    BYTESWAP8(H[2]);
  ------------------
  |  |  810|  36.2k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  36.2k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1413|  36.2k|    BYTESWAP8(H[3]);
  ------------------
  |  |  810|  36.2k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  36.2k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1414|  36.2k|    BYTESWAP8(H[4]);
  ------------------
  |  |  810|  36.2k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  36.2k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1415|  36.2k|    BYTESWAP8(H[5]);
  ------------------
  |  |  810|  36.2k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  36.2k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1416|  36.2k|    BYTESWAP8(H[6]);
  ------------------
  |  |  810|  36.2k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  36.2k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1417|  36.2k|    BYTESWAP8(H[7]);
  ------------------
  |  |  810|  36.2k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  36.2k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1418|  36.2k|#endif
 1419|  36.2k|    padLen = PR_MIN(SHA512_LENGTH, maxDigestLen);
  ------------------
  |  |  158|  36.2k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 36.2k]
  |  |  ------------------
  ------------------
 1420|  36.2k|    memcpy(digest, H, padLen);
  ------------------
  |  |   31|  36.2k|#define H ctx->h
  ------------------
 1421|  36.2k|    if (digestLen)
  ------------------
  |  Branch (1421:9): [True: 36.2k, False: 0]
  ------------------
 1422|  36.2k|        *digestLen = padLen;
 1423|  36.2k|}
SHA512_FlattenSize:
 1478|    504|{
 1479|    504|    return sizeof *ctx;
 1480|    504|}
SHA384_NewContext:
 1528|  20.5k|{
 1529|  20.5k|    return SHA512_NewContext();
 1530|  20.5k|}
SHA384_DestroyContext:
 1534|  20.5k|{
 1535|  20.5k|    SHA512_DestroyContext(ctx, freeit);
 1536|  20.5k|}
SHA384_Begin:
 1540|  36.0k|{
 1541|  36.0k|    memset(ctx, 0, sizeof *ctx);
 1542|  36.0k|    memcpy(H, H384, sizeof H384);
  ------------------
  |  |   31|  36.0k|#define H ctx->h
  ------------------
 1543|  36.0k|}
SHA384_Update:
 1548|  72.6k|{
 1549|  72.6k|    SHA512_Update(ctx, input, inputLen);
 1550|  72.6k|}
SHA384_End:
 1555|  35.7k|{
 1556|  35.7k|    unsigned int maxLen = SHA_MIN(maxDigestLen, SHA384_LENGTH);
  ------------------
  |  |   37|  35.7k|#define SHA_MIN(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (37:24): [True: 0, False: 35.7k]
  |  |  ------------------
  ------------------
 1557|  35.7k|    SHA512_End(ctx, digest, digestLen, maxLen);
 1558|  35.7k|}
SHA384_FlattenSize:
 1596|  7.17k|{
 1597|  7.17k|    return sizeof(SHA384Context);
 1598|  7.17k|}
sha512.c:swap4b:
  103|   819k|{
  104|   819k|    __asm__("bswap %0"
  105|   819k|            : "+r"(value));
  106|   819k|    return (value);
  107|   819k|}
sha512.c:SHA512_Compress:
 1086|  79.4k|{
 1087|       |#if defined(USE_PPC_CRYPTO)
 1088|       |    sha512_block_p8(&H[0], &W[0], 1);
 1089|       |#else /* USE_PPC_CRYPTO */
 1090|       |
 1091|  79.4k|#if defined(IS_LITTLE_ENDIAN)
 1092|  79.4k|    {
 1093|  79.4k|        BYTESWAP8(W[0]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1094|  79.4k|        BYTESWAP8(W[1]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1095|  79.4k|        BYTESWAP8(W[2]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1096|  79.4k|        BYTESWAP8(W[3]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1097|  79.4k|        BYTESWAP8(W[4]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1098|  79.4k|        BYTESWAP8(W[5]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1099|  79.4k|        BYTESWAP8(W[6]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1100|  79.4k|        BYTESWAP8(W[7]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1101|  79.4k|        BYTESWAP8(W[8]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1102|  79.4k|        BYTESWAP8(W[9]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1103|  79.4k|        BYTESWAP8(W[10]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1104|  79.4k|        BYTESWAP8(W[11]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1105|  79.4k|        BYTESWAP8(W[12]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1106|  79.4k|        BYTESWAP8(W[13]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1107|  79.4k|        BYTESWAP8(W[14]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1108|  79.4k|        BYTESWAP8(W[15]);
  ------------------
  |  |  810|  79.4k|#define BYTESWAP8(x) x = FREEBL_HTONLL(x)
  |  |  ------------------
  |  |  |  |   46|  79.4k|#define FREEBL_HTONLL(x) __builtin_bswap64(x)
  |  |  ------------------
  ------------------
 1109|  79.4k|    }
 1110|  79.4k|#endif
 1111|       |
 1112|  79.4k|    {
 1113|       |#ifdef NOUNROLL512
 1114|       |        {
 1115|       |            /* prepare the "message schedule"   */
 1116|       |            int t;
 1117|       |            for (t = 16; t < 80; ++t) {
 1118|       |                INITW(t);
 1119|       |            }
 1120|       |        }
 1121|       |#else
 1122|  79.4k|        INITW(16);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1123|  79.4k|        INITW(17);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1124|  79.4k|        INITW(18);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1125|  79.4k|        INITW(19);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1126|       |
 1127|  79.4k|        INITW(20);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1128|  79.4k|        INITW(21);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1129|  79.4k|        INITW(22);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1130|  79.4k|        INITW(23);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1131|  79.4k|        INITW(24);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1132|  79.4k|        INITW(25);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1133|  79.4k|        INITW(26);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1134|  79.4k|        INITW(27);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1135|  79.4k|        INITW(28);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1136|  79.4k|        INITW(29);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1137|       |
 1138|  79.4k|        INITW(30);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1139|  79.4k|        INITW(31);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1140|  79.4k|        INITW(32);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1141|  79.4k|        INITW(33);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1142|  79.4k|        INITW(34);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1143|  79.4k|        INITW(35);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1144|  79.4k|        INITW(36);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1145|  79.4k|        INITW(37);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1146|  79.4k|        INITW(38);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1147|  79.4k|        INITW(39);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1148|       |
 1149|  79.4k|        INITW(40);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1150|  79.4k|        INITW(41);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1151|  79.4k|        INITW(42);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1152|  79.4k|        INITW(43);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1153|  79.4k|        INITW(44);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1154|  79.4k|        INITW(45);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1155|  79.4k|        INITW(46);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1156|  79.4k|        INITW(47);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1157|  79.4k|        INITW(48);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1158|  79.4k|        INITW(49);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1159|       |
 1160|  79.4k|        INITW(50);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1161|  79.4k|        INITW(51);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1162|  79.4k|        INITW(52);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1163|  79.4k|        INITW(53);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1164|  79.4k|        INITW(54);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1165|  79.4k|        INITW(55);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1166|  79.4k|        INITW(56);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1167|  79.4k|        INITW(57);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1168|  79.4k|        INITW(58);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1169|  79.4k|        INITW(59);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1170|       |
 1171|  79.4k|        INITW(60);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1172|  79.4k|        INITW(61);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1173|  79.4k|        INITW(62);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1174|  79.4k|        INITW(63);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1175|  79.4k|        INITW(64);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1176|  79.4k|        INITW(65);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1177|  79.4k|        INITW(66);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1178|  79.4k|        INITW(67);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1179|  79.4k|        INITW(68);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1180|  79.4k|        INITW(69);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1181|       |
 1182|  79.4k|        INITW(70);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1183|  79.4k|        INITW(71);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1184|  79.4k|        INITW(72);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1185|  79.4k|        INITW(73);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1186|  79.4k|        INITW(74);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1187|  79.4k|        INITW(75);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1188|  79.4k|        INITW(76);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1189|  79.4k|        INITW(77);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1190|  79.4k|        INITW(78);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1191|  79.4k|        INITW(79);
  ------------------
  |  |  999|  79.4k|#define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  800|  79.4k|#define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s1(x) (ROTR64(x, 19) ^ ROTR64(x, 61) ^ SHR(x, 6))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |  799|  79.4k|#define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define s0(x) (ROTR64(x, 1) ^ ROTR64(x, 8) ^ SHR(x, 7))
  |  |  |  |  ------------------
  |  |  |  |  |  |   33|  79.4k|#define SHR(x, n) (x >> n)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define INITW(t) W[t] = (s1(W[t - 2]) + W[t - 7] + s0(W[t - 15]) + W[t - 16])
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  ------------------
 1192|  79.4k|#endif
 1193|  79.4k|    }
 1194|       |#ifdef SHA512_TRACE
 1195|       |    {
 1196|       |        int i;
 1197|       |        for (i = 0; i < 80; ++i) {
 1198|       |#ifdef HAVE_LONG_LONG
 1199|       |            printf("W[%2d] = %016lx\n", i, W[i]);
 1200|       |#else
 1201|       |            printf("W[%2d] = %08x%08x\n", i, W[i].hi, W[i].lo);
 1202|       |#endif
 1203|       |        }
 1204|       |    }
 1205|       |#endif
 1206|  79.4k|    {
 1207|  79.4k|        PRUint64 a, b, c, d, e, f, g, h;
 1208|       |
 1209|  79.4k|        a = H[0];
  ------------------
  |  |   31|  79.4k|#define H ctx->h
  ------------------
 1210|  79.4k|        b = H[1];
  ------------------
  |  |   31|  79.4k|#define H ctx->h
  ------------------
 1211|  79.4k|        c = H[2];
  ------------------
  |  |   31|  79.4k|#define H ctx->h
  ------------------
 1212|  79.4k|        d = H[3];
  ------------------
  |  |   31|  79.4k|#define H ctx->h
  ------------------
 1213|  79.4k|        e = H[4];
  ------------------
  |  |   31|  79.4k|#define H ctx->h
  ------------------
 1214|  79.4k|        f = H[5];
  ------------------
  |  |   31|  79.4k|#define H ctx->h
  ------------------
 1215|  79.4k|        g = H[6];
  ------------------
  |  |   31|  79.4k|#define H ctx->h
  ------------------
 1216|  79.4k|        h = H[7];
  ------------------
  |  |   31|  79.4k|#define H ctx->h
  ------------------
 1217|       |
 1218|       |#ifdef NOUNROLL512
 1219|       |        {
 1220|       |            int t;
 1221|       |            for (t = 0; t < 80; t += 8) {
 1222|       |                ROUND(t + 0, a, b, c, d, e, f, g, h)
 1223|       |                ROUND(t + 1, h, a, b, c, d, e, f, g)
 1224|       |                ROUND(t + 2, g, h, a, b, c, d, e, f)
 1225|       |                ROUND(t + 3, f, g, h, a, b, c, d, e)
 1226|       |                ROUND(t + 4, e, f, g, h, a, b, c, d)
 1227|       |                ROUND(t + 5, d, e, f, g, h, a, b, c)
 1228|       |                ROUND(t + 6, c, d, e, f, g, h, a, b)
 1229|       |                ROUND(t + 7, b, c, d, e, f, g, h, a)
 1230|       |            }
 1231|       |        }
 1232|       |#else
 1233|  79.4k|        ROUND(0, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1234|  79.4k|        ROUND(1, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1235|  79.4k|        ROUND(2, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1236|  79.4k|        ROUND(3, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1237|  79.4k|        ROUND(4, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1238|  79.4k|        ROUND(5, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1239|  79.4k|        ROUND(6, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1240|  79.4k|        ROUND(7, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1241|       |
 1242|  79.4k|        ROUND(8, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1243|  79.4k|        ROUND(9, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1244|  79.4k|        ROUND(10, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1245|  79.4k|        ROUND(11, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1246|  79.4k|        ROUND(12, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1247|  79.4k|        ROUND(13, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1248|  79.4k|        ROUND(14, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1249|  79.4k|        ROUND(15, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1250|       |
 1251|  79.4k|        ROUND(16, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1252|  79.4k|        ROUND(17, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1253|  79.4k|        ROUND(18, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1254|  79.4k|        ROUND(19, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1255|  79.4k|        ROUND(20, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1256|  79.4k|        ROUND(21, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1257|  79.4k|        ROUND(22, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1258|  79.4k|        ROUND(23, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1259|       |
 1260|  79.4k|        ROUND(24, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1261|  79.4k|        ROUND(25, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1262|  79.4k|        ROUND(26, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1263|  79.4k|        ROUND(27, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1264|  79.4k|        ROUND(28, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1265|  79.4k|        ROUND(29, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1266|  79.4k|        ROUND(30, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1267|  79.4k|        ROUND(31, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1268|       |
 1269|  79.4k|        ROUND(32, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1270|  79.4k|        ROUND(33, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1271|  79.4k|        ROUND(34, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1272|  79.4k|        ROUND(35, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1273|  79.4k|        ROUND(36, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1274|  79.4k|        ROUND(37, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1275|  79.4k|        ROUND(38, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1276|  79.4k|        ROUND(39, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1277|       |
 1278|  79.4k|        ROUND(40, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1279|  79.4k|        ROUND(41, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1280|  79.4k|        ROUND(42, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1281|  79.4k|        ROUND(43, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1282|  79.4k|        ROUND(44, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1283|  79.4k|        ROUND(45, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1284|  79.4k|        ROUND(46, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1285|  79.4k|        ROUND(47, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1286|       |
 1287|  79.4k|        ROUND(48, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1288|  79.4k|        ROUND(49, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1289|  79.4k|        ROUND(50, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1290|  79.4k|        ROUND(51, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1291|  79.4k|        ROUND(52, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1292|  79.4k|        ROUND(53, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1293|  79.4k|        ROUND(54, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1294|  79.4k|        ROUND(55, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1295|       |
 1296|  79.4k|        ROUND(56, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1297|  79.4k|        ROUND(57, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1298|  79.4k|        ROUND(58, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1299|  79.4k|        ROUND(59, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1300|  79.4k|        ROUND(60, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1301|  79.4k|        ROUND(61, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1302|  79.4k|        ROUND(62, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1303|  79.4k|        ROUND(63, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1304|       |
 1305|  79.4k|        ROUND(64, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1306|  79.4k|        ROUND(65, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1307|  79.4k|        ROUND(66, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1308|  79.4k|        ROUND(67, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1309|  79.4k|        ROUND(68, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1310|  79.4k|        ROUND(69, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1311|  79.4k|        ROUND(70, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1312|  79.4k|        ROUND(71, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1313|       |
 1314|  79.4k|        ROUND(72, a, b, c, d, e, f, g, h)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1315|  79.4k|        ROUND(73, h, a, b, c, d, e, f, g)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1316|  79.4k|        ROUND(74, g, h, a, b, c, d, e, f)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1317|  79.4k|        ROUND(75, f, g, h, a, b, c, d, e)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1318|  79.4k|        ROUND(76, e, f, g, h, a, b, c, d)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1319|  79.4k|        ROUND(77, d, e, f, g, h, a, b, c)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1320|  79.4k|        ROUND(78, c, d, e, f, g, h, a, b)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1321|  79.4k|        ROUND(79, b, c, d, e, f, g, h, a)
  ------------------
  |  | 1002|  79.4k|    h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |  798|  79.4k|#define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S1(x) (ROTR64(x, 14) ^ ROTR64(x, 18) ^ ROTR64(x, 41))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   35|  79.4k|#define Ch(x, y, z) ((x & y) ^ (~x & z))
  |  |  ------------------
  |  |                   h += S1(e) + Ch(e, f, g) + K512[n] + W[n]; \
  |  |  ------------------
  |  |  |  |   29|  79.4k|#define W ctx->u.w
  |  |  ------------------
  |  | 1003|  79.4k|    d += h;                                    \
  |  | 1004|  79.4k|    h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |  797|  79.4k|#define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  |  |               #define S0(x) (ROTR64(x, 28) ^ ROTR64(x, 34) ^ ROTR64(x, 39))
  |  |  |  |  ------------------
  |  |  |  |  |  |   30|  79.4k|#define ROTR64(x, n) (((x) >> (n)) | ((x) << (64 - (n))))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   h += S0(a) + Maj(a, b, c);                 \
  |  |  ------------------
  |  |  |  |   36|  79.4k|#define Maj(x, y, z) ((x & y) ^ (x & z) ^ (y & z))
  |  |  ------------------
  |  | 1005|  79.4k|    DUMP(n, a, d, e, h)
  ------------------
 1322|  79.4k|#endif
 1323|       |
 1324|  79.4k|        ADDTO(a, H[0]);
  ------------------
  |  |  997|  79.4k|#define ADDTO(x, y) y += x
  ------------------
 1325|  79.4k|        ADDTO(b, H[1]);
  ------------------
  |  |  997|  79.4k|#define ADDTO(x, y) y += x
  ------------------
 1326|  79.4k|        ADDTO(c, H[2]);
  ------------------
  |  |  997|  79.4k|#define ADDTO(x, y) y += x
  ------------------
 1327|  79.4k|        ADDTO(d, H[3]);
  ------------------
  |  |  997|  79.4k|#define ADDTO(x, y) y += x
  ------------------
 1328|  79.4k|        ADDTO(e, H[4]);
  ------------------
  |  |  997|  79.4k|#define ADDTO(x, y) y += x
  ------------------
 1329|  79.4k|        ADDTO(f, H[5]);
  ------------------
  |  |  997|  79.4k|#define ADDTO(x, y) y += x
  ------------------
 1330|  79.4k|        ADDTO(g, H[6]);
  ------------------
  |  |  997|  79.4k|#define ADDTO(x, y) y += x
  ------------------
 1331|  79.4k|        ADDTO(h, H[7]);
  ------------------
  |  |  997|  79.4k|#define ADDTO(x, y) y += x
  ------------------
 1332|  79.4k|    }
 1333|       |
 1334|  79.4k|#endif /* !USE_PPC_CRYPTO */
 1335|  79.4k|}

SHA1_Begin:
   59|  25.2k|{
   60|  25.2k|    ctx->size = 0;
   61|       |    /*
   62|       |     *  Initialize H with constants from FIPS180-1.
   63|       |     */
   64|  25.2k|    ctx->H[0] = 0x67452301L;
   65|  25.2k|    ctx->H[1] = 0xefcdab89L;
   66|  25.2k|    ctx->H[2] = 0x98badcfeL;
   67|  25.2k|    ctx->H[3] = 0x10325476L;
   68|  25.2k|    ctx->H[4] = 0xc3d2e1f0L;
   69|       |
   70|       |#if defined(USE_HW_SHA1) && defined(IS_LITTLE_ENDIAN)
   71|       |    /* arm's implementation is tested on little endian only */
   72|       |    if (arm_sha1_support()) {
   73|       |        ctx->compress = SHA1_Compress_Native;
   74|       |        ctx->update = SHA1_Update_Native;
   75|       |    } else
   76|       |#endif
   77|  25.2k|    {
   78|  25.2k|        ctx->compress = SHA1_Compress_Generic;
   79|  25.2k|        ctx->update = SHA1_Update_Generic;
   80|  25.2k|    }
   81|  25.2k|}
SHA1_Update:
  126|  62.9k|{
  127|  62.9k|    ctx->update(ctx, dataIn, len);
  128|  62.9k|}
SHA1_End:
  187|  22.2k|{
  188|  22.2k|    register PRUint64 size;
  189|  22.2k|    register PRUint32 lenB;
  190|       |
  191|  22.2k|    static const unsigned char bulk_pad[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  192|  22.2k|                                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  193|  22.2k|                                                0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  194|  22.2k|#define tmp lenB
  195|       |
  196|  22.2k|    PORT_Assert(maxDigestLen >= SHA1_LENGTH);
  ------------------
  |  |  120|  22.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  22.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 22.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|       |
  198|       |    /*
  199|       |     *  Pad with a binary 1 (e.g. 0x80), then zeroes, then length in bits
  200|       |     */
  201|  22.2k|    size = ctx->size;
  202|       |
  203|  22.2k|    lenB = (PRUint32)size & 63;
  204|  22.2k|    SHA1_Update(ctx, bulk_pad, (((55 + 64) - lenB) & 63) + 1);
  205|  22.2k|    PORT_Assert(((PRUint32)ctx->size & 63) == 56);
  ------------------
  |  |  120|  22.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  22.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 22.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  206|       |    /* Convert size from bytes to bits. */
  207|  22.2k|    size <<= 3;
  208|  22.2k|    ctx->W[14] = SHA_HTONL((PRUint32)(size >> 32));
  ------------------
  |  |   22|  22.2k|#define W u.w
  ------------------
                  ctx->W[14] = SHA_HTONL((PRUint32)(size >> 32));
  ------------------
  |  |   97|  22.2k|#define SHA_HTONL(x) swap4b(x)
  ------------------
  209|  22.2k|    ctx->W[15] = SHA_HTONL((PRUint32)size);
  ------------------
  |  |   22|  22.2k|#define W u.w
  ------------------
                  ctx->W[15] = SHA_HTONL((PRUint32)size);
  ------------------
  |  |   97|  22.2k|#define SHA_HTONL(x) swap4b(x)
  ------------------
  210|  22.2k|    ctx->compress(ctx);
  211|       |
  212|       |    /*
  213|       |     *  Output hash
  214|       |     */
  215|  22.2k|    SHA_STORE_RESULT;
  ------------------
  |  |  149|  22.2k|    SHA_STORE(0);        \
  |  |  ------------------
  |  |  |  |  146|  22.2k|#define SHA_STORE(n) ((PRUint32 *)hashout)[n] = SHA_HTONL(ctx->H[n])
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  22.2k|#define SHA_HTONL(x) swap4b(x)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  150|  22.2k|    SHA_STORE(1);        \
  |  |  ------------------
  |  |  |  |  146|  22.2k|#define SHA_STORE(n) ((PRUint32 *)hashout)[n] = SHA_HTONL(ctx->H[n])
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  22.2k|#define SHA_HTONL(x) swap4b(x)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  151|  22.2k|    SHA_STORE(2);        \
  |  |  ------------------
  |  |  |  |  146|  22.2k|#define SHA_STORE(n) ((PRUint32 *)hashout)[n] = SHA_HTONL(ctx->H[n])
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  22.2k|#define SHA_HTONL(x) swap4b(x)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  152|  22.2k|    SHA_STORE(3);        \
  |  |  ------------------
  |  |  |  |  146|  22.2k|#define SHA_STORE(n) ((PRUint32 *)hashout)[n] = SHA_HTONL(ctx->H[n])
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  22.2k|#define SHA_HTONL(x) swap4b(x)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  22.2k|    SHA_STORE(4);
  |  |  ------------------
  |  |  |  |  146|  22.2k|#define SHA_STORE(n) ((PRUint32 *)hashout)[n] = SHA_HTONL(ctx->H[n])
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  22.2k|#define SHA_HTONL(x) swap4b(x)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  216|  22.2k|    if (pDigestLen) {
  ------------------
  |  Branch (216:9): [True: 22.2k, False: 0]
  ------------------
  217|  22.2k|        *pDigestLen = SHA1_LENGTH;
  ------------------
  |  |   39|  22.2k|#define SHA1_LENGTH 20
  ------------------
  218|  22.2k|    }
  219|  22.2k|#undef tmp
  220|  22.2k|}
SHA1_NewContext:
  516|  20.1k|{
  517|  20.1k|    SHA1Context *cx;
  518|       |
  519|       |    /* no need to ZNew, SHA1_Begin will init the context */
  520|  20.1k|    cx = PORT_New(SHA1Context);
  ------------------
  |  |  151|  20.1k|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|  20.1k|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
  521|  20.1k|    return cx;
  522|  20.1k|}
SHA1_DestroyContext:
  527|  20.1k|{
  528|  20.1k|    memset(cx, 0, sizeof *cx);
  529|  20.1k|    if (freeit) {
  ------------------
  |  Branch (529:9): [True: 20.1k, False: 0]
  ------------------
  530|  20.1k|        PORT_Free(cx);
  ------------------
  |  |   60|  20.1k|#define PORT_Free PORT_Free_Util
  ------------------
  531|  20.1k|    }
  532|  20.1k|}
SHA1_FlattenSize:
  560|  15.3k|{
  561|  15.3k|    return sizeof(SHA1Context);
  562|  15.3k|}
sha_fast.c:SHA1_Update_Generic:
  132|  62.9k|{
  133|  62.9k|    register unsigned int lenB;
  134|  62.9k|    register unsigned int togo;
  135|       |
  136|  62.9k|    if (!len)
  ------------------
  |  Branch (136:9): [True: 171, False: 62.8k]
  ------------------
  137|    171|        return;
  138|       |
  139|       |    /* accumulate the byte count. */
  140|  62.8k|    lenB = (unsigned int)(ctx->size) & 63U;
  141|       |
  142|  62.8k|    ctx->size += len;
  143|       |
  144|       |    /*
  145|       |     *  Read the data into W and process blocks as they get full
  146|       |     */
  147|  62.8k|    if (lenB > 0) {
  ------------------
  |  Branch (147:9): [True: 29.3k, False: 33.4k]
  ------------------
  148|  29.3k|        togo = 64U - lenB;
  149|  29.3k|        if (len < togo)
  ------------------
  |  Branch (149:13): [True: 25.9k, False: 3.43k]
  ------------------
  150|  25.9k|            togo = len;
  151|  29.3k|        memcpy(ctx->B + lenB, dataIn, togo);
  ------------------
  |  |   23|  29.3k|#define B u.b
  ------------------
  152|  29.3k|        len -= togo;
  153|  29.3k|        dataIn += togo;
  154|  29.3k|        lenB = (lenB + togo) & 63U;
  155|  29.3k|        if (!lenB) {
  ------------------
  |  Branch (155:13): [True: 3.43k, False: 25.9k]
  ------------------
  156|  3.43k|            shaCompress(&ctx->H[H2X], ctx->W);
  ------------------
  |  |  115|  3.43k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  ------------------
                          shaCompress(&ctx->H[H2X], ctx->W);
  ------------------
  |  |   22|  3.43k|#define W u.w
  ------------------
  157|  3.43k|        }
  158|  29.3k|    }
  159|       |#if !defined(HAVE_UNALIGNED_ACCESS)
  160|       |    if ((ptrdiff_t)dataIn % sizeof(PRUint32)) {
  161|       |        while (len >= 64U) {
  162|       |            memcpy(ctx->B, dataIn, 64);
  163|       |            len -= 64U;
  164|       |            shaCompress(&ctx->H[H2X], ctx->W);
  165|       |            dataIn += 64U;
  166|       |        }
  167|       |    } else
  168|       |#endif
  169|  62.8k|    {
  170|   111k|        while (len >= 64U) {
  ------------------
  |  Branch (170:16): [True: 48.6k, False: 62.8k]
  ------------------
  171|  48.6k|            len -= 64U;
  172|  48.6k|            shaCompress(&ctx->H[H2X], (PRUint32 *)dataIn);
  ------------------
  |  |  115|  48.6k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  ------------------
  173|  48.6k|            dataIn += 64U;
  174|  48.6k|        }
  175|  62.8k|    }
  176|  62.8k|    if (len) {
  ------------------
  |  Branch (176:9): [True: 25.8k, False: 36.9k]
  ------------------
  177|  25.8k|        memcpy(ctx->B, dataIn, len);
  ------------------
  |  |   23|  25.8k|#define B u.b
  ------------------
  178|  25.8k|    }
  179|  62.8k|}
sha_fast.c:shaCompress:
  286|  74.3k|{
  287|  74.3k|    register SHA_HW_t A, B, C, D, E;
  288|       |
  289|       |#if defined(SHA_NEED_TMP_VARIABLE)
  290|       |    register PRUint32 tmp;
  291|       |#endif
  292|       |
  293|  74.3k|#if !defined(SHA_PUT_W_IN_STACK)
  294|  74.3k|#define XH(n) X[n - H2X]
  295|  74.3k|#define XW(n) X[n - W2X]
  296|       |#else
  297|       |    SHA_HW_t w_0, w_1, w_2, w_3, w_4, w_5, w_6, w_7,
  298|       |        w_8, w_9, w_10, w_11, w_12, w_13, w_14, w_15;
  299|       |#define XW(n) w_##n
  300|       |#define XH(n) X[n]
  301|       |#endif
  302|       |
  303|  74.3k|#define K0 0x5a827999L
  304|  74.3k|#define K1 0x6ed9eba1L
  305|  74.3k|#define K2 0x8f1bbcdcL
  306|  74.3k|#define K3 0xca62c1d6L
  307|       |
  308|  74.3k|#define SHA_RND1(a, b, c, d, e, n)                         \
  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  310|  74.3k|    c = SHA_ROTL(c, 30)
  311|  74.3k|#define SHA_RND2(a, b, c, d, e, n)                         \
  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  313|  74.3k|    c = SHA_ROTL(c, 30)
  314|  74.3k|#define SHA_RND3(a, b, c, d, e, n)                         \
  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  316|  74.3k|    c = SHA_ROTL(c, 30)
  317|  74.3k|#define SHA_RND4(a, b, c, d, e, n)                         \
  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  319|  74.3k|    c = SHA_ROTL(c, 30)
  320|       |
  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  322|       |
  323|  74.3k|    A = XH(0);
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  324|  74.3k|    B = XH(1);
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  325|  74.3k|    C = XH(2);
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  326|  74.3k|    D = XH(3);
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  327|  74.3k|    E = XH(4);
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  328|       |
  329|  74.3k|    LOAD(0);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  330|  74.3k|    SHA_RND1(E, A, B, C, D, 0);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  331|  74.3k|    LOAD(1);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  332|  74.3k|    SHA_RND1(D, E, A, B, C, 1);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  333|  74.3k|    LOAD(2);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  334|  74.3k|    SHA_RND1(C, D, E, A, B, 2);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  335|  74.3k|    LOAD(3);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  336|  74.3k|    SHA_RND1(B, C, D, E, A, 3);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  337|  74.3k|    LOAD(4);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  338|  74.3k|    SHA_RND1(A, B, C, D, E, 4);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  339|  74.3k|    LOAD(5);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  340|  74.3k|    SHA_RND1(E, A, B, C, D, 5);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  341|  74.3k|    LOAD(6);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  342|  74.3k|    SHA_RND1(D, E, A, B, C, 6);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  343|  74.3k|    LOAD(7);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  344|  74.3k|    SHA_RND1(C, D, E, A, B, 7);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  345|  74.3k|    LOAD(8);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  346|  74.3k|    SHA_RND1(B, C, D, E, A, 8);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  347|  74.3k|    LOAD(9);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  348|  74.3k|    SHA_RND1(A, B, C, D, E, 9);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  349|  74.3k|    LOAD(10);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  350|  74.3k|    SHA_RND1(E, A, B, C, D, 10);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  351|  74.3k|    LOAD(11);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  352|  74.3k|    SHA_RND1(D, E, A, B, C, 11);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  353|  74.3k|    LOAD(12);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  354|  74.3k|    SHA_RND1(C, D, E, A, B, 12);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  355|  74.3k|    LOAD(13);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  356|  74.3k|    SHA_RND1(B, C, D, E, A, 13);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  357|  74.3k|    LOAD(14);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  358|  74.3k|    SHA_RND1(A, B, C, D, E, 14);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  359|  74.3k|    LOAD(15);
  ------------------
  |  |  321|  74.3k|#define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define LOAD(n) XW(n) = SHA_HTONL(inbuf[n])
  |  |  ------------------
  |  |  |  |   97|  74.3k|#define SHA_HTONL(x) swap4b(x)
  |  |  ------------------
  ------------------
  360|  74.3k|    SHA_RND1(E, A, B, C, D, 15);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  361|       |
  362|  74.3k|    SHA_MIX(0, 13, 8, 2);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|  74.3k|    SHA_RND1(D, E, A, B, C, 0);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  364|  74.3k|    SHA_MIX(1, 14, 9, 3);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  365|  74.3k|    SHA_RND1(C, D, E, A, B, 1);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  366|  74.3k|    SHA_MIX(2, 15, 10, 4);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|  74.3k|    SHA_RND1(B, C, D, E, A, 2);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  368|  74.3k|    SHA_MIX(3, 0, 11, 5);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  369|  74.3k|    SHA_RND1(A, B, C, D, E, 3);
  ------------------
  |  |  309|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |   25|  74.3k|#define SHA_F1(X, Y, Z) ((((Y) ^ (Z)) & (X)) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F1(c, d, e) + a + XW(n) + K0; \
  |  |  ------------------
  |  |  |  |  303|  74.3k|#define K0 0x5a827999L
  |  |  ------------------
  |  |  310|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  370|       |
  371|  74.3k|    SHA_MIX(4, 1, 12, 6);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  372|  74.3k|    SHA_RND2(E, A, B, C, D, 4);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  373|  74.3k|    SHA_MIX(5, 2, 13, 7);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  374|  74.3k|    SHA_RND2(D, E, A, B, C, 5);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  375|  74.3k|    SHA_MIX(6, 3, 14, 8);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  376|  74.3k|    SHA_RND2(C, D, E, A, B, 6);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  377|  74.3k|    SHA_MIX(7, 4, 15, 9);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  378|  74.3k|    SHA_RND2(B, C, D, E, A, 7);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  379|  74.3k|    SHA_MIX(8, 5, 0, 10);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  380|  74.3k|    SHA_RND2(A, B, C, D, E, 8);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  381|  74.3k|    SHA_MIX(9, 6, 1, 11);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  382|  74.3k|    SHA_RND2(E, A, B, C, D, 9);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  383|  74.3k|    SHA_MIX(10, 7, 2, 12);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  384|  74.3k|    SHA_RND2(D, E, A, B, C, 10);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  385|  74.3k|    SHA_MIX(11, 8, 3, 13);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  386|  74.3k|    SHA_RND2(C, D, E, A, B, 11);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  387|  74.3k|    SHA_MIX(12, 9, 4, 14);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|  74.3k|    SHA_RND2(B, C, D, E, A, 12);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  389|  74.3k|    SHA_MIX(13, 10, 5, 15);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  390|  74.3k|    SHA_RND2(A, B, C, D, E, 13);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  391|  74.3k|    SHA_MIX(14, 11, 6, 0);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  392|  74.3k|    SHA_RND2(E, A, B, C, D, 14);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  393|  74.3k|    SHA_MIX(15, 12, 7, 1);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  394|  74.3k|    SHA_RND2(D, E, A, B, C, 15);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  395|       |
  396|  74.3k|    SHA_MIX(0, 13, 8, 2);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  397|  74.3k|    SHA_RND2(C, D, E, A, B, 0);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  398|  74.3k|    SHA_MIX(1, 14, 9, 3);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  399|  74.3k|    SHA_RND2(B, C, D, E, A, 1);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  400|  74.3k|    SHA_MIX(2, 15, 10, 4);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|  74.3k|    SHA_RND2(A, B, C, D, E, 2);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  402|  74.3k|    SHA_MIX(3, 0, 11, 5);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  403|  74.3k|    SHA_RND2(E, A, B, C, D, 3);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  404|  74.3k|    SHA_MIX(4, 1, 12, 6);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  405|  74.3k|    SHA_RND2(D, E, A, B, C, 4);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  406|  74.3k|    SHA_MIX(5, 2, 13, 7);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  407|  74.3k|    SHA_RND2(C, D, E, A, B, 5);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  408|  74.3k|    SHA_MIX(6, 3, 14, 8);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  409|  74.3k|    SHA_RND2(B, C, D, E, A, 6);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  410|  74.3k|    SHA_MIX(7, 4, 15, 9);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  411|  74.3k|    SHA_RND2(A, B, C, D, E, 7);
  ------------------
  |  |  312|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |   26|  74.3k|#define SHA_F2(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F2(c, d, e) + a + XW(n) + K1; \
  |  |  ------------------
  |  |  |  |  304|  74.3k|#define K1 0x6ed9eba1L
  |  |  ------------------
  |  |  313|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  412|       |
  413|  74.3k|    SHA_MIX(8, 5, 0, 10);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  414|  74.3k|    SHA_RND3(E, A, B, C, D, 8);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  415|  74.3k|    SHA_MIX(9, 6, 1, 11);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  416|  74.3k|    SHA_RND3(D, E, A, B, C, 9);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  417|  74.3k|    SHA_MIX(10, 7, 2, 12);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  418|  74.3k|    SHA_RND3(C, D, E, A, B, 10);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  419|  74.3k|    SHA_MIX(11, 8, 3, 13);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  420|  74.3k|    SHA_RND3(B, C, D, E, A, 11);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  421|  74.3k|    SHA_MIX(12, 9, 4, 14);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  422|  74.3k|    SHA_RND3(A, B, C, D, E, 12);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  423|  74.3k|    SHA_MIX(13, 10, 5, 15);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  74.3k|    SHA_RND3(E, A, B, C, D, 13);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  425|  74.3k|    SHA_MIX(14, 11, 6, 0);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  426|  74.3k|    SHA_RND3(D, E, A, B, C, 14);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  427|  74.3k|    SHA_MIX(15, 12, 7, 1);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  428|  74.3k|    SHA_RND3(C, D, E, A, B, 15);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  429|       |
  430|  74.3k|    SHA_MIX(0, 13, 8, 2);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  431|  74.3k|    SHA_RND3(B, C, D, E, A, 0);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  432|  74.3k|    SHA_MIX(1, 14, 9, 3);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  74.3k|    SHA_RND3(A, B, C, D, E, 1);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  434|  74.3k|    SHA_MIX(2, 15, 10, 4);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  435|  74.3k|    SHA_RND3(E, A, B, C, D, 2);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  436|  74.3k|    SHA_MIX(3, 0, 11, 5);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  437|  74.3k|    SHA_RND3(D, E, A, B, C, 3);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  438|  74.3k|    SHA_MIX(4, 1, 12, 6);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  439|  74.3k|    SHA_RND3(C, D, E, A, B, 4);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  440|  74.3k|    SHA_MIX(5, 2, 13, 7);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  441|  74.3k|    SHA_RND3(B, C, D, E, A, 5);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  442|  74.3k|    SHA_MIX(6, 3, 14, 8);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  443|  74.3k|    SHA_RND3(A, B, C, D, E, 6);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  444|  74.3k|    SHA_MIX(7, 4, 15, 9);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  445|  74.3k|    SHA_RND3(E, A, B, C, D, 7);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  446|  74.3k|    SHA_MIX(8, 5, 0, 10);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  447|  74.3k|    SHA_RND3(D, E, A, B, C, 8);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  448|  74.3k|    SHA_MIX(9, 6, 1, 11);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  449|  74.3k|    SHA_RND3(C, D, E, A, B, 9);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  450|  74.3k|    SHA_MIX(10, 7, 2, 12);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  451|  74.3k|    SHA_RND3(B, C, D, E, A, 10);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  452|  74.3k|    SHA_MIX(11, 8, 3, 13);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|  74.3k|    SHA_RND3(A, B, C, D, E, 11);
  ------------------
  |  |  315|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |   27|  74.3k|#define SHA_F3(X, Y, Z) (((X) & (Y)) | ((Z) & ((X) | (Y))))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F3(c, d, e) + a + XW(n) + K2; \
  |  |  ------------------
  |  |  |  |  305|  74.3k|#define K2 0x8f1bbcdcL
  |  |  ------------------
  |  |  316|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  454|       |
  455|  74.3k|    SHA_MIX(12, 9, 4, 14);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  456|  74.3k|    SHA_RND4(E, A, B, C, D, 12);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  457|  74.3k|    SHA_MIX(13, 10, 5, 15);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  458|  74.3k|    SHA_RND4(D, E, A, B, C, 13);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  459|  74.3k|    SHA_MIX(14, 11, 6, 0);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  460|  74.3k|    SHA_RND4(C, D, E, A, B, 14);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  461|  74.3k|    SHA_MIX(15, 12, 7, 1);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  462|  74.3k|    SHA_RND4(B, C, D, E, A, 15);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  463|       |
  464|  74.3k|    SHA_MIX(0, 13, 8, 2);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  465|  74.3k|    SHA_RND4(A, B, C, D, E, 0);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  466|  74.3k|    SHA_MIX(1, 14, 9, 3);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  467|  74.3k|    SHA_RND4(E, A, B, C, D, 1);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  468|  74.3k|    SHA_MIX(2, 15, 10, 4);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|  74.3k|    SHA_RND4(D, E, A, B, C, 2);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  470|  74.3k|    SHA_MIX(3, 0, 11, 5);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  471|  74.3k|    SHA_RND4(C, D, E, A, B, 3);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  472|  74.3k|    SHA_MIX(4, 1, 12, 6);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  473|  74.3k|    SHA_RND4(B, C, D, E, A, 4);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  474|  74.3k|    SHA_MIX(5, 2, 13, 7);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  475|  74.3k|    SHA_RND4(A, B, C, D, E, 5);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  476|  74.3k|    SHA_MIX(6, 3, 14, 8);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  477|  74.3k|    SHA_RND4(E, A, B, C, D, 6);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  478|  74.3k|    SHA_MIX(7, 4, 15, 9);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  479|  74.3k|    SHA_RND4(D, E, A, B, C, 7);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  480|  74.3k|    SHA_MIX(8, 5, 0, 10);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  481|  74.3k|    SHA_RND4(C, D, E, A, B, 8);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  482|  74.3k|    SHA_MIX(9, 6, 1, 11);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|  74.3k|    SHA_RND4(B, C, D, E, A, 9);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  484|  74.3k|    SHA_MIX(10, 7, 2, 12);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  485|  74.3k|    SHA_RND4(A, B, C, D, E, 10);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  486|  74.3k|    SHA_MIX(11, 8, 3, 13);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  74.3k|    SHA_RND4(E, A, B, C, D, 11);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  488|  74.3k|    SHA_MIX(12, 9, 4, 14);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  489|  74.3k|    SHA_RND4(D, E, A, B, C, 12);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  490|  74.3k|    SHA_MIX(13, 10, 5, 15);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  491|  74.3k|    SHA_RND4(C, D, E, A, B, 13);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  492|  74.3k|    SHA_MIX(14, 11, 6, 0);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  493|  74.3k|    SHA_RND4(B, C, D, E, A, 14);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  494|  74.3k|    SHA_MIX(15, 12, 7, 1);
  ------------------
  |  |   30|  74.3k|#define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define SHA_MIX(n, a, b, c) XW(n) = SHA_ROTL(XW(a) ^ XW(b) ^ XW(c) ^ XW(n), 1)
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  495|  74.3k|    SHA_RND4(A, B, C, D, E, 15);
  ------------------
  |  |  318|  74.3k|    a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |   28|  74.3k|#define SHA_F4(X, Y, Z) ((X) ^ (Y) ^ (Z))
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  295|  74.3k|#define XW(n) X[n - W2X]
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|  74.3k|#define W2X 6  /* X[0] is W[6],  and W[0] is X[-6]  */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   a = SHA_ROTL(b, 5) + SHA_F4(c, d, e) + a + XW(n) + K3; \
  |  |  ------------------
  |  |  |  |  306|  74.3k|#define K3 0xca62c1d6L
  |  |  ------------------
  |  |  319|  74.3k|    c = SHA_ROTL(c, 30)
  ------------------
  496|       |
  497|  74.3k|    XH(0) += A;
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  498|  74.3k|    XH(1) += B;
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  499|  74.3k|    XH(2) += C;
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  500|  74.3k|    XH(3) += D;
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  501|  74.3k|    XH(4) += E;
  ------------------
  |  |  294|  74.3k|#define XH(n) X[n - H2X]
  |  |  ------------------
  |  |  |  |  115|  74.3k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  |  |  ------------------
  ------------------
  502|  74.3k|}
sha_fast.c:SHA1_Compress_Generic:
  506|  22.2k|{
  507|  22.2k|    shaCompress(&ctx->H[H2X], ctx->u.w);
  ------------------
  |  |  115|  22.2k|#define H2X 11 /* X[0] is H[11], and H[0] is X[-11] */
  ------------------
  508|  22.2k|}

camellia.c:swap4b:
   92|    520|{
   93|    520|    __asm__("bswap %0"
   94|    520|            : "+r"(value));
   95|    520|    return (value);
   96|    520|}
sha_fast.c:SHA_ROTL:
   76|  16.6M|{
   77|  16.6M|    PRUint32 t = (PRUint32)x;
   78|  16.6M|    return ((t << n) | (t >> (32 - n)));
   79|  16.6M|}
sha_fast.c:swap4b:
   92|  1.34M|{
   93|  1.34M|    __asm__("bswap %0"
   94|  1.34M|            : "+r"(value));
   95|  1.34M|    return (value);
   96|  1.34M|}

TLS_P_hash:
   21|  5.90k|{
   22|  5.90k|    unsigned char state[PHASH_STATE_MAX_LEN];
   23|  5.90k|    unsigned char outbuf[PHASH_STATE_MAX_LEN];
   24|  5.90k|    unsigned int state_len = 0, label_len = 0, outbuf_len = 0, chunk_size;
   25|  5.90k|    unsigned int remaining;
   26|  5.90k|    unsigned char *res;
   27|  5.90k|    SECStatus status;
   28|  5.90k|    HMACContext *cx;
   29|  5.90k|    SECStatus rv = SECFailure;
   30|  5.90k|    const SECHashObject *hashObj = HASH_GetRawHashObject(hashType);
   31|       |
   32|  5.90k|    PORT_Assert((secret != NULL) && (secret->data != NULL || !secret->len));
  ------------------
  |  |  120|  5.90k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  17.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 5.90k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 5.90k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   33|  5.90k|    PORT_Assert((seed != NULL) && (seed->data != NULL));
  ------------------
  |  |  120|  5.90k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  11.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 5.90k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 5.90k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   34|  5.90k|    PORT_Assert((result != NULL) && (result->data != NULL));
  ------------------
  |  |  120|  5.90k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  11.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 5.90k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 5.90k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   35|       |
   36|  5.90k|    remaining = result->len;
   37|  5.90k|    res = result->data;
   38|       |
   39|  5.90k|    if (label != NULL)
  ------------------
  |  Branch (39:9): [True: 3.83k, False: 2.06k]
  ------------------
   40|  3.83k|        label_len = PORT_Strlen(label);
  ------------------
  |  |  190|  3.83k|#define PORT_Strlen(s) strlen(s)
  ------------------
   41|       |
   42|  5.90k|    cx = HMAC_Create(hashObj, secret->data, secret->len, isFIPS);
   43|  5.90k|    if (cx == NULL)
  ------------------
  |  Branch (43:9): [True: 0, False: 5.90k]
  ------------------
   44|      0|        goto loser;
   45|       |
   46|       |    /* initialize the state = A(1) = HMAC_hash(secret, seed) */
   47|  5.90k|    HMAC_Begin(cx);
   48|  5.90k|    HMAC_Update(cx, (unsigned char *)label, label_len);
   49|  5.90k|    HMAC_Update(cx, seed->data, seed->len);
   50|  5.90k|    status = HMAC_Finish(cx, state, &state_len, sizeof(state));
   51|  5.90k|    if (status != SECSuccess)
  ------------------
  |  Branch (51:9): [True: 0, False: 5.90k]
  ------------------
   52|      0|        goto loser;
   53|       |
   54|       |    /* generate a block at a time until we're done */
   55|  19.2k|    while (remaining > 0) {
  ------------------
  |  Branch (55:12): [True: 13.3k, False: 5.90k]
  ------------------
   56|       |
   57|  13.3k|        HMAC_Begin(cx);
   58|  13.3k|        HMAC_Update(cx, state, state_len);
   59|  13.3k|        if (label_len)
  ------------------
  |  Branch (59:13): [True: 11.2k, False: 2.06k]
  ------------------
   60|  11.2k|            HMAC_Update(cx, (unsigned char *)label, label_len);
   61|  13.3k|        HMAC_Update(cx, seed->data, seed->len);
   62|  13.3k|        status = HMAC_Finish(cx, outbuf, &outbuf_len, sizeof(outbuf));
   63|  13.3k|        if (status != SECSuccess)
  ------------------
  |  Branch (63:13): [True: 0, False: 13.3k]
  ------------------
   64|      0|            goto loser;
   65|       |
   66|       |        /* Update the state = A(i) = HMAC_hash(secret, A(i-1)) */
   67|  13.3k|        HMAC_Begin(cx);
   68|  13.3k|        HMAC_Update(cx, state, state_len);
   69|  13.3k|        status = HMAC_Finish(cx, state, &state_len, sizeof(state));
   70|  13.3k|        if (status != SECSuccess)
  ------------------
  |  Branch (70:13): [True: 0, False: 13.3k]
  ------------------
   71|      0|            goto loser;
   72|       |
   73|  13.3k|        chunk_size = PR_MIN(outbuf_len, remaining);
  ------------------
  |  |  158|  13.3k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 7.44k, False: 5.90k]
  |  |  ------------------
  ------------------
   74|  13.3k|        PORT_Memcpy(res, &outbuf, chunk_size);
  ------------------
  |  |  180|  13.3k|#define PORT_Memcpy memcpy
  ------------------
   75|  13.3k|        res += chunk_size;
   76|  13.3k|        remaining -= chunk_size;
   77|  13.3k|    }
   78|       |
   79|  5.90k|    rv = SECSuccess;
   80|       |
   81|  5.90k|loser:
   82|       |    /* clear out state so it's not left on the stack */
   83|  5.90k|    if (cx)
  ------------------
  |  Branch (83:9): [True: 5.90k, False: 0]
  ------------------
   84|  5.90k|        HMAC_Destroy(cx, PR_TRUE);
  ------------------
  |  |  437|  5.90k|#define PR_TRUE 1
  ------------------
   85|  5.90k|    PORT_SafeZero(state, sizeof(state));
   86|  5.90k|    PORT_SafeZero(outbuf, sizeof(outbuf));
   87|  5.90k|    return rv;
   88|  5.90k|}
TLS_PRF:
   93|    485|{
   94|    485|    SECStatus rv = SECFailure, status;
   95|    485|    unsigned int i;
   96|    485|    SECItem tmp = { siBuffer, NULL, 0 };
   97|    485|    SECItem S1;
   98|    485|    SECItem S2;
   99|       |
  100|    485|    PORT_Assert((secret != NULL) && (secret->data != NULL || !secret->len));
  ------------------
  |  |  120|    485|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.45k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 485, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 485, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|    485|    PORT_Assert((seed != NULL) && (seed->data != NULL));
  ------------------
  |  |  120|    485|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    970|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 485, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 485, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|    485|    PORT_Assert((result != NULL) && (result->data != NULL));
  ------------------
  |  |  120|    485|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    970|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 485, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 485, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|       |
  104|    485|    S1.type = siBuffer;
  105|    485|    S1.len = (secret->len / 2) + (secret->len & 1);
  106|    485|    S1.data = secret->data;
  107|       |
  108|    485|    S2.type = siBuffer;
  109|    485|    S2.len = S1.len;
  110|    485|    S2.data = secret->data + (secret->len - S2.len);
  111|       |
  112|    485|    tmp.data = (unsigned char *)PORT_Alloc(result->len);
  ------------------
  |  |   52|    485|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  113|    485|    if (tmp.data == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 485]
  ------------------
  114|      0|        goto loser;
  115|    485|    tmp.len = result->len;
  116|       |
  117|    485|    status = TLS_P_hash(HASH_AlgMD5, &S1, label, seed, result, isFIPS);
  118|    485|    if (status != SECSuccess)
  ------------------
  |  Branch (118:9): [True: 0, False: 485]
  ------------------
  119|      0|        goto loser;
  120|       |
  121|    485|    status = TLS_P_hash(HASH_AlgSHA1, &S2, label, seed, &tmp, isFIPS);
  122|    485|    if (status != SECSuccess)
  ------------------
  |  Branch (122:9): [True: 0, False: 485]
  ------------------
  123|      0|        goto loser;
  124|       |
  125|  26.5k|    for (i = 0; i < result->len; i++)
  ------------------
  |  Branch (125:17): [True: 26.0k, False: 485]
  ------------------
  126|  26.0k|        result->data[i] ^= tmp.data[i];
  127|       |
  128|    485|    rv = SECSuccess;
  129|       |
  130|    485|loser:
  131|    485|    if (tmp.data != NULL)
  ------------------
  |  Branch (131:9): [True: 485, False: 0]
  ------------------
  132|    485|        PORT_ZFree(tmp.data, tmp.len);
  ------------------
  |  |   75|    485|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  133|    485|    return rv;
  134|    485|}

Hacl_Impl_Chacha20_chacha20_init:
  117|  33.6k|{
  118|  33.6k|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|  33.6k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  33.6k|    do {                               \
  |  |  |  |  289|  33.6k|        uint32_t i = z;                \
  |  |  |  |  290|  33.6k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  33.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|  33.6k|                    (uint32_t)0U,
  120|  33.6k|                    (uint32_t)4U,
  121|  33.6k|                    (uint32_t)1U,
  122|  33.6k|                    uint32_t *os = ctx;
  123|  33.6k|                    uint32_t x = chacha20_constants[i];
  124|  33.6k|                    os[i] = x;);
  125|  33.6k|    KRML_MAYBE_FOR8(i,
  ------------------
  |  |  354|  33.6k|#define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 8, k, x)
  |  |  ------------------
  |  |  |  |  288|  33.6k|    do {                               \
  |  |  |  |  289|  33.6k|        uint32_t i = z;                \
  |  |  |  |  290|  33.6k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  33.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  126|  33.6k|                    (uint32_t)0U,
  127|  33.6k|                    (uint32_t)8U,
  128|  33.6k|                    (uint32_t)1U,
  129|  33.6k|                    uint32_t *os = ctx + (uint32_t)4U;
  130|  33.6k|                    uint8_t *bj = k + i * (uint32_t)4U;
  131|  33.6k|                    uint32_t u = load32_le(bj);
  132|  33.6k|                    uint32_t r = u;
  133|  33.6k|                    uint32_t x = r;
  134|  33.6k|                    os[i] = x;);
  135|  33.6k|    ctx[12U] = ctr;
  136|  33.6k|    KRML_MAYBE_FOR3(i,
  ------------------
  |  |  324|  33.6k|#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x)
  |  |  ------------------
  |  |  |  |  288|  33.6k|    do {                               \
  |  |  |  |  289|  33.6k|        uint32_t i = z;                \
  |  |  |  |  290|  33.6k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  33.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  137|  33.6k|                    (uint32_t)0U,
  138|  33.6k|                    (uint32_t)3U,
  139|  33.6k|                    (uint32_t)1U,
  140|  33.6k|                    uint32_t *os = ctx + (uint32_t)13U;
  141|  33.6k|                    uint8_t *bj = n + i * (uint32_t)4U;
  142|  33.6k|                    uint32_t u = load32_le(bj);
  143|  33.6k|                    uint32_t r = u;
  144|  33.6k|                    uint32_t x = r;
  145|  33.6k|                    os[i] = x;);
  146|  33.6k|}
Hacl_Impl_Chacha20_chacha20_update:
  189|  33.6k|{
  190|  33.6k|    uint32_t rem = len % (uint32_t)64U;
  191|  33.6k|    uint32_t nb = len / (uint32_t)64U;
  192|  33.6k|    uint32_t rem1 = len % (uint32_t)64U;
  193|  34.9k|    for (uint32_t i = (uint32_t)0U; i < nb; i++) {
  ------------------
  |  Branch (193:37): [True: 1.26k, False: 33.6k]
  ------------------
  194|  1.26k|        chacha20_encrypt_block(ctx, out + i * (uint32_t)64U, i, text + i * (uint32_t)64U);
  195|  1.26k|    }
  196|  33.6k|    if (rem1 > (uint32_t)0U) {
  ------------------
  |  Branch (196:9): [True: 33.6k, False: 5]
  ------------------
  197|  33.6k|        chacha20_encrypt_last(ctx, rem, out + nb * (uint32_t)64U, nb, text + nb * (uint32_t)64U);
  198|  33.6k|    }
  199|  33.6k|}
Hacl_Chacha20_chacha20_encrypt:
  209|  33.6k|{
  210|  33.6k|    uint32_t ctx[16U] = { 0U };
  211|  33.6k|    Hacl_Impl_Chacha20_chacha20_init(ctx, key, n, ctr);
  212|  33.6k|    Hacl_Impl_Chacha20_chacha20_update(ctx, len, out, text);
  213|  33.6k|}
Hacl_Chacha20.c:chacha20_encrypt_block:
  150|  34.9k|{
  151|  34.9k|    uint32_t k[16U] = { 0U };
  152|  34.9k|    chacha20_core(k, ctx, incr);
  153|  34.9k|    uint32_t bl[16U] = { 0U };
  154|  34.9k|    KRML_MAYBE_FOR16(i,
  ------------------
  |  |  402|  34.9k|#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x)
  |  |  ------------------
  |  |  |  |  288|  34.9k|    do {                               \
  |  |  |  |  289|  34.9k|        uint32_t i = z;                \
  |  |  |  |  290|  34.9k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  34.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  155|  34.9k|                     (uint32_t)0U,
  156|  34.9k|                     (uint32_t)16U,
  157|  34.9k|                     (uint32_t)1U,
  158|  34.9k|                     uint32_t *os = bl;
  159|  34.9k|                     uint8_t *bj = text + i * (uint32_t)4U;
  160|  34.9k|                     uint32_t u = load32_le(bj);
  161|  34.9k|                     uint32_t r = u;
  162|  34.9k|                     uint32_t x = r;
  163|  34.9k|                     os[i] = x;);
  164|  34.9k|    KRML_MAYBE_FOR16(i,
  ------------------
  |  |  402|  34.9k|#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x)
  |  |  ------------------
  |  |  |  |  288|  34.9k|    do {                               \
  |  |  |  |  289|  34.9k|        uint32_t i = z;                \
  |  |  |  |  290|  34.9k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  34.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|  34.9k|                     (uint32_t)0U,
  166|  34.9k|                     (uint32_t)16U,
  167|  34.9k|                     (uint32_t)1U,
  168|  34.9k|                     uint32_t *os = bl;
  169|  34.9k|                     uint32_t x = bl[i] ^ k[i];
  170|  34.9k|                     os[i] = x;);
  171|  34.9k|    KRML_MAYBE_FOR16(i,
  ------------------
  |  |  402|  34.9k|#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x)
  |  |  ------------------
  |  |  |  |  288|  34.9k|    do {                               \
  |  |  |  |  289|  34.9k|        uint32_t i = z;                \
  |  |  |  |  290|  34.9k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  34.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|  34.9k|                     (uint32_t)0U,
  173|  34.9k|                     (uint32_t)16U,
  174|  34.9k|                     (uint32_t)1U,
  175|  34.9k|                     store32_le(out + i * (uint32_t)4U, bl[i]););
  176|  34.9k|}
Hacl_Chacha20.c:chacha20_core:
   97|  34.9k|{
   98|  34.9k|    memcpy(k, ctx, (uint32_t)16U * sizeof(uint32_t));
   99|  34.9k|    uint32_t ctr_u32 = ctr;
  100|  34.9k|    k[12U] = k[12U] + ctr_u32;
  101|  34.9k|    rounds(k);
  102|  34.9k|    KRML_MAYBE_FOR16(i,
  ------------------
  |  |  402|  34.9k|#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x)
  |  |  ------------------
  |  |  |  |  288|  34.9k|    do {                               \
  |  |  |  |  289|  34.9k|        uint32_t i = z;                \
  |  |  |  |  290|  34.9k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  34.9k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|  34.9k|                     (uint32_t)0U,
  104|  34.9k|                     (uint32_t)16U,
  105|  34.9k|                     (uint32_t)1U,
  106|  34.9k|                     uint32_t *os = k;
  107|  34.9k|                     uint32_t x = k[i] + ctx[i];
  108|  34.9k|                     os[i] = x;);
  109|  34.9k|    k[12U] = k[12U] + ctr_u32;
  110|  34.9k|}
Hacl_Chacha20.c:rounds:
   82|  34.9k|{
   83|  34.9k|    double_round(st);
   84|  34.9k|    double_round(st);
   85|  34.9k|    double_round(st);
   86|  34.9k|    double_round(st);
   87|  34.9k|    double_round(st);
   88|  34.9k|    double_round(st);
   89|  34.9k|    double_round(st);
   90|  34.9k|    double_round(st);
   91|  34.9k|    double_round(st);
   92|  34.9k|    double_round(st);
   93|  34.9k|}
Hacl_Chacha20.c:double_round:
   69|   349k|{
   70|   349k|    quarter_round(st, (uint32_t)0U, (uint32_t)4U, (uint32_t)8U, (uint32_t)12U);
   71|   349k|    quarter_round(st, (uint32_t)1U, (uint32_t)5U, (uint32_t)9U, (uint32_t)13U);
   72|   349k|    quarter_round(st, (uint32_t)2U, (uint32_t)6U, (uint32_t)10U, (uint32_t)14U);
   73|   349k|    quarter_round(st, (uint32_t)3U, (uint32_t)7U, (uint32_t)11U, (uint32_t)15U);
   74|   349k|    quarter_round(st, (uint32_t)0U, (uint32_t)5U, (uint32_t)10U, (uint32_t)15U);
   75|   349k|    quarter_round(st, (uint32_t)1U, (uint32_t)6U, (uint32_t)11U, (uint32_t)12U);
   76|   349k|    quarter_round(st, (uint32_t)2U, (uint32_t)7U, (uint32_t)8U, (uint32_t)13U);
   77|   349k|    quarter_round(st, (uint32_t)3U, (uint32_t)4U, (uint32_t)9U, (uint32_t)14U);
   78|   349k|}
Hacl_Chacha20.c:quarter_round:
   32|  2.79M|{
   33|  2.79M|    uint32_t sta = st[a];
   34|  2.79M|    uint32_t stb0 = st[b];
   35|  2.79M|    uint32_t std0 = st[d];
   36|  2.79M|    uint32_t sta10 = sta + stb0;
   37|  2.79M|    uint32_t std10 = std0 ^ sta10;
   38|  2.79M|    uint32_t std2 = std10 << (uint32_t)16U | std10 >> (uint32_t)16U;
   39|  2.79M|    st[a] = sta10;
   40|  2.79M|    st[d] = std2;
   41|  2.79M|    uint32_t sta0 = st[c];
   42|  2.79M|    uint32_t stb1 = st[d];
   43|  2.79M|    uint32_t std3 = st[b];
   44|  2.79M|    uint32_t sta11 = sta0 + stb1;
   45|  2.79M|    uint32_t std11 = std3 ^ sta11;
   46|  2.79M|    uint32_t std20 = std11 << (uint32_t)12U | std11 >> (uint32_t)20U;
   47|  2.79M|    st[c] = sta11;
   48|  2.79M|    st[b] = std20;
   49|  2.79M|    uint32_t sta2 = st[a];
   50|  2.79M|    uint32_t stb2 = st[b];
   51|  2.79M|    uint32_t std4 = st[d];
   52|  2.79M|    uint32_t sta12 = sta2 + stb2;
   53|  2.79M|    uint32_t std12 = std4 ^ sta12;
   54|  2.79M|    uint32_t std21 = std12 << (uint32_t)8U | std12 >> (uint32_t)24U;
   55|  2.79M|    st[a] = sta12;
   56|  2.79M|    st[d] = std21;
   57|  2.79M|    uint32_t sta3 = st[c];
   58|  2.79M|    uint32_t stb = st[d];
   59|  2.79M|    uint32_t std = st[b];
   60|  2.79M|    uint32_t sta1 = sta3 + stb;
   61|  2.79M|    uint32_t std1 = std ^ sta1;
   62|  2.79M|    uint32_t std22 = std1 << (uint32_t)7U | std1 >> (uint32_t)25U;
   63|  2.79M|    st[c] = sta1;
   64|  2.79M|    st[b] = std22;
   65|  2.79M|}
Hacl_Chacha20.c:chacha20_encrypt_last:
  180|  33.6k|{
  181|  33.6k|    uint8_t plain[64U] = { 0U };
  182|  33.6k|    memcpy(plain, text, len * sizeof(uint8_t));
  183|  33.6k|    chacha20_encrypt_block(ctx, plain, incr, plain);
  184|  33.6k|    memcpy(out, plain, len * sizeof(uint8_t));
  185|  33.6k|}

Hacl_Curve25519_51_fsquare_times:
  163|  85.0k|{
  164|  85.0k|    Hacl_Impl_Curve25519_Field51_fsqr(o, inp, tmp);
  165|  1.96M|    for (uint32_t i = (uint32_t)0U; i < n - (uint32_t)1U; i++) {
  ------------------
  |  Branch (165:37): [True: 1.87M, False: 85.0k]
  ------------------
  166|  1.87M|        Hacl_Impl_Curve25519_Field51_fsqr(o, o, tmp);
  167|  1.87M|    }
  168|  85.0k|}
Hacl_Curve25519_51_finv:
  172|  7.73k|{
  173|  7.73k|    uint64_t t1[20U] = { 0U };
  174|  7.73k|    uint64_t *a1 = t1;
  175|  7.73k|    uint64_t *b1 = t1 + (uint32_t)5U;
  176|  7.73k|    uint64_t *t010 = t1 + (uint32_t)15U;
  177|  7.73k|    FStar_UInt128_uint128 *tmp10 = tmp;
  178|  7.73k|    Hacl_Curve25519_51_fsquare_times(a1, i, tmp10, (uint32_t)1U);
  179|  7.73k|    Hacl_Curve25519_51_fsquare_times(t010, a1, tmp10, (uint32_t)2U);
  180|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(b1, t010, i, tmp);
  181|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(a1, b1, a1, tmp);
  182|  7.73k|    Hacl_Curve25519_51_fsquare_times(t010, a1, tmp10, (uint32_t)1U);
  183|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(b1, t010, b1, tmp);
  184|  7.73k|    Hacl_Curve25519_51_fsquare_times(t010, b1, tmp10, (uint32_t)5U);
  185|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(b1, t010, b1, tmp);
  186|  7.73k|    uint64_t *b10 = t1 + (uint32_t)5U;
  187|  7.73k|    uint64_t *c10 = t1 + (uint32_t)10U;
  188|  7.73k|    uint64_t *t011 = t1 + (uint32_t)15U;
  189|  7.73k|    FStar_UInt128_uint128 *tmp11 = tmp;
  190|  7.73k|    Hacl_Curve25519_51_fsquare_times(t011, b10, tmp11, (uint32_t)10U);
  191|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(c10, t011, b10, tmp);
  192|  7.73k|    Hacl_Curve25519_51_fsquare_times(t011, c10, tmp11, (uint32_t)20U);
  193|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(t011, t011, c10, tmp);
  194|  7.73k|    Hacl_Curve25519_51_fsquare_times(t011, t011, tmp11, (uint32_t)10U);
  195|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(b10, t011, b10, tmp);
  196|  7.73k|    Hacl_Curve25519_51_fsquare_times(t011, b10, tmp11, (uint32_t)50U);
  197|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(c10, t011, b10, tmp);
  198|  7.73k|    uint64_t *b11 = t1 + (uint32_t)5U;
  199|  7.73k|    uint64_t *c1 = t1 + (uint32_t)10U;
  200|  7.73k|    uint64_t *t01 = t1 + (uint32_t)15U;
  201|  7.73k|    FStar_UInt128_uint128 *tmp1 = tmp;
  202|  7.73k|    Hacl_Curve25519_51_fsquare_times(t01, c1, tmp1, (uint32_t)100U);
  203|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(t01, t01, c1, tmp);
  204|  7.73k|    Hacl_Curve25519_51_fsquare_times(t01, t01, tmp1, (uint32_t)50U);
  205|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(t01, t01, b11, tmp);
  206|  7.73k|    Hacl_Curve25519_51_fsquare_times(t01, t01, tmp1, (uint32_t)5U);
  207|  7.73k|    uint64_t *a = t1;
  208|  7.73k|    uint64_t *t0 = t1 + (uint32_t)15U;
  209|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(o, t0, a, tmp);
  210|  7.73k|}
Hacl_Curve25519_51_scalarmult:
  241|  7.73k|{
  242|  7.73k|    uint64_t init[10U] = { 0U };
  243|  7.73k|    uint64_t tmp[4U] = { 0U };
  244|  7.73k|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|  7.73k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  7.73k|    do {                               \
  |  |  |  |  289|  7.73k|        uint32_t i = z;                \
  |  |  |  |  290|  7.73k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  7.73k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  7.73k|                    (uint32_t)0U,
  246|  7.73k|                    (uint32_t)4U,
  247|  7.73k|                    (uint32_t)1U,
  248|  7.73k|                    uint64_t *os = tmp;
  249|  7.73k|                    uint8_t *bj = pub + i * (uint32_t)8U;
  250|  7.73k|                    uint64_t u = load64_le(bj);
  251|  7.73k|                    uint64_t r = u;
  252|  7.73k|                    uint64_t x = r;
  253|  7.73k|                    os[i] = x;);
  254|  7.73k|    uint64_t tmp3 = tmp[3U];
  255|  7.73k|    tmp[3U] = tmp3 & (uint64_t)0x7fffffffffffffffU;
  256|  7.73k|    uint64_t *x = init;
  257|  7.73k|    uint64_t *z = init + (uint32_t)5U;
  258|  7.73k|    z[0U] = (uint64_t)1U;
  259|  7.73k|    z[1U] = (uint64_t)0U;
  260|  7.73k|    z[2U] = (uint64_t)0U;
  261|  7.73k|    z[3U] = (uint64_t)0U;
  262|  7.73k|    z[4U] = (uint64_t)0U;
  263|  7.73k|    uint64_t f0l = tmp[0U] & (uint64_t)0x7ffffffffffffU;
  264|  7.73k|    uint64_t f0h = tmp[0U] >> (uint32_t)51U;
  265|  7.73k|    uint64_t f1l = (tmp[1U] & (uint64_t)0x3fffffffffU) << (uint32_t)13U;
  266|  7.73k|    uint64_t f1h = tmp[1U] >> (uint32_t)38U;
  267|  7.73k|    uint64_t f2l = (tmp[2U] & (uint64_t)0x1ffffffU) << (uint32_t)26U;
  268|  7.73k|    uint64_t f2h = tmp[2U] >> (uint32_t)25U;
  269|  7.73k|    uint64_t f3l = (tmp[3U] & (uint64_t)0xfffU) << (uint32_t)39U;
  270|  7.73k|    uint64_t f3h = tmp[3U] >> (uint32_t)12U;
  271|  7.73k|    x[0U] = f0l;
  272|  7.73k|    x[1U] = f0h | f1l;
  273|  7.73k|    x[2U] = f1h | f2l;
  274|  7.73k|    x[3U] = f2h | f3l;
  275|  7.73k|    x[4U] = f3h;
  276|  7.73k|    montgomery_ladder(init, priv, init);
  277|  7.73k|    encode_point(out, init);
  278|  7.73k|}
Hacl_Curve25519_51_ecdh:
  309|  7.73k|{
  310|  7.73k|    uint8_t zeros[32U] = { 0U };
  311|  7.73k|    Hacl_Curve25519_51_scalarmult(out, priv, pub);
  312|  7.73k|    uint8_t res = (uint8_t)255U;
  313|   255k|    for (uint32_t i = (uint32_t)0U; i < (uint32_t)32U; i++) {
  ------------------
  |  Branch (313:37): [True: 247k, False: 7.73k]
  ------------------
  314|   247k|        uint8_t uu____0 = FStar_UInt8_eq_mask(out[i], zeros[i]);
  315|   247k|        res = uu____0 & res;
  316|   247k|    }
  317|  7.73k|    uint8_t z = res;
  318|  7.73k|    bool r = z == (uint8_t)255U;
  319|  7.73k|    return !r;
  320|  7.73k|}
Hacl_Curve25519_51.c:montgomery_ladder:
  104|  7.73k|{
  105|  7.73k|    FStar_UInt128_uint128 tmp2[10U];
  106|  85.0k|    for (uint32_t _i = 0U; _i < (uint32_t)10U; ++_i)
  ------------------
  |  Branch (106:28): [True: 77.3k, False: 7.73k]
  ------------------
  107|  77.3k|        tmp2[_i] = FStar_UInt128_uint64_to_uint128((uint64_t)0U);
  108|  7.73k|    uint64_t p01_tmp1_swap[41U] = { 0U };
  109|  7.73k|    uint64_t *p0 = p01_tmp1_swap;
  110|  7.73k|    uint64_t *p01 = p01_tmp1_swap;
  111|  7.73k|    uint64_t *p03 = p01;
  112|  7.73k|    uint64_t *p11 = p01 + (uint32_t)10U;
  113|  7.73k|    memcpy(p11, init, (uint32_t)10U * sizeof(uint64_t));
  114|  7.73k|    uint64_t *x0 = p03;
  115|  7.73k|    uint64_t *z0 = p03 + (uint32_t)5U;
  116|  7.73k|    x0[0U] = (uint64_t)1U;
  117|  7.73k|    x0[1U] = (uint64_t)0U;
  118|  7.73k|    x0[2U] = (uint64_t)0U;
  119|  7.73k|    x0[3U] = (uint64_t)0U;
  120|  7.73k|    x0[4U] = (uint64_t)0U;
  121|  7.73k|    z0[0U] = (uint64_t)0U;
  122|  7.73k|    z0[1U] = (uint64_t)0U;
  123|  7.73k|    z0[2U] = (uint64_t)0U;
  124|  7.73k|    z0[3U] = (uint64_t)0U;
  125|  7.73k|    z0[4U] = (uint64_t)0U;
  126|  7.73k|    uint64_t *p01_tmp1 = p01_tmp1_swap;
  127|  7.73k|    uint64_t *p01_tmp11 = p01_tmp1_swap;
  128|  7.73k|    uint64_t *nq1 = p01_tmp1_swap;
  129|  7.73k|    uint64_t *nq_p11 = p01_tmp1_swap + (uint32_t)10U;
  130|  7.73k|    uint64_t *swap = p01_tmp1_swap + (uint32_t)40U;
  131|  7.73k|    Hacl_Impl_Curve25519_Field51_cswap2((uint64_t)1U, nq1, nq_p11);
  132|  7.73k|    point_add_and_double(init, p01_tmp11, tmp2);
  133|  7.73k|    swap[0U] = (uint64_t)1U;
  134|  1.94M|    for (uint32_t i = (uint32_t)0U; i < (uint32_t)251U; i++) {
  ------------------
  |  Branch (134:37): [True: 1.94M, False: 7.73k]
  ------------------
  135|  1.94M|        uint64_t *p01_tmp12 = p01_tmp1_swap;
  136|  1.94M|        uint64_t *swap1 = p01_tmp1_swap + (uint32_t)40U;
  137|  1.94M|        uint64_t *nq2 = p01_tmp12;
  138|  1.94M|        uint64_t *nq_p12 = p01_tmp12 + (uint32_t)10U;
  139|  1.94M|        uint64_t
  140|  1.94M|            bit =
  141|  1.94M|                (uint64_t)(key[((uint32_t)253U - i) / (uint32_t)8U] >> ((uint32_t)253U - i) % (uint32_t)8U & (uint8_t)1U);
  142|  1.94M|        uint64_t sw = swap1[0U] ^ bit;
  143|  1.94M|        Hacl_Impl_Curve25519_Field51_cswap2(sw, nq2, nq_p12);
  144|  1.94M|        point_add_and_double(init, p01_tmp12, tmp2);
  145|  1.94M|        swap1[0U] = bit;
  146|  1.94M|    }
  147|  7.73k|    uint64_t sw = swap[0U];
  148|  7.73k|    Hacl_Impl_Curve25519_Field51_cswap2(sw, nq1, nq_p11);
  149|  7.73k|    uint64_t *nq10 = p01_tmp1;
  150|  7.73k|    uint64_t *tmp1 = p01_tmp1 + (uint32_t)20U;
  151|  7.73k|    point_double(nq10, tmp1, tmp2);
  152|  7.73k|    point_double(nq10, tmp1, tmp2);
  153|  7.73k|    point_double(nq10, tmp1, tmp2);
  154|  7.73k|    memcpy(out, p0, (uint32_t)10U * sizeof(uint64_t));
  155|  7.73k|}
Hacl_Curve25519_51.c:point_add_and_double:
   34|  1.94M|{
   35|  1.94M|    uint64_t *nq = p01_tmp1;
   36|  1.94M|    uint64_t *nq_p1 = p01_tmp1 + (uint32_t)10U;
   37|  1.94M|    uint64_t *tmp1 = p01_tmp1 + (uint32_t)20U;
   38|  1.94M|    uint64_t *x1 = q;
   39|  1.94M|    uint64_t *x2 = nq;
   40|  1.94M|    uint64_t *z2 = nq + (uint32_t)5U;
   41|  1.94M|    uint64_t *z3 = nq_p1 + (uint32_t)5U;
   42|  1.94M|    uint64_t *a = tmp1;
   43|  1.94M|    uint64_t *b = tmp1 + (uint32_t)5U;
   44|  1.94M|    uint64_t *ab = tmp1;
   45|  1.94M|    uint64_t *dc = tmp1 + (uint32_t)10U;
   46|  1.94M|    Hacl_Impl_Curve25519_Field51_fadd(a, x2, z2);
   47|  1.94M|    Hacl_Impl_Curve25519_Field51_fsub(b, x2, z2);
   48|  1.94M|    uint64_t *x3 = nq_p1;
   49|  1.94M|    uint64_t *z31 = nq_p1 + (uint32_t)5U;
   50|  1.94M|    uint64_t *d0 = dc;
   51|  1.94M|    uint64_t *c0 = dc + (uint32_t)5U;
   52|  1.94M|    Hacl_Impl_Curve25519_Field51_fadd(c0, x3, z31);
   53|  1.94M|    Hacl_Impl_Curve25519_Field51_fsub(d0, x3, z31);
   54|  1.94M|    Hacl_Impl_Curve25519_Field51_fmul2(dc, dc, ab, tmp2);
   55|  1.94M|    Hacl_Impl_Curve25519_Field51_fadd(x3, d0, c0);
   56|  1.94M|    Hacl_Impl_Curve25519_Field51_fsub(z31, d0, c0);
   57|  1.94M|    uint64_t *a1 = tmp1;
   58|  1.94M|    uint64_t *b1 = tmp1 + (uint32_t)5U;
   59|  1.94M|    uint64_t *d = tmp1 + (uint32_t)10U;
   60|  1.94M|    uint64_t *c = tmp1 + (uint32_t)15U;
   61|  1.94M|    uint64_t *ab1 = tmp1;
   62|  1.94M|    uint64_t *dc1 = tmp1 + (uint32_t)10U;
   63|  1.94M|    Hacl_Impl_Curve25519_Field51_fsqr2(dc1, ab1, tmp2);
   64|  1.94M|    Hacl_Impl_Curve25519_Field51_fsqr2(nq_p1, nq_p1, tmp2);
   65|  1.94M|    a1[0U] = c[0U];
   66|  1.94M|    a1[1U] = c[1U];
   67|  1.94M|    a1[2U] = c[2U];
   68|  1.94M|    a1[3U] = c[3U];
   69|  1.94M|    a1[4U] = c[4U];
   70|  1.94M|    Hacl_Impl_Curve25519_Field51_fsub(c, d, c);
   71|  1.94M|    Hacl_Impl_Curve25519_Field51_fmul1(b1, c, (uint64_t)121665U);
   72|  1.94M|    Hacl_Impl_Curve25519_Field51_fadd(b1, b1, d);
   73|  1.94M|    Hacl_Impl_Curve25519_Field51_fmul2(nq, dc1, ab1, tmp2);
   74|  1.94M|    Hacl_Impl_Curve25519_Field51_fmul(z3, z3, x1, tmp2);
   75|  1.94M|}
Hacl_Curve25519_51.c:point_double:
   79|  23.1k|{
   80|  23.1k|    uint64_t *x2 = nq;
   81|  23.1k|    uint64_t *z2 = nq + (uint32_t)5U;
   82|  23.1k|    uint64_t *a = tmp1;
   83|  23.1k|    uint64_t *b = tmp1 + (uint32_t)5U;
   84|  23.1k|    uint64_t *d = tmp1 + (uint32_t)10U;
   85|  23.1k|    uint64_t *c = tmp1 + (uint32_t)15U;
   86|  23.1k|    uint64_t *ab = tmp1;
   87|  23.1k|    uint64_t *dc = tmp1 + (uint32_t)10U;
   88|  23.1k|    Hacl_Impl_Curve25519_Field51_fadd(a, x2, z2);
   89|  23.1k|    Hacl_Impl_Curve25519_Field51_fsub(b, x2, z2);
   90|  23.1k|    Hacl_Impl_Curve25519_Field51_fsqr2(dc, ab, tmp2);
   91|  23.1k|    a[0U] = c[0U];
   92|  23.1k|    a[1U] = c[1U];
   93|  23.1k|    a[2U] = c[2U];
   94|  23.1k|    a[3U] = c[3U];
   95|  23.1k|    a[4U] = c[4U];
   96|  23.1k|    Hacl_Impl_Curve25519_Field51_fsub(c, d, c);
   97|  23.1k|    Hacl_Impl_Curve25519_Field51_fmul1(b, c, (uint64_t)121665U);
   98|  23.1k|    Hacl_Impl_Curve25519_Field51_fadd(b, b, d);
   99|  23.1k|    Hacl_Impl_Curve25519_Field51_fmul2(nq, dc, ab, tmp2);
  100|  23.1k|}
Hacl_Curve25519_51.c:encode_point:
  214|  7.73k|{
  215|  7.73k|    uint64_t *x = i;
  216|  7.73k|    uint64_t *z = i + (uint32_t)5U;
  217|  7.73k|    uint64_t tmp[5U] = { 0U };
  218|  7.73k|    uint64_t u64s[4U] = { 0U };
  219|  7.73k|    FStar_UInt128_uint128 tmp_w[10U];
  220|  85.0k|    for (uint32_t _i = 0U; _i < (uint32_t)10U; ++_i)
  ------------------
  |  Branch (220:28): [True: 77.3k, False: 7.73k]
  ------------------
  221|  77.3k|        tmp_w[_i] = FStar_UInt128_uint64_to_uint128((uint64_t)0U);
  222|  7.73k|    Hacl_Curve25519_51_finv(tmp, z, tmp_w);
  223|  7.73k|    Hacl_Impl_Curve25519_Field51_fmul(tmp, tmp, x, tmp_w);
  224|  7.73k|    Hacl_Impl_Curve25519_Field51_store_felem(u64s, tmp);
  225|  7.73k|    KRML_MAYBE_FOR4(i0,
  ------------------
  |  |  330|  7.73k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  7.73k|    do {                               \
  |  |  |  |  289|  7.73k|        uint32_t i = z;                \
  |  |  |  |  290|  7.73k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  7.73k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|  7.73k|                    (uint32_t)0U,
  227|  7.73k|                    (uint32_t)4U,
  228|  7.73k|                    (uint32_t)1U,
  229|  7.73k|                    store64_le(o + i0 * (uint32_t)8U, u64s[i0]););
  230|  7.73k|}

Hacl_Impl_P256_DH_ecp256dh_i:
 1284|    169|{
 1285|    169|    uint64_t tmp[16U] = { 0U };
 1286|    169|    uint64_t *sk = tmp;
 1287|    169|    uint64_t *pk = tmp + (uint32_t)4U;
 1288|    169|    bn_from_bytes_be4(sk, private_key);
 1289|    169|    uint64_t is_b_valid = bn_is_lt_order_and_gt_zero_mask4(sk);
 1290|    169|    uint64_t oneq[4U] = { 0U };
 1291|    169|    oneq[0U] = (uint64_t)1U;
 1292|    169|    oneq[1U] = (uint64_t)0U;
 1293|    169|    oneq[2U] = (uint64_t)0U;
 1294|    169|    oneq[3U] = (uint64_t)0U;
 1295|    169|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|    169|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|    169|    do {                               \
  |  |  |  |  289|    169|        uint32_t i = z;                \
  |  |  |  |  290|    169|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    169|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1296|    169|                    (uint32_t)0U,
 1297|    169|                    (uint32_t)4U,
 1298|    169|                    (uint32_t)1U,
 1299|    169|                    uint64_t *os = sk;
 1300|    169|                    uint64_t uu____0 = oneq[i];
 1301|    169|                    uint64_t x = uu____0 ^ (is_b_valid & (sk[i] ^ uu____0));
 1302|    169|                    os[i] = x;);
 1303|    169|    uint64_t is_sk_valid = is_b_valid;
 1304|    169|    point_mul_g(pk, sk);
 1305|    169|    point_store(public_key, pk);
 1306|    169|    return is_sk_valid == (uint64_t)0xFFFFFFFFFFFFFFFFU;
 1307|    169|}
Hacl_Impl_P256_DH_ecp256dh_r:
 1314|    119|{
 1315|    119|    uint64_t tmp[16U] = { 0U };
 1316|    119|    uint64_t *sk = tmp;
 1317|    119|    uint64_t *pk = tmp + (uint32_t)4U;
 1318|    119|    bool is_pk_valid = load_point_vartime(pk, their_pubkey);
 1319|    119|    bn_from_bytes_be4(sk, private_key);
 1320|    119|    uint64_t is_b_valid = bn_is_lt_order_and_gt_zero_mask4(sk);
 1321|    119|    uint64_t oneq[4U] = { 0U };
 1322|    119|    oneq[0U] = (uint64_t)1U;
 1323|    119|    oneq[1U] = (uint64_t)0U;
 1324|    119|    oneq[2U] = (uint64_t)0U;
 1325|    119|    oneq[3U] = (uint64_t)0U;
 1326|    119|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|    119|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|    119|    do {                               \
  |  |  |  |  289|    119|        uint32_t i = z;                \
  |  |  |  |  290|    119|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    119|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1327|    119|                    (uint32_t)0U,
 1328|    119|                    (uint32_t)4U,
 1329|    119|                    (uint32_t)1U,
 1330|    119|                    uint64_t *os = sk;
 1331|    119|                    uint64_t uu____0 = oneq[i];
 1332|    119|                    uint64_t x = uu____0 ^ (is_b_valid & (sk[i] ^ uu____0));
 1333|    119|                    os[i] = x;);
 1334|    119|    uint64_t is_sk_valid = is_b_valid;
 1335|    119|    uint64_t ss_proj[12U] = { 0U };
 1336|    119|    if (is_pk_valid) {
  ------------------
  |  Branch (1336:9): [True: 119, False: 0]
  ------------------
 1337|    119|        point_mul(ss_proj, sk, pk);
 1338|    119|        point_store(shared_secret, ss_proj);
 1339|    119|    }
 1340|    119|    return is_sk_valid == (uint64_t)0xFFFFFFFFFFFFFFFFU && is_pk_valid;
  ------------------
  |  Branch (1340:12): [True: 119, False: 0]
  |  Branch (1340:60): [True: 119, False: 0]
  ------------------
 1341|    119|}
Hacl_P256_ecdsa_verif_without_hash:
 1643|     68|{
 1644|     68|    uint64_t m_q[4U] = { 0U };
 1645|     68|    uint8_t mHash[32U] = { 0U };
 1646|     68|    memcpy(mHash, msg, (uint32_t)32U * sizeof(uint8_t));
 1647|     68|    KRML_HOST_IGNORE(msg_len);
  ------------------
  |  |   56|     68|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
 1648|     68|    uint8_t *mHash32 = mHash;
 1649|     68|    bn_from_bytes_be4(m_q, mHash32);
 1650|     68|    qmod_short(m_q, m_q);
 1651|     68|    bool res = ecdsa_verify_msg_as_qelem(m_q, public_key, signature_r, signature_s);
 1652|     68|    return res;
 1653|     68|}
Hacl_P256_validate_public_key:
 1675|    491|{
 1676|    491|    uint64_t point_jac[12U] = { 0U };
 1677|    491|    bool res = load_point_vartime(point_jac, public_key);
 1678|    491|    return res;
 1679|    491|}
Hacl_P256_validate_private_key:
 1693|    169|{
 1694|    169|    uint64_t bn_sk[4U] = { 0U };
 1695|    169|    bn_from_bytes_be4(bn_sk, private_key);
 1696|    169|    uint64_t res = bn_is_lt_order_and_gt_zero_mask4(bn_sk);
 1697|    169|    return res == (uint64_t)0xFFFFFFFFFFFFFFFFU;
 1698|    169|}
Hacl_P256_dh_initiator:
 1809|    169|{
 1810|    169|    return Hacl_Impl_P256_DH_ecp256dh_i(public_key, private_key);
 1811|    169|}
Hacl_P256_dh_responder:
 1827|    119|{
 1828|    119|    return Hacl_Impl_P256_DH_ecp256dh_r(shared_secret, their_pubkey, private_key);
 1829|    119|}
Hacl_P256.c:bn_from_bytes_be4:
  316|  2.01k|{
  317|  2.01k|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|  2.01k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  2.01k|    do {                               \
  |  |  |  |  289|  2.01k|        uint32_t i = z;                \
  |  |  |  |  290|  2.01k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  2.01k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  2.01k|                    (uint32_t)0U,
  319|  2.01k|                    (uint32_t)4U,
  320|  2.01k|                    (uint32_t)1U,
  321|  2.01k|                    uint64_t *os = res;
  322|  2.01k|                    uint64_t u = load64_be(b + ((uint32_t)4U - i - (uint32_t)1U) * (uint32_t)8U);
  323|  2.01k|                    uint64_t x = u;
  324|  2.01k|                    os[i] = x;);
  325|  2.01k|}
Hacl_P256.c:bn_is_lt_order_and_gt_zero_mask4:
 1170|    593|{
 1171|    593|    uint64_t is_lt_order = bn_is_lt_order_mask4(f);
 1172|    593|    uint64_t is_eq_zero = bn_is_zero_mask4(f);
 1173|    593|    return is_lt_order & ~is_eq_zero;
 1174|    593|}
Hacl_P256.c:bn_is_lt_order_mask4:
 1161|    593|{
 1162|    593|    uint64_t tmp[4U] = { 0U };
 1163|    593|    make_order(tmp);
 1164|    593|    uint64_t c = bn_sub4(tmp, f, tmp);
 1165|    593|    return (uint64_t)0U - c;
 1166|    593|}
Hacl_P256.c:make_order:
  345|  20.2k|{
  346|  20.2k|    n[0U] = (uint64_t)0xf3b9cac2fc632551U;
  347|  20.2k|    n[1U] = (uint64_t)0xbce6faada7179e84U;
  348|  20.2k|    n[2U] = (uint64_t)0xffffffffffffffffU;
  349|  20.2k|    n[3U] = (uint64_t)0xffffffff00000000U;
  350|  20.2k|}
Hacl_P256.c:bn_sub4:
  146|  2.08k|{
  147|  2.08k|    uint64_t c = (uint64_t)0U;
  148|  2.08k|    {
  149|  2.08k|        uint64_t t1 = x[(uint32_t)4U * (uint32_t)0U];
  150|  2.08k|        uint64_t t20 = y[(uint32_t)4U * (uint32_t)0U];
  151|  2.08k|        uint64_t *res_i0 = res + (uint32_t)4U * (uint32_t)0U;
  152|  2.08k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0);
  ------------------
  |  |   89|  2.08k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  153|  2.08k|        uint64_t t10 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  154|  2.08k|        uint64_t t21 = y[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  155|  2.08k|        uint64_t *res_i1 = res + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
  156|  2.08k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1);
  ------------------
  |  |   89|  2.08k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  157|  2.08k|        uint64_t t11 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  158|  2.08k|        uint64_t t22 = y[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  159|  2.08k|        uint64_t *res_i2 = res + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
  160|  2.08k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2);
  ------------------
  |  |   89|  2.08k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  161|  2.08k|        uint64_t t12 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  162|  2.08k|        uint64_t t2 = y[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  163|  2.08k|        uint64_t *res_i = res + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
  164|  2.08k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i);
  ------------------
  |  |   89|  2.08k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  165|  2.08k|    }
  166|  2.08k|    uint64_t c0 = c;
  167|  2.08k|    return c0;
  168|  2.08k|}
Hacl_P256.c:bn_is_zero_mask4:
   34|    659|{
   35|    659|    uint64_t bn_zero[4U] = { 0U };
   36|    659|    uint64_t mask = (uint64_t)0xFFFFFFFFFFFFFFFFU;
   37|    659|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|    659|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|    659|    do {                               \
  |  |  |  |  289|    659|        uint32_t i = z;                \
  |  |  |  |  290|    659|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    659|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   38|    659|                    (uint32_t)0U,
   39|    659|                    (uint32_t)4U,
   40|    659|                    (uint32_t)1U,
   41|    659|                    uint64_t uu____0 = FStar_UInt64_eq_mask(f[i], bn_zero[i]);
   42|    659|                    mask = uu____0 & mask;);
   43|    659|    uint64_t mask1 = mask;
   44|    659|    uint64_t res = mask1;
   45|    659|    return res;
   46|    659|}
Hacl_P256.c:point_mul_g:
 1039|    169|{
 1040|    169|    uint64_t q1[12U] = { 0U };
 1041|    169|    make_base_point(q1);
 1042|    169|    uint64_t
 1043|    169|        q2[12U] = {
 1044|    169|            (uint64_t)1499621593102562565U, (uint64_t)16692369783039433128U,
 1045|    169|            (uint64_t)15337520135922861848U, (uint64_t)5455737214495366228U,
 1046|    169|            (uint64_t)17827017231032529600U, (uint64_t)12413621606240782649U,
 1047|    169|            (uint64_t)2290483008028286132U, (uint64_t)15752017553340844820U,
 1048|    169|            (uint64_t)4846430910634234874U, (uint64_t)10861682798464583253U,
 1049|    169|            (uint64_t)15404737222404363049U, (uint64_t)363586619281562022U
 1050|    169|        };
 1051|    169|    uint64_t
 1052|    169|        q3[12U] = {
 1053|    169|            (uint64_t)14619254753077084366U, (uint64_t)13913835116514008593U,
 1054|    169|            (uint64_t)15060744674088488145U, (uint64_t)17668414598203068685U,
 1055|    169|            (uint64_t)10761169236902342334U, (uint64_t)15467027479157446221U,
 1056|    169|            (uint64_t)14989185522423469618U, (uint64_t)14354539272510107003U,
 1057|    169|            (uint64_t)14298211796392133693U, (uint64_t)13270323784253711450U,
 1058|    169|            (uint64_t)13380964971965046957U, (uint64_t)8686204248456909699U
 1059|    169|        };
 1060|    169|    uint64_t
 1061|    169|        q4[12U] = {
 1062|    169|            (uint64_t)7870395003430845958U, (uint64_t)18001862936410067720U,
 1063|    169|            (uint64_t)8006461232116967215U, (uint64_t)5921313779532424762U,
 1064|    169|            (uint64_t)10702113371959864307U, (uint64_t)8070517410642379879U,
 1065|    169|            (uint64_t)7139806720777708306U, (uint64_t)8253938546650739833U,
 1066|    169|            (uint64_t)17490482834545705718U, (uint64_t)1065249776797037500U,
 1067|    169|            (uint64_t)5018258455937968775U, (uint64_t)14100621120178668337U
 1068|    169|        };
 1069|    169|    uint64_t *r1 = scalar;
 1070|    169|    uint64_t *r2 = scalar + (uint32_t)1U;
 1071|    169|    uint64_t *r3 = scalar + (uint32_t)2U;
 1072|    169|    uint64_t *r4 = scalar + (uint32_t)3U;
 1073|    169|    make_point_at_inf(res);
 1074|    169|    uint64_t tmp[12U] = { 0U };
 1075|    169|    KRML_MAYBE_FOR16(i,
  ------------------
  |  |  402|    169|#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x)
  |  |  ------------------
  |  |  |  |  288|    169|    do {                               \
  |  |  |  |  289|    169|        uint32_t i = z;                \
  |  |  |  |  290|    169|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    169|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1076|    169|                     (uint32_t)0U,
 1077|    169|                     (uint32_t)16U,
 1078|    169|                     (uint32_t)1U,
 1079|    169|                     KRML_MAYBE_FOR4(i0, (uint32_t)0U, (uint32_t)4U, (uint32_t)1U, point_double(res, res););
 1080|    169|                     uint32_t k = (uint32_t)64U - (uint32_t)4U * i - (uint32_t)4U;
 1081|    169|                     uint64_t bits_l = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)1U, r4, k, (uint32_t)4U);
 1082|    169|                     precomp_get_consttime(Hacl_P256_PrecompTable_precomp_g_pow2_192_table_w4, bits_l, tmp);
 1083|    169|                     point_add(res, res, tmp);
 1084|    169|                     uint32_t k0 = (uint32_t)64U - (uint32_t)4U * i - (uint32_t)4U;
 1085|    169|                     uint64_t bits_l0 = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)1U, r3, k0, (uint32_t)4U);
 1086|    169|                     precomp_get_consttime(Hacl_P256_PrecompTable_precomp_g_pow2_128_table_w4, bits_l0, tmp);
 1087|    169|                     point_add(res, res, tmp);
 1088|    169|                     uint32_t k1 = (uint32_t)64U - (uint32_t)4U * i - (uint32_t)4U;
 1089|    169|                     uint64_t bits_l1 = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)1U, r2, k1, (uint32_t)4U);
 1090|    169|                     precomp_get_consttime(Hacl_P256_PrecompTable_precomp_g_pow2_64_table_w4, bits_l1, tmp);
 1091|    169|                     point_add(res, res, tmp);
 1092|    169|                     uint32_t k2 = (uint32_t)64U - (uint32_t)4U * i - (uint32_t)4U;
 1093|    169|                     uint64_t bits_l2 = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)1U, r1, k2, (uint32_t)4U);
 1094|    169|                     precomp_get_consttime(Hacl_P256_PrecompTable_precomp_basepoint_table_w4, bits_l2, tmp);
 1095|    169|                     point_add(res, res, tmp););
 1096|    169|    KRML_HOST_IGNORE(q1);
  ------------------
  |  |   56|    169|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
 1097|    169|    KRML_HOST_IGNORE(q2);
  ------------------
  |  |   56|    169|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
 1098|    169|    KRML_HOST_IGNORE(q3);
  ------------------
  |  |   56|    169|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
 1099|    169|    KRML_HOST_IGNORE(q4);
  ------------------
  |  |   56|    169|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
 1100|    169|}
Hacl_P256.c:make_base_point:
  663|    235|{
  664|    235|    uint64_t *x = p;
  665|    235|    uint64_t *y = p + (uint32_t)4U;
  666|    235|    uint64_t *z = p + (uint32_t)8U;
  667|    235|    make_g_x(x);
  668|    235|    make_g_y(y);
  669|    235|    make_fone(z);
  670|    235|}
Hacl_P256.c:make_g_x:
  372|    235|{
  373|    235|    n[0U] = (uint64_t)0x79e730d418a9143cU;
  374|    235|    n[1U] = (uint64_t)0x75ba95fc5fedb601U;
  375|    235|    n[2U] = (uint64_t)0x79fb732b77622510U;
  376|    235|    n[3U] = (uint64_t)0x18905f76a53755c6U;
  377|    235|}
Hacl_P256.c:make_g_y:
  381|    235|{
  382|    235|    n[0U] = (uint64_t)0xddf25357ce95560aU;
  383|    235|    n[1U] = (uint64_t)0x8b4ab8e4ba19e45cU;
  384|    235|    n[2U] = (uint64_t)0xd2e88688dd21f325U;
  385|    235|    n[3U] = (uint64_t)0x8571ff1825885d85U;
  386|    235|}
Hacl_P256.c:make_fone:
  408|  1.25k|{
  409|  1.25k|    n[0U] = (uint64_t)0x1U;
  410|  1.25k|    n[1U] = (uint64_t)0xffffffff00000000U;
  411|  1.25k|    n[2U] = (uint64_t)0xffffffffffffffffU;
  412|  1.25k|    n[3U] = (uint64_t)0xfffffffeU;
  413|  1.25k|}
Hacl_P256.c:make_point_at_inf:
  674|    473|{
  675|    473|    uint64_t *x = p;
  676|    473|    uint64_t *y = p + (uint32_t)4U;
  677|    473|    uint64_t *z = p + (uint32_t)8U;
  678|    473|    make_fzero(x);
  679|    473|    make_fone(y);
  680|    473|    make_fzero(z);
  681|    473|}
Hacl_P256.c:make_fzero:
  399|    946|{
  400|    946|    n[0U] = (uint64_t)0U;
  401|    946|    n[1U] = (uint64_t)0U;
  402|    946|    n[2U] = (uint64_t)0U;
  403|    946|    n[3U] = (uint64_t)0U;
  404|    946|}
Hacl_P256.c:point_double:
  845|  59.9k|{
  846|  59.9k|    uint64_t tmp[20U] = { 0U };
  847|  59.9k|    uint64_t *x = p;
  848|  59.9k|    uint64_t *z = p + (uint32_t)8U;
  849|  59.9k|    uint64_t *x3 = res;
  850|  59.9k|    uint64_t *y3 = res + (uint32_t)4U;
  851|  59.9k|    uint64_t *z3 = res + (uint32_t)8U;
  852|  59.9k|    uint64_t *t0 = tmp;
  853|  59.9k|    uint64_t *t1 = tmp + (uint32_t)4U;
  854|  59.9k|    uint64_t *t2 = tmp + (uint32_t)8U;
  855|  59.9k|    uint64_t *t3 = tmp + (uint32_t)12U;
  856|  59.9k|    uint64_t *t4 = tmp + (uint32_t)16U;
  857|  59.9k|    uint64_t *x1 = p;
  858|  59.9k|    uint64_t *y = p + (uint32_t)4U;
  859|  59.9k|    uint64_t *z1 = p + (uint32_t)8U;
  860|  59.9k|    fsqr0(t0, x1);
  861|  59.9k|    fsqr0(t1, y);
  862|  59.9k|    fsqr0(t2, z1);
  863|  59.9k|    fmul0(t3, x1, y);
  864|  59.9k|    fadd0(t3, t3, t3);
  865|  59.9k|    fmul0(t4, y, z1);
  866|  59.9k|    fmul0(z3, x, z);
  867|  59.9k|    fadd0(z3, z3, z3);
  868|  59.9k|    fmul_by_b_coeff(y3, t2);
  869|  59.9k|    fsub0(y3, y3, z3);
  870|  59.9k|    fadd0(x3, y3, y3);
  871|  59.9k|    fadd0(y3, x3, y3);
  872|  59.9k|    fsub0(x3, t1, y3);
  873|  59.9k|    fadd0(y3, t1, y3);
  874|  59.9k|    fmul0(y3, x3, y3);
  875|  59.9k|    fmul0(x3, x3, t3);
  876|  59.9k|    fadd0(t3, t2, t2);
  877|  59.9k|    fadd0(t2, t2, t3);
  878|  59.9k|    fmul_by_b_coeff(z3, z3);
  879|  59.9k|    fsub0(z3, z3, t2);
  880|  59.9k|    fsub0(z3, z3, t0);
  881|  59.9k|    fadd0(t3, z3, z3);
  882|  59.9k|    fadd0(z3, z3, t3);
  883|  59.9k|    fadd0(t3, t0, t0);
  884|  59.9k|    fadd0(t0, t3, t0);
  885|  59.9k|    fsub0(t0, t0, t2);
  886|  59.9k|    fmul0(t0, t0, z3);
  887|  59.9k|    fadd0(y3, y3, t0);
  888|  59.9k|    fadd0(t0, t4, t4);
  889|  59.9k|    fmul0(z3, t0, z3);
  890|  59.9k|    fsub0(x3, x3, z3);
  891|  59.9k|    fmul0(z3, t0, t1);
  892|  59.9k|    fadd0(z3, z3, z3);
  893|  59.9k|    fadd0(z3, z3, z3);
  894|  59.9k|}
Hacl_P256.c:fsqr0:
  531|   271k|{
  532|   271k|    uint64_t tmp[8U] = { 0U };
  533|   271k|    bn_sqr4(tmp, x);
  534|   271k|    mont_reduction(res, tmp);
  535|   271k|}
Hacl_P256.c:bn_sqr4:
  256|   288k|{
  257|   288k|    memset(res, 0U, (uint32_t)8U * sizeof(uint64_t));
  258|   288k|    KRML_MAYBE_FOR4(
  ------------------
  |  |  330|   288k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|   288k|    do {                               \
  |  |  |  |  289|   288k|        uint32_t i = z;                \
  |  |  |  |  290|   288k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   288k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  259|   288k|        i0,
  260|   288k|        (uint32_t)0U,
  261|   288k|        (uint32_t)4U,
  262|   288k|        (uint32_t)1U,
  263|   288k|        uint64_t *ab = x;
  264|   288k|        uint64_t a_j = x[i0];
  265|   288k|        uint64_t *res_j = res + i0;
  266|   288k|        uint64_t c = (uint64_t)0U;
  267|   288k|        for (uint32_t i = (uint32_t)0U; i < i0 / (uint32_t)4U; i++) {
  268|   288k|            uint64_t a_i = ab[(uint32_t)4U * i];
  269|   288k|            uint64_t *res_i0 = res_j + (uint32_t)4U * i;
  270|   288k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, a_j, c, res_i0);
  271|   288k|            uint64_t a_i0 = ab[(uint32_t)4U * i + (uint32_t)1U];
  272|   288k|            uint64_t *res_i1 = res_j + (uint32_t)4U * i + (uint32_t)1U;
  273|   288k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, a_j, c, res_i1);
  274|   288k|            uint64_t a_i1 = ab[(uint32_t)4U * i + (uint32_t)2U];
  275|   288k|            uint64_t *res_i2 = res_j + (uint32_t)4U * i + (uint32_t)2U;
  276|   288k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, a_j, c, res_i2);
  277|   288k|            uint64_t a_i2 = ab[(uint32_t)4U * i + (uint32_t)3U];
  278|   288k|            uint64_t *res_i = res_j + (uint32_t)4U * i + (uint32_t)3U;
  279|   288k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, a_j, c, res_i);
  280|   288k|        } for (uint32_t i = i0 / (uint32_t)4U * (uint32_t)4U; i < i0; i++) {
  281|   288k|            uint64_t a_i = ab[i];
  282|   288k|            uint64_t *res_i = res_j + i;
  283|   288k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, a_j, c, res_i);
  284|   288k|        } uint64_t r = c;
  285|   288k|        res[i0 + i0] = r;);
  286|   288k|    uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, res, res);
  287|   288k|    KRML_HOST_IGNORE(c0);
  ------------------
  |  |   56|   288k|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
  288|   288k|    uint64_t tmp[8U] = { 0U };
  289|   288k|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|   288k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|   288k|    do {                               \
  |  |  |  |  289|   288k|        uint32_t i = z;                \
  |  |  |  |  290|   288k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   288k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  290|   288k|                    (uint32_t)0U,
  291|   288k|                    (uint32_t)4U,
  292|   288k|                    (uint32_t)1U,
  293|   288k|                    FStar_UInt128_uint128 res1 = FStar_UInt128_mul_wide(x[i], x[i]);
  294|   288k|                    uint64_t hi = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res1, (uint32_t)64U));
  295|   288k|                    uint64_t lo = FStar_UInt128_uint128_to_uint64(res1);
  296|   288k|                    tmp[(uint32_t)2U * i] = lo;
  297|   288k|                    tmp[(uint32_t)2U * i + (uint32_t)1U] = hi;);
  298|   288k|    uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64((uint32_t)8U, res, tmp, res);
  299|   288k|    KRML_HOST_IGNORE(c1);
  ------------------
  |  |   56|   288k|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
  300|   288k|}
Hacl_P256.c:mont_reduction:
  458|  1.25M|{
  459|  1.25M|    uint64_t n[4U] = { 0U };
  460|  1.25M|    make_prime(n);
  461|  1.25M|    uint64_t c0 = (uint64_t)0U;
  462|  1.25M|    KRML_MAYBE_FOR4(
  ------------------
  |  |  330|  1.25M|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.25M|    do {                               \
  |  |  |  |  289|  1.25M|        uint32_t i = z;                \
  |  |  |  |  290|  1.25M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.25M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  1.25M|        i0,
  464|  1.25M|        (uint32_t)0U,
  465|  1.25M|        (uint32_t)4U,
  466|  1.25M|        (uint32_t)1U,
  467|  1.25M|        uint64_t qj = (uint64_t)1U * x[i0];
  468|  1.25M|        uint64_t *res_j0 = x + i0;
  469|  1.25M|        uint64_t c = (uint64_t)0U;
  470|  1.25M|        {
  471|  1.25M|            uint64_t a_i = n[(uint32_t)4U * (uint32_t)0U];
  472|  1.25M|            uint64_t *res_i0 = res_j0 + (uint32_t)4U * (uint32_t)0U;
  473|  1.25M|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i0);
  474|  1.25M|            uint64_t a_i0 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  475|  1.25M|            uint64_t *res_i1 = res_j0 + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
  476|  1.25M|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, qj, c, res_i1);
  477|  1.25M|            uint64_t a_i1 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  478|  1.25M|            uint64_t *res_i2 = res_j0 + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
  479|  1.25M|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, qj, c, res_i2);
  480|  1.25M|            uint64_t a_i2 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  481|  1.25M|            uint64_t *res_i = res_j0 + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
  482|  1.25M|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, qj, c, res_i);
  483|  1.25M|        } uint64_t r = c;
  484|  1.25M|        uint64_t c1 = r;
  485|  1.25M|        uint64_t *resb = x + (uint32_t)4U + i0;
  486|  1.25M|        uint64_t res_j = x[(uint32_t)4U + i0];
  487|  1.25M|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, c1, res_j, resb););
  488|  1.25M|    memcpy(res, x + (uint32_t)4U, (uint32_t)4U * sizeof(uint64_t));
  489|  1.25M|    uint64_t c00 = c0;
  490|  1.25M|    uint64_t tmp[4U] = { 0U };
  491|  1.25M|    uint64_t c = (uint64_t)0U;
  492|  1.25M|    {
  493|  1.25M|        uint64_t t1 = res[(uint32_t)4U * (uint32_t)0U];
  494|  1.25M|        uint64_t t20 = n[(uint32_t)4U * (uint32_t)0U];
  495|  1.25M|        uint64_t *res_i0 = tmp + (uint32_t)4U * (uint32_t)0U;
  496|  1.25M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0);
  ------------------
  |  |   89|  1.25M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  497|  1.25M|        uint64_t t10 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  498|  1.25M|        uint64_t t21 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  499|  1.25M|        uint64_t *res_i1 = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
  500|  1.25M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1);
  ------------------
  |  |   89|  1.25M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  501|  1.25M|        uint64_t t11 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  502|  1.25M|        uint64_t t22 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  503|  1.25M|        uint64_t *res_i2 = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
  504|  1.25M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2);
  ------------------
  |  |   89|  1.25M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  505|  1.25M|        uint64_t t12 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  506|  1.25M|        uint64_t t2 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  507|  1.25M|        uint64_t *res_i = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
  508|  1.25M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i);
  ------------------
  |  |   89|  1.25M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  509|  1.25M|    }
  510|  1.25M|    uint64_t c1 = c;
  511|  1.25M|    uint64_t c2 = c00 - c1;
  512|  1.25M|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|  1.25M|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.25M|    do {                               \
  |  |  |  |  289|  1.25M|        uint32_t i = z;                \
  |  |  |  |  290|  1.25M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.25M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  513|  1.25M|                    (uint32_t)0U,
  514|  1.25M|                    (uint32_t)4U,
  515|  1.25M|                    (uint32_t)1U,
  516|  1.25M|                    uint64_t *os = res;
  517|  1.25M|                    uint64_t x1 = (c2 & res[i]) | (~c2 & tmp[i]);
  518|  1.25M|                    os[i] = x1;);
  519|  1.25M|}
Hacl_P256.c:make_prime:
  336|  3.30M|{
  337|  3.30M|    n[0U] = (uint64_t)0xffffffffffffffffU;
  338|  3.30M|    n[1U] = (uint64_t)0xffffffffU;
  339|  3.30M|    n[2U] = (uint64_t)0x0U;
  340|  3.30M|    n[3U] = (uint64_t)0xffffffff00000001U;
  341|  3.30M|}
Hacl_P256.c:fmul0:
  523|   986k|{
  524|   986k|    uint64_t tmp[8U] = { 0U };
  525|   986k|    bn_mul4(tmp, x, y);
  526|   986k|    mont_reduction(res, tmp);
  527|   986k|}
Hacl_P256.c:bn_mul4:
  227|   989k|{
  228|   989k|    memset(res, 0U, (uint32_t)8U * sizeof(uint64_t));
  229|   989k|    KRML_MAYBE_FOR4(
  ------------------
  |  |  330|   989k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|   989k|    do {                               \
  |  |  |  |  289|   989k|        uint32_t i = z;                \
  |  |  |  |  290|   989k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   989k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  230|   989k|        i0,
  231|   989k|        (uint32_t)0U,
  232|   989k|        (uint32_t)4U,
  233|   989k|        (uint32_t)1U,
  234|   989k|        uint64_t bj = y[i0];
  235|   989k|        uint64_t *res_j = res + i0;
  236|   989k|        uint64_t c = (uint64_t)0U;
  237|   989k|        {
  238|   989k|            uint64_t a_i = x[(uint32_t)4U * (uint32_t)0U];
  239|   989k|            uint64_t *res_i0 = res_j + (uint32_t)4U * (uint32_t)0U;
  240|   989k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, bj, c, res_i0);
  241|   989k|            uint64_t a_i0 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  242|   989k|            uint64_t *res_i1 = res_j + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
  243|   989k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, bj, c, res_i1);
  244|   989k|            uint64_t a_i1 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  245|   989k|            uint64_t *res_i2 = res_j + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
  246|   989k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, bj, c, res_i2);
  247|   989k|            uint64_t a_i2 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  248|   989k|            uint64_t *res_i = res_j + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
  249|   989k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, bj, c, res_i);
  250|   989k|        } uint64_t r = c;
  251|   989k|        res[(uint32_t)4U + i0] = r;);
  252|   989k|}
Hacl_P256.c:fadd0:
  433|  1.44M|{
  434|  1.44M|    uint64_t n[4U] = { 0U };
  435|  1.44M|    make_prime(n);
  436|  1.44M|    bn_add_mod4(res, n, x, y);
  437|  1.44M|}
Hacl_P256.c:bn_add_mod4:
   92|  1.44M|{
   93|  1.44M|    uint64_t c0 = (uint64_t)0U;
   94|  1.44M|    {
   95|  1.44M|        uint64_t t1 = x[(uint32_t)4U * (uint32_t)0U];
   96|  1.44M|        uint64_t t20 = y[(uint32_t)4U * (uint32_t)0U];
   97|  1.44M|        uint64_t *res_i0 = res + (uint32_t)4U * (uint32_t)0U;
   98|  1.44M|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, t1, t20, res_i0);
  ------------------
  |  |   66|  1.44M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
   99|  1.44M|        uint64_t t10 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  100|  1.44M|        uint64_t t21 = y[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  101|  1.44M|        uint64_t *res_i1 = res + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
  102|  1.44M|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, t10, t21, res_i1);
  ------------------
  |  |   66|  1.44M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  103|  1.44M|        uint64_t t11 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  104|  1.44M|        uint64_t t22 = y[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  105|  1.44M|        uint64_t *res_i2 = res + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
  106|  1.44M|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, t11, t22, res_i2);
  ------------------
  |  |   66|  1.44M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  107|  1.44M|        uint64_t t12 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  108|  1.44M|        uint64_t t2 = y[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  109|  1.44M|        uint64_t *res_i = res + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
  110|  1.44M|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, t12, t2, res_i);
  ------------------
  |  |   66|  1.44M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  111|  1.44M|    }
  112|  1.44M|    uint64_t c00 = c0;
  113|  1.44M|    uint64_t tmp[4U] = { 0U };
  114|  1.44M|    uint64_t c = (uint64_t)0U;
  115|  1.44M|    {
  116|  1.44M|        uint64_t t1 = res[(uint32_t)4U * (uint32_t)0U];
  117|  1.44M|        uint64_t t20 = n[(uint32_t)4U * (uint32_t)0U];
  118|  1.44M|        uint64_t *res_i0 = tmp + (uint32_t)4U * (uint32_t)0U;
  119|  1.44M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0);
  ------------------
  |  |   89|  1.44M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  120|  1.44M|        uint64_t t10 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  121|  1.44M|        uint64_t t21 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  122|  1.44M|        uint64_t *res_i1 = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
  123|  1.44M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1);
  ------------------
  |  |   89|  1.44M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  124|  1.44M|        uint64_t t11 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  125|  1.44M|        uint64_t t22 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  126|  1.44M|        uint64_t *res_i2 = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
  127|  1.44M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2);
  ------------------
  |  |   89|  1.44M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  128|  1.44M|        uint64_t t12 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  129|  1.44M|        uint64_t t2 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  130|  1.44M|        uint64_t *res_i = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
  131|  1.44M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i);
  ------------------
  |  |   89|  1.44M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  132|  1.44M|    }
  133|  1.44M|    uint64_t c1 = c;
  134|  1.44M|    uint64_t c2 = c00 - c1;
  135|  1.44M|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|  1.44M|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.44M|    do {                               \
  |  |  |  |  289|  1.44M|        uint32_t i = z;                \
  |  |  |  |  290|  1.44M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.44M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|  1.44M|                    (uint32_t)0U,
  137|  1.44M|                    (uint32_t)4U,
  138|  1.44M|                    (uint32_t)1U,
  139|  1.44M|                    uint64_t *os = res;
  140|  1.44M|                    uint64_t x1 = (c2 & res[i]) | (~c2 & tmp[i]);
  141|  1.44M|                    os[i] = x1;);
  142|  1.44M|}
Hacl_P256.c:fmul_by_b_coeff:
  555|   173k|{
  556|   173k|    uint64_t b_coeff[4U] = { 0U };
  557|   173k|    make_b_coeff(b_coeff);
  558|   173k|    fmul0(res, b_coeff, x);
  559|   173k|}
Hacl_P256.c:make_b_coeff:
  363|   174k|{
  364|   174k|    b[0U] = (uint64_t)0xd89cdf6229c4bddfU;
  365|   174k|    b[1U] = (uint64_t)0xacf005cd78843090U;
  366|   174k|    b[2U] = (uint64_t)0xe5a220abf7212ed6U;
  367|   174k|    b[3U] = (uint64_t)0xdc30061d04874834U;
  368|   174k|}
Hacl_P256.c:fsub0:
  441|   603k|{
  442|   603k|    uint64_t n[4U] = { 0U };
  443|   603k|    make_prime(n);
  444|   603k|    bn_sub_mod4(res, n, x, y);
  445|   603k|}
Hacl_P256.c:bn_sub_mod4:
  172|   603k|{
  173|   603k|    uint64_t c0 = (uint64_t)0U;
  174|   603k|    {
  175|   603k|        uint64_t t1 = x[(uint32_t)4U * (uint32_t)0U];
  176|   603k|        uint64_t t20 = y[(uint32_t)4U * (uint32_t)0U];
  177|   603k|        uint64_t *res_i0 = res + (uint32_t)4U * (uint32_t)0U;
  178|   603k|        c0 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c0, t1, t20, res_i0);
  ------------------
  |  |   89|   603k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  179|   603k|        uint64_t t10 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  180|   603k|        uint64_t t21 = y[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  181|   603k|        uint64_t *res_i1 = res + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
  182|   603k|        c0 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c0, t10, t21, res_i1);
  ------------------
  |  |   89|   603k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  183|   603k|        uint64_t t11 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  184|   603k|        uint64_t t22 = y[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  185|   603k|        uint64_t *res_i2 = res + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
  186|   603k|        c0 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c0, t11, t22, res_i2);
  ------------------
  |  |   89|   603k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  187|   603k|        uint64_t t12 = x[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  188|   603k|        uint64_t t2 = y[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  189|   603k|        uint64_t *res_i = res + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
  190|   603k|        c0 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c0, t12, t2, res_i);
  ------------------
  |  |   89|   603k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  191|   603k|    }
  192|   603k|    uint64_t c00 = c0;
  193|   603k|    uint64_t tmp[4U] = { 0U };
  194|   603k|    uint64_t c = (uint64_t)0U;
  195|   603k|    {
  196|   603k|        uint64_t t1 = res[(uint32_t)4U * (uint32_t)0U];
  197|   603k|        uint64_t t20 = n[(uint32_t)4U * (uint32_t)0U];
  198|   603k|        uint64_t *res_i0 = tmp + (uint32_t)4U * (uint32_t)0U;
  199|   603k|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t20, res_i0);
  ------------------
  |  |   66|   603k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  200|   603k|        uint64_t t10 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  201|   603k|        uint64_t t21 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
  202|   603k|        uint64_t *res_i1 = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
  203|   603k|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t10, t21, res_i1);
  ------------------
  |  |   66|   603k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  204|   603k|        uint64_t t11 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  205|   603k|        uint64_t t22 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
  206|   603k|        uint64_t *res_i2 = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
  207|   603k|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t11, t22, res_i2);
  ------------------
  |  |   66|   603k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  208|   603k|        uint64_t t12 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  209|   603k|        uint64_t t2 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
  210|   603k|        uint64_t *res_i = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
  211|   603k|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i);
  ------------------
  |  |   66|   603k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  212|   603k|    }
  213|   603k|    uint64_t c1 = c;
  214|   603k|    KRML_HOST_IGNORE(c1);
  ------------------
  |  |   56|   603k|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
  215|   603k|    uint64_t c2 = (uint64_t)0U - c00;
  216|   603k|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|   603k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|   603k|    do {                               \
  |  |  |  |  289|   603k|        uint32_t i = z;                \
  |  |  |  |  290|   603k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   603k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|   603k|                    (uint32_t)0U,
  218|   603k|                    (uint32_t)4U,
  219|   603k|                    (uint32_t)1U,
  220|   603k|                    uint64_t *os = res;
  221|   603k|                    uint64_t x1 = (c2 & tmp[i]) | (~c2 & res[i]);
  222|   603k|                    os[i] = x1;);
  223|   603k|}
Hacl_P256.c:precomp_get_consttime:
 1020|  10.8k|{
 1021|  10.8k|    memcpy(tmp, (uint64_t *)table, (uint32_t)12U * sizeof(uint64_t));
 1022|  10.8k|    KRML_MAYBE_FOR15(i0,
  ------------------
  |  |  396|  10.8k|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|  10.8k|    do {                               \
  |  |  |  |  289|  10.8k|        uint32_t i = z;                \
  |  |  |  |  290|  10.8k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  10.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1023|  10.8k|                     (uint32_t)0U,
 1024|  10.8k|                     (uint32_t)15U,
 1025|  10.8k|                     (uint32_t)1U,
 1026|  10.8k|                     uint64_t c = FStar_UInt64_eq_mask(bits_l, (uint64_t)(i0 + (uint32_t)1U));
 1027|  10.8k|                     const uint64_t *res_j = table + (i0 + (uint32_t)1U) * (uint32_t)12U;
 1028|  10.8k|                     KRML_MAYBE_FOR12(i,
 1029|  10.8k|                                      (uint32_t)0U,
 1030|  10.8k|                                      (uint32_t)12U,
 1031|  10.8k|                                      (uint32_t)1U,
 1032|  10.8k|                                      uint64_t *os = tmp;
 1033|  10.8k|                                      uint64_t x = (c & res_j[i]) | (~c & tmp[i]);
 1034|  10.8k|                                      os[i] = x;););
 1035|  10.8k|}
Hacl_P256.c:point_add:
  898|  27.0k|{
  899|  27.0k|    uint64_t tmp[36U] = { 0U };
  900|  27.0k|    uint64_t *t0 = tmp;
  901|  27.0k|    uint64_t *t1 = tmp + (uint32_t)24U;
  902|  27.0k|    uint64_t *x3 = t1;
  903|  27.0k|    uint64_t *y3 = t1 + (uint32_t)4U;
  904|  27.0k|    uint64_t *z3 = t1 + (uint32_t)8U;
  905|  27.0k|    uint64_t *t01 = t0;
  906|  27.0k|    uint64_t *t11 = t0 + (uint32_t)4U;
  907|  27.0k|    uint64_t *t2 = t0 + (uint32_t)8U;
  908|  27.0k|    uint64_t *t3 = t0 + (uint32_t)12U;
  909|  27.0k|    uint64_t *t4 = t0 + (uint32_t)16U;
  910|  27.0k|    uint64_t *t5 = t0 + (uint32_t)20U;
  911|  27.0k|    uint64_t *x1 = p;
  912|  27.0k|    uint64_t *y1 = p + (uint32_t)4U;
  913|  27.0k|    uint64_t *z10 = p + (uint32_t)8U;
  914|  27.0k|    uint64_t *x20 = q;
  915|  27.0k|    uint64_t *y20 = q + (uint32_t)4U;
  916|  27.0k|    uint64_t *z20 = q + (uint32_t)8U;
  917|  27.0k|    fmul0(t01, x1, x20);
  918|  27.0k|    fmul0(t11, y1, y20);
  919|  27.0k|    fmul0(t2, z10, z20);
  920|  27.0k|    fadd0(t3, x1, y1);
  921|  27.0k|    fadd0(t4, x20, y20);
  922|  27.0k|    fmul0(t3, t3, t4);
  923|  27.0k|    fadd0(t4, t01, t11);
  924|  27.0k|    uint64_t *y10 = p + (uint32_t)4U;
  925|  27.0k|    uint64_t *z11 = p + (uint32_t)8U;
  926|  27.0k|    uint64_t *y2 = q + (uint32_t)4U;
  927|  27.0k|    uint64_t *z21 = q + (uint32_t)8U;
  928|  27.0k|    fsub0(t3, t3, t4);
  929|  27.0k|    fadd0(t4, y10, z11);
  930|  27.0k|    fadd0(t5, y2, z21);
  931|  27.0k|    fmul0(t4, t4, t5);
  932|  27.0k|    fadd0(t5, t11, t2);
  933|  27.0k|    fsub0(t4, t4, t5);
  934|  27.0k|    uint64_t *x10 = p;
  935|  27.0k|    uint64_t *z1 = p + (uint32_t)8U;
  936|  27.0k|    uint64_t *x2 = q;
  937|  27.0k|    uint64_t *z2 = q + (uint32_t)8U;
  938|  27.0k|    fadd0(x3, x10, z1);
  939|  27.0k|    fadd0(y3, x2, z2);
  940|  27.0k|    fmul0(x3, x3, y3);
  941|  27.0k|    fadd0(y3, t01, t2);
  942|  27.0k|    fsub0(y3, x3, y3);
  943|  27.0k|    fmul_by_b_coeff(z3, t2);
  944|  27.0k|    fsub0(x3, y3, z3);
  945|  27.0k|    fadd0(z3, x3, x3);
  946|  27.0k|    fadd0(x3, x3, z3);
  947|  27.0k|    fsub0(z3, t11, x3);
  948|  27.0k|    fadd0(x3, t11, x3);
  949|  27.0k|    fmul_by_b_coeff(y3, y3);
  950|  27.0k|    fadd0(t11, t2, t2);
  951|  27.0k|    fadd0(t2, t11, t2);
  952|  27.0k|    fsub0(y3, y3, t2);
  953|  27.0k|    fsub0(y3, y3, t01);
  954|  27.0k|    fadd0(t11, y3, y3);
  955|  27.0k|    fadd0(y3, t11, y3);
  956|  27.0k|    fadd0(t11, t01, t01);
  957|  27.0k|    fadd0(t01, t11, t01);
  958|  27.0k|    fsub0(t01, t01, t2);
  959|  27.0k|    fmul0(t11, t4, y3);
  960|  27.0k|    fmul0(t2, t01, y3);
  961|  27.0k|    fmul0(y3, x3, z3);
  962|  27.0k|    fadd0(y3, y3, t2);
  963|  27.0k|    fmul0(x3, t3, x3);
  964|  27.0k|    fsub0(x3, x3, t11);
  965|  27.0k|    fmul0(z3, t4, z3);
  966|  27.0k|    fmul0(t11, t3, t01);
  967|  27.0k|    fadd0(z3, z3, t11);
  968|  27.0k|    memcpy(res, t1, (uint32_t)12U * sizeof(uint64_t));
  969|  27.0k|}
Hacl_P256.c:point_store:
  763|    288|{
  764|    288|    uint64_t aff_p[8U] = { 0U };
  765|    288|    to_aff_point(aff_p, p);
  766|    288|    aff_point_store(res, aff_p);
  767|    288|}
Hacl_P256.c:to_aff_point:
  692|    288|{
  693|    288|    uint64_t zinv[4U] = { 0U };
  694|    288|    uint64_t *px = p;
  695|    288|    uint64_t *py = p + (uint32_t)4U;
  696|    288|    uint64_t *pz = p + (uint32_t)8U;
  697|    288|    uint64_t *x = res;
  698|    288|    uint64_t *y = res + (uint32_t)4U;
  699|    288|    finv(zinv, pz);
  700|    288|    fmul0(x, px, zinv);
  701|    288|    fmul0(y, py, zinv);
  702|    288|    from_mont(x, x);
  703|    288|    from_mont(y, y);
  704|    288|}
Hacl_P256.c:finv:
  570|    354|{
  571|    354|    uint64_t tmp[16U] = { 0U };
  572|    354|    uint64_t *x30 = tmp;
  573|    354|    uint64_t *x2 = tmp + (uint32_t)4U;
  574|    354|    uint64_t *tmp1 = tmp + (uint32_t)8U;
  575|    354|    uint64_t *tmp2 = tmp + (uint32_t)12U;
  576|    354|    memcpy(x2, a, (uint32_t)4U * sizeof(uint64_t));
  577|    354|    {
  578|    354|        fsqr0(x2, x2);
  579|    354|    }
  580|    354|    fmul0(x2, x2, a);
  581|    354|    memcpy(x30, x2, (uint32_t)4U * sizeof(uint64_t));
  582|    354|    {
  583|    354|        fsqr0(x30, x30);
  584|    354|    }
  585|    354|    fmul0(x30, x30, a);
  586|    354|    memcpy(tmp1, x30, (uint32_t)4U * sizeof(uint64_t));
  587|    354|    KRML_MAYBE_FOR3(i, (uint32_t)0U, (uint32_t)3U, (uint32_t)1U, fsqr0(tmp1, tmp1););
  ------------------
  |  |  324|    354|#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x)
  |  |  ------------------
  |  |  |  |  288|    354|    do {                               \
  |  |  |  |  289|    354|        uint32_t i = z;                \
  |  |  |  |  290|    354|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    354|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  588|    354|    fmul0(tmp1, tmp1, x30);
  589|    354|    memcpy(tmp2, tmp1, (uint32_t)4U * sizeof(uint64_t));
  590|    354|    KRML_MAYBE_FOR6(i, (uint32_t)0U, (uint32_t)6U, (uint32_t)1U, fsqr0(tmp2, tmp2););
  ------------------
  |  |  342|    354|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|    354|    do {                               \
  |  |  |  |  289|    354|        uint32_t i = z;                \
  |  |  |  |  290|    354|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    354|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  591|    354|    fmul0(tmp2, tmp2, tmp1);
  592|    354|    memcpy(tmp1, tmp2, (uint32_t)4U * sizeof(uint64_t));
  593|    354|    KRML_MAYBE_FOR3(i, (uint32_t)0U, (uint32_t)3U, (uint32_t)1U, fsqr0(tmp1, tmp1););
  ------------------
  |  |  324|    354|#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x)
  |  |  ------------------
  |  |  |  |  288|    354|    do {                               \
  |  |  |  |  289|    354|        uint32_t i = z;                \
  |  |  |  |  290|    354|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    354|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|    354|    fmul0(tmp1, tmp1, x30);
  595|    354|    memcpy(x30, tmp1, (uint32_t)4U * sizeof(uint64_t));
  596|    354|    KRML_MAYBE_FOR15(i, (uint32_t)0U, (uint32_t)15U, (uint32_t)1U, fsqr0(x30, x30););
  ------------------
  |  |  396|    354|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|    354|    do {                               \
  |  |  |  |  289|    354|        uint32_t i = z;                \
  |  |  |  |  290|    354|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    354|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  597|    354|    fmul0(x30, x30, tmp1);
  598|    354|    memcpy(tmp1, x30, (uint32_t)4U * sizeof(uint64_t));
  599|    354|    KRML_MAYBE_FOR2(i, (uint32_t)0U, (uint32_t)2U, (uint32_t)1U, fsqr0(tmp1, tmp1););
  ------------------
  |  |  318|    354|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|    354|    do {                               \
  |  |  |  |  289|    354|        uint32_t i = z;                \
  |  |  |  |  290|    354|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    354|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  600|    354|    fmul0(tmp1, tmp1, x2);
  601|    354|    memcpy(x2, tmp1, (uint32_t)4U * sizeof(uint64_t));
  602|  11.6k|    for (uint32_t i = (uint32_t)0U; i < (uint32_t)32U; i++) {
  ------------------
  |  Branch (602:37): [True: 11.3k, False: 354]
  ------------------
  603|  11.3k|        fsqr0(x2, x2);
  604|  11.3k|    }
  605|    354|    fmul0(x2, x2, a);
  606|  45.6k|    for (uint32_t i = (uint32_t)0U; i < (uint32_t)128U; i++) {
  ------------------
  |  Branch (606:37): [True: 45.3k, False: 354]
  ------------------
  607|  45.3k|        fsqr0(x2, x2);
  608|  45.3k|    }
  609|    354|    fmul0(x2, x2, tmp1);
  610|  11.6k|    for (uint32_t i = (uint32_t)0U; i < (uint32_t)32U; i++) {
  ------------------
  |  Branch (610:37): [True: 11.3k, False: 354]
  ------------------
  611|  11.3k|        fsqr0(x2, x2);
  612|  11.3k|    }
  613|    354|    fmul0(x2, x2, tmp1);
  614|  10.9k|    for (uint32_t i = (uint32_t)0U; i < (uint32_t)30U; i++) {
  ------------------
  |  Branch (614:37): [True: 10.6k, False: 354]
  ------------------
  615|  10.6k|        fsqr0(x2, x2);
  616|  10.6k|    }
  617|    354|    fmul0(x2, x2, x30);
  618|    354|    KRML_MAYBE_FOR2(i, (uint32_t)0U, (uint32_t)2U, (uint32_t)1U, fsqr0(x2, x2););
  ------------------
  |  |  318|    354|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|    354|    do {                               \
  |  |  |  |  289|    354|        uint32_t i = z;                \
  |  |  |  |  290|    354|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    354|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  619|    354|    fmul0(tmp1, x2, a);
  620|    354|    memcpy(res, tmp1, (uint32_t)4U * sizeof(uint64_t));
  621|    354|}
Hacl_P256.c:from_mont:
  539|    642|{
  540|    642|    uint64_t tmp[8U] = { 0U };
  541|    642|    memcpy(tmp, a, (uint32_t)4U * sizeof(uint64_t));
  542|    642|    mont_reduction(res, tmp);
  543|    642|}
Hacl_P256.c:aff_point_store:
  755|    288|{
  756|    288|    uint64_t *px = p;
  757|    288|    uint64_t *py = p + (uint32_t)4U;
  758|    288|    bn2_to_bytes_be4(res, px, py);
  759|    288|}
Hacl_P256.c:bn2_to_bytes_be4:
  329|    288|{
  330|    288|    bn_to_bytes_be4(res, x);
  331|    288|    bn_to_bytes_be4(res + (uint32_t)32U, y);
  332|    288|}
Hacl_P256.c:load_point_vartime:
  792|    678|{
  793|    678|    uint64_t p_aff[8U] = { 0U };
  794|    678|    bool res = aff_point_load_vartime(p_aff, b);
  795|    678|    if (res) {
  ------------------
  |  Branch (795:9): [True: 551, False: 127]
  ------------------
  796|    551|        to_proj_point(p, p_aff);
  797|    551|    }
  798|    678|    return res;
  799|    678|}
Hacl_P256.c:aff_point_load_vartime:
  771|    678|{
  772|    678|    uint8_t *p_x = b;
  773|    678|    uint8_t *p_y = b + (uint32_t)32U;
  774|    678|    uint64_t *bn_p_x = p;
  775|    678|    uint64_t *bn_p_y = p + (uint32_t)4U;
  776|    678|    bn_from_bytes_be4(bn_p_x, p_x);
  777|    678|    bn_from_bytes_be4(bn_p_y, p_y);
  778|    678|    uint64_t *px = p;
  779|    678|    uint64_t *py = p + (uint32_t)4U;
  780|    678|    uint64_t lessX = bn_is_lt_prime_mask4(px);
  781|    678|    uint64_t lessY = bn_is_lt_prime_mask4(py);
  782|    678|    uint64_t res = lessX & lessY;
  783|    678|    bool is_xy_valid = res == (uint64_t)0xFFFFFFFFFFFFFFFFU;
  784|    678|    if (!is_xy_valid) {
  ------------------
  |  Branch (784:9): [True: 7, False: 671]
  ------------------
  785|      7|        return false;
  786|      7|    }
  787|    671|    return is_on_curve_vartime(p);
  788|    678|}
Hacl_P256.c:bn_is_lt_prime_mask4:
  417|  1.35k|{
  418|  1.35k|    uint64_t tmp[4U] = { 0U };
  419|  1.35k|    make_prime(tmp);
  420|  1.35k|    uint64_t c = bn_sub4(tmp, f, tmp);
  421|  1.35k|    return (uint64_t)0U - c;
  422|  1.35k|}
Hacl_P256.c:is_on_curve_vartime:
  732|    671|{
  733|    671|    uint64_t rp[4U] = { 0U };
  734|    671|    uint64_t tx[4U] = { 0U };
  735|    671|    uint64_t ty[4U] = { 0U };
  736|    671|    uint64_t *px = p;
  737|    671|    uint64_t *py = p + (uint32_t)4U;
  738|    671|    to_mont(tx, px);
  739|    671|    to_mont(ty, py);
  740|    671|    uint64_t tmp[4U] = { 0U };
  741|    671|    fcube(rp, tx);
  742|    671|    make_a_coeff(tmp);
  743|    671|    fmul0(tmp, tmp, tx);
  744|    671|    fadd0(rp, tmp, rp);
  745|    671|    make_b_coeff(tmp);
  746|    671|    fadd0(rp, tmp, rp);
  747|    671|    fsqr0(ty, ty);
  748|    671|    uint64_t r = feq_mask(ty, rp);
  749|    671|    bool r0 = r == (uint64_t)0xFFFFFFFFFFFFFFFFU;
  750|    671|    return r0;
  751|    671|}
Hacl_P256.c:to_mont:
  547|  2.44k|{
  548|  2.44k|    uint64_t r2modn[4U] = { 0U };
  549|  2.44k|    make_fmont_R2(r2modn);
  550|  2.44k|    fmul0(res, a, r2modn);
  551|  2.44k|}
Hacl_P256.c:make_fmont_R2:
  390|  2.44k|{
  391|  2.44k|    n[0U] = (uint64_t)0x3U;
  392|  2.44k|    n[1U] = (uint64_t)0xfffffffbffffffffU;
  393|  2.44k|    n[2U] = (uint64_t)0xfffffffffffffffeU;
  394|  2.44k|    n[3U] = (uint64_t)0x4fffffffdU;
  395|  2.44k|}
Hacl_P256.c:fcube:
  563|    671|{
  564|    671|    fsqr0(res, x);
  565|    671|    fmul0(res, res, x);
  566|    671|}
Hacl_P256.c:make_a_coeff:
  354|    671|{
  355|    671|    a[0U] = (uint64_t)0xfffffffffffffffcU;
  356|    671|    a[1U] = (uint64_t)0x3ffffffffU;
  357|    671|    a[2U] = (uint64_t)0x0U;
  358|    671|    a[3U] = (uint64_t)0xfffffffc00000004U;
  359|    671|}
Hacl_P256.c:feq_mask:
  426|    671|{
  427|    671|    uint64_t r = bn_is_eq_mask4(a, b);
  428|    671|    return r;
  429|    671|}
Hacl_P256.c:bn_is_eq_mask4:
   57|    737|{
   58|    737|    uint64_t mask = (uint64_t)0xFFFFFFFFFFFFFFFFU;
   59|    737|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|    737|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|    737|    do {                               \
  |  |  |  |  289|    737|        uint32_t i = z;                \
  |  |  |  |  290|    737|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    737|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|    737|                    (uint32_t)0U,
   61|    737|                    (uint32_t)4U,
   62|    737|                    (uint32_t)1U,
   63|    737|                    uint64_t uu____0 = FStar_UInt64_eq_mask(a[i], b[i]);
   64|    737|                    mask = uu____0 & mask;);
   65|    737|    uint64_t mask1 = mask;
   66|    737|    return mask1;
   67|    737|}
Hacl_P256.c:to_proj_point:
  719|    551|{
  720|    551|    uint64_t *px = p;
  721|    551|    uint64_t *py = p + (uint32_t)4U;
  722|    551|    uint64_t *rx = res;
  723|    551|    uint64_t *ry = res + (uint32_t)4U;
  724|    551|    uint64_t *rz = res + (uint32_t)8U;
  725|    551|    to_mont(rx, px);
  726|    551|    to_mont(ry, py);
  727|    551|    make_fone(rz);
  728|    551|}
Hacl_P256.c:point_mul:
  973|    119|{
  974|    119|    uint64_t table[192U] = { 0U };
  975|    119|    uint64_t tmp[12U] = { 0U };
  976|    119|    uint64_t *t0 = table;
  977|    119|    uint64_t *t1 = table + (uint32_t)12U;
  978|    119|    make_point_at_inf(t0);
  979|    119|    memcpy(t1, p, (uint32_t)12U * sizeof(uint64_t));
  980|    119|    KRML_MAYBE_FOR7(i,
  ------------------
  |  |  348|    119|#define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 7, k, x)
  |  |  ------------------
  |  |  |  |  288|    119|    do {                               \
  |  |  |  |  289|    119|        uint32_t i = z;                \
  |  |  |  |  290|    119|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    119|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  981|    119|                    (uint32_t)0U,
  982|    119|                    (uint32_t)7U,
  983|    119|                    (uint32_t)1U,
  984|    119|                    uint64_t *t11 = table + (i + (uint32_t)1U) * (uint32_t)12U;
  985|    119|                    point_double(tmp, t11);
  986|    119|                    memcpy(table + ((uint32_t)2U * i + (uint32_t)2U) * (uint32_t)12U,
  987|    119|                           tmp,
  988|    119|                           (uint32_t)12U * sizeof(uint64_t));
  989|    119|                    uint64_t *t2 = table + ((uint32_t)2U * i + (uint32_t)2U) * (uint32_t)12U;
  990|    119|                    point_add(tmp, p, t2);
  991|    119|                    memcpy(table + ((uint32_t)2U * i + (uint32_t)3U) * (uint32_t)12U,
  992|    119|                           tmp,
  993|    119|                           (uint32_t)12U * sizeof(uint64_t)););
  994|    119|    make_point_at_inf(res);
  995|    119|    uint64_t tmp0[12U] = { 0U };
  996|  7.73k|    for (uint32_t i0 = (uint32_t)0U; i0 < (uint32_t)64U; i0++) {
  ------------------
  |  Branch (996:38): [True: 7.61k, False: 119]
  ------------------
  997|  7.61k|        KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, (uint32_t)1U, point_double(res, res););
  ------------------
  |  |  330|  7.61k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  7.61k|    do {                               \
  |  |  |  |  289|  7.61k|        uint32_t i = z;                \
  |  |  |  |  290|  7.61k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  7.61k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  998|  7.61k|        uint32_t k = (uint32_t)256U - (uint32_t)4U * i0 - (uint32_t)4U;
  999|  7.61k|        uint64_t bits_l = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)4U, scalar, k, (uint32_t)4U);
 1000|  7.61k|        memcpy(tmp0, (uint64_t *)table, (uint32_t)12U * sizeof(uint64_t));
 1001|  7.61k|        KRML_MAYBE_FOR15(i1,
  ------------------
  |  |  396|  7.61k|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|  7.61k|    do {                               \
  |  |  |  |  289|  7.61k|        uint32_t i = z;                \
  |  |  |  |  290|  7.61k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  7.61k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1002|  7.61k|                         (uint32_t)0U,
 1003|  7.61k|                         (uint32_t)15U,
 1004|  7.61k|                         (uint32_t)1U,
 1005|  7.61k|                         uint64_t c = FStar_UInt64_eq_mask(bits_l, (uint64_t)(i1 + (uint32_t)1U));
 1006|  7.61k|                         const uint64_t *res_j = table + (i1 + (uint32_t)1U) * (uint32_t)12U;
 1007|  7.61k|                         KRML_MAYBE_FOR12(i,
 1008|  7.61k|                                          (uint32_t)0U,
 1009|  7.61k|                                          (uint32_t)12U,
 1010|  7.61k|                                          (uint32_t)1U,
 1011|  7.61k|                                          uint64_t *os = tmp0;
 1012|  7.61k|                                          uint64_t x = (c & res_j[i]) | (~c & tmp0[i]);
 1013|  7.61k|                                          os[i] = x;););
 1014|  7.61k|        point_add(res, res, tmp0);
 1015|  7.61k|    }
 1016|    119|}
Hacl_P256.c:qmod_short:
 1178|    134|{
 1179|    134|    uint64_t tmp[4U] = { 0U };
 1180|    134|    make_order(tmp);
 1181|    134|    uint64_t c = bn_sub4(tmp, x, tmp);
 1182|    134|    bn_cmovznz4(res, c, tmp, x);
 1183|    134|}
Hacl_P256.c:bn_cmovznz4:
   78|    134|{
   79|    134|    uint64_t mask = ~FStar_UInt64_eq_mask(cin, (uint64_t)0U);
   80|    134|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|    134|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|    134|    do {                               \
  |  |  |  |  289|    134|        uint32_t i = z;                \
  |  |  |  |  290|    134|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    134|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|    134|                    (uint32_t)0U,
   82|    134|                    (uint32_t)4U,
   83|    134|                    (uint32_t)1U,
   84|    134|                    uint64_t *os = res;
   85|    134|                    uint64_t uu____0 = x[i];
   86|    134|                    uint64_t x1 = uu____0 ^ (mask & (y[i] ^ uu____0));
   87|    134|                    os[i] = x1;);
   88|    134|}
Hacl_P256.c:to_aff_point_x:
  708|     66|{
  709|     66|    uint64_t zinv[4U] = { 0U };
  710|     66|    uint64_t *px = p;
  711|     66|    uint64_t *pz = p + (uint32_t)8U;
  712|     66|    finv(zinv, pz);
  713|     66|    fmul0(res, px, zinv);
  714|     66|    from_mont(res, res);
  715|     66|}
Hacl_P256.c:qinv:
 1345|     66|{
 1346|     66|    uint64_t tmp[28U] = { 0U };
 1347|     66|    uint64_t *x6 = tmp;
 1348|     66|    uint64_t *x_11 = tmp + (uint32_t)4U;
 1349|     66|    uint64_t *x_101 = tmp + (uint32_t)8U;
 1350|     66|    uint64_t *x_111 = tmp + (uint32_t)12U;
 1351|     66|    uint64_t *x_1111 = tmp + (uint32_t)16U;
 1352|     66|    uint64_t *x_10101 = tmp + (uint32_t)20U;
 1353|     66|    uint64_t *x_101111 = tmp + (uint32_t)24U;
 1354|     66|    memcpy(x6, r, (uint32_t)4U * sizeof(uint64_t));
 1355|     66|    {
 1356|     66|        qsqr(x6, x6);
 1357|     66|    }
 1358|     66|    qmul(x_11, x6, r);
 1359|     66|    qmul(x_101, x6, x_11);
 1360|     66|    qmul(x_111, x6, x_101);
 1361|     66|    memcpy(x6, x_101, (uint32_t)4U * sizeof(uint64_t));
 1362|     66|    {
 1363|     66|        qsqr(x6, x6);
 1364|     66|    }
 1365|     66|    qmul(x_1111, x_101, x6);
 1366|     66|    {
 1367|     66|        qsqr(x6, x6);
 1368|     66|    }
 1369|     66|    qmul(x_10101, x6, r);
 1370|     66|    memcpy(x6, x_10101, (uint32_t)4U * sizeof(uint64_t));
 1371|     66|    {
 1372|     66|        qsqr(x6, x6);
 1373|     66|    }
 1374|     66|    qmul(x_101111, x_101, x6);
 1375|     66|    qmul(x6, x_10101, x6);
 1376|     66|    uint64_t tmp1[4U] = { 0U };
 1377|     66|    KRML_MAYBE_FOR2(i, (uint32_t)0U, (uint32_t)2U, (uint32_t)1U, qsqr(x6, x6););
  ------------------
  |  |  318|     66|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1378|     66|    qmul(x6, x6, x_11);
 1379|     66|    memcpy(tmp1, x6, (uint32_t)4U * sizeof(uint64_t));
 1380|     66|    KRML_MAYBE_FOR8(i, (uint32_t)0U, (uint32_t)8U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  354|     66|#define KRML_MAYBE_FOR8(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 8, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1381|     66|    qmul(tmp1, tmp1, x6);
 1382|     66|    memcpy(x6, tmp1, (uint32_t)4U * sizeof(uint64_t));
 1383|     66|    KRML_MAYBE_FOR16(i, (uint32_t)0U, (uint32_t)16U, (uint32_t)1U, qsqr(x6, x6););
  ------------------
  |  |  402|     66|#define KRML_MAYBE_FOR16(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 16, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1384|     66|    qmul(x6, x6, tmp1);
 1385|     66|    memcpy(tmp1, x6, (uint32_t)4U * sizeof(uint64_t));
 1386|  4.29k|    for (uint32_t i = (uint32_t)0U; i < (uint32_t)64U; i++) {
  ------------------
  |  Branch (1386:37): [True: 4.22k, False: 66]
  ------------------
 1387|  4.22k|        qsqr(tmp1, tmp1);
 1388|  4.22k|    }
 1389|     66|    qmul(tmp1, tmp1, x6);
 1390|  2.17k|    for (uint32_t i = (uint32_t)0U; i < (uint32_t)32U; i++) {
  ------------------
  |  Branch (1390:37): [True: 2.11k, False: 66]
  ------------------
 1391|  2.11k|        qsqr(tmp1, tmp1);
 1392|  2.11k|    }
 1393|     66|    qmul(tmp1, tmp1, x6);
 1394|     66|    KRML_MAYBE_FOR6(i, (uint32_t)0U, (uint32_t)6U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  342|     66|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1395|     66|    qmul(tmp1, tmp1, x_101111);
 1396|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1397|     66|    qmul(tmp1, tmp1, x_111);
 1398|     66|    KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  330|     66|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1399|     66|    qmul(tmp1, tmp1, x_11);
 1400|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1401|     66|    qmul(tmp1, tmp1, x_1111);
 1402|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1403|     66|    qmul(tmp1, tmp1, x_10101);
 1404|     66|    KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  330|     66|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1405|     66|    qmul(tmp1, tmp1, x_101);
 1406|     66|    KRML_MAYBE_FOR3(i, (uint32_t)0U, (uint32_t)3U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  324|     66|#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1407|     66|    qmul(tmp1, tmp1, x_101);
 1408|     66|    KRML_MAYBE_FOR3(i, (uint32_t)0U, (uint32_t)3U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  324|     66|#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1409|     66|    qmul(tmp1, tmp1, x_101);
 1410|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1411|     66|    qmul(tmp1, tmp1, x_111);
 1412|     66|    KRML_MAYBE_FOR9(i, (uint32_t)0U, (uint32_t)9U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  360|     66|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1413|     66|    qmul(tmp1, tmp1, x_101111);
 1414|     66|    KRML_MAYBE_FOR6(i, (uint32_t)0U, (uint32_t)6U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  342|     66|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1415|     66|    qmul(tmp1, tmp1, x_1111);
 1416|     66|    KRML_MAYBE_FOR2(i, (uint32_t)0U, (uint32_t)2U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  318|     66|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1417|     66|    qmul(tmp1, tmp1, r);
 1418|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1419|     66|    qmul(tmp1, tmp1, r);
 1420|     66|    KRML_MAYBE_FOR6(i, (uint32_t)0U, (uint32_t)6U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  342|     66|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1421|     66|    qmul(tmp1, tmp1, x_1111);
 1422|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1423|     66|    qmul(tmp1, tmp1, x_111);
 1424|     66|    KRML_MAYBE_FOR4(i, (uint32_t)0U, (uint32_t)4U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  330|     66|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1425|     66|    qmul(tmp1, tmp1, x_111);
 1426|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1427|     66|    qmul(tmp1, tmp1, x_111);
 1428|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1429|     66|    qmul(tmp1, tmp1, x_101);
 1430|     66|    KRML_MAYBE_FOR3(i, (uint32_t)0U, (uint32_t)3U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  324|     66|#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1431|     66|    qmul(tmp1, tmp1, x_11);
 1432|     66|    KRML_MAYBE_FOR10(i, (uint32_t)0U, (uint32_t)10U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  366|     66|#define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 10, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1433|     66|    qmul(tmp1, tmp1, x_101111);
 1434|     66|    KRML_MAYBE_FOR2(i, (uint32_t)0U, (uint32_t)2U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  318|     66|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1435|     66|    qmul(tmp1, tmp1, x_11);
 1436|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1437|     66|    qmul(tmp1, tmp1, x_11);
 1438|     66|    KRML_MAYBE_FOR5(i, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  336|     66|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1439|     66|    qmul(tmp1, tmp1, x_11);
 1440|     66|    KRML_MAYBE_FOR3(i, (uint32_t)0U, (uint32_t)3U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  324|     66|#define KRML_MAYBE_FOR3(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 3, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1441|     66|    qmul(tmp1, tmp1, r);
 1442|     66|    KRML_MAYBE_FOR7(i, (uint32_t)0U, (uint32_t)7U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  348|     66|#define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 7, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1443|     66|    qmul(tmp1, tmp1, x_10101);
 1444|     66|    KRML_MAYBE_FOR6(i, (uint32_t)0U, (uint32_t)6U, (uint32_t)1U, qsqr(tmp1, tmp1););
  ------------------
  |  |  342|     66|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1445|     66|    qmul(tmp1, tmp1, x_1111);
 1446|     66|    memcpy(x6, tmp1, (uint32_t)4U * sizeof(uint64_t));
 1447|     66|    memcpy(res, x6, (uint32_t)4U * sizeof(uint64_t));
 1448|     66|}
Hacl_P256.c:qsqr:
 1276|  16.7k|{
 1277|  16.7k|    uint64_t tmp[8U] = { 0U };
 1278|  16.7k|    bn_sqr4(tmp, x);
 1279|  16.7k|    qmont_reduction(res, tmp);
 1280|  16.7k|}
Hacl_P256.c:qmont_reduction:
 1195|  19.5k|{
 1196|  19.5k|    uint64_t n[4U] = { 0U };
 1197|  19.5k|    make_order(n);
 1198|  19.5k|    uint64_t c0 = (uint64_t)0U;
 1199|  19.5k|    KRML_MAYBE_FOR4(
  ------------------
  |  |  330|  19.5k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  19.5k|    do {                               \
  |  |  |  |  289|  19.5k|        uint32_t i = z;                \
  |  |  |  |  290|  19.5k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  19.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1200|  19.5k|        i0,
 1201|  19.5k|        (uint32_t)0U,
 1202|  19.5k|        (uint32_t)4U,
 1203|  19.5k|        (uint32_t)1U,
 1204|  19.5k|        uint64_t qj = (uint64_t)0xccd1c8aaee00bc4fU * x[i0];
 1205|  19.5k|        uint64_t *res_j0 = x + i0;
 1206|  19.5k|        uint64_t c = (uint64_t)0U;
 1207|  19.5k|        {
 1208|  19.5k|            uint64_t a_i = n[(uint32_t)4U * (uint32_t)0U];
 1209|  19.5k|            uint64_t *res_i0 = res_j0 + (uint32_t)4U * (uint32_t)0U;
 1210|  19.5k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i0);
 1211|  19.5k|            uint64_t a_i0 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
 1212|  19.5k|            uint64_t *res_i1 = res_j0 + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
 1213|  19.5k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, qj, c, res_i1);
 1214|  19.5k|            uint64_t a_i1 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
 1215|  19.5k|            uint64_t *res_i2 = res_j0 + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
 1216|  19.5k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, qj, c, res_i2);
 1217|  19.5k|            uint64_t a_i2 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
 1218|  19.5k|            uint64_t *res_i = res_j0 + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
 1219|  19.5k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, qj, c, res_i);
 1220|  19.5k|        } uint64_t r = c;
 1221|  19.5k|        uint64_t c1 = r;
 1222|  19.5k|        uint64_t *resb = x + (uint32_t)4U + i0;
 1223|  19.5k|        uint64_t res_j = x[(uint32_t)4U + i0];
 1224|  19.5k|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, c1, res_j, resb););
 1225|  19.5k|    memcpy(res, x + (uint32_t)4U, (uint32_t)4U * sizeof(uint64_t));
 1226|  19.5k|    uint64_t c00 = c0;
 1227|  19.5k|    uint64_t tmp[4U] = { 0U };
 1228|  19.5k|    uint64_t c = (uint64_t)0U;
 1229|  19.5k|    {
 1230|  19.5k|        uint64_t t1 = res[(uint32_t)4U * (uint32_t)0U];
 1231|  19.5k|        uint64_t t20 = n[(uint32_t)4U * (uint32_t)0U];
 1232|  19.5k|        uint64_t *res_i0 = tmp + (uint32_t)4U * (uint32_t)0U;
 1233|  19.5k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0);
  ------------------
  |  |   89|  19.5k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
 1234|  19.5k|        uint64_t t10 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
 1235|  19.5k|        uint64_t t21 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)1U];
 1236|  19.5k|        uint64_t *res_i1 = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)1U;
 1237|  19.5k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1);
  ------------------
  |  |   89|  19.5k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
 1238|  19.5k|        uint64_t t11 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
 1239|  19.5k|        uint64_t t22 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)2U];
 1240|  19.5k|        uint64_t *res_i2 = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)2U;
 1241|  19.5k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2);
  ------------------
  |  |   89|  19.5k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
 1242|  19.5k|        uint64_t t12 = res[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
 1243|  19.5k|        uint64_t t2 = n[(uint32_t)4U * (uint32_t)0U + (uint32_t)3U];
 1244|  19.5k|        uint64_t *res_i = tmp + (uint32_t)4U * (uint32_t)0U + (uint32_t)3U;
 1245|  19.5k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i);
  ------------------
  |  |   89|  19.5k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
 1246|  19.5k|    }
 1247|  19.5k|    uint64_t c1 = c;
 1248|  19.5k|    uint64_t c2 = c00 - c1;
 1249|  19.5k|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|  19.5k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  19.5k|    do {                               \
  |  |  |  |  289|  19.5k|        uint32_t i = z;                \
  |  |  |  |  290|  19.5k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  19.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1250|  19.5k|                    (uint32_t)0U,
 1251|  19.5k|                    (uint32_t)4U,
 1252|  19.5k|                    (uint32_t)1U,
 1253|  19.5k|                    uint64_t *os = res;
 1254|  19.5k|                    uint64_t x1 = (c2 & res[i]) | (~c2 & tmp[i]);
 1255|  19.5k|                    os[i] = x1;);
 1256|  19.5k|}
Hacl_P256.c:qmul:
 1268|  2.64k|{
 1269|  2.64k|    uint64_t tmp[8U] = { 0U };
 1270|  2.64k|    bn_mul4(tmp, x, y);
 1271|  2.64k|    qmont_reduction(res, tmp);
 1272|  2.64k|}
Hacl_P256.c:from_qmont:
 1260|    132|{
 1261|    132|    uint64_t tmp[8U] = { 0U };
 1262|    132|    memcpy(tmp, x, (uint32_t)4U * sizeof(uint64_t));
 1263|    132|    qmont_reduction(res, tmp);
 1264|    132|}
Hacl_P256.c:ecdsa_verify_msg_as_qelem:
 1464|     68|{
 1465|     68|    uint64_t tmp[28U] = { 0U };
 1466|     68|    uint64_t *pk = tmp;
 1467|     68|    uint64_t *r_q = tmp + (uint32_t)12U;
 1468|     68|    uint64_t *s_q = tmp + (uint32_t)16U;
 1469|     68|    uint64_t *u1 = tmp + (uint32_t)20U;
 1470|     68|    uint64_t *u2 = tmp + (uint32_t)24U;
 1471|     68|    bool is_pk_valid = load_point_vartime(pk, public_key);
 1472|     68|    bn_from_bytes_be4(r_q, signature_r);
 1473|     68|    bn_from_bytes_be4(s_q, signature_s);
 1474|     68|    uint64_t is_r_valid = bn_is_lt_order_and_gt_zero_mask4(r_q);
 1475|     68|    uint64_t is_s_valid = bn_is_lt_order_and_gt_zero_mask4(s_q);
 1476|     68|    bool
 1477|     68|        is_rs_valid =
 1478|     68|            is_r_valid == (uint64_t)0xFFFFFFFFFFFFFFFFU && is_s_valid == (uint64_t)0xFFFFFFFFFFFFFFFFU;
  ------------------
  |  Branch (1478:13): [True: 67, False: 1]
  |  Branch (1478:60): [True: 66, False: 1]
  ------------------
 1479|     68|    if (!(is_pk_valid && is_rs_valid)) {
  ------------------
  |  Branch (1479:11): [True: 68, False: 0]
  |  Branch (1479:26): [True: 66, False: 2]
  ------------------
 1480|      2|        return false;
 1481|      2|    }
 1482|     66|    uint64_t sinv[4U] = { 0U };
 1483|     66|    qinv(sinv, s_q);
 1484|     66|    qmul_mont(sinv, m_q, u1);
 1485|     66|    qmul_mont(sinv, r_q, u2);
 1486|     66|    uint64_t res[12U] = { 0U };
 1487|     66|    point_mul_double_g(res, u1, u2, pk);
 1488|     66|    if (is_point_at_inf_vartime(res)) {
  ------------------
  |  Branch (1488:9): [True: 0, False: 66]
  ------------------
 1489|      0|        return false;
 1490|      0|    }
 1491|     66|    uint64_t x[4U] = { 0U };
 1492|     66|    to_aff_point_x(x, res);
 1493|     66|    qmod_short(x, x);
 1494|     66|    bool res1 = bn_is_eq_vartime4(x, r_q);
 1495|     66|    return res1;
 1496|     66|}
Hacl_P256.c:qmul_mont:
 1452|    132|{
 1453|    132|    uint64_t tmp[4U] = { 0U };
 1454|    132|    from_qmont(tmp, b);
 1455|    132|    qmul(res, sinv, tmp);
 1456|    132|}
Hacl_P256.c:point_mul_double_g:
 1104|     66|{
 1105|     66|    uint64_t q1[12U] = { 0U };
 1106|     66|    make_base_point(q1);
 1107|     66|    uint64_t table2[384U] = { 0U };
 1108|     66|    uint64_t tmp[12U] = { 0U };
 1109|     66|    uint64_t *t0 = table2;
 1110|     66|    uint64_t *t1 = table2 + (uint32_t)12U;
 1111|     66|    make_point_at_inf(t0);
 1112|     66|    memcpy(t1, q2, (uint32_t)12U * sizeof(uint64_t));
 1113|     66|    KRML_MAYBE_FOR15(i,
  ------------------
  |  |  396|     66|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|     66|    do {                               \
  |  |  |  |  289|     66|        uint32_t i = z;                \
  |  |  |  |  290|     66|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     66|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1114|     66|                     (uint32_t)0U,
 1115|     66|                     (uint32_t)15U,
 1116|     66|                     (uint32_t)1U,
 1117|     66|                     uint64_t *t11 = table2 + (i + (uint32_t)1U) * (uint32_t)12U;
 1118|     66|                     point_double(tmp, t11);
 1119|     66|                     memcpy(table2 + ((uint32_t)2U * i + (uint32_t)2U) * (uint32_t)12U,
 1120|     66|                            tmp,
 1121|     66|                            (uint32_t)12U * sizeof(uint64_t));
 1122|     66|                     uint64_t *t2 = table2 + ((uint32_t)2U * i + (uint32_t)2U) * (uint32_t)12U;
 1123|     66|                     point_add(tmp, q2, t2);
 1124|     66|                     memcpy(table2 + ((uint32_t)2U * i + (uint32_t)3U) * (uint32_t)12U,
 1125|     66|                            tmp,
 1126|     66|                            (uint32_t)12U * sizeof(uint64_t)););
 1127|     66|    uint64_t tmp0[12U] = { 0U };
 1128|     66|    uint32_t i0 = (uint32_t)255U;
 1129|     66|    uint64_t bits_c = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)4U, scalar1, i0, (uint32_t)5U);
 1130|     66|    uint32_t bits_l32 = (uint32_t)bits_c;
 1131|     66|    const uint64_t
 1132|     66|        *a_bits_l = Hacl_P256_PrecompTable_precomp_basepoint_table_w5 + bits_l32 * (uint32_t)12U;
 1133|     66|    memcpy(res, (uint64_t *)a_bits_l, (uint32_t)12U * sizeof(uint64_t));
 1134|     66|    uint32_t i1 = (uint32_t)255U;
 1135|     66|    uint64_t bits_c0 = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)4U, scalar2, i1, (uint32_t)5U);
 1136|     66|    uint32_t bits_l320 = (uint32_t)bits_c0;
 1137|     66|    const uint64_t *a_bits_l0 = table2 + bits_l320 * (uint32_t)12U;
 1138|     66|    memcpy(tmp0, (uint64_t *)a_bits_l0, (uint32_t)12U * sizeof(uint64_t));
 1139|     66|    point_add(res, res, tmp0);
 1140|     66|    uint64_t tmp1[12U] = { 0U };
 1141|  3.43k|    for (uint32_t i = (uint32_t)0U; i < (uint32_t)51U; i++) {
  ------------------
  |  Branch (1141:37): [True: 3.36k, False: 66]
  ------------------
 1142|  3.36k|        KRML_MAYBE_FOR5(i2, (uint32_t)0U, (uint32_t)5U, (uint32_t)1U, point_double(res, res););
  ------------------
  |  |  336|  3.36k|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|  3.36k|    do {                               \
  |  |  |  |  289|  3.36k|        uint32_t i = z;                \
  |  |  |  |  290|  3.36k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  3.36k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1143|  3.36k|        uint32_t k = (uint32_t)255U - (uint32_t)5U * i - (uint32_t)5U;
 1144|  3.36k|        uint64_t bits_l = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)4U, scalar2, k, (uint32_t)5U);
 1145|  3.36k|        uint32_t bits_l321 = (uint32_t)bits_l;
 1146|  3.36k|        const uint64_t *a_bits_l1 = table2 + bits_l321 * (uint32_t)12U;
 1147|  3.36k|        memcpy(tmp1, (uint64_t *)a_bits_l1, (uint32_t)12U * sizeof(uint64_t));
 1148|  3.36k|        point_add(res, res, tmp1);
 1149|  3.36k|        uint32_t k0 = (uint32_t)255U - (uint32_t)5U * i - (uint32_t)5U;
 1150|  3.36k|        uint64_t bits_l0 = Hacl_Bignum_Lib_bn_get_bits_u64((uint32_t)4U, scalar1, k0, (uint32_t)5U);
 1151|  3.36k|        uint32_t bits_l322 = (uint32_t)bits_l0;
 1152|  3.36k|        const uint64_t
 1153|  3.36k|            *a_bits_l2 = Hacl_P256_PrecompTable_precomp_basepoint_table_w5 + bits_l322 * (uint32_t)12U;
 1154|  3.36k|        memcpy(tmp1, (uint64_t *)a_bits_l2, (uint32_t)12U * sizeof(uint64_t));
 1155|  3.36k|        point_add(res, res, tmp1);
 1156|  3.36k|    }
 1157|     66|}
Hacl_P256.c:is_point_at_inf_vartime:
  685|     66|{
  686|     66|    uint64_t *pz = p + (uint32_t)8U;
  687|     66|    return bn_is_zero_vartime4(pz);
  688|     66|}
Hacl_P256.c:bn_is_zero_vartime4:
   50|     66|{
   51|     66|    uint64_t m = bn_is_zero_mask4(f);
   52|     66|    return m == (uint64_t)0xFFFFFFFFFFFFFFFFU;
   53|     66|}
Hacl_P256.c:bn_is_eq_vartime4:
   71|     66|{
   72|     66|    uint64_t m = bn_is_eq_mask4(a, b);
   73|     66|    return m == (uint64_t)0xFFFFFFFFFFFFFFFFU;
   74|     66|}
Hacl_P256.c:bn_to_bytes_be4:
  304|    576|{
  305|    576|    uint8_t tmp[32U] = { 0U };
  306|    576|    KRML_HOST_IGNORE(tmp);
  ------------------
  |  |   56|    576|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
  307|    576|    KRML_MAYBE_FOR4(i,
  ------------------
  |  |  330|    576|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|    576|    do {                               \
  |  |  |  |  289|    576|        uint32_t i = z;                \
  |  |  |  |  290|    576|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    576|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  308|    576|                    (uint32_t)0U,
  309|    576|                    (uint32_t)4U,
  310|    576|                    (uint32_t)1U,
  311|    576|                    store64_be(res + i * (uint32_t)8U, f[(uint32_t)4U - i - (uint32_t)1U]););
  312|    576|}

Hacl_P384_ecdsa_verif_without_hash:
 1328|      7|{
 1329|      7|    uint64_t m_q[6U] = { 0U };
 1330|      7|    uint8_t mHash[48U] = { 0U };
 1331|      7|    memcpy(mHash, msg, 48U * sizeof(uint8_t));
 1332|      7|    KRML_MAYBE_UNUSED_VAR(msg_len);
  ------------------
  |  |   60|      7|#define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
  |  |  ------------------
  |  |  |  |   56|      7|#define KRML_HOST_IGNORE(x) (void)(x)
  |  |  ------------------
  ------------------
 1333|      7|    uint8_t *mHash48 = mHash;
 1334|      7|    bn_from_bytes_be(m_q, mHash48);
 1335|      7|    qmod_short(m_q, m_q);
 1336|      7|    bool res = ecdsa_verify_msg_as_qelem(m_q, public_key, signature_r, signature_s);
 1337|      7|    return res;
 1338|      7|}
Hacl_P384_validate_public_key:
 1360|    325|{
 1361|    325|    uint64_t point_jac[18U] = { 0U };
 1362|    325|    uint64_t p_aff[12U] = { 0U };
 1363|    325|    uint8_t *p_x = public_key;
 1364|    325|    uint8_t *p_y = public_key + 48U;
 1365|    325|    uint64_t *bn_p_x = p_aff;
 1366|    325|    uint64_t *bn_p_y = p_aff + 6U;
 1367|    325|    bn_from_bytes_be(bn_p_x, p_x);
 1368|    325|    bn_from_bytes_be(bn_p_y, p_y);
 1369|    325|    uint64_t *px0 = p_aff;
 1370|    325|    uint64_t *py0 = p_aff + 6U;
 1371|    325|    uint64_t lessX = bn_is_lt_prime_mask(px0);
 1372|    325|    uint64_t lessY = bn_is_lt_prime_mask(py0);
 1373|    325|    uint64_t res0 = lessX & lessY;
 1374|    325|    bool is_xy_valid = res0 == 0xFFFFFFFFFFFFFFFFULL;
 1375|    325|    bool res;
 1376|    325|    if (!is_xy_valid) {
  ------------------
  |  Branch (1376:9): [True: 5, False: 320]
  ------------------
 1377|      5|        res = false;
 1378|    320|    } else {
 1379|    320|        uint64_t rp[6U] = { 0U };
 1380|    320|        uint64_t tx[6U] = { 0U };
 1381|    320|        uint64_t ty[6U] = { 0U };
 1382|    320|        uint64_t *px = p_aff;
 1383|    320|        uint64_t *py = p_aff + 6U;
 1384|    320|        to_mont(tx, px);
 1385|    320|        to_mont(ty, py);
 1386|    320|        uint64_t tmp[6U] = { 0U };
 1387|    320|        fsqr0(rp, tx);
 1388|    320|        fmul0(rp, rp, tx);
 1389|    320|        p384_make_a_coeff(tmp);
 1390|    320|        fmul0(tmp, tmp, tx);
 1391|    320|        fadd0(rp, tmp, rp);
 1392|    320|        p384_make_b_coeff(tmp);
 1393|    320|        fadd0(rp, tmp, rp);
 1394|    320|        fsqr0(ty, ty);
 1395|    320|        uint64_t r = bn_is_eq_mask(ty, rp);
 1396|    320|        uint64_t r0 = r;
 1397|    320|        bool r1 = r0 == 0xFFFFFFFFFFFFFFFFULL;
 1398|    320|        res = r1;
 1399|    320|    }
 1400|    325|    if (res) {
  ------------------
  |  Branch (1400:9): [True: 268, False: 57]
  ------------------
 1401|    268|        uint64_t *px = p_aff;
 1402|    268|        uint64_t *py = p_aff + 6U;
 1403|    268|        uint64_t *rx = point_jac;
 1404|    268|        uint64_t *ry = point_jac + 6U;
 1405|    268|        uint64_t *rz = point_jac + 12U;
 1406|    268|        to_mont(rx, px);
 1407|    268|        to_mont(ry, py);
 1408|    268|        p384_make_fone(rz);
 1409|    268|    }
 1410|    325|    bool res1 = res;
 1411|    325|    return res1;
 1412|    325|}
Hacl_P384_validate_private_key:
 1426|    145|{
 1427|    145|    uint64_t bn_sk[6U] = { 0U };
 1428|    145|    bn_from_bytes_be(bn_sk, private_key);
 1429|    145|    uint64_t tmp[6U] = { 0U };
 1430|    145|    p384_make_order(tmp);
 1431|    145|    uint64_t c = bn_sub(tmp, bn_sk, tmp);
 1432|    145|    uint64_t is_lt_order = FStar_UInt64_gte_mask(c, 0ULL) & ~FStar_UInt64_eq_mask(c, 0ULL);
 1433|    145|    uint64_t bn_zero[6U] = { 0U };
 1434|    145|    uint64_t res = bn_is_eq_mask(bn_sk, bn_zero);
 1435|    145|    uint64_t is_eq_zero = res;
 1436|    145|    uint64_t res0 = is_lt_order & ~is_eq_zero;
 1437|    145|    return res0 == 0xFFFFFFFFFFFFFFFFULL;
 1438|    145|}
Hacl_P384_dh_initiator:
 1594|    145|{
 1595|    145|    uint64_t tmp[24U] = { 0U };
 1596|    145|    uint64_t *sk = tmp;
 1597|    145|    uint64_t *pk = tmp + 6U;
 1598|    145|    uint64_t is_sk_valid = load_qelem_conditional(sk, private_key);
 1599|    145|    point_mul_g(pk, sk);
 1600|    145|    uint64_t aff_p[12U] = { 0U };
 1601|    145|    uint64_t zinv[6U] = { 0U };
 1602|    145|    uint64_t *px = pk;
 1603|    145|    uint64_t *py0 = pk + 6U;
 1604|    145|    uint64_t *pz = pk + 12U;
 1605|    145|    uint64_t *x = aff_p;
 1606|    145|    uint64_t *y = aff_p + 6U;
 1607|    145|    p384_finv(zinv, pz);
 1608|    145|    fmul0(x, px, zinv);
 1609|    145|    fmul0(y, py0, zinv);
 1610|    145|    from_mont(x, x);
 1611|    145|    from_mont(y, y);
 1612|    145|    uint64_t *px0 = aff_p;
 1613|    145|    uint64_t *py = aff_p + 6U;
 1614|    145|    bn_to_bytes_be(public_key, px0);
 1615|    145|    bn_to_bytes_be(public_key + 48U, py);
 1616|    145|    return is_sk_valid == 0xFFFFFFFFFFFFFFFFULL;
 1617|    145|}
Hacl_P384_dh_responder:
 1633|    114|{
 1634|    114|    uint64_t tmp[192U] = { 0U };
 1635|    114|    uint64_t *sk = tmp;
 1636|    114|    uint64_t *pk = tmp + 6U;
 1637|    114|    uint64_t p_aff[12U] = { 0U };
 1638|    114|    uint8_t *p_x = their_pubkey;
 1639|    114|    uint8_t *p_y = their_pubkey + 48U;
 1640|    114|    uint64_t *bn_p_x = p_aff;
 1641|    114|    uint64_t *bn_p_y = p_aff + 6U;
 1642|    114|    bn_from_bytes_be(bn_p_x, p_x);
 1643|    114|    bn_from_bytes_be(bn_p_y, p_y);
 1644|    114|    uint64_t *px0 = p_aff;
 1645|    114|    uint64_t *py0 = p_aff + 6U;
 1646|    114|    uint64_t lessX = bn_is_lt_prime_mask(px0);
 1647|    114|    uint64_t lessY = bn_is_lt_prime_mask(py0);
 1648|    114|    uint64_t res0 = lessX & lessY;
 1649|    114|    bool is_xy_valid = res0 == 0xFFFFFFFFFFFFFFFFULL;
 1650|    114|    bool res;
 1651|    114|    if (!is_xy_valid) {
  ------------------
  |  Branch (1651:9): [True: 0, False: 114]
  ------------------
 1652|      0|        res = false;
 1653|    114|    } else {
 1654|    114|        uint64_t rp[6U] = { 0U };
 1655|    114|        uint64_t tx[6U] = { 0U };
 1656|    114|        uint64_t ty[6U] = { 0U };
 1657|    114|        uint64_t *px = p_aff;
 1658|    114|        uint64_t *py = p_aff + 6U;
 1659|    114|        to_mont(tx, px);
 1660|    114|        to_mont(ty, py);
 1661|    114|        uint64_t tmp1[6U] = { 0U };
 1662|    114|        fsqr0(rp, tx);
 1663|    114|        fmul0(rp, rp, tx);
 1664|    114|        p384_make_a_coeff(tmp1);
 1665|    114|        fmul0(tmp1, tmp1, tx);
 1666|    114|        fadd0(rp, tmp1, rp);
 1667|    114|        p384_make_b_coeff(tmp1);
 1668|    114|        fadd0(rp, tmp1, rp);
 1669|    114|        fsqr0(ty, ty);
 1670|    114|        uint64_t r = bn_is_eq_mask(ty, rp);
 1671|    114|        uint64_t r0 = r;
 1672|    114|        bool r1 = r0 == 0xFFFFFFFFFFFFFFFFULL;
 1673|    114|        res = r1;
 1674|    114|    }
 1675|    114|    if (res) {
  ------------------
  |  Branch (1675:9): [True: 114, False: 0]
  ------------------
 1676|    114|        uint64_t *px = p_aff;
 1677|    114|        uint64_t *py = p_aff + 6U;
 1678|    114|        uint64_t *rx = pk;
 1679|    114|        uint64_t *ry = pk + 6U;
 1680|    114|        uint64_t *rz = pk + 12U;
 1681|    114|        to_mont(rx, px);
 1682|    114|        to_mont(ry, py);
 1683|    114|        p384_make_fone(rz);
 1684|    114|    }
 1685|    114|    bool is_pk_valid = res;
 1686|    114|    uint64_t is_sk_valid = load_qelem_conditional(sk, private_key);
 1687|    114|    uint64_t ss_proj[18U] = { 0U };
 1688|    114|    if (is_pk_valid) {
  ------------------
  |  Branch (1688:9): [True: 114, False: 0]
  ------------------
 1689|    114|        point_mul(ss_proj, sk, pk);
 1690|    114|        uint64_t aff_p[12U] = { 0U };
 1691|    114|        uint64_t zinv[6U] = { 0U };
 1692|    114|        uint64_t *px = ss_proj;
 1693|    114|        uint64_t *py1 = ss_proj + 6U;
 1694|    114|        uint64_t *pz = ss_proj + 12U;
 1695|    114|        uint64_t *x = aff_p;
 1696|    114|        uint64_t *y = aff_p + 6U;
 1697|    114|        p384_finv(zinv, pz);
 1698|    114|        fmul0(x, px, zinv);
 1699|    114|        fmul0(y, py1, zinv);
 1700|    114|        from_mont(x, x);
 1701|    114|        from_mont(y, y);
 1702|    114|        uint64_t *px1 = aff_p;
 1703|    114|        uint64_t *py = aff_p + 6U;
 1704|    114|        bn_to_bytes_be(shared_secret, px1);
 1705|    114|        bn_to_bytes_be(shared_secret + 48U, py);
 1706|    114|    }
 1707|    114|    return is_sk_valid == 0xFFFFFFFFFFFFFFFFULL && is_pk_valid;
  ------------------
  |  Branch (1707:12): [True: 114, False: 0]
  |  Branch (1707:52): [True: 114, False: 0]
  ------------------
 1708|    114|}
Hacl_P384.c:bn_from_bytes_be:
  327|  1.31k|{
  328|  1.31k|    KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|  1.31k|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.31k|    do {                               \
  |  |  |  |  289|  1.31k|        uint32_t i = z;                \
  |  |  |  |  290|  1.31k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.31k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  329|  1.31k|                    0U,
  330|  1.31k|                    6U,
  331|  1.31k|                    1U,
  332|  1.31k|                    uint64_t *os = a;
  333|  1.31k|                    uint64_t u = load64_be(b + (6U - i - 1U) * 8U);
  334|  1.31k|                    uint64_t x = u;
  335|  1.31k|                    os[i] = x;);
  336|  1.31k|}
Hacl_P384.c:qmod_short:
  772|     13|{
  773|     13|    uint64_t tmp[6U] = { 0U };
  774|     13|    p384_make_order(tmp);
  775|     13|    uint64_t c = bn_sub(tmp, b, tmp);
  776|     13|    bn_cmovznz(a, c, tmp, b);
  777|     13|}
Hacl_P384.c:bn_cmovznz:
   46|     13|{
   47|     13|    uint64_t mask = ~FStar_UInt64_eq_mask(b, 0ULL);
   48|     13|    KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|     13|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|     13|    do {                               \
  |  |  |  |  289|     13|        uint32_t i = z;                \
  |  |  |  |  290|     13|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     13|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   49|     13|                    0U,
   50|     13|                    6U,
   51|     13|                    1U,
   52|     13|                    uint64_t *os = a;
   53|     13|                    uint64_t uu____0 = c[i];
   54|     13|                    uint64_t x = uu____0 ^ (mask & (d[i] ^ uu____0));
   55|     13|                    os[i] = x;);
   56|     13|}
Hacl_P384.c:p384_qinv:
  867|      6|{
  868|      6|    uint64_t b[6U] = { 0U };
  869|      6|    b[0U] = 0xecec196accc52971ULL;
  870|      6|    b[1U] = 0x581a0db248b0a77aULL;
  871|      6|    b[2U] = 0xc7634d81f4372ddfULL;
  872|      6|    b[3U] = 0xffffffffffffffffULL;
  873|      6|    b[4U] = 0xffffffffffffffffULL;
  874|      6|    b[5U] = 0xffffffffffffffffULL;
  875|      6|    qexp_consttime(res, a, b);
  876|      6|}
Hacl_P384.c:qexp_consttime:
  813|      6|{
  814|      6|    uint64_t table[192U] = { 0U };
  815|      6|    uint64_t tmp[6U] = { 0U };
  816|      6|    uint64_t *t0 = table;
  817|      6|    uint64_t *t1 = table + 6U;
  818|      6|    p384_make_qone(t0);
  819|      6|    memcpy(t1, a, 6U * sizeof(uint64_t));
  820|      6|    KRML_MAYBE_FOR15(i,
  ------------------
  |  |  396|      6|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|      6|    do {                               \
  |  |  |  |  289|      6|        uint32_t i = z;                \
  |  |  |  |  290|      6|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|      6|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  821|      6|                     0U,
  822|      6|                     15U,
  823|      6|                     1U,
  824|      6|                     uint64_t *t11 = table + (i + 1U) * 6U;
  825|      6|                     qsqr(tmp, t11);
  826|      6|                     memcpy(table + (2U * i + 2U) * 6U, tmp, 6U * sizeof(uint64_t));
  827|      6|                     uint64_t *t2 = table + (2U * i + 2U) * 6U;
  828|      6|                     qmul(tmp, a, t2);
  829|      6|                     memcpy(table + (2U * i + 3U) * 6U, tmp, 6U * sizeof(uint64_t)););
  830|      6|    uint32_t i0 = 380U;
  831|      6|    uint64_t bits_c = Hacl_Bignum_Lib_bn_get_bits_u64(6U, b, i0, 5U);
  832|      6|    memcpy(out, (uint64_t *)table, 6U * sizeof(uint64_t));
  833|    192|    for (uint32_t i1 = 0U; i1 < 31U; i1++) {
  ------------------
  |  Branch (833:28): [True: 186, False: 6]
  ------------------
  834|    186|        uint64_t c = FStar_UInt64_eq_mask(bits_c, (uint64_t)(i1 + 1U));
  835|    186|        const uint64_t *res_j = table + (i1 + 1U) * 6U;
  836|    186|        KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|    186|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|    186|    do {                               \
  |  |  |  |  289|    186|        uint32_t i = z;                \
  |  |  |  |  290|    186|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    186|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  837|    186|                        0U,
  838|    186|                        6U,
  839|    186|                        1U,
  840|    186|                        uint64_t *os = out;
  841|    186|                        uint64_t x = (c & res_j[i]) | (~c & out[i]);
  842|    186|                        os[i] = x;);
  843|    186|    }
  844|      6|    uint64_t tmp0[6U] = { 0U };
  845|    462|    for (uint32_t i1 = 0U; i1 < 76U; i1++) {
  ------------------
  |  Branch (845:28): [True: 456, False: 6]
  ------------------
  846|    456|        KRML_MAYBE_FOR5(i, 0U, 5U, 1U, qsqr(out, out););
  ------------------
  |  |  336|    456|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|    456|    do {                               \
  |  |  |  |  289|    456|        uint32_t i = z;                \
  |  |  |  |  290|    456|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    456|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  847|    456|        uint32_t k = 380U - 5U * i1 - 5U;
  848|    456|        uint64_t bits_l = Hacl_Bignum_Lib_bn_get_bits_u64(6U, b, k, 5U);
  849|    456|        memcpy(tmp0, (uint64_t *)table, 6U * sizeof(uint64_t));
  850|  14.5k|        for (uint32_t i2 = 0U; i2 < 31U; i2++) {
  ------------------
  |  Branch (850:32): [True: 14.1k, False: 456]
  ------------------
  851|  14.1k|            uint64_t c = FStar_UInt64_eq_mask(bits_l, (uint64_t)(i2 + 1U));
  852|  14.1k|            const uint64_t *res_j = table + (i2 + 1U) * 6U;
  853|  14.1k|            KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|  14.1k|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|  14.1k|    do {                               \
  |  |  |  |  289|  14.1k|        uint32_t i = z;                \
  |  |  |  |  290|  14.1k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  14.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  854|  14.1k|                            0U,
  855|  14.1k|                            6U,
  856|  14.1k|                            1U,
  857|  14.1k|                            uint64_t *os = tmp0;
  858|  14.1k|                            uint64_t x = (c & res_j[i]) | (~c & tmp0[i]);
  859|  14.1k|                            os[i] = x;);
  860|  14.1k|        }
  861|    456|        qmul(out, out, tmp0);
  862|    456|    }
  863|      6|}
Hacl_P384.c:p384_make_qone:
  435|      6|{
  436|      6|    f[0U] = 0x1313e695333ad68dULL;
  437|      6|    f[1U] = 0xa7e5f24db74f5885ULL;
  438|      6|    f[2U] = 0x389cb27e0bc8d220ULL;
  439|      6|    f[3U] = 0x0ULL;
  440|      6|    f[4U] = 0x0ULL;
  441|      6|    f[5U] = 0x0ULL;
  442|      6|}
Hacl_P384.c:qsqr:
  797|  2.37k|{
  798|  2.37k|    uint64_t tmp[12U] = { 0U };
  799|  2.37k|    bn_sqr(tmp, b);
  800|  2.37k|    qmont_reduction(a, tmp);
  801|  2.37k|}
Hacl_P384.c:bn_sqr:
  271|   425k|{
  272|   425k|    memset(a, 0U, 12U * sizeof(uint64_t));
  273|   425k|    KRML_MAYBE_FOR6(
  ------------------
  |  |  342|   425k|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|   425k|    do {                               \
  |  |  |  |  289|   425k|        uint32_t i = z;                \
  |  |  |  |  290|   425k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   425k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|   425k|        i0,
  275|   425k|        0U,
  276|   425k|        6U,
  277|   425k|        1U,
  278|   425k|        uint64_t *ab = b;
  279|   425k|        uint64_t a_j = b[i0];
  280|   425k|        uint64_t *res_j = a + i0;
  281|   425k|        uint64_t c = 0ULL;
  282|   425k|        for (uint32_t i = 0U; i < i0 / 4U; i++) {
  283|   425k|            uint64_t a_i = ab[4U * i];
  284|   425k|            uint64_t *res_i0 = res_j + 4U * i;
  285|   425k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, a_j, c, res_i0);
  286|   425k|            uint64_t a_i0 = ab[4U * i + 1U];
  287|   425k|            uint64_t *res_i1 = res_j + 4U * i + 1U;
  288|   425k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, a_j, c, res_i1);
  289|   425k|            uint64_t a_i1 = ab[4U * i + 2U];
  290|   425k|            uint64_t *res_i2 = res_j + 4U * i + 2U;
  291|   425k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, a_j, c, res_i2);
  292|   425k|            uint64_t a_i2 = ab[4U * i + 3U];
  293|   425k|            uint64_t *res_i = res_j + 4U * i + 3U;
  294|   425k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, a_j, c, res_i);
  295|   425k|        } for (uint32_t i = i0 / 4U * 4U; i < i0; i++) {
  296|   425k|            uint64_t a_i = ab[i];
  297|   425k|            uint64_t *res_i = res_j + i;
  298|   425k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, a_j, c, res_i);
  299|   425k|        } uint64_t r = c;
  300|   425k|        a[i0 + i0] = r;);
  301|   425k|    uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64(12U, a, a, a);
  302|   425k|    KRML_MAYBE_UNUSED_VAR(c0);
  ------------------
  |  |   60|   425k|#define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
  |  |  ------------------
  |  |  |  |   56|   425k|#define KRML_HOST_IGNORE(x) (void)(x)
  |  |  ------------------
  ------------------
  303|   425k|    uint64_t tmp[12U] = { 0U };
  304|   425k|    KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|   425k|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|   425k|    do {                               \
  |  |  |  |  289|   425k|        uint32_t i = z;                \
  |  |  |  |  290|   425k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   425k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  305|   425k|                    0U,
  306|   425k|                    6U,
  307|   425k|                    1U,
  308|   425k|                    FStar_UInt128_uint128 res = FStar_UInt128_mul_wide(b[i], b[i]);
  309|   425k|                    uint64_t hi = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, 64U));
  310|   425k|                    uint64_t lo = FStar_UInt128_uint128_to_uint64(res);
  311|   425k|                    tmp[2U * i] = lo;
  312|   425k|                    tmp[2U * i + 1U] = hi;);
  313|   425k|    uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64(12U, a, tmp, a);
  314|   425k|    KRML_MAYBE_UNUSED_VAR(c1);
  ------------------
  |  |   60|   425k|#define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
  |  |  ------------------
  |  |  |  |   56|   425k|#define KRML_HOST_IGNORE(x) (void)(x)
  |  |  ------------------
  ------------------
  315|   425k|}
Hacl_P384.c:qmont_reduction:
  526|  2.94k|{
  527|  2.94k|    uint64_t n[6U] = { 0U };
  528|  2.94k|    p384_make_order(n);
  529|  2.94k|    uint64_t c0 = 0ULL;
  530|  2.94k|    KRML_MAYBE_FOR6(
  ------------------
  |  |  342|  2.94k|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|  2.94k|    do {                               \
  |  |  |  |  289|  2.94k|        uint32_t i = z;                \
  |  |  |  |  290|  2.94k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  2.94k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  531|  2.94k|        i0,
  532|  2.94k|        0U,
  533|  2.94k|        6U,
  534|  2.94k|        1U,
  535|  2.94k|        uint64_t qj = 7986114184663260229ULL * x[i0];
  536|  2.94k|        uint64_t *res_j0 = x + i0;
  537|  2.94k|        uint64_t c = 0ULL;
  538|  2.94k|        {
  539|  2.94k|            uint64_t a_i = n[4U * 0U];
  540|  2.94k|            uint64_t *res_i0 = res_j0 + 4U * 0U;
  541|  2.94k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i0);
  542|  2.94k|            uint64_t a_i0 = n[4U * 0U + 1U];
  543|  2.94k|            uint64_t *res_i1 = res_j0 + 4U * 0U + 1U;
  544|  2.94k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, qj, c, res_i1);
  545|  2.94k|            uint64_t a_i1 = n[4U * 0U + 2U];
  546|  2.94k|            uint64_t *res_i2 = res_j0 + 4U * 0U + 2U;
  547|  2.94k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, qj, c, res_i2);
  548|  2.94k|            uint64_t a_i2 = n[4U * 0U + 3U];
  549|  2.94k|            uint64_t *res_i = res_j0 + 4U * 0U + 3U;
  550|  2.94k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, qj, c, res_i);
  551|  2.94k|        } KRML_MAYBE_FOR2(i,
  552|  2.94k|                          4U,
  553|  2.94k|                          6U,
  554|  2.94k|                          1U,
  555|  2.94k|                          uint64_t a_i = n[i];
  556|  2.94k|                          uint64_t *res_i = res_j0 + i;
  557|  2.94k|                          c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i););
  558|  2.94k|        uint64_t r = c;
  559|  2.94k|        uint64_t c1 = r;
  560|  2.94k|        uint64_t *resb = x + 6U + i0;
  561|  2.94k|        uint64_t res_j = x[6U + i0];
  562|  2.94k|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, c1, res_j, resb););
  563|  2.94k|    memcpy(res, x + 6U, 6U * sizeof(uint64_t));
  564|  2.94k|    uint64_t c00 = c0;
  565|  2.94k|    uint64_t tmp[6U] = { 0U };
  566|  2.94k|    uint64_t c = 0ULL;
  567|  2.94k|    {
  568|  2.94k|        uint64_t t1 = res[4U * 0U];
  569|  2.94k|        uint64_t t20 = n[4U * 0U];
  570|  2.94k|        uint64_t *res_i0 = tmp + 4U * 0U;
  571|  2.94k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0);
  ------------------
  |  |   89|  2.94k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  572|  2.94k|        uint64_t t10 = res[4U * 0U + 1U];
  573|  2.94k|        uint64_t t21 = n[4U * 0U + 1U];
  574|  2.94k|        uint64_t *res_i1 = tmp + 4U * 0U + 1U;
  575|  2.94k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1);
  ------------------
  |  |   89|  2.94k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  576|  2.94k|        uint64_t t11 = res[4U * 0U + 2U];
  577|  2.94k|        uint64_t t22 = n[4U * 0U + 2U];
  578|  2.94k|        uint64_t *res_i2 = tmp + 4U * 0U + 2U;
  579|  2.94k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2);
  ------------------
  |  |   89|  2.94k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  580|  2.94k|        uint64_t t12 = res[4U * 0U + 3U];
  581|  2.94k|        uint64_t t2 = n[4U * 0U + 3U];
  582|  2.94k|        uint64_t *res_i = tmp + 4U * 0U + 3U;
  583|  2.94k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i);
  ------------------
  |  |   89|  2.94k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  584|  2.94k|    }
  585|  2.94k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|  2.94k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|  2.94k|    do {                               \
  |  |  |  |  289|  2.94k|        uint32_t i = z;                \
  |  |  |  |  290|  2.94k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  2.94k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  586|  2.94k|                    4U,
  587|  2.94k|                    6U,
  588|  2.94k|                    1U,
  589|  2.94k|                    uint64_t t1 = res[i];
  590|  2.94k|                    uint64_t t2 = n[i];
  591|  2.94k|                    uint64_t *res_i = tmp + i;
  592|  2.94k|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t2, res_i););
  593|  2.94k|    uint64_t c1 = c;
  594|  2.94k|    uint64_t c2 = c00 - c1;
  595|  2.94k|    KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|  2.94k|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|  2.94k|    do {                               \
  |  |  |  |  289|  2.94k|        uint32_t i = z;                \
  |  |  |  |  290|  2.94k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  2.94k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|  2.94k|                    0U,
  597|  2.94k|                    6U,
  598|  2.94k|                    1U,
  599|  2.94k|                    uint64_t *os = res;
  600|  2.94k|                    uint64_t x1 = (c2 & res[i]) | (~c2 & tmp[i]);
  601|  2.94k|                    os[i] = x1;);
  602|  2.94k|}
Hacl_P384.c:qmul:
  789|    558|{
  790|    558|    uint64_t tmp[12U] = { 0U };
  791|    558|    bn_mul(tmp, b, c);
  792|    558|    qmont_reduction(a, tmp);
  793|    558|}
Hacl_P384.c:bn_mul:
  235|  1.47M|{
  236|  1.47M|    memset(a, 0U, 12U * sizeof(uint64_t));
  237|  1.47M|    KRML_MAYBE_FOR6(
  ------------------
  |  |  342|  1.47M|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.47M|    do {                               \
  |  |  |  |  289|  1.47M|        uint32_t i = z;                \
  |  |  |  |  290|  1.47M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.47M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  1.47M|        i0,
  239|  1.47M|        0U,
  240|  1.47M|        6U,
  241|  1.47M|        1U,
  242|  1.47M|        uint64_t bj = c[i0];
  243|  1.47M|        uint64_t *res_j = a + i0;
  244|  1.47M|        uint64_t c1 = 0ULL;
  245|  1.47M|        {
  246|  1.47M|            uint64_t a_i = b[4U * 0U];
  247|  1.47M|            uint64_t *res_i0 = res_j + 4U * 0U;
  248|  1.47M|            c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, bj, c1, res_i0);
  249|  1.47M|            uint64_t a_i0 = b[4U * 0U + 1U];
  250|  1.47M|            uint64_t *res_i1 = res_j + 4U * 0U + 1U;
  251|  1.47M|            c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, bj, c1, res_i1);
  252|  1.47M|            uint64_t a_i1 = b[4U * 0U + 2U];
  253|  1.47M|            uint64_t *res_i2 = res_j + 4U * 0U + 2U;
  254|  1.47M|            c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, bj, c1, res_i2);
  255|  1.47M|            uint64_t a_i2 = b[4U * 0U + 3U];
  256|  1.47M|            uint64_t *res_i = res_j + 4U * 0U + 3U;
  257|  1.47M|            c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, bj, c1, res_i);
  258|  1.47M|        } KRML_MAYBE_FOR2(i,
  259|  1.47M|                          4U,
  260|  1.47M|                          6U,
  261|  1.47M|                          1U,
  262|  1.47M|                          uint64_t a_i = b[i];
  263|  1.47M|                          uint64_t *res_i = res_j + i;
  264|  1.47M|                          c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, bj, c1, res_i););
  265|  1.47M|        uint64_t r = c1;
  266|  1.47M|        a[6U + i0] = r;);
  267|  1.47M|}
Hacl_P384.c:from_qmont:
  805|     12|{
  806|     12|    uint64_t tmp[12U] = { 0U };
  807|     12|    memcpy(tmp, b, 6U * sizeof(uint64_t));
  808|     12|    qmont_reduction(a, tmp);
  809|     12|}
Hacl_P384.c:bn_add_mod:
   60|  2.14M|{
   61|  2.14M|    uint64_t c10 = 0ULL;
   62|  2.14M|    {
   63|  2.14M|        uint64_t t1 = c[4U * 0U];
   64|  2.14M|        uint64_t t20 = d[4U * 0U];
   65|  2.14M|        uint64_t *res_i0 = a + 4U * 0U;
   66|  2.14M|        c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t1, t20, res_i0);
  ------------------
  |  |   66|  2.14M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
   67|  2.14M|        uint64_t t10 = c[4U * 0U + 1U];
   68|  2.14M|        uint64_t t21 = d[4U * 0U + 1U];
   69|  2.14M|        uint64_t *res_i1 = a + 4U * 0U + 1U;
   70|  2.14M|        c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t10, t21, res_i1);
  ------------------
  |  |   66|  2.14M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
   71|  2.14M|        uint64_t t11 = c[4U * 0U + 2U];
   72|  2.14M|        uint64_t t22 = d[4U * 0U + 2U];
   73|  2.14M|        uint64_t *res_i2 = a + 4U * 0U + 2U;
   74|  2.14M|        c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t11, t22, res_i2);
  ------------------
  |  |   66|  2.14M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
   75|  2.14M|        uint64_t t12 = c[4U * 0U + 3U];
   76|  2.14M|        uint64_t t2 = d[4U * 0U + 3U];
   77|  2.14M|        uint64_t *res_i = a + 4U * 0U + 3U;
   78|  2.14M|        c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t12, t2, res_i);
  ------------------
  |  |   66|  2.14M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
   79|  2.14M|    }
   80|  2.14M|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|  2.14M|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|  2.14M|    do {                               \
  |  |  |  |  289|  2.14M|        uint32_t i = z;                \
  |  |  |  |  290|  2.14M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  2.14M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   81|  2.14M|                    4U,
   82|  2.14M|                    6U,
   83|  2.14M|                    1U,
   84|  2.14M|                    uint64_t t1 = c[i];
   85|  2.14M|                    uint64_t t2 = d[i];
   86|  2.14M|                    uint64_t *res_i = a + i;
   87|  2.14M|                    c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t1, t2, res_i););
   88|  2.14M|    uint64_t c0 = c10;
   89|  2.14M|    uint64_t tmp[6U] = { 0U };
   90|  2.14M|    uint64_t c1 = 0ULL;
   91|  2.14M|    {
   92|  2.14M|        uint64_t t1 = a[4U * 0U];
   93|  2.14M|        uint64_t t20 = b[4U * 0U];
   94|  2.14M|        uint64_t *res_i0 = tmp + 4U * 0U;
   95|  2.14M|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t1, t20, res_i0);
  ------------------
  |  |   89|  2.14M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
   96|  2.14M|        uint64_t t10 = a[4U * 0U + 1U];
   97|  2.14M|        uint64_t t21 = b[4U * 0U + 1U];
   98|  2.14M|        uint64_t *res_i1 = tmp + 4U * 0U + 1U;
   99|  2.14M|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t10, t21, res_i1);
  ------------------
  |  |   89|  2.14M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  100|  2.14M|        uint64_t t11 = a[4U * 0U + 2U];
  101|  2.14M|        uint64_t t22 = b[4U * 0U + 2U];
  102|  2.14M|        uint64_t *res_i2 = tmp + 4U * 0U + 2U;
  103|  2.14M|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t11, t22, res_i2);
  ------------------
  |  |   89|  2.14M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  104|  2.14M|        uint64_t t12 = a[4U * 0U + 3U];
  105|  2.14M|        uint64_t t2 = b[4U * 0U + 3U];
  106|  2.14M|        uint64_t *res_i = tmp + 4U * 0U + 3U;
  107|  2.14M|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t12, t2, res_i);
  ------------------
  |  |   89|  2.14M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  108|  2.14M|    }
  109|  2.14M|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|  2.14M|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|  2.14M|    do {                               \
  |  |  |  |  289|  2.14M|        uint32_t i = z;                \
  |  |  |  |  290|  2.14M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  2.14M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  110|  2.14M|                    4U,
  111|  2.14M|                    6U,
  112|  2.14M|                    1U,
  113|  2.14M|                    uint64_t t1 = a[i];
  114|  2.14M|                    uint64_t t2 = b[i];
  115|  2.14M|                    uint64_t *res_i = tmp + i;
  116|  2.14M|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t1, t2, res_i););
  117|  2.14M|    uint64_t c11 = c1;
  118|  2.14M|    uint64_t c2 = c0 - c11;
  119|  2.14M|    KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|  2.14M|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|  2.14M|    do {                               \
  |  |  |  |  289|  2.14M|        uint32_t i = z;                \
  |  |  |  |  290|  2.14M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  2.14M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  120|  2.14M|                    0U,
  121|  2.14M|                    6U,
  122|  2.14M|                    1U,
  123|  2.14M|                    uint64_t *os = a;
  124|  2.14M|                    uint64_t x = (c2 & a[i]) | (~c2 & tmp[i]);
  125|  2.14M|                    os[i] = x;);
  126|  2.14M|}
Hacl_P384.c:ecdsa_verify_msg_as_qelem:
 1138|      7|{
 1139|      7|    uint64_t tmp[42U] = { 0U };
 1140|      7|    uint64_t *pk = tmp;
 1141|      7|    uint64_t *r_q = tmp + 18U;
 1142|      7|    uint64_t *s_q = tmp + 24U;
 1143|      7|    uint64_t *u1 = tmp + 30U;
 1144|      7|    uint64_t *u2 = tmp + 36U;
 1145|      7|    uint64_t p_aff[12U] = { 0U };
 1146|      7|    uint8_t *p_x = public_key;
 1147|      7|    uint8_t *p_y = public_key + 48U;
 1148|      7|    uint64_t *bn_p_x = p_aff;
 1149|      7|    uint64_t *bn_p_y = p_aff + 6U;
 1150|      7|    bn_from_bytes_be(bn_p_x, p_x);
 1151|      7|    bn_from_bytes_be(bn_p_y, p_y);
 1152|      7|    uint64_t *px0 = p_aff;
 1153|      7|    uint64_t *py0 = p_aff + 6U;
 1154|      7|    uint64_t lessX = bn_is_lt_prime_mask(px0);
 1155|      7|    uint64_t lessY = bn_is_lt_prime_mask(py0);
 1156|      7|    uint64_t res0 = lessX & lessY;
 1157|      7|    bool is_xy_valid = res0 == 0xFFFFFFFFFFFFFFFFULL;
 1158|      7|    bool res;
 1159|      7|    if (!is_xy_valid) {
  ------------------
  |  Branch (1159:9): [True: 0, False: 7]
  ------------------
 1160|      0|        res = false;
 1161|      7|    } else {
 1162|      7|        uint64_t rp[6U] = { 0U };
 1163|      7|        uint64_t tx[6U] = { 0U };
 1164|      7|        uint64_t ty[6U] = { 0U };
 1165|      7|        uint64_t *px = p_aff;
 1166|      7|        uint64_t *py = p_aff + 6U;
 1167|      7|        to_mont(tx, px);
 1168|      7|        to_mont(ty, py);
 1169|      7|        uint64_t tmp1[6U] = { 0U };
 1170|      7|        fsqr0(rp, tx);
 1171|      7|        fmul0(rp, rp, tx);
 1172|      7|        p384_make_a_coeff(tmp1);
 1173|      7|        fmul0(tmp1, tmp1, tx);
 1174|      7|        fadd0(rp, tmp1, rp);
 1175|      7|        p384_make_b_coeff(tmp1);
 1176|      7|        fadd0(rp, tmp1, rp);
 1177|      7|        fsqr0(ty, ty);
 1178|      7|        uint64_t r = bn_is_eq_mask(ty, rp);
 1179|      7|        uint64_t r0 = r;
 1180|      7|        bool r1 = r0 == 0xFFFFFFFFFFFFFFFFULL;
 1181|      7|        res = r1;
 1182|      7|    }
 1183|      7|    if (res) {
  ------------------
  |  Branch (1183:9): [True: 7, False: 0]
  ------------------
 1184|      7|        uint64_t *px = p_aff;
 1185|      7|        uint64_t *py = p_aff + 6U;
 1186|      7|        uint64_t *rx = pk;
 1187|      7|        uint64_t *ry = pk + 6U;
 1188|      7|        uint64_t *rz = pk + 12U;
 1189|      7|        to_mont(rx, px);
 1190|      7|        to_mont(ry, py);
 1191|      7|        p384_make_fone(rz);
 1192|      7|    }
 1193|      7|    bool is_pk_valid = res;
 1194|      7|    bn_from_bytes_be(r_q, signature_r);
 1195|      7|    bn_from_bytes_be(s_q, signature_s);
 1196|      7|    uint64_t tmp10[6U] = { 0U };
 1197|      7|    p384_make_order(tmp10);
 1198|      7|    uint64_t c = bn_sub(tmp10, r_q, tmp10);
 1199|      7|    uint64_t is_lt_order = FStar_UInt64_gte_mask(c, 0ULL) & ~FStar_UInt64_eq_mask(c, 0ULL);
 1200|      7|    uint64_t bn_zero0[6U] = { 0U };
 1201|      7|    uint64_t res1 = bn_is_eq_mask(r_q, bn_zero0);
 1202|      7|    uint64_t is_eq_zero = res1;
 1203|      7|    uint64_t is_r_valid = is_lt_order & ~is_eq_zero;
 1204|      7|    uint64_t tmp11[6U] = { 0U };
 1205|      7|    p384_make_order(tmp11);
 1206|      7|    uint64_t c0 = bn_sub(tmp11, s_q, tmp11);
 1207|      7|    uint64_t is_lt_order0 = FStar_UInt64_gte_mask(c0, 0ULL) & ~FStar_UInt64_eq_mask(c0, 0ULL);
 1208|      7|    uint64_t bn_zero1[6U] = { 0U };
 1209|      7|    uint64_t res2 = bn_is_eq_mask(s_q, bn_zero1);
 1210|      7|    uint64_t is_eq_zero0 = res2;
 1211|      7|    uint64_t is_s_valid = is_lt_order0 & ~is_eq_zero0;
 1212|      7|    bool is_rs_valid = is_r_valid == 0xFFFFFFFFFFFFFFFFULL && is_s_valid == 0xFFFFFFFFFFFFFFFFULL;
  ------------------
  |  Branch (1212:24): [True: 7, False: 0]
  |  Branch (1212:63): [True: 6, False: 1]
  ------------------
 1213|      7|    if (!(is_pk_valid && is_rs_valid)) {
  ------------------
  |  Branch (1213:11): [True: 7, False: 0]
  |  Branch (1213:26): [True: 6, False: 1]
  ------------------
 1214|      1|        return false;
 1215|      1|    }
 1216|      6|    uint64_t sinv[6U] = { 0U };
 1217|      6|    p384_qinv(sinv, s_q);
 1218|      6|    uint64_t tmp1[6U] = { 0U };
 1219|      6|    from_qmont(tmp1, m_q);
 1220|      6|    qmul(u1, sinv, tmp1);
 1221|      6|    uint64_t tmp12[6U] = { 0U };
 1222|      6|    from_qmont(tmp12, r_q);
 1223|      6|    qmul(u2, sinv, tmp12);
 1224|      6|    uint64_t res3[18U] = { 0U };
 1225|      6|    point_mul_double_g(res3, u1, u2, pk);
 1226|      6|    uint64_t *pz0 = res3 + 12U;
 1227|      6|    uint64_t bn_zero[6U] = { 0U };
 1228|      6|    uint64_t res10 = bn_is_eq_mask(pz0, bn_zero);
 1229|      6|    uint64_t m = res10;
 1230|      6|    if (m == 0xFFFFFFFFFFFFFFFFULL) {
  ------------------
  |  Branch (1230:9): [True: 0, False: 6]
  ------------------
 1231|      0|        return false;
 1232|      0|    }
 1233|      6|    uint64_t x[6U] = { 0U };
 1234|      6|    uint64_t zinv[6U] = { 0U };
 1235|      6|    uint64_t *px = res3;
 1236|      6|    uint64_t *pz = res3 + 12U;
 1237|      6|    p384_finv(zinv, pz);
 1238|      6|    fmul0(x, px, zinv);
 1239|      6|    from_mont(x, x);
 1240|      6|    qmod_short(x, x);
 1241|      6|    uint64_t m0 = bn_is_eq_mask(x, r_q);
 1242|      6|    bool res11 = m0 == 0xFFFFFFFFFFFFFFFFULL;
 1243|      6|    return res11;
 1244|      6|}
Hacl_P384.c:point_mul_double_g:
 1082|      6|{
 1083|      6|    uint64_t tmp[18U] = { 0U };
 1084|      6|    point_mul_g(tmp, scalar1);
 1085|      6|    point_mul(res, scalar2, p);
 1086|      6|    point_add(res, tmp, res);
 1087|      6|}
Hacl_P384.c:point_add:
  880|  27.9k|{
  881|  27.9k|    uint64_t tmp[54U] = { 0U };
  882|  27.9k|    uint64_t *t0 = tmp;
  883|  27.9k|    uint64_t *t1 = tmp + 36U;
  884|  27.9k|    uint64_t *x3 = t1;
  885|  27.9k|    uint64_t *y3 = t1 + 6U;
  886|  27.9k|    uint64_t *z3 = t1 + 12U;
  887|  27.9k|    uint64_t *t01 = t0;
  888|  27.9k|    uint64_t *t11 = t0 + 6U;
  889|  27.9k|    uint64_t *t2 = t0 + 12U;
  890|  27.9k|    uint64_t *t3 = t0 + 18U;
  891|  27.9k|    uint64_t *t4 = t0 + 24U;
  892|  27.9k|    uint64_t *t5 = t0 + 30U;
  893|  27.9k|    uint64_t *x1 = x;
  894|  27.9k|    uint64_t *y1 = x + 6U;
  895|  27.9k|    uint64_t *z10 = x + 12U;
  896|  27.9k|    uint64_t *x20 = y;
  897|  27.9k|    uint64_t *y20 = y + 6U;
  898|  27.9k|    uint64_t *z20 = y + 12U;
  899|  27.9k|    fmul0(t01, x1, x20);
  900|  27.9k|    fmul0(t11, y1, y20);
  901|  27.9k|    fmul0(t2, z10, z20);
  902|  27.9k|    fadd0(t3, x1, y1);
  903|  27.9k|    fadd0(t4, x20, y20);
  904|  27.9k|    fmul0(t3, t3, t4);
  905|  27.9k|    fadd0(t4, t01, t11);
  906|  27.9k|    uint64_t *y10 = x + 6U;
  907|  27.9k|    uint64_t *z11 = x + 12U;
  908|  27.9k|    uint64_t *y2 = y + 6U;
  909|  27.9k|    uint64_t *z21 = y + 12U;
  910|  27.9k|    fsub0(t3, t3, t4);
  911|  27.9k|    fadd0(t4, y10, z11);
  912|  27.9k|    fadd0(t5, y2, z21);
  913|  27.9k|    fmul0(t4, t4, t5);
  914|  27.9k|    fadd0(t5, t11, t2);
  915|  27.9k|    fsub0(t4, t4, t5);
  916|  27.9k|    uint64_t *x10 = x;
  917|  27.9k|    uint64_t *z1 = x + 12U;
  918|  27.9k|    uint64_t *x2 = y;
  919|  27.9k|    uint64_t *z2 = y + 12U;
  920|  27.9k|    fadd0(x3, x10, z1);
  921|  27.9k|    fadd0(y3, x2, z2);
  922|  27.9k|    fmul0(x3, x3, y3);
  923|  27.9k|    fadd0(y3, t01, t2);
  924|  27.9k|    fsub0(y3, x3, y3);
  925|  27.9k|    uint64_t b_coeff[6U] = { 0U };
  926|  27.9k|    p384_make_b_coeff(b_coeff);
  927|  27.9k|    fmul0(z3, b_coeff, t2);
  928|  27.9k|    fsub0(x3, y3, z3);
  929|  27.9k|    fadd0(z3, x3, x3);
  930|  27.9k|    fadd0(x3, x3, z3);
  931|  27.9k|    fsub0(z3, t11, x3);
  932|  27.9k|    fadd0(x3, t11, x3);
  933|  27.9k|    uint64_t b_coeff0[6U] = { 0U };
  934|  27.9k|    p384_make_b_coeff(b_coeff0);
  935|  27.9k|    fmul0(y3, b_coeff0, y3);
  936|  27.9k|    fadd0(t11, t2, t2);
  937|  27.9k|    fadd0(t2, t11, t2);
  938|  27.9k|    fsub0(y3, y3, t2);
  939|  27.9k|    fsub0(y3, y3, t01);
  940|  27.9k|    fadd0(t11, y3, y3);
  941|  27.9k|    fadd0(y3, t11, y3);
  942|  27.9k|    fadd0(t11, t01, t01);
  943|  27.9k|    fadd0(t01, t11, t01);
  944|  27.9k|    fsub0(t01, t01, t2);
  945|  27.9k|    fmul0(t11, t4, y3);
  946|  27.9k|    fmul0(t2, t01, y3);
  947|  27.9k|    fmul0(y3, x3, z3);
  948|  27.9k|    fadd0(y3, y3, t2);
  949|  27.9k|    fmul0(x3, t3, x3);
  950|  27.9k|    fsub0(x3, x3, t11);
  951|  27.9k|    fmul0(z3, t4, z3);
  952|  27.9k|    fmul0(t11, t3, t01);
  953|  27.9k|    fadd0(z3, z3, t11);
  954|  27.9k|    memcpy(xy, t1, 18U * sizeof(uint64_t));
  955|  27.9k|}
Hacl_P384.c:bn_is_lt_prime_mask:
  606|    892|{
  607|    892|    uint64_t tmp[6U] = { 0U };
  608|    892|    p384_make_prime(tmp);
  609|    892|    uint64_t c = bn_sub(tmp, f, tmp);
  610|    892|    uint64_t m = FStar_UInt64_gte_mask(c, 0ULL) & ~FStar_UInt64_eq_mask(c, 0ULL);
  611|    892|    return m;
  612|    892|}
Hacl_P384.c:p384_make_prime:
  340|  4.93M|{
  341|  4.93M|    n[0U] = 0x00000000ffffffffULL;
  342|  4.93M|    n[1U] = 0xffffffff00000000ULL;
  343|  4.93M|    n[2U] = 0xfffffffffffffffeULL;
  344|  4.93M|    n[3U] = 0xffffffffffffffffULL;
  345|  4.93M|    n[4U] = 0xffffffffffffffffULL;
  346|  4.93M|    n[5U] = 0xffffffffffffffffULL;
  347|  4.93M|}
Hacl_P384.c:to_mont:
  656|  1.66k|{
  657|  1.66k|    uint64_t r2modn[6U] = { 0U };
  658|  1.66k|    p384_make_fmont_R2(r2modn);
  659|  1.66k|    uint64_t tmp[12U] = { 0U };
  660|  1.66k|    bn_mul(tmp, b, r2modn);
  661|  1.66k|    fmont_reduction(a, tmp);
  662|  1.66k|}
Hacl_P384.c:p384_make_fmont_R2:
  406|  1.66k|{
  407|  1.66k|    n[0U] = 0xfffffffe00000001ULL;
  408|  1.66k|    n[1U] = 0x0000000200000000ULL;
  409|  1.66k|    n[2U] = 0xfffffffe00000000ULL;
  410|  1.66k|    n[3U] = 0x0000000200000000ULL;
  411|  1.66k|    n[4U] = 0x0000000000000001ULL;
  412|  1.66k|    n[5U] = 0x0ULL;
  413|  1.66k|}
Hacl_P384.c:fmont_reduction:
  446|  1.90M|{
  447|  1.90M|    uint64_t n[6U] = { 0U };
  448|  1.90M|    p384_make_prime(n);
  449|  1.90M|    uint64_t c0 = 0ULL;
  450|  1.90M|    KRML_MAYBE_FOR6(
  ------------------
  |  |  342|  1.90M|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.90M|    do {                               \
  |  |  |  |  289|  1.90M|        uint32_t i = z;                \
  |  |  |  |  290|  1.90M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.90M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  451|  1.90M|        i0,
  452|  1.90M|        0U,
  453|  1.90M|        6U,
  454|  1.90M|        1U,
  455|  1.90M|        uint64_t qj = 4294967297ULL * x[i0];
  456|  1.90M|        uint64_t *res_j0 = x + i0;
  457|  1.90M|        uint64_t c = 0ULL;
  458|  1.90M|        {
  459|  1.90M|            uint64_t a_i = n[4U * 0U];
  460|  1.90M|            uint64_t *res_i0 = res_j0 + 4U * 0U;
  461|  1.90M|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i0);
  462|  1.90M|            uint64_t a_i0 = n[4U * 0U + 1U];
  463|  1.90M|            uint64_t *res_i1 = res_j0 + 4U * 0U + 1U;
  464|  1.90M|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, qj, c, res_i1);
  465|  1.90M|            uint64_t a_i1 = n[4U * 0U + 2U];
  466|  1.90M|            uint64_t *res_i2 = res_j0 + 4U * 0U + 2U;
  467|  1.90M|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, qj, c, res_i2);
  468|  1.90M|            uint64_t a_i2 = n[4U * 0U + 3U];
  469|  1.90M|            uint64_t *res_i = res_j0 + 4U * 0U + 3U;
  470|  1.90M|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, qj, c, res_i);
  471|  1.90M|        } KRML_MAYBE_FOR2(i,
  472|  1.90M|                          4U,
  473|  1.90M|                          6U,
  474|  1.90M|                          1U,
  475|  1.90M|                          uint64_t a_i = n[i];
  476|  1.90M|                          uint64_t *res_i = res_j0 + i;
  477|  1.90M|                          c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i););
  478|  1.90M|        uint64_t r = c;
  479|  1.90M|        uint64_t c1 = r;
  480|  1.90M|        uint64_t *resb = x + 6U + i0;
  481|  1.90M|        uint64_t res_j = x[6U + i0];
  482|  1.90M|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, c1, res_j, resb););
  483|  1.90M|    memcpy(res, x + 6U, 6U * sizeof(uint64_t));
  484|  1.90M|    uint64_t c00 = c0;
  485|  1.90M|    uint64_t tmp[6U] = { 0U };
  486|  1.90M|    uint64_t c = 0ULL;
  487|  1.90M|    {
  488|  1.90M|        uint64_t t1 = res[4U * 0U];
  489|  1.90M|        uint64_t t20 = n[4U * 0U];
  490|  1.90M|        uint64_t *res_i0 = tmp + 4U * 0U;
  491|  1.90M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0);
  ------------------
  |  |   89|  1.90M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  492|  1.90M|        uint64_t t10 = res[4U * 0U + 1U];
  493|  1.90M|        uint64_t t21 = n[4U * 0U + 1U];
  494|  1.90M|        uint64_t *res_i1 = tmp + 4U * 0U + 1U;
  495|  1.90M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1);
  ------------------
  |  |   89|  1.90M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  496|  1.90M|        uint64_t t11 = res[4U * 0U + 2U];
  497|  1.90M|        uint64_t t22 = n[4U * 0U + 2U];
  498|  1.90M|        uint64_t *res_i2 = tmp + 4U * 0U + 2U;
  499|  1.90M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2);
  ------------------
  |  |   89|  1.90M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  500|  1.90M|        uint64_t t12 = res[4U * 0U + 3U];
  501|  1.90M|        uint64_t t2 = n[4U * 0U + 3U];
  502|  1.90M|        uint64_t *res_i = tmp + 4U * 0U + 3U;
  503|  1.90M|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i);
  ------------------
  |  |   89|  1.90M|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  504|  1.90M|    }
  505|  1.90M|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|  1.90M|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.90M|    do {                               \
  |  |  |  |  289|  1.90M|        uint32_t i = z;                \
  |  |  |  |  290|  1.90M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.90M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  1.90M|                    4U,
  507|  1.90M|                    6U,
  508|  1.90M|                    1U,
  509|  1.90M|                    uint64_t t1 = res[i];
  510|  1.90M|                    uint64_t t2 = n[i];
  511|  1.90M|                    uint64_t *res_i = tmp + i;
  512|  1.90M|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t2, res_i););
  513|  1.90M|    uint64_t c1 = c;
  514|  1.90M|    uint64_t c2 = c00 - c1;
  515|  1.90M|    KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|  1.90M|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.90M|    do {                               \
  |  |  |  |  289|  1.90M|        uint32_t i = z;                \
  |  |  |  |  290|  1.90M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.90M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  516|  1.90M|                    0U,
  517|  1.90M|                    6U,
  518|  1.90M|                    1U,
  519|  1.90M|                    uint64_t *os = res;
  520|  1.90M|                    uint64_t x1 = (c2 & res[i]) | (~c2 & tmp[i]);
  521|  1.90M|                    os[i] = x1;);
  522|  1.90M|}
Hacl_P384.c:fsqr0:
  640|   423k|{
  641|   423k|    uint64_t tmp[12U] = { 0U };
  642|   423k|    bn_sqr(tmp, b);
  643|   423k|    fmont_reduction(a, tmp);
  644|   423k|}
Hacl_P384.c:fmul0:
  632|  1.47M|{
  633|  1.47M|    uint64_t tmp[12U] = { 0U };
  634|  1.47M|    bn_mul(tmp, b, c);
  635|  1.47M|    fmont_reduction(a, tmp);
  636|  1.47M|}
Hacl_P384.c:p384_make_a_coeff:
  362|    441|{
  363|    441|    a[0U] = 0x00000003fffffffcULL;
  364|    441|    a[1U] = 0xfffffffc00000000ULL;
  365|    441|    a[2U] = 0xfffffffffffffffbULL;
  366|    441|    a[3U] = 0xffffffffffffffffULL;
  367|    441|    a[4U] = 0xffffffffffffffffULL;
  368|    441|    a[5U] = 0xffffffffffffffffULL;
  369|    441|}
Hacl_P384.c:fadd0:
  616|  2.14M|{
  617|  2.14M|    uint64_t n[6U] = { 0U };
  618|  2.14M|    p384_make_prime(n);
  619|  2.14M|    bn_add_mod(a, n, b, c);
  620|  2.14M|}
Hacl_P384.c:p384_make_b_coeff:
  373|   268k|{
  374|   268k|    b[0U] = 0x081188719d412dccULL;
  375|   268k|    b[1U] = 0xf729add87a4c32ecULL;
  376|   268k|    b[2U] = 0x77f2209b1920022eULL;
  377|   268k|    b[3U] = 0xe3374bee94938ae2ULL;
  378|   268k|    b[4U] = 0xb62b21f41f022094ULL;
  379|   268k|    b[5U] = 0xcd08114b604fbff9ULL;
  380|   268k|}
Hacl_P384.c:bn_is_eq_mask:
   32|    871|{
   33|    871|    uint64_t mask = 0xFFFFFFFFFFFFFFFFULL;
   34|    871|    KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|    871|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|    871|    do {                               \
  |  |  |  |  289|    871|        uint32_t i = z;                \
  |  |  |  |  290|    871|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    871|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   35|    871|                    0U,
   36|    871|                    6U,
   37|    871|                    1U,
   38|    871|                    uint64_t uu____0 = FStar_UInt64_eq_mask(x[i], y[i]);
   39|    871|                    mask = uu____0 & mask;);
   40|    871|    uint64_t mask1 = mask;
   41|    871|    return mask1;
   42|    871|}
Hacl_P384.c:p384_make_fone:
  424|  1.34k|{
  425|  1.34k|    n[0U] = 0xffffffff00000001ULL;
  426|  1.34k|    n[1U] = 0x00000000ffffffffULL;
  427|  1.34k|    n[2U] = 0x1ULL;
  428|  1.34k|    n[3U] = 0x0ULL;
  429|  1.34k|    n[4U] = 0x0ULL;
  430|  1.34k|    n[5U] = 0x0ULL;
  431|  1.34k|}
Hacl_P384.c:p384_make_order:
  351|  3.37k|{
  352|  3.37k|    n[0U] = 0xecec196accc52973ULL;
  353|  3.37k|    n[1U] = 0x581a0db248b0a77aULL;
  354|  3.37k|    n[2U] = 0xc7634d81f4372ddfULL;
  355|  3.37k|    n[3U] = 0xffffffffffffffffULL;
  356|  3.37k|    n[4U] = 0xffffffffffffffffULL;
  357|  3.37k|    n[5U] = 0xffffffffffffffffULL;
  358|  3.37k|}
Hacl_P384.c:bn_sub:
  130|  1.32k|{
  131|  1.32k|    uint64_t c1 = 0ULL;
  132|  1.32k|    {
  133|  1.32k|        uint64_t t1 = b[4U * 0U];
  134|  1.32k|        uint64_t t20 = c[4U * 0U];
  135|  1.32k|        uint64_t *res_i0 = a + 4U * 0U;
  136|  1.32k|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t1, t20, res_i0);
  ------------------
  |  |   89|  1.32k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  137|  1.32k|        uint64_t t10 = b[4U * 0U + 1U];
  138|  1.32k|        uint64_t t21 = c[4U * 0U + 1U];
  139|  1.32k|        uint64_t *res_i1 = a + 4U * 0U + 1U;
  140|  1.32k|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t10, t21, res_i1);
  ------------------
  |  |   89|  1.32k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  141|  1.32k|        uint64_t t11 = b[4U * 0U + 2U];
  142|  1.32k|        uint64_t t22 = c[4U * 0U + 2U];
  143|  1.32k|        uint64_t *res_i2 = a + 4U * 0U + 2U;
  144|  1.32k|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t11, t22, res_i2);
  ------------------
  |  |   89|  1.32k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  145|  1.32k|        uint64_t t12 = b[4U * 0U + 3U];
  146|  1.32k|        uint64_t t2 = c[4U * 0U + 3U];
  147|  1.32k|        uint64_t *res_i = a + 4U * 0U + 3U;
  148|  1.32k|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t12, t2, res_i);
  ------------------
  |  |   89|  1.32k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  149|  1.32k|    }
  150|  1.32k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|  1.32k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.32k|    do {                               \
  |  |  |  |  289|  1.32k|        uint32_t i = z;                \
  |  |  |  |  290|  1.32k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.32k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  151|  1.32k|                    4U,
  152|  1.32k|                    6U,
  153|  1.32k|                    1U,
  154|  1.32k|                    uint64_t t1 = b[i];
  155|  1.32k|                    uint64_t t2 = c[i];
  156|  1.32k|                    uint64_t *res_i = a + i;
  157|  1.32k|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t1, t2, res_i););
  158|  1.32k|    uint64_t c10 = c1;
  159|  1.32k|    return c10;
  160|  1.32k|}
Hacl_P384.c:fexp_consttime:
  666|    265|{
  667|    265|    uint64_t table[192U] = { 0U };
  668|    265|    uint64_t tmp[6U] = { 0U };
  669|    265|    uint64_t *t0 = table;
  670|    265|    uint64_t *t1 = table + 6U;
  671|    265|    p384_make_fone(t0);
  672|    265|    memcpy(t1, a, 6U * sizeof(uint64_t));
  673|    265|    KRML_MAYBE_FOR15(i,
  ------------------
  |  |  396|    265|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|    265|    do {                               \
  |  |  |  |  289|    265|        uint32_t i = z;                \
  |  |  |  |  290|    265|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    265|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  674|    265|                     0U,
  675|    265|                     15U,
  676|    265|                     1U,
  677|    265|                     uint64_t *t11 = table + (i + 1U) * 6U;
  678|    265|                     fsqr0(tmp, t11);
  679|    265|                     memcpy(table + (2U * i + 2U) * 6U, tmp, 6U * sizeof(uint64_t));
  680|    265|                     uint64_t *t2 = table + (2U * i + 2U) * 6U;
  681|    265|                     fmul0(tmp, a, t2);
  682|    265|                     memcpy(table + (2U * i + 3U) * 6U, tmp, 6U * sizeof(uint64_t)););
  683|    265|    uint32_t i0 = 380U;
  684|    265|    uint64_t bits_c = Hacl_Bignum_Lib_bn_get_bits_u64(6U, b, i0, 5U);
  685|    265|    memcpy(out, (uint64_t *)table, 6U * sizeof(uint64_t));
  686|  8.48k|    for (uint32_t i1 = 0U; i1 < 31U; i1++) {
  ------------------
  |  Branch (686:28): [True: 8.21k, False: 265]
  ------------------
  687|  8.21k|        uint64_t c = FStar_UInt64_eq_mask(bits_c, (uint64_t)(i1 + 1U));
  688|  8.21k|        const uint64_t *res_j = table + (i1 + 1U) * 6U;
  689|  8.21k|        KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|  8.21k|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|  8.21k|    do {                               \
  |  |  |  |  289|  8.21k|        uint32_t i = z;                \
  |  |  |  |  290|  8.21k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  8.21k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  690|  8.21k|                        0U,
  691|  8.21k|                        6U,
  692|  8.21k|                        1U,
  693|  8.21k|                        uint64_t *os = out;
  694|  8.21k|                        uint64_t x = (c & res_j[i]) | (~c & out[i]);
  695|  8.21k|                        os[i] = x;);
  696|  8.21k|    }
  697|    265|    uint64_t tmp0[6U] = { 0U };
  698|  20.4k|    for (uint32_t i1 = 0U; i1 < 76U; i1++) {
  ------------------
  |  Branch (698:28): [True: 20.1k, False: 265]
  ------------------
  699|  20.1k|        KRML_MAYBE_FOR5(i, 0U, 5U, 1U, fsqr0(out, out););
  ------------------
  |  |  336|  20.1k|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|  20.1k|    do {                               \
  |  |  |  |  289|  20.1k|        uint32_t i = z;                \
  |  |  |  |  290|  20.1k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  20.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  700|  20.1k|        uint32_t k = 380U - 5U * i1 - 5U;
  701|  20.1k|        uint64_t bits_l = Hacl_Bignum_Lib_bn_get_bits_u64(6U, b, k, 5U);
  702|  20.1k|        memcpy(tmp0, (uint64_t *)table, 6U * sizeof(uint64_t));
  703|   644k|        for (uint32_t i2 = 0U; i2 < 31U; i2++) {
  ------------------
  |  Branch (703:32): [True: 624k, False: 20.1k]
  ------------------
  704|   624k|            uint64_t c = FStar_UInt64_eq_mask(bits_l, (uint64_t)(i2 + 1U));
  705|   624k|            const uint64_t *res_j = table + (i2 + 1U) * 6U;
  706|   624k|            KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|   624k|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|   624k|    do {                               \
  |  |  |  |  289|   624k|        uint32_t i = z;                \
  |  |  |  |  290|   624k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   624k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|   624k|                            0U,
  708|   624k|                            6U,
  709|   624k|                            1U,
  710|   624k|                            uint64_t *os = tmp0;
  711|   624k|                            uint64_t x = (c & res_j[i]) | (~c & tmp0[i]);
  712|   624k|                            os[i] = x;);
  713|   624k|        }
  714|  20.1k|        fmul0(out, out, tmp0);
  715|  20.1k|    }
  716|    265|}
Hacl_P384.c:from_mont:
  648|    524|{
  649|    524|    uint64_t tmp[12U] = { 0U };
  650|    524|    memcpy(tmp, b, 6U * sizeof(uint64_t));
  651|    524|    fmont_reduction(a, tmp);
  652|    524|}
Hacl_P384.c:fsub0:
  624|   887k|{
  625|   887k|    uint64_t n[6U] = { 0U };
  626|   887k|    p384_make_prime(n);
  627|   887k|    bn_sub_mod(a, n, b, c);
  628|   887k|}
Hacl_P384.c:bn_sub_mod:
  164|   887k|{
  165|   887k|    uint64_t c10 = 0ULL;
  166|   887k|    {
  167|   887k|        uint64_t t1 = c[4U * 0U];
  168|   887k|        uint64_t t20 = d[4U * 0U];
  169|   887k|        uint64_t *res_i0 = a + 4U * 0U;
  170|   887k|        c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t1, t20, res_i0);
  ------------------
  |  |   89|   887k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  171|   887k|        uint64_t t10 = c[4U * 0U + 1U];
  172|   887k|        uint64_t t21 = d[4U * 0U + 1U];
  173|   887k|        uint64_t *res_i1 = a + 4U * 0U + 1U;
  174|   887k|        c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t10, t21, res_i1);
  ------------------
  |  |   89|   887k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  175|   887k|        uint64_t t11 = c[4U * 0U + 2U];
  176|   887k|        uint64_t t22 = d[4U * 0U + 2U];
  177|   887k|        uint64_t *res_i2 = a + 4U * 0U + 2U;
  178|   887k|        c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t11, t22, res_i2);
  ------------------
  |  |   89|   887k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  179|   887k|        uint64_t t12 = c[4U * 0U + 3U];
  180|   887k|        uint64_t t2 = d[4U * 0U + 3U];
  181|   887k|        uint64_t *res_i = a + 4U * 0U + 3U;
  182|   887k|        c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t12, t2, res_i);
  ------------------
  |  |   89|   887k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  183|   887k|    }
  184|   887k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|   887k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|   887k|    do {                               \
  |  |  |  |  289|   887k|        uint32_t i = z;                \
  |  |  |  |  290|   887k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   887k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|   887k|                    4U,
  186|   887k|                    6U,
  187|   887k|                    1U,
  188|   887k|                    uint64_t t1 = c[i];
  189|   887k|                    uint64_t t2 = d[i];
  190|   887k|                    uint64_t *res_i = a + i;
  191|   887k|                    c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t1, t2, res_i););
  192|   887k|    uint64_t c0 = c10;
  193|   887k|    uint64_t tmp[6U] = { 0U };
  194|   887k|    uint64_t c1 = 0ULL;
  195|   887k|    {
  196|   887k|        uint64_t t1 = a[4U * 0U];
  197|   887k|        uint64_t t20 = b[4U * 0U];
  198|   887k|        uint64_t *res_i0 = tmp + 4U * 0U;
  199|   887k|        c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t1, t20, res_i0);
  ------------------
  |  |   66|   887k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  200|   887k|        uint64_t t10 = a[4U * 0U + 1U];
  201|   887k|        uint64_t t21 = b[4U * 0U + 1U];
  202|   887k|        uint64_t *res_i1 = tmp + 4U * 0U + 1U;
  203|   887k|        c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t10, t21, res_i1);
  ------------------
  |  |   66|   887k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  204|   887k|        uint64_t t11 = a[4U * 0U + 2U];
  205|   887k|        uint64_t t22 = b[4U * 0U + 2U];
  206|   887k|        uint64_t *res_i2 = tmp + 4U * 0U + 2U;
  207|   887k|        c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t11, t22, res_i2);
  ------------------
  |  |   66|   887k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  208|   887k|        uint64_t t12 = a[4U * 0U + 3U];
  209|   887k|        uint64_t t2 = b[4U * 0U + 3U];
  210|   887k|        uint64_t *res_i = tmp + 4U * 0U + 3U;
  211|   887k|        c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t12, t2, res_i);
  ------------------
  |  |   66|   887k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  212|   887k|    }
  213|   887k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|   887k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|   887k|    do {                               \
  |  |  |  |  289|   887k|        uint32_t i = z;                \
  |  |  |  |  290|   887k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   887k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|   887k|                    4U,
  215|   887k|                    6U,
  216|   887k|                    1U,
  217|   887k|                    uint64_t t1 = a[i];
  218|   887k|                    uint64_t t2 = b[i];
  219|   887k|                    uint64_t *res_i = tmp + i;
  220|   887k|                    c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t1, t2, res_i););
  221|   887k|    uint64_t c11 = c1;
  222|   887k|    KRML_MAYBE_UNUSED_VAR(c11);
  ------------------
  |  |   60|   887k|#define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
  |  |  ------------------
  |  |  |  |   56|   887k|#define KRML_HOST_IGNORE(x) (void)(x)
  |  |  ------------------
  ------------------
  223|   887k|    uint64_t c2 = 0ULL - c0;
  224|   887k|    KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|   887k|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|   887k|    do {                               \
  |  |  |  |  289|   887k|        uint32_t i = z;                \
  |  |  |  |  290|   887k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   887k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|   887k|                    0U,
  226|   887k|                    6U,
  227|   887k|                    1U,
  228|   887k|                    uint64_t *os = a;
  229|   887k|                    uint64_t x = (c2 & tmp[i]) | (~c2 & a[i]);
  230|   887k|                    os[i] = x;);
  231|   887k|}
Hacl_P384.c:bn_to_bytes_be:
  319|    518|{
  320|    518|    uint8_t tmp[48U] = { 0U };
  321|    518|    KRML_MAYBE_UNUSED_VAR(tmp);
  ------------------
  |  |   60|    518|#define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
  |  |  ------------------
  |  |  |  |   56|    518|#define KRML_HOST_IGNORE(x) (void)(x)
  |  |  ------------------
  ------------------
  322|    518|    KRML_MAYBE_FOR6(i, 0U, 6U, 1U, store64_be(a + i * 8U, b[6U - i - 1U]););
  ------------------
  |  |  342|    518|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|    518|    do {                               \
  |  |  |  |  289|    518|        uint32_t i = z;                \
  |  |  |  |  290|    518|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    518|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|    518|}
Hacl_P384.c:load_qelem_conditional:
  746|    259|{
  747|    259|    bn_from_bytes_be(a, b);
  748|    259|    uint64_t tmp[6U] = { 0U };
  749|    259|    p384_make_order(tmp);
  750|    259|    uint64_t c = bn_sub(tmp, a, tmp);
  751|    259|    uint64_t is_lt_order = FStar_UInt64_gte_mask(c, 0ULL) & ~FStar_UInt64_eq_mask(c, 0ULL);
  752|    259|    uint64_t bn_zero[6U] = { 0U };
  753|    259|    uint64_t res = bn_is_eq_mask(a, bn_zero);
  754|    259|    uint64_t is_eq_zero = res;
  755|    259|    uint64_t is_b_valid = is_lt_order & ~is_eq_zero;
  756|    259|    uint64_t oneq[6U] = { 0U };
  757|    259|    memset(oneq, 0U, 6U * sizeof(uint64_t));
  758|    259|    oneq[0U] = 1ULL;
  759|    259|    KRML_MAYBE_FOR6(i,
  ------------------
  |  |  342|    259|#define KRML_MAYBE_FOR6(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 6, k, x)
  |  |  ------------------
  |  |  |  |  288|    259|    do {                               \
  |  |  |  |  289|    259|        uint32_t i = z;                \
  |  |  |  |  290|    259|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    259|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  760|    259|                    0U,
  761|    259|                    6U,
  762|    259|                    1U,
  763|    259|                    uint64_t *os = a;
  764|    259|                    uint64_t uu____0 = oneq[i];
  765|    259|                    uint64_t x = uu____0 ^ (is_b_valid & (a[i] ^ uu____0));
  766|    259|                    os[i] = x;);
  767|    259|    return is_b_valid;
  768|    259|}
Hacl_P384.c:point_mul_g:
 1069|    151|{
 1070|    151|    uint64_t g[18U] = { 0U };
 1071|    151|    uint64_t *x = g;
 1072|    151|    uint64_t *y = g + 6U;
 1073|    151|    uint64_t *z = g + 12U;
 1074|    151|    p384_make_g_x(x);
 1075|    151|    p384_make_g_y(y);
 1076|    151|    p384_make_fone(z);
 1077|    151|    point_mul(res, scalar, g);
 1078|    151|}
Hacl_P384.c:p384_make_g_x:
  384|    151|{
  385|    151|    n[0U] = 0x3dd0756649c0b528ULL;
  386|    151|    n[1U] = 0x20e378e2a0d6ce38ULL;
  387|    151|    n[2U] = 0x879c3afc541b4d6eULL;
  388|    151|    n[3U] = 0x6454868459a30effULL;
  389|    151|    n[4U] = 0x812ff723614ede2bULL;
  390|    151|    n[5U] = 0x4d3aadc2299e1513ULL;
  391|    151|}
Hacl_P384.c:p384_make_g_y:
  395|    151|{
  396|    151|    n[0U] = 0x23043dad4b03a4feULL;
  397|    151|    n[1U] = 0xa1bfa8bf7bb4a9acULL;
  398|    151|    n[2U] = 0x8bade7562e83b050ULL;
  399|    151|    n[3U] = 0xc6c3521968f4ffd9ULL;
  400|    151|    n[4U] = 0xdd8002263969a840ULL;
  401|    151|    n[5U] = 0x2b78abc25a15c5e9ULL;
  402|    151|}
Hacl_P384.c:p384_finv:
  720|    265|{
  721|    265|    uint64_t b[6U] = { 0U };
  722|    265|    b[0U] = 0x00000000fffffffdULL;
  723|    265|    b[1U] = 0xffffffff00000000ULL;
  724|    265|    b[2U] = 0xfffffffffffffffeULL;
  725|    265|    b[3U] = 0xffffffffffffffffULL;
  726|    265|    b[4U] = 0xffffffffffffffffULL;
  727|    265|    b[5U] = 0xffffffffffffffffULL;
  728|    265|    fexp_consttime(res, a, b);
  729|    265|}
Hacl_P384.c:point_mul:
 1027|    271|{
 1028|    271|    uint64_t table[288U] = { 0U };
 1029|    271|    uint64_t tmp[18U] = { 0U };
 1030|    271|    uint64_t *t0 = table;
 1031|    271|    uint64_t *t1 = table + 18U;
 1032|    271|    point_zero(t0);
 1033|    271|    memcpy(t1, p, 18U * sizeof(uint64_t));
 1034|    271|    KRML_MAYBE_FOR7(i,
  ------------------
  |  |  348|    271|#define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 7, k, x)
  |  |  ------------------
  |  |  |  |  288|    271|    do {                               \
  |  |  |  |  289|    271|        uint32_t i = z;                \
  |  |  |  |  290|    271|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    271|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1035|    271|                    0U,
 1036|    271|                    7U,
 1037|    271|                    1U,
 1038|    271|                    uint64_t *t11 = table + (i + 1U) * 18U;
 1039|    271|                    point_double(t11, tmp);
 1040|    271|                    memcpy(table + (2U * i + 2U) * 18U, tmp, 18U * sizeof(uint64_t));
 1041|    271|                    uint64_t *t2 = table + (2U * i + 2U) * 18U;
 1042|    271|                    point_add(p, t2, tmp);
 1043|    271|                    memcpy(table + (2U * i + 3U) * 18U, tmp, 18U * sizeof(uint64_t)););
 1044|    271|    point_zero(res);
 1045|    271|    uint64_t tmp0[18U] = { 0U };
 1046|  26.2k|    for (uint32_t i0 = 0U; i0 < 96U; i0++) {
  ------------------
  |  Branch (1046:28): [True: 26.0k, False: 271]
  ------------------
 1047|  26.0k|        KRML_MAYBE_FOR4(i, 0U, 4U, 1U, point_double(res, res););
  ------------------
  |  |  330|  26.0k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  26.0k|    do {                               \
  |  |  |  |  289|  26.0k|        uint32_t i = z;                \
  |  |  |  |  290|  26.0k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  26.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1048|  26.0k|        uint32_t k = 384U - 4U * i0 - 4U;
 1049|  26.0k|        uint64_t bits_l = Hacl_Bignum_Lib_bn_get_bits_u64(6U, scalar, k, 4U);
 1050|  26.0k|        memcpy(tmp0, (uint64_t *)table, 18U * sizeof(uint64_t));
 1051|  26.0k|        KRML_MAYBE_FOR15(
  ------------------
  |  |  396|  26.0k|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|  26.0k|    do {                               \
  |  |  |  |  289|  26.0k|        uint32_t i = z;                \
  |  |  |  |  290|  26.0k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  26.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1052|  26.0k|            i1,
 1053|  26.0k|            0U,
 1054|  26.0k|            15U,
 1055|  26.0k|            1U,
 1056|  26.0k|            uint64_t c = FStar_UInt64_eq_mask(bits_l, (uint64_t)(i1 + 1U));
 1057|  26.0k|            const uint64_t *res_j = table + (i1 + 1U) * 18U;
 1058|  26.0k|            for (uint32_t i = 0U; i < 18U; i++) {
 1059|  26.0k|                uint64_t *os = tmp0;
 1060|  26.0k|                uint64_t x = (c & res_j[i]) | (~c & tmp0[i]);
 1061|  26.0k|                os[i] = x;
 1062|  26.0k|            });
 1063|  26.0k|        point_add(res, tmp0, res);
 1064|  26.0k|    }
 1065|    271|}
Hacl_P384.c:point_zero:
 1016|    542|{
 1017|    542|    uint64_t *x = one;
 1018|    542|    uint64_t *y = one + 6U;
 1019|    542|    uint64_t *z = one + 12U;
 1020|    542|    p384_make_fzero(x);
 1021|    542|    p384_make_fone(y);
 1022|    542|    p384_make_fzero(z);
 1023|    542|}
Hacl_P384.c:p384_make_fzero:
  417|  1.08k|{
  418|  1.08k|    memset(n, 0U, 6U * sizeof(uint64_t));
  419|  1.08k|    n[0U] = 0ULL;
  420|  1.08k|}
Hacl_P384.c:point_double:
  959|   105k|{
  960|   105k|    uint64_t tmp[30U] = { 0U };
  961|   105k|    uint64_t *x1 = x;
  962|   105k|    uint64_t *z = x + 12U;
  963|   105k|    uint64_t *x3 = xx;
  964|   105k|    uint64_t *y3 = xx + 6U;
  965|   105k|    uint64_t *z3 = xx + 12U;
  966|   105k|    uint64_t *t0 = tmp;
  967|   105k|    uint64_t *t1 = tmp + 6U;
  968|   105k|    uint64_t *t2 = tmp + 12U;
  969|   105k|    uint64_t *t3 = tmp + 18U;
  970|   105k|    uint64_t *t4 = tmp + 24U;
  971|   105k|    uint64_t *x2 = x;
  972|   105k|    uint64_t *y = x + 6U;
  973|   105k|    uint64_t *z1 = x + 12U;
  974|   105k|    fsqr0(t0, x2);
  975|   105k|    fsqr0(t1, y);
  976|   105k|    fsqr0(t2, z1);
  977|   105k|    fmul0(t3, x2, y);
  978|   105k|    fadd0(t3, t3, t3);
  979|   105k|    fmul0(t4, y, z1);
  980|   105k|    fmul0(z3, x1, z);
  981|   105k|    fadd0(z3, z3, z3);
  982|   105k|    uint64_t b_coeff[6U] = { 0U };
  983|   105k|    p384_make_b_coeff(b_coeff);
  984|   105k|    fmul0(y3, b_coeff, t2);
  985|   105k|    fsub0(y3, y3, z3);
  986|   105k|    fadd0(x3, y3, y3);
  987|   105k|    fadd0(y3, x3, y3);
  988|   105k|    fsub0(x3, t1, y3);
  989|   105k|    fadd0(y3, t1, y3);
  990|   105k|    fmul0(y3, x3, y3);
  991|   105k|    fmul0(x3, x3, t3);
  992|   105k|    fadd0(t3, t2, t2);
  993|   105k|    fadd0(t2, t2, t3);
  994|   105k|    uint64_t b_coeff0[6U] = { 0U };
  995|   105k|    p384_make_b_coeff(b_coeff0);
  996|   105k|    fmul0(z3, b_coeff0, z3);
  997|   105k|    fsub0(z3, z3, t2);
  998|   105k|    fsub0(z3, z3, t0);
  999|   105k|    fadd0(t3, z3, z3);
 1000|   105k|    fadd0(z3, z3, t3);
 1001|   105k|    fadd0(t3, t0, t0);
 1002|   105k|    fadd0(t0, t3, t0);
 1003|   105k|    fsub0(t0, t0, t2);
 1004|   105k|    fmul0(t0, t0, z3);
 1005|   105k|    fadd0(y3, y3, t0);
 1006|   105k|    fadd0(t0, t4, t4);
 1007|   105k|    fmul0(z3, t0, z3);
 1008|   105k|    fsub0(x3, x3, z3);
 1009|   105k|    fmul0(z3, t0, t1);
 1010|   105k|    fadd0(z3, z3, z3);
 1011|   105k|    fadd0(z3, z3, z3);
 1012|   105k|}

Hacl_P521_ecdsa_verif_without_hash:
 1421|      4|{
 1422|      4|    uint64_t m_q[9U] = { 0U };
 1423|      4|    uint8_t mHash[66U] = { 0U };
 1424|      4|    memcpy(mHash, msg, 66U * sizeof(uint8_t));
 1425|      4|    KRML_MAYBE_UNUSED_VAR(msg_len);
  ------------------
  |  |   60|      4|#define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
  |  |  ------------------
  |  |  |  |   56|      4|#define KRML_HOST_IGNORE(x) (void)(x)
  |  |  ------------------
  ------------------
 1426|      4|    bn_from_bytes_be(m_q, mHash);
 1427|      4|    qmod_short(m_q, m_q);
 1428|      4|    bool res = ecdsa_verify_msg_as_qelem(m_q, public_key, signature_r, signature_s);
 1429|      4|    return res;
 1430|      4|}
Hacl_P521_validate_public_key:
 1452|     48|{
 1453|     48|    uint64_t point_jac[27U] = { 0U };
 1454|     48|    uint64_t p_aff[18U] = { 0U };
 1455|     48|    uint8_t *p_x = public_key;
 1456|     48|    uint8_t *p_y = public_key + 66U;
 1457|     48|    uint64_t *bn_p_x = p_aff;
 1458|     48|    uint64_t *bn_p_y = p_aff + 9U;
 1459|     48|    bn_from_bytes_be(bn_p_x, p_x);
 1460|     48|    bn_from_bytes_be(bn_p_y, p_y);
 1461|     48|    uint64_t *px0 = p_aff;
 1462|     48|    uint64_t *py0 = p_aff + 9U;
 1463|     48|    uint64_t lessX = bn_is_lt_prime_mask(px0);
 1464|     48|    uint64_t lessY = bn_is_lt_prime_mask(py0);
 1465|     48|    uint64_t res0 = lessX & lessY;
 1466|     48|    bool is_xy_valid = res0 == 0xFFFFFFFFFFFFFFFFULL;
 1467|     48|    bool res;
 1468|     48|    if (!is_xy_valid) {
  ------------------
  |  Branch (1468:9): [True: 3, False: 45]
  ------------------
 1469|      3|        res = false;
 1470|     45|    } else {
 1471|     45|        uint64_t rp[9U] = { 0U };
 1472|     45|        uint64_t tx[9U] = { 0U };
 1473|     45|        uint64_t ty[9U] = { 0U };
 1474|     45|        uint64_t *px = p_aff;
 1475|     45|        uint64_t *py = p_aff + 9U;
 1476|     45|        to_mont(tx, px);
 1477|     45|        to_mont(ty, py);
 1478|     45|        uint64_t tmp[9U] = { 0U };
 1479|     45|        fsqr0(rp, tx);
 1480|     45|        fmul0(rp, rp, tx);
 1481|     45|        p521_make_a_coeff(tmp);
 1482|     45|        fmul0(tmp, tmp, tx);
 1483|     45|        fadd0(rp, tmp, rp);
 1484|     45|        p521_make_b_coeff(tmp);
 1485|     45|        fadd0(rp, tmp, rp);
 1486|     45|        fsqr0(ty, ty);
 1487|     45|        uint64_t r = bn_is_eq_mask(ty, rp);
 1488|     45|        uint64_t r0 = r;
 1489|     45|        bool r1 = r0 == 0xFFFFFFFFFFFFFFFFULL;
 1490|     45|        res = r1;
 1491|     45|    }
 1492|     48|    if (res) {
  ------------------
  |  Branch (1492:9): [True: 40, False: 8]
  ------------------
 1493|     40|        uint64_t *px = p_aff;
 1494|     40|        uint64_t *py = p_aff + 9U;
 1495|     40|        uint64_t *rx = point_jac;
 1496|     40|        uint64_t *ry = point_jac + 9U;
 1497|     40|        uint64_t *rz = point_jac + 18U;
 1498|     40|        to_mont(rx, px);
 1499|     40|        to_mont(ry, py);
 1500|     40|        p521_make_fone(rz);
 1501|     40|    }
 1502|     48|    bool res1 = res;
 1503|     48|    return res1;
 1504|     48|}
Hacl_P521_validate_private_key:
 1518|     32|{
 1519|     32|    uint64_t bn_sk[9U] = { 0U };
 1520|     32|    bn_from_bytes_be(bn_sk, private_key);
 1521|     32|    uint64_t tmp[9U] = { 0U };
 1522|     32|    p521_make_order(tmp);
 1523|     32|    uint64_t c = bn_sub(tmp, bn_sk, tmp);
 1524|     32|    uint64_t is_lt_order = FStar_UInt64_gte_mask(c, 0ULL) & ~FStar_UInt64_eq_mask(c, 0ULL);
 1525|     32|    uint64_t bn_zero[9U] = { 0U };
 1526|     32|    uint64_t res = bn_is_eq_mask(bn_sk, bn_zero);
 1527|     32|    uint64_t is_eq_zero = res;
 1528|     32|    uint64_t res0 = is_lt_order & ~is_eq_zero;
 1529|     32|    return res0 == 0xFFFFFFFFFFFFFFFFULL;
 1530|     32|}
Hacl_P521_dh_initiator:
 1686|     32|{
 1687|     32|    uint64_t tmp[36U] = { 0U };
 1688|     32|    uint64_t *sk = tmp;
 1689|     32|    uint64_t *pk = tmp + 9U;
 1690|     32|    uint64_t is_sk_valid = load_qelem_conditional(sk, private_key);
 1691|     32|    point_mul_g(pk, sk);
 1692|     32|    uint64_t aff_p[18U] = { 0U };
 1693|     32|    uint64_t zinv[9U] = { 0U };
 1694|     32|    uint64_t *px = pk;
 1695|     32|    uint64_t *py0 = pk + 9U;
 1696|     32|    uint64_t *pz = pk + 18U;
 1697|     32|    uint64_t *x = aff_p;
 1698|     32|    uint64_t *y = aff_p + 9U;
 1699|     32|    p521_finv(zinv, pz);
 1700|     32|    fmul0(x, px, zinv);
 1701|     32|    fmul0(y, py0, zinv);
 1702|     32|    from_mont(x, x);
 1703|     32|    from_mont(y, y);
 1704|     32|    uint64_t *px0 = aff_p;
 1705|     32|    uint64_t *py = aff_p + 9U;
 1706|     32|    bn_to_bytes_be(public_key, px0);
 1707|     32|    bn_to_bytes_be(public_key + 66U, py);
 1708|     32|    return is_sk_valid == 0xFFFFFFFFFFFFFFFFULL;
 1709|     32|}
Hacl_P521_dh_responder:
 1725|      2|{
 1726|      2|    uint64_t tmp[264U] = { 0U };
 1727|      2|    uint64_t *sk = tmp;
 1728|      2|    uint64_t *pk = tmp + 9U;
 1729|      2|    uint64_t p_aff[18U] = { 0U };
 1730|      2|    uint8_t *p_x = their_pubkey;
 1731|      2|    uint8_t *p_y = their_pubkey + 66U;
 1732|      2|    uint64_t *bn_p_x = p_aff;
 1733|      2|    uint64_t *bn_p_y = p_aff + 9U;
 1734|      2|    bn_from_bytes_be(bn_p_x, p_x);
 1735|      2|    bn_from_bytes_be(bn_p_y, p_y);
 1736|      2|    uint64_t *px0 = p_aff;
 1737|      2|    uint64_t *py0 = p_aff + 9U;
 1738|      2|    uint64_t lessX = bn_is_lt_prime_mask(px0);
 1739|      2|    uint64_t lessY = bn_is_lt_prime_mask(py0);
 1740|      2|    uint64_t res0 = lessX & lessY;
 1741|      2|    bool is_xy_valid = res0 == 0xFFFFFFFFFFFFFFFFULL;
 1742|      2|    bool res;
 1743|      2|    if (!is_xy_valid) {
  ------------------
  |  Branch (1743:9): [True: 0, False: 2]
  ------------------
 1744|      0|        res = false;
 1745|      2|    } else {
 1746|      2|        uint64_t rp[9U] = { 0U };
 1747|      2|        uint64_t tx[9U] = { 0U };
 1748|      2|        uint64_t ty[9U] = { 0U };
 1749|      2|        uint64_t *px = p_aff;
 1750|      2|        uint64_t *py = p_aff + 9U;
 1751|      2|        to_mont(tx, px);
 1752|      2|        to_mont(ty, py);
 1753|      2|        uint64_t tmp1[9U] = { 0U };
 1754|      2|        fsqr0(rp, tx);
 1755|      2|        fmul0(rp, rp, tx);
 1756|      2|        p521_make_a_coeff(tmp1);
 1757|      2|        fmul0(tmp1, tmp1, tx);
 1758|      2|        fadd0(rp, tmp1, rp);
 1759|      2|        p521_make_b_coeff(tmp1);
 1760|      2|        fadd0(rp, tmp1, rp);
 1761|      2|        fsqr0(ty, ty);
 1762|      2|        uint64_t r = bn_is_eq_mask(ty, rp);
 1763|      2|        uint64_t r0 = r;
 1764|      2|        bool r1 = r0 == 0xFFFFFFFFFFFFFFFFULL;
 1765|      2|        res = r1;
 1766|      2|    }
 1767|      2|    if (res) {
  ------------------
  |  Branch (1767:9): [True: 2, False: 0]
  ------------------
 1768|      2|        uint64_t *px = p_aff;
 1769|      2|        uint64_t *py = p_aff + 9U;
 1770|      2|        uint64_t *rx = pk;
 1771|      2|        uint64_t *ry = pk + 9U;
 1772|      2|        uint64_t *rz = pk + 18U;
 1773|      2|        to_mont(rx, px);
 1774|      2|        to_mont(ry, py);
 1775|      2|        p521_make_fone(rz);
 1776|      2|    }
 1777|      2|    bool is_pk_valid = res;
 1778|      2|    uint64_t is_sk_valid = load_qelem_conditional(sk, private_key);
 1779|      2|    uint64_t ss_proj[27U] = { 0U };
 1780|      2|    if (is_pk_valid) {
  ------------------
  |  Branch (1780:9): [True: 2, False: 0]
  ------------------
 1781|      2|        point_mul(ss_proj, sk, pk);
 1782|      2|        uint64_t aff_p[18U] = { 0U };
 1783|      2|        uint64_t zinv[9U] = { 0U };
 1784|      2|        uint64_t *px = ss_proj;
 1785|      2|        uint64_t *py1 = ss_proj + 9U;
 1786|      2|        uint64_t *pz = ss_proj + 18U;
 1787|      2|        uint64_t *x = aff_p;
 1788|      2|        uint64_t *y = aff_p + 9U;
 1789|      2|        p521_finv(zinv, pz);
 1790|      2|        fmul0(x, px, zinv);
 1791|      2|        fmul0(y, py1, zinv);
 1792|      2|        from_mont(x, x);
 1793|      2|        from_mont(y, y);
 1794|      2|        uint64_t *px1 = aff_p;
 1795|      2|        uint64_t *py = aff_p + 9U;
 1796|      2|        bn_to_bytes_be(shared_secret, px1);
 1797|      2|        bn_to_bytes_be(shared_secret + 66U, py);
 1798|      2|    }
 1799|      2|    return is_sk_valid == 0xFFFFFFFFFFFFFFFFULL && is_pk_valid;
  ------------------
  |  Branch (1799:12): [True: 2, False: 0]
  |  Branch (1799:52): [True: 2, False: 0]
  ------------------
 1800|      2|}
Hacl_P521.c:bn_from_bytes_be:
  327|    186|{
  328|    186|    uint8_t tmp[72U] = { 0U };
  329|    186|    memcpy(tmp + 6U, b, 66U * sizeof(uint8_t));
  330|    186|    KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|    186|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|    186|    do {                               \
  |  |  |  |  289|    186|        uint32_t i = z;                \
  |  |  |  |  290|    186|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    186|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  331|    186|                    0U,
  332|    186|                    9U,
  333|    186|                    1U,
  334|    186|                    uint64_t *os = a;
  335|    186|                    uint64_t u = load64_be(tmp + (9U - i - 1U) * 8U);
  336|    186|                    uint64_t x = u;
  337|    186|                    os[i] = x;);
  338|    186|}
Hacl_P521.c:qmod_short:
  853|      7|{
  854|      7|    uint64_t tmp[9U] = { 0U };
  855|      7|    p521_make_order(tmp);
  856|      7|    uint64_t c = bn_sub(tmp, b, tmp);
  857|      7|    bn_cmovznz(a, c, tmp, b);
  858|      7|}
Hacl_P521.c:bn_cmovznz:
   46|      7|{
   47|      7|    uint64_t mask = ~FStar_UInt64_eq_mask(b, 0ULL);
   48|      7|    KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|      7|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|      7|    do {                               \
  |  |  |  |  289|      7|        uint32_t i = z;                \
  |  |  |  |  290|      7|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|      7|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   49|      7|                    0U,
   50|      7|                    9U,
   51|      7|                    1U,
   52|      7|                    uint64_t *os = a;
   53|      7|                    uint64_t uu____0 = c[i];
   54|      7|                    uint64_t x = uu____0 ^ (mask & (d[i] ^ uu____0));
   55|      7|                    os[i] = x;);
   56|      7|}
Hacl_P521.c:p521_qinv:
  894|      3|{
  895|      3|    uint64_t b[9U] = { 0U };
  896|      3|    b[0U] = 0xbb6fb71e91386407ULL;
  897|      3|    b[1U] = 0x3bb5c9b8899c47aeULL;
  898|      3|    b[2U] = 0x7fcc0148f709a5d0ULL;
  899|      3|    b[3U] = 0x51868783bf2f966bULL;
  900|      3|    b[4U] = 0xfffffffffffffffaULL;
  901|      3|    b[5U] = 0xffffffffffffffffULL;
  902|      3|    b[6U] = 0xffffffffffffffffULL;
  903|      3|    b[7U] = 0xffffffffffffffffULL;
  904|      3|    b[8U] = 0x1ffULL;
  905|      3|    uint64_t tmp[9U] = { 0U };
  906|      3|    memcpy(tmp, a, 9U * sizeof(uint64_t));
  907|      3|    uint64_t table[288U] = { 0U };
  908|      3|    uint64_t tmp1[9U] = { 0U };
  909|      3|    uint64_t *t0 = table;
  910|      3|    uint64_t *t1 = table + 9U;
  911|      3|    p521_make_qone(t0);
  912|      3|    memcpy(t1, tmp, 9U * sizeof(uint64_t));
  913|      3|    KRML_MAYBE_FOR15(i,
  ------------------
  |  |  396|      3|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|      3|    do {                               \
  |  |  |  |  289|      3|        uint32_t i = z;                \
  |  |  |  |  290|      3|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|      3|                     0U,
  915|      3|                     15U,
  916|      3|                     1U,
  917|      3|                     uint64_t *t11 = table + (i + 1U) * 9U;
  918|      3|                     qsqr(tmp1, t11);
  919|      3|                     memcpy(table + (2U * i + 2U) * 9U, tmp1, 9U * sizeof(uint64_t));
  920|      3|                     uint64_t *t2 = table + (2U * i + 2U) * 9U;
  921|      3|                     qmul(tmp1, tmp, t2);
  922|      3|                     memcpy(table + (2U * i + 3U) * 9U, tmp1, 9U * sizeof(uint64_t)););
  923|      3|    uint32_t i0 = 520U;
  924|      3|    uint64_t bits_c = Hacl_Bignum_Lib_bn_get_bits_u64(9U, b, i0, 5U);
  925|      3|    memcpy(res, (uint64_t *)table, 9U * sizeof(uint64_t));
  926|     96|    for (uint32_t i1 = 0U; i1 < 31U; i1++) {
  ------------------
  |  Branch (926:28): [True: 93, False: 3]
  ------------------
  927|     93|        uint64_t c = FStar_UInt64_eq_mask(bits_c, (uint64_t)(i1 + 1U));
  928|     93|        const uint64_t *res_j = table + (i1 + 1U) * 9U;
  929|     93|        KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|     93|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|     93|    do {                               \
  |  |  |  |  289|     93|        uint32_t i = z;                \
  |  |  |  |  290|     93|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     93|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  930|     93|                        0U,
  931|     93|                        9U,
  932|     93|                        1U,
  933|     93|                        uint64_t *os = res;
  934|     93|                        uint64_t x = (c & res_j[i]) | (~c & res[i]);
  935|     93|                        os[i] = x;);
  936|     93|    }
  937|      3|    uint64_t tmp10[9U] = { 0U };
  938|    315|    for (uint32_t i1 = 0U; i1 < 104U; i1++) {
  ------------------
  |  Branch (938:28): [True: 312, False: 3]
  ------------------
  939|    312|        KRML_MAYBE_FOR5(i, 0U, 5U, 1U, qsqr(res, res););
  ------------------
  |  |  336|    312|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|    312|    do {                               \
  |  |  |  |  289|    312|        uint32_t i = z;                \
  |  |  |  |  290|    312|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    312|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  940|    312|        uint32_t k = 520U - 5U * i1 - 5U;
  941|    312|        uint64_t bits_l = Hacl_Bignum_Lib_bn_get_bits_u64(9U, b, k, 5U);
  942|    312|        memcpy(tmp10, (uint64_t *)table, 9U * sizeof(uint64_t));
  943|  9.98k|        for (uint32_t i2 = 0U; i2 < 31U; i2++) {
  ------------------
  |  Branch (943:32): [True: 9.67k, False: 312]
  ------------------
  944|  9.67k|            uint64_t c = FStar_UInt64_eq_mask(bits_l, (uint64_t)(i2 + 1U));
  945|  9.67k|            const uint64_t *res_j = table + (i2 + 1U) * 9U;
  946|  9.67k|            KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|  9.67k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|  9.67k|    do {                               \
  |  |  |  |  289|  9.67k|        uint32_t i = z;                \
  |  |  |  |  290|  9.67k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  9.67k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  947|  9.67k|                            0U,
  948|  9.67k|                            9U,
  949|  9.67k|                            1U,
  950|  9.67k|                            uint64_t *os = tmp10;
  951|  9.67k|                            uint64_t x = (c & res_j[i]) | (~c & tmp10[i]);
  952|  9.67k|                            os[i] = x;);
  953|  9.67k|        }
  954|    312|        qmul(res, res, tmp10);
  955|    312|    }
  956|      3|}
Hacl_P521.c:p521_make_qone:
  461|      3|{
  462|      3|    f[0U] = 0xfb80000000000000ULL;
  463|      3|    f[1U] = 0x28a2482470b763cdULL;
  464|      3|    f[2U] = 0x17e2251b23bb31dcULL;
  465|      3|    f[3U] = 0xca4019ff5b847b2dULL;
  466|      3|    f[4U] = 0x2d73cbc3e206834ULL;
  467|      3|    f[5U] = 0x0ULL;
  468|      3|    f[6U] = 0x0ULL;
  469|      3|    f[7U] = 0x0ULL;
  470|      3|    f[8U] = 0x0ULL;
  471|      3|}
Hacl_P521.c:qsqr:
  878|  1.60k|{
  879|  1.60k|    uint64_t tmp[18U] = { 0U };
  880|  1.60k|    bn_sqr(tmp, b);
  881|  1.60k|    qmont_reduction(a, tmp);
  882|  1.60k|}
Hacl_P521.c:bn_sqr:
  271|  84.7k|{
  272|  84.7k|    memset(a, 0U, 18U * sizeof(uint64_t));
  273|  84.7k|    KRML_MAYBE_FOR9(
  ------------------
  |  |  360|  84.7k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|  84.7k|    do {                               \
  |  |  |  |  289|  84.7k|        uint32_t i = z;                \
  |  |  |  |  290|  84.7k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  84.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  274|  84.7k|        i0,
  275|  84.7k|        0U,
  276|  84.7k|        9U,
  277|  84.7k|        1U,
  278|  84.7k|        uint64_t *ab = b;
  279|  84.7k|        uint64_t a_j = b[i0];
  280|  84.7k|        uint64_t *res_j = a + i0;
  281|  84.7k|        uint64_t c = 0ULL;
  282|  84.7k|        for (uint32_t i = 0U; i < i0 / 4U; i++) {
  283|  84.7k|            uint64_t a_i = ab[4U * i];
  284|  84.7k|            uint64_t *res_i0 = res_j + 4U * i;
  285|  84.7k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, a_j, c, res_i0);
  286|  84.7k|            uint64_t a_i0 = ab[4U * i + 1U];
  287|  84.7k|            uint64_t *res_i1 = res_j + 4U * i + 1U;
  288|  84.7k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, a_j, c, res_i1);
  289|  84.7k|            uint64_t a_i1 = ab[4U * i + 2U];
  290|  84.7k|            uint64_t *res_i2 = res_j + 4U * i + 2U;
  291|  84.7k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, a_j, c, res_i2);
  292|  84.7k|            uint64_t a_i2 = ab[4U * i + 3U];
  293|  84.7k|            uint64_t *res_i = res_j + 4U * i + 3U;
  294|  84.7k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, a_j, c, res_i);
  295|  84.7k|        } for (uint32_t i = i0 / 4U * 4U; i < i0; i++) {
  296|  84.7k|            uint64_t a_i = ab[i];
  297|  84.7k|            uint64_t *res_i = res_j + i;
  298|  84.7k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, a_j, c, res_i);
  299|  84.7k|        } uint64_t r = c;
  300|  84.7k|        a[i0 + i0] = r;);
  301|  84.7k|    uint64_t c0 = Hacl_Bignum_Addition_bn_add_eq_len_u64(18U, a, a, a);
  302|  84.7k|    KRML_MAYBE_UNUSED_VAR(c0);
  ------------------
  |  |   60|  84.7k|#define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
  |  |  ------------------
  |  |  |  |   56|  84.7k|#define KRML_HOST_IGNORE(x) (void)(x)
  |  |  ------------------
  ------------------
  303|  84.7k|    uint64_t tmp[18U] = { 0U };
  304|  84.7k|    KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|  84.7k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|  84.7k|    do {                               \
  |  |  |  |  289|  84.7k|        uint32_t i = z;                \
  |  |  |  |  290|  84.7k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  84.7k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  305|  84.7k|                    0U,
  306|  84.7k|                    9U,
  307|  84.7k|                    1U,
  308|  84.7k|                    FStar_UInt128_uint128 res = FStar_UInt128_mul_wide(b[i], b[i]);
  309|  84.7k|                    uint64_t hi = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, 64U));
  310|  84.7k|                    uint64_t lo = FStar_UInt128_uint128_to_uint64(res);
  311|  84.7k|                    tmp[2U * i] = lo;
  312|  84.7k|                    tmp[2U * i + 1U] = hi;);
  313|  84.7k|    uint64_t c1 = Hacl_Bignum_Addition_bn_add_eq_len_u64(18U, a, tmp, a);
  314|  84.7k|    KRML_MAYBE_UNUSED_VAR(c1);
  ------------------
  |  |   60|  84.7k|#define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
  |  |  ------------------
  |  |  |  |   56|  84.7k|#define KRML_HOST_IGNORE(x) (void)(x)
  |  |  ------------------
  ------------------
  315|  84.7k|}
Hacl_P521.c:qmont_reduction:
  555|  1.97k|{
  556|  1.97k|    uint64_t n[9U] = { 0U };
  557|  1.97k|    p521_make_order(n);
  558|  1.97k|    uint64_t c0 = 0ULL;
  559|  1.97k|    KRML_MAYBE_FOR9(
  ------------------
  |  |  360|  1.97k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.97k|    do {                               \
  |  |  |  |  289|  1.97k|        uint32_t i = z;                \
  |  |  |  |  290|  1.97k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.97k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  560|  1.97k|        i0,
  561|  1.97k|        0U,
  562|  1.97k|        9U,
  563|  1.97k|        1U,
  564|  1.97k|        uint64_t qj = 2103001588584519111ULL * x[i0];
  565|  1.97k|        uint64_t *res_j0 = x + i0;
  566|  1.97k|        uint64_t c = 0ULL;
  567|  1.97k|        KRML_MAYBE_FOR2(i,
  568|  1.97k|                        0U,
  569|  1.97k|                        2U,
  570|  1.97k|                        1U,
  571|  1.97k|                        uint64_t a_i = n[4U * i];
  572|  1.97k|                        uint64_t *res_i0 = res_j0 + 4U * i;
  573|  1.97k|                        c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i0);
  574|  1.97k|                        uint64_t a_i0 = n[4U * i + 1U];
  575|  1.97k|                        uint64_t *res_i1 = res_j0 + 4U * i + 1U;
  576|  1.97k|                        c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, qj, c, res_i1);
  577|  1.97k|                        uint64_t a_i1 = n[4U * i + 2U];
  578|  1.97k|                        uint64_t *res_i2 = res_j0 + 4U * i + 2U;
  579|  1.97k|                        c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, qj, c, res_i2);
  580|  1.97k|                        uint64_t a_i2 = n[4U * i + 3U];
  581|  1.97k|                        uint64_t *res_i = res_j0 + 4U * i + 3U;
  582|  1.97k|                        c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, qj, c, res_i););
  583|  1.97k|        {
  584|  1.97k|            uint64_t a_i = n[8U];
  585|  1.97k|            uint64_t *res_i = res_j0 + 8U;
  586|  1.97k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i);
  587|  1.97k|        } uint64_t r = c;
  588|  1.97k|        uint64_t c1 = r;
  589|  1.97k|        uint64_t *resb = x + 9U + i0;
  590|  1.97k|        uint64_t res_j = x[9U + i0];
  591|  1.97k|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, c1, res_j, resb););
  592|  1.97k|    memcpy(res, x + 9U, 9U * sizeof(uint64_t));
  593|  1.97k|    uint64_t c00 = c0;
  594|  1.97k|    uint64_t tmp[9U] = { 0U };
  595|  1.97k|    uint64_t c = 0ULL;
  596|  1.97k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|  1.97k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.97k|    do {                               \
  |  |  |  |  289|  1.97k|        uint32_t i = z;                \
  |  |  |  |  290|  1.97k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.97k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  597|  1.97k|                    0U,
  598|  1.97k|                    2U,
  599|  1.97k|                    1U,
  600|  1.97k|                    uint64_t t1 = res[4U * i];
  601|  1.97k|                    uint64_t t20 = n[4U * i];
  602|  1.97k|                    uint64_t *res_i0 = tmp + 4U * i;
  603|  1.97k|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0);
  604|  1.97k|                    uint64_t t10 = res[4U * i + 1U];
  605|  1.97k|                    uint64_t t21 = n[4U * i + 1U];
  606|  1.97k|                    uint64_t *res_i1 = tmp + 4U * i + 1U;
  607|  1.97k|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1);
  608|  1.97k|                    uint64_t t11 = res[4U * i + 2U];
  609|  1.97k|                    uint64_t t22 = n[4U * i + 2U];
  610|  1.97k|                    uint64_t *res_i2 = tmp + 4U * i + 2U;
  611|  1.97k|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2);
  612|  1.97k|                    uint64_t t12 = res[4U * i + 3U];
  613|  1.97k|                    uint64_t t2 = n[4U * i + 3U];
  614|  1.97k|                    uint64_t *res_i = tmp + 4U * i + 3U;
  615|  1.97k|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i););
  616|  1.97k|    {
  617|  1.97k|        uint64_t t1 = res[8U];
  618|  1.97k|        uint64_t t2 = n[8U];
  619|  1.97k|        uint64_t *res_i = tmp + 8U;
  620|  1.97k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t2, res_i);
  ------------------
  |  |   89|  1.97k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  621|  1.97k|    }
  622|  1.97k|    uint64_t c1 = c;
  623|  1.97k|    uint64_t c2 = c00 - c1;
  624|  1.97k|    KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|  1.97k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.97k|    do {                               \
  |  |  |  |  289|  1.97k|        uint32_t i = z;                \
  |  |  |  |  290|  1.97k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.97k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  625|  1.97k|                    0U,
  626|  1.97k|                    9U,
  627|  1.97k|                    1U,
  628|  1.97k|                    uint64_t *os = res;
  629|  1.97k|                    uint64_t x1 = (c2 & res[i]) | (~c2 & tmp[i]);
  630|  1.97k|                    os[i] = x1;);
  631|  1.97k|}
Hacl_P521.c:qmul:
  870|    363|{
  871|    363|    uint64_t tmp[18U] = { 0U };
  872|    363|    bn_mul(tmp, b, c);
  873|    363|    qmont_reduction(a, tmp);
  874|    363|}
Hacl_P521.c:bn_mul:
  235|   292k|{
  236|   292k|    memset(a, 0U, 18U * sizeof(uint64_t));
  237|   292k|    KRML_MAYBE_FOR9(
  ------------------
  |  |  360|   292k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|   292k|    do {                               \
  |  |  |  |  289|   292k|        uint32_t i = z;                \
  |  |  |  |  290|   292k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   292k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|   292k|        i0,
  239|   292k|        0U,
  240|   292k|        9U,
  241|   292k|        1U,
  242|   292k|        uint64_t bj = c[i0];
  243|   292k|        uint64_t *res_j = a + i0;
  244|   292k|        uint64_t c1 = 0ULL;
  245|   292k|        KRML_MAYBE_FOR2(i,
  246|   292k|                        0U,
  247|   292k|                        2U,
  248|   292k|                        1U,
  249|   292k|                        uint64_t a_i = b[4U * i];
  250|   292k|                        uint64_t *res_i0 = res_j + 4U * i;
  251|   292k|                        c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, bj, c1, res_i0);
  252|   292k|                        uint64_t a_i0 = b[4U * i + 1U];
  253|   292k|                        uint64_t *res_i1 = res_j + 4U * i + 1U;
  254|   292k|                        c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, bj, c1, res_i1);
  255|   292k|                        uint64_t a_i1 = b[4U * i + 2U];
  256|   292k|                        uint64_t *res_i2 = res_j + 4U * i + 2U;
  257|   292k|                        c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, bj, c1, res_i2);
  258|   292k|                        uint64_t a_i2 = b[4U * i + 3U];
  259|   292k|                        uint64_t *res_i = res_j + 4U * i + 3U;
  260|   292k|                        c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, bj, c1, res_i););
  261|   292k|        {
  262|   292k|            uint64_t a_i = b[8U];
  263|   292k|            uint64_t *res_i = res_j + 8U;
  264|   292k|            c1 = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, bj, c1, res_i);
  265|   292k|        } uint64_t r = c1;
  266|   292k|        a[9U + i0] = r;);
  267|   292k|}
Hacl_P521.c:from_qmont:
  886|      6|{
  887|      6|    uint64_t tmp[18U] = { 0U };
  888|      6|    memcpy(tmp, b, 9U * sizeof(uint64_t));
  889|      6|    qmont_reduction(a, tmp);
  890|      6|}
Hacl_P521.c:bn_add_mod:
   60|   425k|{
   61|   425k|    uint64_t c10 = 0ULL;
   62|   425k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|   425k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|   425k|    do {                               \
  |  |  |  |  289|   425k|        uint32_t i = z;                \
  |  |  |  |  290|   425k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   425k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   63|   425k|                    0U,
   64|   425k|                    2U,
   65|   425k|                    1U,
   66|   425k|                    uint64_t t1 = c[4U * i];
   67|   425k|                    uint64_t t20 = d[4U * i];
   68|   425k|                    uint64_t *res_i0 = a + 4U * i;
   69|   425k|                    c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t1, t20, res_i0);
   70|   425k|                    uint64_t t10 = c[4U * i + 1U];
   71|   425k|                    uint64_t t21 = d[4U * i + 1U];
   72|   425k|                    uint64_t *res_i1 = a + 4U * i + 1U;
   73|   425k|                    c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t10, t21, res_i1);
   74|   425k|                    uint64_t t11 = c[4U * i + 2U];
   75|   425k|                    uint64_t t22 = d[4U * i + 2U];
   76|   425k|                    uint64_t *res_i2 = a + 4U * i + 2U;
   77|   425k|                    c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t11, t22, res_i2);
   78|   425k|                    uint64_t t12 = c[4U * i + 3U];
   79|   425k|                    uint64_t t2 = d[4U * i + 3U];
   80|   425k|                    uint64_t *res_i = a + 4U * i + 3U;
   81|   425k|                    c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t12, t2, res_i););
   82|   425k|    {
   83|   425k|        uint64_t t1 = c[8U];
   84|   425k|        uint64_t t2 = d[8U];
   85|   425k|        uint64_t *res_i = a + 8U;
   86|   425k|        c10 = Lib_IntTypes_Intrinsics_add_carry_u64(c10, t1, t2, res_i);
  ------------------
  |  |   66|   425k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
   87|   425k|    }
   88|   425k|    uint64_t c0 = c10;
   89|   425k|    uint64_t tmp[9U] = { 0U };
   90|   425k|    uint64_t c1 = 0ULL;
   91|   425k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|   425k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|   425k|    do {                               \
  |  |  |  |  289|   425k|        uint32_t i = z;                \
  |  |  |  |  290|   425k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   425k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   92|   425k|                    0U,
   93|   425k|                    2U,
   94|   425k|                    1U,
   95|   425k|                    uint64_t t1 = a[4U * i];
   96|   425k|                    uint64_t t20 = b[4U * i];
   97|   425k|                    uint64_t *res_i0 = tmp + 4U * i;
   98|   425k|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t1, t20, res_i0);
   99|   425k|                    uint64_t t10 = a[4U * i + 1U];
  100|   425k|                    uint64_t t21 = b[4U * i + 1U];
  101|   425k|                    uint64_t *res_i1 = tmp + 4U * i + 1U;
  102|   425k|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t10, t21, res_i1);
  103|   425k|                    uint64_t t11 = a[4U * i + 2U];
  104|   425k|                    uint64_t t22 = b[4U * i + 2U];
  105|   425k|                    uint64_t *res_i2 = tmp + 4U * i + 2U;
  106|   425k|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t11, t22, res_i2);
  107|   425k|                    uint64_t t12 = a[4U * i + 3U];
  108|   425k|                    uint64_t t2 = b[4U * i + 3U];
  109|   425k|                    uint64_t *res_i = tmp + 4U * i + 3U;
  110|   425k|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t12, t2, res_i););
  111|   425k|    {
  112|   425k|        uint64_t t1 = a[8U];
  113|   425k|        uint64_t t2 = b[8U];
  114|   425k|        uint64_t *res_i = tmp + 8U;
  115|   425k|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t1, t2, res_i);
  ------------------
  |  |   89|   425k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  116|   425k|    }
  117|   425k|    uint64_t c11 = c1;
  118|   425k|    uint64_t c2 = c0 - c11;
  119|   425k|    KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|   425k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|   425k|    do {                               \
  |  |  |  |  289|   425k|        uint32_t i = z;                \
  |  |  |  |  290|   425k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   425k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  120|   425k|                    0U,
  121|   425k|                    9U,
  122|   425k|                    1U,
  123|   425k|                    uint64_t *os = a;
  124|   425k|                    uint64_t x = (c2 & a[i]) | (~c2 & tmp[i]);
  125|   425k|                    os[i] = x;);
  126|   425k|}
Hacl_P521.c:ecdsa_verify_msg_as_qelem:
 1232|      4|{
 1233|      4|    uint64_t tmp[63U] = { 0U };
 1234|      4|    uint64_t *pk = tmp;
 1235|      4|    uint64_t *r_q = tmp + 27U;
 1236|      4|    uint64_t *s_q = tmp + 36U;
 1237|      4|    uint64_t *u1 = tmp + 45U;
 1238|      4|    uint64_t *u2 = tmp + 54U;
 1239|      4|    uint64_t p_aff[18U] = { 0U };
 1240|      4|    uint8_t *p_x = public_key;
 1241|      4|    uint8_t *p_y = public_key + 66U;
 1242|      4|    uint64_t *bn_p_x = p_aff;
 1243|      4|    uint64_t *bn_p_y = p_aff + 9U;
 1244|      4|    bn_from_bytes_be(bn_p_x, p_x);
 1245|      4|    bn_from_bytes_be(bn_p_y, p_y);
 1246|      4|    uint64_t *px0 = p_aff;
 1247|      4|    uint64_t *py0 = p_aff + 9U;
 1248|      4|    uint64_t lessX = bn_is_lt_prime_mask(px0);
 1249|      4|    uint64_t lessY = bn_is_lt_prime_mask(py0);
 1250|      4|    uint64_t res0 = lessX & lessY;
 1251|      4|    bool is_xy_valid = res0 == 0xFFFFFFFFFFFFFFFFULL;
 1252|      4|    bool res;
 1253|      4|    if (!is_xy_valid) {
  ------------------
  |  Branch (1253:9): [True: 0, False: 4]
  ------------------
 1254|      0|        res = false;
 1255|      4|    } else {
 1256|      4|        uint64_t rp[9U] = { 0U };
 1257|      4|        uint64_t tx[9U] = { 0U };
 1258|      4|        uint64_t ty[9U] = { 0U };
 1259|      4|        uint64_t *px = p_aff;
 1260|      4|        uint64_t *py = p_aff + 9U;
 1261|      4|        to_mont(tx, px);
 1262|      4|        to_mont(ty, py);
 1263|      4|        uint64_t tmp1[9U] = { 0U };
 1264|      4|        fsqr0(rp, tx);
 1265|      4|        fmul0(rp, rp, tx);
 1266|      4|        p521_make_a_coeff(tmp1);
 1267|      4|        fmul0(tmp1, tmp1, tx);
 1268|      4|        fadd0(rp, tmp1, rp);
 1269|      4|        p521_make_b_coeff(tmp1);
 1270|      4|        fadd0(rp, tmp1, rp);
 1271|      4|        fsqr0(ty, ty);
 1272|      4|        uint64_t r = bn_is_eq_mask(ty, rp);
 1273|      4|        uint64_t r0 = r;
 1274|      4|        bool r1 = r0 == 0xFFFFFFFFFFFFFFFFULL;
 1275|      4|        res = r1;
 1276|      4|    }
 1277|      4|    if (res) {
  ------------------
  |  Branch (1277:9): [True: 4, False: 0]
  ------------------
 1278|      4|        uint64_t *px = p_aff;
 1279|      4|        uint64_t *py = p_aff + 9U;
 1280|      4|        uint64_t *rx = pk;
 1281|      4|        uint64_t *ry = pk + 9U;
 1282|      4|        uint64_t *rz = pk + 18U;
 1283|      4|        to_mont(rx, px);
 1284|      4|        to_mont(ry, py);
 1285|      4|        p521_make_fone(rz);
 1286|      4|    }
 1287|      4|    bool is_pk_valid = res;
 1288|      4|    bn_from_bytes_be(r_q, signature_r);
 1289|      4|    bn_from_bytes_be(s_q, signature_s);
 1290|      4|    uint64_t tmp10[9U] = { 0U };
 1291|      4|    p521_make_order(tmp10);
 1292|      4|    uint64_t c = bn_sub(tmp10, r_q, tmp10);
 1293|      4|    uint64_t is_lt_order = FStar_UInt64_gte_mask(c, 0ULL) & ~FStar_UInt64_eq_mask(c, 0ULL);
 1294|      4|    uint64_t bn_zero0[9U] = { 0U };
 1295|      4|    uint64_t res1 = bn_is_eq_mask(r_q, bn_zero0);
 1296|      4|    uint64_t is_eq_zero = res1;
 1297|      4|    uint64_t is_r_valid = is_lt_order & ~is_eq_zero;
 1298|      4|    uint64_t tmp11[9U] = { 0U };
 1299|      4|    p521_make_order(tmp11);
 1300|      4|    uint64_t c0 = bn_sub(tmp11, s_q, tmp11);
 1301|      4|    uint64_t is_lt_order0 = FStar_UInt64_gte_mask(c0, 0ULL) & ~FStar_UInt64_eq_mask(c0, 0ULL);
 1302|      4|    uint64_t bn_zero1[9U] = { 0U };
 1303|      4|    uint64_t res2 = bn_is_eq_mask(s_q, bn_zero1);
 1304|      4|    uint64_t is_eq_zero0 = res2;
 1305|      4|    uint64_t is_s_valid = is_lt_order0 & ~is_eq_zero0;
 1306|      4|    bool is_rs_valid = is_r_valid == 0xFFFFFFFFFFFFFFFFULL && is_s_valid == 0xFFFFFFFFFFFFFFFFULL;
  ------------------
  |  Branch (1306:24): [True: 4, False: 0]
  |  Branch (1306:63): [True: 3, False: 1]
  ------------------
 1307|      4|    if (!(is_pk_valid && is_rs_valid)) {
  ------------------
  |  Branch (1307:11): [True: 4, False: 0]
  |  Branch (1307:26): [True: 3, False: 1]
  ------------------
 1308|      1|        return false;
 1309|      1|    }
 1310|      3|    uint64_t sinv[9U] = { 0U };
 1311|      3|    p521_qinv(sinv, s_q);
 1312|      3|    uint64_t tmp1[9U] = { 0U };
 1313|      3|    from_qmont(tmp1, m_q);
 1314|      3|    qmul(u1, sinv, tmp1);
 1315|      3|    uint64_t tmp12[9U] = { 0U };
 1316|      3|    from_qmont(tmp12, r_q);
 1317|      3|    qmul(u2, sinv, tmp12);
 1318|      3|    uint64_t res3[27U] = { 0U };
 1319|      3|    point_mul_double_g(res3, u1, u2, pk);
 1320|      3|    uint64_t *pz0 = res3 + 18U;
 1321|      3|    uint64_t bn_zero[9U] = { 0U };
 1322|      3|    uint64_t res10 = bn_is_eq_mask(pz0, bn_zero);
 1323|      3|    uint64_t m = res10;
 1324|      3|    if (m == 0xFFFFFFFFFFFFFFFFULL) {
  ------------------
  |  Branch (1324:9): [True: 0, False: 3]
  ------------------
 1325|      0|        return false;
 1326|      0|    }
 1327|      3|    uint64_t x[9U] = { 0U };
 1328|      3|    uint64_t zinv[9U] = { 0U };
 1329|      3|    uint64_t *px = res3;
 1330|      3|    uint64_t *pz = res3 + 18U;
 1331|      3|    p521_finv(zinv, pz);
 1332|      3|    fmul0(x, px, zinv);
 1333|      3|    from_mont(x, x);
 1334|      3|    qmod_short(x, x);
 1335|      3|    uint64_t m0 = bn_is_eq_mask(x, r_q);
 1336|      3|    bool res11 = m0 == 0xFFFFFFFFFFFFFFFFULL;
 1337|      3|    return res11;
 1338|      3|}
Hacl_P521.c:point_mul_double_g:
 1176|      3|{
 1177|      3|    uint64_t tmp[27U] = { 0U };
 1178|      3|    point_mul_g(tmp, scalar1);
 1179|      3|    point_mul(res, scalar2, p);
 1180|      3|    point_add(res, tmp, res);
 1181|      3|}
Hacl_P521.c:point_add:
  960|  5.48k|{
  961|  5.48k|    uint64_t tmp[81U] = { 0U };
  962|  5.48k|    uint64_t *t0 = tmp;
  963|  5.48k|    uint64_t *t1 = tmp + 54U;
  964|  5.48k|    uint64_t *x3 = t1;
  965|  5.48k|    uint64_t *y3 = t1 + 9U;
  966|  5.48k|    uint64_t *z3 = t1 + 18U;
  967|  5.48k|    uint64_t *t01 = t0;
  968|  5.48k|    uint64_t *t11 = t0 + 9U;
  969|  5.48k|    uint64_t *t2 = t0 + 18U;
  970|  5.48k|    uint64_t *t3 = t0 + 27U;
  971|  5.48k|    uint64_t *t4 = t0 + 36U;
  972|  5.48k|    uint64_t *t5 = t0 + 45U;
  973|  5.48k|    uint64_t *x1 = x;
  974|  5.48k|    uint64_t *y1 = x + 9U;
  975|  5.48k|    uint64_t *z10 = x + 18U;
  976|  5.48k|    uint64_t *x20 = y;
  977|  5.48k|    uint64_t *y20 = y + 9U;
  978|  5.48k|    uint64_t *z20 = y + 18U;
  979|  5.48k|    fmul0(t01, x1, x20);
  980|  5.48k|    fmul0(t11, y1, y20);
  981|  5.48k|    fmul0(t2, z10, z20);
  982|  5.48k|    fadd0(t3, x1, y1);
  983|  5.48k|    fadd0(t4, x20, y20);
  984|  5.48k|    fmul0(t3, t3, t4);
  985|  5.48k|    fadd0(t4, t01, t11);
  986|  5.48k|    uint64_t *y10 = x + 9U;
  987|  5.48k|    uint64_t *z11 = x + 18U;
  988|  5.48k|    uint64_t *y2 = y + 9U;
  989|  5.48k|    uint64_t *z21 = y + 18U;
  990|  5.48k|    fsub0(t3, t3, t4);
  991|  5.48k|    fadd0(t4, y10, z11);
  992|  5.48k|    fadd0(t5, y2, z21);
  993|  5.48k|    fmul0(t4, t4, t5);
  994|  5.48k|    fadd0(t5, t11, t2);
  995|  5.48k|    fsub0(t4, t4, t5);
  996|  5.48k|    uint64_t *x10 = x;
  997|  5.48k|    uint64_t *z1 = x + 18U;
  998|  5.48k|    uint64_t *x2 = y;
  999|  5.48k|    uint64_t *z2 = y + 18U;
 1000|  5.48k|    fadd0(x3, x10, z1);
 1001|  5.48k|    fadd0(y3, x2, z2);
 1002|  5.48k|    fmul0(x3, x3, y3);
 1003|  5.48k|    fadd0(y3, t01, t2);
 1004|  5.48k|    fsub0(y3, x3, y3);
 1005|  5.48k|    uint64_t b_coeff[9U] = { 0U };
 1006|  5.48k|    p521_make_b_coeff(b_coeff);
 1007|  5.48k|    fmul0(z3, b_coeff, t2);
 1008|  5.48k|    fsub0(x3, y3, z3);
 1009|  5.48k|    fadd0(z3, x3, x3);
 1010|  5.48k|    fadd0(x3, x3, z3);
 1011|  5.48k|    fsub0(z3, t11, x3);
 1012|  5.48k|    fadd0(x3, t11, x3);
 1013|  5.48k|    uint64_t b_coeff0[9U] = { 0U };
 1014|  5.48k|    p521_make_b_coeff(b_coeff0);
 1015|  5.48k|    fmul0(y3, b_coeff0, y3);
 1016|  5.48k|    fadd0(t11, t2, t2);
 1017|  5.48k|    fadd0(t2, t11, t2);
 1018|  5.48k|    fsub0(y3, y3, t2);
 1019|  5.48k|    fsub0(y3, y3, t01);
 1020|  5.48k|    fadd0(t11, y3, y3);
 1021|  5.48k|    fadd0(y3, t11, y3);
 1022|  5.48k|    fadd0(t11, t01, t01);
 1023|  5.48k|    fadd0(t01, t11, t01);
 1024|  5.48k|    fsub0(t01, t01, t2);
 1025|  5.48k|    fmul0(t11, t4, y3);
 1026|  5.48k|    fmul0(t2, t01, y3);
 1027|  5.48k|    fmul0(y3, x3, z3);
 1028|  5.48k|    fadd0(y3, y3, t2);
 1029|  5.48k|    fmul0(x3, t3, x3);
 1030|  5.48k|    fsub0(x3, x3, t11);
 1031|  5.48k|    fmul0(z3, t4, z3);
 1032|  5.48k|    fmul0(t11, t3, t01);
 1033|  5.48k|    fadd0(z3, z3, t11);
 1034|  5.48k|    memcpy(xy, t1, 27U * sizeof(uint64_t));
 1035|  5.48k|}
Hacl_P521.c:bn_is_lt_prime_mask:
  635|    108|{
  636|    108|    uint64_t tmp[9U] = { 0U };
  637|    108|    p521_make_prime(tmp);
  638|    108|    uint64_t c = bn_sub(tmp, f, tmp);
  639|    108|    uint64_t m = FStar_UInt64_gte_mask(c, 0ULL) & ~FStar_UInt64_eq_mask(c, 0ULL);
  640|    108|    return m;
  641|    108|}
Hacl_P521.c:p521_make_prime:
  342|   977k|{
  343|   977k|    n[0U] = 0xffffffffffffffffULL;
  344|   977k|    n[1U] = 0xffffffffffffffffULL;
  345|   977k|    n[2U] = 0xffffffffffffffffULL;
  346|   977k|    n[3U] = 0xffffffffffffffffULL;
  347|   977k|    n[4U] = 0xffffffffffffffffULL;
  348|   977k|    n[5U] = 0xffffffffffffffffULL;
  349|   977k|    n[6U] = 0xffffffffffffffffULL;
  350|   977k|    n[7U] = 0xffffffffffffffffULL;
  351|   977k|    n[8U] = 0x1ffULL;
  352|   977k|}
Hacl_P521.c:to_mont:
  685|    194|{
  686|    194|    uint64_t r2modn[9U] = { 0U };
  687|    194|    p521_make_fmont_R2(r2modn);
  688|    194|    uint64_t tmp[18U] = { 0U };
  689|    194|    bn_mul(tmp, b, r2modn);
  690|    194|    fmont_reduction(a, tmp);
  691|    194|}
Hacl_P521.c:p521_make_fmont_R2:
  426|    194|{
  427|    194|    n[0U] = 0x0ULL;
  428|    194|    n[1U] = 0x400000000000ULL;
  429|    194|    n[2U] = 0x0ULL;
  430|    194|    n[3U] = 0x0ULL;
  431|    194|    n[4U] = 0x0ULL;
  432|    194|    n[5U] = 0x0ULL;
  433|    194|    n[6U] = 0x0ULL;
  434|    194|    n[7U] = 0x0ULL;
  435|    194|    n[8U] = 0x0ULL;
  436|    194|}
Hacl_P521.c:fmont_reduction:
  475|   375k|{
  476|   375k|    uint64_t n[9U] = { 0U };
  477|   375k|    p521_make_prime(n);
  478|   375k|    uint64_t c0 = 0ULL;
  479|   375k|    KRML_MAYBE_FOR9(
  ------------------
  |  |  360|   375k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|   375k|    do {                               \
  |  |  |  |  289|   375k|        uint32_t i = z;                \
  |  |  |  |  290|   375k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   375k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|   375k|        i0,
  481|   375k|        0U,
  482|   375k|        9U,
  483|   375k|        1U,
  484|   375k|        uint64_t qj = 1ULL * x[i0];
  485|   375k|        uint64_t *res_j0 = x + i0;
  486|   375k|        uint64_t c = 0ULL;
  487|   375k|        KRML_MAYBE_FOR2(i,
  488|   375k|                        0U,
  489|   375k|                        2U,
  490|   375k|                        1U,
  491|   375k|                        uint64_t a_i = n[4U * i];
  492|   375k|                        uint64_t *res_i0 = res_j0 + 4U * i;
  493|   375k|                        c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i0);
  494|   375k|                        uint64_t a_i0 = n[4U * i + 1U];
  495|   375k|                        uint64_t *res_i1 = res_j0 + 4U * i + 1U;
  496|   375k|                        c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i0, qj, c, res_i1);
  497|   375k|                        uint64_t a_i1 = n[4U * i + 2U];
  498|   375k|                        uint64_t *res_i2 = res_j0 + 4U * i + 2U;
  499|   375k|                        c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i1, qj, c, res_i2);
  500|   375k|                        uint64_t a_i2 = n[4U * i + 3U];
  501|   375k|                        uint64_t *res_i = res_j0 + 4U * i + 3U;
  502|   375k|                        c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i2, qj, c, res_i););
  503|   375k|        {
  504|   375k|            uint64_t a_i = n[8U];
  505|   375k|            uint64_t *res_i = res_j0 + 8U;
  506|   375k|            c = Hacl_Bignum_Base_mul_wide_add2_u64(a_i, qj, c, res_i);
  507|   375k|        } uint64_t r = c;
  508|   375k|        uint64_t c1 = r;
  509|   375k|        uint64_t *resb = x + 9U + i0;
  510|   375k|        uint64_t res_j = x[9U + i0];
  511|   375k|        c0 = Lib_IntTypes_Intrinsics_add_carry_u64(c0, c1, res_j, resb););
  512|   375k|    memcpy(res, x + 9U, 9U * sizeof(uint64_t));
  513|   375k|    uint64_t c00 = c0;
  514|   375k|    uint64_t tmp[9U] = { 0U };
  515|   375k|    uint64_t c = 0ULL;
  516|   375k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|   375k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|   375k|    do {                               \
  |  |  |  |  289|   375k|        uint32_t i = z;                \
  |  |  |  |  290|   375k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   375k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  517|   375k|                    0U,
  518|   375k|                    2U,
  519|   375k|                    1U,
  520|   375k|                    uint64_t t1 = res[4U * i];
  521|   375k|                    uint64_t t20 = n[4U * i];
  522|   375k|                    uint64_t *res_i0 = tmp + 4U * i;
  523|   375k|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t20, res_i0);
  524|   375k|                    uint64_t t10 = res[4U * i + 1U];
  525|   375k|                    uint64_t t21 = n[4U * i + 1U];
  526|   375k|                    uint64_t *res_i1 = tmp + 4U * i + 1U;
  527|   375k|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t10, t21, res_i1);
  528|   375k|                    uint64_t t11 = res[4U * i + 2U];
  529|   375k|                    uint64_t t22 = n[4U * i + 2U];
  530|   375k|                    uint64_t *res_i2 = tmp + 4U * i + 2U;
  531|   375k|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t11, t22, res_i2);
  532|   375k|                    uint64_t t12 = res[4U * i + 3U];
  533|   375k|                    uint64_t t2 = n[4U * i + 3U];
  534|   375k|                    uint64_t *res_i = tmp + 4U * i + 3U;
  535|   375k|                    c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t12, t2, res_i););
  536|   375k|    {
  537|   375k|        uint64_t t1 = res[8U];
  538|   375k|        uint64_t t2 = n[8U];
  539|   375k|        uint64_t *res_i = tmp + 8U;
  540|   375k|        c = Lib_IntTypes_Intrinsics_sub_borrow_u64(c, t1, t2, res_i);
  ------------------
  |  |   89|   375k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  541|   375k|    }
  542|   375k|    uint64_t c1 = c;
  543|   375k|    uint64_t c2 = c00 - c1;
  544|   375k|    KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|   375k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|   375k|    do {                               \
  |  |  |  |  289|   375k|        uint32_t i = z;                \
  |  |  |  |  290|   375k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   375k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  545|   375k|                    0U,
  546|   375k|                    9U,
  547|   375k|                    1U,
  548|   375k|                    uint64_t *os = res;
  549|   375k|                    uint64_t x1 = (c2 & res[i]) | (~c2 & tmp[i]);
  550|   375k|                    os[i] = x1;);
  551|   375k|}
Hacl_P521.c:fsqr0:
  669|  83.1k|{
  670|  83.1k|    uint64_t tmp[18U] = { 0U };
  671|  83.1k|    bn_sqr(tmp, b);
  672|  83.1k|    fmont_reduction(a, tmp);
  673|  83.1k|}
Hacl_P521.c:fmul0:
  661|   292k|{
  662|   292k|    uint64_t tmp[18U] = { 0U };
  663|   292k|    bn_mul(tmp, b, c);
  664|   292k|    fmont_reduction(a, tmp);
  665|   292k|}
Hacl_P521.c:p521_make_a_coeff:
  370|     51|{
  371|     51|    a[0U] = 0xfe7fffffffffffffULL;
  372|     51|    a[1U] = 0xffffffffffffffffULL;
  373|     51|    a[2U] = 0xffffffffffffffffULL;
  374|     51|    a[3U] = 0xffffffffffffffffULL;
  375|     51|    a[4U] = 0xffffffffffffffffULL;
  376|     51|    a[5U] = 0xffffffffffffffffULL;
  377|     51|    a[6U] = 0xffffffffffffffffULL;
  378|     51|    a[7U] = 0xffffffffffffffffULL;
  379|     51|    a[8U] = 0x01ffULL;
  380|     51|}
Hacl_P521.c:fadd0:
  645|   425k|{
  646|   425k|    uint64_t n[9U] = { 0U };
  647|   425k|    p521_make_prime(n);
  648|   425k|    bn_add_mod(a, n, b, c);
  649|   425k|}
Hacl_P521.c:p521_make_b_coeff:
  384|  53.1k|{
  385|  53.1k|    b[0U] = 0x8014654fae586387ULL;
  386|  53.1k|    b[1U] = 0x78f7a28fea35a81fULL;
  387|  53.1k|    b[2U] = 0x839ab9efc41e961aULL;
  388|  53.1k|    b[3U] = 0xbd8b29605e9dd8dfULL;
  389|  53.1k|    b[4U] = 0xf0ab0c9ca8f63f49ULL;
  390|  53.1k|    b[5U] = 0xf9dc5a44c8c77884ULL;
  391|  53.1k|    b[6U] = 0x77516d392dccd98aULL;
  392|  53.1k|    b[7U] = 0x0fc94d10d05b42a0ULL;
  393|  53.1k|    b[8U] = 0x4dULL;
  394|  53.1k|}
Hacl_P521.c:bn_is_eq_mask:
   32|    131|{
   33|    131|    uint64_t mask = 0xFFFFFFFFFFFFFFFFULL;
   34|    131|    KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|    131|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|    131|    do {                               \
  |  |  |  |  289|    131|        uint32_t i = z;                \
  |  |  |  |  290|    131|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    131|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   35|    131|                    0U,
   36|    131|                    9U,
   37|    131|                    1U,
   38|    131|                    uint64_t uu____0 = FStar_UInt64_eq_mask(x[i], y[i]);
   39|    131|                    mask = uu____0 & mask;);
   40|    131|    uint64_t mask1 = mask;
   41|    131|    return mask1;
   42|    131|}
Hacl_P521.c:p521_make_fone:
  447|    158|{
  448|    158|    n[0U] = 0x80000000000000ULL;
  449|    158|    n[1U] = 0x0ULL;
  450|    158|    n[2U] = 0x0ULL;
  451|    158|    n[3U] = 0x0ULL;
  452|    158|    n[4U] = 0x0ULL;
  453|    158|    n[5U] = 0x0ULL;
  454|    158|    n[6U] = 0x0ULL;
  455|    158|    n[7U] = 0x0ULL;
  456|    158|    n[8U] = 0x0ULL;
  457|    158|}
Hacl_P521.c:p521_make_order:
  356|  2.05k|{
  357|  2.05k|    n[0U] = 0xbb6fb71e91386409ULL;
  358|  2.05k|    n[1U] = 0x3bb5c9b8899c47aeULL;
  359|  2.05k|    n[2U] = 0x7fcc0148f709a5d0ULL;
  360|  2.05k|    n[3U] = 0x51868783bf2f966bULL;
  361|  2.05k|    n[4U] = 0xfffffffffffffffaULL;
  362|  2.05k|    n[5U] = 0xffffffffffffffffULL;
  363|  2.05k|    n[6U] = 0xffffffffffffffffULL;
  364|  2.05k|    n[7U] = 0xffffffffffffffffULL;
  365|  2.05k|    n[8U] = 0x1ffULL;
  366|  2.05k|}
Hacl_P521.c:bn_sub:
  130|    189|{
  131|    189|    uint64_t c1 = 0ULL;
  132|    189|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|    189|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|    189|    do {                               \
  |  |  |  |  289|    189|        uint32_t i = z;                \
  |  |  |  |  290|    189|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|    189|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  133|    189|                    0U,
  134|    189|                    2U,
  135|    189|                    1U,
  136|    189|                    uint64_t t1 = b[4U * i];
  137|    189|                    uint64_t t20 = c[4U * i];
  138|    189|                    uint64_t *res_i0 = a + 4U * i;
  139|    189|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t1, t20, res_i0);
  140|    189|                    uint64_t t10 = b[4U * i + 1U];
  141|    189|                    uint64_t t21 = c[4U * i + 1U];
  142|    189|                    uint64_t *res_i1 = a + 4U * i + 1U;
  143|    189|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t10, t21, res_i1);
  144|    189|                    uint64_t t11 = b[4U * i + 2U];
  145|    189|                    uint64_t t22 = c[4U * i + 2U];
  146|    189|                    uint64_t *res_i2 = a + 4U * i + 2U;
  147|    189|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t11, t22, res_i2);
  148|    189|                    uint64_t t12 = b[4U * i + 3U];
  149|    189|                    uint64_t t2 = c[4U * i + 3U];
  150|    189|                    uint64_t *res_i = a + 4U * i + 3U;
  151|    189|                    c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t12, t2, res_i););
  152|    189|    {
  153|    189|        uint64_t t1 = b[8U];
  154|    189|        uint64_t t2 = c[8U];
  155|    189|        uint64_t *res_i = a + 8U;
  156|    189|        c1 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c1, t1, t2, res_i);
  ------------------
  |  |   89|    189|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  157|    189|    }
  158|    189|    uint64_t c10 = c1;
  159|    189|    return c10;
  160|    189|}
Hacl_P521.c:from_mont:
  677|     71|{
  678|     71|    uint64_t tmp[18U] = { 0U };
  679|     71|    memcpy(tmp, b, 9U * sizeof(uint64_t));
  680|     71|    fmont_reduction(a, tmp);
  681|     71|}
Hacl_P521.c:fsub0:
  653|   175k|{
  654|   175k|    uint64_t n[9U] = { 0U };
  655|   175k|    p521_make_prime(n);
  656|   175k|    bn_sub_mod(a, n, b, c);
  657|   175k|}
Hacl_P521.c:bn_sub_mod:
  164|   175k|{
  165|   175k|    uint64_t c10 = 0ULL;
  166|   175k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|   175k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|   175k|    do {                               \
  |  |  |  |  289|   175k|        uint32_t i = z;                \
  |  |  |  |  290|   175k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   175k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  167|   175k|                    0U,
  168|   175k|                    2U,
  169|   175k|                    1U,
  170|   175k|                    uint64_t t1 = c[4U * i];
  171|   175k|                    uint64_t t20 = d[4U * i];
  172|   175k|                    uint64_t *res_i0 = a + 4U * i;
  173|   175k|                    c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t1, t20, res_i0);
  174|   175k|                    uint64_t t10 = c[4U * i + 1U];
  175|   175k|                    uint64_t t21 = d[4U * i + 1U];
  176|   175k|                    uint64_t *res_i1 = a + 4U * i + 1U;
  177|   175k|                    c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t10, t21, res_i1);
  178|   175k|                    uint64_t t11 = c[4U * i + 2U];
  179|   175k|                    uint64_t t22 = d[4U * i + 2U];
  180|   175k|                    uint64_t *res_i2 = a + 4U * i + 2U;
  181|   175k|                    c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t11, t22, res_i2);
  182|   175k|                    uint64_t t12 = c[4U * i + 3U];
  183|   175k|                    uint64_t t2 = d[4U * i + 3U];
  184|   175k|                    uint64_t *res_i = a + 4U * i + 3U;
  185|   175k|                    c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t12, t2, res_i););
  186|   175k|    {
  187|   175k|        uint64_t t1 = c[8U];
  188|   175k|        uint64_t t2 = d[8U];
  189|   175k|        uint64_t *res_i = a + 8U;
  190|   175k|        c10 = Lib_IntTypes_Intrinsics_sub_borrow_u64(c10, t1, t2, res_i);
  ------------------
  |  |   89|   175k|    (_subborrow_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  191|   175k|    }
  192|   175k|    uint64_t c0 = c10;
  193|   175k|    uint64_t tmp[9U] = { 0U };
  194|   175k|    uint64_t c1 = 0ULL;
  195|   175k|    KRML_MAYBE_FOR2(i,
  ------------------
  |  |  318|   175k|#define KRML_MAYBE_FOR2(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 2, k, x)
  |  |  ------------------
  |  |  |  |  288|   175k|    do {                               \
  |  |  |  |  289|   175k|        uint32_t i = z;                \
  |  |  |  |  290|   175k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   175k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|   175k|                    0U,
  197|   175k|                    2U,
  198|   175k|                    1U,
  199|   175k|                    uint64_t t1 = a[4U * i];
  200|   175k|                    uint64_t t20 = b[4U * i];
  201|   175k|                    uint64_t *res_i0 = tmp + 4U * i;
  202|   175k|                    c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t1, t20, res_i0);
  203|   175k|                    uint64_t t10 = a[4U * i + 1U];
  204|   175k|                    uint64_t t21 = b[4U * i + 1U];
  205|   175k|                    uint64_t *res_i1 = tmp + 4U * i + 1U;
  206|   175k|                    c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t10, t21, res_i1);
  207|   175k|                    uint64_t t11 = a[4U * i + 2U];
  208|   175k|                    uint64_t t22 = b[4U * i + 2U];
  209|   175k|                    uint64_t *res_i2 = tmp + 4U * i + 2U;
  210|   175k|                    c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t11, t22, res_i2);
  211|   175k|                    uint64_t t12 = a[4U * i + 3U];
  212|   175k|                    uint64_t t2 = b[4U * i + 3U];
  213|   175k|                    uint64_t *res_i = tmp + 4U * i + 3U;
  214|   175k|                    c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t12, t2, res_i););
  215|   175k|    {
  216|   175k|        uint64_t t1 = a[8U];
  217|   175k|        uint64_t t2 = b[8U];
  218|   175k|        uint64_t *res_i = tmp + 8U;
  219|   175k|        c1 = Lib_IntTypes_Intrinsics_add_carry_u64(c1, t1, t2, res_i);
  ------------------
  |  |   66|   175k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  220|   175k|    }
  221|   175k|    uint64_t c11 = c1;
  222|   175k|    KRML_MAYBE_UNUSED_VAR(c11);
  ------------------
  |  |   60|   175k|#define KRML_MAYBE_UNUSED_VAR(x) KRML_HOST_IGNORE(x)
  |  |  ------------------
  |  |  |  |   56|   175k|#define KRML_HOST_IGNORE(x) (void)(x)
  |  |  ------------------
  ------------------
  223|   175k|    uint64_t c2 = 0ULL - c0;
  224|   175k|    KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|   175k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|   175k|    do {                               \
  |  |  |  |  289|   175k|        uint32_t i = z;                \
  |  |  |  |  290|   175k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   175k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|   175k|                    0U,
  226|   175k|                    9U,
  227|   175k|                    1U,
  228|   175k|                    uint64_t *os = a;
  229|   175k|                    uint64_t x = (c2 & tmp[i]) | (~c2 & a[i]);
  230|   175k|                    os[i] = x;);
  231|   175k|}
Hacl_P521.c:bn_to_bytes_be:
  319|     68|{
  320|     68|    uint8_t tmp[72U] = { 0U };
  321|     68|    KRML_MAYBE_FOR9(i, 0U, 9U, 1U, store64_be(tmp + i * 8U, b[9U - i - 1U]););
  ------------------
  |  |  360|     68|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|     68|    do {                               \
  |  |  |  |  289|     68|        uint32_t i = z;                \
  |  |  |  |  290|     68|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     68|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  322|     68|    memcpy(a, tmp + 6U, 66U * sizeof(uint8_t));
  323|     68|}
Hacl_P521.c:load_qelem_conditional:
  827|     34|{
  828|     34|    bn_from_bytes_be(a, b);
  829|     34|    uint64_t tmp[9U] = { 0U };
  830|     34|    p521_make_order(tmp);
  831|     34|    uint64_t c = bn_sub(tmp, a, tmp);
  832|     34|    uint64_t is_lt_order = FStar_UInt64_gte_mask(c, 0ULL) & ~FStar_UInt64_eq_mask(c, 0ULL);
  833|     34|    uint64_t bn_zero[9U] = { 0U };
  834|     34|    uint64_t res = bn_is_eq_mask(a, bn_zero);
  835|     34|    uint64_t is_eq_zero = res;
  836|     34|    uint64_t is_b_valid = is_lt_order & ~is_eq_zero;
  837|     34|    uint64_t oneq[9U] = { 0U };
  838|     34|    memset(oneq, 0U, 9U * sizeof(uint64_t));
  839|     34|    oneq[0U] = 1ULL;
  840|     34|    KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|     34|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|     34|    do {                               \
  |  |  |  |  289|     34|        uint32_t i = z;                \
  |  |  |  |  290|     34|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     34|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  841|     34|                    0U,
  842|     34|                    9U,
  843|     34|                    1U,
  844|     34|                    uint64_t *os = a;
  845|     34|                    uint64_t uu____0 = oneq[i];
  846|     34|                    uint64_t x = uu____0 ^ (is_b_valid & (a[i] ^ uu____0));
  847|     34|                    os[i] = x;);
  848|     34|    return is_b_valid;
  849|     34|}
Hacl_P521.c:point_mul_g:
 1163|     35|{
 1164|     35|    uint64_t g[27U] = { 0U };
 1165|     35|    uint64_t *x = g;
 1166|     35|    uint64_t *y = g + 9U;
 1167|     35|    uint64_t *z = g + 18U;
 1168|     35|    p521_make_g_x(x);
 1169|     35|    p521_make_g_y(y);
 1170|     35|    p521_make_fone(z);
 1171|     35|    point_mul(res, scalar, g);
 1172|     35|}
Hacl_P521.c:p521_make_g_x:
  398|     35|{
  399|     35|    n[0U] = 0xb331a16381adc101ULL;
  400|     35|    n[1U] = 0x4dfcbf3f18e172deULL;
  401|     35|    n[2U] = 0x6f19a459e0c2b521ULL;
  402|     35|    n[3U] = 0x947f0ee093d17fd4ULL;
  403|     35|    n[4U] = 0xdd50a5af3bf7f3acULL;
  404|     35|    n[5U] = 0x90fc1457b035a69eULL;
  405|     35|    n[6U] = 0x214e32409c829fdaULL;
  406|     35|    n[7U] = 0xe6cf1f65b311cadaULL;
  407|     35|    n[8U] = 0x74ULL;
  408|     35|}
Hacl_P521.c:p521_make_g_y:
  412|     35|{
  413|     35|    n[0U] = 0x28460e4a5a9e268eULL;
  414|     35|    n[1U] = 0x20445f4a3b4fe8b3ULL;
  415|     35|    n[2U] = 0xb09a9e3843513961ULL;
  416|     35|    n[3U] = 0x2062a85c809fd683ULL;
  417|     35|    n[4U] = 0x164bf7394caf7a13ULL;
  418|     35|    n[5U] = 0x340bd7de8b939f33ULL;
  419|     35|    n[6U] = 0xeccc7aa224abcda2ULL;
  420|     35|    n[7U] = 0x022e452fda163e8dULL;
  421|     35|    n[8U] = 0x1e0ULL;
  422|     35|}
Hacl_P521.c:p521_finv:
  695|     37|{
  696|     37|    uint64_t b[9U] = { 0U };
  697|     37|    b[0U] = 0xfffffffffffffffdULL;
  698|     37|    b[1U] = 0xffffffffffffffffULL;
  699|     37|    b[2U] = 0xffffffffffffffffULL;
  700|     37|    b[3U] = 0xffffffffffffffffULL;
  701|     37|    b[4U] = 0xffffffffffffffffULL;
  702|     37|    b[5U] = 0xffffffffffffffffULL;
  703|     37|    b[6U] = 0xffffffffffffffffULL;
  704|     37|    b[7U] = 0xffffffffffffffffULL;
  705|     37|    b[8U] = 0x1ffULL;
  706|     37|    uint64_t tmp[9U] = { 0U };
  707|     37|    memcpy(tmp, a, 9U * sizeof(uint64_t));
  708|     37|    uint64_t table[288U] = { 0U };
  709|     37|    uint64_t tmp1[9U] = { 0U };
  710|     37|    uint64_t *t0 = table;
  711|     37|    uint64_t *t1 = table + 9U;
  712|     37|    p521_make_fone(t0);
  713|     37|    memcpy(t1, tmp, 9U * sizeof(uint64_t));
  714|     37|    KRML_MAYBE_FOR15(i,
  ------------------
  |  |  396|     37|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|     37|    do {                               \
  |  |  |  |  289|     37|        uint32_t i = z;                \
  |  |  |  |  290|     37|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     37|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  715|     37|                     0U,
  716|     37|                     15U,
  717|     37|                     1U,
  718|     37|                     uint64_t *t11 = table + (i + 1U) * 9U;
  719|     37|                     fsqr0(tmp1, t11);
  720|     37|                     memcpy(table + (2U * i + 2U) * 9U, tmp1, 9U * sizeof(uint64_t));
  721|     37|                     uint64_t *t2 = table + (2U * i + 2U) * 9U;
  722|     37|                     fmul0(tmp1, tmp, t2);
  723|     37|                     memcpy(table + (2U * i + 3U) * 9U, tmp1, 9U * sizeof(uint64_t)););
  724|     37|    uint32_t i0 = 520U;
  725|     37|    uint64_t bits_c = Hacl_Bignum_Lib_bn_get_bits_u64(9U, b, i0, 5U);
  726|     37|    memcpy(res, (uint64_t *)table, 9U * sizeof(uint64_t));
  727|  1.18k|    for (uint32_t i1 = 0U; i1 < 31U; i1++) {
  ------------------
  |  Branch (727:28): [True: 1.14k, False: 37]
  ------------------
  728|  1.14k|        uint64_t c = FStar_UInt64_eq_mask(bits_c, (uint64_t)(i1 + 1U));
  729|  1.14k|        const uint64_t *res_j = table + (i1 + 1U) * 9U;
  730|  1.14k|        KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|  1.14k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.14k|    do {                               \
  |  |  |  |  289|  1.14k|        uint32_t i = z;                \
  |  |  |  |  290|  1.14k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.14k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  731|  1.14k|                        0U,
  732|  1.14k|                        9U,
  733|  1.14k|                        1U,
  734|  1.14k|                        uint64_t *os = res;
  735|  1.14k|                        uint64_t x = (c & res_j[i]) | (~c & res[i]);
  736|  1.14k|                        os[i] = x;);
  737|  1.14k|    }
  738|     37|    uint64_t tmp10[9U] = { 0U };
  739|  3.88k|    for (uint32_t i1 = 0U; i1 < 104U; i1++) {
  ------------------
  |  Branch (739:28): [True: 3.84k, False: 37]
  ------------------
  740|  3.84k|        KRML_MAYBE_FOR5(i, 0U, 5U, 1U, fsqr0(res, res););
  ------------------
  |  |  336|  3.84k|#define KRML_MAYBE_FOR5(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 5, k, x)
  |  |  ------------------
  |  |  |  |  288|  3.84k|    do {                               \
  |  |  |  |  289|  3.84k|        uint32_t i = z;                \
  |  |  |  |  290|  3.84k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  3.84k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  741|  3.84k|        uint32_t k = 520U - 5U * i1 - 5U;
  742|  3.84k|        uint64_t bits_l = Hacl_Bignum_Lib_bn_get_bits_u64(9U, b, k, 5U);
  743|  3.84k|        memcpy(tmp10, (uint64_t *)table, 9U * sizeof(uint64_t));
  744|   123k|        for (uint32_t i2 = 0U; i2 < 31U; i2++) {
  ------------------
  |  Branch (744:32): [True: 119k, False: 3.84k]
  ------------------
  745|   119k|            uint64_t c = FStar_UInt64_eq_mask(bits_l, (uint64_t)(i2 + 1U));
  746|   119k|            const uint64_t *res_j = table + (i2 + 1U) * 9U;
  747|   119k|            KRML_MAYBE_FOR9(i,
  ------------------
  |  |  360|   119k|#define KRML_MAYBE_FOR9(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 9, k, x)
  |  |  ------------------
  |  |  |  |  288|   119k|    do {                               \
  |  |  |  |  289|   119k|        uint32_t i = z;                \
  |  |  |  |  290|   119k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|   119k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|   119k|                            0U,
  749|   119k|                            9U,
  750|   119k|                            1U,
  751|   119k|                            uint64_t *os = tmp10;
  752|   119k|                            uint64_t x = (c & res_j[i]) | (~c & tmp10[i]);
  753|   119k|                            os[i] = x;);
  754|   119k|        }
  755|  3.84k|        fmul0(res, res, tmp10);
  756|  3.84k|    }
  757|     37|}
Hacl_P521.c:point_mul:
 1107|     40|{
 1108|     40|    uint64_t table[432U] = { 0U };
 1109|     40|    uint64_t tmp[27U] = { 0U };
 1110|     40|    uint64_t *t0 = table;
 1111|     40|    uint64_t *t1 = table + 27U;
 1112|     40|    point_zero(t0);
 1113|     40|    memcpy(t1, p, 27U * sizeof(uint64_t));
 1114|     40|    KRML_MAYBE_FOR7(i,
  ------------------
  |  |  348|     40|#define KRML_MAYBE_FOR7(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 7, k, x)
  |  |  ------------------
  |  |  |  |  288|     40|    do {                               \
  |  |  |  |  289|     40|        uint32_t i = z;                \
  |  |  |  |  290|     40|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     40|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1115|     40|                    0U,
 1116|     40|                    7U,
 1117|     40|                    1U,
 1118|     40|                    uint64_t *t11 = table + (i + 1U) * 27U;
 1119|     40|                    point_double(t11, tmp);
 1120|     40|                    memcpy(table + (2U * i + 2U) * 27U, tmp, 27U * sizeof(uint64_t));
 1121|     40|                    uint64_t *t2 = table + (2U * i + 2U) * 27U;
 1122|     40|                    point_add(p, t2, tmp);
 1123|     40|                    memcpy(table + (2U * i + 3U) * 27U, tmp, 27U * sizeof(uint64_t)););
 1124|     40|    uint32_t i0 = 520U;
 1125|     40|    uint64_t bits_c = Hacl_Bignum_Lib_bn_get_bits_u64(9U, scalar, i0, 4U);
 1126|     40|    memcpy(res, (uint64_t *)table, 27U * sizeof(uint64_t));
 1127|     40|    KRML_MAYBE_FOR15(
  ------------------
  |  |  396|     40|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|     40|    do {                               \
  |  |  |  |  289|     40|        uint32_t i = z;                \
  |  |  |  |  290|     40|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|     40|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1128|     40|        i1,
 1129|     40|        0U,
 1130|     40|        15U,
 1131|     40|        1U,
 1132|     40|        uint64_t c = FStar_UInt64_eq_mask(bits_c, (uint64_t)(i1 + 1U));
 1133|     40|        const uint64_t *res_j = table + (i1 + 1U) * 27U;
 1134|     40|        for (uint32_t i = 0U; i < 27U; i++) {
 1135|     40|            uint64_t *os = res;
 1136|     40|            uint64_t x = (c & res_j[i]) | (~c & res[i]);
 1137|     40|            os[i] = x;
 1138|     40|        });
 1139|     40|    uint64_t tmp0[27U] = { 0U };
 1140|  5.24k|    for (uint32_t i1 = 0U; i1 < 130U; i1++) {
  ------------------
  |  Branch (1140:28): [True: 5.20k, False: 40]
  ------------------
 1141|  5.20k|        KRML_MAYBE_FOR4(i, 0U, 4U, 1U, point_double(res, res););
  ------------------
  |  |  330|  5.20k|#define KRML_MAYBE_FOR4(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 4, k, x)
  |  |  ------------------
  |  |  |  |  288|  5.20k|    do {                               \
  |  |  |  |  289|  5.20k|        uint32_t i = z;                \
  |  |  |  |  290|  5.20k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  5.20k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1142|  5.20k|        uint32_t k = 520U - 4U * i1 - 4U;
 1143|  5.20k|        uint64_t bits_l = Hacl_Bignum_Lib_bn_get_bits_u64(9U, scalar, k, 4U);
 1144|  5.20k|        memcpy(tmp0, (uint64_t *)table, 27U * sizeof(uint64_t));
 1145|  5.20k|        KRML_MAYBE_FOR15(
  ------------------
  |  |  396|  5.20k|#define KRML_MAYBE_FOR15(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 15, k, x)
  |  |  ------------------
  |  |  |  |  288|  5.20k|    do {                               \
  |  |  |  |  289|  5.20k|        uint32_t i = z;                \
  |  |  |  |  290|  5.20k|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  5.20k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1146|  5.20k|            i2,
 1147|  5.20k|            0U,
 1148|  5.20k|            15U,
 1149|  5.20k|            1U,
 1150|  5.20k|            uint64_t c = FStar_UInt64_eq_mask(bits_l, (uint64_t)(i2 + 1U));
 1151|  5.20k|            const uint64_t *res_j = table + (i2 + 1U) * 27U;
 1152|  5.20k|            for (uint32_t i = 0U; i < 27U; i++) {
 1153|  5.20k|                uint64_t *os = tmp0;
 1154|  5.20k|                uint64_t x = (c & res_j[i]) | (~c & tmp0[i]);
 1155|  5.20k|                os[i] = x;
 1156|  5.20k|            });
 1157|  5.20k|        point_add(res, tmp0, res);
 1158|  5.20k|    }
 1159|     40|}
Hacl_P521.c:point_zero:
 1096|     40|{
 1097|     40|    uint64_t *x = one;
 1098|     40|    uint64_t *y = one + 9U;
 1099|     40|    uint64_t *z = one + 18U;
 1100|     40|    p521_make_fzero(x);
 1101|     40|    p521_make_fone(y);
 1102|     40|    p521_make_fzero(z);
 1103|     40|}
Hacl_P521.c:p521_make_fzero:
  440|     80|{
  441|     80|    memset(n, 0U, 9U * sizeof(uint64_t));
  442|     80|    n[0U] = 0ULL;
  443|     80|}
Hacl_P521.c:point_double:
 1039|  21.0k|{
 1040|  21.0k|    uint64_t tmp[45U] = { 0U };
 1041|  21.0k|    uint64_t *x1 = x;
 1042|  21.0k|    uint64_t *z = x + 18U;
 1043|  21.0k|    uint64_t *x3 = xx;
 1044|  21.0k|    uint64_t *y3 = xx + 9U;
 1045|  21.0k|    uint64_t *z3 = xx + 18U;
 1046|  21.0k|    uint64_t *t0 = tmp;
 1047|  21.0k|    uint64_t *t1 = tmp + 9U;
 1048|  21.0k|    uint64_t *t2 = tmp + 18U;
 1049|  21.0k|    uint64_t *t3 = tmp + 27U;
 1050|  21.0k|    uint64_t *t4 = tmp + 36U;
 1051|  21.0k|    uint64_t *x2 = x;
 1052|  21.0k|    uint64_t *y = x + 9U;
 1053|  21.0k|    uint64_t *z1 = x + 18U;
 1054|  21.0k|    fsqr0(t0, x2);
 1055|  21.0k|    fsqr0(t1, y);
 1056|  21.0k|    fsqr0(t2, z1);
 1057|  21.0k|    fmul0(t3, x2, y);
 1058|  21.0k|    fadd0(t3, t3, t3);
 1059|  21.0k|    fmul0(t4, y, z1);
 1060|  21.0k|    fmul0(z3, x1, z);
 1061|  21.0k|    fadd0(z3, z3, z3);
 1062|  21.0k|    uint64_t b_coeff[9U] = { 0U };
 1063|  21.0k|    p521_make_b_coeff(b_coeff);
 1064|  21.0k|    fmul0(y3, b_coeff, t2);
 1065|  21.0k|    fsub0(y3, y3, z3);
 1066|  21.0k|    fadd0(x3, y3, y3);
 1067|  21.0k|    fadd0(y3, x3, y3);
 1068|  21.0k|    fsub0(x3, t1, y3);
 1069|  21.0k|    fadd0(y3, t1, y3);
 1070|  21.0k|    fmul0(y3, x3, y3);
 1071|  21.0k|    fmul0(x3, x3, t3);
 1072|  21.0k|    fadd0(t3, t2, t2);
 1073|  21.0k|    fadd0(t2, t2, t3);
 1074|  21.0k|    uint64_t b_coeff0[9U] = { 0U };
 1075|  21.0k|    p521_make_b_coeff(b_coeff0);
 1076|  21.0k|    fmul0(z3, b_coeff0, z3);
 1077|  21.0k|    fsub0(z3, z3, t2);
 1078|  21.0k|    fsub0(z3, z3, t0);
 1079|  21.0k|    fadd0(t3, z3, z3);
 1080|  21.0k|    fadd0(z3, z3, t3);
 1081|  21.0k|    fadd0(t3, t0, t0);
 1082|  21.0k|    fadd0(t0, t3, t0);
 1083|  21.0k|    fsub0(t0, t0, t2);
 1084|  21.0k|    fmul0(t0, t0, z3);
 1085|  21.0k|    fadd0(y3, y3, t0);
 1086|  21.0k|    fadd0(t0, t4, t4);
 1087|  21.0k|    fmul0(z3, t0, z3);
 1088|  21.0k|    fsub0(x3, x3, z3);
 1089|  21.0k|    fmul0(z3, t0, t1);
 1090|  21.0k|    fadd0(z3, z3, z3);
 1091|  21.0k|    fadd0(z3, z3, z3);
 1092|  21.0k|}

Hacl_Curve25519_51.c:Hacl_Impl_Curve25519_Field51_fsqr:
  375|  1.96M|{
  376|  1.96M|    KRML_HOST_IGNORE(uu___);
  ------------------
  |  |   56|  1.96M|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
  377|  1.96M|    uint64_t f0 = f[0U];
  378|  1.96M|    uint64_t f1 = f[1U];
  379|  1.96M|    uint64_t f2 = f[2U];
  380|  1.96M|    uint64_t f3 = f[3U];
  381|  1.96M|    uint64_t f4 = f[4U];
  382|  1.96M|    uint64_t d0 = (uint64_t)2U * f0;
  383|  1.96M|    uint64_t d1 = (uint64_t)2U * f1;
  384|  1.96M|    uint64_t d2 = (uint64_t)38U * f2;
  385|  1.96M|    uint64_t d3 = (uint64_t)19U * f3;
  386|  1.96M|    uint64_t d419 = (uint64_t)19U * f4;
  387|  1.96M|    uint64_t d4 = (uint64_t)2U * d419;
  388|  1.96M|    FStar_UInt128_uint128
  389|  1.96M|        s0 =
  390|  1.96M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(f0, f0),
  391|  1.96M|                                                FStar_UInt128_mul_wide(d4, f1)),
  392|  1.96M|                              FStar_UInt128_mul_wide(d2, f3));
  393|  1.96M|    FStar_UInt128_uint128
  394|  1.96M|        s1 =
  395|  1.96M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d0, f1),
  396|  1.96M|                                                FStar_UInt128_mul_wide(d4, f2)),
  397|  1.96M|                              FStar_UInt128_mul_wide(d3, f3));
  398|  1.96M|    FStar_UInt128_uint128
  399|  1.96M|        s2 =
  400|  1.96M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d0, f2),
  401|  1.96M|                                                FStar_UInt128_mul_wide(f1, f1)),
  402|  1.96M|                              FStar_UInt128_mul_wide(d4, f3));
  403|  1.96M|    FStar_UInt128_uint128
  404|  1.96M|        s3 =
  405|  1.96M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d0, f3),
  406|  1.96M|                                                FStar_UInt128_mul_wide(d1, f2)),
  407|  1.96M|                              FStar_UInt128_mul_wide(f4, d419));
  408|  1.96M|    FStar_UInt128_uint128
  409|  1.96M|        s4 =
  410|  1.96M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d0, f4),
  411|  1.96M|                                                FStar_UInt128_mul_wide(d1, f3)),
  412|  1.96M|                              FStar_UInt128_mul_wide(f2, f2));
  413|  1.96M|    FStar_UInt128_uint128 o00 = s0;
  414|  1.96M|    FStar_UInt128_uint128 o10 = s1;
  415|  1.96M|    FStar_UInt128_uint128 o20 = s2;
  416|  1.96M|    FStar_UInt128_uint128 o30 = s3;
  417|  1.96M|    FStar_UInt128_uint128 o40 = s4;
  418|  1.96M|    FStar_UInt128_uint128
  419|  1.96M|        l_ = FStar_UInt128_add(o00, FStar_UInt128_uint64_to_uint128((uint64_t)0U));
  420|  1.96M|    uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU;
  421|  1.96M|    uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U));
  422|  1.96M|    FStar_UInt128_uint128 l_0 = FStar_UInt128_add(o10, FStar_UInt128_uint64_to_uint128(c0));
  423|  1.96M|    uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU;
  424|  1.96M|    uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U));
  425|  1.96M|    FStar_UInt128_uint128 l_1 = FStar_UInt128_add(o20, FStar_UInt128_uint64_to_uint128(c1));
  426|  1.96M|    uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU;
  427|  1.96M|    uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U));
  428|  1.96M|    FStar_UInt128_uint128 l_2 = FStar_UInt128_add(o30, FStar_UInt128_uint64_to_uint128(c2));
  429|  1.96M|    uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU;
  430|  1.96M|    uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U));
  431|  1.96M|    FStar_UInt128_uint128 l_3 = FStar_UInt128_add(o40, FStar_UInt128_uint64_to_uint128(c3));
  432|  1.96M|    uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU;
  433|  1.96M|    uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U));
  434|  1.96M|    uint64_t l_4 = tmp0 + c4 * (uint64_t)19U;
  435|  1.96M|    uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU;
  436|  1.96M|    uint64_t c5 = l_4 >> (uint32_t)51U;
  437|  1.96M|    uint64_t o0 = tmp0_;
  438|  1.96M|    uint64_t o1 = tmp1 + c5;
  439|  1.96M|    uint64_t o2 = tmp2;
  440|  1.96M|    uint64_t o3 = tmp3;
  441|  1.96M|    uint64_t o4 = tmp4;
  442|  1.96M|    out[0U] = o0;
  443|  1.96M|    out[1U] = o1;
  444|  1.96M|    out[2U] = o2;
  445|  1.96M|    out[3U] = o3;
  446|  1.96M|    out[4U] = o4;
  447|  1.96M|}
Hacl_Curve25519_51.c:Hacl_Impl_Curve25519_Field51_fmul:
   86|  2.04M|{
   87|  2.04M|    KRML_HOST_IGNORE(uu___);
  ------------------
  |  |   56|  2.04M|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
   88|  2.04M|    uint64_t f10 = f1[0U];
   89|  2.04M|    uint64_t f11 = f1[1U];
   90|  2.04M|    uint64_t f12 = f1[2U];
   91|  2.04M|    uint64_t f13 = f1[3U];
   92|  2.04M|    uint64_t f14 = f1[4U];
   93|  2.04M|    uint64_t f20 = f2[0U];
   94|  2.04M|    uint64_t f21 = f2[1U];
   95|  2.04M|    uint64_t f22 = f2[2U];
   96|  2.04M|    uint64_t f23 = f2[3U];
   97|  2.04M|    uint64_t f24 = f2[4U];
   98|  2.04M|    uint64_t tmp1 = f21 * (uint64_t)19U;
   99|  2.04M|    uint64_t tmp2 = f22 * (uint64_t)19U;
  100|  2.04M|    uint64_t tmp3 = f23 * (uint64_t)19U;
  101|  2.04M|    uint64_t tmp4 = f24 * (uint64_t)19U;
  102|  2.04M|    FStar_UInt128_uint128 o00 = FStar_UInt128_mul_wide(f10, f20);
  103|  2.04M|    FStar_UInt128_uint128 o10 = FStar_UInt128_mul_wide(f10, f21);
  104|  2.04M|    FStar_UInt128_uint128 o20 = FStar_UInt128_mul_wide(f10, f22);
  105|  2.04M|    FStar_UInt128_uint128 o30 = FStar_UInt128_mul_wide(f10, f23);
  106|  2.04M|    FStar_UInt128_uint128 o40 = FStar_UInt128_mul_wide(f10, f24);
  107|  2.04M|    FStar_UInt128_uint128 o01 = FStar_UInt128_add(o00, FStar_UInt128_mul_wide(f11, tmp4));
  108|  2.04M|    FStar_UInt128_uint128 o11 = FStar_UInt128_add(o10, FStar_UInt128_mul_wide(f11, f20));
  109|  2.04M|    FStar_UInt128_uint128 o21 = FStar_UInt128_add(o20, FStar_UInt128_mul_wide(f11, f21));
  110|  2.04M|    FStar_UInt128_uint128 o31 = FStar_UInt128_add(o30, FStar_UInt128_mul_wide(f11, f22));
  111|  2.04M|    FStar_UInt128_uint128 o41 = FStar_UInt128_add(o40, FStar_UInt128_mul_wide(f11, f23));
  112|  2.04M|    FStar_UInt128_uint128 o02 = FStar_UInt128_add(o01, FStar_UInt128_mul_wide(f12, tmp3));
  113|  2.04M|    FStar_UInt128_uint128 o12 = FStar_UInt128_add(o11, FStar_UInt128_mul_wide(f12, tmp4));
  114|  2.04M|    FStar_UInt128_uint128 o22 = FStar_UInt128_add(o21, FStar_UInt128_mul_wide(f12, f20));
  115|  2.04M|    FStar_UInt128_uint128 o32 = FStar_UInt128_add(o31, FStar_UInt128_mul_wide(f12, f21));
  116|  2.04M|    FStar_UInt128_uint128 o42 = FStar_UInt128_add(o41, FStar_UInt128_mul_wide(f12, f22));
  117|  2.04M|    FStar_UInt128_uint128 o03 = FStar_UInt128_add(o02, FStar_UInt128_mul_wide(f13, tmp2));
  118|  2.04M|    FStar_UInt128_uint128 o13 = FStar_UInt128_add(o12, FStar_UInt128_mul_wide(f13, tmp3));
  119|  2.04M|    FStar_UInt128_uint128 o23 = FStar_UInt128_add(o22, FStar_UInt128_mul_wide(f13, tmp4));
  120|  2.04M|    FStar_UInt128_uint128 o33 = FStar_UInt128_add(o32, FStar_UInt128_mul_wide(f13, f20));
  121|  2.04M|    FStar_UInt128_uint128 o43 = FStar_UInt128_add(o42, FStar_UInt128_mul_wide(f13, f21));
  122|  2.04M|    FStar_UInt128_uint128 o04 = FStar_UInt128_add(o03, FStar_UInt128_mul_wide(f14, tmp1));
  123|  2.04M|    FStar_UInt128_uint128 o14 = FStar_UInt128_add(o13, FStar_UInt128_mul_wide(f14, tmp2));
  124|  2.04M|    FStar_UInt128_uint128 o24 = FStar_UInt128_add(o23, FStar_UInt128_mul_wide(f14, tmp3));
  125|  2.04M|    FStar_UInt128_uint128 o34 = FStar_UInt128_add(o33, FStar_UInt128_mul_wide(f14, tmp4));
  126|  2.04M|    FStar_UInt128_uint128 o44 = FStar_UInt128_add(o43, FStar_UInt128_mul_wide(f14, f20));
  127|  2.04M|    FStar_UInt128_uint128 tmp_w0 = o04;
  128|  2.04M|    FStar_UInt128_uint128 tmp_w1 = o14;
  129|  2.04M|    FStar_UInt128_uint128 tmp_w2 = o24;
  130|  2.04M|    FStar_UInt128_uint128 tmp_w3 = o34;
  131|  2.04M|    FStar_UInt128_uint128 tmp_w4 = o44;
  132|  2.04M|    FStar_UInt128_uint128
  133|  2.04M|        l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128((uint64_t)0U));
  134|  2.04M|    uint64_t tmp01 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU;
  135|  2.04M|    uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U));
  136|  2.04M|    FStar_UInt128_uint128 l_0 = FStar_UInt128_add(tmp_w1, FStar_UInt128_uint64_to_uint128(c0));
  137|  2.04M|    uint64_t tmp11 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU;
  138|  2.04M|    uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U));
  139|  2.04M|    FStar_UInt128_uint128 l_1 = FStar_UInt128_add(tmp_w2, FStar_UInt128_uint64_to_uint128(c1));
  140|  2.04M|    uint64_t tmp21 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU;
  141|  2.04M|    uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U));
  142|  2.04M|    FStar_UInt128_uint128 l_2 = FStar_UInt128_add(tmp_w3, FStar_UInt128_uint64_to_uint128(c2));
  143|  2.04M|    uint64_t tmp31 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU;
  144|  2.04M|    uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U));
  145|  2.04M|    FStar_UInt128_uint128 l_3 = FStar_UInt128_add(tmp_w4, FStar_UInt128_uint64_to_uint128(c3));
  146|  2.04M|    uint64_t tmp41 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU;
  147|  2.04M|    uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U));
  148|  2.04M|    uint64_t l_4 = tmp01 + c4 * (uint64_t)19U;
  149|  2.04M|    uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU;
  150|  2.04M|    uint64_t c5 = l_4 >> (uint32_t)51U;
  151|  2.04M|    uint64_t o0 = tmp0_;
  152|  2.04M|    uint64_t o1 = tmp11 + c5;
  153|  2.04M|    uint64_t o2 = tmp21;
  154|  2.04M|    uint64_t o3 = tmp31;
  155|  2.04M|    uint64_t o4 = tmp41;
  156|  2.04M|    out[0U] = o0;
  157|  2.04M|    out[1U] = o1;
  158|  2.04M|    out[2U] = o2;
  159|  2.04M|    out[3U] = o3;
  160|  2.04M|    out[4U] = o4;
  161|  2.04M|}
Hacl_Curve25519_51.c:Hacl_Impl_Curve25519_Field51_cswap2:
  668|  1.95M|{
  669|  1.95M|    uint64_t mask = (uint64_t)0U - bit;
  670|  1.95M|    KRML_MAYBE_FOR10(i,
  ------------------
  |  |  366|  1.95M|#define KRML_MAYBE_FOR10(i, z, n, k, x) KRML_UNROLL_FOR(i, z, 10, k, x)
  |  |  ------------------
  |  |  |  |  288|  1.95M|    do {                               \
  |  |  |  |  289|  1.95M|        uint32_t i = z;                \
  |  |  |  |  290|  1.95M|        KRML_LOOP##n(i, k, x)          \
  |  |  |  |  291|  1.95M|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (291:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  671|  1.95M|                     (uint32_t)0U,
  672|  1.95M|                     (uint32_t)10U,
  673|  1.95M|                     (uint32_t)1U,
  674|  1.95M|                     uint64_t dummy = mask & (p1[i] ^ p2[i]);
  675|  1.95M|                     p1[i] = p1[i] ^ dummy;
  676|  1.95M|                     p2[i] = p2[i] ^ dummy;);
  677|  1.95M|}
Hacl_Curve25519_51.c:Hacl_Impl_Curve25519_Field51_fadd:
   42|  7.83M|{
   43|  7.83M|    uint64_t f10 = f1[0U];
   44|  7.83M|    uint64_t f20 = f2[0U];
   45|  7.83M|    uint64_t f11 = f1[1U];
   46|  7.83M|    uint64_t f21 = f2[1U];
   47|  7.83M|    uint64_t f12 = f1[2U];
   48|  7.83M|    uint64_t f22 = f2[2U];
   49|  7.83M|    uint64_t f13 = f1[3U];
   50|  7.83M|    uint64_t f23 = f2[3U];
   51|  7.83M|    uint64_t f14 = f1[4U];
   52|  7.83M|    uint64_t f24 = f2[4U];
   53|  7.83M|    out[0U] = f10 + f20;
   54|  7.83M|    out[1U] = f11 + f21;
   55|  7.83M|    out[2U] = f12 + f22;
   56|  7.83M|    out[3U] = f13 + f23;
   57|  7.83M|    out[4U] = f14 + f24;
   58|  7.83M|}
Hacl_Curve25519_51.c:Hacl_Impl_Curve25519_Field51_fsub:
   62|  7.83M|{
   63|  7.83M|    uint64_t f10 = f1[0U];
   64|  7.83M|    uint64_t f20 = f2[0U];
   65|  7.83M|    uint64_t f11 = f1[1U];
   66|  7.83M|    uint64_t f21 = f2[1U];
   67|  7.83M|    uint64_t f12 = f1[2U];
   68|  7.83M|    uint64_t f22 = f2[2U];
   69|  7.83M|    uint64_t f13 = f1[3U];
   70|  7.83M|    uint64_t f23 = f2[3U];
   71|  7.83M|    uint64_t f14 = f1[4U];
   72|  7.83M|    uint64_t f24 = f2[4U];
   73|  7.83M|    out[0U] = f10 + (uint64_t)0x3fffffffffff68U - f20;
   74|  7.83M|    out[1U] = f11 + (uint64_t)0x3ffffffffffff8U - f21;
   75|  7.83M|    out[2U] = f12 + (uint64_t)0x3ffffffffffff8U - f22;
   76|  7.83M|    out[3U] = f13 + (uint64_t)0x3ffffffffffff8U - f23;
   77|  7.83M|    out[4U] = f14 + (uint64_t)0x3ffffffffffff8U - f24;
   78|  7.83M|}
Hacl_Curve25519_51.c:Hacl_Impl_Curve25519_Field51_fmul2:
  169|  3.91M|{
  170|  3.91M|    KRML_HOST_IGNORE(uu___);
  ------------------
  |  |   56|  3.91M|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
  171|  3.91M|    uint64_t f10 = f1[0U];
  172|  3.91M|    uint64_t f11 = f1[1U];
  173|  3.91M|    uint64_t f12 = f1[2U];
  174|  3.91M|    uint64_t f13 = f1[3U];
  175|  3.91M|    uint64_t f14 = f1[4U];
  176|  3.91M|    uint64_t f20 = f2[0U];
  177|  3.91M|    uint64_t f21 = f2[1U];
  178|  3.91M|    uint64_t f22 = f2[2U];
  179|  3.91M|    uint64_t f23 = f2[3U];
  180|  3.91M|    uint64_t f24 = f2[4U];
  181|  3.91M|    uint64_t f30 = f1[5U];
  182|  3.91M|    uint64_t f31 = f1[6U];
  183|  3.91M|    uint64_t f32 = f1[7U];
  184|  3.91M|    uint64_t f33 = f1[8U];
  185|  3.91M|    uint64_t f34 = f1[9U];
  186|  3.91M|    uint64_t f40 = f2[5U];
  187|  3.91M|    uint64_t f41 = f2[6U];
  188|  3.91M|    uint64_t f42 = f2[7U];
  189|  3.91M|    uint64_t f43 = f2[8U];
  190|  3.91M|    uint64_t f44 = f2[9U];
  191|  3.91M|    uint64_t tmp11 = f21 * (uint64_t)19U;
  192|  3.91M|    uint64_t tmp12 = f22 * (uint64_t)19U;
  193|  3.91M|    uint64_t tmp13 = f23 * (uint64_t)19U;
  194|  3.91M|    uint64_t tmp14 = f24 * (uint64_t)19U;
  195|  3.91M|    uint64_t tmp21 = f41 * (uint64_t)19U;
  196|  3.91M|    uint64_t tmp22 = f42 * (uint64_t)19U;
  197|  3.91M|    uint64_t tmp23 = f43 * (uint64_t)19U;
  198|  3.91M|    uint64_t tmp24 = f44 * (uint64_t)19U;
  199|  3.91M|    FStar_UInt128_uint128 o00 = FStar_UInt128_mul_wide(f10, f20);
  200|  3.91M|    FStar_UInt128_uint128 o15 = FStar_UInt128_mul_wide(f10, f21);
  201|  3.91M|    FStar_UInt128_uint128 o25 = FStar_UInt128_mul_wide(f10, f22);
  202|  3.91M|    FStar_UInt128_uint128 o30 = FStar_UInt128_mul_wide(f10, f23);
  203|  3.91M|    FStar_UInt128_uint128 o40 = FStar_UInt128_mul_wide(f10, f24);
  204|  3.91M|    FStar_UInt128_uint128 o010 = FStar_UInt128_add(o00, FStar_UInt128_mul_wide(f11, tmp14));
  205|  3.91M|    FStar_UInt128_uint128 o110 = FStar_UInt128_add(o15, FStar_UInt128_mul_wide(f11, f20));
  206|  3.91M|    FStar_UInt128_uint128 o210 = FStar_UInt128_add(o25, FStar_UInt128_mul_wide(f11, f21));
  207|  3.91M|    FStar_UInt128_uint128 o310 = FStar_UInt128_add(o30, FStar_UInt128_mul_wide(f11, f22));
  208|  3.91M|    FStar_UInt128_uint128 o410 = FStar_UInt128_add(o40, FStar_UInt128_mul_wide(f11, f23));
  209|  3.91M|    FStar_UInt128_uint128 o020 = FStar_UInt128_add(o010, FStar_UInt128_mul_wide(f12, tmp13));
  210|  3.91M|    FStar_UInt128_uint128 o120 = FStar_UInt128_add(o110, FStar_UInt128_mul_wide(f12, tmp14));
  211|  3.91M|    FStar_UInt128_uint128 o220 = FStar_UInt128_add(o210, FStar_UInt128_mul_wide(f12, f20));
  212|  3.91M|    FStar_UInt128_uint128 o320 = FStar_UInt128_add(o310, FStar_UInt128_mul_wide(f12, f21));
  213|  3.91M|    FStar_UInt128_uint128 o420 = FStar_UInt128_add(o410, FStar_UInt128_mul_wide(f12, f22));
  214|  3.91M|    FStar_UInt128_uint128 o030 = FStar_UInt128_add(o020, FStar_UInt128_mul_wide(f13, tmp12));
  215|  3.91M|    FStar_UInt128_uint128 o130 = FStar_UInt128_add(o120, FStar_UInt128_mul_wide(f13, tmp13));
  216|  3.91M|    FStar_UInt128_uint128 o230 = FStar_UInt128_add(o220, FStar_UInt128_mul_wide(f13, tmp14));
  217|  3.91M|    FStar_UInt128_uint128 o330 = FStar_UInt128_add(o320, FStar_UInt128_mul_wide(f13, f20));
  218|  3.91M|    FStar_UInt128_uint128 o430 = FStar_UInt128_add(o420, FStar_UInt128_mul_wide(f13, f21));
  219|  3.91M|    FStar_UInt128_uint128 o040 = FStar_UInt128_add(o030, FStar_UInt128_mul_wide(f14, tmp11));
  220|  3.91M|    FStar_UInt128_uint128 o140 = FStar_UInt128_add(o130, FStar_UInt128_mul_wide(f14, tmp12));
  221|  3.91M|    FStar_UInt128_uint128 o240 = FStar_UInt128_add(o230, FStar_UInt128_mul_wide(f14, tmp13));
  222|  3.91M|    FStar_UInt128_uint128 o340 = FStar_UInt128_add(o330, FStar_UInt128_mul_wide(f14, tmp14));
  223|  3.91M|    FStar_UInt128_uint128 o440 = FStar_UInt128_add(o430, FStar_UInt128_mul_wide(f14, f20));
  224|  3.91M|    FStar_UInt128_uint128 tmp_w10 = o040;
  225|  3.91M|    FStar_UInt128_uint128 tmp_w11 = o140;
  226|  3.91M|    FStar_UInt128_uint128 tmp_w12 = o240;
  227|  3.91M|    FStar_UInt128_uint128 tmp_w13 = o340;
  228|  3.91M|    FStar_UInt128_uint128 tmp_w14 = o440;
  229|  3.91M|    FStar_UInt128_uint128 o0 = FStar_UInt128_mul_wide(f30, f40);
  230|  3.91M|    FStar_UInt128_uint128 o1 = FStar_UInt128_mul_wide(f30, f41);
  231|  3.91M|    FStar_UInt128_uint128 o2 = FStar_UInt128_mul_wide(f30, f42);
  232|  3.91M|    FStar_UInt128_uint128 o3 = FStar_UInt128_mul_wide(f30, f43);
  233|  3.91M|    FStar_UInt128_uint128 o4 = FStar_UInt128_mul_wide(f30, f44);
  234|  3.91M|    FStar_UInt128_uint128 o01 = FStar_UInt128_add(o0, FStar_UInt128_mul_wide(f31, tmp24));
  235|  3.91M|    FStar_UInt128_uint128 o111 = FStar_UInt128_add(o1, FStar_UInt128_mul_wide(f31, f40));
  236|  3.91M|    FStar_UInt128_uint128 o211 = FStar_UInt128_add(o2, FStar_UInt128_mul_wide(f31, f41));
  237|  3.91M|    FStar_UInt128_uint128 o31 = FStar_UInt128_add(o3, FStar_UInt128_mul_wide(f31, f42));
  238|  3.91M|    FStar_UInt128_uint128 o41 = FStar_UInt128_add(o4, FStar_UInt128_mul_wide(f31, f43));
  239|  3.91M|    FStar_UInt128_uint128 o02 = FStar_UInt128_add(o01, FStar_UInt128_mul_wide(f32, tmp23));
  240|  3.91M|    FStar_UInt128_uint128 o121 = FStar_UInt128_add(o111, FStar_UInt128_mul_wide(f32, tmp24));
  241|  3.91M|    FStar_UInt128_uint128 o221 = FStar_UInt128_add(o211, FStar_UInt128_mul_wide(f32, f40));
  242|  3.91M|    FStar_UInt128_uint128 o32 = FStar_UInt128_add(o31, FStar_UInt128_mul_wide(f32, f41));
  243|  3.91M|    FStar_UInt128_uint128 o42 = FStar_UInt128_add(o41, FStar_UInt128_mul_wide(f32, f42));
  244|  3.91M|    FStar_UInt128_uint128 o03 = FStar_UInt128_add(o02, FStar_UInt128_mul_wide(f33, tmp22));
  245|  3.91M|    FStar_UInt128_uint128 o131 = FStar_UInt128_add(o121, FStar_UInt128_mul_wide(f33, tmp23));
  246|  3.91M|    FStar_UInt128_uint128 o231 = FStar_UInt128_add(o221, FStar_UInt128_mul_wide(f33, tmp24));
  247|  3.91M|    FStar_UInt128_uint128 o33 = FStar_UInt128_add(o32, FStar_UInt128_mul_wide(f33, f40));
  248|  3.91M|    FStar_UInt128_uint128 o43 = FStar_UInt128_add(o42, FStar_UInt128_mul_wide(f33, f41));
  249|  3.91M|    FStar_UInt128_uint128 o04 = FStar_UInt128_add(o03, FStar_UInt128_mul_wide(f34, tmp21));
  250|  3.91M|    FStar_UInt128_uint128 o141 = FStar_UInt128_add(o131, FStar_UInt128_mul_wide(f34, tmp22));
  251|  3.91M|    FStar_UInt128_uint128 o241 = FStar_UInt128_add(o231, FStar_UInt128_mul_wide(f34, tmp23));
  252|  3.91M|    FStar_UInt128_uint128 o34 = FStar_UInt128_add(o33, FStar_UInt128_mul_wide(f34, tmp24));
  253|  3.91M|    FStar_UInt128_uint128 o44 = FStar_UInt128_add(o43, FStar_UInt128_mul_wide(f34, f40));
  254|  3.91M|    FStar_UInt128_uint128 tmp_w20 = o04;
  255|  3.91M|    FStar_UInt128_uint128 tmp_w21 = o141;
  256|  3.91M|    FStar_UInt128_uint128 tmp_w22 = o241;
  257|  3.91M|    FStar_UInt128_uint128 tmp_w23 = o34;
  258|  3.91M|    FStar_UInt128_uint128 tmp_w24 = o44;
  259|  3.91M|    FStar_UInt128_uint128
  260|  3.91M|        l_ = FStar_UInt128_add(tmp_w10, FStar_UInt128_uint64_to_uint128((uint64_t)0U));
  261|  3.91M|    uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU;
  262|  3.91M|    uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U));
  263|  3.91M|    FStar_UInt128_uint128 l_0 = FStar_UInt128_add(tmp_w11, FStar_UInt128_uint64_to_uint128(c00));
  264|  3.91M|    uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU;
  265|  3.91M|    uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U));
  266|  3.91M|    FStar_UInt128_uint128 l_1 = FStar_UInt128_add(tmp_w12, FStar_UInt128_uint64_to_uint128(c10));
  267|  3.91M|    uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU;
  268|  3.91M|    uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U));
  269|  3.91M|    FStar_UInt128_uint128 l_2 = FStar_UInt128_add(tmp_w13, FStar_UInt128_uint64_to_uint128(c20));
  270|  3.91M|    uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU;
  271|  3.91M|    uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U));
  272|  3.91M|    FStar_UInt128_uint128 l_3 = FStar_UInt128_add(tmp_w14, FStar_UInt128_uint64_to_uint128(c30));
  273|  3.91M|    uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU;
  274|  3.91M|    uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U));
  275|  3.91M|    uint64_t l_4 = tmp00 + c40 * (uint64_t)19U;
  276|  3.91M|    uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU;
  277|  3.91M|    uint64_t c50 = l_4 >> (uint32_t)51U;
  278|  3.91M|    uint64_t o100 = tmp0_;
  279|  3.91M|    uint64_t o112 = tmp10 + c50;
  280|  3.91M|    uint64_t o122 = tmp20;
  281|  3.91M|    uint64_t o132 = tmp30;
  282|  3.91M|    uint64_t o142 = tmp40;
  283|  3.91M|    FStar_UInt128_uint128
  284|  3.91M|        l_5 = FStar_UInt128_add(tmp_w20, FStar_UInt128_uint64_to_uint128((uint64_t)0U));
  285|  3.91M|    uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & (uint64_t)0x7ffffffffffffU;
  286|  3.91M|    uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, (uint32_t)51U));
  287|  3.91M|    FStar_UInt128_uint128 l_6 = FStar_UInt128_add(tmp_w21, FStar_UInt128_uint64_to_uint128(c0));
  288|  3.91M|    uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & (uint64_t)0x7ffffffffffffU;
  289|  3.91M|    uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, (uint32_t)51U));
  290|  3.91M|    FStar_UInt128_uint128 l_7 = FStar_UInt128_add(tmp_w22, FStar_UInt128_uint64_to_uint128(c1));
  291|  3.91M|    uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & (uint64_t)0x7ffffffffffffU;
  292|  3.91M|    uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, (uint32_t)51U));
  293|  3.91M|    FStar_UInt128_uint128 l_8 = FStar_UInt128_add(tmp_w23, FStar_UInt128_uint64_to_uint128(c2));
  294|  3.91M|    uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & (uint64_t)0x7ffffffffffffU;
  295|  3.91M|    uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, (uint32_t)51U));
  296|  3.91M|    FStar_UInt128_uint128 l_9 = FStar_UInt128_add(tmp_w24, FStar_UInt128_uint64_to_uint128(c3));
  297|  3.91M|    uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & (uint64_t)0x7ffffffffffffU;
  298|  3.91M|    uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, (uint32_t)51U));
  299|  3.91M|    uint64_t l_10 = tmp0 + c4 * (uint64_t)19U;
  300|  3.91M|    uint64_t tmp0_0 = l_10 & (uint64_t)0x7ffffffffffffU;
  301|  3.91M|    uint64_t c5 = l_10 >> (uint32_t)51U;
  302|  3.91M|    uint64_t o200 = tmp0_0;
  303|  3.91M|    uint64_t o212 = tmp1 + c5;
  304|  3.91M|    uint64_t o222 = tmp2;
  305|  3.91M|    uint64_t o232 = tmp3;
  306|  3.91M|    uint64_t o242 = tmp4;
  307|  3.91M|    uint64_t o10 = o100;
  308|  3.91M|    uint64_t o11 = o112;
  309|  3.91M|    uint64_t o12 = o122;
  310|  3.91M|    uint64_t o13 = o132;
  311|  3.91M|    uint64_t o14 = o142;
  312|  3.91M|    uint64_t o20 = o200;
  313|  3.91M|    uint64_t o21 = o212;
  314|  3.91M|    uint64_t o22 = o222;
  315|  3.91M|    uint64_t o23 = o232;
  316|  3.91M|    uint64_t o24 = o242;
  317|  3.91M|    out[0U] = o10;
  318|  3.91M|    out[1U] = o11;
  319|  3.91M|    out[2U] = o12;
  320|  3.91M|    out[3U] = o13;
  321|  3.91M|    out[4U] = o14;
  322|  3.91M|    out[5U] = o20;
  323|  3.91M|    out[6U] = o21;
  324|  3.91M|    out[7U] = o22;
  325|  3.91M|    out[8U] = o23;
  326|  3.91M|    out[9U] = o24;
  327|  3.91M|}
Hacl_Curve25519_51.c:Hacl_Impl_Curve25519_Field51_fsqr2:
  451|  3.91M|{
  452|  3.91M|    KRML_HOST_IGNORE(uu___);
  ------------------
  |  |   56|  3.91M|#define KRML_HOST_IGNORE(x) (void)(x)
  ------------------
  453|  3.91M|    uint64_t f10 = f[0U];
  454|  3.91M|    uint64_t f11 = f[1U];
  455|  3.91M|    uint64_t f12 = f[2U];
  456|  3.91M|    uint64_t f13 = f[3U];
  457|  3.91M|    uint64_t f14 = f[4U];
  458|  3.91M|    uint64_t f20 = f[5U];
  459|  3.91M|    uint64_t f21 = f[6U];
  460|  3.91M|    uint64_t f22 = f[7U];
  461|  3.91M|    uint64_t f23 = f[8U];
  462|  3.91M|    uint64_t f24 = f[9U];
  463|  3.91M|    uint64_t d00 = (uint64_t)2U * f10;
  464|  3.91M|    uint64_t d10 = (uint64_t)2U * f11;
  465|  3.91M|    uint64_t d20 = (uint64_t)38U * f12;
  466|  3.91M|    uint64_t d30 = (uint64_t)19U * f13;
  467|  3.91M|    uint64_t d4190 = (uint64_t)19U * f14;
  468|  3.91M|    uint64_t d40 = (uint64_t)2U * d4190;
  469|  3.91M|    FStar_UInt128_uint128
  470|  3.91M|        s00 =
  471|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(f10, f10),
  472|  3.91M|                                                FStar_UInt128_mul_wide(d40, f11)),
  473|  3.91M|                              FStar_UInt128_mul_wide(d20, f13));
  474|  3.91M|    FStar_UInt128_uint128
  475|  3.91M|        s10 =
  476|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d00, f11),
  477|  3.91M|                                                FStar_UInt128_mul_wide(d40, f12)),
  478|  3.91M|                              FStar_UInt128_mul_wide(d30, f13));
  479|  3.91M|    FStar_UInt128_uint128
  480|  3.91M|        s20 =
  481|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d00, f12),
  482|  3.91M|                                                FStar_UInt128_mul_wide(f11, f11)),
  483|  3.91M|                              FStar_UInt128_mul_wide(d40, f13));
  484|  3.91M|    FStar_UInt128_uint128
  485|  3.91M|        s30 =
  486|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d00, f13),
  487|  3.91M|                                                FStar_UInt128_mul_wide(d10, f12)),
  488|  3.91M|                              FStar_UInt128_mul_wide(f14, d4190));
  489|  3.91M|    FStar_UInt128_uint128
  490|  3.91M|        s40 =
  491|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d00, f14),
  492|  3.91M|                                                FStar_UInt128_mul_wide(d10, f13)),
  493|  3.91M|                              FStar_UInt128_mul_wide(f12, f12));
  494|  3.91M|    FStar_UInt128_uint128 o100 = s00;
  495|  3.91M|    FStar_UInt128_uint128 o110 = s10;
  496|  3.91M|    FStar_UInt128_uint128 o120 = s20;
  497|  3.91M|    FStar_UInt128_uint128 o130 = s30;
  498|  3.91M|    FStar_UInt128_uint128 o140 = s40;
  499|  3.91M|    uint64_t d0 = (uint64_t)2U * f20;
  500|  3.91M|    uint64_t d1 = (uint64_t)2U * f21;
  501|  3.91M|    uint64_t d2 = (uint64_t)38U * f22;
  502|  3.91M|    uint64_t d3 = (uint64_t)19U * f23;
  503|  3.91M|    uint64_t d419 = (uint64_t)19U * f24;
  504|  3.91M|    uint64_t d4 = (uint64_t)2U * d419;
  505|  3.91M|    FStar_UInt128_uint128
  506|  3.91M|        s0 =
  507|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(f20, f20),
  508|  3.91M|                                                FStar_UInt128_mul_wide(d4, f21)),
  509|  3.91M|                              FStar_UInt128_mul_wide(d2, f23));
  510|  3.91M|    FStar_UInt128_uint128
  511|  3.91M|        s1 =
  512|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d0, f21),
  513|  3.91M|                                                FStar_UInt128_mul_wide(d4, f22)),
  514|  3.91M|                              FStar_UInt128_mul_wide(d3, f23));
  515|  3.91M|    FStar_UInt128_uint128
  516|  3.91M|        s2 =
  517|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d0, f22),
  518|  3.91M|                                                FStar_UInt128_mul_wide(f21, f21)),
  519|  3.91M|                              FStar_UInt128_mul_wide(d4, f23));
  520|  3.91M|    FStar_UInt128_uint128
  521|  3.91M|        s3 =
  522|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d0, f23),
  523|  3.91M|                                                FStar_UInt128_mul_wide(d1, f22)),
  524|  3.91M|                              FStar_UInt128_mul_wide(f24, d419));
  525|  3.91M|    FStar_UInt128_uint128
  526|  3.91M|        s4 =
  527|  3.91M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(d0, f24),
  528|  3.91M|                                                FStar_UInt128_mul_wide(d1, f23)),
  529|  3.91M|                              FStar_UInt128_mul_wide(f22, f22));
  530|  3.91M|    FStar_UInt128_uint128 o200 = s0;
  531|  3.91M|    FStar_UInt128_uint128 o210 = s1;
  532|  3.91M|    FStar_UInt128_uint128 o220 = s2;
  533|  3.91M|    FStar_UInt128_uint128 o230 = s3;
  534|  3.91M|    FStar_UInt128_uint128 o240 = s4;
  535|  3.91M|    FStar_UInt128_uint128
  536|  3.91M|        l_ = FStar_UInt128_add(o100, FStar_UInt128_uint64_to_uint128((uint64_t)0U));
  537|  3.91M|    uint64_t tmp00 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU;
  538|  3.91M|    uint64_t c00 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U));
  539|  3.91M|    FStar_UInt128_uint128 l_0 = FStar_UInt128_add(o110, FStar_UInt128_uint64_to_uint128(c00));
  540|  3.91M|    uint64_t tmp10 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU;
  541|  3.91M|    uint64_t c10 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U));
  542|  3.91M|    FStar_UInt128_uint128 l_1 = FStar_UInt128_add(o120, FStar_UInt128_uint64_to_uint128(c10));
  543|  3.91M|    uint64_t tmp20 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU;
  544|  3.91M|    uint64_t c20 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U));
  545|  3.91M|    FStar_UInt128_uint128 l_2 = FStar_UInt128_add(o130, FStar_UInt128_uint64_to_uint128(c20));
  546|  3.91M|    uint64_t tmp30 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU;
  547|  3.91M|    uint64_t c30 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U));
  548|  3.91M|    FStar_UInt128_uint128 l_3 = FStar_UInt128_add(o140, FStar_UInt128_uint64_to_uint128(c30));
  549|  3.91M|    uint64_t tmp40 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU;
  550|  3.91M|    uint64_t c40 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U));
  551|  3.91M|    uint64_t l_4 = tmp00 + c40 * (uint64_t)19U;
  552|  3.91M|    uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU;
  553|  3.91M|    uint64_t c50 = l_4 >> (uint32_t)51U;
  554|  3.91M|    uint64_t o101 = tmp0_;
  555|  3.91M|    uint64_t o111 = tmp10 + c50;
  556|  3.91M|    uint64_t o121 = tmp20;
  557|  3.91M|    uint64_t o131 = tmp30;
  558|  3.91M|    uint64_t o141 = tmp40;
  559|  3.91M|    FStar_UInt128_uint128
  560|  3.91M|        l_5 = FStar_UInt128_add(o200, FStar_UInt128_uint64_to_uint128((uint64_t)0U));
  561|  3.91M|    uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_5) & (uint64_t)0x7ffffffffffffU;
  562|  3.91M|    uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_5, (uint32_t)51U));
  563|  3.91M|    FStar_UInt128_uint128 l_6 = FStar_UInt128_add(o210, FStar_UInt128_uint64_to_uint128(c0));
  564|  3.91M|    uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_6) & (uint64_t)0x7ffffffffffffU;
  565|  3.91M|    uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_6, (uint32_t)51U));
  566|  3.91M|    FStar_UInt128_uint128 l_7 = FStar_UInt128_add(o220, FStar_UInt128_uint64_to_uint128(c1));
  567|  3.91M|    uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_7) & (uint64_t)0x7ffffffffffffU;
  568|  3.91M|    uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_7, (uint32_t)51U));
  569|  3.91M|    FStar_UInt128_uint128 l_8 = FStar_UInt128_add(o230, FStar_UInt128_uint64_to_uint128(c2));
  570|  3.91M|    uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_8) & (uint64_t)0x7ffffffffffffU;
  571|  3.91M|    uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_8, (uint32_t)51U));
  572|  3.91M|    FStar_UInt128_uint128 l_9 = FStar_UInt128_add(o240, FStar_UInt128_uint64_to_uint128(c3));
  573|  3.91M|    uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_9) & (uint64_t)0x7ffffffffffffU;
  574|  3.91M|    uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_9, (uint32_t)51U));
  575|  3.91M|    uint64_t l_10 = tmp0 + c4 * (uint64_t)19U;
  576|  3.91M|    uint64_t tmp0_0 = l_10 & (uint64_t)0x7ffffffffffffU;
  577|  3.91M|    uint64_t c5 = l_10 >> (uint32_t)51U;
  578|  3.91M|    uint64_t o201 = tmp0_0;
  579|  3.91M|    uint64_t o211 = tmp1 + c5;
  580|  3.91M|    uint64_t o221 = tmp2;
  581|  3.91M|    uint64_t o231 = tmp3;
  582|  3.91M|    uint64_t o241 = tmp4;
  583|  3.91M|    uint64_t o10 = o101;
  584|  3.91M|    uint64_t o11 = o111;
  585|  3.91M|    uint64_t o12 = o121;
  586|  3.91M|    uint64_t o13 = o131;
  587|  3.91M|    uint64_t o14 = o141;
  588|  3.91M|    uint64_t o20 = o201;
  589|  3.91M|    uint64_t o21 = o211;
  590|  3.91M|    uint64_t o22 = o221;
  591|  3.91M|    uint64_t o23 = o231;
  592|  3.91M|    uint64_t o24 = o241;
  593|  3.91M|    out[0U] = o10;
  594|  3.91M|    out[1U] = o11;
  595|  3.91M|    out[2U] = o12;
  596|  3.91M|    out[3U] = o13;
  597|  3.91M|    out[4U] = o14;
  598|  3.91M|    out[5U] = o20;
  599|  3.91M|    out[6U] = o21;
  600|  3.91M|    out[7U] = o22;
  601|  3.91M|    out[8U] = o23;
  602|  3.91M|    out[9U] = o24;
  603|  3.91M|}
Hacl_Curve25519_51.c:Hacl_Impl_Curve25519_Field51_fmul1:
  331|  1.97M|{
  332|  1.97M|    uint64_t f10 = f1[0U];
  333|  1.97M|    uint64_t f11 = f1[1U];
  334|  1.97M|    uint64_t f12 = f1[2U];
  335|  1.97M|    uint64_t f13 = f1[3U];
  336|  1.97M|    uint64_t f14 = f1[4U];
  337|  1.97M|    FStar_UInt128_uint128 tmp_w0 = FStar_UInt128_mul_wide(f2, f10);
  338|  1.97M|    FStar_UInt128_uint128 tmp_w1 = FStar_UInt128_mul_wide(f2, f11);
  339|  1.97M|    FStar_UInt128_uint128 tmp_w2 = FStar_UInt128_mul_wide(f2, f12);
  340|  1.97M|    FStar_UInt128_uint128 tmp_w3 = FStar_UInt128_mul_wide(f2, f13);
  341|  1.97M|    FStar_UInt128_uint128 tmp_w4 = FStar_UInt128_mul_wide(f2, f14);
  342|  1.97M|    FStar_UInt128_uint128
  343|  1.97M|        l_ = FStar_UInt128_add(tmp_w0, FStar_UInt128_uint64_to_uint128((uint64_t)0U));
  344|  1.97M|    uint64_t tmp0 = FStar_UInt128_uint128_to_uint64(l_) & (uint64_t)0x7ffffffffffffU;
  345|  1.97M|    uint64_t c0 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_, (uint32_t)51U));
  346|  1.97M|    FStar_UInt128_uint128 l_0 = FStar_UInt128_add(tmp_w1, FStar_UInt128_uint64_to_uint128(c0));
  347|  1.97M|    uint64_t tmp1 = FStar_UInt128_uint128_to_uint64(l_0) & (uint64_t)0x7ffffffffffffU;
  348|  1.97M|    uint64_t c1 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_0, (uint32_t)51U));
  349|  1.97M|    FStar_UInt128_uint128 l_1 = FStar_UInt128_add(tmp_w2, FStar_UInt128_uint64_to_uint128(c1));
  350|  1.97M|    uint64_t tmp2 = FStar_UInt128_uint128_to_uint64(l_1) & (uint64_t)0x7ffffffffffffU;
  351|  1.97M|    uint64_t c2 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_1, (uint32_t)51U));
  352|  1.97M|    FStar_UInt128_uint128 l_2 = FStar_UInt128_add(tmp_w3, FStar_UInt128_uint64_to_uint128(c2));
  353|  1.97M|    uint64_t tmp3 = FStar_UInt128_uint128_to_uint64(l_2) & (uint64_t)0x7ffffffffffffU;
  354|  1.97M|    uint64_t c3 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_2, (uint32_t)51U));
  355|  1.97M|    FStar_UInt128_uint128 l_3 = FStar_UInt128_add(tmp_w4, FStar_UInt128_uint64_to_uint128(c3));
  356|  1.97M|    uint64_t tmp4 = FStar_UInt128_uint128_to_uint64(l_3) & (uint64_t)0x7ffffffffffffU;
  357|  1.97M|    uint64_t c4 = FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(l_3, (uint32_t)51U));
  358|  1.97M|    uint64_t l_4 = tmp0 + c4 * (uint64_t)19U;
  359|  1.97M|    uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU;
  360|  1.97M|    uint64_t c5 = l_4 >> (uint32_t)51U;
  361|  1.97M|    uint64_t o0 = tmp0_;
  362|  1.97M|    uint64_t o1 = tmp1 + c5;
  363|  1.97M|    uint64_t o2 = tmp2;
  364|  1.97M|    uint64_t o3 = tmp3;
  365|  1.97M|    uint64_t o4 = tmp4;
  366|  1.97M|    out[0U] = o0;
  367|  1.97M|    out[1U] = o1;
  368|  1.97M|    out[2U] = o2;
  369|  1.97M|    out[3U] = o3;
  370|  1.97M|    out[4U] = o4;
  371|  1.97M|}
Hacl_Curve25519_51.c:Hacl_Impl_Curve25519_Field51_store_felem:
  607|  7.73k|{
  608|  7.73k|    uint64_t f0 = f[0U];
  609|  7.73k|    uint64_t f1 = f[1U];
  610|  7.73k|    uint64_t f2 = f[2U];
  611|  7.73k|    uint64_t f3 = f[3U];
  612|  7.73k|    uint64_t f4 = f[4U];
  613|  7.73k|    uint64_t l_ = f0 + (uint64_t)0U;
  614|  7.73k|    uint64_t tmp0 = l_ & (uint64_t)0x7ffffffffffffU;
  615|  7.73k|    uint64_t c0 = l_ >> (uint32_t)51U;
  616|  7.73k|    uint64_t l_0 = f1 + c0;
  617|  7.73k|    uint64_t tmp1 = l_0 & (uint64_t)0x7ffffffffffffU;
  618|  7.73k|    uint64_t c1 = l_0 >> (uint32_t)51U;
  619|  7.73k|    uint64_t l_1 = f2 + c1;
  620|  7.73k|    uint64_t tmp2 = l_1 & (uint64_t)0x7ffffffffffffU;
  621|  7.73k|    uint64_t c2 = l_1 >> (uint32_t)51U;
  622|  7.73k|    uint64_t l_2 = f3 + c2;
  623|  7.73k|    uint64_t tmp3 = l_2 & (uint64_t)0x7ffffffffffffU;
  624|  7.73k|    uint64_t c3 = l_2 >> (uint32_t)51U;
  625|  7.73k|    uint64_t l_3 = f4 + c3;
  626|  7.73k|    uint64_t tmp4 = l_3 & (uint64_t)0x7ffffffffffffU;
  627|  7.73k|    uint64_t c4 = l_3 >> (uint32_t)51U;
  628|  7.73k|    uint64_t l_4 = tmp0 + c4 * (uint64_t)19U;
  629|  7.73k|    uint64_t tmp0_ = l_4 & (uint64_t)0x7ffffffffffffU;
  630|  7.73k|    uint64_t c5 = l_4 >> (uint32_t)51U;
  631|  7.73k|    uint64_t f01 = tmp0_;
  632|  7.73k|    uint64_t f11 = tmp1 + c5;
  633|  7.73k|    uint64_t f21 = tmp2;
  634|  7.73k|    uint64_t f31 = tmp3;
  635|  7.73k|    uint64_t f41 = tmp4;
  636|  7.73k|    uint64_t m0 = FStar_UInt64_gte_mask(f01, (uint64_t)0x7ffffffffffedU);
  637|  7.73k|    uint64_t m1 = FStar_UInt64_eq_mask(f11, (uint64_t)0x7ffffffffffffU);
  638|  7.73k|    uint64_t m2 = FStar_UInt64_eq_mask(f21, (uint64_t)0x7ffffffffffffU);
  639|  7.73k|    uint64_t m3 = FStar_UInt64_eq_mask(f31, (uint64_t)0x7ffffffffffffU);
  640|  7.73k|    uint64_t m4 = FStar_UInt64_eq_mask(f41, (uint64_t)0x7ffffffffffffU);
  641|  7.73k|    uint64_t mask = (((m0 & m1) & m2) & m3) & m4;
  642|  7.73k|    uint64_t f0_ = f01 - (mask & (uint64_t)0x7ffffffffffedU);
  643|  7.73k|    uint64_t f1_ = f11 - (mask & (uint64_t)0x7ffffffffffffU);
  644|  7.73k|    uint64_t f2_ = f21 - (mask & (uint64_t)0x7ffffffffffffU);
  645|  7.73k|    uint64_t f3_ = f31 - (mask & (uint64_t)0x7ffffffffffffU);
  646|  7.73k|    uint64_t f4_ = f41 - (mask & (uint64_t)0x7ffffffffffffU);
  647|  7.73k|    uint64_t f02 = f0_;
  648|  7.73k|    uint64_t f12 = f1_;
  649|  7.73k|    uint64_t f22 = f2_;
  650|  7.73k|    uint64_t f32 = f3_;
  651|  7.73k|    uint64_t f42 = f4_;
  652|  7.73k|    uint64_t o00 = f02 | f12 << (uint32_t)51U;
  653|  7.73k|    uint64_t o10 = f12 >> (uint32_t)13U | f22 << (uint32_t)38U;
  654|  7.73k|    uint64_t o20 = f22 >> (uint32_t)26U | f32 << (uint32_t)25U;
  655|  7.73k|    uint64_t o30 = f32 >> (uint32_t)39U | f42 << (uint32_t)12U;
  656|  7.73k|    uint64_t o0 = o00;
  657|  7.73k|    uint64_t o1 = o10;
  658|  7.73k|    uint64_t o2 = o20;
  659|  7.73k|    uint64_t o3 = o30;
  660|  7.73k|    u64s[0U] = o0;
  661|  7.73k|    u64s[1U] = o1;
  662|  7.73k|    u64s[2U] = o2;
  663|  7.73k|    u64s[3U] = o3;
  664|  7.73k|}

Hacl_P256.c:Hacl_Bignum_Base_mul_wide_add2_u64:
   53|  38.0M|{
   54|  38.0M|    uint64_t out0 = out[0U];
   55|  38.0M|    FStar_UInt128_uint128
   56|  38.0M|        res =
   57|  38.0M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(a, b),
   58|  38.0M|                                                FStar_UInt128_uint64_to_uint128(c_in)),
   59|  38.0M|                              FStar_UInt128_uint64_to_uint128(out0));
   60|  38.0M|    out[0U] = FStar_UInt128_uint128_to_uint64(res);
   61|  38.0M|    return FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, (uint32_t)64U));
   62|  38.0M|}
Hacl_P256.c:Hacl_Bignum_Addition_bn_add_eq_len_u64:
  242|   576k|{
  243|   576k|    uint64_t c = (uint64_t)0U;
  244|  1.72M|    for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) {
  ------------------
  |  Branch (244:37): [True: 1.15M, False: 576k]
  ------------------
  245|  1.15M|        uint64_t t1 = a[(uint32_t)4U * i];
  246|  1.15M|        uint64_t t20 = b[(uint32_t)4U * i];
  247|  1.15M|        uint64_t *res_i0 = res + (uint32_t)4U * i;
  248|  1.15M|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t20, res_i0);
  ------------------
  |  |   66|  1.15M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  249|  1.15M|        uint64_t t10 = a[(uint32_t)4U * i + (uint32_t)1U];
  250|  1.15M|        uint64_t t21 = b[(uint32_t)4U * i + (uint32_t)1U];
  251|  1.15M|        uint64_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U;
  252|  1.15M|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t10, t21, res_i1);
  ------------------
  |  |   66|  1.15M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  253|  1.15M|        uint64_t t11 = a[(uint32_t)4U * i + (uint32_t)2U];
  254|  1.15M|        uint64_t t22 = b[(uint32_t)4U * i + (uint32_t)2U];
  255|  1.15M|        uint64_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U;
  256|  1.15M|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t11, t22, res_i2);
  ------------------
  |  |   66|  1.15M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  257|  1.15M|        uint64_t t12 = a[(uint32_t)4U * i + (uint32_t)3U];
  258|  1.15M|        uint64_t t2 = b[(uint32_t)4U * i + (uint32_t)3U];
  259|  1.15M|        uint64_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U;
  260|  1.15M|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i);
  ------------------
  |  |   66|  1.15M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  261|  1.15M|    }
  262|   576k|    for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) {
  ------------------
  |  Branch (262:59): [True: 0, False: 576k]
  ------------------
  263|      0|        uint64_t t1 = a[i];
  264|      0|        uint64_t t2 = b[i];
  265|      0|        uint64_t *res_i = res + i;
  266|      0|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t2, res_i);
  ------------------
  |  |   66|      0|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  267|      0|    }
  268|   576k|    return c;
  269|   576k|}
Hacl_P256.c:Hacl_Bignum_Lib_bn_get_bits_u64:
  134|  25.2k|{
  135|  25.2k|    uint32_t i1 = i / (uint32_t)64U;
  136|  25.2k|    uint32_t j = i % (uint32_t)64U;
  137|  25.2k|    uint64_t p1 = b[i1] >> j;
  138|  25.2k|    uint64_t ite;
  139|  25.2k|    if (i1 + (uint32_t)1U < len && (uint32_t)0U < j) {
  ------------------
  |  Branch (139:9): [True: 10.8k, False: 14.4k]
  |  Branch (139:36): [True: 10.3k, False: 489]
  ------------------
  140|  10.3k|        ite = p1 | b[i1 + (uint32_t)1U] << ((uint32_t)64U - j);
  141|  14.9k|    } else {
  142|  14.9k|        ite = p1;
  143|  14.9k|    }
  144|  25.2k|    return ite & (((uint64_t)1U << l) - (uint64_t)1U);
  145|  25.2k|}
Hacl_P384.c:Hacl_Bignum_Base_mul_wide_add2_u64:
   53|   128M|{
   54|   128M|    uint64_t out0 = out[0U];
   55|   128M|    FStar_UInt128_uint128
   56|   128M|        res =
   57|   128M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(a, b),
   58|   128M|                                                FStar_UInt128_uint64_to_uint128(c_in)),
   59|   128M|                              FStar_UInt128_uint64_to_uint128(out0));
   60|   128M|    out[0U] = FStar_UInt128_uint128_to_uint64(res);
   61|   128M|    return FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, (uint32_t)64U));
   62|   128M|}
Hacl_P384.c:Hacl_Bignum_Addition_bn_add_eq_len_u64:
  242|   851k|{
  243|   851k|    uint64_t c = (uint64_t)0U;
  244|  3.40M|    for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) {
  ------------------
  |  Branch (244:37): [True: 2.55M, False: 851k]
  ------------------
  245|  2.55M|        uint64_t t1 = a[(uint32_t)4U * i];
  246|  2.55M|        uint64_t t20 = b[(uint32_t)4U * i];
  247|  2.55M|        uint64_t *res_i0 = res + (uint32_t)4U * i;
  248|  2.55M|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t20, res_i0);
  ------------------
  |  |   66|  2.55M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  249|  2.55M|        uint64_t t10 = a[(uint32_t)4U * i + (uint32_t)1U];
  250|  2.55M|        uint64_t t21 = b[(uint32_t)4U * i + (uint32_t)1U];
  251|  2.55M|        uint64_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U;
  252|  2.55M|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t10, t21, res_i1);
  ------------------
  |  |   66|  2.55M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  253|  2.55M|        uint64_t t11 = a[(uint32_t)4U * i + (uint32_t)2U];
  254|  2.55M|        uint64_t t22 = b[(uint32_t)4U * i + (uint32_t)2U];
  255|  2.55M|        uint64_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U;
  256|  2.55M|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t11, t22, res_i2);
  ------------------
  |  |   66|  2.55M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  257|  2.55M|        uint64_t t12 = a[(uint32_t)4U * i + (uint32_t)3U];
  258|  2.55M|        uint64_t t2 = b[(uint32_t)4U * i + (uint32_t)3U];
  259|  2.55M|        uint64_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U;
  260|  2.55M|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i);
  ------------------
  |  |   66|  2.55M|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  261|  2.55M|    }
  262|   851k|    for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) {
  ------------------
  |  Branch (262:59): [True: 0, False: 851k]
  ------------------
  263|      0|        uint64_t t1 = a[i];
  264|      0|        uint64_t t2 = b[i];
  265|      0|        uint64_t *res_i = res + i;
  266|      0|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t2, res_i);
  ------------------
  |  |   66|      0|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  267|      0|    }
  268|   851k|    return c;
  269|   851k|}
Hacl_P384.c:Hacl_Bignum_Lib_bn_get_bits_u64:
  134|  46.8k|{
  135|  46.8k|    uint32_t i1 = i / (uint32_t)64U;
  136|  46.8k|    uint32_t j = i % (uint32_t)64U;
  137|  46.8k|    uint64_t p1 = b[i1] >> j;
  138|  46.8k|    uint64_t ite;
  139|  46.8k|    if (i1 + (uint32_t)1U < len && (uint32_t)0U < j) {
  ------------------
  |  Branch (139:9): [True: 39.0k, False: 7.85k]
  |  Branch (139:36): [True: 37.3k, False: 1.62k]
  ------------------
  140|  37.3k|        ite = p1 | b[i1 + (uint32_t)1U] << ((uint32_t)64U - j);
  141|  37.3k|    } else {
  142|  9.48k|        ite = p1;
  143|  9.48k|    }
  144|  46.8k|    return ite & (((uint64_t)1U << l) - (uint64_t)1U);
  145|  46.8k|}
Hacl_P521.c:Hacl_Bignum_Base_mul_wide_add2_u64:
   53|  57.3M|{
   54|  57.3M|    uint64_t out0 = out[0U];
   55|  57.3M|    FStar_UInt128_uint128
   56|  57.3M|        res =
   57|  57.3M|            FStar_UInt128_add(FStar_UInt128_add(FStar_UInt128_mul_wide(a, b),
   58|  57.3M|                                                FStar_UInt128_uint64_to_uint128(c_in)),
   59|  57.3M|                              FStar_UInt128_uint64_to_uint128(out0));
   60|  57.3M|    out[0U] = FStar_UInt128_uint128_to_uint64(res);
   61|  57.3M|    return FStar_UInt128_uint128_to_uint64(FStar_UInt128_shift_right(res, (uint32_t)64U));
   62|  57.3M|}
Hacl_P521.c:Hacl_Bignum_Addition_bn_add_eq_len_u64:
  242|   169k|{
  243|   169k|    uint64_t c = (uint64_t)0U;
  244|   847k|    for (uint32_t i = (uint32_t)0U; i < aLen / (uint32_t)4U; i++) {
  ------------------
  |  Branch (244:37): [True: 677k, False: 169k]
  ------------------
  245|   677k|        uint64_t t1 = a[(uint32_t)4U * i];
  246|   677k|        uint64_t t20 = b[(uint32_t)4U * i];
  247|   677k|        uint64_t *res_i0 = res + (uint32_t)4U * i;
  248|   677k|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t20, res_i0);
  ------------------
  |  |   66|   677k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  249|   677k|        uint64_t t10 = a[(uint32_t)4U * i + (uint32_t)1U];
  250|   677k|        uint64_t t21 = b[(uint32_t)4U * i + (uint32_t)1U];
  251|   677k|        uint64_t *res_i1 = res + (uint32_t)4U * i + (uint32_t)1U;
  252|   677k|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t10, t21, res_i1);
  ------------------
  |  |   66|   677k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  253|   677k|        uint64_t t11 = a[(uint32_t)4U * i + (uint32_t)2U];
  254|   677k|        uint64_t t22 = b[(uint32_t)4U * i + (uint32_t)2U];
  255|   677k|        uint64_t *res_i2 = res + (uint32_t)4U * i + (uint32_t)2U;
  256|   677k|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t11, t22, res_i2);
  ------------------
  |  |   66|   677k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  257|   677k|        uint64_t t12 = a[(uint32_t)4U * i + (uint32_t)3U];
  258|   677k|        uint64_t t2 = b[(uint32_t)4U * i + (uint32_t)3U];
  259|   677k|        uint64_t *res_i = res + (uint32_t)4U * i + (uint32_t)3U;
  260|   677k|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t12, t2, res_i);
  ------------------
  |  |   66|   677k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  261|   677k|    }
  262|   508k|    for (uint32_t i = aLen / (uint32_t)4U * (uint32_t)4U; i < aLen; i++) {
  ------------------
  |  Branch (262:59): [True: 338k, False: 169k]
  ------------------
  263|   338k|        uint64_t t1 = a[i];
  264|   338k|        uint64_t t2 = b[i];
  265|   338k|        uint64_t *res_i = res + i;
  266|   338k|        c = Lib_IntTypes_Intrinsics_add_carry_u64(c, t1, t2, res_i);
  ------------------
  |  |   66|   338k|    (_addcarry_u64(x1, x2, x3, (long long unsigned int *)x4))
  ------------------
  267|   338k|    }
  268|   169k|    return c;
  269|   169k|}
Hacl_P521.c:Hacl_Bignum_Lib_bn_get_bits_u64:
  134|  9.44k|{
  135|  9.44k|    uint32_t i1 = i / (uint32_t)64U;
  136|  9.44k|    uint32_t j = i % (uint32_t)64U;
  137|  9.44k|    uint64_t p1 = b[i1] >> j;
  138|  9.44k|    uint64_t ite;
  139|  9.44k|    if (i1 + (uint32_t)1U < len && (uint32_t)0U < j) {
  ------------------
  |  Branch (139:9): [True: 9.24k, False: 200]
  |  Branch (139:36): [True: 8.84k, False: 400]
  ------------------
  140|  8.84k|        ite = p1 | b[i1 + (uint32_t)1U] << ((uint32_t)64U - j);
  141|  8.84k|    } else {
  142|    600|        ite = p1;
  143|    600|    }
  144|  9.44k|    return ite & (((uint64_t)1U << l) - (uint64_t)1U);
  145|  9.44k|}

Hacl_P256.c:load64:
  178|  8.06k|{
  179|  8.06k|    uint64_t x;
  180|  8.06k|    memcpy(&x, b, 8);
  181|  8.06k|    return x;
  182|  8.06k|}
Hacl_P256.c:store64:
  198|  2.30k|{
  199|  2.30k|    memcpy(b, &i, 8);
  200|  2.30k|}
Hacl_P384.c:load64:
  178|  7.90k|{
  179|  7.90k|    uint64_t x;
  180|  7.90k|    memcpy(&x, b, 8);
  181|  7.90k|    return x;
  182|  7.90k|}
Hacl_P384.c:store64:
  198|  3.10k|{
  199|  3.10k|    memcpy(b, &i, 8);
  200|  3.10k|}
Hacl_P521.c:load64:
  178|  1.67k|{
  179|  1.67k|    uint64_t x;
  180|  1.67k|    memcpy(&x, b, 8);
  181|  1.67k|    return x;
  182|  1.67k|}
Hacl_P521.c:store64:
  198|    612|{
  199|    612|    memcpy(b, &i, 8);
  200|    612|}
Hacl_Chacha20.c:load32:
  170|   929k|{
  171|   929k|    uint32_t x;
  172|   929k|    memcpy(&x, b, 4);
  173|   929k|    return x;
  174|   929k|}
Hacl_Chacha20.c:store32:
  192|   559k|{
  193|   559k|    memcpy(b, &i, 4);
  194|   559k|}
Hacl_Curve25519_51.c:load64:
  178|  30.9k|{
  179|  30.9k|    uint64_t x;
  180|  30.9k|    memcpy(&x, b, 8);
  181|  30.9k|    return x;
  182|  30.9k|}
Hacl_Curve25519_51.c:store64:
  198|  30.9k|{
  199|  30.9k|    memcpy(b, &i, 8);
  200|  30.9k|}

Hacl_P256.c:FStar_UInt64_eq_mask:
   36|   282k|{
   37|   282k|    uint64_t x = a ^ b;
   38|   282k|    uint64_t minus_x = ~x + (uint64_t)1U;
   39|   282k|    uint64_t x_or_minus_x = x | minus_x;
   40|   282k|    uint64_t xnx = x_or_minus_x >> (uint32_t)63U;
   41|   282k|    return xnx - (uint64_t)1U;
   42|   282k|}
Hacl_P384.c:FStar_UInt64_gte_mask:
   46|  1.31k|{
   47|  1.31k|    uint64_t x = a;
   48|  1.31k|    uint64_t y = b;
   49|  1.31k|    uint64_t x_xor_y = x ^ y;
   50|  1.31k|    uint64_t x_sub_y = x - y;
   51|  1.31k|    uint64_t x_sub_y_xor_y = x_sub_y ^ y;
   52|  1.31k|    uint64_t q = x_xor_y | x_sub_y_xor_y;
   53|  1.31k|    uint64_t x_xor_q = x ^ q;
   54|  1.31k|    uint64_t x_xor_q_ = x_xor_q >> (uint32_t)63U;
   55|  1.31k|    return x_xor_q_ - (uint64_t)1U;
   56|  1.31k|}
Hacl_P384.c:FStar_UInt64_eq_mask:
   36|  1.04M|{
   37|  1.04M|    uint64_t x = a ^ b;
   38|  1.04M|    uint64_t minus_x = ~x + (uint64_t)1U;
   39|  1.04M|    uint64_t x_or_minus_x = x | minus_x;
   40|  1.04M|    uint64_t xnx = x_or_minus_x >> (uint32_t)63U;
   41|  1.04M|    return xnx - (uint64_t)1U;
   42|  1.04M|}
Hacl_P521.c:FStar_UInt64_gte_mask:
   46|    182|{
   47|    182|    uint64_t x = a;
   48|    182|    uint64_t y = b;
   49|    182|    uint64_t x_xor_y = x ^ y;
   50|    182|    uint64_t x_sub_y = x - y;
   51|    182|    uint64_t x_sub_y_xor_y = x_sub_y ^ y;
   52|    182|    uint64_t q = x_xor_y | x_sub_y_xor_y;
   53|    182|    uint64_t x_xor_q = x ^ q;
   54|    182|    uint64_t x_xor_q_ = x_xor_q >> (uint32_t)63U;
   55|    182|    return x_xor_q_ - (uint64_t)1U;
   56|    182|}
Hacl_P521.c:FStar_UInt64_eq_mask:
   36|   210k|{
   37|   210k|    uint64_t x = a ^ b;
   38|   210k|    uint64_t minus_x = ~x + (uint64_t)1U;
   39|   210k|    uint64_t x_or_minus_x = x | minus_x;
   40|   210k|    uint64_t xnx = x_or_minus_x >> (uint32_t)63U;
   41|   210k|    return xnx - (uint64_t)1U;
   42|   210k|}
Hacl_Curve25519_51.c:FStar_UInt64_gte_mask:
   46|  7.73k|{
   47|  7.73k|    uint64_t x = a;
   48|  7.73k|    uint64_t y = b;
   49|  7.73k|    uint64_t x_xor_y = x ^ y;
   50|  7.73k|    uint64_t x_sub_y = x - y;
   51|  7.73k|    uint64_t x_sub_y_xor_y = x_sub_y ^ y;
   52|  7.73k|    uint64_t q = x_xor_y | x_sub_y_xor_y;
   53|  7.73k|    uint64_t x_xor_q = x ^ q;
   54|  7.73k|    uint64_t x_xor_q_ = x_xor_q >> (uint32_t)63U;
   55|  7.73k|    return x_xor_q_ - (uint64_t)1U;
   56|  7.73k|}
Hacl_Curve25519_51.c:FStar_UInt64_eq_mask:
   36|  30.9k|{
   37|  30.9k|    uint64_t x = a ^ b;
   38|  30.9k|    uint64_t minus_x = ~x + (uint64_t)1U;
   39|  30.9k|    uint64_t x_or_minus_x = x | minus_x;
   40|  30.9k|    uint64_t xnx = x_or_minus_x >> (uint32_t)63U;
   41|  30.9k|    return xnx - (uint64_t)1U;
   42|  30.9k|}
Hacl_Curve25519_51.c:FStar_UInt8_eq_mask:
  186|   247k|{
  187|   247k|    uint8_t x = a ^ b;
  188|   247k|    uint8_t minus_x = ~x + (uint8_t)1U;
  189|   247k|    uint8_t x_or_minus_x = x | minus_x;
  190|   247k|    uint8_t xnx = x_or_minus_x >> (uint32_t)7U;
  191|   247k|    return xnx - (uint8_t)1U;
  192|   247k|}

Hacl_P256.c:FStar_UInt128_add:
   64|  76.0M|{
   65|  76.0M|    return x + y;
   66|  76.0M|}
Hacl_P256.c:FStar_UInt128_uint64_to_uint128:
  130|  76.0M|{
  131|  76.0M|    return (uint128_t)x;
  132|  76.0M|}
Hacl_P256.c:FStar_UInt128_mul_wide:
  142|  39.1M|{
  143|  39.1M|    return ((uint128_t)x) * y;
  144|  39.1M|}
Hacl_P256.c:FStar_UInt128_uint128_to_uint64:
  136|  78.3M|{
  137|  78.3M|    return (uint64_t)x;
  138|  78.3M|}
Hacl_P256.c:FStar_UInt128_shift_right:
  124|  39.1M|{
  125|  39.1M|    return x >> y;
  126|  39.1M|}
Hacl_P384.c:FStar_UInt128_add:
   64|   256M|{
   65|   256M|    return x + y;
   66|   256M|}
Hacl_P384.c:FStar_UInt128_uint64_to_uint128:
  130|   256M|{
  131|   256M|    return (uint128_t)x;
  132|   256M|}
Hacl_P384.c:FStar_UInt128_mul_wide:
  142|   130M|{
  143|   130M|    return ((uint128_t)x) * y;
  144|   130M|}
Hacl_P384.c:FStar_UInt128_uint128_to_uint64:
  136|   261M|{
  137|   261M|    return (uint64_t)x;
  138|   261M|}
Hacl_P384.c:FStar_UInt128_shift_right:
  124|   130M|{
  125|   130M|    return x >> y;
  126|   130M|}
Hacl_P521.c:FStar_UInt128_add:
   64|   114M|{
   65|   114M|    return x + y;
   66|   114M|}
Hacl_P521.c:FStar_UInt128_uint64_to_uint128:
  130|   114M|{
  131|   114M|    return (uint128_t)x;
  132|   114M|}
Hacl_P521.c:FStar_UInt128_mul_wide:
  142|  58.1M|{
  143|  58.1M|    return ((uint128_t)x) * y;
  144|  58.1M|}
Hacl_P521.c:FStar_UInt128_uint128_to_uint64:
  136|   116M|{
  137|   116M|    return (uint64_t)x;
  138|   116M|}
Hacl_P521.c:FStar_UInt128_shift_right:
  124|  58.1M|{
  125|  58.1M|    return x >> y;
  126|  58.1M|}
Hacl_Curve25519_51.c:FStar_UInt128_add:
   64|   403M|{
   65|   403M|    return x + y;
   66|   403M|}
Hacl_Curve25519_51.c:FStar_UInt128_mul_wide:
  142|   403M|{
  143|   403M|    return ((uint128_t)x) * y;
  144|   403M|}
Hacl_Curve25519_51.c:FStar_UInt128_uint64_to_uint128:
  130|   108M|{
  131|   108M|    return (uint128_t)x;
  132|   108M|}
Hacl_Curve25519_51.c:FStar_UInt128_uint128_to_uint64:
  136|   216M|{
  137|   216M|    return (uint64_t)x;
  138|   216M|}
Hacl_Curve25519_51.c:FStar_UInt128_shift_right:
  124|   108M|{
  125|   108M|    return x >> y;
  126|   108M|}

NSS_NoDB_Init:
  949|      1|{
  950|      1|    return nss_Init("", "", "", "", "", "", "", "", "", NULL, NULL,
  951|      1|                    PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE,
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
                                  PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE,
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
                                  PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE,
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
                                  PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE,
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
                                  PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE,
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
                                  PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE, PR_TRUE,
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  952|      1|                    PR_FALSE, PR_FALSE, PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
                                  PR_FALSE, PR_FALSE, PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
                                  PR_FALSE, PR_FALSE, PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  953|      1|}
NSS_RegisterShutdown:
  992|      3|{
  993|      3|    int i;
  994|       |
  995|       |    /* make sure our lock and condition variable are initialized one and only
  996|       |     * one time */
  997|      3|    if (PR_CallOnce(&nssInitOnce, nss_doLockInit) != PR_SUCCESS) {
  ------------------
  |  Branch (997:9): [True: 0, False: 3]
  ------------------
  998|      0|        return SECFailure;
  999|      0|    }
 1000|       |
 1001|      3|    PZ_Lock(nssInitLock);
  ------------------
  |  |  245|      3|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1002|      3|    if (!NSS_IsInitialized()) {
  ------------------
  |  Branch (1002:9): [True: 0, False: 3]
  ------------------
 1003|      0|        PZ_Unlock(nssInitLock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1004|      0|        PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1005|      0|        return SECFailure;
 1006|      0|    }
 1007|      3|    PZ_Unlock(nssInitLock);
  ------------------
  |  |  246|      3|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1008|      3|    if (sFunc == NULL) {
  ------------------
  |  Branch (1008:9): [True: 0, False: 3]
  ------------------
 1009|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1010|      0|        return SECFailure;
 1011|      0|    }
 1012|       |
 1013|      3|    PORT_Assert(nssShutdownList.lock);
  ------------------
  |  |  120|      3|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      3|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1014|      3|    PZ_Lock(nssShutdownList.lock);
  ------------------
  |  |  245|      3|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1015|       |
 1016|       |    /* make sure we don't have a duplicate */
 1017|      3|    i = nss_GetShutdownEntry(sFunc, appData);
 1018|      3|    if (i >= 0) {
  ------------------
  |  Branch (1018:9): [True: 0, False: 3]
  ------------------
 1019|      0|        PZ_Unlock(nssShutdownList.lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1020|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1021|      0|        return SECFailure;
 1022|      0|    }
 1023|       |    /* find an empty slot */
 1024|      3|    i = nss_GetShutdownEntry(NULL, NULL);
 1025|      3|    if (i >= 0) {
  ------------------
  |  Branch (1025:9): [True: 0, False: 3]
  ------------------
 1026|      0|        nssShutdownList.funcs[i].func = sFunc;
 1027|      0|        nssShutdownList.funcs[i].appData = appData;
 1028|      0|        PZ_Unlock(nssShutdownList.lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1029|      0|        return SECSuccess;
 1030|      0|    }
 1031|      3|    if (nssShutdownList.allocatedFuncs == nssShutdownList.peakFuncs) {
  ------------------
  |  Branch (1031:9): [True: 0, False: 3]
  ------------------
 1032|      0|        struct NSSShutdownFuncPair *funcs =
 1033|      0|            (struct NSSShutdownFuncPair *)PORT_Realloc(nssShutdownList.funcs,
  ------------------
  |  |   64|      0|#define PORT_Realloc PORT_Realloc_Util
  ------------------
 1034|      0|                                                       (nssShutdownList.allocatedFuncs + NSS_SHUTDOWN_STEP) * sizeof(struct NSSShutdownFuncPair));
  ------------------
  |  |  955|      0|#define NSS_SHUTDOWN_STEP 10
  ------------------
 1035|      0|        if (!funcs) {
  ------------------
  |  Branch (1035:13): [True: 0, False: 0]
  ------------------
 1036|      0|            PZ_Unlock(nssShutdownList.lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1037|      0|            return SECFailure;
 1038|      0|        }
 1039|      0|        nssShutdownList.funcs = funcs;
 1040|      0|        nssShutdownList.allocatedFuncs += NSS_SHUTDOWN_STEP;
  ------------------
  |  |  955|      0|#define NSS_SHUTDOWN_STEP 10
  ------------------
 1041|      0|    }
 1042|      3|    nssShutdownList.funcs[nssShutdownList.peakFuncs].func = sFunc;
 1043|      3|    nssShutdownList.funcs[nssShutdownList.peakFuncs].appData = appData;
 1044|      3|    nssShutdownList.peakFuncs++;
 1045|      3|    PZ_Unlock(nssShutdownList.lock);
  ------------------
  |  |  246|      3|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1046|      3|    return SECSuccess;
 1047|      3|}
nss_Shutdown:
 1143|      1|{
 1144|      1|    SECStatus shutdownRV = SECSuccess;
 1145|      1|    SECStatus rv;
 1146|      1|    PRStatus status;
 1147|      1|    NSSInitContext *temp;
 1148|       |
 1149|      1|    rv = nss_ShutdownShutdownList();
 1150|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1150:9): [True: 0, False: 1]
  ------------------
 1151|      0|        shutdownRV = SECFailure;
 1152|      0|    }
 1153|      1|    cert_DestroyLocks();
 1154|      1|    ShutdownCRLCache();
 1155|      1|    OCSP_ShutdownGlobal();
 1156|       |#ifndef NSS_DISABLE_LIBPKIX
 1157|       |    PKIX_Shutdown(plContext);
 1158|       |#endif /* NSS_DISABLE_LIBPKIX */
 1159|      1|    SECOID_Shutdown();
 1160|      1|    status = STAN_Shutdown();
 1161|      1|    cert_DestroySubjectKeyIDHashTable();
 1162|      1|    pk11_SetInternalKeySlot(NULL);
 1163|      1|    rv = SECMOD_Shutdown();
 1164|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1164:9): [True: 0, False: 1]
  ------------------
 1165|      0|        shutdownRV = SECFailure;
 1166|      0|    }
 1167|      1|    pk11sdr_Shutdown();
 1168|      1|    nssArena_Shutdown();
 1169|      1|    if (status == PR_FAILURE) {
  ------------------
  |  Branch (1169:9): [True: 0, False: 1]
  ------------------
 1170|      0|        if (NSS_GetError() == NSS_ERROR_BUSY) {
  ------------------
  |  Branch (1170:13): [True: 0, False: 0]
  ------------------
 1171|      0|            PORT_SetError(SEC_ERROR_BUSY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1172|      0|        }
 1173|      0|        shutdownRV = SECFailure;
 1174|      0|    }
 1175|       |    /*
 1176|       |     * A thread's error stack is automatically destroyed when the thread
 1177|       |     * terminates, except for the primordial thread, whose error stack is
 1178|       |     * destroyed by PR_Cleanup.  Since NSS is usually shut down by the
 1179|       |     * primordial thread and many NSS-based apps don't call PR_Cleanup,
 1180|       |     * we destroy the calling thread's error stack here. This must be
 1181|       |     * done after any NSS_GetError call, otherwise NSS_GetError will
 1182|       |     * create the error stack again.
 1183|       |     */
 1184|      1|    nss_DestroyErrorStack();
 1185|      1|    nssIsInitted = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 1186|      1|    temp = nssInitContextList;
 1187|      1|    nssInitContextList = NULL;
 1188|       |    /* free the old list. This is necessary when we are called from
 1189|       |     * NSS_Shutdown(). */
 1190|      1|    while (temp) {
  ------------------
  |  Branch (1190:12): [True: 0, False: 1]
  ------------------
 1191|      0|        NSSInitContext *next = temp->next;
 1192|      0|        temp->magic = 0;
 1193|      0|        PORT_Free(temp);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1194|      0|        temp = next;
 1195|      0|    }
 1196|      1|    return shutdownRV;
 1197|      1|}
NSS_Shutdown:
 1201|      1|{
 1202|      1|    SECStatus rv;
 1203|       |    /* make sure our lock and condition variable are initialized one and only
 1204|       |     * one time */
 1205|      1|    if (PR_CallOnce(&nssInitOnce, nss_doLockInit) != PR_SUCCESS) {
  ------------------
  |  Branch (1205:9): [True: 0, False: 1]
  ------------------
 1206|      0|        return SECFailure;
 1207|      0|    }
 1208|      1|    PZ_Lock(nssInitLock);
  ------------------
  |  |  245|      1|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1209|       |
 1210|      1|    if (!nssIsInitted) {
  ------------------
  |  Branch (1210:9): [True: 0, False: 1]
  ------------------
 1211|      0|        PZ_Unlock(nssInitLock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1212|      0|        PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1213|      0|        return SECFailure;
 1214|      0|    }
 1215|       |
 1216|       |    /* If one or more threads are in the middle of init, wait for them
 1217|       |     * to complete */
 1218|      1|    while (nssIsInInit) {
  ------------------
  |  Branch (1218:12): [True: 0, False: 1]
  ------------------
 1219|      0|        PZ_WaitCondVar(nssInitCondition, PR_INTERVAL_NO_TIMEOUT);
  ------------------
  |  |  250|      0|#define PZ_WaitCondVar(v, t) PR_WaitCondVar((v), (t))
  ------------------
 1220|      0|    }
 1221|      1|    rv = nss_Shutdown();
 1222|      1|    PZ_Unlock(nssInitLock);
  ------------------
  |  |  246|      1|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1223|      1|    return rv;
 1224|      1|}
NSS_IsInitialized:
 1303|      4|{
 1304|      4|    return (nssIsInitted) || (nssInitContextList != NULL);
  ------------------
  |  Branch (1304:12): [True: 3, False: 1]
  |  Branch (1304:30): [True: 0, False: 1]
  ------------------
 1305|      4|}
nssinit.c:nss_Init:
  558|      1|{
  559|      1|    SECMODModule *parent = NULL;
  560|       |#ifndef NSS_DISABLE_LIBPKIX
  561|       |    PKIX_UInt32 actualMinorVersion = 0;
  562|       |    PKIX_Error *pkixError = NULL;
  563|       |#endif /* NSS_DISABLE_LIBPKIX */
  564|      1|    PRBool isReallyInitted;
  565|      1|    char *configStrings = NULL;
  566|      1|    char *configName = NULL;
  567|      1|    PRBool passwordRequired = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  568|       |#ifdef POLICY_FILE
  569|       |    char *ignoreVar;
  570|       |#endif
  571|       |
  572|       |    /* if we are trying to init with a traditional NSS_Init call, maintain
  573|       |     * the traditional idempotent behavior. */
  574|      1|    if (!initContextPtr && nssIsInitted) {
  ------------------
  |  Branch (574:9): [True: 1, False: 0]
  |  Branch (574:28): [True: 0, False: 1]
  ------------------
  575|      0|        return SECSuccess;
  576|      0|    }
  577|       |
  578|       |    /* make sure our lock and condition variable are initialized one and only
  579|       |     * one time */
  580|      1|    if (PR_CallOnce(&nssInitOnce, nss_doLockInit) != PR_SUCCESS) {
  ------------------
  |  Branch (580:9): [True: 0, False: 1]
  ------------------
  581|      0|        return SECFailure;
  582|      0|    }
  583|       |
  584|       |    /*
  585|       |     * if we haven't done basic initialization, single thread the
  586|       |     * initializations.
  587|       |     */
  588|      1|    PZ_Lock(nssInitLock);
  ------------------
  |  |  245|      1|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  589|      1|    isReallyInitted = NSS_IsInitialized();
  590|      1|    if (!isReallyInitted) {
  ------------------
  |  Branch (590:9): [True: 1, False: 0]
  ------------------
  591|      1|        while (!isReallyInitted && nssIsInInit) {
  ------------------
  |  Branch (591:16): [True: 1, False: 0]
  |  Branch (591:36): [True: 0, False: 1]
  ------------------
  592|      0|            PZ_WaitCondVar(nssInitCondition, PR_INTERVAL_NO_TIMEOUT);
  ------------------
  |  |  250|      0|#define PZ_WaitCondVar(v, t) PR_WaitCondVar((v), (t))
  ------------------
  593|      0|            isReallyInitted = NSS_IsInitialized();
  594|      0|        }
  595|       |        /* once we've completed basic initialization, we can allow more than
  596|       |         * one process initialize NSS at a time. */
  597|      1|    }
  598|      1|    nssIsInInit++;
  599|      1|    PZ_Unlock(nssInitLock);
  ------------------
  |  |  246|      1|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  600|       |
  601|       |    /* this tells us whether or not some library has already initialized us.
  602|       |     * if so, we don't want to double call some of the basic initialization
  603|       |     * functions */
  604|       |
  605|      1|    if (!isReallyInitted) {
  ------------------
  |  Branch (605:9): [True: 1, False: 0]
  ------------------
  606|      1|#ifdef DEBUG
  607|      1|        CERTCertificate dummyCert;
  608|       |        /* New option bits must not change the size of CERTCertificate. */
  609|      1|        PORT_Assert(sizeof(dummyCert.options) == sizeof(void *));
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  610|      1|#endif
  611|       |
  612|      1|        if (SECSuccess != cert_InitLocks()) {
  ------------------
  |  Branch (612:13): [True: 0, False: 1]
  ------------------
  613|      0|            goto loser;
  614|      0|        }
  615|       |
  616|      1|        if (SECSuccess != InitCRLCache()) {
  ------------------
  |  Branch (616:13): [True: 0, False: 1]
  ------------------
  617|      0|            goto loser;
  618|      0|        }
  619|       |
  620|      1|        if (SECSuccess != OCSP_InitGlobal()) {
  ------------------
  |  Branch (620:13): [True: 0, False: 1]
  ------------------
  621|      0|            goto loser;
  622|      0|        }
  623|      1|    }
  624|       |
  625|      1|    if (noSingleThreadedModules || allowAlreadyInitializedModules ||
  ------------------
  |  Branch (625:9): [True: 0, False: 1]
  |  Branch (625:36): [True: 0, False: 1]
  ------------------
  626|      1|        dontFinalizeModules) {
  ------------------
  |  Branch (626:9): [True: 0, False: 1]
  ------------------
  627|      0|        pk11_setGlobalOptions(noSingleThreadedModules,
  628|      0|                              allowAlreadyInitializedModules,
  629|      0|                              dontFinalizeModules);
  630|      0|    }
  631|       |
  632|      1|    if (initContextPtr) {
  ------------------
  |  Branch (632:9): [True: 0, False: 1]
  ------------------
  633|      0|        *initContextPtr = PORT_ZNew(NSSInitContext);
  ------------------
  |  |  148|      0|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  634|      0|        if (*initContextPtr == NULL) {
  ------------------
  |  Branch (634:13): [True: 0, False: 0]
  ------------------
  635|      0|            goto loser;
  636|      0|        }
  637|       |        /*
  638|       |         * For traditional NSS_Init, we used the PK11_Configure() call to set
  639|       |         * globals. with InitContext, we pass those strings in as parameters.
  640|       |         *
  641|       |         * This allows old NSS_Init calls to work as before, while at the same
  642|       |         * time new calls and old calls will not interfere with each other.
  643|       |         */
  644|      0|        if (initParams) {
  ------------------
  |  Branch (644:13): [True: 0, False: 0]
  ------------------
  645|      0|            if (initParams->length < sizeof(NSSInitParameters)) {
  ------------------
  |  Branch (645:17): [True: 0, False: 0]
  ------------------
  646|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  647|      0|                goto loser;
  648|      0|            }
  649|      0|            configStrings = nss_MkConfigString(initParams->manufactureID,
  650|      0|                                               initParams->libraryDescription,
  651|      0|                                               initParams->cryptoTokenDescription,
  652|      0|                                               initParams->dbTokenDescription,
  653|      0|                                               initParams->cryptoSlotDescription,
  654|      0|                                               initParams->dbSlotDescription,
  655|      0|                                               initParams->FIPSSlotDescription,
  656|      0|                                               initParams->FIPSTokenDescription,
  657|      0|                                               initParams->minPWLen);
  658|      0|            if (configStrings == NULL) {
  ------------------
  |  Branch (658:17): [True: 0, False: 0]
  ------------------
  659|      0|                PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  660|      0|                goto loser;
  661|      0|            }
  662|      0|            configName = initParams->libraryDescription;
  663|      0|            passwordRequired = initParams->passwordRequired;
  664|      0|        }
  665|       |
  666|       |        /* If we're NSS_ContextInit, we're probably a library. It could be
  667|       |         * possible that the application initialized NSS then forked(). The
  668|       |         * library would have no knowledge of that. If we call
  669|       |         * SECMOD_RestartModules() here, we will be able to continue on with
  670|       |         * NSS as normal. SECMOD_RestartModules() does have the side affect
  671|       |         * of losing all our PKCS #11 objects in the new process, but only if
  672|       |         * the module needs to be reinited. If it needs to be reinit those
  673|       |         * objects are inaccessible anyway, it's always save to call
  674|       |         * SECMOD_RestartModules(PR_FALSE).
  675|       |         */
  676|       |        /* NOTE: We could call SECMOD_Init() here, but if we aren't already
  677|       |         * inited, then there's no modules to restart, so SECMOD_RestartModules
  678|       |         * will return immediately */
  679|      0|        SECMOD_RestartModules(PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  680|      1|    } else {
  681|      1|        configStrings = pk11_config_strings;
  682|      1|        configName = pk11_config_name;
  683|      1|        passwordRequired = pk11_password_required;
  684|      1|    }
  685|       |
  686|       |    /* Skip the module init if we are already initted and we are trying
  687|       |     * to init with noCertDB and noModDB */
  688|      1|    if (!(isReallyInitted && noCertDB && noModDB)) {
  ------------------
  |  Branch (688:11): [True: 0, False: 1]
  |  Branch (688:30): [True: 0, False: 0]
  |  Branch (688:42): [True: 0, False: 0]
  ------------------
  689|      1|        parent = nss_InitModules(configdir, certPrefix, keyPrefix, secmodName,
  690|      1|                                 updateDir, updCertPrefix, updKeyPrefix, updateID,
  691|      1|                                 updateName, configName, configStrings, passwordRequired,
  692|      1|                                 readOnly, noCertDB, noModDB, forceOpen, optimizeSpace,
  693|      1|                                 (initContextPtr != NULL));
  694|       |
  695|      1|        if (parent == NULL) {
  ------------------
  |  Branch (695:13): [True: 0, False: 1]
  ------------------
  696|      0|            goto loser;
  697|      0|        }
  698|      1|    }
  699|       |
  700|       |    /* finish up initialization */
  701|      1|    if (!isReallyInitted) {
  ------------------
  |  Branch (701:9): [True: 1, False: 0]
  ------------------
  702|      1|        if (SECOID_Init() != SECSuccess) {
  ------------------
  |  Branch (702:13): [True: 0, False: 1]
  ------------------
  703|      0|            goto loser;
  704|      0|        }
  705|       |#ifdef POLICY_FILE
  706|       |        /* Load the system crypto policy file if it exists,
  707|       |         * unless the NSS_IGNORE_SYSTEM_POLICY environment
  708|       |         * variable has been set to 1. */
  709|       |        ignoreVar = PR_GetEnvSecure("NSS_IGNORE_SYSTEM_POLICY");
  710|       |        if (ignoreVar == NULL || strncmp(ignoreVar, "1", sizeof("1")) != 0) {
  711|       |            if (PR_Access(POLICY_PATH "/" POLICY_FILE, PR_ACCESS_READ_OK) == PR_SUCCESS) {
  712|       |                SECMODModule *module = SECMOD_LoadModule(
  713|       |                    "name=\"Policy File\" "
  714|       |                    "parameters=\"configdir='sql:" POLICY_PATH "' "
  715|       |                    "secmod='" POLICY_FILE "' "
  716|       |                    "flags=readOnly,noCertDB,forceSecmodChoice,forceOpen\" "
  717|       |                    "NSS=\"flags=internal,moduleDB,skipFirst,moduleDBOnly,critical\"",
  718|       |                    parent, PR_TRUE);
  719|       |                if (module) {
  720|       |                    PRBool isLoaded = module->loaded;
  721|       |                    SECMOD_DestroyModule(module);
  722|       |                    if (!isLoaded) {
  723|       |                        goto loser;
  724|       |                    }
  725|       |                }
  726|       |            }
  727|       |        }
  728|       |#endif
  729|      1|        if (STAN_LoadDefaultNSS3TrustDomain() != PR_SUCCESS) {
  ------------------
  |  Branch (729:13): [True: 0, False: 1]
  ------------------
  730|      0|            goto loser;
  731|      0|        }
  732|      1|        if (nss_InitShutdownList() != SECSuccess) {
  ------------------
  |  Branch (732:13): [True: 0, False: 1]
  ------------------
  733|      0|            goto loser;
  734|      0|        }
  735|      1|        CERT_SetDefaultCertDB((CERTCertDBHandle *)
  736|      1|                                  STAN_GetDefaultTrustDomain());
  737|      1|        if ((!noModDB) && (!noCertDB) && (!noRootInit)) {
  ------------------
  |  Branch (737:13): [True: 0, False: 1]
  |  Branch (737:27): [True: 0, False: 0]
  |  Branch (737:42): [True: 0, False: 0]
  ------------------
  738|      0|            if (!SECMOD_HasRootCerts()) {
  ------------------
  |  Branch (738:17): [True: 0, False: 0]
  ------------------
  739|      0|                const char *dbpath = configdir;
  740|       |                /* handle supported database modifiers */
  741|      0|                if (strncmp(dbpath, "sql:", 4) == 0) {
  ------------------
  |  Branch (741:21): [True: 0, False: 0]
  ------------------
  742|      0|                    dbpath += 4;
  743|      0|                } else if (strncmp(dbpath, "dbm:", 4) == 0) {
  ------------------
  |  Branch (743:28): [True: 0, False: 0]
  ------------------
  744|      0|                    dbpath += 4;
  745|      0|                } else if (strncmp(dbpath, "extern:", 7) == 0) {
  ------------------
  |  Branch (745:28): [True: 0, False: 0]
  ------------------
  746|      0|                    dbpath += 7;
  747|      0|                } else if (strncmp(dbpath, "rdb:", 4) == 0) {
  ------------------
  |  Branch (747:28): [True: 0, False: 0]
  ------------------
  748|       |                    /* if rdb: is specified, the configdir isn't really a
  749|       |                     * path. Skip it */
  750|      0|                    dbpath = NULL;
  751|      0|                }
  752|      0|                if (dbpath) {
  ------------------
  |  Branch (752:21): [True: 0, False: 0]
  ------------------
  753|      0|                    nss_FindExternalRoot(dbpath, secmodName);
  754|      0|                }
  755|      0|            }
  756|      0|        }
  757|      1|        pk11sdr_Init();
  758|      1|        cert_CreateSubjectKeyIDHashTable();
  759|       |
  760|       |#ifndef NSS_DISABLE_LIBPKIX
  761|       |        pkixError = PKIX_Initialize(PKIX_FALSE, PKIX_MAJOR_VERSION, PKIX_MINOR_VERSION,
  762|       |                                    PKIX_MINOR_VERSION, &actualMinorVersion, &plContext);
  763|       |
  764|       |        if (pkixError != NULL) {
  765|       |            goto loser;
  766|       |        } else {
  767|       |            char *ev = PR_GetEnvSecure("NSS_DISABLE_PKIX_VERIFY");
  768|       |            if (ev && ev[0]) {
  769|       |                CERT_SetUsePKIXForValidation(PR_FALSE);
  770|       |            }
  771|       |        }
  772|       |#endif /* NSS_DISABLE_LIBPKIX */
  773|      1|    }
  774|       |
  775|       |    /*
  776|       |     * Now mark the appropriate init state. If initContextPtr was passed
  777|       |     * in, then return the new context pointer and add it to the
  778|       |     * nssInitContextList. Otherwise set the global nss_isInitted flag
  779|       |     */
  780|      1|    PZ_Lock(nssInitLock);
  ------------------
  |  |  245|      1|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  781|      1|    if (!initContextPtr) {
  ------------------
  |  Branch (781:9): [True: 1, False: 0]
  ------------------
  782|      1|        nssIsInitted = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  783|      1|    } else {
  784|      0|        (*initContextPtr)->magic = NSS_INIT_MAGIC;
  ------------------
  |  |  523|      0|#define NSS_INIT_MAGIC 0x1413A91C
  ------------------
  785|      0|        (*initContextPtr)->next = nssInitContextList;
  786|      0|        nssInitContextList = (*initContextPtr);
  787|      0|    }
  788|      1|    nssIsInInit--;
  789|       |    /* now that we are inited, all waiters can move forward */
  790|      1|    PZ_NotifyAllCondVar(nssInitCondition);
  ------------------
  |  |  252|      1|#define PZ_NotifyAllCondVar(v) PR_NotifyAllCondVar((v))
  ------------------
  791|      1|    PZ_Unlock(nssInitLock);
  ------------------
  |  |  246|      1|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  792|       |
  793|      1|    if (initContextPtr && configStrings) {
  ------------------
  |  Branch (793:9): [True: 0, False: 1]
  |  Branch (793:27): [True: 0, False: 0]
  ------------------
  794|      0|        PR_smprintf_free(configStrings);
  795|      0|    }
  796|      1|    if (parent) {
  ------------------
  |  Branch (796:9): [True: 1, False: 0]
  ------------------
  797|      1|        SECMOD_DestroyModule(parent);
  798|      1|    }
  799|       |
  800|      1|    return SECSuccess;
  801|       |
  802|      0|loser:
  803|      0|    if (initContextPtr && *initContextPtr) {
  ------------------
  |  Branch (803:9): [True: 0, False: 0]
  |  Branch (803:27): [True: 0, False: 0]
  ------------------
  804|      0|        PORT_Free(*initContextPtr);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  805|      0|        *initContextPtr = NULL;
  806|      0|        if (configStrings) {
  ------------------
  |  Branch (806:13): [True: 0, False: 0]
  ------------------
  807|      0|            PR_smprintf_free(configStrings);
  808|      0|        }
  809|      0|    }
  810|      0|    PZ_Lock(nssInitLock);
  ------------------
  |  |  245|      0|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  811|      0|    nssIsInInit--;
  812|       |    /* We failed to init, allow one to move forward */
  813|      0|    PZ_NotifyCondVar(nssInitCondition);
  ------------------
  |  |  251|      0|#define PZ_NotifyCondVar(v) PR_NotifyCondVar((v))
  ------------------
  814|      0|    PZ_Unlock(nssInitLock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  815|      0|    if (parent) {
  ------------------
  |  Branch (815:9): [True: 0, False: 0]
  ------------------
  816|      0|        SECMOD_DestroyModule(parent);
  817|      0|    }
  818|      0|    return SECFailure;
  819|      1|}
nssinit.c:nss_InitModules:
  366|      1|{
  367|      1|    SECMODModule *module = NULL;
  368|      1|    char *moduleSpec = NULL;
  369|      1|    char *flags = NULL;
  370|      1|    char *lconfigdir = NULL;
  371|      1|    char *lcertPrefix = NULL;
  372|      1|    char *lkeyPrefix = NULL;
  373|      1|    char *lsecmodName = NULL;
  374|      1|    char *lupdateDir = NULL;
  375|      1|    char *lupdCertPrefix = NULL;
  376|      1|    char *lupdKeyPrefix = NULL;
  377|      1|    char *lupdateID = NULL;
  378|      1|    char *lupdateName = NULL;
  379|       |
  380|      1|    if (NSS_InitializePRErrorTable() != SECSuccess) {
  ------------------
  |  Branch (380:9): [True: 0, False: 1]
  ------------------
  381|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  382|      0|        return NULL;
  383|      0|    }
  384|       |
  385|      1|    flags = nss_makeFlags(readOnly, noCertDB, noModDB, forceOpen,
  386|      1|                          pwRequired, optimizeSpace);
  387|      1|    if (flags == NULL)
  ------------------
  |  Branch (387:9): [True: 0, False: 1]
  ------------------
  388|      0|        return NULL;
  389|       |
  390|       |    /*
  391|       |     * configdir is double nested, and Windows uses the same character
  392|       |     * for file seps as we use for escapes! (sigh).
  393|       |     */
  394|      1|    lconfigdir = NSSUTIL_DoubleEscape(configdir, '\'', '\"');
  395|      1|    if (lconfigdir == NULL) {
  ------------------
  |  Branch (395:9): [True: 0, False: 1]
  ------------------
  396|      0|        goto loser;
  397|      0|    }
  398|      1|    lcertPrefix = NSSUTIL_DoubleEscape(certPrefix, '\'', '\"');
  399|      1|    if (lcertPrefix == NULL) {
  ------------------
  |  Branch (399:9): [True: 0, False: 1]
  ------------------
  400|      0|        goto loser;
  401|      0|    }
  402|      1|    lkeyPrefix = NSSUTIL_DoubleEscape(keyPrefix, '\'', '\"');
  403|      1|    if (lkeyPrefix == NULL) {
  ------------------
  |  Branch (403:9): [True: 0, False: 1]
  ------------------
  404|      0|        goto loser;
  405|      0|    }
  406|      1|    lsecmodName = NSSUTIL_DoubleEscape(secmodName, '\'', '\"');
  407|      1|    if (lsecmodName == NULL) {
  ------------------
  |  Branch (407:9): [True: 0, False: 1]
  ------------------
  408|      0|        goto loser;
  409|      0|    }
  410|      1|    lupdateDir = NSSUTIL_DoubleEscape(updateDir, '\'', '\"');
  411|      1|    if (lupdateDir == NULL) {
  ------------------
  |  Branch (411:9): [True: 0, False: 1]
  ------------------
  412|      0|        goto loser;
  413|      0|    }
  414|      1|    lupdCertPrefix = NSSUTIL_DoubleEscape(updCertPrefix, '\'', '\"');
  415|      1|    if (lupdCertPrefix == NULL) {
  ------------------
  |  Branch (415:9): [True: 0, False: 1]
  ------------------
  416|      0|        goto loser;
  417|      0|    }
  418|      1|    lupdKeyPrefix = NSSUTIL_DoubleEscape(updKeyPrefix, '\'', '\"');
  419|      1|    if (lupdKeyPrefix == NULL) {
  ------------------
  |  Branch (419:9): [True: 0, False: 1]
  ------------------
  420|      0|        goto loser;
  421|      0|    }
  422|      1|    lupdateID = NSSUTIL_DoubleEscape(updateID, '\'', '\"');
  423|      1|    if (lupdateID == NULL) {
  ------------------
  |  Branch (423:9): [True: 0, False: 1]
  ------------------
  424|      0|        goto loser;
  425|      0|    }
  426|      1|    lupdateName = NSSUTIL_DoubleEscape(updateName, '\'', '\"');
  427|      1|    if (lupdateName == NULL) {
  ------------------
  |  Branch (427:9): [True: 0, False: 1]
  ------------------
  428|      0|        goto loser;
  429|      0|    }
  430|       |
  431|      1|    moduleSpec = PR_smprintf(
  432|      1|        "name=\"%s\" parameters=\"configdir='%s' certPrefix='%s' keyPrefix='%s' "
  433|      1|        "secmod='%s' flags=%s updatedir='%s' updateCertPrefix='%s' "
  434|      1|        "updateKeyPrefix='%s' updateid='%s' updateTokenDescription='%s' %s\" "
  435|      1|        "NSS=\"flags=internal,moduleDB,moduleDBOnly,critical%s\"",
  436|      1|        configName ? configName : NSS_DEFAULT_MOD_NAME,
  ------------------
  |  |   58|      1|#define NSS_DEFAULT_MOD_NAME "NSS Internal Module"
  ------------------
  |  Branch (436:9): [True: 0, False: 1]
  ------------------
  437|      1|        lconfigdir, lcertPrefix, lkeyPrefix, lsecmodName, flags,
  438|      1|        lupdateDir, lupdCertPrefix, lupdKeyPrefix, lupdateID,
  439|      1|        lupdateName, configStrings ? configStrings : "",
  ------------------
  |  Branch (439:22): [True: 0, False: 1]
  ------------------
  440|      1|        isContextInit ? "" : ",defaultModDB,internalKeySlot");
  ------------------
  |  Branch (440:9): [True: 0, False: 1]
  ------------------
  441|       |
  442|      1|loser:
  443|      1|    PORT_Free(flags);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  444|      1|    if (lconfigdir)
  ------------------
  |  Branch (444:9): [True: 1, False: 0]
  ------------------
  445|      1|        PORT_Free(lconfigdir);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  446|      1|    if (lcertPrefix)
  ------------------
  |  Branch (446:9): [True: 1, False: 0]
  ------------------
  447|      1|        PORT_Free(lcertPrefix);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  448|      1|    if (lkeyPrefix)
  ------------------
  |  Branch (448:9): [True: 1, False: 0]
  ------------------
  449|      1|        PORT_Free(lkeyPrefix);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  450|      1|    if (lsecmodName)
  ------------------
  |  Branch (450:9): [True: 1, False: 0]
  ------------------
  451|      1|        PORT_Free(lsecmodName);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  452|      1|    if (lupdateDir)
  ------------------
  |  Branch (452:9): [True: 1, False: 0]
  ------------------
  453|      1|        PORT_Free(lupdateDir);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  454|      1|    if (lupdCertPrefix)
  ------------------
  |  Branch (454:9): [True: 1, False: 0]
  ------------------
  455|      1|        PORT_Free(lupdCertPrefix);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  456|      1|    if (lupdKeyPrefix)
  ------------------
  |  Branch (456:9): [True: 1, False: 0]
  ------------------
  457|      1|        PORT_Free(lupdKeyPrefix);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  458|      1|    if (lupdateID)
  ------------------
  |  Branch (458:9): [True: 1, False: 0]
  ------------------
  459|      1|        PORT_Free(lupdateID);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  460|      1|    if (lupdateName)
  ------------------
  |  Branch (460:9): [True: 1, False: 0]
  ------------------
  461|      1|        PORT_Free(lupdateName);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  462|       |
  463|      1|    if (moduleSpec) {
  ------------------
  |  Branch (463:9): [True: 1, False: 0]
  ------------------
  464|      1|        module = SECMOD_LoadModule(moduleSpec, NULL, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  465|      1|        PR_smprintf_free(moduleSpec);
  466|      1|        if (module && !module->loaded) {
  ------------------
  |  Branch (466:13): [True: 1, False: 0]
  |  Branch (466:23): [True: 0, False: 1]
  ------------------
  467|      0|            SECMOD_DestroyModule(module);
  468|      0|            return NULL;
  469|      0|        }
  470|      1|    }
  471|      1|    return module;
  472|      1|}
nssinit.c:nss_makeFlags:
   64|      1|{
   65|      1|    char *flags = (char *)PORT_Alloc(NSS_MAX_FLAG_SIZE);
  ------------------
  |  |   52|      1|#define PORT_Alloc PORT_Alloc_Util
  ------------------
                  char *flags = (char *)PORT_Alloc(NSS_MAX_FLAG_SIZE);
  ------------------
  |  |   55|      1|#define NSS_MAX_FLAG_SIZE sizeof("readOnly") + sizeof("noCertDB") +                                  \
  |  |   56|      1|                              sizeof("noModDB") + sizeof("forceOpen") + sizeof("passwordRequired") + \
  |  |   57|      1|                              sizeof("optimizeSpace") + sizeof("printPolicyFeedback")
  ------------------
   66|      1|    PRBool first = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
   67|       |
   68|      1|    PORT_Memset(flags, 0, NSS_MAX_FLAG_SIZE);
  ------------------
  |  |  182|      1|#define PORT_Memset memset
  ------------------
                  PORT_Memset(flags, 0, NSS_MAX_FLAG_SIZE);
  ------------------
  |  |   55|      1|#define NSS_MAX_FLAG_SIZE sizeof("readOnly") + sizeof("noCertDB") +                                  \
  |  |   56|      1|                              sizeof("noModDB") + sizeof("forceOpen") + sizeof("passwordRequired") + \
  |  |   57|      1|                              sizeof("optimizeSpace") + sizeof("printPolicyFeedback")
  ------------------
   69|      1|    if (readOnly) {
  ------------------
  |  Branch (69:9): [True: 1, False: 0]
  ------------------
   70|      1|        PORT_Strcat(flags, "readOnly");
  ------------------
  |  |  185|      1|#define PORT_Strcat strcat
  ------------------
   71|      1|        first = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
   72|      1|    }
   73|      1|    if (noCertDB) {
  ------------------
  |  Branch (73:9): [True: 1, False: 0]
  ------------------
   74|      1|        if (!first)
  ------------------
  |  Branch (74:13): [True: 1, False: 0]
  ------------------
   75|      1|            PORT_Strcat(flags, ",");
  ------------------
  |  |  185|      1|#define PORT_Strcat strcat
  ------------------
   76|      1|        PORT_Strcat(flags, "noCertDB");
  ------------------
  |  |  185|      1|#define PORT_Strcat strcat
  ------------------
   77|      1|        first = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
   78|      1|    }
   79|      1|    if (noModDB) {
  ------------------
  |  Branch (79:9): [True: 1, False: 0]
  ------------------
   80|      1|        if (!first)
  ------------------
  |  Branch (80:13): [True: 1, False: 0]
  ------------------
   81|      1|            PORT_Strcat(flags, ",");
  ------------------
  |  |  185|      1|#define PORT_Strcat strcat
  ------------------
   82|      1|        PORT_Strcat(flags, "noModDB");
  ------------------
  |  |  185|      1|#define PORT_Strcat strcat
  ------------------
   83|      1|        first = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
   84|      1|    }
   85|      1|    if (forceOpen) {
  ------------------
  |  Branch (85:9): [True: 1, False: 0]
  ------------------
   86|      1|        if (!first)
  ------------------
  |  Branch (86:13): [True: 1, False: 0]
  ------------------
   87|      1|            PORT_Strcat(flags, ",");
  ------------------
  |  |  185|      1|#define PORT_Strcat strcat
  ------------------
   88|      1|        PORT_Strcat(flags, "forceOpen");
  ------------------
  |  |  185|      1|#define PORT_Strcat strcat
  ------------------
   89|      1|        first = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
   90|      1|    }
   91|      1|    if (passwordRequired) {
  ------------------
  |  Branch (91:9): [True: 0, False: 1]
  ------------------
   92|      0|        if (!first)
  ------------------
  |  Branch (92:13): [True: 0, False: 0]
  ------------------
   93|      0|            PORT_Strcat(flags, ",");
  ------------------
  |  |  185|      0|#define PORT_Strcat strcat
  ------------------
   94|      0|        PORT_Strcat(flags, "passwordRequired");
  ------------------
  |  |  185|      0|#define PORT_Strcat strcat
  ------------------
   95|      0|        first = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
   96|      0|    }
   97|      1|    if (optimizeSpace) {
  ------------------
  |  Branch (97:9): [True: 1, False: 0]
  ------------------
   98|      1|        if (!first)
  ------------------
  |  Branch (98:13): [True: 1, False: 0]
  ------------------
   99|      1|            PORT_Strcat(flags, ",");
  ------------------
  |  |  185|      1|#define PORT_Strcat strcat
  ------------------
  100|      1|        PORT_Strcat(flags, "optimizeSpace");
  ------------------
  |  |  185|      1|#define PORT_Strcat strcat
  ------------------
  101|      1|    }
  102|      1|    return flags;
  103|      1|}
nssinit.c:nss_InitShutdownList:
 1091|      1|{
 1092|      1|    if (nssShutdownList.lock != NULL) {
  ------------------
  |  Branch (1092:9): [True: 0, False: 1]
  ------------------
 1093|      0|        return SECSuccess;
 1094|      0|    }
 1095|      1|    nssShutdownList.lock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 1096|      1|    if (nssShutdownList.lock == NULL) {
  ------------------
  |  Branch (1096:9): [True: 0, False: 1]
  ------------------
 1097|      0|        return SECFailure;
 1098|      0|    }
 1099|      1|    nssShutdownList.funcs = PORT_ZNewArray(struct NSSShutdownFuncPair,
  ------------------
  |  |  159|      1|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|      1|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 1100|      1|                                           NSS_SHUTDOWN_STEP);
 1101|      1|    if (nssShutdownList.funcs == NULL) {
  ------------------
  |  Branch (1101:9): [True: 0, False: 1]
  ------------------
 1102|      0|        PZ_DestroyLock(nssShutdownList.lock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 1103|      0|        nssShutdownList.lock = NULL;
 1104|      0|        return SECFailure;
 1105|      0|    }
 1106|      1|    nssShutdownList.allocatedFuncs = NSS_SHUTDOWN_STEP;
  ------------------
  |  |  955|      1|#define NSS_SHUTDOWN_STEP 10
  ------------------
 1107|      1|    nssShutdownList.peakFuncs = 0;
 1108|       |
 1109|      1|    return SECSuccess;
 1110|      1|}
nssinit.c:nss_doLockInit:
  534|      1|{
  535|      1|    nssInitLock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  536|      1|    if (nssInitLock == NULL) {
  ------------------
  |  Branch (536:9): [True: 0, False: 1]
  ------------------
  537|      0|        return PR_FAILURE;
  538|      0|    }
  539|      1|    nssInitCondition = PZ_NewCondVar(nssInitLock);
  ------------------
  |  |  248|      1|#define PZ_NewCondVar(l) PR_NewCondVar((l))
  ------------------
  540|      1|    if (nssInitCondition == NULL) {
  ------------------
  |  Branch (540:9): [True: 0, False: 1]
  ------------------
  541|      0|        return PR_FAILURE;
  542|      0|    }
  543|      1|    return PR_SUCCESS;
  544|      1|}
nssinit.c:nss_GetShutdownEntry:
  974|      6|{
  975|      6|    int count, i;
  976|      6|    count = nssShutdownList.peakFuncs;
  977|       |
  978|     12|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (978:17): [True: 6, False: 6]
  ------------------
  979|      6|        if ((nssShutdownList.funcs[i].func == sFunc) &&
  ------------------
  |  Branch (979:13): [True: 0, False: 6]
  ------------------
  980|      6|            (nssShutdownList.funcs[i].appData == appData)) {
  ------------------
  |  Branch (980:13): [True: 0, False: 0]
  ------------------
  981|      0|            return i;
  982|      0|        }
  983|      6|    }
  984|      6|    return -1;
  985|      6|}
nssinit.c:nss_ShutdownShutdownList:
 1114|      1|{
 1115|      1|    SECStatus rv = SECSuccess;
 1116|      1|    int i;
 1117|       |
 1118|       |    /* call all the registerd functions first */
 1119|      4|    for (i = 0; i < nssShutdownList.peakFuncs; i++) {
  ------------------
  |  Branch (1119:17): [True: 3, False: 1]
  ------------------
 1120|      3|        struct NSSShutdownFuncPair *funcPair = &nssShutdownList.funcs[i];
 1121|      3|        if (funcPair->func) {
  ------------------
  |  Branch (1121:13): [True: 3, False: 0]
  ------------------
 1122|      3|            if ((*funcPair->func)(funcPair->appData, NULL) != SECSuccess) {
  ------------------
  |  Branch (1122:17): [True: 0, False: 3]
  ------------------
 1123|      0|                rv = SECFailure;
 1124|      0|            }
 1125|      3|        }
 1126|      3|    }
 1127|       |
 1128|      1|    nssShutdownList.peakFuncs = 0;
 1129|      1|    nssShutdownList.allocatedFuncs = 0;
 1130|      1|    PORT_Free(nssShutdownList.funcs);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
 1131|      1|    nssShutdownList.funcs = NULL;
 1132|      1|    if (nssShutdownList.lock) {
  ------------------
  |  Branch (1132:9): [True: 1, False: 0]
  ------------------
 1133|      1|        PZ_DestroyLock(nssShutdownList.lock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 1134|      1|    }
 1135|      1|    nssShutdownList.lock = NULL;
 1136|      1|    return rv;
 1137|      1|}

NSS_OptionGet:
  107|   643k|{
  108|   643k|    SECStatus rv = SECSuccess;
  109|       |
  110|   643k|    switch (which) {
  111|  3.57k|        case NSS_RSA_MIN_KEY_SIZE:
  ------------------
  |  |  286|  3.57k|#define NSS_RSA_MIN_KEY_SIZE 0x001
  ------------------
  |  Branch (111:9): [True: 3.57k, False: 639k]
  ------------------
  112|  3.57k|            *value = nss_ops.rsaMinKeySize;
  113|  3.57k|            break;
  114|  1.71k|        case NSS_DH_MIN_KEY_SIZE:
  ------------------
  |  |  287|  1.71k|#define NSS_DH_MIN_KEY_SIZE 0x002
  ------------------
  |  Branch (114:9): [True: 1.71k, False: 641k]
  ------------------
  115|  1.71k|            *value = nss_ops.dhMinKeySize;
  116|  1.71k|            break;
  117|    936|        case NSS_DSA_MIN_KEY_SIZE:
  ------------------
  |  |  288|    936|#define NSS_DSA_MIN_KEY_SIZE 0x004
  ------------------
  |  Branch (117:9): [True: 936, False: 642k]
  ------------------
  118|    936|            *value = nss_ops.dsaMinKeySize;
  119|    936|            break;
  120|      0|        case NSS_TLS_VERSION_MIN_POLICY:
  ------------------
  |  |  289|      0|#define NSS_TLS_VERSION_MIN_POLICY 0x008
  ------------------
  |  Branch (120:9): [True: 0, False: 643k]
  ------------------
  121|      0|            *value = nss_ops.tlsVersionMinPolicy;
  122|      0|            break;
  123|      0|        case NSS_TLS_VERSION_MAX_POLICY:
  ------------------
  |  |  290|      0|#define NSS_TLS_VERSION_MAX_POLICY 0x009
  ------------------
  |  Branch (123:9): [True: 0, False: 643k]
  ------------------
  124|      0|            *value = nss_ops.tlsVersionMaxPolicy;
  125|      0|            break;
  126|      0|        case NSS_DTLS_VERSION_MIN_POLICY:
  ------------------
  |  |  291|      0|#define NSS_DTLS_VERSION_MIN_POLICY 0x00a
  ------------------
  |  Branch (126:9): [True: 0, False: 643k]
  ------------------
  127|      0|            *value = nss_ops.dtlsVersionMinPolicy;
  128|      0|            break;
  129|      0|        case NSS_DTLS_VERSION_MAX_POLICY:
  ------------------
  |  |  292|      0|#define NSS_DTLS_VERSION_MAX_POLICY 0x00b
  ------------------
  |  Branch (129:9): [True: 0, False: 643k]
  ------------------
  130|      0|            *value = nss_ops.dtlsVersionMaxPolicy;
  131|      0|            break;
  132|      0|        case __NSS_PKCS12_DECODE_FORCE_UNICODE:
  ------------------
  |  |  301|      0|#define __NSS_PKCS12_DECODE_FORCE_UNICODE 0x00c
  ------------------
  |  Branch (132:9): [True: 0, False: 643k]
  ------------------
  133|      0|            *value = nss_ops.pkcs12DecodeForceUnicode;
  134|      0|            break;
  135|   628k|        case NSS_DEFAULT_LOCKS:
  ------------------
  |  |  302|   628k|#define NSS_DEFAULT_LOCKS 0x00d /* lock default values */
  ------------------
  |  Branch (135:9): [True: 628k, False: 14.9k]
  ------------------
  136|   628k|            *value = nss_ops.defaultLocks;
  137|   628k|            break;
  138|  7.45k|        case NSS_KEY_SIZE_POLICY_FLAGS:
  ------------------
  |  |  317|  7.45k|#define NSS_KEY_SIZE_POLICY_FLAGS 0x00e
  ------------------
  |  Branch (138:9): [True: 7.45k, False: 636k]
  ------------------
  139|  7.45k|        case NSS_KEY_SIZE_POLICY_SET_FLAGS:
  ------------------
  |  |  318|  7.45k|#define NSS_KEY_SIZE_POLICY_SET_FLAGS 0x00f
  ------------------
  |  Branch (139:9): [True: 0, False: 643k]
  ------------------
  140|  7.45k|            *value = nss_ops.keySizePolicyFlags;
  141|  7.45k|            break;
  142|      0|        case NSS_KEY_SIZE_POLICY_CLEAR_FLAGS:
  ------------------
  |  |  319|      0|#define NSS_KEY_SIZE_POLICY_CLEAR_FLAGS 0x010
  ------------------
  |  Branch (142:9): [True: 0, False: 643k]
  ------------------
  143|      0|            *value = ~nss_ops.keySizePolicyFlags;
  144|      0|            break;
  145|  1.23k|        case NSS_ECC_MIN_KEY_SIZE:
  ------------------
  |  |  327|  1.23k|#define NSS_ECC_MIN_KEY_SIZE 0x011
  ------------------
  |  Branch (145:9): [True: 1.23k, False: 642k]
  ------------------
  146|  1.23k|            *value = nss_ops.eccMinKeySize;
  147|  1.23k|            break;
  148|      0|        default:
  ------------------
  |  Branch (148:9): [True: 0, False: 643k]
  ------------------
  149|      0|            rv = SECFailure;
  150|   643k|    }
  151|       |
  152|   643k|    return rv;
  153|   643k|}

nssSession_ImportNSS3Session:
   29|      2|{
   30|      2|    nssSession *rvSession = NULL;
   31|      2|    if (session != CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      2|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (31:9): [True: 2, False: 0]
  ------------------
   32|      2|        rvSession = nss_ZNEW(arenaOpt, nssSession);
  ------------------
  |  |  348|      2|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
   33|      2|        if (rvSession) {
  ------------------
  |  Branch (33:13): [True: 2, False: 0]
  ------------------
   34|      2|            rvSession->handle = session;
   35|      2|            rvSession->lock = lock;
   36|      2|            rvSession->ownLock = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
   37|      2|            rvSession->isRW = rw;
   38|      2|        }
   39|      2|    }
   40|      2|    return rvSession;
   41|      2|}
nssToken_CreateFromPK11SlotInfo:
  132|      2|{
  133|      2|    NSSToken *rvToken;
  134|      2|    NSSArena *arena;
  135|       |
  136|       |    /* Don't create a token object for a disabled slot */
  137|      2|    if (nss3slot->disabled) {
  ------------------
  |  Branch (137:9): [True: 0, False: 2]
  ------------------
  138|      0|        PORT_SetError(SEC_ERROR_NO_TOKEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  139|      0|        return NULL;
  140|      0|    }
  141|      2|    arena = nssArena_Create();
  142|      2|    if (!arena) {
  ------------------
  |  Branch (142:9): [True: 0, False: 2]
  ------------------
  143|      0|        return NULL;
  144|      0|    }
  145|      2|    rvToken = nss_ZNEW(arena, NSSToken);
  ------------------
  |  |  348|      2|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  146|      2|    if (!rvToken) {
  ------------------
  |  Branch (146:9): [True: 0, False: 2]
  ------------------
  147|      0|        nssArena_Destroy(arena);
  148|      0|        return NULL;
  149|      0|    }
  150|      2|    rvToken->base.refCount = 1;
  151|      2|    rvToken->base.lock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  152|      2|    if (!rvToken->base.lock) {
  ------------------
  |  Branch (152:9): [True: 0, False: 2]
  ------------------
  153|      0|        nssArena_Destroy(arena);
  154|      0|        return NULL;
  155|      0|    }
  156|      2|    rvToken->base.arena = arena;
  157|      2|    rvToken->pk11slot = PK11_ReferenceSlot(nss3slot);
  158|      2|    rvToken->epv = nss3slot->functionList;
  159|      2|    rvToken->defaultSession = nssSession_ImportNSS3Session(td->arena,
  160|      2|                                                           nss3slot->session,
  161|      2|                                                           nss3slot->sessionLock,
  162|      2|                                                           nss3slot->defRWSession);
  163|       |#if 0 /* we should do this instead of blindly continuing. */
  164|       |    if (!rvToken->defaultSession) {
  165|       |    PORT_SetError(SEC_ERROR_NO_TOKEN);
  166|       |        goto loser;
  167|       |    }
  168|       |#endif
  169|      2|    if (!PK11_IsInternal(nss3slot) && PK11_IsHW(nss3slot)) {
  ------------------
  |  Branch (169:9): [True: 0, False: 2]
  |  Branch (169:39): [True: 0, False: 0]
  ------------------
  170|      0|        rvToken->cache = nssTokenObjectCache_Create(rvToken,
  171|      0|                                                    PR_TRUE, PR_TRUE, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                                                                  PR_TRUE, PR_TRUE, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                                                                  PR_TRUE, PR_TRUE, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  172|      0|        if (!rvToken->cache)
  ------------------
  |  Branch (172:13): [True: 0, False: 0]
  ------------------
  173|      0|            goto loser;
  174|      0|    }
  175|      2|    rvToken->trustDomain = td;
  176|       |    /* Grab the token name from the PKCS#11 fixed-length buffer */
  177|      2|    rvToken->base.name = nssUTF8_Duplicate(nss3slot->token_name, td->arena);
  178|      2|    rvToken->slot = nssSlot_CreateFromPK11SlotInfo(td, nss3slot);
  179|      2|    if (!rvToken->slot) {
  ------------------
  |  Branch (179:9): [True: 0, False: 2]
  ------------------
  180|      0|        goto loser;
  181|      0|    }
  182|      2|    if (rvToken->defaultSession)
  ------------------
  |  Branch (182:9): [True: 2, False: 0]
  ------------------
  183|      2|        rvToken->defaultSession->slot = rvToken->slot;
  184|      2|    return rvToken;
  185|      0|loser:
  186|      0|    PZ_DestroyLock(rvToken->base.lock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  187|      0|    nssArena_Destroy(arena);
  188|      0|    return NULL;
  189|      2|}
nssToken_UpdateName:
  193|      2|{
  194|      2|    if (!token) {
  ------------------
  |  Branch (194:9): [True: 2, False: 0]
  ------------------
  195|      2|        return;
  196|      2|    }
  197|      0|    token->base.name = nssUTF8_Duplicate(token->pk11slot->token_name, token->base.arena);
  198|      0|}
nssSlot_IsPermanent:
  202|  31.3k|{
  203|  31.3k|    return slot->pk11slot->isPerm;
  204|  31.3k|}
nssToken_Refresh:
  214|      2|{
  215|      2|    PK11SlotInfo *nss3slot;
  216|       |
  217|      2|    if (!token) {
  ------------------
  |  Branch (217:9): [True: 2, False: 0]
  ------------------
  218|      2|        return PR_SUCCESS;
  219|      2|    }
  220|      0|    nss3slot = token->pk11slot;
  221|      0|    token->defaultSession =
  222|      0|        nssSession_ImportNSS3Session(token->slot->base.arena,
  223|      0|                                     nss3slot->session,
  224|      0|                                     nss3slot->sessionLock,
  225|      0|                                     nss3slot->defRWSession);
  226|      0|    return token->defaultSession ? PR_SUCCESS : PR_FAILURE;
  ------------------
  |  Branch (226:12): [True: 0, False: 0]
  ------------------
  227|      2|}
dev3hack.c:nssSlot_CreateFromPK11SlotInfo:
  102|      2|{
  103|      2|    NSSSlot *rvSlot;
  104|      2|    NSSArena *arena;
  105|      2|    arena = nssArena_Create();
  106|      2|    if (!arena) {
  ------------------
  |  Branch (106:9): [True: 0, False: 2]
  ------------------
  107|      0|        return NULL;
  108|      0|    }
  109|      2|    rvSlot = nss_ZNEW(arena, NSSSlot);
  ------------------
  |  |  348|      2|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  110|      2|    if (!rvSlot) {
  ------------------
  |  Branch (110:9): [True: 0, False: 2]
  ------------------
  111|      0|        nssArena_Destroy(arena);
  112|      0|        return NULL;
  113|      0|    }
  114|      2|    rvSlot->base.refCount = 1;
  115|      2|    rvSlot->base.lock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  116|      2|    rvSlot->base.arena = arena;
  117|      2|    rvSlot->pk11slot = PK11_ReferenceSlot(nss3slot);
  118|      2|    rvSlot->epv = nss3slot->functionList;
  119|      2|    rvSlot->slotID = nss3slot->slotID;
  120|       |    /* Grab the slot name from the PKCS#11 fixed-length buffer */
  121|      2|    rvSlot->base.name = nssUTF8_Duplicate(nss3slot->slot_name, td->arena);
  122|      2|    rvSlot->lock = (nss3slot->isThreadSafe) ? NULL : nss3slot->sessionLock;
  ------------------
  |  Branch (122:20): [True: 2, False: 0]
  ------------------
  123|      2|    rvSlot->isPresentLock = PZ_NewLock(nssiLockOther);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  124|      2|    rvSlot->isPresentCondition = PR_NewCondVar(rvSlot->isPresentLock);
  125|      2|    rvSlot->isPresentThread = NULL;
  126|      2|    rvSlot->lastTokenPingState = nssSlotLastPingState_Reset;
  127|      2|    return rvSlot;
  128|      2|}

PK11_ImportPublicKey:
   72|  4.16k|{
   73|  4.16k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  4.16k|#define CK_TRUE 1
  ------------------
   74|  4.16k|    CK_BBOOL ckfalse = CK_FALSE;
  ------------------
  |  |   23|  4.16k|#define CK_FALSE 0
  ------------------
   75|  4.16k|    CK_OBJECT_CLASS keyClass = CKO_PUBLIC_KEY;
  ------------------
  |  |  327|  4.16k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
   76|  4.16k|    CK_KEY_TYPE keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|  4.16k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
   77|  4.16k|    CK_OBJECT_HANDLE objectID;
   78|  4.16k|    CK_ATTRIBUTE theTemplate[11];
   79|  4.16k|    CK_ATTRIBUTE *signedattr = NULL;
   80|  4.16k|    CK_ATTRIBUTE *attrs = theTemplate;
   81|  4.16k|    CK_NSS_KEM_PARAMETER_SET_TYPE kemParams;
   82|  4.16k|    SECItem *ckaId = NULL;
   83|  4.16k|    SECItem *pubValue = NULL;
   84|  4.16k|    int signedcount = 0;
   85|  4.16k|    unsigned int templateCount = 0;
   86|  4.16k|    SECStatus rv;
   87|       |
   88|       |    /* if we already have an object in the desired slot, use it */
   89|  4.16k|    if (!isToken && pubKey->pkcs11Slot == slot) {
  ------------------
  |  Branch (89:9): [True: 4.16k, False: 0]
  |  Branch (89:21): [True: 0, False: 4.16k]
  ------------------
   90|      0|        return pubKey->pkcs11ID;
   91|      0|    }
   92|       |
   93|       |    /* free the existing key */
   94|  4.16k|    if (pubKey->pkcs11Slot != NULL) {
  ------------------
  |  Branch (94:9): [True: 0, False: 4.16k]
  ------------------
   95|      0|        PK11SlotInfo *oSlot = pubKey->pkcs11Slot;
   96|      0|        if (!PK11_IsPermObject(pubKey->pkcs11Slot, pubKey->pkcs11ID)) {
  ------------------
  |  Branch (96:13): [True: 0, False: 0]
  ------------------
   97|      0|            PK11_EnterSlotMonitor(oSlot);
   98|      0|            (void)PK11_GETTAB(oSlot)->C_DestroyObject(oSlot->session,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
   99|      0|                                                      pubKey->pkcs11ID);
  100|      0|            PK11_ExitSlotMonitor(oSlot);
  101|      0|        }
  102|      0|        PK11_FreeSlot(oSlot);
  103|      0|        pubKey->pkcs11Slot = NULL;
  104|      0|    }
  105|  4.16k|    PK11_SETATTRS(attrs, CKA_CLASS, &keyClass, sizeof(keyClass));
  ------------------
  |  |  104|  4.16k|    (x)->type = (id);              \
  |  |  105|  4.16k|    (x)->pValue = (v);             \
  |  |  106|  4.16k|    (x)->ulValueLen = (l);
  ------------------
  106|  4.16k|    attrs++;
  107|  4.16k|    PK11_SETATTRS(attrs, CKA_KEY_TYPE, &keyType, sizeof(keyType));
  ------------------
  |  |  104|  4.16k|    (x)->type = (id);              \
  |  |  105|  4.16k|    (x)->pValue = (v);             \
  |  |  106|  4.16k|    (x)->ulValueLen = (l);
  ------------------
  108|  4.16k|    attrs++;
  109|  4.16k|    PK11_SETATTRS(attrs, CKA_TOKEN, isToken ? &cktrue : &ckfalse,
  ------------------
  |  |  104|  4.16k|    (x)->type = (id);              \
  |  |  105|  8.32k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 0, False: 4.16k]
  |  |  ------------------
  |  |  106|  4.16k|    (x)->ulValueLen = (l);
  ------------------
  110|  4.16k|                  sizeof(CK_BBOOL));
  111|  4.16k|    attrs++;
  112|  4.16k|    if (isToken) {
  ------------------
  |  Branch (112:9): [True: 0, False: 4.16k]
  ------------------
  113|      0|        ckaId = pk11_MakeIDFromPublicKey(pubKey);
  114|      0|        if (ckaId == NULL) {
  ------------------
  |  Branch (114:13): [True: 0, False: 0]
  ------------------
  115|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  116|      0|            return CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  117|      0|        }
  118|      0|        PK11_SETATTRS(attrs, CKA_ID, ckaId->data, ckaId->len);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  119|      0|        attrs++;
  120|      0|    }
  121|       |
  122|       |    /* now import the key */
  123|  4.16k|    {
  124|  4.16k|        switch (pubKey->keyType) {
  125|  2.92k|            case rsaKey:
  ------------------
  |  Branch (125:13): [True: 2.92k, False: 1.24k]
  ------------------
  126|  2.92k|                keyType = CKK_RSA;
  ------------------
  |  |  372|  2.92k|#define CKK_RSA 0x00000000UL
  ------------------
  127|  2.92k|                PK11_SETATTRS(attrs, CKA_WRAP, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|  2.92k|    (x)->type = (id);              \
  |  |  105|  2.92k|    (x)->pValue = (v);             \
  |  |  106|  2.92k|    (x)->ulValueLen = (l);
  ------------------
  128|  2.92k|                attrs++;
  129|  2.92k|                PK11_SETATTRS(attrs, CKA_ENCRYPT, &cktrue,
  ------------------
  |  |  104|  2.92k|    (x)->type = (id);              \
  |  |  105|  2.92k|    (x)->pValue = (v);             \
  |  |  106|  2.92k|    (x)->ulValueLen = (l);
  ------------------
  130|  2.92k|                              sizeof(CK_BBOOL));
  131|  2.92k|                attrs++;
  132|  2.92k|                PK11_SETATTRS(attrs, CKA_VERIFY, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|  2.92k|    (x)->type = (id);              \
  |  |  105|  2.92k|    (x)->pValue = (v);             \
  |  |  106|  2.92k|    (x)->ulValueLen = (l);
  ------------------
  133|  2.92k|                attrs++;
  134|  2.92k|                signedattr = attrs;
  135|  2.92k|                PK11_SETATTRS(attrs, CKA_MODULUS, pubKey->u.rsa.modulus.data,
  ------------------
  |  |  104|  2.92k|    (x)->type = (id);              \
  |  |  105|  2.92k|    (x)->pValue = (v);             \
  |  |  106|  2.92k|    (x)->ulValueLen = (l);
  ------------------
  136|  2.92k|                              pubKey->u.rsa.modulus.len);
  137|  2.92k|                attrs++;
  138|  2.92k|                PK11_SETATTRS(attrs, CKA_PUBLIC_EXPONENT,
  ------------------
  |  |  104|  2.92k|    (x)->type = (id);              \
  |  |  105|  2.92k|    (x)->pValue = (v);             \
  |  |  106|  2.92k|    (x)->ulValueLen = (l);
  ------------------
  139|  2.92k|                              pubKey->u.rsa.publicExponent.data,
  140|  2.92k|                              pubKey->u.rsa.publicExponent.len);
  141|  2.92k|                attrs++;
  142|  2.92k|                break;
  143|    918|            case dsaKey:
  ------------------
  |  Branch (143:13): [True: 918, False: 3.24k]
  ------------------
  144|    918|                keyType = CKK_DSA;
  ------------------
  |  |  373|    918|#define CKK_DSA 0x00000001UL
  ------------------
  145|    918|                PK11_SETATTRS(attrs, CKA_VERIFY, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|    918|    (x)->type = (id);              \
  |  |  105|    918|    (x)->pValue = (v);             \
  |  |  106|    918|    (x)->ulValueLen = (l);
  ------------------
  146|    918|                attrs++;
  147|    918|                signedattr = attrs;
  148|    918|                PK11_SETATTRS(attrs, CKA_PRIME, pubKey->u.dsa.params.prime.data,
  ------------------
  |  |  104|    918|    (x)->type = (id);              \
  |  |  105|    918|    (x)->pValue = (v);             \
  |  |  106|    918|    (x)->ulValueLen = (l);
  ------------------
  149|    918|                              pubKey->u.dsa.params.prime.len);
  150|    918|                attrs++;
  151|    918|                PK11_SETATTRS(attrs, CKA_SUBPRIME, pubKey->u.dsa.params.subPrime.data,
  ------------------
  |  |  104|    918|    (x)->type = (id);              \
  |  |  105|    918|    (x)->pValue = (v);             \
  |  |  106|    918|    (x)->ulValueLen = (l);
  ------------------
  152|    918|                              pubKey->u.dsa.params.subPrime.len);
  153|    918|                attrs++;
  154|    918|                PK11_SETATTRS(attrs, CKA_BASE, pubKey->u.dsa.params.base.data,
  ------------------
  |  |  104|    918|    (x)->type = (id);              \
  |  |  105|    918|    (x)->pValue = (v);             \
  |  |  106|    918|    (x)->ulValueLen = (l);
  ------------------
  155|    918|                              pubKey->u.dsa.params.base.len);
  156|    918|                attrs++;
  157|    918|                PK11_SETATTRS(attrs, CKA_VALUE, pubKey->u.dsa.publicValue.data,
  ------------------
  |  |  104|    918|    (x)->type = (id);              \
  |  |  105|    918|    (x)->pValue = (v);             \
  |  |  106|    918|    (x)->ulValueLen = (l);
  ------------------
  158|    918|                              pubKey->u.dsa.publicValue.len);
  159|    918|                attrs++;
  160|    918|                break;
  161|      0|            case fortezzaKey:
  ------------------
  |  Branch (161:13): [True: 0, False: 4.16k]
  ------------------
  162|      0|                keyType = CKK_DSA;
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
  163|      0|                PK11_SETATTRS(attrs, CKA_VERIFY, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  164|      0|                attrs++;
  165|      0|                signedattr = attrs;
  166|      0|                PK11_SETATTRS(attrs, CKA_PRIME, pubKey->u.fortezza.params.prime.data,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  167|      0|                              pubKey->u.fortezza.params.prime.len);
  168|      0|                attrs++;
  169|      0|                PK11_SETATTRS(attrs, CKA_SUBPRIME,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  170|      0|                              pubKey->u.fortezza.params.subPrime.data,
  171|      0|                              pubKey->u.fortezza.params.subPrime.len);
  172|      0|                attrs++;
  173|      0|                PK11_SETATTRS(attrs, CKA_BASE, pubKey->u.fortezza.params.base.data,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  174|      0|                              pubKey->u.fortezza.params.base.len);
  175|      0|                attrs++;
  176|      0|                PK11_SETATTRS(attrs, CKA_VALUE, pubKey->u.fortezza.DSSKey.data,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  177|      0|                              pubKey->u.fortezza.DSSKey.len);
  178|      0|                attrs++;
  179|      0|                break;
  180|      3|            case dhKey:
  ------------------
  |  Branch (180:13): [True: 3, False: 4.16k]
  ------------------
  181|      3|                keyType = CKK_DH;
  ------------------
  |  |  374|      3|#define CKK_DH 0x00000002UL
  ------------------
  182|      3|                PK11_SETATTRS(attrs, CKA_DERIVE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|      3|    (x)->type = (id);              \
  |  |  105|      3|    (x)->pValue = (v);             \
  |  |  106|      3|    (x)->ulValueLen = (l);
  ------------------
  183|      3|                attrs++;
  184|      3|                signedattr = attrs;
  185|      3|                PK11_SETATTRS(attrs, CKA_PRIME, pubKey->u.dh.prime.data,
  ------------------
  |  |  104|      3|    (x)->type = (id);              \
  |  |  105|      3|    (x)->pValue = (v);             \
  |  |  106|      3|    (x)->ulValueLen = (l);
  ------------------
  186|      3|                              pubKey->u.dh.prime.len);
  187|      3|                attrs++;
  188|      3|                PK11_SETATTRS(attrs, CKA_BASE, pubKey->u.dh.base.data,
  ------------------
  |  |  104|      3|    (x)->type = (id);              \
  |  |  105|      3|    (x)->pValue = (v);             \
  |  |  106|      3|    (x)->ulValueLen = (l);
  ------------------
  189|      3|                              pubKey->u.dh.base.len);
  190|      3|                attrs++;
  191|      3|                PK11_SETATTRS(attrs, CKA_VALUE, pubKey->u.dh.publicValue.data,
  ------------------
  |  |  104|      3|    (x)->type = (id);              \
  |  |  105|      3|    (x)->pValue = (v);             \
  |  |  106|      3|    (x)->ulValueLen = (l);
  ------------------
  192|      3|                              pubKey->u.dh.publicValue.len);
  193|      3|                attrs++;
  194|      3|                break;
  195|      0|            case edKey:
  ------------------
  |  Branch (195:13): [True: 0, False: 4.16k]
  ------------------
  196|      0|                keyType = CKK_EC_EDWARDS;
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  197|      0|                PK11_SETATTRS(attrs, CKA_VERIFY, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  198|      0|                attrs++;
  199|      0|                PK11_SETATTRS(attrs, CKA_EC_PARAMS,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  200|      0|                              pubKey->u.ec.DEREncodedParams.data,
  201|      0|                              pubKey->u.ec.DEREncodedParams.len);
  202|      0|                attrs++;
  203|      0|                PK11_SETATTRS(attrs, CKA_EC_POINT,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  204|      0|                              pubKey->u.ec.publicValue.data,
  205|      0|                              pubKey->u.ec.publicValue.len);
  206|      0|                attrs++;
  207|      0|                break;
  208|      0|            case ecMontKey:
  ------------------
  |  Branch (208:13): [True: 0, False: 4.16k]
  ------------------
  209|      0|                keyType = CKK_EC_MONTGOMERY;
  ------------------
  |  |  449|      0|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  210|      0|                PK11_SETATTRS(attrs, CKA_DERIVE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  211|      0|                attrs++;
  212|      0|                PK11_SETATTRS(attrs, CKA_EC_PARAMS,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  213|      0|                              pubKey->u.ec.DEREncodedParams.data,
  214|      0|                              pubKey->u.ec.DEREncodedParams.len);
  215|      0|                attrs++;
  216|      0|                PK11_SETATTRS(attrs, CKA_EC_POINT,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  217|      0|                              pubKey->u.ec.publicValue.data,
  218|      0|                              pubKey->u.ec.publicValue.len);
  219|      0|                attrs++;
  220|      0|                break;
  221|    322|            case ecKey:
  ------------------
  |  Branch (221:13): [True: 322, False: 3.84k]
  ------------------
  222|    322|                keyType = CKK_EC;
  ------------------
  |  |  379|    322|#define CKK_EC 0x00000003UL
  ------------------
  223|    322|                PK11_SETATTRS(attrs, CKA_VERIFY, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|    322|    (x)->type = (id);              \
  |  |  105|    322|    (x)->pValue = (v);             \
  |  |  106|    322|    (x)->ulValueLen = (l);
  ------------------
  224|    322|                attrs++;
  225|    322|                PK11_SETATTRS(attrs, CKA_DERIVE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|    322|    (x)->type = (id);              \
  |  |  105|    322|    (x)->pValue = (v);             \
  |  |  106|    322|    (x)->ulValueLen = (l);
  ------------------
  226|    322|                attrs++;
  227|    322|                PK11_SETATTRS(attrs, CKA_EC_PARAMS,
  ------------------
  |  |  104|    322|    (x)->type = (id);              \
  |  |  105|    322|    (x)->pValue = (v);             \
  |  |  106|    322|    (x)->ulValueLen = (l);
  ------------------
  228|    322|                              pubKey->u.ec.DEREncodedParams.data,
  229|    322|                              pubKey->u.ec.DEREncodedParams.len);
  230|    322|                attrs++;
  231|    322|                if (PR_GetEnvSecure("NSS_USE_DECODED_CKA_EC_POINT")) {
  ------------------
  |  Branch (231:21): [True: 0, False: 322]
  ------------------
  232|      0|                    PK11_SETATTRS(attrs, CKA_EC_POINT,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  233|      0|                                  pubKey->u.ec.publicValue.data,
  234|      0|                                  pubKey->u.ec.publicValue.len);
  235|      0|                    attrs++;
  236|    322|                } else {
  237|    322|                    pubValue = SEC_ASN1EncodeItem(NULL, NULL,
  ------------------
  |  |   89|    322|#define SEC_ASN1EncodeItem SEC_ASN1EncodeItem_Util
  ------------------
  238|    322|                                                  &pubKey->u.ec.publicValue,
  239|    322|                                                  SEC_ASN1_GET(SEC_OctetStringTemplate));
  ------------------
  |  |  188|    322|#define SEC_ASN1_GET(x) x
  ------------------
  240|    322|                    if (pubValue == NULL) {
  ------------------
  |  Branch (240:25): [True: 0, False: 322]
  ------------------
  241|      0|                        if (ckaId) {
  ------------------
  |  Branch (241:29): [True: 0, False: 0]
  ------------------
  242|      0|                            SECITEM_FreeItem(ckaId, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                                          SECITEM_FreeItem(ckaId, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  243|      0|                        }
  244|      0|                        return CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  245|      0|                    }
  246|    322|                    PK11_SETATTRS(attrs, CKA_EC_POINT,
  ------------------
  |  |  104|    322|    (x)->type = (id);              \
  |  |  105|    322|    (x)->pValue = (v);             \
  |  |  106|    322|    (x)->ulValueLen = (l);
  ------------------
  247|    322|                                  pubValue->data, pubValue->len);
  248|    322|                    attrs++;
  249|    322|                }
  250|    322|                break;
  251|    322|            case kyberKey:
  ------------------
  |  Branch (251:13): [True: 0, False: 4.16k]
  ------------------
  252|      0|                switch (pubKey->u.kyber.params) {
  253|      0|                    case params_kyber768_round3:
  ------------------
  |  Branch (253:21): [True: 0, False: 0]
  ------------------
  254|      0|                    case params_kyber768_round3_test_mode:
  ------------------
  |  Branch (254:21): [True: 0, False: 0]
  ------------------
  255|      0|                        keyType = CKK_NSS_KYBER;
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|      0|                        kemParams = CKP_NSS_KYBER_768_ROUND3;
  ------------------
  |  |  301|      0|#define CKP_NSS_KYBER_768_ROUND3 (CKP_NSS + 1)
  |  |  ------------------
  |  |  |  |  300|      0|#define CKP_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKP_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|      0|                        break;
  258|      0|                    case params_ml_kem768:
  ------------------
  |  Branch (258:21): [True: 0, False: 0]
  ------------------
  259|      0|                    case params_ml_kem768_test_mode:
  ------------------
  |  Branch (259:21): [True: 0, False: 0]
  ------------------
  260|      0|                        keyType = CKK_NSS_ML_KEM;
  ------------------
  |  |   59|      0|#define CKK_NSS_ML_KEM (CKK_NSS + 6)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  261|      0|                        kemParams = CKP_NSS_ML_KEM_768;
  ------------------
  |  |  302|      0|#define CKP_NSS_ML_KEM_768 (CKP_NSS + 2)
  |  |  ------------------
  |  |  |  |  300|      0|#define CKP_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKP_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|      0|                        break;
  263|      0|                    default:
  ------------------
  |  Branch (263:21): [True: 0, False: 0]
  ------------------
  264|      0|                        kemParams = CKP_INVALID_ID;
  ------------------
  |  |  345|      0|#define CKP_INVALID_ID 0x00000000UL
  ------------------
  265|      0|                        break;
  266|      0|                }
  267|      0|                PK11_SETATTRS(attrs, CKA_NSS_PARAMETER_SET,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  268|      0|                              &kemParams,
  269|      0|                              sizeof(CK_NSS_KEM_PARAMETER_SET_TYPE));
  270|      0|                attrs++;
  271|      0|                PK11_SETATTRS(attrs, CKA_VALUE, pubKey->u.kyber.publicValue.data,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  272|      0|                              pubKey->u.kyber.publicValue.len);
  273|      0|                attrs++;
  274|      0|                break;
  275|      0|            default:
  ------------------
  |  Branch (275:13): [True: 0, False: 4.16k]
  ------------------
  276|      0|                if (ckaId) {
  ------------------
  |  Branch (276:21): [True: 0, False: 0]
  ------------------
  277|      0|                    SECITEM_FreeItem(ckaId, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                                  SECITEM_FreeItem(ckaId, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  278|      0|                }
  279|      0|                PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  280|      0|                return CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  281|  4.16k|        }
  282|  4.16k|        templateCount = attrs - theTemplate;
  283|  4.16k|        PORT_Assert(templateCount <= (sizeof(theTemplate) / sizeof(CK_ATTRIBUTE)));
  ------------------
  |  |  120|  4.16k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.16k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.16k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|  4.16k|        if (pubKey->keyType != ecKey && pubKey->keyType != kyberKey && pubKey->keyType != edKey &&
  ------------------
  |  Branch (284:13): [True: 3.84k, False: 322]
  |  Branch (284:41): [True: 3.84k, False: 0]
  |  Branch (284:72): [True: 3.84k, False: 0]
  ------------------
  285|  4.16k|            pubKey->keyType != ecMontKey) {
  ------------------
  |  Branch (285:13): [True: 3.84k, False: 0]
  ------------------
  286|  3.84k|            PORT_Assert(signedattr);
  ------------------
  |  |  120|  3.84k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.84k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.84k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  287|  3.84k|            signedcount = attrs - signedattr;
  288|  13.3k|            for (attrs = signedattr; signedcount; attrs++, signedcount--) {
  ------------------
  |  Branch (288:38): [True: 9.52k, False: 3.84k]
  ------------------
  289|  9.52k|                pk11_SignedToUnsigned(attrs);
  290|  9.52k|            }
  291|  3.84k|        }
  292|  4.16k|        rv = PK11_CreateNewObject(slot, CK_INVALID_HANDLE, theTemplate,
  ------------------
  |  |   78|  4.16k|#define CK_INVALID_HANDLE 0
  ------------------
  293|  4.16k|                                  templateCount, isToken, &objectID);
  294|  4.16k|        if (ckaId) {
  ------------------
  |  Branch (294:13): [True: 0, False: 4.16k]
  ------------------
  295|      0|            SECITEM_FreeItem(ckaId, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                          SECITEM_FreeItem(ckaId, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  296|      0|        }
  297|  4.16k|        if (pubValue) {
  ------------------
  |  Branch (297:13): [True: 322, False: 3.84k]
  ------------------
  298|    322|            SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  108|    322|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                          SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  437|    322|#define PR_TRUE 1
  ------------------
  299|    322|        }
  300|  4.16k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (300:13): [True: 571, False: 3.59k]
  ------------------
  301|    571|            return CK_INVALID_HANDLE;
  ------------------
  |  |   78|    571|#define CK_INVALID_HANDLE 0
  ------------------
  302|    571|        }
  303|  4.16k|    }
  304|       |
  305|  3.59k|    pubKey->pkcs11ID = objectID;
  306|  3.59k|    pubKey->pkcs11Slot = PK11_ReferenceSlot(slot);
  307|       |
  308|  3.59k|    return objectID;
  309|  4.16k|}
PK11_ExtractPublicKey:
  648|  9.19k|{
  649|  9.19k|    CK_OBJECT_CLASS keyClass = CKO_PUBLIC_KEY;
  ------------------
  |  |  327|  9.19k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
  650|  9.19k|    PLArenaPool *arena;
  651|  9.19k|    PLArenaPool *tmp_arena;
  652|  9.19k|    SECKEYPublicKey *pubKey;
  653|  9.19k|    unsigned int templateCount = 0;
  654|  9.19k|    CK_KEY_TYPE pk11KeyType;
  655|  9.19k|    CK_RV crv;
  656|  9.19k|    CK_ATTRIBUTE template[8];
  657|  9.19k|    CK_ATTRIBUTE *attrs = template;
  658|  9.19k|    CK_ATTRIBUTE *modulus, *exponent, *base, *prime, *subprime, *value;
  659|  9.19k|    CK_ATTRIBUTE *ecparams, *kemParams;
  660|       |
  661|       |    /* if we didn't know the key type, get it */
  662|  9.19k|    if (keyType == nullKey) {
  ------------------
  |  Branch (662:9): [True: 0, False: 9.19k]
  ------------------
  663|       |
  664|      0|        pk11KeyType = PK11_ReadULongAttribute(slot, id, CKA_KEY_TYPE);
  ------------------
  |  |  543|      0|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
  665|      0|        if (pk11KeyType == CK_UNAVAILABLE_INFORMATION) {
  ------------------
  |  |   64|      0|#define CK_UNAVAILABLE_INFORMATION (~0UL)
  ------------------
  |  Branch (665:13): [True: 0, False: 0]
  ------------------
  666|      0|            return NULL;
  667|      0|        }
  668|      0|        switch (pk11KeyType) {
  669|      0|            case CKK_RSA:
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (669:13): [True: 0, False: 0]
  ------------------
  670|      0|                keyType = rsaKey;
  671|      0|                break;
  672|      0|            case CKK_DSA:
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (672:13): [True: 0, False: 0]
  ------------------
  673|      0|                keyType = dsaKey;
  674|      0|                break;
  675|      0|            case CKK_DH:
  ------------------
  |  |  374|      0|#define CKK_DH 0x00000002UL
  ------------------
  |  Branch (675:13): [True: 0, False: 0]
  ------------------
  676|      0|                keyType = dhKey;
  677|      0|                break;
  678|      0|            case CKK_EC:
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (678:13): [True: 0, False: 0]
  ------------------
  679|      0|                keyType = ecKey;
  680|      0|                break;
  681|      0|            case CKK_EC_MONTGOMERY:
  ------------------
  |  |  449|      0|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (681:13): [True: 0, False: 0]
  ------------------
  682|      0|                keyType = ecMontKey;
  683|      0|                break;
  684|      0|            case CKK_EC_EDWARDS:
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (684:13): [True: 0, False: 0]
  ------------------
  685|      0|                keyType = edKey;
  686|      0|                break;
  687|      0|            case CKK_NSS_KYBER:
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (687:13): [True: 0, False: 0]
  ------------------
  688|      0|            case CKK_NSS_ML_KEM:
  ------------------
  |  |   59|      0|#define CKK_NSS_ML_KEM (CKK_NSS + 6)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (688:13): [True: 0, False: 0]
  ------------------
  689|      0|                keyType = kyberKey;
  690|      0|                break;
  691|      0|            default:
  ------------------
  |  Branch (691:13): [True: 0, False: 0]
  ------------------
  692|      0|                PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  693|      0|                return NULL;
  694|      0|        }
  695|      0|    }
  696|       |
  697|       |    /* now we need to create space for the public key */
  698|  9.19k|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  9.19k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  9.19k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  699|  9.19k|    if (arena == NULL)
  ------------------
  |  Branch (699:9): [True: 0, False: 9.19k]
  ------------------
  700|      0|        return NULL;
  701|  9.19k|    tmp_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  9.19k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  tmp_arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  9.19k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  702|  9.19k|    if (tmp_arena == NULL) {
  ------------------
  |  Branch (702:9): [True: 0, False: 9.19k]
  ------------------
  703|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  704|      0|        return NULL;
  705|      0|    }
  706|       |
  707|  9.19k|    pubKey = (SECKEYPublicKey *)
  708|  9.19k|        PORT_ArenaZAlloc(arena, sizeof(SECKEYPublicKey));
  ------------------
  |  |   59|  9.19k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  709|  9.19k|    if (pubKey == NULL) {
  ------------------
  |  Branch (709:9): [True: 0, False: 9.19k]
  ------------------
  710|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  711|      0|        PORT_FreeArena(tmp_arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(tmp_arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  712|      0|        return NULL;
  713|      0|    }
  714|       |
  715|  9.19k|    pubKey->arena = arena;
  716|  9.19k|    pubKey->keyType = keyType;
  717|  9.19k|    pubKey->pkcs11Slot = PK11_ReferenceSlot(slot);
  718|  9.19k|    pubKey->pkcs11ID = id;
  719|  9.19k|    PK11_SETATTRS(attrs, CKA_CLASS, &keyClass,
  ------------------
  |  |  104|  9.19k|    (x)->type = (id);              \
  |  |  105|  9.19k|    (x)->pValue = (v);             \
  |  |  106|  9.19k|    (x)->ulValueLen = (l);
  ------------------
  720|  9.19k|                  sizeof(keyClass));
  721|  9.19k|    attrs++;
  722|  9.19k|    PK11_SETATTRS(attrs, CKA_KEY_TYPE, &pk11KeyType,
  ------------------
  |  |  104|  9.19k|    (x)->type = (id);              \
  |  |  105|  9.19k|    (x)->pValue = (v);             \
  |  |  106|  9.19k|    (x)->ulValueLen = (l);
  ------------------
  723|  9.19k|                  sizeof(pk11KeyType));
  724|  9.19k|    attrs++;
  725|  9.19k|    switch (pubKey->keyType) {
  726|      0|        case rsaKey:
  ------------------
  |  Branch (726:9): [True: 0, False: 9.19k]
  ------------------
  727|      0|            modulus = attrs;
  728|      0|            PK11_SETATTRS(attrs, CKA_MODULUS, NULL, 0);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  729|      0|            attrs++;
  730|      0|            exponent = attrs;
  731|      0|            PK11_SETATTRS(attrs, CKA_PUBLIC_EXPONENT, NULL, 0);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  732|      0|            attrs++;
  733|       |
  734|      0|            templateCount = attrs - template;
  735|      0|            PR_ASSERT(templateCount <= sizeof(template) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  736|      0|            crv = PK11_GetAttributes(tmp_arena, slot, id, template, templateCount);
  737|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (737:17): [True: 0, False: 0]
  ------------------
  738|      0|                break;
  739|       |
  740|      0|            if ((keyClass != CKO_PUBLIC_KEY) || (pk11KeyType != CKK_RSA)) {
  ------------------
  |  |  327|      0|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
                          if ((keyClass != CKO_PUBLIC_KEY) || (pk11KeyType != CKK_RSA)) {
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (740:17): [True: 0, False: 0]
  |  Branch (740:49): [True: 0, False: 0]
  ------------------
  741|      0|                crv = CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  742|      0|                break;
  743|      0|            }
  744|      0|            crv = pk11_Attr2SecItem(arena, modulus, &pubKey->u.rsa.modulus);
  745|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (745:17): [True: 0, False: 0]
  ------------------
  746|      0|                break;
  747|      0|            crv = pk11_Attr2SecItem(arena, exponent, &pubKey->u.rsa.publicExponent);
  748|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (748:17): [True: 0, False: 0]
  ------------------
  749|      0|                break;
  750|      0|            break;
  751|      0|        case dsaKey:
  ------------------
  |  Branch (751:9): [True: 0, False: 9.19k]
  ------------------
  752|      0|            prime = attrs;
  753|      0|            PK11_SETATTRS(attrs, CKA_PRIME, NULL, 0);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  754|      0|            attrs++;
  755|      0|            subprime = attrs;
  756|      0|            PK11_SETATTRS(attrs, CKA_SUBPRIME, NULL, 0);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  757|      0|            attrs++;
  758|      0|            base = attrs;
  759|      0|            PK11_SETATTRS(attrs, CKA_BASE, NULL, 0);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  760|      0|            attrs++;
  761|      0|            value = attrs;
  762|      0|            PK11_SETATTRS(attrs, CKA_VALUE, NULL, 0);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  763|      0|            attrs++;
  764|      0|            templateCount = attrs - template;
  765|      0|            PR_ASSERT(templateCount <= sizeof(template) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  766|      0|            crv = PK11_GetAttributes(tmp_arena, slot, id, template, templateCount);
  767|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (767:17): [True: 0, False: 0]
  ------------------
  768|      0|                break;
  769|       |
  770|      0|            if ((keyClass != CKO_PUBLIC_KEY) || (pk11KeyType != CKK_DSA)) {
  ------------------
  |  |  327|      0|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
                          if ((keyClass != CKO_PUBLIC_KEY) || (pk11KeyType != CKK_DSA)) {
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (770:17): [True: 0, False: 0]
  |  Branch (770:49): [True: 0, False: 0]
  ------------------
  771|      0|                crv = CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  772|      0|                break;
  773|      0|            }
  774|      0|            crv = pk11_Attr2SecItem(arena, prime, &pubKey->u.dsa.params.prime);
  775|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (775:17): [True: 0, False: 0]
  ------------------
  776|      0|                break;
  777|      0|            crv = pk11_Attr2SecItem(arena, subprime, &pubKey->u.dsa.params.subPrime);
  778|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (778:17): [True: 0, False: 0]
  ------------------
  779|      0|                break;
  780|      0|            crv = pk11_Attr2SecItem(arena, base, &pubKey->u.dsa.params.base);
  781|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (781:17): [True: 0, False: 0]
  ------------------
  782|      0|                break;
  783|      0|            crv = pk11_Attr2SecItem(arena, value, &pubKey->u.dsa.publicValue);
  784|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (784:17): [True: 0, False: 0]
  ------------------
  785|      0|                break;
  786|      0|            break;
  787|  1.29k|        case dhKey:
  ------------------
  |  Branch (787:9): [True: 1.29k, False: 7.90k]
  ------------------
  788|  1.29k|            prime = attrs;
  789|  1.29k|            PK11_SETATTRS(attrs, CKA_PRIME, NULL, 0);
  ------------------
  |  |  104|  1.29k|    (x)->type = (id);              \
  |  |  105|  1.29k|    (x)->pValue = (v);             \
  |  |  106|  1.29k|    (x)->ulValueLen = (l);
  ------------------
  790|  1.29k|            attrs++;
  791|  1.29k|            base = attrs;
  792|  1.29k|            PK11_SETATTRS(attrs, CKA_BASE, NULL, 0);
  ------------------
  |  |  104|  1.29k|    (x)->type = (id);              \
  |  |  105|  1.29k|    (x)->pValue = (v);             \
  |  |  106|  1.29k|    (x)->ulValueLen = (l);
  ------------------
  793|  1.29k|            attrs++;
  794|  1.29k|            value = attrs;
  795|  1.29k|            PK11_SETATTRS(attrs, CKA_VALUE, NULL, 0);
  ------------------
  |  |  104|  1.29k|    (x)->type = (id);              \
  |  |  105|  1.29k|    (x)->pValue = (v);             \
  |  |  106|  1.29k|    (x)->ulValueLen = (l);
  ------------------
  796|  1.29k|            attrs++;
  797|  1.29k|            templateCount = attrs - template;
  798|  1.29k|            PR_ASSERT(templateCount <= sizeof(template) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|  1.29k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1.29k, False: 0]
  |  |  ------------------
  ------------------
  799|  1.29k|            crv = PK11_GetAttributes(tmp_arena, slot, id, template, templateCount);
  800|  1.29k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.29k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (800:17): [True: 0, False: 1.29k]
  ------------------
  801|      0|                break;
  802|       |
  803|  1.29k|            if ((keyClass != CKO_PUBLIC_KEY) || (pk11KeyType != CKK_DH)) {
  ------------------
  |  |  327|  1.29k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
                          if ((keyClass != CKO_PUBLIC_KEY) || (pk11KeyType != CKK_DH)) {
  ------------------
  |  |  374|  1.29k|#define CKK_DH 0x00000002UL
  ------------------
  |  Branch (803:17): [True: 0, False: 1.29k]
  |  Branch (803:49): [True: 0, False: 1.29k]
  ------------------
  804|      0|                crv = CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  805|      0|                break;
  806|      0|            }
  807|  1.29k|            crv = pk11_Attr2SecItem(arena, prime, &pubKey->u.dh.prime);
  808|  1.29k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.29k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (808:17): [True: 0, False: 1.29k]
  ------------------
  809|      0|                break;
  810|  1.29k|            crv = pk11_Attr2SecItem(arena, base, &pubKey->u.dh.base);
  811|  1.29k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.29k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (811:17): [True: 0, False: 1.29k]
  ------------------
  812|      0|                break;
  813|  1.29k|            crv = pk11_Attr2SecItem(arena, value, &pubKey->u.dh.publicValue);
  814|  1.29k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.29k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (814:17): [True: 0, False: 1.29k]
  ------------------
  815|      0|                break;
  816|  1.29k|            break;
  817|  1.29k|        case edKey:
  ------------------
  |  Branch (817:9): [True: 0, False: 9.19k]
  ------------------
  818|  7.90k|        case ecKey:
  ------------------
  |  Branch (818:9): [True: 7.90k, False: 1.29k]
  ------------------
  819|  7.90k|        case ecMontKey:
  ------------------
  |  Branch (819:9): [True: 0, False: 9.19k]
  ------------------
  820|  7.90k|            pubKey->u.ec.size = 0;
  821|  7.90k|            ecparams = attrs;
  822|  7.90k|            PK11_SETATTRS(attrs, CKA_EC_PARAMS, NULL, 0);
  ------------------
  |  |  104|  7.90k|    (x)->type = (id);              \
  |  |  105|  7.90k|    (x)->pValue = (v);             \
  |  |  106|  7.90k|    (x)->ulValueLen = (l);
  ------------------
  823|  7.90k|            attrs++;
  824|  7.90k|            value = attrs;
  825|  7.90k|            PK11_SETATTRS(attrs, CKA_EC_POINT, NULL, 0);
  ------------------
  |  |  104|  7.90k|    (x)->type = (id);              \
  |  |  105|  7.90k|    (x)->pValue = (v);             \
  |  |  106|  7.90k|    (x)->ulValueLen = (l);
  ------------------
  826|  7.90k|            attrs++;
  827|  7.90k|            templateCount = attrs - template;
  828|  7.90k|            PR_ASSERT(templateCount <= sizeof(template) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|  7.90k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 7.90k, False: 0]
  |  |  ------------------
  ------------------
  829|  7.90k|            crv = PK11_GetAttributes(arena, slot, id, template, templateCount);
  830|  7.90k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  7.90k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (830:17): [True: 0, False: 7.90k]
  ------------------
  831|      0|                break;
  832|       |
  833|  7.90k|            if ((keyClass != CKO_PUBLIC_KEY) ||
  ------------------
  |  |  327|  7.90k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
  |  Branch (833:17): [True: 0, False: 7.90k]
  ------------------
  834|  7.90k|                (pubKey->keyType == ecKey && pk11KeyType != CKK_EC) ||
  ------------------
  |  |  379|  7.90k|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (834:18): [True: 7.90k, False: 0]
  |  Branch (834:46): [True: 0, False: 7.90k]
  ------------------
  835|  7.90k|                (pubKey->keyType == edKey && pk11KeyType != CKK_EC_EDWARDS) ||
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (835:18): [True: 0, False: 7.90k]
  |  Branch (835:46): [True: 0, False: 0]
  ------------------
  836|  7.90k|                (pubKey->keyType == ecMontKey && pk11KeyType != CKK_EC_MONTGOMERY)) {
  ------------------
  |  |  449|      0|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (836:18): [True: 0, False: 7.90k]
  |  Branch (836:50): [True: 0, False: 0]
  ------------------
  837|      0|                crv = CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  838|      0|                break;
  839|      0|            }
  840|       |
  841|  7.90k|            crv = pk11_Attr2SecItem(arena, ecparams,
  842|  7.90k|                                    &pubKey->u.ec.DEREncodedParams);
  843|  7.90k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  7.90k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (843:17): [True: 0, False: 7.90k]
  ------------------
  844|      0|                break;
  845|  7.90k|            pubKey->u.ec.encoding = ECPoint_Undefined;
  846|  7.90k|            crv = pk11_get_Decoded_ECPoint(arena,
  847|  7.90k|                                           &pubKey->u.ec.DEREncodedParams, value,
  848|  7.90k|                                           &pubKey->u.ec.publicValue);
  849|  7.90k|            break;
  850|      0|        case kyberKey:
  ------------------
  |  Branch (850:9): [True: 0, False: 9.19k]
  ------------------
  851|      0|            value = attrs;
  852|      0|            PK11_SETATTRS(attrs, CKA_VALUE, NULL, 0);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  853|      0|            attrs++;
  854|      0|            kemParams = attrs;
  855|      0|            PK11_SETATTRS(attrs, CKA_NSS_PARAMETER_SET, NULL, 0);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  856|      0|            attrs++;
  857|      0|            templateCount = attrs - template;
  858|      0|            PR_ASSERT(templateCount <= sizeof(template) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  859|       |
  860|      0|            crv = PK11_GetAttributes(arena, slot, id, template, templateCount);
  861|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (861:17): [True: 0, False: 0]
  ------------------
  862|      0|                break;
  863|       |
  864|      0|            if (keyClass != CKO_PUBLIC_KEY) {
  ------------------
  |  |  327|      0|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
  |  Branch (864:17): [True: 0, False: 0]
  ------------------
  865|      0|                crv = CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  866|      0|                break;
  867|      0|            }
  868|       |
  869|      0|            if (pk11KeyType != CKK_NSS_KYBER && pk11KeyType != CKK_NSS_ML_KEM) {
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if (pk11KeyType != CKK_NSS_KYBER && pk11KeyType != CKK_NSS_ML_KEM) {
  ------------------
  |  |   59|      0|#define CKK_NSS_ML_KEM (CKK_NSS + 6)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (869:17): [True: 0, False: 0]
  |  Branch (869:49): [True: 0, False: 0]
  ------------------
  870|      0|                crv = CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  871|      0|                break;
  872|      0|            }
  873|       |
  874|      0|            if (kemParams->ulValueLen != sizeof(CK_NSS_KEM_PARAMETER_SET_TYPE)) {
  ------------------
  |  Branch (874:17): [True: 0, False: 0]
  ------------------
  875|      0|                crv = CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  876|      0|                break;
  877|      0|            }
  878|      0|            CK_NSS_KEM_PARAMETER_SET_TYPE *pPK11Params = kemParams->pValue;
  879|      0|            switch (*pPK11Params) {
  880|      0|                case CKP_NSS_KYBER_768_ROUND3:
  ------------------
  |  |  301|      0|#define CKP_NSS_KYBER_768_ROUND3 (CKP_NSS + 1)
  |  |  ------------------
  |  |  |  |  300|      0|#define CKP_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKP_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (880:17): [True: 0, False: 0]
  ------------------
  881|      0|                    pubKey->u.kyber.params = params_kyber768_round3;
  882|      0|                    break;
  883|      0|                case CKP_NSS_ML_KEM_768:
  ------------------
  |  |  302|      0|#define CKP_NSS_ML_KEM_768 (CKP_NSS + 2)
  |  |  ------------------
  |  |  |  |  300|      0|#define CKP_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKP_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (883:17): [True: 0, False: 0]
  ------------------
  884|      0|                    pubKey->u.kyber.params = params_ml_kem768;
  885|      0|                    break;
  886|      0|                default:
  ------------------
  |  Branch (886:17): [True: 0, False: 0]
  ------------------
  887|      0|                    pubKey->u.kyber.params = params_kyber_invalid;
  888|      0|                    break;
  889|      0|            }
  890|      0|            crv = pk11_Attr2SecItem(arena, value, &pubKey->u.kyber.publicValue);
  891|      0|            break;
  892|      0|        case fortezzaKey:
  ------------------
  |  Branch (892:9): [True: 0, False: 9.19k]
  ------------------
  893|      0|        case nullKey:
  ------------------
  |  Branch (893:9): [True: 0, False: 9.19k]
  ------------------
  894|      0|        default:
  ------------------
  |  Branch (894:9): [True: 0, False: 9.19k]
  ------------------
  895|      0|            crv = CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  896|      0|            break;
  897|  9.19k|    }
  898|       |
  899|  9.19k|    PORT_FreeArena(tmp_arena, PR_FALSE);
  ------------------
  |  |   61|  9.19k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                  PORT_FreeArena(tmp_arena, PR_FALSE);
  ------------------
  |  |  438|  9.19k|#define PR_FALSE 0
  ------------------
  900|       |
  901|  9.19k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.19k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (901:9): [True: 0, False: 9.19k]
  ------------------
  902|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  903|      0|        PK11_FreeSlot(slot);
  904|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  905|      0|        return NULL;
  906|      0|    }
  907|       |
  908|  9.19k|    return pubKey;
  909|  9.19k|}
PK11_MakePrivKey:
  917|  9.19k|{
  918|  9.19k|    PLArenaPool *arena;
  919|  9.19k|    SECKEYPrivateKey *privKey;
  920|  9.19k|    PRBool isPrivate;
  921|  9.19k|    SECStatus rv;
  922|       |
  923|       |    /* don't know? look it up */
  924|  9.19k|    if (keyType == nullKey) {
  ------------------
  |  Branch (924:9): [True: 0, False: 9.19k]
  ------------------
  925|      0|        CK_KEY_TYPE pk11Type = CKK_RSA;
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  926|       |
  927|      0|        pk11Type = PK11_ReadULongAttribute(slot, privID, CKA_KEY_TYPE);
  ------------------
  |  |  543|      0|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
  928|      0|        isTemp = (PRBool)!PK11_HasAttributeSet(slot, privID, CKA_TOKEN, PR_FALSE);
  ------------------
  |  |  512|      0|#define CKA_TOKEN 0x00000001UL
  ------------------
                      isTemp = (PRBool)!PK11_HasAttributeSet(slot, privID, CKA_TOKEN, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  929|      0|        switch (pk11Type) {
  930|      0|            case CKK_RSA:
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (930:13): [True: 0, False: 0]
  ------------------
  931|      0|                keyType = rsaKey;
  932|      0|                break;
  933|      0|            case CKK_DSA:
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (933:13): [True: 0, False: 0]
  ------------------
  934|      0|                keyType = dsaKey;
  935|      0|                break;
  936|      0|            case CKK_DH:
  ------------------
  |  |  374|      0|#define CKK_DH 0x00000002UL
  ------------------
  |  Branch (936:13): [True: 0, False: 0]
  ------------------
  937|      0|                keyType = dhKey;
  938|      0|                break;
  939|      0|            case CKK_KEA:
  ------------------
  |  |  381|      0|#define CKK_KEA 0x00000005UL
  ------------------
  |  Branch (939:13): [True: 0, False: 0]
  ------------------
  940|      0|                keyType = fortezzaKey;
  941|      0|                break;
  942|      0|            case CKK_EC:
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (942:13): [True: 0, False: 0]
  ------------------
  943|      0|                keyType = ecKey;
  944|      0|                break;
  945|      0|            case CKK_EC_MONTGOMERY:
  ------------------
  |  |  449|      0|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (945:13): [True: 0, False: 0]
  ------------------
  946|      0|                keyType = ecMontKey;
  947|      0|                break;
  948|      0|            case CKK_EC_EDWARDS:
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (948:13): [True: 0, False: 0]
  ------------------
  949|      0|                keyType = edKey;
  950|      0|                break;
  951|      0|            case CKK_NSS_KYBER:
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (951:13): [True: 0, False: 0]
  ------------------
  952|      0|            case CKK_NSS_ML_KEM:
  ------------------
  |  |   59|      0|#define CKK_NSS_ML_KEM (CKK_NSS + 6)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (952:13): [True: 0, False: 0]
  ------------------
  953|      0|                keyType = kyberKey;
  954|      0|                break;
  955|      0|            default:
  ------------------
  |  Branch (955:13): [True: 0, False: 0]
  ------------------
  956|      0|                break;
  957|      0|        }
  958|      0|    }
  959|       |
  960|       |    /* if the key is private, make sure we are authenticated to the
  961|       |     * token before we try to use it */
  962|  9.19k|    isPrivate = (PRBool)PK11_HasAttributeSet(slot, privID, CKA_PRIVATE, PR_FALSE);
  ------------------
  |  |  513|  9.19k|#define CKA_PRIVATE 0x00000002UL
  ------------------
                  isPrivate = (PRBool)PK11_HasAttributeSet(slot, privID, CKA_PRIVATE, PR_FALSE);
  ------------------
  |  |  438|  9.19k|#define PR_FALSE 0
  ------------------
  963|  9.19k|    if (isPrivate) {
  ------------------
  |  Branch (963:9): [True: 0, False: 9.19k]
  ------------------
  964|      0|        rv = PK11_Authenticate(slot, PR_TRUE, wincx);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  965|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (965:13): [True: 0, False: 0]
  ------------------
  966|      0|            return NULL;
  967|      0|        }
  968|      0|    }
  969|       |
  970|       |    /* now we need to create space for the private key */
  971|  9.19k|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  9.19k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  9.19k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  972|  9.19k|    if (arena == NULL)
  ------------------
  |  Branch (972:9): [True: 0, False: 9.19k]
  ------------------
  973|      0|        return NULL;
  974|       |
  975|  9.19k|    privKey = (SECKEYPrivateKey *)
  976|  9.19k|        PORT_ArenaZAlloc(arena, sizeof(SECKEYPrivateKey));
  ------------------
  |  |   59|  9.19k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  977|  9.19k|    if (privKey == NULL) {
  ------------------
  |  Branch (977:9): [True: 0, False: 9.19k]
  ------------------
  978|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  979|      0|        return NULL;
  980|      0|    }
  981|       |
  982|  9.19k|    privKey->arena = arena;
  983|  9.19k|    privKey->keyType = keyType;
  984|  9.19k|    privKey->pkcs11Slot = PK11_ReferenceSlot(slot);
  985|  9.19k|    privKey->pkcs11ID = privID;
  986|  9.19k|    privKey->pkcs11IsTemp = isTemp;
  987|  9.19k|    privKey->wincx = wincx;
  988|       |
  989|  9.19k|    return privKey;
  990|  9.19k|}
PK11_GenerateKeyPairWithOpFlags:
 1278|  9.87k|{
 1279|       |    /* we have to use these native types because when we call PKCS 11 modules
 1280|       |     * we have to make sure that we are using the correct sizes for all the
 1281|       |     * parameters. */
 1282|  9.87k|    CK_BBOOL ckfalse = CK_FALSE;
  ------------------
  |  |   23|  9.87k|#define CK_FALSE 0
  ------------------
 1283|  9.87k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  9.87k|#define CK_TRUE 1
  ------------------
 1284|  9.87k|    CK_ULONG modulusBits;
 1285|  9.87k|    CK_BYTE publicExponent[4];
 1286|  9.87k|    CK_ATTRIBUTE privTemplate[] = {
 1287|  9.87k|        { CKA_SENSITIVE, NULL, 0 },
  ------------------
  |  |  546|  9.87k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
 1288|  9.87k|        { CKA_TOKEN, NULL, 0 },
  ------------------
  |  |  512|  9.87k|#define CKA_TOKEN 0x00000001UL
  ------------------
 1289|  9.87k|        { CKA_PRIVATE, NULL, 0 },
  ------------------
  |  |  513|  9.87k|#define CKA_PRIVATE 0x00000002UL
  ------------------
 1290|  9.87k|        { CKA_DERIVE, NULL, 0 },
  ------------------
  |  |  555|  9.87k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 1291|  9.87k|        { CKA_UNWRAP, NULL, 0 },
  ------------------
  |  |  550|  9.87k|#define CKA_UNWRAP 0x00000107UL
  ------------------
 1292|  9.87k|        { CKA_SIGN, NULL, 0 },
  ------------------
  |  |  551|  9.87k|#define CKA_SIGN 0x00000108UL
  ------------------
 1293|  9.87k|        { CKA_DECRYPT, NULL, 0 },
  ------------------
  |  |  548|  9.87k|#define CKA_DECRYPT 0x00000105UL
  ------------------
 1294|  9.87k|        { CKA_EXTRACTABLE, NULL, 0 },
  ------------------
  |  |  585|  9.87k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
 1295|  9.87k|        { CKA_MODIFIABLE, NULL, 0 },
  ------------------
  |  |  593|  9.87k|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
 1296|  9.87k|    };
 1297|  9.87k|    CK_ATTRIBUTE rsaPubTemplate[] = {
 1298|  9.87k|        { CKA_MODULUS_BITS, NULL, 0 },
  ------------------
  |  |  559|  9.87k|#define CKA_MODULUS_BITS 0x00000121UL
  ------------------
 1299|  9.87k|        { CKA_PUBLIC_EXPONENT, NULL, 0 },
  ------------------
  |  |  560|  9.87k|#define CKA_PUBLIC_EXPONENT 0x00000122UL
  ------------------
 1300|  9.87k|        { CKA_TOKEN, NULL, 0 },
  ------------------
  |  |  512|  9.87k|#define CKA_TOKEN 0x00000001UL
  ------------------
 1301|  9.87k|        { CKA_DERIVE, NULL, 0 },
  ------------------
  |  |  555|  9.87k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 1302|  9.87k|        { CKA_WRAP, NULL, 0 },
  ------------------
  |  |  549|  9.87k|#define CKA_WRAP 0x00000106UL
  ------------------
 1303|  9.87k|        { CKA_VERIFY, NULL, 0 },
  ------------------
  |  |  553|  9.87k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 1304|  9.87k|        { CKA_VERIFY_RECOVER, NULL, 0 },
  ------------------
  |  |  554|  9.87k|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
 1305|  9.87k|        { CKA_ENCRYPT, NULL, 0 },
  ------------------
  |  |  547|  9.87k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 1306|  9.87k|        { CKA_MODIFIABLE, NULL, 0 },
  ------------------
  |  |  593|  9.87k|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
 1307|  9.87k|    };
 1308|  9.87k|    CK_ATTRIBUTE dsaPubTemplate[] = {
 1309|  9.87k|        { CKA_PRIME, NULL, 0 },
  ------------------
  |  |  569|  9.87k|#define CKA_PRIME 0x00000130UL
  ------------------
 1310|  9.87k|        { CKA_SUBPRIME, NULL, 0 },
  ------------------
  |  |  570|  9.87k|#define CKA_SUBPRIME 0x00000131UL
  ------------------
 1311|  9.87k|        { CKA_BASE, NULL, 0 },
  ------------------
  |  |  571|  9.87k|#define CKA_BASE 0x00000132UL
  ------------------
 1312|  9.87k|        { CKA_TOKEN, NULL, 0 },
  ------------------
  |  |  512|  9.87k|#define CKA_TOKEN 0x00000001UL
  ------------------
 1313|  9.87k|        { CKA_DERIVE, NULL, 0 },
  ------------------
  |  |  555|  9.87k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 1314|  9.87k|        { CKA_WRAP, NULL, 0 },
  ------------------
  |  |  549|  9.87k|#define CKA_WRAP 0x00000106UL
  ------------------
 1315|  9.87k|        { CKA_VERIFY, NULL, 0 },
  ------------------
  |  |  553|  9.87k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 1316|  9.87k|        { CKA_VERIFY_RECOVER, NULL, 0 },
  ------------------
  |  |  554|  9.87k|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
 1317|  9.87k|        { CKA_ENCRYPT, NULL, 0 },
  ------------------
  |  |  547|  9.87k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 1318|  9.87k|        { CKA_MODIFIABLE, NULL, 0 },
  ------------------
  |  |  593|  9.87k|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
 1319|  9.87k|    };
 1320|  9.87k|    CK_ATTRIBUTE dhPubTemplate[] = {
 1321|  9.87k|        { CKA_PRIME, NULL, 0 },
  ------------------
  |  |  569|  9.87k|#define CKA_PRIME 0x00000130UL
  ------------------
 1322|  9.87k|        { CKA_BASE, NULL, 0 },
  ------------------
  |  |  571|  9.87k|#define CKA_BASE 0x00000132UL
  ------------------
 1323|  9.87k|        { CKA_TOKEN, NULL, 0 },
  ------------------
  |  |  512|  9.87k|#define CKA_TOKEN 0x00000001UL
  ------------------
 1324|  9.87k|        { CKA_DERIVE, NULL, 0 },
  ------------------
  |  |  555|  9.87k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 1325|  9.87k|        { CKA_WRAP, NULL, 0 },
  ------------------
  |  |  549|  9.87k|#define CKA_WRAP 0x00000106UL
  ------------------
 1326|  9.87k|        { CKA_VERIFY, NULL, 0 },
  ------------------
  |  |  553|  9.87k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 1327|  9.87k|        { CKA_VERIFY_RECOVER, NULL, 0 },
  ------------------
  |  |  554|  9.87k|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
 1328|  9.87k|        { CKA_ENCRYPT, NULL, 0 },
  ------------------
  |  |  547|  9.87k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 1329|  9.87k|        { CKA_MODIFIABLE, NULL, 0 },
  ------------------
  |  |  593|  9.87k|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
 1330|  9.87k|    };
 1331|  9.87k|    CK_ATTRIBUTE ecPubTemplate[] = {
 1332|  9.87k|        { CKA_EC_PARAMS, NULL, 0 },
  ------------------
  |  |  602|  9.87k|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
 1333|  9.87k|        { CKA_TOKEN, NULL, 0 },
  ------------------
  |  |  512|  9.87k|#define CKA_TOKEN 0x00000001UL
  ------------------
 1334|  9.87k|        { CKA_DERIVE, NULL, 0 },
  ------------------
  |  |  555|  9.87k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 1335|  9.87k|        { CKA_WRAP, NULL, 0 },
  ------------------
  |  |  549|  9.87k|#define CKA_WRAP 0x00000106UL
  ------------------
 1336|  9.87k|        { CKA_VERIFY, NULL, 0 },
  ------------------
  |  |  553|  9.87k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 1337|  9.87k|        { CKA_VERIFY_RECOVER, NULL, 0 },
  ------------------
  |  |  554|  9.87k|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
 1338|  9.87k|        { CKA_ENCRYPT, NULL, 0 },
  ------------------
  |  |  547|  9.87k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 1339|  9.87k|        { CKA_MODIFIABLE, NULL, 0 },
  ------------------
  |  |  593|  9.87k|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
 1340|  9.87k|    };
 1341|  9.87k|    SECKEYECParams *ecParams;
 1342|       |
 1343|  9.87k|    CK_ATTRIBUTE kyberPubTemplate[] = {
 1344|  9.87k|        { CKA_NSS_PARAMETER_SET, NULL, 0 },
  ------------------
  |  |  113|  9.87k|#define CKA_NSS_PARAMETER_SET (CKA_NSS + 40)
  |  |  ------------------
  |  |  |  |   77|  9.87k|#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  692|  9.87k|#define CKA_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  9.87k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1345|  9.87k|        { CKA_TOKEN, NULL, 0 },
  ------------------
  |  |  512|  9.87k|#define CKA_TOKEN 0x00000001UL
  ------------------
 1346|  9.87k|        { CKA_DERIVE, NULL, 0 },
  ------------------
  |  |  555|  9.87k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 1347|  9.87k|        { CKA_WRAP, NULL, 0 },
  ------------------
  |  |  549|  9.87k|#define CKA_WRAP 0x00000106UL
  ------------------
 1348|  9.87k|        { CKA_VERIFY, NULL, 0 },
  ------------------
  |  |  553|  9.87k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 1349|  9.87k|        { CKA_VERIFY_RECOVER, NULL, 0 },
  ------------------
  |  |  554|  9.87k|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
 1350|  9.87k|        { CKA_ENCRYPT, NULL, 0 },
  ------------------
  |  |  547|  9.87k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 1351|  9.87k|        { CKA_MODIFIABLE, NULL, 0 },
  ------------------
  |  |  593|  9.87k|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
 1352|  9.87k|    };
 1353|       |
 1354|       |    /*CK_ULONG key_size = 0;*/
 1355|  9.87k|    CK_ATTRIBUTE *pubTemplate;
 1356|  9.87k|    int privCount = 0;
 1357|  9.87k|    int pubCount = 0;
 1358|  9.87k|    PK11RSAGenParams *rsaParams;
 1359|  9.87k|    SECKEYPQGParams *dsaParams;
 1360|  9.87k|    SECKEYDHParams *dhParams;
 1361|  9.87k|    CK_NSS_KEM_PARAMETER_SET_TYPE *kemParams;
 1362|  9.87k|    CK_MECHANISM mechanism;
 1363|  9.87k|    CK_MECHANISM test_mech;
 1364|  9.87k|    CK_MECHANISM test_mech2;
 1365|  9.87k|    CK_SESSION_HANDLE session_handle;
 1366|  9.87k|    CK_RV crv;
 1367|  9.87k|    CK_OBJECT_HANDLE privID, pubID;
 1368|  9.87k|    SECKEYPrivateKey *privKey;
 1369|  9.87k|    KeyType keyType;
 1370|  9.87k|    PRBool restore;
 1371|  9.87k|    int peCount, i;
 1372|  9.87k|    CK_ATTRIBUTE *attrs;
 1373|  9.87k|    CK_ATTRIBUTE *privattrs;
 1374|  9.87k|    CK_ATTRIBUTE setTemplate;
 1375|  9.87k|    CK_MECHANISM_INFO mechanism_info;
 1376|  9.87k|    CK_OBJECT_CLASS keyClass;
 1377|  9.87k|    SECItem *cka_id;
 1378|  9.87k|    PRBool haslock = PR_FALSE;
  ------------------
  |  |  438|  9.87k|#define PR_FALSE 0
  ------------------
 1379|  9.87k|    PRBool pubIsToken = PR_FALSE;
  ------------------
  |  |  438|  9.87k|#define PR_FALSE 0
  ------------------
 1380|  9.87k|    PRBool token = ((attrFlags & PK11_ATTR_TOKEN) != 0);
  ------------------
  |  |  194|  9.87k|#define PK11_ATTR_TOKEN 0x00000001L
  ------------------
 1381|       |    /* subset of attrFlags applicable to the public key */
 1382|  9.87k|    PK11AttrFlags pubKeyAttrFlags = attrFlags &
 1383|  9.87k|                                    (PK11_ATTR_TOKEN | PK11_ATTR_SESSION | PK11_ATTR_MODIFIABLE | PK11_ATTR_UNMODIFIABLE);
  ------------------
  |  |  194|  9.87k|#define PK11_ATTR_TOKEN 0x00000001L
  ------------------
                                                  (PK11_ATTR_TOKEN | PK11_ATTR_SESSION | PK11_ATTR_MODIFIABLE | PK11_ATTR_UNMODIFIABLE);
  ------------------
  |  |  195|  9.87k|#define PK11_ATTR_SESSION 0x00000002L
  ------------------
                                                  (PK11_ATTR_TOKEN | PK11_ATTR_SESSION | PK11_ATTR_MODIFIABLE | PK11_ATTR_UNMODIFIABLE);
  ------------------
  |  |  235|  9.87k|#define PK11_ATTR_MODIFIABLE 0x00000010L
  ------------------
                                                  (PK11_ATTR_TOKEN | PK11_ATTR_SESSION | PK11_ATTR_MODIFIABLE | PK11_ATTR_UNMODIFIABLE);
  ------------------
  |  |  236|  9.87k|#define PK11_ATTR_UNMODIFIABLE 0x00000020L
  ------------------
 1384|       |
 1385|  9.87k|    if (pk11_BadAttrFlags(attrFlags)) {
  ------------------
  |  Branch (1385:9): [True: 0, False: 9.87k]
  ------------------
 1386|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1387|      0|        return NULL;
 1388|      0|    }
 1389|       |
 1390|  9.87k|    if (!param) {
  ------------------
  |  Branch (1390:9): [True: 0, False: 9.87k]
  ------------------
 1391|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1392|      0|        return NULL;
 1393|      0|    }
 1394|       |
 1395|       |    /*
 1396|       |     * The opFlags and opFlagMask parameters allow us to control the
 1397|       |     * settings of the key usage attributes (CKA_ENCRYPT and friends).
 1398|       |     * opFlagMask is set to one if the flag is specified in opFlags and
 1399|       |     *  zero if it is to take on a default value calculated by
 1400|       |     *  PK11_GenerateKeyPairWithOpFlags.
 1401|       |     * opFlags specifies the actual value of the flag 1 or 0.
 1402|       |     *   Bits not corresponding to one bits in opFlagMask should be zero.
 1403|       |     */
 1404|       |
 1405|       |    /* if we are trying to turn on a flag, it better be in the mask */
 1406|  9.87k|    PORT_Assert((opFlags & ~opFlagsMask) == 0);
  ------------------
  |  |  120|  9.87k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  9.87k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 9.87k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1407|  9.87k|    opFlags &= opFlagsMask;
 1408|       |
 1409|  9.87k|    PORT_Assert(slot != NULL);
  ------------------
  |  |  120|  9.87k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  9.87k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 9.87k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1410|  9.87k|    if (slot == NULL) {
  ------------------
  |  Branch (1410:9): [True: 0, False: 9.87k]
  ------------------
 1411|      0|        PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1412|      0|        return NULL;
 1413|      0|    }
 1414|       |
 1415|       |    /* if our slot really doesn't do this mechanism, Generate the key
 1416|       |     * in our internal token and write it out */
 1417|  9.87k|    if (!PK11_DoesMechanism(slot, type)) {
  ------------------
  |  Branch (1417:9): [True: 0, False: 9.87k]
  ------------------
 1418|      0|        PK11SlotInfo *int_slot = PK11_GetInternalSlot();
 1419|       |
 1420|       |        /* don't loop forever looking for a slot */
 1421|      0|        if (slot == int_slot) {
  ------------------
  |  Branch (1421:13): [True: 0, False: 0]
  ------------------
 1422|      0|            PK11_FreeSlot(int_slot);
 1423|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1424|      0|            return NULL;
 1425|      0|        }
 1426|       |
 1427|       |        /* if there isn't a suitable slot, then we can't do the keygen */
 1428|      0|        if (int_slot == NULL) {
  ------------------
  |  Branch (1428:13): [True: 0, False: 0]
  ------------------
 1429|      0|            PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1430|      0|            return NULL;
 1431|      0|        }
 1432|       |
 1433|       |        /* generate the temporary key to load */
 1434|      0|        privKey = PK11_GenerateKeyPair(int_slot, type, param, pubKey, PR_FALSE,
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1435|      0|                                       PR_FALSE, wincx);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1436|      0|        PK11_FreeSlot(int_slot);
 1437|       |
 1438|       |        /* if successful, load the temp key into the new token */
 1439|      0|        if (privKey != NULL) {
  ------------------
  |  Branch (1439:13): [True: 0, False: 0]
  ------------------
 1440|      0|            SECKEYPrivateKey *newPrivKey = pk11_loadPrivKeyWithFlags(slot,
 1441|      0|                                                                     privKey, *pubKey, attrFlags);
 1442|      0|            SECKEY_DestroyPrivateKey(privKey);
 1443|      0|            if (newPrivKey == NULL) {
  ------------------
  |  Branch (1443:17): [True: 0, False: 0]
  ------------------
 1444|      0|                SECKEY_DestroyPublicKey(*pubKey);
 1445|      0|                *pubKey = NULL;
 1446|      0|            }
 1447|      0|            return newPrivKey;
 1448|      0|        }
 1449|      0|        return NULL;
 1450|      0|    }
 1451|       |
 1452|  9.87k|    mechanism.mechanism = type;
 1453|  9.87k|    mechanism.pParameter = NULL;
 1454|  9.87k|    mechanism.ulParameterLen = 0;
 1455|  9.87k|    test_mech.pParameter = NULL;
 1456|  9.87k|    test_mech.ulParameterLen = 0;
 1457|  9.87k|    test_mech2.mechanism = CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|  9.87k|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
 1458|  9.87k|    test_mech2.pParameter = NULL;
 1459|  9.87k|    test_mech2.ulParameterLen = 0;
 1460|       |
 1461|       |    /* set up the private key template */
 1462|  9.87k|    privattrs = privTemplate;
 1463|  9.87k|    privattrs += pk11_AttrFlagsToAttributes(attrFlags, privattrs,
 1464|  9.87k|                                            &cktrue, &ckfalse);
 1465|       |
 1466|       |    /* set up the mechanism specific info */
 1467|  9.87k|    switch (type) {
 1468|      0|        case CKM_RSA_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  719|      0|#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL
  ------------------
  |  Branch (1468:9): [True: 0, False: 9.87k]
  ------------------
 1469|      0|        case CKM_RSA_X9_31_KEY_PAIR_GEN:
  ------------------
  |  |  738|      0|#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000AUL
  ------------------
  |  Branch (1469:9): [True: 0, False: 9.87k]
  ------------------
 1470|      0|            rsaParams = (PK11RSAGenParams *)param;
 1471|      0|            if (rsaParams->pe == 0) {
  ------------------
  |  Branch (1471:17): [True: 0, False: 0]
  ------------------
 1472|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1473|      0|                return NULL;
 1474|      0|            }
 1475|      0|            modulusBits = rsaParams->keySizeInBits;
 1476|      0|            peCount = 0;
 1477|       |
 1478|       |            /* convert pe to a PKCS #11 string */
 1479|      0|            for (i = 0; i < 4; i++) {
  ------------------
  |  Branch (1479:25): [True: 0, False: 0]
  ------------------
 1480|      0|                if (peCount || (rsaParams->pe &
  ------------------
  |  Branch (1480:21): [True: 0, False: 0]
  |  Branch (1480:32): [True: 0, False: 0]
  ------------------
 1481|      0|                                ((unsigned long)0xff000000L >> (i * 8)))) {
 1482|      0|                    publicExponent[peCount] =
 1483|      0|                        (CK_BYTE)((rsaParams->pe >> (3 - i) * 8) & 0xff);
 1484|      0|                    peCount++;
 1485|      0|                }
 1486|      0|            }
 1487|      0|            PORT_Assert(peCount != 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1488|      0|            attrs = rsaPubTemplate;
 1489|      0|            PK11_SETATTRS(attrs, CKA_MODULUS_BITS,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1490|      0|                          &modulusBits, sizeof(modulusBits));
 1491|      0|            attrs++;
 1492|      0|            PK11_SETATTRS(attrs, CKA_PUBLIC_EXPONENT,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1493|      0|                          publicExponent, peCount);
 1494|      0|            attrs++;
 1495|      0|            pubTemplate = rsaPubTemplate;
 1496|      0|            keyType = rsaKey;
 1497|      0|            test_mech.mechanism = CKM_RSA_PKCS;
  ------------------
  |  |  720|      0|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
 1498|      0|            break;
 1499|      0|        case CKM_DSA_KEY_PAIR_GEN:
  ------------------
  |  |  744|      0|#define CKM_DSA_KEY_PAIR_GEN 0x00000010UL
  ------------------
  |  Branch (1499:9): [True: 0, False: 9.87k]
  ------------------
 1500|      0|            dsaParams = (SECKEYPQGParams *)param;
 1501|      0|            attrs = dsaPubTemplate;
 1502|      0|            PK11_SETATTRS(attrs, CKA_PRIME, dsaParams->prime.data,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1503|      0|                          dsaParams->prime.len);
 1504|      0|            attrs++;
 1505|      0|            PK11_SETATTRS(attrs, CKA_SUBPRIME, dsaParams->subPrime.data,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1506|      0|                          dsaParams->subPrime.len);
 1507|      0|            attrs++;
 1508|      0|            PK11_SETATTRS(attrs, CKA_BASE, dsaParams->base.data,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1509|      0|                          dsaParams->base.len);
 1510|      0|            attrs++;
 1511|      0|            pubTemplate = dsaPubTemplate;
 1512|      0|            keyType = dsaKey;
 1513|      0|            test_mech.mechanism = CKM_DSA;
  ------------------
  |  |  745|      0|#define CKM_DSA 0x00000011UL
  ------------------
 1514|      0|            break;
 1515|  1.91k|        case CKM_DH_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  758|  1.91k|#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
  ------------------
  |  Branch (1515:9): [True: 1.91k, False: 7.96k]
  ------------------
 1516|  1.91k|            dhParams = (SECKEYDHParams *)param;
 1517|  1.91k|            attrs = dhPubTemplate;
 1518|  1.91k|            PK11_SETATTRS(attrs, CKA_PRIME, dhParams->prime.data,
  ------------------
  |  |  104|  1.91k|    (x)->type = (id);              \
  |  |  105|  1.91k|    (x)->pValue = (v);             \
  |  |  106|  1.91k|    (x)->ulValueLen = (l);
  ------------------
 1519|  1.91k|                          dhParams->prime.len);
 1520|  1.91k|            attrs++;
 1521|  1.91k|            PK11_SETATTRS(attrs, CKA_BASE, dhParams->base.data,
  ------------------
  |  |  104|  1.91k|    (x)->type = (id);              \
  |  |  105|  1.91k|    (x)->pValue = (v);             \
  |  |  106|  1.91k|    (x)->ulValueLen = (l);
  ------------------
 1522|  1.91k|                          dhParams->base.len);
 1523|  1.91k|            attrs++;
 1524|  1.91k|            pubTemplate = dhPubTemplate;
 1525|  1.91k|            keyType = dhKey;
 1526|  1.91k|            test_mech.mechanism = CKM_DH_PKCS_DERIVE;
  ------------------
  |  |  759|  1.91k|#define CKM_DH_PKCS_DERIVE 0x00000021UL
  ------------------
 1527|  1.91k|            break;
 1528|      0|        case CKM_EC_KEY_PAIR_GEN:
  ------------------
  |  | 1072|      0|#define CKM_EC_KEY_PAIR_GEN 0x00001040UL
  ------------------
  |  Branch (1528:9): [True: 0, False: 9.87k]
  ------------------
 1529|  7.96k|        case CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN:
  ------------------
  |  |  274|  7.96k|#define CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN (CKM_NSS + 47)
  |  |  ------------------
  |  |  |  |  162|  7.96k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  7.96k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  7.96k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1529:9): [True: 7.96k, False: 1.91k]
  ------------------
 1530|  7.96k|            ecParams = (SECKEYECParams *)param;
 1531|  7.96k|            attrs = ecPubTemplate;
 1532|  7.96k|            PK11_SETATTRS(attrs, CKA_EC_PARAMS, ecParams->data,
  ------------------
  |  |  104|  7.96k|    (x)->type = (id);              \
  |  |  105|  7.96k|    (x)->pValue = (v);             \
  |  |  106|  7.96k|    (x)->ulValueLen = (l);
  ------------------
 1533|  7.96k|                          ecParams->len);
 1534|  7.96k|            attrs++;
 1535|  7.96k|            pubTemplate = ecPubTemplate;
 1536|  7.96k|            keyType = ecKey;
 1537|       |            /*
 1538|       |             * ECC supports 2 different mechanism types (unlike RSA, which
 1539|       |             * supports different usages with the same mechanism).
 1540|       |             * We may need to query both mechanism types and or the results
 1541|       |             * together -- but we only do that if either the user has
 1542|       |             * requested both usages, or not specified any usages.
 1543|       |             */
 1544|  7.96k|            if ((opFlags & (CKF_SIGN | CKF_DERIVE)) == (CKF_SIGN | CKF_DERIVE)) {
  ------------------
  |  | 1356|  7.96k|#define CKF_SIGN 0x00000800UL
  ------------------
                          if ((opFlags & (CKF_SIGN | CKF_DERIVE)) == (CKF_SIGN | CKF_DERIVE)) {
  ------------------
  |  | 1364|  7.96k|#define CKF_DERIVE 0x00080000UL
  ------------------
                          if ((opFlags & (CKF_SIGN | CKF_DERIVE)) == (CKF_SIGN | CKF_DERIVE)) {
  ------------------
  |  | 1356|  7.96k|#define CKF_SIGN 0x00000800UL
  ------------------
                          if ((opFlags & (CKF_SIGN | CKF_DERIVE)) == (CKF_SIGN | CKF_DERIVE)) {
  ------------------
  |  | 1364|  7.96k|#define CKF_DERIVE 0x00080000UL
  ------------------
  |  Branch (1544:17): [True: 0, False: 7.96k]
  ------------------
 1545|       |                /* We've explicitly turned on both flags, use both mechanism */
 1546|      0|                test_mech.mechanism = CKM_ECDH1_DERIVE;
  ------------------
  |  | 1086|      0|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
 1547|      0|                test_mech2.mechanism = CKM_ECDSA;
  ------------------
  |  | 1074|      0|#define CKM_ECDSA 0x00001041UL
  ------------------
 1548|  7.96k|            } else if (opFlags & CKF_SIGN) {
  ------------------
  |  | 1356|  7.96k|#define CKF_SIGN 0x00000800UL
  ------------------
  |  Branch (1548:24): [True: 0, False: 7.96k]
  ------------------
 1549|       |                /* just do signing */
 1550|      0|                test_mech.mechanism = CKM_ECDSA;
  ------------------
  |  | 1074|      0|#define CKM_ECDSA 0x00001041UL
  ------------------
 1551|  7.96k|            } else if (opFlags & CKF_DERIVE) {
  ------------------
  |  | 1364|  7.96k|#define CKF_DERIVE 0x00080000UL
  ------------------
  |  Branch (1551:24): [True: 7.96k, False: 0]
  ------------------
 1552|       |                /* just do ECDH */
 1553|  7.96k|                test_mech.mechanism = CKM_ECDH1_DERIVE;
  ------------------
  |  | 1086|  7.96k|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
 1554|  7.96k|            } else {
 1555|       |                /* neither was specified default to both */
 1556|      0|                test_mech.mechanism = CKM_ECDH1_DERIVE;
  ------------------
  |  | 1086|      0|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
 1557|      0|                test_mech2.mechanism = CKM_ECDSA;
  ------------------
  |  | 1074|      0|#define CKM_ECDSA 0x00001041UL
  ------------------
 1558|      0|            }
 1559|  7.96k|            break;
 1560|      0|        case CKM_NSS_KYBER_KEY_PAIR_GEN:
  ------------------
  |  |  267|      0|#define CKM_NSS_KYBER_KEY_PAIR_GEN (CKM_NSS + 45)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1560:9): [True: 0, False: 9.87k]
  ------------------
 1561|      0|            kemParams = (CK_NSS_KEM_PARAMETER_SET_TYPE *)param;
 1562|      0|            attrs = kyberPubTemplate;
 1563|      0|            PK11_SETATTRS(attrs, CKA_NSS_PARAMETER_SET,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1564|      0|                          kemParams,
 1565|      0|                          sizeof(CK_NSS_KEM_PARAMETER_SET_TYPE));
 1566|      0|            attrs++;
 1567|      0|            pubTemplate = kyberPubTemplate;
 1568|      0|            keyType = kyberKey;
 1569|      0|            test_mech.mechanism = CKM_NSS_KYBER;
  ------------------
  |  |  268|      0|#define CKM_NSS_KYBER (CKM_NSS + 46)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1570|      0|            break;
 1571|      0|        case CKM_NSS_ML_KEM_KEY_PAIR_GEN:
  ------------------
  |  |  277|      0|#define CKM_NSS_ML_KEM_KEY_PAIR_GEN (CKM_NSS + 48)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1571:9): [True: 0, False: 9.87k]
  ------------------
 1572|      0|            kemParams = (CK_NSS_KEM_PARAMETER_SET_TYPE *)param;
 1573|      0|            attrs = kyberPubTemplate;
 1574|      0|            PK11_SETATTRS(attrs, CKA_NSS_PARAMETER_SET,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1575|      0|                          kemParams,
 1576|      0|                          sizeof(CK_NSS_KEM_PARAMETER_SET_TYPE));
 1577|      0|            attrs++;
 1578|      0|            pubTemplate = kyberPubTemplate;
 1579|      0|            keyType = kyberKey;
 1580|      0|            test_mech.mechanism = CKM_NSS_ML_KEM;
  ------------------
  |  |  278|      0|#define CKM_NSS_ML_KEM (CKM_NSS + 49)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1581|      0|            break;
 1582|      0|        case CKM_EC_MONTGOMERY_KEY_PAIR_GEN:
  ------------------
  |  | 1173|      0|#define CKM_EC_MONTGOMERY_KEY_PAIR_GEN 0x00001056UL
  ------------------
  |  Branch (1582:9): [True: 0, False: 9.87k]
  ------------------
 1583|      0|            ecParams = (SECKEYECParams *)param;
 1584|      0|            attrs = ecPubTemplate;
 1585|      0|            PK11_SETATTRS(attrs, CKA_EC_PARAMS, ecParams->data,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1586|      0|                          ecParams->len);
 1587|      0|            attrs++;
 1588|      0|            pubTemplate = ecPubTemplate;
 1589|      0|            keyType = ecMontKey;
 1590|      0|            test_mech.mechanism = CKM_ECDH1_DERIVE;
  ------------------
  |  | 1086|      0|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
 1591|      0|            break;
 1592|      0|        case CKM_EC_EDWARDS_KEY_PAIR_GEN:
  ------------------
  |  | 1172|      0|#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL
  ------------------
  |  Branch (1592:9): [True: 0, False: 9.87k]
  ------------------
 1593|      0|            ecParams = (SECKEYECParams *)param;
 1594|      0|            attrs = ecPubTemplate;
 1595|      0|            PK11_SETATTRS(attrs, CKA_EC_PARAMS, ecParams->data,
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1596|      0|                          ecParams->len);
 1597|      0|            attrs++;
 1598|      0|            pubTemplate = ecPubTemplate;
 1599|      0|            keyType = edKey;
 1600|      0|            test_mech.mechanism = CKM_EDDSA;
  ------------------
  |  | 1174|      0|#define CKM_EDDSA 0x00001057UL
  ------------------
 1601|      0|            break;
 1602|      0|        default:
  ------------------
  |  Branch (1602:9): [True: 0, False: 9.87k]
  ------------------
 1603|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1604|      0|            return NULL;
 1605|  9.87k|    }
 1606|       |
 1607|       |    /* now query the slot to find out how "good" a key we can generate */
 1608|  9.87k|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (1608:9): [True: 0, False: 9.87k]
  ------------------
 1609|      0|        PK11_EnterSlotMonitor(slot);
 1610|  9.87k|    crv = PK11_GETTAB(slot)->C_GetMechanismInfo(slot->slotID,
  ------------------
  |  |  102|  9.87k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1611|  9.87k|                                                test_mech.mechanism, &mechanism_info);
 1612|       |    /*
 1613|       |     * EC keys are used in multiple different types of mechanism, if we
 1614|       |     * are using dual use keys, we need to query the second mechanism
 1615|       |     * as well.
 1616|       |     */
 1617|  9.87k|    if (test_mech2.mechanism != CKM_INVALID_MECHANISM) {
  ------------------
  |  |  155|  9.87k|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  |  Branch (1617:9): [True: 0, False: 9.87k]
  ------------------
 1618|      0|        CK_MECHANISM_INFO mechanism_info2;
 1619|      0|        CK_RV crv2;
 1620|       |
 1621|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1621:13): [True: 0, False: 0]
  ------------------
 1622|       |            /* the first failed, make sure there is no trash in the
 1623|       |             * mechanism flags when we or it below */
 1624|      0|            mechanism_info.flags = 0;
 1625|      0|        }
 1626|      0|        crv2 = PK11_GETTAB(slot)->C_GetMechanismInfo(slot->slotID,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1627|      0|                                                     test_mech2.mechanism, &mechanism_info2);
 1628|      0|        if (crv2 == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1628:13): [True: 0, False: 0]
  ------------------
 1629|      0|            crv = CKR_OK; /* succeed if either mechnaism info succeeds */
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
 1630|       |            /* combine the 2 sets of mechnanism flags */
 1631|      0|            mechanism_info.flags |= mechanism_info2.flags;
 1632|      0|        }
 1633|      0|    }
 1634|  9.87k|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (1634:9): [True: 0, False: 9.87k]
  ------------------
 1635|      0|        PK11_ExitSlotMonitor(slot);
 1636|  9.87k|    if ((crv != CKR_OK) || (mechanism_info.flags == 0)) {
  ------------------
  |  | 1388|  9.87k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1636:9): [True: 0, False: 9.87k]
  |  Branch (1636:28): [True: 0, False: 9.87k]
  ------------------
 1637|       |        /* must be old module... guess what it should be... */
 1638|      0|        switch (test_mech.mechanism) {
 1639|      0|            case CKM_RSA_PKCS:
  ------------------
  |  |  720|      0|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (1639:13): [True: 0, False: 0]
  ------------------
 1640|      0|                mechanism_info.flags = (CKF_SIGN | CKF_DECRYPT |
  ------------------
  |  | 1356|      0|#define CKF_SIGN 0x00000800UL
  ------------------
                              mechanism_info.flags = (CKF_SIGN | CKF_DECRYPT |
  ------------------
  |  | 1354|      0|#define CKF_DECRYPT 0x00000200UL
  ------------------
 1641|      0|                                        CKF_WRAP | CKF_VERIFY_RECOVER | CKF_ENCRYPT | CKF_WRAP);
  ------------------
  |  | 1362|      0|#define CKF_WRAP 0x00020000UL
  ------------------
                                                      CKF_WRAP | CKF_VERIFY_RECOVER | CKF_ENCRYPT | CKF_WRAP);
  ------------------
  |  | 1359|      0|#define CKF_VERIFY_RECOVER 0x00004000UL
  ------------------
                                                      CKF_WRAP | CKF_VERIFY_RECOVER | CKF_ENCRYPT | CKF_WRAP);
  ------------------
  |  | 1353|      0|#define CKF_ENCRYPT 0x00000100UL
  ------------------
                                                      CKF_WRAP | CKF_VERIFY_RECOVER | CKF_ENCRYPT | CKF_WRAP);
  ------------------
  |  | 1362|      0|#define CKF_WRAP 0x00020000UL
  ------------------
 1642|      0|                break;
 1643|      0|            case CKM_DSA:
  ------------------
  |  |  745|      0|#define CKM_DSA 0x00000011UL
  ------------------
  |  Branch (1643:13): [True: 0, False: 0]
  ------------------
 1644|      0|                mechanism_info.flags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1356|      0|#define CKF_SIGN 0x00000800UL
  ------------------
                              mechanism_info.flags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1358|      0|#define CKF_VERIFY 0x00002000
  ------------------
 1645|      0|                break;
 1646|      0|            case CKM_DH_PKCS_DERIVE:
  ------------------
  |  |  759|      0|#define CKM_DH_PKCS_DERIVE 0x00000021UL
  ------------------
  |  Branch (1646:13): [True: 0, False: 0]
  ------------------
 1647|      0|                mechanism_info.flags = CKF_DERIVE;
  ------------------
  |  | 1364|      0|#define CKF_DERIVE 0x00080000UL
  ------------------
 1648|      0|                break;
 1649|      0|            case CKM_ECDH1_DERIVE:
  ------------------
  |  | 1086|      0|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
  |  Branch (1649:13): [True: 0, False: 0]
  ------------------
 1650|      0|                mechanism_info.flags = CKF_DERIVE;
  ------------------
  |  | 1364|      0|#define CKF_DERIVE 0x00080000UL
  ------------------
 1651|      0|                if (test_mech2.mechanism == CKM_ECDSA) {
  ------------------
  |  | 1074|      0|#define CKM_ECDSA 0x00001041UL
  ------------------
  |  Branch (1651:21): [True: 0, False: 0]
  ------------------
 1652|      0|                    mechanism_info.flags |= CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1356|      0|#define CKF_SIGN 0x00000800UL
  ------------------
                                  mechanism_info.flags |= CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1358|      0|#define CKF_VERIFY 0x00002000
  ------------------
 1653|      0|                }
 1654|      0|                break;
 1655|      0|            case CKM_ECDSA:
  ------------------
  |  | 1074|      0|#define CKM_ECDSA 0x00001041UL
  ------------------
  |  Branch (1655:13): [True: 0, False: 0]
  ------------------
 1656|      0|                mechanism_info.flags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1356|      0|#define CKF_SIGN 0x00000800UL
  ------------------
                              mechanism_info.flags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1358|      0|#define CKF_VERIFY 0x00002000
  ------------------
 1657|      0|                break;
 1658|      0|            case CKM_EDDSA:
  ------------------
  |  | 1174|      0|#define CKM_EDDSA 0x00001057UL
  ------------------
  |  Branch (1658:13): [True: 0, False: 0]
  ------------------
 1659|      0|                mechanism_info.flags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1356|      0|#define CKF_SIGN 0x00000800UL
  ------------------
                              mechanism_info.flags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1358|      0|#define CKF_VERIFY 0x00002000
  ------------------
 1660|      0|                break;
 1661|       |
 1662|      0|            default:
  ------------------
  |  Branch (1662:13): [True: 0, False: 0]
  ------------------
 1663|      0|                break;
 1664|      0|        }
 1665|      0|    }
 1666|       |    /* now adjust our flags according to the user's key usage passed to us */
 1667|  9.87k|    mechanism_info.flags = (mechanism_info.flags & (~opFlagsMask)) | opFlags;
 1668|       |    /* set the public key attributes */
 1669|  9.87k|    attrs += pk11_AttrFlagsToAttributes(pubKeyAttrFlags, attrs,
 1670|  9.87k|                                        &cktrue, &ckfalse);
 1671|  9.87k|    PK11_SETATTRS(attrs, CKA_DERIVE,
  ------------------
  |  |  104|  9.87k|    (x)->type = (id);              \
  |  |  105|  19.7k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 9.87k, False: 0]
  |  |  ------------------
  |  |  106|  9.87k|    (x)->ulValueLen = (l);
  ------------------
 1672|  9.87k|                  mechanism_info.flags & CKF_DERIVE ? &cktrue : &ckfalse,
 1673|  9.87k|                  sizeof(CK_BBOOL));
 1674|  9.87k|    attrs++;
 1675|  9.87k|    PK11_SETATTRS(attrs, CKA_WRAP,
  ------------------
  |  |  104|  9.87k|    (x)->type = (id);              \
  |  |  105|  19.7k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 0, False: 9.87k]
  |  |  ------------------
  |  |  106|  9.87k|    (x)->ulValueLen = (l);
  ------------------
 1676|  9.87k|                  mechanism_info.flags & CKF_WRAP ? &cktrue : &ckfalse,
 1677|  9.87k|                  sizeof(CK_BBOOL));
 1678|  9.87k|    attrs++;
 1679|  9.87k|    PK11_SETATTRS(attrs, CKA_VERIFY,
  ------------------
  |  |  104|  9.87k|    (x)->type = (id);              \
  |  |  105|  19.7k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 0, False: 9.87k]
  |  |  ------------------
  |  |  106|  9.87k|    (x)->ulValueLen = (l);
  ------------------
 1680|  9.87k|                  mechanism_info.flags & CKF_VERIFY ? &cktrue : &ckfalse,
 1681|  9.87k|                  sizeof(CK_BBOOL));
 1682|  9.87k|    attrs++;
 1683|  9.87k|    PK11_SETATTRS(attrs, CKA_VERIFY_RECOVER,
  ------------------
  |  |  104|  9.87k|    (x)->type = (id);              \
  |  |  105|  19.7k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 0, False: 9.87k]
  |  |  ------------------
  |  |  106|  9.87k|    (x)->ulValueLen = (l);
  ------------------
 1684|  9.87k|                  mechanism_info.flags & CKF_VERIFY_RECOVER ? &cktrue : &ckfalse,
 1685|  9.87k|                  sizeof(CK_BBOOL));
 1686|  9.87k|    attrs++;
 1687|  9.87k|    PK11_SETATTRS(attrs, CKA_ENCRYPT,
  ------------------
  |  |  104|  9.87k|    (x)->type = (id);              \
  |  |  105|  19.7k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 0, False: 9.87k]
  |  |  ------------------
  |  |  106|  9.87k|    (x)->ulValueLen = (l);
  ------------------
 1688|  9.87k|                  mechanism_info.flags & CKF_ENCRYPT ? &cktrue : &ckfalse,
 1689|  9.87k|                  sizeof(CK_BBOOL));
 1690|  9.87k|    attrs++;
 1691|       |    /* set the private key attributes */
 1692|  9.87k|    PK11_SETATTRS(privattrs, CKA_DERIVE,
  ------------------
  |  |  104|  9.87k|    (x)->type = (id);              \
  |  |  105|  19.7k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 9.87k, False: 0]
  |  |  ------------------
  |  |  106|  9.87k|    (x)->ulValueLen = (l);
  ------------------
 1693|  9.87k|                  mechanism_info.flags & CKF_DERIVE ? &cktrue : &ckfalse,
 1694|  9.87k|                  sizeof(CK_BBOOL));
 1695|  9.87k|    privattrs++;
 1696|  9.87k|    PK11_SETATTRS(privattrs, CKA_UNWRAP,
  ------------------
  |  |  104|  9.87k|    (x)->type = (id);              \
  |  |  105|  19.7k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 0, False: 9.87k]
  |  |  ------------------
  |  |  106|  9.87k|    (x)->ulValueLen = (l);
  ------------------
 1697|  9.87k|                  mechanism_info.flags & CKF_UNWRAP ? &cktrue : &ckfalse,
 1698|  9.87k|                  sizeof(CK_BBOOL));
 1699|  9.87k|    privattrs++;
 1700|  9.87k|    PK11_SETATTRS(privattrs, CKA_SIGN,
  ------------------
  |  |  104|  9.87k|    (x)->type = (id);              \
  |  |  105|  19.7k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 0, False: 9.87k]
  |  |  ------------------
  |  |  106|  9.87k|    (x)->ulValueLen = (l);
  ------------------
 1701|  9.87k|                  mechanism_info.flags & CKF_SIGN ? &cktrue : &ckfalse,
 1702|  9.87k|                  sizeof(CK_BBOOL));
 1703|  9.87k|    privattrs++;
 1704|  9.87k|    PK11_SETATTRS(privattrs, CKA_DECRYPT,
  ------------------
  |  |  104|  9.87k|    (x)->type = (id);              \
  |  |  105|  19.7k|    (x)->pValue = (v);             \
  |  |  ------------------
  |  |  |  Branch (105:20): [True: 0, False: 9.87k]
  |  |  ------------------
  |  |  106|  9.87k|    (x)->ulValueLen = (l);
  ------------------
 1705|  9.87k|                  mechanism_info.flags & CKF_DECRYPT ? &cktrue : &ckfalse,
 1706|  9.87k|                  sizeof(CK_BBOOL));
 1707|  9.87k|    privattrs++;
 1708|       |
 1709|  9.87k|    if (token) {
  ------------------
  |  Branch (1709:9): [True: 0, False: 9.87k]
  ------------------
 1710|      0|        session_handle = PK11_GetRWSession(slot);
 1711|      0|        haslock = PK11_RWSessionHasLock(slot, session_handle);
 1712|      0|        restore = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1713|  9.87k|    } else {
 1714|  9.87k|        session_handle = slot->session;
 1715|  9.87k|        if (session_handle != CK_INVALID_HANDLE)
  ------------------
  |  |   78|  9.87k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1715:13): [True: 9.87k, False: 0]
  ------------------
 1716|  9.87k|            PK11_EnterSlotMonitor(slot);
 1717|  9.87k|        restore = PR_FALSE;
  ------------------
  |  |  438|  9.87k|#define PR_FALSE 0
  ------------------
 1718|  9.87k|        haslock = PR_TRUE;
  ------------------
  |  |  437|  9.87k|#define PR_TRUE 1
  ------------------
 1719|  9.87k|    }
 1720|       |
 1721|  9.87k|    if (session_handle == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  9.87k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1721:9): [True: 0, False: 9.87k]
  ------------------
 1722|      0|        PORT_SetError(SEC_ERROR_BAD_DATA);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1723|      0|        return NULL;
 1724|      0|    }
 1725|  9.87k|    privCount = privattrs - privTemplate;
 1726|  9.87k|    pubCount = attrs - pubTemplate;
 1727|  9.87k|    crv = PK11_GETTAB(slot)->C_GenerateKeyPair(session_handle, &mechanism,
  ------------------
  |  |  102|  9.87k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1728|  9.87k|                                               pubTemplate, pubCount, privTemplate, privCount, &pubID, &privID);
 1729|       |
 1730|  9.87k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.87k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1730:9): [True: 680, False: 9.19k]
  ------------------
 1731|    680|        if (restore) {
  ------------------
  |  Branch (1731:13): [True: 0, False: 680]
  ------------------
 1732|      0|            PK11_RestoreROSession(slot, session_handle);
 1733|      0|        } else
 1734|    680|            PK11_ExitSlotMonitor(slot);
 1735|    680|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|    680|#define PORT_SetError PORT_SetError_Util
  ------------------
 1736|    680|        return NULL;
 1737|    680|    }
 1738|       |    /* This locking code is dangerous and needs to be more thought
 1739|       |     * out... the real problem is that we're holding the mutex open this long
 1740|       |     */
 1741|  9.19k|    if (haslock) {
  ------------------
  |  Branch (1741:9): [True: 9.19k, False: 0]
  ------------------
 1742|  9.19k|        PK11_ExitSlotMonitor(slot);
 1743|  9.19k|    }
 1744|       |
 1745|       |    /* swap around the ID's for older PKCS #11 modules */
 1746|  9.19k|    keyClass = PK11_ReadULongAttribute(slot, pubID, CKA_CLASS);
  ------------------
  |  |  511|  9.19k|#define CKA_CLASS 0x00000000UL
  ------------------
 1747|  9.19k|    if (keyClass != CKO_PUBLIC_KEY) {
  ------------------
  |  |  327|  9.19k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
  |  Branch (1747:9): [True: 0, False: 9.19k]
  ------------------
 1748|      0|        CK_OBJECT_HANDLE tmp = pubID;
 1749|      0|        pubID = privID;
 1750|      0|        privID = tmp;
 1751|      0|    }
 1752|       |
 1753|  9.19k|    *pubKey = PK11_ExtractPublicKey(slot, keyType, pubID);
 1754|  9.19k|    if (*pubKey == NULL) {
  ------------------
  |  Branch (1754:9): [True: 0, False: 9.19k]
  ------------------
 1755|      0|        if (restore) {
  ------------------
  |  Branch (1755:13): [True: 0, False: 0]
  ------------------
 1756|       |            /* we may have to restore the mutex so it get's exited properly
 1757|       |             * in RestoreROSession */
 1758|      0|            if (haslock)
  ------------------
  |  Branch (1758:17): [True: 0, False: 0]
  ------------------
 1759|      0|                PK11_EnterSlotMonitor(slot);
 1760|      0|            PK11_RestoreROSession(slot, session_handle);
 1761|      0|        }
 1762|      0|        PK11_DestroyObject(slot, pubID);
 1763|      0|        PK11_DestroyObject(slot, privID);
 1764|      0|        return NULL;
 1765|      0|    }
 1766|       |
 1767|       |    /* set the ID to the public key so we can find it again */
 1768|  9.19k|    cka_id = pk11_MakeIDFromPublicKey(*pubKey);
 1769|  9.19k|    pubIsToken = (PRBool)PK11_HasAttributeSet(slot, pubID, CKA_TOKEN, PR_FALSE);
  ------------------
  |  |  512|  9.19k|#define CKA_TOKEN 0x00000001UL
  ------------------
                  pubIsToken = (PRBool)PK11_HasAttributeSet(slot, pubID, CKA_TOKEN, PR_FALSE);
  ------------------
  |  |  438|  9.19k|#define PR_FALSE 0
  ------------------
 1770|       |
 1771|  9.19k|    PK11_SETATTRS(&setTemplate, CKA_ID, cka_id->data, cka_id->len);
  ------------------
  |  |  104|  9.19k|    (x)->type = (id);              \
  |  |  105|  9.19k|    (x)->pValue = (v);             \
  |  |  106|  9.19k|    (x)->ulValueLen = (l);
  ------------------
 1772|       |
 1773|  9.19k|    if (haslock) {
  ------------------
  |  Branch (1773:9): [True: 9.19k, False: 0]
  ------------------
 1774|  9.19k|        PK11_EnterSlotMonitor(slot);
 1775|  9.19k|    }
 1776|  9.19k|    crv = PK11_GETTAB(slot)->C_SetAttributeValue(session_handle, privID,
  ------------------
  |  |  102|  9.19k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1777|  9.19k|                                                 &setTemplate, 1);
 1778|       |
 1779|  9.19k|    if (crv == CKR_OK && pubIsToken) {
  ------------------
  |  | 1388|  18.3k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1779:9): [True: 9.19k, False: 0]
  |  Branch (1779:26): [True: 0, False: 9.19k]
  ------------------
 1780|      0|        crv = PK11_GETTAB(slot)->C_SetAttributeValue(session_handle, pubID,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1781|      0|                                                     &setTemplate, 1);
 1782|      0|    }
 1783|       |
 1784|  9.19k|    if (restore) {
  ------------------
  |  Branch (1784:9): [True: 0, False: 9.19k]
  ------------------
 1785|      0|        PK11_RestoreROSession(slot, session_handle);
 1786|  9.19k|    } else {
 1787|  9.19k|        PK11_ExitSlotMonitor(slot);
 1788|  9.19k|    }
 1789|  9.19k|    SECITEM_FreeItem(cka_id, PR_TRUE);
  ------------------
  |  |  108|  9.19k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(cka_id, PR_TRUE);
  ------------------
  |  |  437|  9.19k|#define PR_TRUE 1
  ------------------
 1790|       |
 1791|  9.19k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.19k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1791:9): [True: 0, False: 9.19k]
  ------------------
 1792|      0|        PK11_DestroyObject(slot, pubID);
 1793|      0|        PK11_DestroyObject(slot, privID);
 1794|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1795|      0|        *pubKey = NULL;
 1796|      0|        return NULL;
 1797|      0|    }
 1798|       |
 1799|  9.19k|    privKey = PK11_MakePrivKey(slot, keyType, !token, privID, wincx);
 1800|  9.19k|    if (privKey == NULL) {
  ------------------
  |  Branch (1800:9): [True: 0, False: 9.19k]
  ------------------
 1801|      0|        SECKEY_DestroyPublicKey(*pubKey);
 1802|      0|        PK11_DestroyObject(slot, privID);
 1803|      0|        *pubKey = NULL;
 1804|      0|        return NULL;
 1805|      0|    }
 1806|       |
 1807|  9.19k|    return privKey;
 1808|  9.19k|}
PK11_GenerateKeyPairWithFlags:
 1813|  1.91k|{
 1814|  1.91k|    return PK11_GenerateKeyPairWithOpFlags(slot, type, param, pubKey, attrFlags,
 1815|  1.91k|                                           0, 0, wincx);
 1816|  1.91k|}
PK11_GenerateKeyPair:
 1825|  1.91k|{
 1826|  1.91k|    PK11AttrFlags attrFlags = 0;
 1827|       |
 1828|  1.91k|    if (token) {
  ------------------
  |  Branch (1828:9): [True: 0, False: 1.91k]
  ------------------
 1829|      0|        attrFlags |= PK11_ATTR_TOKEN;
  ------------------
  |  |  194|      0|#define PK11_ATTR_TOKEN 0x00000001L
  ------------------
 1830|  1.91k|    } else {
 1831|  1.91k|        attrFlags |= PK11_ATTR_SESSION;
  ------------------
  |  |  195|  1.91k|#define PK11_ATTR_SESSION 0x00000002L
  ------------------
 1832|  1.91k|    }
 1833|  1.91k|    if (sensitive) {
  ------------------
  |  Branch (1833:9): [True: 308, False: 1.60k]
  ------------------
 1834|    308|        attrFlags |= (PK11_ATTR_SENSITIVE | PK11_ATTR_PRIVATE);
  ------------------
  |  |  260|    308|#define PK11_ATTR_SENSITIVE 0x00000040L
  ------------------
                      attrFlags |= (PK11_ATTR_SENSITIVE | PK11_ATTR_PRIVATE);
  ------------------
  |  |  216|    308|#define PK11_ATTR_PRIVATE 0x00000004L
  ------------------
 1835|  1.60k|    } else {
 1836|  1.60k|        attrFlags |= (PK11_ATTR_INSENSITIVE | PK11_ATTR_PUBLIC);
  ------------------
  |  |  261|  1.60k|#define PK11_ATTR_INSENSITIVE 0x00000080L
  ------------------
                      attrFlags |= (PK11_ATTR_INSENSITIVE | PK11_ATTR_PUBLIC);
  ------------------
  |  |  217|  1.60k|#define PK11_ATTR_PUBLIC 0x00000008L
  ------------------
 1837|  1.60k|    }
 1838|  1.91k|    return PK11_GenerateKeyPairWithFlags(slot, type, param, pubKey,
 1839|  1.91k|                                         attrFlags, wincx);
 1840|  1.91k|}
PK11_MakeIDFromPubKey:
 2699|  9.19k|{
 2700|  9.19k|    PK11Context *context;
 2701|  9.19k|    SECItem *certCKA_ID;
 2702|  9.19k|    SECStatus rv;
 2703|       |
 2704|  9.19k|    if (pubKeyData->len <= SHA1_LENGTH) {
  ------------------
  |  |   39|  9.19k|#define SHA1_LENGTH 20
  ------------------
  |  Branch (2704:9): [True: 9, False: 9.18k]
  ------------------
 2705|       |        /* probably an already hashed value. The strongest known public
 2706|       |         * key values <= 160 bits would be less than 40 bit symetric in
 2707|       |         * strength. Don't hash them, just return the value. There are
 2708|       |         * none at the time of this writing supported by previous versions
 2709|       |         * of NSS, so change is binary compatible safe */
 2710|      9|        return SECITEM_DupItem(pubKeyData);
  ------------------
  |  |  107|      9|#define SECITEM_DupItem SECITEM_DupItem_Util
  ------------------
 2711|      9|    }
 2712|       |
 2713|  9.18k|    context = PK11_CreateDigestContext(SEC_OID_SHA1);
 2714|  9.18k|    if (context == NULL) {
  ------------------
  |  Branch (2714:9): [True: 0, False: 9.18k]
  ------------------
 2715|      0|        return NULL;
 2716|      0|    }
 2717|       |
 2718|  9.18k|    rv = PK11_DigestBegin(context);
 2719|  9.18k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (2719:9): [True: 9.18k, False: 0]
  ------------------
 2720|  9.18k|        rv = PK11_DigestOp(context, pubKeyData->data, pubKeyData->len);
 2721|  9.18k|    }
 2722|  9.18k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2722:9): [True: 0, False: 9.18k]
  ------------------
 2723|      0|        PK11_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2724|      0|        return NULL;
 2725|      0|    }
 2726|       |
 2727|  9.18k|    certCKA_ID = (SECItem *)PORT_Alloc(sizeof(SECItem));
  ------------------
  |  |   52|  9.18k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 2728|  9.18k|    if (certCKA_ID == NULL) {
  ------------------
  |  Branch (2728:9): [True: 0, False: 9.18k]
  ------------------
 2729|      0|        PK11_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2730|      0|        return NULL;
 2731|      0|    }
 2732|       |
 2733|  9.18k|    certCKA_ID->len = SHA1_LENGTH;
  ------------------
  |  |   39|  9.18k|#define SHA1_LENGTH 20
  ------------------
 2734|  9.18k|    certCKA_ID->data = (unsigned char *)PORT_Alloc(certCKA_ID->len);
  ------------------
  |  |   52|  9.18k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 2735|  9.18k|    if (certCKA_ID->data == NULL) {
  ------------------
  |  Branch (2735:9): [True: 0, False: 9.18k]
  ------------------
 2736|      0|        PORT_Free(certCKA_ID);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 2737|      0|        PK11_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2738|      0|        return NULL;
 2739|      0|    }
 2740|       |
 2741|  9.18k|    rv = PK11_DigestFinal(context, certCKA_ID->data, &certCKA_ID->len,
 2742|  9.18k|                          SHA1_LENGTH);
  ------------------
  |  |   39|  9.18k|#define SHA1_LENGTH 20
  ------------------
 2743|  9.18k|    PK11_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|  9.18k|#define PR_TRUE 1
  ------------------
 2744|  9.18k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2744:9): [True: 0, False: 9.18k]
  ------------------
 2745|      0|        SECITEM_FreeItem(certCKA_ID, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(certCKA_ID, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2746|      0|        return NULL;
 2747|      0|    }
 2748|       |
 2749|  9.18k|    return certCKA_ID;
 2750|  9.18k|}
pk11akey.c:pk11_MakeIDFromPublicKey:
   31|  9.19k|{
   32|       |    /* set the ID to the public key so we can find it again */
   33|  9.19k|    SECItem *pubKeyIndex = NULL;
   34|  9.19k|    switch (pubKey->keyType) {
   35|      0|        case rsaKey:
  ------------------
  |  Branch (35:9): [True: 0, False: 9.19k]
  ------------------
   36|      0|            pubKeyIndex = &pubKey->u.rsa.modulus;
   37|      0|            break;
   38|      0|        case dsaKey:
  ------------------
  |  Branch (38:9): [True: 0, False: 9.19k]
  ------------------
   39|      0|            pubKeyIndex = &pubKey->u.dsa.publicValue;
   40|      0|            break;
   41|  1.29k|        case dhKey:
  ------------------
  |  Branch (41:9): [True: 1.29k, False: 7.90k]
  ------------------
   42|  1.29k|            pubKeyIndex = &pubKey->u.dh.publicValue;
   43|  1.29k|            break;
   44|      0|        case edKey:
  ------------------
  |  Branch (44:9): [True: 0, False: 9.19k]
  ------------------
   45|  7.90k|        case ecKey:
  ------------------
  |  Branch (45:9): [True: 7.90k, False: 1.29k]
  ------------------
   46|  7.90k|        case ecMontKey:
  ------------------
  |  Branch (46:9): [True: 0, False: 9.19k]
  ------------------
   47|  7.90k|            pubKeyIndex = &pubKey->u.ec.publicValue;
   48|  7.90k|            break;
   49|      0|        case kyberKey:
  ------------------
  |  Branch (49:9): [True: 0, False: 9.19k]
  ------------------
   50|      0|            pubKeyIndex = &pubKey->u.kyber.publicValue;
   51|      0|            break;
   52|      0|        default:
  ------------------
  |  Branch (52:9): [True: 0, False: 9.19k]
  ------------------
   53|      0|            return NULL;
   54|  9.19k|    }
   55|  9.19k|    PORT_Assert(pubKeyIndex != NULL);
  ------------------
  |  |  120|  9.19k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  9.19k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 9.19k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   56|       |
   57|  9.19k|    return PK11_MakeIDFromPubKey(pubKeyIndex);
   58|  9.19k|}
pk11akey.c:pk11_Attr2SecItem:
  316|  19.3k|{
  317|  19.3k|    item->data = NULL;
  318|       |
  319|  19.3k|    (void)SECITEM_AllocItem(arena, item, attr->ulValueLen);
  ------------------
  |  |  103|  19.3k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  320|  19.3k|    if (item->data == NULL) {
  ------------------
  |  Branch (320:9): [True: 0, False: 19.3k]
  ------------------
  321|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  322|      0|    }
  323|  19.3k|    PORT_Memcpy(item->data, attr->pValue, item->len);
  ------------------
  |  |  180|  19.3k|#define PORT_Memcpy memcpy
  ------------------
  324|  19.3k|    return CKR_OK;
  ------------------
  |  | 1388|  19.3k|#define CKR_OK 0x00000000UL
  ------------------
  325|  19.3k|}
pk11akey.c:pk11_get_Decoded_ECPoint:
  465|  7.90k|{
  466|  7.90k|    SECItem encodedPublicValue;
  467|  7.90k|    SECStatus rv;
  468|  7.90k|    int keyLen;
  469|  7.90k|    PRBool plain = PR_FALSE;
  ------------------
  |  |  438|  7.90k|#define PR_FALSE 0
  ------------------
  470|       |
  471|  7.90k|    if (ecPoint->ulValueLen == 0) {
  ------------------
  |  Branch (471:9): [True: 0, False: 7.90k]
  ------------------
  472|      0|        return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  473|      0|    }
  474|       |
  475|       |    /*
  476|       |     * The PKCS #11 spec requires ecPoints to be encoded as a DER OCTET String.
  477|       |     * NSS has mistakenly passed unencoded values, and some PKCS #11 vendors
  478|       |     * followed that mistake. Now we need to detect which encoding we were
  479|       |     * passed in. The task is made more complicated by the fact the the
  480|       |     * DER encoding byte (SEC_ASN_OCTET_STRING) is the same as the
  481|       |     * EC_POINT_FORM_UNCOMPRESSED byte (0x04), so we can't use that to
  482|       |     * determine which curve we are using.
  483|       |     */
  484|       |
  485|       |    /* get the expected key length for the passed in curve.
  486|       |     * pk11_get_EC_PointLenInBytes only returns valid values for curves
  487|       |     * NSS has traditionally recognized. If the curve is not recognized,
  488|       |     * it will return '0', and we have to figure out if the key was
  489|       |     * encoded or not heuristically. If the ecParams are invalid, it
  490|       |     * will return -1 for the keyLen.
  491|       |     */
  492|  7.90k|    keyLen = pk11_get_EC_PointLenInBytes(arena, ecParams, &plain);
  493|  7.90k|    if (keyLen < 0) {
  ------------------
  |  Branch (493:9): [True: 0, False: 7.90k]
  ------------------
  494|      0|        return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  495|      0|    }
  496|       |
  497|       |    /*
  498|       |     * Some curves are not encoded but we don't have the name here.
  499|       |     * Instead, pk11_get_EC_PointLenInBytes returns true plain if this is the
  500|       |     * case.
  501|       |     */
  502|  7.90k|    if (plain && ecPoint->ulValueLen == (unsigned int)keyLen) {
  ------------------
  |  Branch (502:9): [True: 7.55k, False: 346]
  |  Branch (502:18): [True: 7.55k, False: 0]
  ------------------
  503|  7.55k|        return pk11_Attr2SecItem(arena, ecPoint, publicKeyValue);
  504|  7.55k|    }
  505|       |
  506|       |    /* If the point is uncompressed and the lengths match, it
  507|       |     * must be an unencoded point */
  508|    346|    if ((*((char *)ecPoint->pValue) == EC_POINT_FORM_UNCOMPRESSED) &&
  ------------------
  |  |   92|    346|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (508:9): [True: 346, False: 0]
  ------------------
  509|    346|        (ecPoint->ulValueLen == (unsigned int)keyLen)) {
  ------------------
  |  Branch (509:9): [True: 0, False: 346]
  ------------------
  510|      0|        return pk11_Attr2SecItem(arena, ecPoint, publicKeyValue);
  511|      0|    }
  512|       |
  513|       |    /* now assume the key passed to us was encoded and decode it */
  514|    346|    if (*((char *)ecPoint->pValue) == SEC_ASN1_OCTET_STRING) {
  ------------------
  |  |   80|    346|#define SEC_ASN1_OCTET_STRING 0x04
  ------------------
  |  Branch (514:9): [True: 346, False: 0]
  ------------------
  515|       |        /* OK, now let's try to decode it and see if it's valid */
  516|    346|        encodedPublicValue.data = ecPoint->pValue;
  517|    346|        encodedPublicValue.len = ecPoint->ulValueLen;
  518|    346|        rv = SEC_QuickDERDecodeItem(arena, publicKeyValue,
  ------------------
  |  |  102|    346|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  519|    346|                                    SEC_ASN1_GET(SEC_OctetStringTemplate), &encodedPublicValue);
  ------------------
  |  |  188|    346|#define SEC_ASN1_GET(x) x
  ------------------
  520|       |
  521|       |        /* it coded correctly & we know the key length (and they match)
  522|       |         * then we are done, return the results. */
  523|    346|        if (keyLen && rv == SECSuccess && publicKeyValue->len == (unsigned int)keyLen) {
  ------------------
  |  Branch (523:13): [True: 346, False: 0]
  |  Branch (523:23): [True: 346, False: 0]
  |  Branch (523:43): [True: 346, False: 0]
  ------------------
  524|    346|            return CKR_OK;
  ------------------
  |  | 1388|    346|#define CKR_OK 0x00000000UL
  ------------------
  525|    346|        }
  526|       |
  527|       |        /* if we know the key length, one of the above tests should have
  528|       |         * succeded. If it doesn't the module gave us bad data */
  529|      0|        if (keyLen) {
  ------------------
  |  Branch (529:13): [True: 0, False: 0]
  ------------------
  530|      0|            return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  531|      0|        }
  532|       |
  533|       |        /* We don't know the key length, so we don't know deterministically
  534|       |         * which encoding was used. We now will try to pick the most likely
  535|       |         * form that's correct, with a preference for the encoded form if we
  536|       |         * can't determine for sure. We do this by checking the key we got
  537|       |         * back from SEC_QuickDERDecodeItem for defects. If no defects are
  538|       |         * found, we assume the encoded parameter was was passed to us.
  539|       |         * our defect tests include:
  540|       |         *   1) it didn't decode.
  541|       |         *   2) The decode key had an invalid length (must be odd).
  542|       |         *   3) The decoded key wasn't an UNCOMPRESSED key.
  543|       |         *   4) The decoded key didn't include the entire encoded block
  544|       |         *   except the DER encoding values. (fixing DER length to one
  545|       |         *   particular value).
  546|       |         */
  547|      0|        if ((rv != SECSuccess) || ((publicKeyValue->len & 1) != 1) ||
  ------------------
  |  Branch (547:13): [True: 0, False: 0]
  |  Branch (547:35): [True: 0, False: 0]
  ------------------
  548|      0|            (publicKeyValue->data[0] != EC_POINT_FORM_UNCOMPRESSED) ||
  ------------------
  |  |   92|      0|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (548:13): [True: 0, False: 0]
  ------------------
  549|      0|            (PORT_Memcmp(&encodedPublicValue.data[encodedPublicValue.len - publicKeyValue->len],
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (549:13): [True: 0, False: 0]
  ------------------
  550|      0|                         publicKeyValue->data,
  551|      0|                         publicKeyValue->len) != 0)) {
  552|       |            /* The decoded public key was flawed, the original key must have
  553|       |             * already been in decoded form. Do a quick sanity check then
  554|       |             * return the original key value.
  555|       |             */
  556|      0|            if ((encodedPublicValue.len & 1) == 0) {
  ------------------
  |  Branch (556:17): [True: 0, False: 0]
  ------------------
  557|      0|                return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  558|      0|            }
  559|      0|            return pk11_Attr2SecItem(arena, ecPoint, publicKeyValue);
  560|      0|        }
  561|       |
  562|       |        /* as best we can figure, the passed in key was encoded, and we've
  563|       |         * now decoded it. Note: there is a chance this could be wrong if the
  564|       |         * following conditions hold:
  565|       |         *  1) The first byte or bytes of the X point looks like a valid length
  566|       |         * of precisely the right size (2*curveSize -1). this means for curves
  567|       |         * less than 512 bits (64 bytes), this will happen 1 in 256 times*.
  568|       |         * for curves between 512 and 1024, this will happen 1 in 65,536 times*
  569|       |         * for curves between 1024 and 256K this will happen 1 in 16 million*
  570|       |         *  2) The length of the 'DER length field' is odd
  571|       |         * (making both the encoded and decode
  572|       |         * values an odd length. this is true of all curves less than 512,
  573|       |         * as well as curves between 1024 and 256K).
  574|       |         *  3) The X[length of the 'DER length field'] == 0x04, 1 in 256.
  575|       |         *
  576|       |         *  (* assuming all values are equally likely in the first byte,
  577|       |         * This isn't true if the curve length is not a multiple of 8. In these
  578|       |         * cases, if the DER length is possible, it's more likely,
  579|       |         * if it's not possible, then we have no false decodes).
  580|       |         *
  581|       |         * For reference here are the odds for the various curves we currently
  582|       |         * have support for (and the only curves SSL will negotiate at this
  583|       |         * time). NOTE: None of the supported curves will show up here
  584|       |         * because we return a valid length for all of these curves.
  585|       |         * The only way to get here is to have some application (not SSL)
  586|       |         * which supports some unknown curve and have some vendor supplied
  587|       |         * PKCS #11 module support that curve. NOTE: in this case, one
  588|       |         * presumes that that pkcs #11 module is likely to be using the
  589|       |         * correct encodings.
  590|       |         *
  591|       |         * Prime Curves (GFp):
  592|       |         *   Bit    False       Odds of
  593|       |         *  Size    DER Len  False Decode Positive
  594|       |         *  112     27     1 in 65536
  595|       |         *  128     31     1 in 65536
  596|       |         *  160     39     1 in 65536
  597|       |         *  192     47     1 in 65536
  598|       |         *  224     55     1 in 65536
  599|       |         *  239     59     1 in 32768 (top byte can only be 0-127)
  600|       |         *  256     63     1 in 65536
  601|       |         *  521     129,131      0        (decoded value would be even)
  602|       |         *
  603|       |         * Binary curves (GF2m).
  604|       |         *   Bit    False       Odds of
  605|       |         *  Size    DER Len  False Decode Positive
  606|       |         *  131     33       0        (top byte can only be 0-7)
  607|       |         *  163     41       0        (top byte can only be 0-7)
  608|       |         *  176     43     1 in 65536
  609|       |         *  191     47     1 in 32768 (top byte can only be 0-127)
  610|       |         *  193     49       0        (top byte can only be 0-1)
  611|       |         *  208     51     1 in 65536
  612|       |         *  233     59       0        (top byte can only be 0-1)
  613|       |         *  239     59     1 in 32768 (top byte can only be 0-127)
  614|       |         *  272     67     1 in 65536
  615|       |         *  283     71       0        (top byte can only be 0-7)
  616|       |         *  304     75     1 in 65536
  617|       |         *  359     89     1 in 32768 (top byte can only be 0-127)
  618|       |         *  368     91     1 in 65536
  619|       |         *  409     103      0        (top byte can only be 0-1)
  620|       |         *  431     107    1 in 32768 (top byte can only be 0-127)
  621|       |         *  571     129,143      0        (decoded value would be even)
  622|       |         *
  623|       |         */
  624|       |
  625|      0|        return CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  626|      0|    }
  627|       |
  628|       |    /* In theory, we should handle the case where the curve == 0 and
  629|       |     * the first byte is EC_POINT_FORM_UNCOMPRESSED, (which would be
  630|       |     * handled by doing a santity check on the key length and returning
  631|       |     * pk11_Attr2SecItem() to copy the ecPoint to the publicKeyValue).
  632|       |     *
  633|       |     * This test is unnecessary, however, due to the fact that
  634|       |     * EC_POINT_FORM_UNCOMPRESSED == SEC_ASIN1_OCTET_STRING, that case is
  635|       |     * handled in the above if. That means if we get here, the initial
  636|       |     * byte of our ecPoint value was invalid, so we can safely return.
  637|       |     * invalid attribute.
  638|       |     */
  639|       |
  640|      0|    return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  641|    346|}
pk11akey.c:pk11_get_EC_PointLenInBytes:
  346|  7.90k|{
  347|  7.90k|    SECItem oid;
  348|  7.90k|    SECOidTag tag;
  349|  7.90k|    SECStatus rv;
  350|       |
  351|       |    /* decode the OID tag */
  352|  7.90k|    rv = SEC_QuickDERDecodeItem(arena, &oid,
  ------------------
  |  |  102|  7.90k|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
  353|  7.90k|                                SEC_ASN1_GET(SEC_ObjectIDTemplate), ecParams);
  ------------------
  |  |  188|  7.90k|#define SEC_ASN1_GET(x) x
  ------------------
  354|  7.90k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (354:9): [True: 0, False: 7.90k]
  ------------------
  355|       |        /* could be explict curves, allow them to work if the
  356|       |         * PKCS #11 module support them. If we try to parse the
  357|       |         * explicit curve value in the future, we may return -1 here
  358|       |         * to indicate an invalid parameter if the explicit curve
  359|       |         * decode fails. */
  360|      0|        return 0;
  361|      0|    }
  362|       |
  363|  7.90k|    *plain = PR_FALSE;
  ------------------
  |  |  438|  7.90k|#define PR_FALSE 0
  ------------------
  364|  7.90k|    tag = SECOID_FindOIDTag(&oid);
  ------------------
  |  |  117|  7.90k|#define SECOID_FindOIDTag SECOID_FindOIDTag_Util
  ------------------
  365|  7.90k|    switch (tag) {
  366|      0|        case SEC_OID_SECG_EC_SECP112R1:
  ------------------
  |  Branch (366:9): [True: 0, False: 7.90k]
  ------------------
  367|      0|        case SEC_OID_SECG_EC_SECP112R2:
  ------------------
  |  Branch (367:9): [True: 0, False: 7.90k]
  ------------------
  368|      0|            return 29; /* curve len in bytes = 14 bytes */
  369|      0|        case SEC_OID_SECG_EC_SECT113R1:
  ------------------
  |  Branch (369:9): [True: 0, False: 7.90k]
  ------------------
  370|      0|        case SEC_OID_SECG_EC_SECT113R2:
  ------------------
  |  Branch (370:9): [True: 0, False: 7.90k]
  ------------------
  371|      0|            return 31; /* curve len in bytes = 15 bytes */
  372|      0|        case SEC_OID_SECG_EC_SECP128R1:
  ------------------
  |  Branch (372:9): [True: 0, False: 7.90k]
  ------------------
  373|      0|        case SEC_OID_SECG_EC_SECP128R2:
  ------------------
  |  Branch (373:9): [True: 0, False: 7.90k]
  ------------------
  374|      0|            return 33; /* curve len in bytes = 16 bytes */
  375|      0|        case SEC_OID_SECG_EC_SECT131R1:
  ------------------
  |  Branch (375:9): [True: 0, False: 7.90k]
  ------------------
  376|      0|        case SEC_OID_SECG_EC_SECT131R2:
  ------------------
  |  Branch (376:9): [True: 0, False: 7.90k]
  ------------------
  377|      0|            return 35; /* curve len in bytes = 17 bytes */
  378|      0|        case SEC_OID_SECG_EC_SECP160K1:
  ------------------
  |  Branch (378:9): [True: 0, False: 7.90k]
  ------------------
  379|      0|        case SEC_OID_SECG_EC_SECP160R1:
  ------------------
  |  Branch (379:9): [True: 0, False: 7.90k]
  ------------------
  380|      0|        case SEC_OID_SECG_EC_SECP160R2:
  ------------------
  |  Branch (380:9): [True: 0, False: 7.90k]
  ------------------
  381|      0|            return 41; /* curve len in bytes = 20 bytes */
  382|      0|        case SEC_OID_SECG_EC_SECT163K1:
  ------------------
  |  Branch (382:9): [True: 0, False: 7.90k]
  ------------------
  383|      0|        case SEC_OID_SECG_EC_SECT163R1:
  ------------------
  |  Branch (383:9): [True: 0, False: 7.90k]
  ------------------
  384|      0|        case SEC_OID_SECG_EC_SECT163R2:
  ------------------
  |  Branch (384:9): [True: 0, False: 7.90k]
  ------------------
  385|      0|        case SEC_OID_ANSIX962_EC_C2PNB163V1:
  ------------------
  |  Branch (385:9): [True: 0, False: 7.90k]
  ------------------
  386|      0|        case SEC_OID_ANSIX962_EC_C2PNB163V2:
  ------------------
  |  Branch (386:9): [True: 0, False: 7.90k]
  ------------------
  387|      0|        case SEC_OID_ANSIX962_EC_C2PNB163V3:
  ------------------
  |  Branch (387:9): [True: 0, False: 7.90k]
  ------------------
  388|      0|            return 43; /* curve len in bytes = 21 bytes */
  389|      0|        case SEC_OID_ANSIX962_EC_C2PNB176V1:
  ------------------
  |  Branch (389:9): [True: 0, False: 7.90k]
  ------------------
  390|      0|            return 45; /* curve len in bytes = 22 bytes */
  391|      0|        case SEC_OID_ANSIX962_EC_C2TNB191V1:
  ------------------
  |  Branch (391:9): [True: 0, False: 7.90k]
  ------------------
  392|      0|        case SEC_OID_ANSIX962_EC_C2TNB191V2:
  ------------------
  |  Branch (392:9): [True: 0, False: 7.90k]
  ------------------
  393|      0|        case SEC_OID_ANSIX962_EC_C2TNB191V3:
  ------------------
  |  Branch (393:9): [True: 0, False: 7.90k]
  ------------------
  394|      0|        case SEC_OID_SECG_EC_SECP192K1:
  ------------------
  |  Branch (394:9): [True: 0, False: 7.90k]
  ------------------
  395|      0|        case SEC_OID_ANSIX962_EC_PRIME192V1:
  ------------------
  |  Branch (395:9): [True: 0, False: 7.90k]
  ------------------
  396|      0|        case SEC_OID_ANSIX962_EC_PRIME192V2:
  ------------------
  |  Branch (396:9): [True: 0, False: 7.90k]
  ------------------
  397|      0|        case SEC_OID_ANSIX962_EC_PRIME192V3:
  ------------------
  |  Branch (397:9): [True: 0, False: 7.90k]
  ------------------
  398|      0|            return 49; /*curve len in bytes = 24 bytes */
  399|      0|        case SEC_OID_SECG_EC_SECT193R1:
  ------------------
  |  Branch (399:9): [True: 0, False: 7.90k]
  ------------------
  400|      0|        case SEC_OID_SECG_EC_SECT193R2:
  ------------------
  |  Branch (400:9): [True: 0, False: 7.90k]
  ------------------
  401|      0|            return 51; /*curve len in bytes = 25 bytes */
  402|      0|        case SEC_OID_ANSIX962_EC_C2PNB208W1:
  ------------------
  |  Branch (402:9): [True: 0, False: 7.90k]
  ------------------
  403|      0|            return 53; /*curve len in bytes = 26 bytes */
  404|      0|        case SEC_OID_SECG_EC_SECP224K1:
  ------------------
  |  Branch (404:9): [True: 0, False: 7.90k]
  ------------------
  405|      0|        case SEC_OID_SECG_EC_SECP224R1:
  ------------------
  |  Branch (405:9): [True: 0, False: 7.90k]
  ------------------
  406|      0|            return 57; /*curve len in bytes = 28 bytes */
  407|      0|        case SEC_OID_SECG_EC_SECT233K1:
  ------------------
  |  Branch (407:9): [True: 0, False: 7.90k]
  ------------------
  408|      0|        case SEC_OID_SECG_EC_SECT233R1:
  ------------------
  |  Branch (408:9): [True: 0, False: 7.90k]
  ------------------
  409|      0|        case SEC_OID_SECG_EC_SECT239K1:
  ------------------
  |  Branch (409:9): [True: 0, False: 7.90k]
  ------------------
  410|      0|        case SEC_OID_ANSIX962_EC_PRIME239V1:
  ------------------
  |  Branch (410:9): [True: 0, False: 7.90k]
  ------------------
  411|      0|        case SEC_OID_ANSIX962_EC_PRIME239V2:
  ------------------
  |  Branch (411:9): [True: 0, False: 7.90k]
  ------------------
  412|      0|        case SEC_OID_ANSIX962_EC_PRIME239V3:
  ------------------
  |  Branch (412:9): [True: 0, False: 7.90k]
  ------------------
  413|      0|        case SEC_OID_ANSIX962_EC_C2TNB239V1:
  ------------------
  |  Branch (413:9): [True: 0, False: 7.90k]
  ------------------
  414|      0|        case SEC_OID_ANSIX962_EC_C2TNB239V2:
  ------------------
  |  Branch (414:9): [True: 0, False: 7.90k]
  ------------------
  415|      0|        case SEC_OID_ANSIX962_EC_C2TNB239V3:
  ------------------
  |  Branch (415:9): [True: 0, False: 7.90k]
  ------------------
  416|      0|            return 61; /*curve len in bytes = 30 bytes */
  417|    169|        case SEC_OID_ANSIX962_EC_PRIME256V1:
  ------------------
  |  Branch (417:9): [True: 169, False: 7.73k]
  ------------------
  418|    169|        case SEC_OID_SECG_EC_SECP256K1:
  ------------------
  |  Branch (418:9): [True: 0, False: 7.90k]
  ------------------
  419|    169|            return 65; /*curve len in bytes = 32 bytes */
  420|      0|        case SEC_OID_ANSIX962_EC_C2PNB272W1:
  ------------------
  |  Branch (420:9): [True: 0, False: 7.90k]
  ------------------
  421|      0|            return 69; /*curve len in bytes = 34 bytes */
  422|      0|        case SEC_OID_SECG_EC_SECT283K1:
  ------------------
  |  Branch (422:9): [True: 0, False: 7.90k]
  ------------------
  423|      0|        case SEC_OID_SECG_EC_SECT283R1:
  ------------------
  |  Branch (423:9): [True: 0, False: 7.90k]
  ------------------
  424|      0|            return 73; /*curve len in bytes = 36 bytes */
  425|      0|        case SEC_OID_ANSIX962_EC_C2PNB304W1:
  ------------------
  |  Branch (425:9): [True: 0, False: 7.90k]
  ------------------
  426|      0|            return 77; /*curve len in bytes = 38 bytes */
  427|      0|        case SEC_OID_ANSIX962_EC_C2TNB359V1:
  ------------------
  |  Branch (427:9): [True: 0, False: 7.90k]
  ------------------
  428|      0|            return 91; /*curve len in bytes = 45 bytes */
  429|      0|        case SEC_OID_ANSIX962_EC_C2PNB368W1:
  ------------------
  |  Branch (429:9): [True: 0, False: 7.90k]
  ------------------
  430|      0|            return 93; /*curve len in bytes = 46 bytes */
  431|    145|        case SEC_OID_SECG_EC_SECP384R1:
  ------------------
  |  Branch (431:9): [True: 145, False: 7.75k]
  ------------------
  432|    145|            return 97; /*curve len in bytes = 48 bytes */
  433|      0|        case SEC_OID_SECG_EC_SECT409K1:
  ------------------
  |  Branch (433:9): [True: 0, False: 7.90k]
  ------------------
  434|      0|        case SEC_OID_SECG_EC_SECT409R1:
  ------------------
  |  Branch (434:9): [True: 0, False: 7.90k]
  ------------------
  435|      0|            return 105; /*curve len in bytes = 52 bytes */
  436|      0|        case SEC_OID_ANSIX962_EC_C2TNB431R1:
  ------------------
  |  Branch (436:9): [True: 0, False: 7.90k]
  ------------------
  437|      0|            return 109; /*curve len in bytes = 54 bytes */
  438|     32|        case SEC_OID_SECG_EC_SECP521R1:
  ------------------
  |  Branch (438:9): [True: 32, False: 7.86k]
  ------------------
  439|     32|            return 133; /*curve len in bytes = 66 bytes */
  440|      0|        case SEC_OID_SECG_EC_SECT571K1:
  ------------------
  |  Branch (440:9): [True: 0, False: 7.90k]
  ------------------
  441|      0|        case SEC_OID_SECG_EC_SECT571R1:
  ------------------
  |  Branch (441:9): [True: 0, False: 7.90k]
  ------------------
  442|      0|            return 145; /*curve len in bytes = 72 bytes */
  443|      0|        case SEC_OID_X25519:
  ------------------
  |  Branch (443:9): [True: 0, False: 7.90k]
  ------------------
  444|  7.55k|        case SEC_OID_CURVE25519:
  ------------------
  |  Branch (444:9): [True: 7.55k, False: 346]
  ------------------
  445|  7.55k|        case SEC_OID_ED25519_PUBLIC_KEY:
  ------------------
  |  Branch (445:9): [True: 0, False: 7.90k]
  ------------------
  446|  7.55k|            *plain = PR_TRUE;
  ------------------
  |  |  437|  7.55k|#define PR_TRUE 1
  ------------------
  447|  7.55k|            return 32; /* curve len in bytes = 32 bytes (only X) */
  448|       |        /* unknown or unrecognized OIDs. return unknown length */
  449|      0|        default:
  ------------------
  |  Branch (449:9): [True: 0, False: 7.90k]
  ------------------
  450|      0|            break;
  451|  7.90k|    }
  452|      0|    return 0;
  453|  7.90k|}

pk11_LoginStillRequired:
  311|  7.23k|{
  312|  7.23k|    return slot->needLogin && !PK11_IsLoggedIn(slot, wincx);
  ------------------
  |  Branch (312:12): [True: 0, False: 7.23k]
  |  Branch (312:31): [True: 0, False: 0]
  ------------------
  313|  7.23k|}

PK11_EnterContextMonitor:
   36|   138k|{
   37|       |    /* if we own the session and our slot is ThreadSafe, only monitor
   38|       |     * the Context */
   39|   138k|    if ((cx->ownSession) && (cx->slot->isThreadSafe)) {
  ------------------
  |  Branch (39:9): [True: 138k, False: 0]
  |  Branch (39:29): [True: 138k, False: 0]
  ------------------
   40|       |        /* Should this use monitors instead? */
   41|   138k|        PZ_Lock(cx->sessionLock);
  ------------------
  |  |  245|   138k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
   42|   138k|    } else {
   43|      0|        PK11_EnterSlotMonitor(cx->slot);
   44|      0|    }
   45|   138k|}
PK11_ExitContextMonitor:
   49|   138k|{
   50|       |    /* if we own the session and our slot is ThreadSafe, only monitor
   51|       |     * the Context */
   52|   138k|    if ((cx->ownSession) && (cx->slot->isThreadSafe)) {
  ------------------
  |  Branch (52:9): [True: 138k, False: 0]
  |  Branch (52:29): [True: 138k, False: 0]
  ------------------
   53|       |        /* Should this use monitors instead? */
   54|   138k|        PZ_Unlock(cx->sessionLock);
  ------------------
  |  |  246|   138k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
   55|   138k|    } else {
   56|      0|        PK11_ExitSlotMonitor(cx->slot);
   57|      0|    }
   58|   138k|}
PK11_DestroyContext:
   65|  46.7k|{
   66|  46.7k|    pk11_CloseSession(context->slot, context->session, context->ownSession);
   67|       |    /* initialize the critical fields of the context */
   68|  46.7k|    if (context->savedData != NULL)
  ------------------
  |  Branch (68:9): [True: 0, False: 46.7k]
  ------------------
   69|      0|        PORT_Free(context->savedData);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
   70|  46.7k|    if (context->key)
  ------------------
  |  Branch (70:9): [True: 13.1k, False: 33.5k]
  ------------------
   71|  13.1k|        PK11_FreeSymKey(context->key);
   72|  46.7k|    if (context->param && context->param != &pk11_null_params)
  ------------------
  |  Branch (72:9): [True: 46.7k, False: 0]
  |  Branch (72:27): [True: 7.44k, False: 39.3k]
  ------------------
   73|  7.44k|        SECITEM_FreeItem(context->param, PR_TRUE);
  ------------------
  |  |  108|  7.44k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(context->param, PR_TRUE);
  ------------------
  |  |  437|  7.44k|#define PR_TRUE 1
  ------------------
   74|  46.7k|    if (context->sessionLock)
  ------------------
  |  Branch (74:9): [True: 46.7k, False: 0]
  ------------------
   75|  46.7k|        PZ_DestroyLock(context->sessionLock);
  ------------------
  |  |  244|  46.7k|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
   76|  46.7k|    PK11_FreeSlot(context->slot);
   77|  46.7k|    if (freeit)
  ------------------
  |  Branch (77:9): [True: 46.7k, False: 0]
  ------------------
   78|  46.7k|        PORT_Free(context);
  ------------------
  |  |   60|  46.7k|#define PORT_Free PORT_Free_Util
  ------------------
   79|  46.7k|}
pk11_saveContext:
  116|  1.69k|{
  117|  1.69k|    return pk11_saveContextHelper(context,
  118|  1.69k|                                  (unsigned char *)space, savedLength);
  119|  1.69k|}
pk11_restoreContext:
  126|  2.06k|{
  127|  2.06k|    CK_RV crv;
  128|  2.06k|    CK_OBJECT_HANDLE objectID = context->objectID;
  129|       |
  130|  2.06k|    PORT_Assert(space != NULL);
  ------------------
  |  |  120|  2.06k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.06k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2.06k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  131|  2.06k|    if (space == NULL) {
  ------------------
  |  Branch (131:9): [True: 0, False: 2.06k]
  ------------------
  132|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  133|      0|        return SECFailure;
  134|      0|    }
  135|  2.06k|    crv = PK11_GETTAB(context->slot)->C_SetOperationState(context->session, (CK_BYTE_PTR)space, savedLength, objectID, 0);
  ------------------
  |  |  102|  2.06k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  136|  2.06k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  2.06k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (136:9): [True: 0, False: 2.06k]
  ------------------
  137|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  138|      0|        return SECFailure;
  139|      0|    }
  140|  2.06k|    return SECSuccess;
  141|  2.06k|}
PK11_CreateContextBySymKey:
  495|  13.1k|{
  496|  13.1k|    PK11SymKey *newKey;
  497|  13.1k|    PK11Context *context;
  498|       |
  499|       |    /* if this slot doesn't support the mechanism, go to a slot that does */
  500|  13.1k|    newKey = pk11_ForceSlot(symKey, type, operation);
  501|  13.1k|    if (newKey == NULL) {
  ------------------
  |  Branch (501:9): [True: 13.1k, False: 0]
  ------------------
  502|  13.1k|        PK11_ReferenceSymKey(symKey);
  503|  13.1k|    } else {
  504|      0|        symKey = newKey;
  505|      0|    }
  506|       |
  507|       |    /* Context keeps its reference to the symKey, so it's safe to
  508|       |     * free our reference we we are through, even though we may have
  509|       |     * created the key using pk11_ForceSlot. */
  510|  13.1k|    context = pk11_CreateNewContextInSlot(type, symKey->slot, operation, symKey,
  511|  13.1k|                                          symKey->objectID, param, symKey->cx);
  512|  13.1k|    PK11_FreeSymKey(symKey);
  513|  13.1k|    return context;
  514|  13.1k|}
PK11_CreateDigestContext:
  579|  31.9k|{
  580|       |    /* digesting has to work without authentication to the slot */
  581|  31.9k|    CK_MECHANISM_TYPE type;
  582|  31.9k|    PK11SlotInfo *slot;
  583|  31.9k|    PK11Context *context;
  584|  31.9k|    SECItem param;
  585|       |
  586|  31.9k|    type = PK11_AlgtagToMechanism(hashAlg);
  587|  31.9k|    slot = PK11_GetBestSlot(type, NULL);
  588|  31.9k|    if (slot == NULL) {
  ------------------
  |  Branch (588:9): [True: 0, False: 31.9k]
  ------------------
  589|      0|        PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  590|      0|        return NULL;
  591|      0|    }
  592|       |
  593|       |    /* maybe should really be PK11_GenerateNewParam?? */
  594|  31.9k|    param.data = NULL;
  595|  31.9k|    param.len = 0;
  596|  31.9k|    param.type = 0;
  597|       |
  598|  31.9k|    context = pk11_CreateNewContextInSlot(type, slot, CKA_DIGEST, NULL,
  ------------------
  |  |   68|  31.9k|#define CKA_DIGEST 0x81000000L
  ------------------
  599|  31.9k|                                          CK_INVALID_HANDLE, &param, NULL);
  ------------------
  |  |   78|  31.9k|#define CK_INVALID_HANDLE 0
  ------------------
  600|  31.9k|    PK11_FreeSlot(slot);
  601|  31.9k|    return context;
  602|  31.9k|}
PK11_CloneContext:
  609|  1.69k|{
  610|  1.69k|    PK11Context *newcx;
  611|  1.69k|    PRBool needFree = PR_FALSE;
  ------------------
  |  |  438|  1.69k|#define PR_FALSE 0
  ------------------
  612|  1.69k|    SECStatus rv = SECSuccess;
  613|  1.69k|    void *data;
  614|  1.69k|    unsigned long len;
  615|       |
  616|  1.69k|    newcx = pk11_CreateNewContextInSlot(old->type, old->slot, old->operation,
  617|  1.69k|                                        old->key, old->objectID, old->param,
  618|  1.69k|                                        old->pwArg);
  619|  1.69k|    if (newcx == NULL)
  ------------------
  |  Branch (619:9): [True: 0, False: 1.69k]
  ------------------
  620|      0|        return NULL;
  621|       |
  622|       |    /* now clone the save state. First we need to find the save state
  623|       |     * of the old session. If the old context owns it's session,
  624|       |     * the state needs to be saved, otherwise the state is in saveData. */
  625|  1.69k|    if (old->ownSession) {
  ------------------
  |  Branch (625:9): [True: 1.69k, False: 0]
  ------------------
  626|  1.69k|        PK11_EnterContextMonitor(old);
  627|  1.69k|        data = pk11_saveContext(old, NULL, &len);
  628|  1.69k|        PK11_ExitContextMonitor(old);
  629|  1.69k|        needFree = PR_TRUE;
  ------------------
  |  |  437|  1.69k|#define PR_TRUE 1
  ------------------
  630|  1.69k|    } else {
  631|      0|        data = old->savedData;
  632|      0|        len = old->savedLength;
  633|      0|    }
  634|       |
  635|  1.69k|    if (data == NULL) {
  ------------------
  |  Branch (635:9): [True: 0, False: 1.69k]
  ------------------
  636|      0|        PK11_DestroyContext(newcx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  637|      0|        return NULL;
  638|      0|    }
  639|       |
  640|       |    /* now copy that state into our new context. Again we have different
  641|       |     * work if the new context owns it's own session. If it does, we
  642|       |     * restore the state gathered above. If it doesn't, we copy the
  643|       |     * saveData pointer... */
  644|  1.69k|    if (newcx->ownSession) {
  ------------------
  |  Branch (644:9): [True: 1.69k, False: 0]
  ------------------
  645|  1.69k|        PK11_EnterContextMonitor(newcx);
  646|  1.69k|        rv = pk11_restoreContext(newcx, data, len);
  647|  1.69k|        PK11_ExitContextMonitor(newcx);
  648|  1.69k|    } else {
  649|      0|        PORT_Assert(newcx->savedData != NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  650|      0|        if ((newcx->savedData == NULL) || (newcx->savedLength < len)) {
  ------------------
  |  Branch (650:13): [True: 0, False: 0]
  |  Branch (650:43): [True: 0, False: 0]
  ------------------
  651|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  652|      0|            rv = SECFailure;
  653|      0|        } else {
  654|      0|            PORT_Memcpy(newcx->savedData, data, len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  655|      0|            newcx->savedLength = len;
  656|      0|        }
  657|      0|    }
  658|       |
  659|  1.69k|    if (needFree)
  ------------------
  |  Branch (659:9): [True: 1.69k, False: 0]
  ------------------
  660|  1.69k|        PORT_Free(data);
  ------------------
  |  |   60|  1.69k|#define PORT_Free PORT_Free_Util
  ------------------
  661|       |
  662|  1.69k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (662:9): [True: 0, False: 1.69k]
  ------------------
  663|      0|        PK11_DestroyContext(newcx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  664|      0|        return NULL;
  665|      0|    }
  666|  1.69k|    return newcx;
  667|  1.69k|}
PK11_SaveContextAlloc:
  707|    370|{
  708|    370|    unsigned char *stateBuf = NULL;
  709|    370|    unsigned long length = (unsigned long)pabLen;
  710|       |
  711|    370|    if (cx->ownSession) {
  ------------------
  |  Branch (711:9): [True: 370, False: 0]
  ------------------
  712|    370|        PK11_EnterContextMonitor(cx);
  713|    370|        stateBuf = pk11_saveContextHelper(cx, preAllocBuf, &length);
  714|    370|        PK11_ExitContextMonitor(cx);
  715|    370|        *stateLen = (stateBuf != NULL) ? length : 0;
  ------------------
  |  Branch (715:21): [True: 370, False: 0]
  ------------------
  716|    370|    } else {
  717|      0|        if (pabLen < cx->savedLength) {
  ------------------
  |  Branch (717:13): [True: 0, False: 0]
  ------------------
  718|      0|            stateBuf = (unsigned char *)PORT_Alloc(cx->savedLength);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  719|      0|            if (!stateBuf) {
  ------------------
  |  Branch (719:17): [True: 0, False: 0]
  ------------------
  720|      0|                return (unsigned char *)NULL;
  721|      0|            }
  722|      0|        } else {
  723|      0|            stateBuf = preAllocBuf;
  724|      0|        }
  725|      0|        if (cx->savedData) {
  ------------------
  |  Branch (725:13): [True: 0, False: 0]
  ------------------
  726|      0|            PORT_Memcpy(stateBuf, cx->savedData, cx->savedLength);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  727|      0|        }
  728|      0|        *stateLen = cx->savedLength;
  729|      0|    }
  730|    370|    return stateBuf;
  731|    370|}
PK11_RestoreContext:
  739|    370|{
  740|    370|    SECStatus rv = SECSuccess;
  741|    370|    if (cx->ownSession) {
  ------------------
  |  Branch (741:9): [True: 370, False: 0]
  ------------------
  742|    370|        PK11_EnterContextMonitor(cx);
  743|    370|        pk11_Finalize(cx);
  744|    370|        rv = pk11_restoreContext(cx, save, len);
  745|    370|        PK11_ExitContextMonitor(cx);
  746|    370|    } else {
  747|      0|        PORT_Assert(cx->savedData != NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  748|      0|        if ((cx->savedData == NULL) || (cx->savedLength < (unsigned)len)) {
  ------------------
  |  Branch (748:13): [True: 0, False: 0]
  |  Branch (748:40): [True: 0, False: 0]
  ------------------
  749|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  750|      0|            rv = SECFailure;
  751|      0|        } else {
  752|      0|            PORT_Memcpy(cx->savedData, save, len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  753|      0|            cx->savedLength = len;
  754|      0|        }
  755|      0|    }
  756|    370|    return rv;
  757|    370|}
PK11_DigestBegin:
  781|  38.2k|{
  782|  38.2k|    CK_MECHANISM mech_info;
  783|  38.2k|    SECStatus rv;
  784|       |
  785|  38.2k|    if (cx->init == PR_TRUE) {
  ------------------
  |  |  437|  38.2k|#define PR_TRUE 1
  ------------------
  |  Branch (785:9): [True: 38.2k, False: 0]
  ------------------
  786|  38.2k|        return SECSuccess;
  787|  38.2k|    }
  788|       |
  789|       |    /*
  790|       |     * make sure the old context is clear first
  791|       |     */
  792|      0|    PK11_EnterContextMonitor(cx);
  793|      0|    pk11_Finalize(cx);
  794|      0|    PK11_ExitContextMonitor(cx);
  795|       |
  796|      0|    mech_info.mechanism = cx->type;
  797|      0|    mech_info.pParameter = cx->param->data;
  798|      0|    mech_info.ulParameterLen = cx->param->len;
  799|      0|    rv = pk11_context_init(cx, &mech_info);
  800|       |
  801|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (801:9): [True: 0, False: 0]
  ------------------
  802|      0|        return SECFailure;
  803|      0|    }
  804|      0|    cx->init = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  805|      0|    return SECSuccess;
  806|      0|}
PK11_HashBuf:
  811|  14.8k|{
  812|  14.8k|    PK11Context *context;
  813|  14.8k|    unsigned int max_length;
  814|  14.8k|    unsigned int out_length;
  815|  14.8k|    SECStatus rv;
  816|       |
  817|       |    /* len will be passed to PK11_DigestOp as unsigned. */
  818|  14.8k|    if (len < 0) {
  ------------------
  |  Branch (818:9): [True: 0, False: 14.8k]
  ------------------
  819|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  820|      0|        return SECFailure;
  821|      0|    }
  822|       |
  823|  14.8k|    context = PK11_CreateDigestContext(hashAlg);
  824|  14.8k|    if (context == NULL)
  ------------------
  |  Branch (824:9): [True: 0, False: 14.8k]
  ------------------
  825|      0|        return SECFailure;
  826|       |
  827|  14.8k|    rv = PK11_DigestBegin(context);
  828|  14.8k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (828:9): [True: 0, False: 14.8k]
  ------------------
  829|      0|        PK11_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  830|      0|        return rv;
  831|      0|    }
  832|       |
  833|  14.8k|    rv = PK11_DigestOp(context, in, len);
  834|  14.8k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (834:9): [True: 0, False: 14.8k]
  ------------------
  835|      0|        PK11_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  836|      0|        return rv;
  837|      0|    }
  838|       |
  839|       |    /* XXX This really should have been an argument to this function! */
  840|  14.8k|    max_length = HASH_ResultLenByOidTag(hashAlg);
  841|  14.8k|    PORT_Assert(max_length);
  ------------------
  |  |  120|  14.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  842|  14.8k|    if (!max_length)
  ------------------
  |  Branch (842:9): [True: 0, False: 14.8k]
  ------------------
  843|      0|        max_length = HASH_LENGTH_MAX;
  ------------------
  |  |   48|      0|#define HASH_LENGTH_MAX SHA512_LENGTH
  |  |  ------------------
  |  |  |  |   43|      0|#define SHA512_LENGTH 64
  |  |  ------------------
  ------------------
  844|       |
  845|  14.8k|    rv = PK11_DigestFinal(context, out, &out_length, max_length);
  846|  14.8k|    PK11_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|  14.8k|#define PR_TRUE 1
  ------------------
  847|  14.8k|    return rv;
  848|  14.8k|}
PK11_DigestOp:
 1491|  55.2k|{
 1492|  55.2k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  55.2k|#define CKR_OK 0x00000000UL
  ------------------
 1493|  55.2k|    SECStatus rv = SECSuccess;
 1494|       |
 1495|  55.2k|    if (inLen == 0) {
  ------------------
  |  Branch (1495:9): [True: 6.01k, False: 49.2k]
  ------------------
 1496|  6.01k|        return SECSuccess;
 1497|  6.01k|    }
 1498|  49.2k|    if (!in) {
  ------------------
  |  Branch (1498:9): [True: 0, False: 49.2k]
  ------------------
 1499|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1500|      0|        return SECFailure;
 1501|      0|    }
 1502|       |
 1503|       |    /* if we ran out of session, we need to restore our previously stored
 1504|       |     * state.
 1505|       |     */
 1506|  49.2k|    context->init = PR_FALSE;
  ------------------
  |  |  438|  49.2k|#define PR_FALSE 0
  ------------------
 1507|  49.2k|    PK11_EnterContextMonitor(context);
 1508|  49.2k|    if (!context->ownSession) {
  ------------------
  |  Branch (1508:9): [True: 0, False: 49.2k]
  ------------------
 1509|      0|        rv = pk11_restoreContext(context, context->savedData,
 1510|      0|                                 context->savedLength);
 1511|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1511:13): [True: 0, False: 0]
  ------------------
 1512|      0|            PK11_ExitContextMonitor(context);
 1513|      0|            return rv;
 1514|      0|        }
 1515|      0|    }
 1516|       |
 1517|  49.2k|    switch (context->operation) {
 1518|       |        /* also for MAC'ing */
 1519|  6.36k|        case CKA_SIGN:
  ------------------
  |  |  551|  6.36k|#define CKA_SIGN 0x00000108UL
  ------------------
  |  Branch (1519:9): [True: 6.36k, False: 42.8k]
  ------------------
 1520|  6.36k|            crv = PK11_GETTAB(context->slot)->C_SignUpdate(context->session, (unsigned char *)in, inLen);
  ------------------
  |  |  102|  6.36k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1521|  6.36k|            break;
 1522|      0|        case CKA_VERIFY:
  ------------------
  |  |  553|      0|#define CKA_VERIFY 0x0000010AUL
  ------------------
  |  Branch (1522:9): [True: 0, False: 49.2k]
  ------------------
 1523|      0|            crv = PK11_GETTAB(context->slot)->C_VerifyUpdate(context->session, (unsigned char *)in, inLen);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1524|      0|            break;
 1525|  42.8k|        case CKA_DIGEST:
  ------------------
  |  |   68|  42.8k|#define CKA_DIGEST 0x81000000L
  ------------------
  |  Branch (1525:9): [True: 42.8k, False: 6.36k]
  ------------------
 1526|  42.8k|            crv = PK11_GETTAB(context->slot)->C_DigestUpdate(context->session, (unsigned char *)in, inLen);
  ------------------
  |  |  102|  42.8k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1527|  42.8k|            break;
 1528|      0|        default:
  ------------------
  |  Branch (1528:9): [True: 0, False: 49.2k]
  ------------------
 1529|      0|            crv = CKR_OPERATION_NOT_INITIALIZED;
  ------------------
  |  | 1454|      0|#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL
  ------------------
 1530|      0|            break;
 1531|  49.2k|    }
 1532|       |
 1533|  49.2k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  49.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1533:9): [True: 0, False: 49.2k]
  ------------------
 1534|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1535|      0|        rv = SECFailure;
 1536|      0|    }
 1537|       |
 1538|       |    /*
 1539|       |     * handle session starvation case.. use our last session to multiplex
 1540|       |     */
 1541|  49.2k|    if (!context->ownSession) {
  ------------------
  |  Branch (1541:9): [True: 0, False: 49.2k]
  ------------------
 1542|      0|        context->savedData = pk11_saveContext(context, context->savedData,
 1543|      0|                                              &context->savedLength);
 1544|      0|        if (context->savedData == NULL)
  ------------------
  |  Branch (1544:13): [True: 0, False: 0]
  ------------------
 1545|      0|            rv = SECFailure;
 1546|       |
 1547|       |        /* clear out out session for others to use */
 1548|      0|        pk11_Finalize(context);
 1549|      0|    }
 1550|  49.2k|    PK11_ExitContextMonitor(context);
 1551|  49.2k|    return rv;
 1552|  49.2k|}
pk11_Finalize:
 1642|    370|{
 1643|    370|    CK_ULONG count = 0;
 1644|    370|    CK_RV crv;
 1645|    370|    unsigned char stackBuf[256];
 1646|    370|    unsigned char *buffer = NULL;
 1647|       |
 1648|    370|    if (!context->ownSession) {
  ------------------
  |  Branch (1648:9): [True: 0, False: 370]
  ------------------
 1649|      0|        return SECSuccess;
 1650|      0|    }
 1651|       |
 1652|    370|finalize:
 1653|    370|    switch (context->operation) {
 1654|      0|        case CKA_ENCRYPT:
  ------------------
  |  |  547|      0|#define CKA_ENCRYPT 0x00000104UL
  ------------------
  |  Branch (1654:9): [True: 0, False: 370]
  ------------------
 1655|      0|            crv = PK11_GETTAB(context->slot)->C_EncryptFinal(context->session, buffer, &count);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1656|      0|            break;
 1657|      0|        case CKA_DECRYPT:
  ------------------
  |  |  548|      0|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (1657:9): [True: 0, False: 370]
  ------------------
 1658|      0|            crv = PK11_GETTAB(context->slot)->C_DecryptFinal(context->session, buffer, &count);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1659|      0|            break;
 1660|      0|        case CKA_SIGN:
  ------------------
  |  |  551|      0|#define CKA_SIGN 0x00000108UL
  ------------------
  |  Branch (1660:9): [True: 0, False: 370]
  ------------------
 1661|      0|            crv = PK11_GETTAB(context->slot)->C_SignFinal(context->session, buffer, &count);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1662|      0|            break;
 1663|      0|        case CKA_VERIFY:
  ------------------
  |  |  553|      0|#define CKA_VERIFY 0x0000010AUL
  ------------------
  |  Branch (1663:9): [True: 0, False: 370]
  ------------------
 1664|      0|            crv = PK11_GETTAB(context->slot)->C_VerifyFinal(context->session, buffer, count);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1665|      0|            break;
 1666|    370|        case CKA_DIGEST:
  ------------------
  |  |   68|    370|#define CKA_DIGEST 0x81000000L
  ------------------
  |  Branch (1666:9): [True: 370, False: 0]
  ------------------
 1667|    370|            crv = PK11_GETTAB(context->slot)->C_DigestFinal(context->session, buffer, &count);
  ------------------
  |  |  102|    370|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1668|    370|            break;
 1669|      0|        case CKA_NSS_MESSAGE | CKA_ENCRYPT:
  ------------------
  |  |   69|      0|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_ENCRYPT:
  ------------------
  |  |  547|      0|#define CKA_ENCRYPT 0x00000104UL
  ------------------
  |  Branch (1669:9): [True: 0, False: 370]
  ------------------
 1670|      0|            crv = PK11_GETTAB(context->slot)->C_MessageEncryptFinal(context->session);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1671|      0|            break;
 1672|      0|        case CKA_NSS_MESSAGE | CKA_DECRYPT:
  ------------------
  |  |   69|      0|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_DECRYPT:
  ------------------
  |  |  548|      0|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (1672:9): [True: 0, False: 370]
  ------------------
 1673|      0|            crv = PK11_GETTAB(context->slot)->C_MessageDecryptFinal(context->session);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1674|      0|            break;
 1675|      0|        case CKA_NSS_MESSAGE | CKA_SIGN:
  ------------------
  |  |   69|      0|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_SIGN:
  ------------------
  |  |  551|      0|#define CKA_SIGN 0x00000108UL
  ------------------
  |  Branch (1675:9): [True: 0, False: 370]
  ------------------
 1676|      0|            crv = PK11_GETTAB(context->slot)->C_MessageSignFinal(context->session);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1677|      0|            break;
 1678|      0|        case CKA_NSS_MESSAGE | CKA_VERIFY:
  ------------------
  |  |   69|      0|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_VERIFY:
  ------------------
  |  |  553|      0|#define CKA_VERIFY 0x0000010AUL
  ------------------
  |  Branch (1678:9): [True: 0, False: 370]
  ------------------
 1679|      0|            crv = PK11_GETTAB(context->slot)->C_MessageVerifyFinal(context->session);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1680|      0|            break;
 1681|      0|        default:
  ------------------
  |  Branch (1681:9): [True: 0, False: 370]
  ------------------
 1682|      0|            crv = CKR_OPERATION_NOT_INITIALIZED;
  ------------------
  |  | 1454|      0|#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL
  ------------------
 1683|      0|            break;
 1684|    370|    }
 1685|       |
 1686|    370|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|    370|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1686:9): [True: 370, False: 0]
  ------------------
 1687|    370|        if (buffer != stackBuf) {
  ------------------
  |  Branch (1687:13): [True: 370, False: 0]
  ------------------
 1688|    370|            PORT_Free(buffer);
  ------------------
  |  |   60|    370|#define PORT_Free PORT_Free_Util
  ------------------
 1689|    370|        }
 1690|    370|        if (crv == CKR_OPERATION_NOT_INITIALIZED) {
  ------------------
  |  | 1454|    370|#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL
  ------------------
  |  Branch (1690:13): [True: 370, False: 0]
  ------------------
 1691|       |            /* if there's no operation, it is finalized */
 1692|    370|            return SECSuccess;
 1693|    370|        }
 1694|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1695|      0|        return SECFailure;
 1696|    370|    }
 1697|       |
 1698|       |    /* Message interface does not need to allocate a final buffer */
 1699|      0|    if (((context->operation) & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   70|      0|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
                  if (((context->operation) & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   69|      0|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
  |  Branch (1699:9): [True: 0, False: 0]
  ------------------
 1700|      0|        return SECSuccess;
 1701|      0|    }
 1702|       |
 1703|       |    /* try to finalize the session with a buffer */
 1704|      0|    if (buffer == NULL) {
  ------------------
  |  Branch (1704:9): [True: 0, False: 0]
  ------------------
 1705|      0|        if (count <= sizeof stackBuf) {
  ------------------
  |  Branch (1705:13): [True: 0, False: 0]
  ------------------
 1706|      0|            buffer = stackBuf;
 1707|      0|        } else {
 1708|      0|            buffer = PORT_Alloc(count);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1709|      0|            if (buffer == NULL) {
  ------------------
  |  Branch (1709:17): [True: 0, False: 0]
  ------------------
 1710|      0|                return SECFailure;
 1711|      0|            }
 1712|      0|        }
 1713|      0|        goto finalize;
 1714|      0|    }
 1715|      0|    if (buffer != stackBuf) {
  ------------------
  |  Branch (1715:9): [True: 0, False: 0]
  ------------------
 1716|      0|        PORT_Free(buffer);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1717|      0|    }
 1718|      0|    return SECSuccess;
 1719|      0|}
PK11_DigestFinal:
 1729|  38.6k|{
 1730|  38.6k|    CK_ULONG len;
 1731|  38.6k|    CK_RV crv;
 1732|  38.6k|    SECStatus rv;
 1733|       |
 1734|       |    /* message interface returns no data on Final, Should not use DigestFinal
 1735|       |     * in this case */
 1736|  38.6k|    if (((context->operation) & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   70|  38.6k|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
                  if (((context->operation) & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   69|  38.6k|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
  |  Branch (1736:9): [True: 0, False: 38.6k]
  ------------------
 1737|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1738|      0|        return SECFailure;
 1739|      0|    }
 1740|       |
 1741|       |    /* if we ran out of session, we need to restore our previously stored
 1742|       |     * state.
 1743|       |     */
 1744|  38.6k|    PK11_EnterContextMonitor(context);
 1745|  38.6k|    if (!context->ownSession) {
  ------------------
  |  Branch (1745:9): [True: 0, False: 38.6k]
  ------------------
 1746|      0|        rv = pk11_restoreContext(context, context->savedData,
 1747|      0|                                 context->savedLength);
 1748|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1748:13): [True: 0, False: 0]
  ------------------
 1749|      0|            PK11_ExitContextMonitor(context);
 1750|      0|            return rv;
 1751|      0|        }
 1752|      0|    }
 1753|       |
 1754|  38.6k|    len = length;
 1755|  38.6k|    switch (context->operation) {
 1756|  6.36k|        case CKA_SIGN:
  ------------------
  |  |  551|  6.36k|#define CKA_SIGN 0x00000108UL
  ------------------
  |  Branch (1756:9): [True: 6.36k, False: 32.2k]
  ------------------
 1757|  6.36k|            crv = PK11_GETTAB(context->slot)->C_SignFinal(context->session, data, &len);
  ------------------
  |  |  102|  6.36k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1758|  6.36k|            break;
 1759|      0|        case CKA_VERIFY:
  ------------------
  |  |  553|      0|#define CKA_VERIFY 0x0000010AUL
  ------------------
  |  Branch (1759:9): [True: 0, False: 38.6k]
  ------------------
 1760|      0|            crv = PK11_GETTAB(context->slot)->C_VerifyFinal(context->session, data, len);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1761|      0|            break;
 1762|  32.2k|        case CKA_DIGEST:
  ------------------
  |  |   68|  32.2k|#define CKA_DIGEST 0x81000000L
  ------------------
  |  Branch (1762:9): [True: 32.2k, False: 6.36k]
  ------------------
 1763|  32.2k|            crv = PK11_GETTAB(context->slot)->C_DigestFinal(context->session, data, &len);
  ------------------
  |  |  102|  32.2k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1764|  32.2k|            break;
 1765|      0|        case CKA_ENCRYPT:
  ------------------
  |  |  547|      0|#define CKA_ENCRYPT 0x00000104UL
  ------------------
  |  Branch (1765:9): [True: 0, False: 38.6k]
  ------------------
 1766|      0|            crv = PK11_GETTAB(context->slot)->C_EncryptFinal(context->session, data, &len);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1767|      0|            break;
 1768|      0|        case CKA_DECRYPT:
  ------------------
  |  |  548|      0|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (1768:9): [True: 0, False: 38.6k]
  ------------------
 1769|      0|            crv = PK11_GETTAB(context->slot)->C_DecryptFinal(context->session, data, &len);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1770|      0|            break;
 1771|      0|        default:
  ------------------
  |  Branch (1771:9): [True: 0, False: 38.6k]
  ------------------
 1772|      0|            crv = CKR_OPERATION_NOT_INITIALIZED;
  ------------------
  |  | 1454|      0|#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL
  ------------------
 1773|      0|            break;
 1774|  38.6k|    }
 1775|  38.6k|    PK11_ExitContextMonitor(context);
 1776|       |
 1777|  38.6k|    context->init = PR_FALSE; /* allow Begin to start up again */
  ------------------
  |  |  438|  38.6k|#define PR_FALSE 0
  ------------------
 1778|       |
 1779|  38.6k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  38.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1779:9): [True: 0, False: 38.6k]
  ------------------
 1780|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1781|      0|        return SECFailure;
 1782|      0|    }
 1783|  38.6k|    *outLen = (unsigned int)len;
 1784|  38.6k|    return SECSuccess;
 1785|  38.6k|}
pk11cxt.c:pk11_saveContextHelper:
   87|  2.06k|{
   88|  2.06k|    CK_RV crv;
   89|       |
   90|       |    /* If buffer is NULL, this will get the length */
   91|  2.06k|    crv = PK11_GETTAB(context->slot)->C_GetOperationState(context->session, (CK_BYTE_PTR)buffer, savedLength);
  ------------------
  |  |  102|  2.06k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
   92|  2.06k|    if (!buffer || (crv == CKR_BUFFER_TOO_SMALL)) {
  ------------------
  |  | 1514|    370|#define CKR_BUFFER_TOO_SMALL 0x00000150UL
  ------------------
  |  Branch (92:9): [True: 1.69k, False: 370]
  |  Branch (92:20): [True: 0, False: 370]
  ------------------
   93|       |        /* the given buffer wasn't big enough (or was NULL), but we
   94|       |         * have the length, so try again with a new buffer and the
   95|       |         * correct length
   96|       |         */
   97|  1.69k|        unsigned long bufLen = *savedLength;
   98|  1.69k|        buffer = PORT_Alloc(bufLen);
  ------------------
  |  |   52|  1.69k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
   99|  1.69k|        if (buffer == NULL) {
  ------------------
  |  Branch (99:13): [True: 0, False: 1.69k]
  ------------------
  100|      0|            return (unsigned char *)NULL;
  101|      0|        }
  102|  1.69k|        crv = PK11_GETTAB(context->slot)->C_GetOperationState(context->session, (CK_BYTE_PTR)buffer, savedLength);
  ------------------
  |  |  102|  1.69k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  103|  1.69k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.69k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (103:13): [True: 0, False: 1.69k]
  ------------------
  104|      0|            PORT_ZFree(buffer, bufLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  105|      0|        }
  106|  1.69k|    }
  107|  2.06k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  2.06k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (107:9): [True: 0, False: 2.06k]
  ------------------
  108|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  109|      0|        return (unsigned char *)NULL;
  110|      0|    }
  111|  2.06k|    return buffer;
  112|  2.06k|}
pk11cxt.c:pk11_CreateNewContextInSlot:
  360|  46.7k|{
  361|  46.7k|    CK_MECHANISM mech_info;
  362|  46.7k|    PK11Context *context;
  363|  46.7k|    SECStatus rv;
  364|       |
  365|  46.7k|    PORT_Assert(slot != NULL);
  ------------------
  |  |  120|  46.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  46.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 46.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  366|  46.7k|    if (!slot || ((objectID == CK_INVALID_HANDLE) && ((operation != CKA_DIGEST) ||
  ------------------
  |  |   78|  46.7k|#define CK_INVALID_HANDLE 0
  ------------------
                  if (!slot || ((objectID == CK_INVALID_HANDLE) && ((operation != CKA_DIGEST) ||
  ------------------
  |  |   68|  33.5k|#define CKA_DIGEST 0x81000000L
  ------------------
  |  Branch (366:9): [True: 0, False: 46.7k]
  |  Branch (366:19): [True: 33.5k, False: 13.1k]
  |  Branch (366:55): [True: 0, False: 33.5k]
  ------------------
  367|  33.5k|                                                      (type == CKM_SKIPJACK_CBC64)))) {
  ------------------
  |  | 1049|  33.5k|#define CKM_SKIPJACK_CBC64 0x00001002UL
  ------------------
  |  Branch (367:55): [True: 0, False: 33.5k]
  ------------------
  368|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  369|      0|        return NULL;
  370|      0|    }
  371|  46.7k|    context = (PK11Context *)PORT_Alloc(sizeof(PK11Context));
  ------------------
  |  |   52|  46.7k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  372|  46.7k|    if (context == NULL) {
  ------------------
  |  Branch (372:9): [True: 0, False: 46.7k]
  ------------------
  373|      0|        return NULL;
  374|      0|    }
  375|       |
  376|       |    /* now deal with the fortezza hack... the fortezza hack is an attempt
  377|       |     * to get around the issue of the card not allowing you to do a FORTEZZA
  378|       |     * LoadIV/Encrypt, which was added because such a combination could be
  379|       |     * use to circumvent the key escrow system. Unfortunately SSL needs to
  380|       |     * do this kind of operation, so in SSL we do a loadIV (to verify it),
  381|       |     * Then GenerateIV, and through away the first 8 bytes on either side
  382|       |     * of the connection.*/
  383|  46.7k|    context->fortezzaHack = PR_FALSE;
  ------------------
  |  |  438|  46.7k|#define PR_FALSE 0
  ------------------
  384|  46.7k|    if (type == CKM_SKIPJACK_CBC64) {
  ------------------
  |  | 1049|  46.7k|#define CKM_SKIPJACK_CBC64 0x00001002UL
  ------------------
  |  Branch (384:9): [True: 0, False: 46.7k]
  ------------------
  385|      0|        if (symKey && (symKey->origin == PK11_OriginFortezzaHack)) {
  ------------------
  |  Branch (385:13): [True: 0, False: 0]
  |  Branch (385:23): [True: 0, False: 0]
  ------------------
  386|      0|            context->fortezzaHack = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  387|      0|        }
  388|      0|    }
  389|       |
  390|       |    /* initialize the critical fields of the context */
  391|  46.7k|    context->operation = operation;
  392|       |    /* If we were given a symKey, keep our own reference to it so
  393|       |     * that the key doesn't disappear in the middle of the operation
  394|       |     * if the caller frees it. Public and Private keys are not reference
  395|       |     * counted, so the caller just has to keep his copies around until
  396|       |     * the operation completes */
  397|  46.7k|    context->key = symKey ? PK11_ReferenceSymKey(symKey) : NULL;
  ------------------
  |  Branch (397:20): [True: 13.1k, False: 33.5k]
  ------------------
  398|  46.7k|    context->objectID = objectID;
  399|  46.7k|    context->slot = PK11_ReferenceSlot(slot);
  400|  46.7k|    context->session = pk11_GetNewSession(slot, &context->ownSession);
  401|  46.7k|    context->pwArg = pwArg;
  402|       |    /* get our session */
  403|  46.7k|    context->savedData = NULL;
  404|       |
  405|       |    /* save the parameters so that some digesting stuff can do multiple
  406|       |     * begins on a single context */
  407|  46.7k|    context->type = type;
  408|  46.7k|    if (param) {
  ------------------
  |  Branch (408:9): [True: 46.7k, False: 0]
  ------------------
  409|  46.7k|        if (param->len > 0) {
  ------------------
  |  Branch (409:13): [True: 7.44k, False: 39.3k]
  ------------------
  410|  7.44k|            context->param = SECITEM_DupItem(param);
  ------------------
  |  |  107|  7.44k|#define SECITEM_DupItem SECITEM_DupItem_Util
  ------------------
  411|  39.3k|        } else {
  412|  39.3k|            context->param = (SECItem *)&pk11_null_params;
  413|  39.3k|        }
  414|  46.7k|    } else {
  415|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  416|      0|        context->param = NULL;
  417|      0|    }
  418|  46.7k|    context->init = PR_FALSE;
  ------------------
  |  |  438|  46.7k|#define PR_FALSE 0
  ------------------
  419|  46.7k|    context->sessionLock = PZ_NewLock(nssILockPK11cxt);
  ------------------
  |  |  243|  46.7k|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  420|  46.7k|    if ((context->param == NULL) || (context->sessionLock == NULL)) {
  ------------------
  |  Branch (420:9): [True: 0, False: 46.7k]
  |  Branch (420:37): [True: 0, False: 46.7k]
  ------------------
  421|      0|        PK11_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  422|      0|        return NULL;
  423|      0|    }
  424|       |
  425|  46.7k|    mech_info.mechanism = type;
  426|  46.7k|    mech_info.pParameter = param->data;
  427|  46.7k|    mech_info.ulParameterLen = param->len;
  428|  46.7k|    rv = pk11_context_init(context, &mech_info);
  429|       |
  430|  46.7k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (430:9): [True: 0, False: 46.7k]
  ------------------
  431|      0|        PK11_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  432|      0|        return NULL;
  433|      0|    }
  434|  46.7k|    context->init = PR_TRUE;
  ------------------
  |  |  437|  46.7k|#define PR_TRUE 1
  ------------------
  435|  46.7k|    return context;
  436|  46.7k|}
pk11cxt.c:pk11_context_init:
  198|  46.7k|{
  199|  46.7k|    CK_RV crv;
  200|  46.7k|    SECStatus rv = SECSuccess;
  201|       |
  202|  46.7k|    context->simulate_message = PR_FALSE;
  ------------------
  |  |  438|  46.7k|#define PR_FALSE 0
  ------------------
  203|  46.7k|    switch (context->operation) {
  204|  1.20k|        case CKA_ENCRYPT:
  ------------------
  |  |  547|  1.20k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
  |  Branch (204:9): [True: 1.20k, False: 45.5k]
  ------------------
  205|  1.20k|            PK11_EnterContextMonitor(context);
  206|  1.20k|            crv = PK11_GETTAB(context->slot)->C_EncryptInit(context->session, mech_info, context->objectID);
  ------------------
  |  |  102|  1.20k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  207|  1.20k|            PK11_ExitContextMonitor(context);
  208|  1.20k|            break;
  209|  1.20k|        case CKA_DECRYPT:
  ------------------
  |  |  548|  1.20k|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (209:9): [True: 1.20k, False: 45.5k]
  ------------------
  210|  1.20k|            PK11_EnterContextMonitor(context);
  211|  1.20k|            if (context->fortezzaHack) {
  ------------------
  |  Branch (211:17): [True: 0, False: 1.20k]
  ------------------
  212|      0|                CK_ULONG count = 0;
  213|       |                /* generate the IV for fortezza */
  214|      0|                crv = PK11_GETTAB(context->slot)->C_EncryptInit(context->session, mech_info, context->objectID);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  215|      0|                if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (215:21): [True: 0, False: 0]
  ------------------
  216|      0|                    PK11_ExitContextMonitor(context);
  217|      0|                    break;
  218|      0|                }
  219|      0|                PK11_GETTAB(context->slot)
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  220|      0|                    ->C_EncryptFinal(context->session,
  221|      0|                                     NULL, &count);
  222|      0|            }
  223|  1.20k|            crv = PK11_GETTAB(context->slot)->C_DecryptInit(context->session, mech_info, context->objectID);
  ------------------
  |  |  102|  1.20k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  224|  1.20k|            PK11_ExitContextMonitor(context);
  225|  1.20k|            break;
  226|  9.51k|        case CKA_SIGN:
  ------------------
  |  |  551|  9.51k|#define CKA_SIGN 0x00000108UL
  ------------------
  |  Branch (226:9): [True: 9.51k, False: 37.2k]
  ------------------
  227|  9.51k|            PK11_EnterContextMonitor(context);
  228|  9.51k|            crv = PK11_GETTAB(context->slot)->C_SignInit(context->session, mech_info, context->objectID);
  ------------------
  |  |  102|  9.51k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  229|  9.51k|            PK11_ExitContextMonitor(context);
  230|  9.51k|            break;
  231|      0|        case CKA_VERIFY:
  ------------------
  |  |  553|      0|#define CKA_VERIFY 0x0000010AUL
  ------------------
  |  Branch (231:9): [True: 0, False: 46.7k]
  ------------------
  232|       |            /* NOTE: we previously has this set to C_SignInit for Macing.
  233|       |             * It turns out now one could possibly use it that way, though,
  234|       |             * because PK11_HashOp() always called C_VerifyUpdate on CKA_VERIFY,
  235|       |             * which would have failed. So everyone just calls us with CKA_SIGN
  236|       |             * when Macing even when they are verifying, no need to 'do it
  237|       |             * for them'. It needs to be VerifyInit now so that we can do
  238|       |             * PKCS #11 hash/Verify combo operations. */
  239|      0|            PK11_EnterContextMonitor(context);
  240|      0|            crv = PK11_GETTAB(context->slot)->C_VerifyInit(context->session, mech_info, context->objectID);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  241|      0|            PK11_ExitContextMonitor(context);
  242|      0|            break;
  243|  33.5k|        case CKA_DIGEST:
  ------------------
  |  |   68|  33.5k|#define CKA_DIGEST 0x81000000L
  ------------------
  |  Branch (243:9): [True: 33.5k, False: 13.1k]
  ------------------
  244|  33.5k|            PK11_EnterContextMonitor(context);
  245|  33.5k|            crv = PK11_GETTAB(context->slot)->C_DigestInit(context->session, mech_info);
  ------------------
  |  |  102|  33.5k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  246|  33.5k|            PK11_ExitContextMonitor(context);
  247|  33.5k|            break;
  248|       |
  249|    236|        case CKA_NSS_MESSAGE | CKA_ENCRYPT:
  ------------------
  |  |   69|    236|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_ENCRYPT:
  ------------------
  |  |  547|    236|#define CKA_ENCRYPT 0x00000104UL
  ------------------
  |  Branch (249:9): [True: 236, False: 46.5k]
  ------------------
  250|    236|            crv = pk11_contextInitMessage(context, mech_info,
  251|    236|                                          PK11_GETTAB(context->slot)->C_MessageEncryptInit,
  ------------------
  |  |  102|    236|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  252|    236|                                          CKF_MESSAGE_ENCRYPT, CKR_OK);
  ------------------
  |  | 1339|    236|#define CKF_MESSAGE_ENCRYPT 0x00000002UL
  ------------------
                                                        CKF_MESSAGE_ENCRYPT, CKR_OK);
  ------------------
  |  | 1388|    236|#define CKR_OK 0x00000000UL
  ------------------
  253|    236|            break;
  254|  1.03k|        case CKA_NSS_MESSAGE | CKA_DECRYPT:
  ------------------
  |  |   69|  1.03k|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_DECRYPT:
  ------------------
  |  |  548|  1.03k|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (254:9): [True: 1.03k, False: 45.7k]
  ------------------
  255|  1.03k|            crv = pk11_contextInitMessage(context, mech_info,
  256|  1.03k|                                          PK11_GETTAB(context->slot)->C_MessageDecryptInit,
  ------------------
  |  |  102|  1.03k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  257|  1.03k|                                          CKF_MESSAGE_DECRYPT, CKR_OK);
  ------------------
  |  | 1340|  1.03k|#define CKF_MESSAGE_DECRYPT 0x00000004UL
  ------------------
                                                        CKF_MESSAGE_DECRYPT, CKR_OK);
  ------------------
  |  | 1388|  1.03k|#define CKR_OK 0x00000000UL
  ------------------
  258|  1.03k|            break;
  259|      0|        case CKA_NSS_MESSAGE | CKA_SIGN:
  ------------------
  |  |   69|      0|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_SIGN:
  ------------------
  |  |  551|      0|#define CKA_SIGN 0x00000108UL
  ------------------
  |  Branch (259:9): [True: 0, False: 46.7k]
  ------------------
  260|      0|            crv = pk11_contextInitMessage(context, mech_info,
  261|      0|                                          PK11_GETTAB(context->slot)->C_MessageSignInit,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  262|      0|                                          CKF_MESSAGE_SIGN, CKR_FUNCTION_NOT_SUPPORTED);
  ------------------
  |  | 1341|      0|#define CKF_MESSAGE_SIGN 0x00000008UL
  ------------------
                                                        CKF_MESSAGE_SIGN, CKR_FUNCTION_NOT_SUPPORTED);
  ------------------
  |  | 1426|      0|#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL
  ------------------
  263|      0|            break;
  264|      0|        case CKA_NSS_MESSAGE | CKA_VERIFY:
  ------------------
  |  |   69|      0|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_VERIFY:
  ------------------
  |  |  553|      0|#define CKA_VERIFY 0x0000010AUL
  ------------------
  |  Branch (264:9): [True: 0, False: 46.7k]
  ------------------
  265|      0|            crv = pk11_contextInitMessage(context, mech_info,
  266|      0|                                          PK11_GETTAB(context->slot)->C_MessageVerifyInit,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  267|      0|                                          CKF_MESSAGE_VERIFY, CKR_FUNCTION_NOT_SUPPORTED);
  ------------------
  |  | 1342|      0|#define CKF_MESSAGE_VERIFY 0x00000010UL
  ------------------
                                                        CKF_MESSAGE_VERIFY, CKR_FUNCTION_NOT_SUPPORTED);
  ------------------
  |  | 1426|      0|#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL
  ------------------
  268|      0|            break;
  269|      0|        default:
  ------------------
  |  Branch (269:9): [True: 0, False: 46.7k]
  ------------------
  270|      0|            crv = CKR_OPERATION_NOT_INITIALIZED;
  ------------------
  |  | 1454|      0|#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL
  ------------------
  271|      0|            break;
  272|  46.7k|    }
  273|       |
  274|  46.7k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  46.7k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (274:9): [True: 0, False: 46.7k]
  ------------------
  275|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  276|      0|        return SECFailure;
  277|      0|    }
  278|       |
  279|       |    /* handle the case where the token is using the old NSS mechanism */
  280|  46.7k|    if (context->simulate_message &&
  ------------------
  |  Branch (280:9): [True: 0, False: 46.7k]
  ------------------
  281|  46.7k|        !PK11_DoesMechanism(context->slot, context->simulate_mechanism)) {
  ------------------
  |  Branch (281:9): [True: 0, False: 0]
  ------------------
  282|      0|        if ((context->simulate_mechanism == CKM_CHACHA20_POLY1305) &&
  ------------------
  |  | 1287|      0|#define CKM_CHACHA20_POLY1305 0x00004021UL
  ------------------
  |  Branch (282:13): [True: 0, False: 0]
  ------------------
  283|      0|            PK11_DoesMechanism(context->slot, CKM_NSS_CHACHA20_POLY1305)) {
  ------------------
  |  |  243|      0|#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 28)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (283:13): [True: 0, False: 0]
  ------------------
  284|      0|            context->simulate_mechanism = CKM_NSS_CHACHA20_POLY1305;
  ------------------
  |  |  243|      0|#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 28)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  285|      0|        } else {
  286|      0|            PORT_SetError(PK11_MapError(CKR_MECHANISM_INVALID));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                          PORT_SetError(PK11_MapError(CKR_MECHANISM_INVALID));
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
  287|      0|            return SECFailure;
  288|      0|        }
  289|      0|    }
  290|       |
  291|       |    /*
  292|       |     * handle session starvation case.. use our last session to multiplex
  293|       |     */
  294|  46.7k|    if (!context->ownSession) {
  ------------------
  |  Branch (294:9): [True: 0, False: 46.7k]
  ------------------
  295|      0|        PK11_EnterContextMonitor(context);
  296|      0|        context->savedData = pk11_saveContext(context, context->savedData,
  297|      0|                                              &context->savedLength);
  298|      0|        if (context->savedData == NULL)
  ------------------
  |  Branch (298:13): [True: 0, False: 0]
  ------------------
  299|      0|            rv = SECFailure;
  300|       |        /* clear out out session for others to use */
  301|      0|        pk11_Finalize(context);
  302|      0|        PK11_ExitContextMonitor(context);
  303|      0|    }
  304|  46.7k|    return rv;
  305|  46.7k|}
pk11cxt.c:pk11_contextInitMessage:
  155|  1.26k|{
  156|  1.26k|    PK11SlotInfo *slot = context->slot;
  157|  1.26k|    CK_VERSION version = slot->module->cryptokiVersion;
  158|  1.26k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  1.26k|#define CKR_OK 0x00000000UL
  ------------------
  159|       |
  160|  1.26k|    context->ivCounter = 0;
  161|  1.26k|    context->ivMaxCount = 0;
  162|  1.26k|    context->ivFixedBits = 0;
  163|  1.26k|    context->ivLen = 0;
  164|  1.26k|    context->ivGen = CKG_NO_GENERATE;
  ------------------
  |  | 1991|  1.26k|#define CKG_NO_GENERATE 0x00000000UL
  ------------------
  165|  1.26k|    context->simulate_mechanism = (mech)->mechanism;
  166|  1.26k|    context->simulate_message = PR_FALSE;
  ------------------
  |  |  438|  1.26k|#define PR_FALSE 0
  ------------------
  167|       |    /* check that we can do the Message interface. We need to check
  168|       |     * for either 1) are we using a PKCS #11 v3 interface and 2) is the
  169|       |     * Message flag set on the mechanism. If either is false we simulate
  170|       |     * the message interface for the Encrypt and Decrypt cases using the
  171|       |     * PKCS #11 V2 interface.
  172|       |     * Sign and verify do not have V2 interfaces, so we go ahead and fail
  173|       |     * if those cases */
  174|  1.26k|    if ((version.major >= 3) &&
  ------------------
  |  Branch (174:9): [True: 1.26k, False: 0]
  ------------------
  175|  1.26k|        PK11_DoesMechanismFlag(slot, (mech)->mechanism, flags)) {
  ------------------
  |  Branch (175:9): [True: 1.26k, False: 0]
  ------------------
  176|  1.26k|        PK11_EnterContextMonitor(context);
  177|  1.26k|        crv = (*initFunc)((context)->session, (mech), (context)->objectID);
  178|  1.26k|        PK11_ExitContextMonitor(context);
  179|  1.26k|        if ((crv == CKR_FUNCTION_NOT_SUPPORTED) ||
  ------------------
  |  | 1426|  1.26k|#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL
  ------------------
  |  Branch (179:13): [True: 0, False: 1.26k]
  ------------------
  180|  1.26k|            (crv == CKR_MECHANISM_INVALID)) {
  ------------------
  |  | 1447|  1.26k|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
  |  Branch (180:13): [True: 0, False: 1.26k]
  ------------------
  181|       |            /* we have a 3.0 interface, and the flag was set (or ignored)
  182|       |             * but the implementation was not there, use the V2 interface */
  183|      0|            crv = (scrv);
  184|      0|            context->simulate_message = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  185|      0|        }
  186|  1.26k|    } else {
  187|      0|        crv = (scrv);
  188|      0|        context->simulate_message = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  189|      0|    }
  190|  1.26k|    return crv;
  191|  1.26k|}

PK11_MapError:
   37|  3.83k|{
   38|       |
   39|  3.83k|    switch (rv) {
   40|      0|#define MAPERROR(x, y) \
   41|      0|    case x:            \
   42|      0|        return y;
   43|       |
   44|      0|#endif
   45|       |
   46|       |    /* the guts mapping */
   47|       |    /* clang-format off */
   48|      0|    MAPERROR(CKR_OK, 0)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   49|      0|    MAPERROR(CKR_CANCEL, SEC_ERROR_IO)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   50|      2|    MAPERROR(CKR_HOST_MEMORY, SEC_ERROR_NO_MEMORY)
  ------------------
  |  |   41|      2|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 2, False: 3.82k]
  |  |  ------------------
  |  |   42|      2|        return y;
  ------------------
   51|      0|    MAPERROR(CKR_SLOT_ID_INVALID, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   52|     13|    MAPERROR(CKR_ARGUMENTS_BAD, SEC_ERROR_INVALID_ARGS)
  ------------------
  |  |   41|     13|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 13, False: 3.81k]
  |  |  ------------------
  |  |   42|     13|        return y;
  ------------------
   53|      0|    MAPERROR(CKR_ATTRIBUTE_READ_ONLY, SEC_ERROR_READ_ONLY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   54|      0|    MAPERROR(CKR_ATTRIBUTE_SENSITIVE, SEC_ERROR_IO) /* XX SENSITIVE */
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   55|      0|    MAPERROR(CKR_ATTRIBUTE_TYPE_INVALID, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   56|    359|    MAPERROR(CKR_ATTRIBUTE_VALUE_INVALID, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|    359|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 359, False: 3.47k]
  |  |  ------------------
  |  |   42|    359|        return y;
  ------------------
   57|      0|    MAPERROR(CKR_BUFFER_TOO_SMALL, SEC_ERROR_OUTPUT_LEN)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   58|      0|    MAPERROR(CKR_DATA_INVALID, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   59|      0|    MAPERROR(CKR_DATA_LEN_RANGE, SEC_ERROR_INPUT_LEN)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   60|     12|    MAPERROR(CKR_DEVICE_ERROR, SEC_ERROR_PKCS11_DEVICE_ERROR)
  ------------------
  |  |   41|     12|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 12, False: 3.81k]
  |  |  ------------------
  |  |   42|     12|        return y;
  ------------------
   61|      0|    MAPERROR(CKR_DEVICE_MEMORY, SEC_ERROR_NO_MEMORY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   62|      0|    MAPERROR(CKR_DEVICE_REMOVED, SEC_ERROR_NO_TOKEN)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   63|    172|    MAPERROR(CKR_DOMAIN_PARAMS_INVALID, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|    172|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 172, False: 3.65k]
  |  |  ------------------
  |  |   42|    172|        return y;
  ------------------
   64|      0|    MAPERROR(CKR_ENCRYPTED_DATA_INVALID, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   65|      0|    MAPERROR(CKR_ENCRYPTED_DATA_LEN_RANGE, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   66|      0|    MAPERROR(CKR_FUNCTION_CANCELED, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   67|      0|    MAPERROR(CKR_FUNCTION_FAILED, SEC_ERROR_PKCS11_FUNCTION_FAILED)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   68|      0|    MAPERROR(CKR_FUNCTION_NOT_PARALLEL, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   69|      0|    MAPERROR(CKR_FUNCTION_NOT_SUPPORTED, PR_NOT_IMPLEMENTED_ERROR)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   70|    667|    MAPERROR(CKR_GENERAL_ERROR, SEC_ERROR_PKCS11_GENERAL_ERROR)
  ------------------
  |  |   41|    667|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 667, False: 3.16k]
  |  |  ------------------
  |  |   42|    667|        return y;
  ------------------
   71|      0|    MAPERROR(CKR_KEY_HANDLE_INVALID, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   72|     70|    MAPERROR(CKR_KEY_SIZE_RANGE, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|     70|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 70, False: 3.76k]
  |  |  ------------------
  |  |   42|     70|        return y;
  ------------------
   73|      0|    MAPERROR(CKR_KEY_TYPE_INCONSISTENT, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   74|      8|    MAPERROR(CKR_MECHANISM_INVALID, SEC_ERROR_INVALID_ALGORITHM)
  ------------------
  |  |   41|      8|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 8, False: 3.82k]
  |  |  ------------------
  |  |   42|      8|        return y;
  ------------------
   75|      0|    MAPERROR(CKR_MECHANISM_PARAM_INVALID, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   76|      0|    MAPERROR(CKR_NO_EVENT, SEC_ERROR_NO_EVENT)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   77|      0|    MAPERROR(CKR_OBJECT_HANDLE_INVALID, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   78|      0|    MAPERROR(CKR_OPERATION_ACTIVE, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   79|      0|    MAPERROR(CKR_OPERATION_NOT_INITIALIZED, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   80|      0|    MAPERROR(CKR_PIN_INCORRECT, SEC_ERROR_BAD_PASSWORD)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   81|      0|    MAPERROR(CKR_PIN_INVALID, SEC_ERROR_INVALID_PASSWORD)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   82|      0|    MAPERROR(CKR_PIN_LEN_RANGE, SEC_ERROR_INVALID_PASSWORD)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   83|      0|    MAPERROR(CKR_PIN_EXPIRED, SEC_ERROR_EXPIRED_PASSWORD)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   84|      0|    MAPERROR(CKR_PIN_LOCKED, SEC_ERROR_LOCKED_PASSWORD)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   85|      0|    MAPERROR(CKR_SESSION_CLOSED, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   86|      0|    MAPERROR(CKR_SESSION_COUNT, SEC_ERROR_NO_MEMORY) /* XXXX? */
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   87|      0|    MAPERROR(CKR_SESSION_HANDLE_INVALID, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   88|      0|    MAPERROR(CKR_SESSION_PARALLEL_NOT_SUPPORTED, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   89|      0|    MAPERROR(CKR_SESSION_READ_ONLY, SEC_ERROR_READ_ONLY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   90|  2.42k|    MAPERROR(CKR_SIGNATURE_INVALID, SEC_ERROR_BAD_SIGNATURE)
  ------------------
  |  |   41|  2.42k|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 2.42k, False: 1.40k]
  |  |  ------------------
  |  |   42|  2.42k|        return y;
  ------------------
   91|      0|    MAPERROR(CKR_SIGNATURE_LEN_RANGE, SEC_ERROR_BAD_SIGNATURE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   92|      0|    MAPERROR(CKR_TEMPLATE_INCOMPLETE, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   93|    104|    MAPERROR(CKR_TEMPLATE_INCONSISTENT, SEC_ERROR_BAD_DATA)
  ------------------
  |  |   41|    104|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 104, False: 3.72k]
  |  |  ------------------
  |  |   42|    104|        return y;
  ------------------
   94|      0|    MAPERROR(CKR_TOKEN_NOT_PRESENT, SEC_ERROR_NO_TOKEN)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   95|      0|    MAPERROR(CKR_TOKEN_NOT_RECOGNIZED, SEC_ERROR_IO)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   96|      0|    MAPERROR(CKR_TOKEN_WRITE_PROTECTED, SEC_ERROR_READ_ONLY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   97|      0|    MAPERROR(CKR_UNWRAPPING_KEY_HANDLE_INVALID, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   98|      0|    MAPERROR(CKR_UNWRAPPING_KEY_SIZE_RANGE, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
   99|      0|    MAPERROR(CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  100|      0|    MAPERROR(CKR_USER_ALREADY_LOGGED_IN, 0)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  101|      0|    MAPERROR(CKR_USER_NOT_LOGGED_IN, SEC_ERROR_TOKEN_NOT_LOGGED_IN)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  102|      0|    MAPERROR(CKR_USER_PIN_NOT_INITIALIZED, SEC_ERROR_NO_TOKEN)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  103|      0|    MAPERROR(CKR_USER_TYPE_INVALID, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  104|      0|    MAPERROR(CKR_WRAPPED_KEY_INVALID, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  105|      0|    MAPERROR(CKR_WRAPPED_KEY_LEN_RANGE, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  106|      0|    MAPERROR(CKR_WRAPPING_KEY_HANDLE_INVALID, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  107|      0|    MAPERROR(CKR_WRAPPING_KEY_SIZE_RANGE, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  108|      0|    MAPERROR(CKR_WRAPPING_KEY_TYPE_INCONSISTENT, SEC_ERROR_INVALID_KEY)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  109|      0|    MAPERROR(CKR_VENDOR_DEFINED, SEC_ERROR_LIBRARY_FAILURE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  110|      0|    MAPERROR(CKR_NSS_CERTDB_FAILED, SEC_ERROR_BAD_DATABASE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  111|      0|    MAPERROR(CKR_NSS_KEYDB_FAILED, SEC_ERROR_BAD_DATABASE)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  112|      0|    MAPERROR(CKR_CANT_LOCK, SEC_ERROR_INCOMPATIBLE_PKCS11)
  ------------------
  |  |   41|      0|    case x:            \
  |  |  ------------------
  |  |  |  Branch (41:5): [True: 0, False: 3.83k]
  |  |  ------------------
  |  |   42|      0|        return y;
  ------------------
  113|       |/* clang-format on */
  114|       |
  115|       |#ifdef PK11_ERROR_USE_ARRAY
  116|       |};
  117|       |
  118|       |int
  119|       |PK11_MapError(CK_RV rv)
  120|       |{
  121|       |    int size = sizeof(pk11_error_map) / sizeof(pk11_error_map[0]);
  122|       |
  123|       |    for (i = 0; i < size; i++) {
  124|       |        if (pk11_error_map[i].pk11_error == rv) {
  125|       |            return pk11_error_map[i].sec_error;
  126|       |        }
  127|       |    }
  128|       |    return SEC_ERROR_UNKNOWN_PKCS11_ERROR;
  129|       |}
  130|       |
  131|       |#else
  132|       |
  133|       |            /* clang-format off */
  134|      0|    default :
  ------------------
  |  Branch (134:5): [True: 0, False: 3.83k]
  ------------------
  135|      0|        break;
  136|       |            /* clang-format on */
  137|  3.83k|    }
  138|      0|    return SEC_ERROR_UNKNOWN_PKCS11_ERROR;
  139|  3.83k|}

PK11_HPKE_DestroyContext:
  207|  8.85k|{
  208|  8.85k|    if (!cx) {
  ------------------
  |  Branch (208:9): [True: 8.85k, False: 0]
  ------------------
  209|  8.85k|        return;
  210|  8.85k|    }
  211|       |
  212|      0|    if (cx->aeadContext) {
  ------------------
  |  Branch (212:9): [True: 0, False: 0]
  ------------------
  213|      0|        PK11_DestroyContext((PK11Context *)cx->aeadContext, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  214|      0|        cx->aeadContext = NULL;
  215|      0|    }
  216|      0|    PK11_FreeSymKey(cx->exporterSecret);
  217|      0|    PK11_FreeSymKey(cx->sharedSecret);
  218|      0|    PK11_FreeSymKey(cx->key);
  219|      0|    PK11_FreeSymKey(cx->psk);
  220|      0|    SECITEM_FreeItem(cx->pskId, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(cx->pskId, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  221|      0|    SECITEM_FreeItem(cx->baseNonce, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(cx->baseNonce, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  222|      0|    SECITEM_FreeItem(cx->encapPubKey, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(cx->encapPubKey, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  223|      0|    cx->exporterSecret = NULL;
  224|      0|    cx->sharedSecret = NULL;
  225|      0|    cx->key = NULL;
  226|      0|    cx->psk = NULL;
  227|      0|    cx->pskId = NULL;
  228|      0|    cx->baseNonce = NULL;
  229|      0|    cx->encapPubKey = NULL;
  230|      0|    if (freeit) {
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  ------------------
  231|      0|        PORT_ZFree(cx, sizeof(HpkeContext));
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  232|      0|    }
  233|      0|}

SECMOD_NewListLock:
   21|      1|{
   22|      1|    return NSSRWLock_New(10, "moduleListLock");
  ------------------
  |  |   49|      1|#define NSSRWLock_New NSSRWLock_New_Util
  ------------------
   23|      1|}
SECMOD_DestroyListLock:
   30|      1|{
   31|      1|    NSSRWLock_Destroy(lock);
  ------------------
  |  |   45|      1|#define NSSRWLock_Destroy NSSRWLock_Destroy_Util
  ------------------
   32|      1|}
SECMOD_GetReadLock:
   40|  3.62k|{
   41|  3.62k|    NSSRWLock_LockRead(modLock);
  ------------------
  |  |   47|  3.62k|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  ------------------
   42|  3.62k|}
SECMOD_ReleaseReadLock:
   49|  3.62k|{
   50|  3.62k|    NSSRWLock_UnlockRead(modLock);
  ------------------
  |  |   50|  3.62k|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  ------------------
   51|  3.62k|}
SECMOD_GetWriteLock:
   58|      2|{
   59|      2|    NSSRWLock_LockWrite(modLock);
  ------------------
  |  |   48|      2|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  ------------------
   60|      2|}
SECMOD_ReleaseWriteLock:
   68|      2|{
   69|      2|    NSSRWLock_UnlockWrite(modLock);
  ------------------
  |  |   51|      2|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  ------------------
   70|      2|}

secmod_ModuleInit:
  216|      1|{
  217|      1|    CK_C_INITIALIZE_ARGS moduleArgs;
  218|      1|    CK_VOID_PTR pInitArgs;
  219|      1|    CK_RV crv;
  220|       |
  221|      1|    if (reload) {
  ------------------
  |  Branch (221:9): [True: 1, False: 0]
  ------------------
  222|      1|        *reload = NULL;
  223|      1|    }
  224|       |
  225|      1|    if (!mod || !alreadyLoaded) {
  ------------------
  |  Branch (225:9): [True: 0, False: 1]
  |  Branch (225:17): [True: 0, False: 1]
  ------------------
  226|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  227|      0|        return SECFailure;
  228|      0|    }
  229|       |
  230|      1|    if (mod->libraryParams == NULL) {
  ------------------
  |  Branch (230:9): [True: 0, False: 1]
  ------------------
  231|      0|        if (mod->isThreadSafe) {
  ------------------
  |  Branch (231:13): [True: 0, False: 0]
  ------------------
  232|      0|            pInitArgs = (void *)&secmodLockFunctions;
  233|      0|        } else {
  234|      0|            pInitArgs = NULL;
  235|      0|        }
  236|      1|    } else {
  237|      1|        if (mod->isThreadSafe) {
  ------------------
  |  Branch (237:13): [True: 1, False: 0]
  ------------------
  238|      1|            moduleArgs = secmodLockFunctions;
  239|      1|        } else {
  240|      0|            moduleArgs = secmodNoLockArgs;
  241|      0|        }
  242|      1|        moduleArgs.LibraryParameters = (void *)mod->libraryParams;
  243|      1|        pInitArgs = &moduleArgs;
  244|      1|    }
  245|      1|    crv = PK11_GETTAB(mod)->C_Initialize(pInitArgs);
  ------------------
  |  |  102|      1|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  246|      1|    if (CKR_CRYPTOKI_ALREADY_INITIALIZED == crv) {
  ------------------
  |  | 1521|      1|#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191UL
  ------------------
  |  Branch (246:9): [True: 0, False: 1]
  ------------------
  247|      0|        SECMODModule *oldModule = NULL;
  248|       |
  249|       |        /* Library has already been loaded once, if caller expects it, and it
  250|       |         * has additional configuration, try reloading it as well. */
  251|      0|        if (reload != NULL && mod->libraryParams) {
  ------------------
  |  Branch (251:13): [True: 0, False: 0]
  |  Branch (251:31): [True: 0, False: 0]
  ------------------
  252|      0|            oldModule = secmod_FindModuleByFuncPtr(mod->functionList);
  253|      0|        }
  254|       |        /* Library has been loaded by NSS. It means it may be capable of
  255|       |         * reloading */
  256|      0|        if (oldModule) {
  ------------------
  |  Branch (256:13): [True: 0, False: 0]
  ------------------
  257|      0|            SECStatus rv;
  258|      0|            rv = secmod_handleReload(oldModule, mod);
  259|      0|            if (rv == SECSuccess) {
  ------------------
  |  Branch (259:17): [True: 0, False: 0]
  ------------------
  260|       |                /* This module should go away soon, since we've
  261|       |                 * simply expanded the slots on the old module.
  262|       |                 * When it goes away, it should not Finalize since
  263|       |                 * that will close our old module as well. Setting
  264|       |                 * the function list to NULL will prevent that close */
  265|      0|                mod->functionList = NULL;
  266|      0|                *reload = oldModule;
  267|      0|                return SECSuccess;
  268|      0|            }
  269|      0|            SECMOD_DestroyModule(oldModule);
  270|      0|        }
  271|       |        /* reload not possible, fall back to old semantics */
  272|      0|        if (!enforceAlreadyInitializedError) {
  ------------------
  |  Branch (272:13): [True: 0, False: 0]
  ------------------
  273|      0|            *alreadyLoaded = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  274|      0|            return SECSuccess;
  275|      0|        }
  276|      0|    }
  277|      1|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (277:9): [True: 0, False: 1]
  ------------------
  278|      0|        if (!mod->isThreadSafe ||
  ------------------
  |  Branch (278:13): [True: 0, False: 0]
  ------------------
  279|      0|            crv == CKR_NSS_CERTDB_FAILED ||
  ------------------
  |  |  376|      0|#define CKR_NSS_CERTDB_FAILED (CKR_NSS + 1)
  |  |  ------------------
  |  |  |  |  374|      0|#define CKR_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKR_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (279:13): [True: 0, False: 0]
  ------------------
  280|      0|            crv == CKR_NSS_KEYDB_FAILED) {
  ------------------
  |  |  377|      0|#define CKR_NSS_KEYDB_FAILED (CKR_NSS + 2)
  |  |  ------------------
  |  |  |  |  374|      0|#define CKR_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKR_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (280:13): [True: 0, False: 0]
  ------------------
  281|      0|            PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  282|      0|            return SECFailure;
  283|      0|        }
  284|       |        /* If we had attempted to init a single threaded module "with"
  285|       |         * parameters and it failed, should we retry "without" parameters?
  286|       |         * (currently we don't retry in this scenario) */
  287|       |
  288|      0|        if (!loadSingleThreadedModules) {
  ------------------
  |  Branch (288:13): [True: 0, False: 0]
  ------------------
  289|      0|            PORT_SetError(SEC_ERROR_INCOMPATIBLE_PKCS11);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  290|      0|            return SECFailure;
  291|      0|        }
  292|       |        /* If we arrive here, the module failed a ThreadSafe init. */
  293|      0|        mod->isThreadSafe = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  294|      0|        if (!mod->libraryParams) {
  ------------------
  |  Branch (294:13): [True: 0, False: 0]
  ------------------
  295|      0|            pInitArgs = NULL;
  296|      0|        } else {
  297|      0|            moduleArgs = secmodNoLockArgs;
  298|      0|            moduleArgs.LibraryParameters = (void *)mod->libraryParams;
  299|      0|            pInitArgs = &moduleArgs;
  300|      0|        }
  301|      0|        crv = PK11_GETTAB(mod)->C_Initialize(pInitArgs);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  302|      0|        if ((CKR_CRYPTOKI_ALREADY_INITIALIZED == crv) &&
  ------------------
  |  | 1521|      0|#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191UL
  ------------------
  |  Branch (302:13): [True: 0, False: 0]
  ------------------
  303|      0|            (!enforceAlreadyInitializedError)) {
  ------------------
  |  Branch (303:13): [True: 0, False: 0]
  ------------------
  304|      0|            *alreadyLoaded = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  305|      0|            return SECSuccess;
  306|      0|        }
  307|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (307:13): [True: 0, False: 0]
  ------------------
  308|      0|            PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  309|      0|            return SECFailure;
  310|      0|        }
  311|      0|    }
  312|      1|    return SECSuccess;
  313|      1|}
SECMOD_SetRootCerts:
  321|      2|{
  322|      2|    PK11PreSlotInfo *psi = NULL;
  323|      2|    int i;
  324|       |
  325|      2|    if (slot->hasRootCerts) {
  ------------------
  |  Branch (325:9): [True: 0, False: 2]
  ------------------
  326|      0|        for (i = 0; i < mod->slotInfoCount; i++) {
  ------------------
  |  Branch (326:21): [True: 0, False: 0]
  ------------------
  327|      0|            if (slot->slotID == mod->slotInfo[i].slotID) {
  ------------------
  |  Branch (327:17): [True: 0, False: 0]
  ------------------
  328|      0|                psi = &mod->slotInfo[i];
  329|      0|                break;
  330|      0|            }
  331|      0|        }
  332|      0|        if (psi == NULL) {
  ------------------
  |  Branch (332:13): [True: 0, False: 0]
  ------------------
  333|       |            /* allocate more slots */
  334|      0|            PK11PreSlotInfo *psi_list = (PK11PreSlotInfo *)
  335|      0|                PORT_ArenaAlloc(mod->arena,
  ------------------
  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  336|      0|                                (mod->slotInfoCount + 1) * sizeof(PK11PreSlotInfo));
  337|       |            /* copy the old ones */
  338|      0|            if (mod->slotInfoCount > 0) {
  ------------------
  |  Branch (338:17): [True: 0, False: 0]
  ------------------
  339|      0|                PORT_Memcpy(psi_list, mod->slotInfo,
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  340|      0|                            (mod->slotInfoCount) * sizeof(PK11PreSlotInfo));
  341|      0|            }
  342|       |            /* assign psi to the last new slot */
  343|      0|            psi = &psi_list[mod->slotInfoCount];
  344|      0|            psi->slotID = slot->slotID;
  345|      0|            psi->askpw = 0;
  346|      0|            psi->timeout = 0;
  347|      0|            psi->defaultFlags = 0;
  348|       |
  349|       |            /* increment module count & store new list */
  350|      0|            mod->slotInfo = psi_list;
  351|      0|            mod->slotInfoCount++;
  352|      0|        }
  353|      0|        psi->hasRootCerts = 1;
  354|      0|    }
  355|      2|}
secmod_DetermineModuleFunctionList:
  392|      2|{
  393|      2|    PRLibrary *library = NULL;
  394|      2|    CK_C_GetInterface ientry = NULL;
  395|      2|    CK_C_GetFunctionList fentry = NULL;
  396|      2|    char *disableUnload = NULL;
  397|       |#ifndef NSS_STATIC_SOFTOKEN
  398|       |    const char *nss_interface;
  399|       |    const char *nss_function;
  400|       |#endif
  401|      2|    CK_INTERFACE_PTR interface;
  402|       |
  403|       |    /* internal modules get loaded from their internal list */
  404|      2|    if (mod->internal && (mod->dllName == NULL)) {
  ------------------
  |  Branch (404:9): [True: 2, False: 0]
  |  Branch (404:26): [True: 2, False: 0]
  ------------------
  405|      2|#ifdef NSS_STATIC_SOFTOKEN
  406|      2|        ientry = (CK_C_GetInterface)NSC_GetInterface;
  407|       |#else
  408|       |        /*
  409|       |         * Loads softoken as a dynamic library,
  410|       |         * even though the rest of NSS assumes this as the "internal" module.
  411|       |         */
  412|       |        if (!softokenLib &&
  413|       |            PR_SUCCESS != PR_CallOnce(&loadSoftokenOnce, &softoken_LoadDSO))
  414|       |            return SECFailure;
  415|       |
  416|       |        PR_ATOMIC_INCREMENT(&softokenLoadCount);
  417|       |
  418|       |        if (mod->isFIPS) {
  419|       |            nss_interface = "FC_GetInterface";
  420|       |            nss_function = "FC_GetFunctionList";
  421|       |        } else {
  422|       |            nss_interface = "NSC_GetInterface";
  423|       |            nss_function = "NSC_GetFunctionList";
  424|       |        }
  425|       |
  426|       |        ientry = (CK_C_GetInterface)
  427|       |            PR_FindSymbol(softokenLib, nss_interface);
  428|       |        if (!ientry) {
  429|       |            fentry = (CK_C_GetFunctionList)
  430|       |                PR_FindSymbol(softokenLib, nss_function);
  431|       |            if (!fentry) {
  432|       |                return SECFailure;
  433|       |            }
  434|       |        }
  435|       |#endif
  436|       |
  437|      2|        if (mod->isModuleDB) {
  ------------------
  |  Branch (437:13): [True: 1, False: 1]
  ------------------
  438|      1|            mod->moduleDBFunc = (CK_C_GetFunctionList)
  439|      1|#ifdef NSS_STATIC_SOFTOKEN
  440|      1|                NSC_ModuleDBFunc;
  441|       |#else
  442|       |                PR_FindSymbol(softokenLib, "NSC_ModuleDBFunc");
  443|       |#endif
  444|      1|        }
  445|       |
  446|      2|        if (mod->moduleDBOnly) {
  ------------------
  |  Branch (446:13): [True: 1, False: 1]
  ------------------
  447|      1|            mod->loaded = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  448|      1|            return SECSuccess;
  449|      1|        }
  450|      2|    } else {
  451|       |        /* Not internal, load the DLL and look up C_GetFunctionList */
  452|      0|        if (mod->dllName == NULL) {
  ------------------
  |  Branch (452:13): [True: 0, False: 0]
  ------------------
  453|      0|            return SECFailure;
  454|      0|        }
  455|       |
  456|       |/* load the library. If this succeeds, then we have to remember to
  457|       | * unload the library if anything goes wrong from here on out...
  458|       | */
  459|       |#if defined(_WIN32)
  460|       |        if (nssUTF8_Length(mod->dllName, NULL)) {
  461|       |            wchar_t *dllNameWide = _NSSUTIL_UTF8ToWide(mod->dllName);
  462|       |            if (dllNameWide) {
  463|       |                PRLibSpec libSpec;
  464|       |                libSpec.type = PR_LibSpec_PathnameU;
  465|       |                libSpec.value.pathname_u = dllNameWide;
  466|       |                library = PR_LoadLibraryWithFlags(libSpec, 0);
  467|       |                PORT_Free(dllNameWide);
  468|       |            }
  469|       |        }
  470|       |        if (library == NULL) {
  471|       |            // fallback to system code page
  472|       |            library = PR_LoadLibrary(mod->dllName);
  473|       |        }
  474|       |#else
  475|      0|        library = PR_LoadLibrary(mod->dllName);
  476|      0|#endif // defined(_WIN32)
  477|      0|        mod->library = (void *)library;
  478|       |
  479|      0|        if (library == NULL) {
  ------------------
  |  Branch (479:13): [True: 0, False: 0]
  ------------------
  480|      0|            return SECFailure;
  481|      0|        }
  482|       |
  483|       |        /*
  484|       |         * now we need to get the entry point to find the function pointers
  485|       |         */
  486|      0|        if (!mod->moduleDBOnly) {
  ------------------
  |  Branch (486:13): [True: 0, False: 0]
  ------------------
  487|      0|            ientry = (CK_C_GetInterface)
  488|      0|                PR_FindSymbol(library, "C_GetInterface");
  489|      0|            if (!ientry) {
  ------------------
  |  Branch (489:17): [True: 0, False: 0]
  ------------------
  490|      0|                fentry = (CK_C_GetFunctionList)
  491|      0|                    PR_FindSymbol(library, "C_GetFunctionList");
  492|      0|            }
  493|      0|        }
  494|      0|        if (mod->isModuleDB) {
  ------------------
  |  Branch (494:13): [True: 0, False: 0]
  ------------------
  495|      0|            mod->moduleDBFunc = (void *)
  496|      0|                PR_FindSymbol(library, "NSS_ReturnModuleSpecData");
  497|      0|        }
  498|      0|        if (mod->moduleDBFunc == NULL)
  ------------------
  |  Branch (498:13): [True: 0, False: 0]
  ------------------
  499|      0|            mod->isModuleDB = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  500|      0|        if ((ientry == NULL) && (fentry == NULL)) {
  ------------------
  |  Branch (500:13): [True: 0, False: 0]
  |  Branch (500:33): [True: 0, False: 0]
  ------------------
  501|      0|            if (mod->isModuleDB) {
  ------------------
  |  Branch (501:17): [True: 0, False: 0]
  ------------------
  502|      0|                mod->loaded = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  503|      0|                mod->moduleDBOnly = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  504|      0|                return SECSuccess;
  505|      0|            }
  506|      0|            PR_UnloadLibrary(library);
  507|      0|            return SECFailure;
  508|      0|        }
  509|      0|    }
  510|       |
  511|       |    /*
  512|       |     * We need to get the function list
  513|       |     */
  514|      1|    if (ientry) {
  ------------------
  |  Branch (514:9): [True: 1, False: 0]
  ------------------
  515|       |        /* we first try to get a FORK_SAFE interface */
  516|      1|        if ((*ientry)((CK_UTF8CHAR_PTR) "PKCS 11", NULL, &interface,
  ------------------
  |  Branch (516:13): [True: 0, False: 1]
  ------------------
  517|      1|                      CKF_INTERFACE_FORK_SAFE) != CKR_OK) {
  ------------------
  |  | 1576|      1|#define CKF_INTERFACE_FORK_SAFE 0x00000001UL
  ------------------
                                    CKF_INTERFACE_FORK_SAFE) != CKR_OK) {
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  518|       |            /* one is not appearantly available, get a non-fork safe version */
  519|      0|            if ((*ientry)((CK_UTF8CHAR_PTR) "PKCS 11", NULL, &interface, 0) != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (519:17): [True: 0, False: 0]
  ------------------
  520|      0|                goto fail;
  521|      0|            }
  522|      0|        }
  523|      1|        mod->functionList = interface->pFunctionList;
  524|      1|        mod->flags = interface->flags;
  525|       |        /* if we have a fips indicator, grab it */
  526|      1|        if ((*ientry)((CK_UTF8CHAR_PTR) "Vendor NSS FIPS Interface", NULL,
  ------------------
  |  Branch (526:13): [True: 1, False: 0]
  ------------------
  527|      1|                      &interface, 0) == CKR_OK) {
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  528|      1|            mod->fipsIndicator = ((CK_NSS_FIPS_FUNCTIONS *)(interface->pFunctionList))->NSC_NSSGetFIPSStatus;
  529|      1|        }
  530|      1|    } else {
  531|      0|        if ((*fentry)((CK_FUNCTION_LIST_PTR *)&mod->functionList) != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (531:13): [True: 0, False: 0]
  ------------------
  532|      0|            goto fail;
  533|      0|        mod->flags = 0;
  534|      0|    }
  535|       |
  536|      1|#ifdef DEBUG_MODULE
  537|      1|    modToDBG = PR_GetEnvSecure("NSS_DEBUG_PKCS11_MODULE");
  538|      1|    if (modToDBG && strcmp(mod->commonName, modToDBG) == 0) {
  ------------------
  |  Branch (538:9): [True: 0, False: 1]
  |  Branch (538:21): [True: 0, False: 0]
  ------------------
  539|      0|        mod->functionList = (void *)nss_InsertDeviceLog(
  540|      0|            (CK_FUNCTION_LIST_3_0_PTR)mod->functionList);
  541|      0|    }
  542|      1|#endif
  543|       |
  544|      1|    return SECSuccess;
  545|       |
  546|      0|fail:
  547|      0|    mod->functionList = NULL;
  548|      0|    disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD");
  549|      0|    if (library && !disableUnload) {
  ------------------
  |  Branch (549:9): [True: 0, False: 0]
  |  Branch (549:20): [True: 0, False: 0]
  ------------------
  550|      0|        PR_UnloadLibrary(library);
  551|      0|    }
  552|      0|    return SECFailure;
  553|      1|}
secmod_InitializeModuleAndGetSlotInfo:
  557|      1|{
  558|      1|    CK_INFO info;
  559|      1|    CK_ULONG slotCount = 0;
  560|      1|    SECStatus rv;
  561|      1|    PRBool alreadyLoaded = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  562|       |
  563|       |    /* This test operation makes sure our locking system is
  564|       |     * consistent even if we are using non-thread safe tokens by
  565|       |     * simulating unsafe tokens with safe ones. */
  566|      1|    mod->isThreadSafe = !PR_GetEnvSecure("NSS_FORCE_TOKEN_LOCK");
  567|       |
  568|       |    /* Now we initialize the module */
  569|      1|    rv = secmod_ModuleInit(mod, oldModule, &alreadyLoaded);
  570|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (570:9): [True: 0, False: 1]
  ------------------
  571|      0|        goto fail;
  572|      0|    }
  573|       |
  574|       |    /* module has been reloaded, this module itself is done,
  575|       |     * return to the caller */
  576|      1|    if (mod->functionList == NULL) {
  ------------------
  |  Branch (576:9): [True: 0, False: 1]
  ------------------
  577|      0|        mod->loaded = PR_TRUE; /* technically the module is loaded.. */
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  578|      0|        return SECSuccess;
  579|      0|    }
  580|       |
  581|       |    /* check the version number */
  582|      1|    if (PK11_GETTAB(mod)->C_GetInfo(&info) != CKR_OK)
  ------------------
  |  |  102|      1|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
                  if (PK11_GETTAB(mod)->C_GetInfo(&info) != CKR_OK)
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (582:9): [True: 0, False: 1]
  ------------------
  583|      0|        goto fail2;
  584|      1|    if (info.cryptokiVersion.major < 2)
  ------------------
  |  Branch (584:9): [True: 0, False: 1]
  ------------------
  585|      0|        goto fail2;
  586|       |    /* all 2.0 are a priori *not* thread safe */
  587|      1|    if ((info.cryptokiVersion.major == 2) && (info.cryptokiVersion.minor < 1)) {
  ------------------
  |  Branch (587:9): [True: 0, False: 1]
  |  Branch (587:46): [True: 0, False: 0]
  ------------------
  588|      0|        if (!loadSingleThreadedModules) {
  ------------------
  |  Branch (588:13): [True: 0, False: 0]
  ------------------
  589|      0|            PORT_SetError(SEC_ERROR_INCOMPATIBLE_PKCS11);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  590|      0|            goto fail2;
  591|      0|        } else {
  592|      0|            mod->isThreadSafe = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  593|      0|        }
  594|      0|    }
  595|      1|    mod->cryptokiVersion = info.cryptokiVersion;
  596|       |
  597|       |    /* If we don't have a common name, get it from the PKCS 11 module */
  598|      1|    if ((mod->commonName == NULL) || (mod->commonName[0] == 0)) {
  ------------------
  |  Branch (598:9): [True: 0, False: 1]
  |  Branch (598:38): [True: 0, False: 1]
  ------------------
  599|      0|        mod->commonName = PK11_MakeString(mod->arena, NULL,
  600|      0|                                          (char *)info.libraryDescription, sizeof(info.libraryDescription));
  601|      0|        if (mod->commonName == NULL)
  ------------------
  |  Branch (601:13): [True: 0, False: 0]
  ------------------
  602|      0|            goto fail2;
  603|      0|    }
  604|       |
  605|       |    /* initialize the Slots */
  606|      1|    if (PK11_GETTAB(mod)->C_GetSlotList(CK_FALSE, NULL, &slotCount) == CKR_OK) {
  ------------------
  |  |  102|      1|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
                  if (PK11_GETTAB(mod)->C_GetSlotList(CK_FALSE, NULL, &slotCount) == CKR_OK) {
  ------------------
  |  |   23|      1|#define CK_FALSE 0
  ------------------
                  if (PK11_GETTAB(mod)->C_GetSlotList(CK_FALSE, NULL, &slotCount) == CKR_OK) {
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (606:9): [True: 1, False: 0]
  ------------------
  607|      1|        CK_SLOT_ID *slotIDs;
  608|      1|        int i;
  609|      1|        CK_RV crv;
  610|       |
  611|      1|        mod->slots = (PK11SlotInfo **)PORT_ArenaAlloc(mod->arena,
  ------------------
  |  |   53|      1|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  612|      1|                                                      sizeof(PK11SlotInfo *) * slotCount);
  613|      1|        if (mod->slots == NULL)
  ------------------
  |  Branch (613:13): [True: 0, False: 1]
  ------------------
  614|      0|            goto fail2;
  615|       |
  616|      1|        slotIDs = (CK_SLOT_ID *)PORT_Alloc(sizeof(CK_SLOT_ID) * slotCount);
  ------------------
  |  |   52|      1|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  617|      1|        if (slotIDs == NULL) {
  ------------------
  |  Branch (617:13): [True: 0, False: 1]
  ------------------
  618|      0|            goto fail2;
  619|      0|        }
  620|      1|        crv = PK11_GETTAB(mod)->C_GetSlotList(CK_FALSE, slotIDs, &slotCount);
  ------------------
  |  |  102|      1|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
                      crv = PK11_GETTAB(mod)->C_GetSlotList(CK_FALSE, slotIDs, &slotCount);
  ------------------
  |  |   23|      1|#define CK_FALSE 0
  ------------------
  621|      1|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (621:13): [True: 0, False: 1]
  ------------------
  622|      0|            PORT_Free(slotIDs);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  623|      0|            goto fail2;
  624|      0|        }
  625|       |
  626|       |        /* Initialize each slot */
  627|      3|        for (i = 0; i < (int)slotCount; i++) {
  ------------------
  |  Branch (627:21): [True: 2, False: 1]
  ------------------
  628|      2|            mod->slots[i] = PK11_NewSlotInfo(mod);
  629|      2|            PK11_InitSlot(mod, slotIDs[i], mod->slots[i]);
  630|       |            /* look down the slot info table */
  631|      2|            PK11_LoadSlotList(mod->slots[i], mod->slotInfo, mod->slotInfoCount);
  632|      2|            SECMOD_SetRootCerts(mod->slots[i], mod);
  633|       |            /* explicitly mark the internal slot as such if IsInternalKeySlot()
  634|       |             * is set */
  635|      2|            if (secmod_IsInternalKeySlot(mod) && (i == (mod->isFIPS ? 0 : 1))) {
  ------------------
  |  Branch (635:17): [True: 2, False: 0]
  |  Branch (635:50): [True: 1, False: 1]
  |  Branch (635:57): [True: 0, False: 2]
  ------------------
  636|      1|                pk11_SetInternalKeySlotIfFirst(mod->slots[i]);
  637|      1|            }
  638|      2|        }
  639|      1|        mod->slotCount = slotCount;
  640|      1|        mod->slotInfoCount = 0;
  641|      1|        PORT_Free(slotIDs);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  642|      1|    }
  643|       |
  644|      1|    mod->loaded = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  645|      1|    mod->moduleID = nextModuleID++;
  646|      1|    return SECSuccess;
  647|      0|fail2:
  648|      0|    if (enforceAlreadyInitializedError || (!alreadyLoaded)) {
  ------------------
  |  Branch (648:9): [True: 0, False: 0]
  |  Branch (648:43): [True: 0, False: 0]
  ------------------
  649|      0|        PK11_GETTAB(mod)->C_Finalize(NULL);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  650|      0|    }
  651|      0|fail:
  652|      0|    mod->functionList = NULL;
  653|      0|    return SECFailure;
  654|      0|}
secmod_LoadPKCS11Module:
  661|      2|{
  662|      2|    SECStatus rv = SECFailure;
  663|      2|    if (mod->loaded) {
  ------------------
  |  Branch (663:9): [True: 0, False: 2]
  ------------------
  664|      0|        return SECSuccess;
  665|      0|    }
  666|       |
  667|      2|    mod->fipsIndicator = NULL;
  668|       |
  669|      2|    rv = secmod_DetermineModuleFunctionList(mod);
  670|      2|    if (rv != SECSuccess) { // The error code is set up by secmod_DetermineModuleFunctionList.
  ------------------
  |  Branch (670:9): [True: 0, False: 2]
  ------------------
  671|      0|        return rv;
  672|      0|    }
  673|       |
  674|      2|    if (mod->loaded == PR_TRUE) {
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
  |  Branch (674:9): [True: 1, False: 1]
  ------------------
  675|      1|        return SECSuccess;
  676|      1|    }
  677|       |
  678|      1|    rv = secmod_InitializeModuleAndGetSlotInfo(mod, oldModule);
  679|      1|    if (rv != SECSuccess) { // The error code is set up by secmod_InitializeModuleAndGetSlotInfo
  ------------------
  |  Branch (679:9): [True: 0, False: 1]
  ------------------
  680|      0|        return rv;
  681|      0|    }
  682|       |
  683|      1|    return SECSuccess;
  684|      1|}
SECMOD_UnloadModule:
  729|      2|{
  730|      2|    PRLibrary *library;
  731|      2|    char *disableUnload = NULL;
  732|       |
  733|      2|    if (!mod->loaded) {
  ------------------
  |  Branch (733:9): [True: 0, False: 2]
  ------------------
  734|      0|        return SECFailure;
  735|      0|    }
  736|      2|    if (finalizeModules) {
  ------------------
  |  Branch (736:9): [True: 2, False: 0]
  ------------------
  737|      2|        if (mod->functionList && !mod->moduleDBOnly) {
  ------------------
  |  Branch (737:13): [True: 1, False: 1]
  |  Branch (737:34): [True: 1, False: 0]
  ------------------
  738|      1|            PK11_GETTAB(mod)->C_Finalize(NULL);
  ------------------
  |  |  102|      1|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  739|      1|        }
  740|      2|    }
  741|      2|    mod->moduleID = 0;
  742|      2|    mod->loaded = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  743|       |
  744|       |    /* do we want the semantics to allow unloading the internal library?
  745|       |     * if not, we should change this to SECFailure and move it above the
  746|       |     * mod->loaded = PR_FALSE; */
  747|      2|    if (mod->internal && (mod->dllName == NULL)) {
  ------------------
  |  Branch (747:9): [True: 2, False: 0]
  |  Branch (747:26): [True: 2, False: 0]
  ------------------
  748|       |#ifndef NSS_STATIC_SOFTOKEN
  749|       |        if (0 == PR_ATOMIC_DECREMENT(&softokenLoadCount)) {
  750|       |            if (softokenLib) {
  751|       |                disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD");
  752|       |                if (!disableUnload) {
  753|       |#ifdef DEBUG
  754|       |                    PRStatus status = PR_UnloadLibrary(softokenLib);
  755|       |                    PORT_Assert(PR_SUCCESS == status);
  756|       |#else
  757|       |                    PR_UnloadLibrary(softokenLib);
  758|       |#endif
  759|       |                }
  760|       |                softokenLib = NULL;
  761|       |            }
  762|       |            loadSoftokenOnce = pristineCallOnce;
  763|       |        }
  764|       |#endif
  765|      2|        return SECSuccess;
  766|      2|    }
  767|       |
  768|      0|    library = (PRLibrary *)mod->library;
  769|       |    /* if no library, then we should not unload it */
  770|      0|    if (library == NULL) {
  ------------------
  |  Branch (770:9): [True: 0, False: 0]
  ------------------
  771|      0|        return SECSuccess;
  772|      0|    }
  773|       |
  774|      0|    disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD");
  775|      0|    if (!disableUnload) {
  ------------------
  |  Branch (775:9): [True: 0, False: 0]
  ------------------
  776|      0|        PR_UnloadLibrary(library);
  777|      0|    }
  778|      0|    return SECSuccess;
  779|      0|}
nss_DumpModuleLog:
  783|      1|{
  784|      1|#ifdef DEBUG_MODULE
  785|      1|    if (modToDBG) {
  ------------------
  |  Branch (785:9): [True: 0, False: 1]
  ------------------
  786|      0|        print_final_statistics();
  787|      0|    }
  788|      1|#endif
  789|      1|}

PK11_GetBestWrapMechanism:
   90|      1|{
   91|      1|    int i;
   92|      1|    for (i = 0; i < wrapMechanismCount; i++) {
  ------------------
  |  Branch (92:17): [True: 1, False: 0]
  ------------------
   93|      1|        if (PK11_DoesMechanism(slot, wrapMechanismList[i])) {
  ------------------
  |  Branch (93:13): [True: 1, False: 0]
  ------------------
   94|      1|            return wrapMechanismList[i];
   95|      1|        }
   96|      1|    }
   97|      0|    return CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|      0|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
   98|      1|}
PK11_GetKeyType:
  216|  26.8k|{
  217|  26.8k|    switch (type) {
  218|      0|        case CKM_SEED_ECB:
  ------------------
  |  | 1156|      0|#define CKM_SEED_ECB 0x00000651UL
  ------------------
  |  Branch (218:9): [True: 0, False: 26.8k]
  ------------------
  219|    135|        case CKM_SEED_CBC:
  ------------------
  |  | 1157|    135|#define CKM_SEED_CBC 0x00000652UL
  ------------------
  |  Branch (219:9): [True: 135, False: 26.7k]
  ------------------
  220|    135|        case CKM_SEED_MAC:
  ------------------
  |  | 1158|    135|#define CKM_SEED_MAC 0x00000653UL
  ------------------
  |  Branch (220:9): [True: 0, False: 26.8k]
  ------------------
  221|    135|        case CKM_SEED_MAC_GENERAL:
  ------------------
  |  | 1159|    135|#define CKM_SEED_MAC_GENERAL 0x00000654UL
  ------------------
  |  Branch (221:9): [True: 0, False: 26.8k]
  ------------------
  222|    135|        case CKM_SEED_CBC_PAD:
  ------------------
  |  | 1160|    135|#define CKM_SEED_CBC_PAD 0x00000655UL
  ------------------
  |  Branch (222:9): [True: 0, False: 26.8k]
  ------------------
  223|    135|        case CKM_SEED_KEY_GEN:
  ------------------
  |  | 1155|    135|#define CKM_SEED_KEY_GEN 0x00000650UL
  ------------------
  |  Branch (223:9): [True: 0, False: 26.8k]
  ------------------
  224|    135|            return CKK_SEED;
  ------------------
  |  |  416|    135|#define CKK_SEED 0x0000002FUL /* was 2A */
  ------------------
  225|      0|        case CKM_CAMELLIA_ECB:
  ------------------
  |  | 1136|      0|#define CKM_CAMELLIA_ECB 0x00000551UL
  ------------------
  |  Branch (225:9): [True: 0, False: 26.8k]
  ------------------
  226|     44|        case CKM_CAMELLIA_CBC:
  ------------------
  |  | 1137|     44|#define CKM_CAMELLIA_CBC 0x00000552UL
  ------------------
  |  Branch (226:9): [True: 44, False: 26.8k]
  ------------------
  227|     44|        case CKM_CAMELLIA_MAC:
  ------------------
  |  | 1138|     44|#define CKM_CAMELLIA_MAC 0x00000553UL
  ------------------
  |  Branch (227:9): [True: 0, False: 26.8k]
  ------------------
  228|     44|        case CKM_CAMELLIA_MAC_GENERAL:
  ------------------
  |  | 1139|     44|#define CKM_CAMELLIA_MAC_GENERAL 0x00000554UL
  ------------------
  |  Branch (228:9): [True: 0, False: 26.8k]
  ------------------
  229|     44|        case CKM_CAMELLIA_CBC_PAD:
  ------------------
  |  | 1140|     44|#define CKM_CAMELLIA_CBC_PAD 0x00000555UL
  ------------------
  |  Branch (229:9): [True: 0, False: 26.8k]
  ------------------
  230|     44|        case CKM_CAMELLIA_KEY_GEN:
  ------------------
  |  | 1135|     44|#define CKM_CAMELLIA_KEY_GEN 0x00000550UL
  ------------------
  |  Branch (230:9): [True: 0, False: 26.8k]
  ------------------
  231|     44|            return CKK_CAMELLIA;
  ------------------
  |  |  414|     44|#define CKK_CAMELLIA 0x00000025UL
  ------------------
  232|      0|        case CKM_NSS_CHACHA20_POLY1305:
  ------------------
  |  |  243|      0|#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 28)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (232:9): [True: 0, False: 26.8k]
  ------------------
  233|      0|        case CKM_NSS_CHACHA20_KEY_GEN:
  ------------------
  |  |  242|      0|#define CKM_NSS_CHACHA20_KEY_GEN (CKM_NSS + 27)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (233:9): [True: 0, False: 26.8k]
  ------------------
  234|     22|        case CKM_NSS_CHACHA20_CTR:
  ------------------
  |  |  251|     22|#define CKM_NSS_CHACHA20_CTR (CKM_NSS + 33)
  |  |  ------------------
  |  |  |  |  162|     22|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|     22|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     22|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (234:9): [True: 22, False: 26.8k]
  ------------------
  235|     22|            return CKK_NSS_CHACHA20;
  ------------------
  |  |   56|     22|#define CKK_NSS_CHACHA20 (CKK_NSS + 4)
  |  |  ------------------
  |  |  |  |   49|     22|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|     22|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     22|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|     24|        case CKM_CHACHA20_POLY1305:
  ------------------
  |  | 1287|     24|#define CKM_CHACHA20_POLY1305 0x00004021UL
  ------------------
  |  Branch (236:9): [True: 24, False: 26.8k]
  ------------------
  237|     24|        case CKM_CHACHA20_KEY_GEN:
  ------------------
  |  | 1203|     24|#define CKM_CHACHA20_KEY_GEN 0x00001225UL
  ------------------
  |  Branch (237:9): [True: 0, False: 26.8k]
  ------------------
  238|     24|        case CKM_CHACHA20:
  ------------------
  |  | 1204|     24|#define CKM_CHACHA20 0x00001226UL
  ------------------
  |  Branch (238:9): [True: 0, False: 26.8k]
  ------------------
  239|     24|            return CKK_CHACHA20;
  ------------------
  |  |  433|     24|#define CKK_CHACHA20 0x00000033UL
  ------------------
  240|    875|        case CKM_AES_ECB:
  ------------------
  |  | 1107|    875|#define CKM_AES_ECB 0x00001081UL
  ------------------
  |  Branch (240:9): [True: 875, False: 26.0k]
  ------------------
  241|  1.13k|        case CKM_AES_CBC:
  ------------------
  |  | 1108|  1.13k|#define CKM_AES_CBC 0x00001082UL
  ------------------
  |  Branch (241:9): [True: 263, False: 26.6k]
  ------------------
  242|  1.13k|        case CKM_AES_CCM:
  ------------------
  |  | 1116|  1.13k|#define CKM_AES_CCM 0x00001088UL
  ------------------
  |  Branch (242:9): [True: 0, False: 26.8k]
  ------------------
  243|  1.13k|        case CKM_AES_CTR:
  ------------------
  |  | 1113|  1.13k|#define CKM_AES_CTR 0x00001086UL
  ------------------
  |  Branch (243:9): [True: 0, False: 26.8k]
  ------------------
  244|  1.13k|        case CKM_AES_CTS:
  ------------------
  |  | 1117|  1.13k|#define CKM_AES_CTS 0x00001089UL
  ------------------
  |  Branch (244:9): [True: 0, False: 26.8k]
  ------------------
  245|  2.19k|        case CKM_AES_GCM:
  ------------------
  |  | 1115|  2.19k|#define CKM_AES_GCM 0x00001087UL
  ------------------
  |  Branch (245:9): [True: 1.05k, False: 25.8k]
  ------------------
  246|  2.19k|        case CKM_AES_MAC:
  ------------------
  |  | 1109|  2.19k|#define CKM_AES_MAC 0x00001083UL
  ------------------
  |  Branch (246:9): [True: 0, False: 26.8k]
  ------------------
  247|  2.19k|        case CKM_AES_MAC_GENERAL:
  ------------------
  |  | 1110|  2.19k|#define CKM_AES_MAC_GENERAL 0x00001084UL
  ------------------
  |  Branch (247:9): [True: 0, False: 26.8k]
  ------------------
  248|  2.19k|        case CKM_AES_CMAC:
  ------------------
  |  | 1119|  2.19k|#define CKM_AES_CMAC 0x0000108AUL
  ------------------
  |  Branch (248:9): [True: 0, False: 26.8k]
  ------------------
  249|  2.19k|        case CKM_AES_CMAC_GENERAL:
  ------------------
  |  | 1120|  2.19k|#define CKM_AES_CMAC_GENERAL 0x0000108BUL
  ------------------
  |  Branch (249:9): [True: 0, False: 26.8k]
  ------------------
  250|  2.19k|        case CKM_AES_CBC_PAD:
  ------------------
  |  | 1111|  2.19k|#define CKM_AES_CBC_PAD 0x00001085UL
  ------------------
  |  Branch (250:9): [True: 0, False: 26.8k]
  ------------------
  251|  2.19k|        case CKM_AES_KEY_GEN:
  ------------------
  |  | 1106|  2.19k|#define CKM_AES_KEY_GEN 0x00001080UL
  ------------------
  |  Branch (251:9): [True: 0, False: 26.8k]
  ------------------
  252|  2.19k|        case CKM_NSS_AES_KEY_WRAP:
  ------------------
  |  |  164|  2.19k|#define CKM_NSS_AES_KEY_WRAP (CKM_NSS + 1)
  |  |  ------------------
  |  |  |  |  162|  2.19k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  2.19k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  2.19k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (252:9): [True: 0, False: 26.8k]
  ------------------
  253|  2.19k|        case CKM_NSS_AES_KEY_WRAP_PAD:
  ------------------
  |  |  165|  2.19k|#define CKM_NSS_AES_KEY_WRAP_PAD (CKM_NSS + 2)
  |  |  ------------------
  |  |  |  |  162|  2.19k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  2.19k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  2.19k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (253:9): [True: 0, False: 26.8k]
  ------------------
  254|  2.19k|        case CKM_AES_KEY_WRAP:
  ------------------
  |  | 1231|  2.19k|#define CKM_AES_KEY_WRAP 0x00002109UL
  ------------------
  |  Branch (254:9): [True: 0, False: 26.8k]
  ------------------
  255|  2.19k|        case CKM_AES_KEY_WRAP_KWP:
  ------------------
  |  | 1233|  2.19k|#define CKM_AES_KEY_WRAP_KWP 0x0000210BUL
  ------------------
  |  Branch (255:9): [True: 0, False: 26.8k]
  ------------------
  256|  2.19k|        case CKM_AES_XCBC_MAC:
  ------------------
  |  | 1121|  2.19k|#define CKM_AES_XCBC_MAC 0x0000108CUL
  ------------------
  |  Branch (256:9): [True: 0, False: 26.8k]
  ------------------
  257|  2.19k|        case CKM_AES_XCBC_MAC_96:
  ------------------
  |  | 1122|  2.19k|#define CKM_AES_XCBC_MAC_96 0x0000108DUL
  ------------------
  |  Branch (257:9): [True: 0, False: 26.8k]
  ------------------
  258|  2.19k|            return CKK_AES;
  ------------------
  |  |  402|  2.19k|#define CKK_AES 0x0000001FUL
  ------------------
  259|      0|        case CKM_DES_ECB:
  ------------------
  |  |  815|      0|#define CKM_DES_ECB 0x00000121UL
  ------------------
  |  Branch (259:9): [True: 0, False: 26.8k]
  ------------------
  260|    151|        case CKM_DES_CBC:
  ------------------
  |  |  816|    151|#define CKM_DES_CBC 0x00000122UL
  ------------------
  |  Branch (260:9): [True: 151, False: 26.7k]
  ------------------
  261|    151|        case CKM_DES_MAC:
  ------------------
  |  |  817|    151|#define CKM_DES_MAC 0x00000123UL
  ------------------
  |  Branch (261:9): [True: 0, False: 26.8k]
  ------------------
  262|    151|        case CKM_DES_MAC_GENERAL:
  ------------------
  |  |  820|    151|#define CKM_DES_MAC_GENERAL 0x00000124UL
  ------------------
  |  Branch (262:9): [True: 0, False: 26.8k]
  ------------------
  263|    151|        case CKM_DES_CBC_PAD:
  ------------------
  |  |  821|    151|#define CKM_DES_CBC_PAD 0x00000125UL
  ------------------
  |  Branch (263:9): [True: 0, False: 26.8k]
  ------------------
  264|    151|        case CKM_DES_KEY_GEN:
  ------------------
  |  |  814|    151|#define CKM_DES_KEY_GEN 0x00000120UL
  ------------------
  |  Branch (264:9): [True: 0, False: 26.8k]
  ------------------
  265|    151|        case CKM_KEY_WRAP_LYNKS:
  ------------------
  |  | 1035|    151|#define CKM_KEY_WRAP_LYNKS 0x00000400UL
  ------------------
  |  Branch (265:9): [True: 0, False: 26.8k]
  ------------------
  266|    151|        case CKM_PBE_MD2_DES_CBC:
  ------------------
  |  |  997|    151|#define CKM_PBE_MD2_DES_CBC 0x000003A0UL
  ------------------
  |  Branch (266:9): [True: 0, False: 26.8k]
  ------------------
  267|    151|        case CKM_PBE_MD5_DES_CBC:
  ------------------
  |  |  998|    151|#define CKM_PBE_MD5_DES_CBC 0x000003A1UL
  ------------------
  |  Branch (267:9): [True: 0, False: 26.8k]
  ------------------
  268|    151|            return CKK_DES;
  ------------------
  |  |  386|    151|#define CKK_DES 0x00000013UL
  ------------------
  269|      0|        case CKM_DES3_ECB:
  ------------------
  |  |  825|      0|#define CKM_DES3_ECB 0x00000132UL
  ------------------
  |  Branch (269:9): [True: 0, False: 26.8k]
  ------------------
  270|    608|        case CKM_DES3_CBC:
  ------------------
  |  |  826|    608|#define CKM_DES3_CBC 0x00000133UL
  ------------------
  |  Branch (270:9): [True: 608, False: 26.2k]
  ------------------
  271|    608|        case CKM_DES3_MAC:
  ------------------
  |  |  827|    608|#define CKM_DES3_MAC 0x00000134UL
  ------------------
  |  Branch (271:9): [True: 0, False: 26.8k]
  ------------------
  272|    608|        case CKM_DES3_MAC_GENERAL:
  ------------------
  |  |  832|    608|#define CKM_DES3_MAC_GENERAL 0x00000135UL
  ------------------
  |  Branch (272:9): [True: 0, False: 26.8k]
  ------------------
  273|    608|        case CKM_DES3_CBC_PAD:
  ------------------
  |  |  833|    608|#define CKM_DES3_CBC_PAD 0x00000136UL
  ------------------
  |  Branch (273:9): [True: 0, False: 26.8k]
  ------------------
  274|    608|            return (len == 16) ? CKK_DES2 : CKK_DES3;
  ------------------
  |  |  387|      0|#define CKK_DES2 0x00000014UL
  ------------------
                          return (len == 16) ? CKK_DES2 : CKK_DES3;
  ------------------
  |  |  388|    608|#define CKK_DES3 0x00000015UL
  ------------------
  |  Branch (274:20): [True: 0, False: 608]
  ------------------
  275|      0|        case CKM_DES2_KEY_GEN:
  ------------------
  |  |  823|      0|#define CKM_DES2_KEY_GEN 0x00000130UL
  ------------------
  |  Branch (275:9): [True: 0, False: 26.8k]
  ------------------
  276|      0|        case CKM_PBE_SHA1_DES2_EDE_CBC:
  ------------------
  |  | 1008|      0|#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9UL
  ------------------
  |  Branch (276:9): [True: 0, False: 26.8k]
  ------------------
  277|      0|            return CKK_DES2;
  ------------------
  |  |  387|      0|#define CKK_DES2 0x00000014UL
  ------------------
  278|      0|        case CKM_PBE_SHA1_DES3_EDE_CBC:
  ------------------
  |  | 1007|      0|#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8UL
  ------------------
  |  Branch (278:9): [True: 0, False: 26.8k]
  ------------------
  279|      0|        case CKM_DES3_KEY_GEN:
  ------------------
  |  |  824|      0|#define CKM_DES3_KEY_GEN 0x00000131UL
  ------------------
  |  Branch (279:9): [True: 0, False: 26.8k]
  ------------------
  280|      0|            return CKK_DES3;
  ------------------
  |  |  388|      0|#define CKK_DES3 0x00000015UL
  ------------------
  281|      0|        case CKM_CDMF_ECB:
  ------------------
  |  |  835|      0|#define CKM_CDMF_ECB 0x00000141UL
  ------------------
  |  Branch (281:9): [True: 0, False: 26.8k]
  ------------------
  282|      0|        case CKM_CDMF_CBC:
  ------------------
  |  |  836|      0|#define CKM_CDMF_CBC 0x00000142UL
  ------------------
  |  Branch (282:9): [True: 0, False: 26.8k]
  ------------------
  283|      0|        case CKM_CDMF_MAC:
  ------------------
  |  |  837|      0|#define CKM_CDMF_MAC 0x00000143UL
  ------------------
  |  Branch (283:9): [True: 0, False: 26.8k]
  ------------------
  284|      0|        case CKM_CDMF_MAC_GENERAL:
  ------------------
  |  |  838|      0|#define CKM_CDMF_MAC_GENERAL 0x00000144UL
  ------------------
  |  Branch (284:9): [True: 0, False: 26.8k]
  ------------------
  285|      0|        case CKM_CDMF_CBC_PAD:
  ------------------
  |  |  839|      0|#define CKM_CDMF_CBC_PAD 0x00000145UL
  ------------------
  |  Branch (285:9): [True: 0, False: 26.8k]
  ------------------
  286|      0|        case CKM_CDMF_KEY_GEN:
  ------------------
  |  |  834|      0|#define CKM_CDMF_KEY_GEN 0x00000140UL
  ------------------
  |  Branch (286:9): [True: 0, False: 26.8k]
  ------------------
  287|      0|            return CKK_CDMF;
  ------------------
  |  |  401|      0|#define CKK_CDMF 0x0000001EUL
  ------------------
  288|      0|        case CKM_RC2_ECB:
  ------------------
  |  |  804|      0|#define CKM_RC2_ECB 0x00000101UL
  ------------------
  |  Branch (288:9): [True: 0, False: 26.8k]
  ------------------
  289|      0|        case CKM_RC2_CBC:
  ------------------
  |  |  805|      0|#define CKM_RC2_CBC 0x00000102UL
  ------------------
  |  Branch (289:9): [True: 0, False: 26.8k]
  ------------------
  290|      0|        case CKM_RC2_MAC:
  ------------------
  |  |  806|      0|#define CKM_RC2_MAC 0x00000103UL
  ------------------
  |  Branch (290:9): [True: 0, False: 26.8k]
  ------------------
  291|      0|        case CKM_RC2_MAC_GENERAL:
  ------------------
  |  |  809|      0|#define CKM_RC2_MAC_GENERAL 0x00000104UL
  ------------------
  |  Branch (291:9): [True: 0, False: 26.8k]
  ------------------
  292|      0|        case CKM_RC2_CBC_PAD:
  ------------------
  |  |  810|      0|#define CKM_RC2_CBC_PAD 0x00000105UL
  ------------------
  |  Branch (292:9): [True: 0, False: 26.8k]
  ------------------
  293|      0|        case CKM_RC2_KEY_GEN:
  ------------------
  |  |  803|      0|#define CKM_RC2_KEY_GEN 0x00000100UL
  ------------------
  |  Branch (293:9): [True: 0, False: 26.8k]
  ------------------
  294|      0|        case CKM_PBE_SHA1_RC2_128_CBC:
  ------------------
  |  | 1009|      0|#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AAUL
  ------------------
  |  Branch (294:9): [True: 0, False: 26.8k]
  ------------------
  295|      0|        case CKM_PBE_SHA1_RC2_40_CBC:
  ------------------
  |  | 1010|      0|#define CKM_PBE_SHA1_RC2_40_CBC 0x000003ABUL
  ------------------
  |  Branch (295:9): [True: 0, False: 26.8k]
  ------------------
  296|      0|            return CKK_RC2;
  ------------------
  |  |  384|      0|#define CKK_RC2 0x00000011UL
  ------------------
  297|      0|        case CKM_RC4:
  ------------------
  |  |  813|      0|#define CKM_RC4 0x00000111UL
  ------------------
  |  Branch (297:9): [True: 0, False: 26.8k]
  ------------------
  298|      0|        case CKM_RC4_KEY_GEN:
  ------------------
  |  |  812|      0|#define CKM_RC4_KEY_GEN 0x00000110UL
  ------------------
  |  Branch (298:9): [True: 0, False: 26.8k]
  ------------------
  299|      0|            return CKK_RC4;
  ------------------
  |  |  385|      0|#define CKK_RC4 0x00000012UL
  ------------------
  300|      0|        case CKM_RC5_ECB:
  ------------------
  |  |  942|      0|#define CKM_RC5_ECB 0x00000331UL
  ------------------
  |  Branch (300:9): [True: 0, False: 26.8k]
  ------------------
  301|      0|        case CKM_RC5_CBC:
  ------------------
  |  |  943|      0|#define CKM_RC5_CBC 0x00000332UL
  ------------------
  |  Branch (301:9): [True: 0, False: 26.8k]
  ------------------
  302|      0|        case CKM_RC5_MAC:
  ------------------
  |  |  944|      0|#define CKM_RC5_MAC 0x00000333UL
  ------------------
  |  Branch (302:9): [True: 0, False: 26.8k]
  ------------------
  303|      0|        case CKM_RC5_MAC_GENERAL:
  ------------------
  |  |  945|      0|#define CKM_RC5_MAC_GENERAL 0x00000334UL
  ------------------
  |  Branch (303:9): [True: 0, False: 26.8k]
  ------------------
  304|      0|        case CKM_RC5_CBC_PAD:
  ------------------
  |  |  946|      0|#define CKM_RC5_CBC_PAD 0x00000335UL
  ------------------
  |  Branch (304:9): [True: 0, False: 26.8k]
  ------------------
  305|      0|        case CKM_RC5_KEY_GEN:
  ------------------
  |  |  941|      0|#define CKM_RC5_KEY_GEN 0x00000330UL
  ------------------
  |  Branch (305:9): [True: 0, False: 26.8k]
  ------------------
  306|      0|            return CKK_RC5;
  ------------------
  |  |  396|      0|#define CKK_RC5 0x00000019UL
  ------------------
  307|      0|        case CKM_SKIPJACK_CBC64:
  ------------------
  |  | 1049|      0|#define CKM_SKIPJACK_CBC64 0x00001002UL
  ------------------
  |  Branch (307:9): [True: 0, False: 26.8k]
  ------------------
  308|      0|        case CKM_SKIPJACK_ECB64:
  ------------------
  |  | 1048|      0|#define CKM_SKIPJACK_ECB64 0x00001001UL
  ------------------
  |  Branch (308:9): [True: 0, False: 26.8k]
  ------------------
  309|      0|        case CKM_SKIPJACK_OFB64:
  ------------------
  |  | 1050|      0|#define CKM_SKIPJACK_OFB64 0x00001003UL
  ------------------
  |  Branch (309:9): [True: 0, False: 26.8k]
  ------------------
  310|      0|        case CKM_SKIPJACK_CFB64:
  ------------------
  |  | 1051|      0|#define CKM_SKIPJACK_CFB64 0x00001004UL
  ------------------
  |  Branch (310:9): [True: 0, False: 26.8k]
  ------------------
  311|      0|        case CKM_SKIPJACK_CFB32:
  ------------------
  |  | 1052|      0|#define CKM_SKIPJACK_CFB32 0x00001005UL
  ------------------
  |  Branch (311:9): [True: 0, False: 26.8k]
  ------------------
  312|      0|        case CKM_SKIPJACK_CFB16:
  ------------------
  |  | 1053|      0|#define CKM_SKIPJACK_CFB16 0x00001006UL
  ------------------
  |  Branch (312:9): [True: 0, False: 26.8k]
  ------------------
  313|      0|        case CKM_SKIPJACK_CFB8:
  ------------------
  |  | 1054|      0|#define CKM_SKIPJACK_CFB8 0x00001007UL
  ------------------
  |  Branch (313:9): [True: 0, False: 26.8k]
  ------------------
  314|      0|        case CKM_SKIPJACK_KEY_GEN:
  ------------------
  |  | 1047|      0|#define CKM_SKIPJACK_KEY_GEN 0x00001000UL
  ------------------
  |  Branch (314:9): [True: 0, False: 26.8k]
  ------------------
  315|      0|        case CKM_SKIPJACK_WRAP:
  ------------------
  |  | 1055|      0|#define CKM_SKIPJACK_WRAP 0x00001008UL
  ------------------
  |  Branch (315:9): [True: 0, False: 26.8k]
  ------------------
  316|      0|        case CKM_SKIPJACK_PRIVATE_WRAP:
  ------------------
  |  | 1056|      0|#define CKM_SKIPJACK_PRIVATE_WRAP 0x00001009UL
  ------------------
  |  Branch (316:9): [True: 0, False: 26.8k]
  ------------------
  317|      0|            return CKK_SKIPJACK;
  ------------------
  |  |  398|      0|#define CKK_SKIPJACK 0x0000001BUL
  ------------------
  318|      0|        case CKM_BATON_ECB128:
  ------------------
  |  | 1062|      0|#define CKM_BATON_ECB128 0x00001031UL
  ------------------
  |  Branch (318:9): [True: 0, False: 26.8k]
  ------------------
  319|      0|        case CKM_BATON_ECB96:
  ------------------
  |  | 1063|      0|#define CKM_BATON_ECB96 0x00001032UL
  ------------------
  |  Branch (319:9): [True: 0, False: 26.8k]
  ------------------
  320|      0|        case CKM_BATON_CBC128:
  ------------------
  |  | 1064|      0|#define CKM_BATON_CBC128 0x00001033UL
  ------------------
  |  Branch (320:9): [True: 0, False: 26.8k]
  ------------------
  321|      0|        case CKM_BATON_COUNTER:
  ------------------
  |  | 1065|      0|#define CKM_BATON_COUNTER 0x00001034UL
  ------------------
  |  Branch (321:9): [True: 0, False: 26.8k]
  ------------------
  322|      0|        case CKM_BATON_SHUFFLE:
  ------------------
  |  | 1066|      0|#define CKM_BATON_SHUFFLE 0x00001035UL
  ------------------
  |  Branch (322:9): [True: 0, False: 26.8k]
  ------------------
  323|      0|        case CKM_BATON_WRAP:
  ------------------
  |  | 1067|      0|#define CKM_BATON_WRAP 0x00001036UL
  ------------------
  |  Branch (323:9): [True: 0, False: 26.8k]
  ------------------
  324|      0|        case CKM_BATON_KEY_GEN:
  ------------------
  |  | 1061|      0|#define CKM_BATON_KEY_GEN 0x00001030UL
  ------------------
  |  Branch (324:9): [True: 0, False: 26.8k]
  ------------------
  325|      0|            return CKK_BATON;
  ------------------
  |  |  399|      0|#define CKK_BATON 0x0000001CUL
  ------------------
  326|      0|        case CKM_JUNIPER_ECB128:
  ------------------
  |  | 1095|      0|#define CKM_JUNIPER_ECB128 0x00001061UL
  ------------------
  |  Branch (326:9): [True: 0, False: 26.8k]
  ------------------
  327|      0|        case CKM_JUNIPER_CBC128:
  ------------------
  |  | 1096|      0|#define CKM_JUNIPER_CBC128 0x00001062UL
  ------------------
  |  Branch (327:9): [True: 0, False: 26.8k]
  ------------------
  328|      0|        case CKM_JUNIPER_COUNTER:
  ------------------
  |  | 1097|      0|#define CKM_JUNIPER_COUNTER 0x00001063UL
  ------------------
  |  Branch (328:9): [True: 0, False: 26.8k]
  ------------------
  329|      0|        case CKM_JUNIPER_SHUFFLE:
  ------------------
  |  | 1098|      0|#define CKM_JUNIPER_SHUFFLE 0x00001064UL
  ------------------
  |  Branch (329:9): [True: 0, False: 26.8k]
  ------------------
  330|      0|        case CKM_JUNIPER_WRAP:
  ------------------
  |  | 1099|      0|#define CKM_JUNIPER_WRAP 0x00001065UL
  ------------------
  |  Branch (330:9): [True: 0, False: 26.8k]
  ------------------
  331|      0|        case CKM_JUNIPER_KEY_GEN:
  ------------------
  |  | 1094|      0|#define CKM_JUNIPER_KEY_GEN 0x00001060UL
  ------------------
  |  Branch (331:9): [True: 0, False: 26.8k]
  ------------------
  332|      0|            return CKK_JUNIPER;
  ------------------
  |  |  400|      0|#define CKK_JUNIPER 0x0000001DUL
  ------------------
  333|      0|        case CKM_IDEA_CBC:
  ------------------
  |  |  949|      0|#define CKM_IDEA_CBC 0x00000342UL
  ------------------
  |  Branch (333:9): [True: 0, False: 26.8k]
  ------------------
  334|      0|        case CKM_IDEA_ECB:
  ------------------
  |  |  948|      0|#define CKM_IDEA_ECB 0x00000341UL
  ------------------
  |  Branch (334:9): [True: 0, False: 26.8k]
  ------------------
  335|      0|        case CKM_IDEA_MAC:
  ------------------
  |  |  950|      0|#define CKM_IDEA_MAC 0x00000343UL
  ------------------
  |  Branch (335:9): [True: 0, False: 26.8k]
  ------------------
  336|      0|        case CKM_IDEA_MAC_GENERAL:
  ------------------
  |  |  951|      0|#define CKM_IDEA_MAC_GENERAL 0x00000344UL
  ------------------
  |  Branch (336:9): [True: 0, False: 26.8k]
  ------------------
  337|      0|        case CKM_IDEA_CBC_PAD:
  ------------------
  |  |  952|      0|#define CKM_IDEA_CBC_PAD 0x00000345UL
  ------------------
  |  Branch (337:9): [True: 0, False: 26.8k]
  ------------------
  338|      0|        case CKM_IDEA_KEY_GEN:
  ------------------
  |  |  947|      0|#define CKM_IDEA_KEY_GEN 0x00000340UL
  ------------------
  |  Branch (338:9): [True: 0, False: 26.8k]
  ------------------
  339|      0|            return CKK_IDEA;
  ------------------
  |  |  397|      0|#define CKK_IDEA 0x0000001AUL
  ------------------
  340|      0|        case CKM_CAST_ECB:
  ------------------
  |  |  918|      0|#define CKM_CAST_ECB 0x00000301UL
  ------------------
  |  Branch (340:9): [True: 0, False: 26.8k]
  ------------------
  341|      0|        case CKM_CAST_CBC:
  ------------------
  |  |  919|      0|#define CKM_CAST_CBC 0x00000302UL
  ------------------
  |  Branch (341:9): [True: 0, False: 26.8k]
  ------------------
  342|      0|        case CKM_CAST_MAC:
  ------------------
  |  |  920|      0|#define CKM_CAST_MAC 0x00000303UL
  ------------------
  |  Branch (342:9): [True: 0, False: 26.8k]
  ------------------
  343|      0|        case CKM_CAST_MAC_GENERAL:
  ------------------
  |  |  921|      0|#define CKM_CAST_MAC_GENERAL 0x00000304UL
  ------------------
  |  Branch (343:9): [True: 0, False: 26.8k]
  ------------------
  344|      0|        case CKM_CAST_CBC_PAD:
  ------------------
  |  |  922|      0|#define CKM_CAST_CBC_PAD 0x00000305UL
  ------------------
  |  Branch (344:9): [True: 0, False: 26.8k]
  ------------------
  345|      0|        case CKM_CAST_KEY_GEN:
  ------------------
  |  |  917|      0|#define CKM_CAST_KEY_GEN 0x00000300UL
  ------------------
  |  Branch (345:9): [True: 0, False: 26.8k]
  ------------------
  346|      0|        case CKM_PBE_MD5_CAST_CBC:
  ------------------
  |  |  999|      0|#define CKM_PBE_MD5_CAST_CBC 0x000003A2UL
  ------------------
  |  Branch (346:9): [True: 0, False: 26.8k]
  ------------------
  347|      0|            return CKK_CAST;
  ------------------
  |  |  391|      0|#define CKK_CAST 0x00000016UL
  ------------------
  348|      0|        case CKM_CAST3_ECB:
  ------------------
  |  |  924|      0|#define CKM_CAST3_ECB 0x00000311UL
  ------------------
  |  Branch (348:9): [True: 0, False: 26.8k]
  ------------------
  349|      0|        case CKM_CAST3_CBC:
  ------------------
  |  |  925|      0|#define CKM_CAST3_CBC 0x00000312UL
  ------------------
  |  Branch (349:9): [True: 0, False: 26.8k]
  ------------------
  350|      0|        case CKM_CAST3_MAC:
  ------------------
  |  |  926|      0|#define CKM_CAST3_MAC 0x00000313UL
  ------------------
  |  Branch (350:9): [True: 0, False: 26.8k]
  ------------------
  351|      0|        case CKM_CAST3_MAC_GENERAL:
  ------------------
  |  |  927|      0|#define CKM_CAST3_MAC_GENERAL 0x00000314UL
  ------------------
  |  Branch (351:9): [True: 0, False: 26.8k]
  ------------------
  352|      0|        case CKM_CAST3_CBC_PAD:
  ------------------
  |  |  928|      0|#define CKM_CAST3_CBC_PAD 0x00000315UL
  ------------------
  |  Branch (352:9): [True: 0, False: 26.8k]
  ------------------
  353|      0|        case CKM_CAST3_KEY_GEN:
  ------------------
  |  |  923|      0|#define CKM_CAST3_KEY_GEN 0x00000310UL
  ------------------
  |  Branch (353:9): [True: 0, False: 26.8k]
  ------------------
  354|      0|        case CKM_PBE_MD5_CAST3_CBC:
  ------------------
  |  | 1000|      0|#define CKM_PBE_MD5_CAST3_CBC 0x000003A3UL
  ------------------
  |  Branch (354:9): [True: 0, False: 26.8k]
  ------------------
  355|      0|            return CKK_CAST3;
  ------------------
  |  |  392|      0|#define CKK_CAST3 0x00000017UL
  ------------------
  356|      0|        case CKM_CAST5_ECB:
  ------------------
  |  |  931|      0|#define CKM_CAST5_ECB 0x00000321UL
  ------------------
  |  Branch (356:9): [True: 0, False: 26.8k]
  ------------------
  357|      0|        case CKM_CAST5_CBC:
  ------------------
  |  |  933|      0|#define CKM_CAST5_CBC 0x00000322UL
  ------------------
  |  Branch (357:9): [True: 0, False: 26.8k]
  ------------------
  358|      0|        case CKM_CAST5_MAC:
  ------------------
  |  |  935|      0|#define CKM_CAST5_MAC 0x00000323UL
  ------------------
  |  Branch (358:9): [True: 0, False: 26.8k]
  ------------------
  359|      0|        case CKM_CAST5_MAC_GENERAL:
  ------------------
  |  |  937|      0|#define CKM_CAST5_MAC_GENERAL 0x00000324UL
  ------------------
  |  Branch (359:9): [True: 0, False: 26.8k]
  ------------------
  360|      0|        case CKM_CAST5_CBC_PAD:
  ------------------
  |  |  939|      0|#define CKM_CAST5_CBC_PAD 0x00000325UL
  ------------------
  |  Branch (360:9): [True: 0, False: 26.8k]
  ------------------
  361|      0|        case CKM_CAST5_KEY_GEN:
  ------------------
  |  |  929|      0|#define CKM_CAST5_KEY_GEN 0x00000320UL
  ------------------
  |  Branch (361:9): [True: 0, False: 26.8k]
  ------------------
  362|      0|        case CKM_PBE_MD5_CAST5_CBC:
  ------------------
  |  | 1001|      0|#define CKM_PBE_MD5_CAST5_CBC 0x000003A4UL
  ------------------
  |  Branch (362:9): [True: 0, False: 26.8k]
  ------------------
  363|      0|            return CKK_CAST5;
  ------------------
  |  |  394|      0|#define CKK_CAST5 0x00000018UL
  ------------------
  364|      0|        case CKM_RSA_PKCS:
  ------------------
  |  |  720|      0|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (364:9): [True: 0, False: 26.8k]
  ------------------
  365|      0|        case CKM_RSA_9796:
  ------------------
  |  |  721|      0|#define CKM_RSA_9796 0x00000002UL
  ------------------
  |  Branch (365:9): [True: 0, False: 26.8k]
  ------------------
  366|      0|        case CKM_RSA_X_509:
  ------------------
  |  |  722|      0|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (366:9): [True: 0, False: 26.8k]
  ------------------
  367|      0|        case CKM_MD2_RSA_PKCS:
  ------------------
  |  |  726|      0|#define CKM_MD2_RSA_PKCS 0x00000004UL
  ------------------
  |  Branch (367:9): [True: 0, False: 26.8k]
  ------------------
  368|      0|        case CKM_MD5_RSA_PKCS:
  ------------------
  |  |  727|      0|#define CKM_MD5_RSA_PKCS 0x00000005UL
  ------------------
  |  Branch (368:9): [True: 0, False: 26.8k]
  ------------------
  369|      0|        case CKM_SHA1_RSA_PKCS:
  ------------------
  |  |  728|      0|#define CKM_SHA1_RSA_PKCS 0x00000006UL
  ------------------
  |  Branch (369:9): [True: 0, False: 26.8k]
  ------------------
  370|      0|        case CKM_SHA224_RSA_PKCS:
  ------------------
  |  |  778|      0|#define CKM_SHA224_RSA_PKCS 0x00000046UL
  ------------------
  |  Branch (370:9): [True: 0, False: 26.8k]
  ------------------
  371|      0|        case CKM_SHA256_RSA_PKCS:
  ------------------
  |  |  770|      0|#define CKM_SHA256_RSA_PKCS 0x00000040UL
  ------------------
  |  Branch (371:9): [True: 0, False: 26.8k]
  ------------------
  372|      0|        case CKM_SHA384_RSA_PKCS:
  ------------------
  |  |  771|      0|#define CKM_SHA384_RSA_PKCS 0x00000041UL
  ------------------
  |  Branch (372:9): [True: 0, False: 26.8k]
  ------------------
  373|      0|        case CKM_SHA512_RSA_PKCS:
  ------------------
  |  |  772|      0|#define CKM_SHA512_RSA_PKCS 0x00000042UL
  ------------------
  |  Branch (373:9): [True: 0, False: 26.8k]
  ------------------
  374|      0|        case CKM_KEY_WRAP_SET_OAEP:
  ------------------
  |  | 1036|      0|#define CKM_KEY_WRAP_SET_OAEP 0x00000401UL
  ------------------
  |  Branch (374:9): [True: 0, False: 26.8k]
  ------------------
  375|      0|        case CKM_RSA_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  719|      0|#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL
  ------------------
  |  Branch (375:9): [True: 0, False: 26.8k]
  ------------------
  376|      0|        case CKM_RSA_X9_31_KEY_PAIR_GEN:
  ------------------
  |  |  738|      0|#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000AUL
  ------------------
  |  Branch (376:9): [True: 0, False: 26.8k]
  ------------------
  377|      0|            return CKK_RSA;
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  378|      0|        case CKM_DSA:
  ------------------
  |  |  745|      0|#define CKM_DSA 0x00000011UL
  ------------------
  |  Branch (378:9): [True: 0, False: 26.8k]
  ------------------
  379|      0|        case CKM_DSA_SHA1:
  ------------------
  |  |  746|      0|#define CKM_DSA_SHA1 0x00000012UL
  ------------------
  |  Branch (379:9): [True: 0, False: 26.8k]
  ------------------
  380|      0|        case CKM_DSA_KEY_PAIR_GEN:
  ------------------
  |  |  744|      0|#define CKM_DSA_KEY_PAIR_GEN 0x00000010UL
  ------------------
  |  Branch (380:9): [True: 0, False: 26.8k]
  ------------------
  381|      0|            return CKK_DSA;
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
  382|      0|        case CKM_DH_PKCS_DERIVE:
  ------------------
  |  |  759|      0|#define CKM_DH_PKCS_DERIVE 0x00000021UL
  ------------------
  |  Branch (382:9): [True: 0, False: 26.8k]
  ------------------
  383|      0|        case CKM_DH_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  758|      0|#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
  ------------------
  |  Branch (383:9): [True: 0, False: 26.8k]
  ------------------
  384|      0|            return CKK_DH;
  ------------------
  |  |  374|      0|#define CKK_DH 0x00000002UL
  ------------------
  385|      0|        case CKM_KEA_KEY_DERIVE:
  ------------------
  |  | 1059|      0|#define CKM_KEA_KEY_DERIVE 0x00001011UL
  ------------------
  |  Branch (385:9): [True: 0, False: 26.8k]
  ------------------
  386|      0|        case CKM_KEA_KEY_PAIR_GEN:
  ------------------
  |  | 1058|      0|#define CKM_KEA_KEY_PAIR_GEN 0x00001010UL
  ------------------
  |  Branch (386:9): [True: 0, False: 26.8k]
  ------------------
  387|      0|            return CKK_KEA;
  ------------------
  |  |  381|      0|#define CKK_KEA 0x00000005UL
  ------------------
  388|      0|        case CKM_ECDSA:
  ------------------
  |  | 1074|      0|#define CKM_ECDSA 0x00001041UL
  ------------------
  |  Branch (388:9): [True: 0, False: 26.8k]
  ------------------
  389|      0|        case CKM_ECDSA_SHA1:
  ------------------
  |  | 1075|      0|#define CKM_ECDSA_SHA1 0x00001042UL
  ------------------
  |  Branch (389:9): [True: 0, False: 26.8k]
  ------------------
  390|      0|        case CKM_EC_KEY_PAIR_GEN: /* aka CKM_ECDSA_KEY_PAIR_GEN */
  ------------------
  |  | 1072|      0|#define CKM_EC_KEY_PAIR_GEN 0x00001040UL
  ------------------
  |  Branch (390:9): [True: 0, False: 26.8k]
  ------------------
  391|      0|        case CKM_ECDH1_DERIVE:
  ------------------
  |  | 1086|      0|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
  |  Branch (391:9): [True: 0, False: 26.8k]
  ------------------
  392|      0|            return CKK_EC; /* CKK_ECDSA is deprecated */
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
  393|      0|        case CKM_EC_EDWARDS_KEY_PAIR_GEN:
  ------------------
  |  | 1172|      0|#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL
  ------------------
  |  Branch (393:9): [True: 0, False: 26.8k]
  ------------------
  394|      0|        case CKM_EDDSA:
  ------------------
  |  | 1174|      0|#define CKM_EDDSA 0x00001057UL
  ------------------
  |  Branch (394:9): [True: 0, False: 26.8k]
  ------------------
  395|      0|            return CKK_EC_EDWARDS;
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  396|      0|        case CKM_HKDF_KEY_GEN:
  ------------------
  |  | 1298|      0|#define CKM_HKDF_KEY_GEN 0x0000402cUL
  ------------------
  |  Branch (396:9): [True: 0, False: 26.8k]
  ------------------
  397|  16.3k|        case CKM_HKDF_DERIVE:
  ------------------
  |  | 1296|  16.3k|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
  |  Branch (397:9): [True: 16.3k, False: 10.5k]
  ------------------
  398|  16.3k|        case CKM_HKDF_DATA:
  ------------------
  |  | 1297|  16.3k|#define CKM_HKDF_DATA 0x0000402bUL
  ------------------
  |  Branch (398:9): [True: 0, False: 26.8k]
  ------------------
  399|  16.3k|            return CKK_HKDF;
  ------------------
  |  |  450|  16.3k|#define CKK_HKDF 0x00000042UL
  ------------------
  400|      0|        case CKM_SSL3_PRE_MASTER_KEY_GEN:
  ------------------
  |  |  959|      0|#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL
  ------------------
  |  Branch (400:9): [True: 0, False: 26.8k]
  ------------------
  401|      0|        case CKM_GENERIC_SECRET_KEY_GEN:
  ------------------
  |  |  953|      0|#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL
  ------------------
  |  Branch (401:9): [True: 0, False: 26.8k]
  ------------------
  402|      0|        case CKM_SSL3_MASTER_KEY_DERIVE:
  ------------------
  |  |  960|      0|#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL
  ------------------
  |  Branch (402:9): [True: 0, False: 26.8k]
  ------------------
  403|      0|        case CKM_SSL3_MASTER_KEY_DERIVE_DH:
  ------------------
  |  |  966|      0|#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL
  ------------------
  |  Branch (403:9): [True: 0, False: 26.8k]
  ------------------
  404|      0|        case CKM_SSL3_KEY_AND_MAC_DERIVE:
  ------------------
  |  |  961|      0|#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL
  ------------------
  |  Branch (404:9): [True: 0, False: 26.8k]
  ------------------
  405|      0|        case CKM_SSL3_SHA1_MAC:
  ------------------
  |  |  976|      0|#define CKM_SSL3_SHA1_MAC 0x00000381UL
  ------------------
  |  Branch (405:9): [True: 0, False: 26.8k]
  ------------------
  406|      0|        case CKM_SSL3_MD5_MAC:
  ------------------
  |  |  975|      0|#define CKM_SSL3_MD5_MAC 0x00000380UL
  ------------------
  |  Branch (406:9): [True: 0, False: 26.8k]
  ------------------
  407|      0|        case CKM_TLS_MASTER_KEY_DERIVE:
  ------------------
  |  |  968|      0|#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375UL
  ------------------
  |  Branch (407:9): [True: 0, False: 26.8k]
  ------------------
  408|      0|        case CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256:
  ------------------
  |  |  234|      0|#define CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256 (CKM_NSS + 22)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (408:9): [True: 0, False: 26.8k]
  ------------------
  409|    482|        case CKM_TLS_MASTER_KEY_DERIVE_DH:
  ------------------
  |  |  970|    482|#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL
  ------------------
  |  Branch (409:9): [True: 482, False: 26.4k]
  ------------------
  410|    482|        case CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256:
  ------------------
  |  |  236|    482|#define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24)
  |  |  ------------------
  |  |  |  |  162|    482|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    482|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    482|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (410:9): [True: 0, False: 26.8k]
  ------------------
  411|    639|        case CKM_TLS_KEY_AND_MAC_DERIVE:
  ------------------
  |  |  969|    639|#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL
  ------------------
  |  Branch (411:9): [True: 157, False: 26.7k]
  ------------------
  412|    639|        case CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256:
  ------------------
  |  |  235|    639|#define CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256 (CKM_NSS + 23)
  |  |  ------------------
  |  |  |  |  162|    639|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    639|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    639|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (412:9): [True: 0, False: 26.8k]
  ------------------
  413|    639|        case CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE:
  ------------------
  |  |  239|    639|#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE (CKM_NSS + 25)
  |  |  ------------------
  |  |  |  |  162|    639|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    639|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    639|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (413:9): [True: 0, False: 26.8k]
  ------------------
  414|    639|        case CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH:
  ------------------
  |  |  240|    639|#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH (CKM_NSS + 26)
  |  |  ------------------
  |  |  |  |  162|    639|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    639|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    639|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (414:9): [True: 0, False: 26.8k]
  ------------------
  415|    639|        case CKM_SHA_1_HMAC:
  ------------------
  |  |  862|    639|#define CKM_SHA_1_HMAC 0x00000221UL
  ------------------
  |  Branch (415:9): [True: 0, False: 26.8k]
  ------------------
  416|    639|        case CKM_SHA_1_HMAC_GENERAL:
  ------------------
  |  |  863|    639|#define CKM_SHA_1_HMAC_GENERAL 0x00000222UL
  ------------------
  |  Branch (416:9): [True: 0, False: 26.8k]
  ------------------
  417|    639|        case CKM_SHA224_HMAC:
  ------------------
  |  |  888|    639|#define CKM_SHA224_HMAC 0x00000256UL
  ------------------
  |  Branch (417:9): [True: 0, False: 26.8k]
  ------------------
  418|    639|        case CKM_SHA224_HMAC_GENERAL:
  ------------------
  |  |  889|    639|#define CKM_SHA224_HMAC_GENERAL 0x00000257UL
  ------------------
  |  Branch (418:9): [True: 0, False: 26.8k]
  ------------------
  419|  2.02k|        case CKM_SHA256_HMAC:
  ------------------
  |  |  877|  2.02k|#define CKM_SHA256_HMAC 0x00000251UL
  ------------------
  |  Branch (419:9): [True: 1.38k, False: 25.5k]
  ------------------
  420|  2.02k|        case CKM_SHA256_HMAC_GENERAL:
  ------------------
  |  |  878|  2.02k|#define CKM_SHA256_HMAC_GENERAL 0x00000252UL
  ------------------
  |  Branch (420:9): [True: 0, False: 26.8k]
  ------------------
  421|  5.10k|        case CKM_SHA384_HMAC:
  ------------------
  |  |  880|  5.10k|#define CKM_SHA384_HMAC 0x00000261UL
  ------------------
  |  Branch (421:9): [True: 3.07k, False: 23.8k]
  ------------------
  422|  5.10k|        case CKM_SHA384_HMAC_GENERAL:
  ------------------
  |  |  881|  5.10k|#define CKM_SHA384_HMAC_GENERAL 0x00000262UL
  ------------------
  |  Branch (422:9): [True: 0, False: 26.8k]
  ------------------
  423|  5.10k|        case CKM_SHA512_HMAC:
  ------------------
  |  |  883|  5.10k|#define CKM_SHA512_HMAC 0x00000271UL
  ------------------
  |  Branch (423:9): [True: 0, False: 26.8k]
  ------------------
  424|  5.10k|        case CKM_SHA512_HMAC_GENERAL:
  ------------------
  |  |  884|  5.10k|#define CKM_SHA512_HMAC_GENERAL 0x00000272UL
  ------------------
  |  Branch (424:9): [True: 0, False: 26.8k]
  ------------------
  425|  5.10k|        case CKM_MD2_HMAC:
  ------------------
  |  |  850|  5.10k|#define CKM_MD2_HMAC 0x00000201UL
  ------------------
  |  Branch (425:9): [True: 0, False: 26.8k]
  ------------------
  426|  5.10k|        case CKM_MD2_HMAC_GENERAL:
  ------------------
  |  |  851|  5.10k|#define CKM_MD2_HMAC_GENERAL 0x00000202UL
  ------------------
  |  Branch (426:9): [True: 0, False: 26.8k]
  ------------------
  427|  5.10k|        case CKM_MD5_HMAC:
  ------------------
  |  |  856|  5.10k|#define CKM_MD5_HMAC 0x00000211UL
  ------------------
  |  Branch (427:9): [True: 0, False: 26.8k]
  ------------------
  428|  5.10k|        case CKM_MD5_HMAC_GENERAL:
  ------------------
  |  |  857|  5.10k|#define CKM_MD5_HMAC_GENERAL 0x00000212UL
  ------------------
  |  Branch (428:9): [True: 0, False: 26.8k]
  ------------------
  429|  5.10k|        case CKM_TLS_PRF_GENERAL:
  ------------------
  |  |  297|  5.10k|#define CKM_TLS_PRF_GENERAL 0x80000373UL
  ------------------
  |  Branch (429:9): [True: 0, False: 26.8k]
  ------------------
  430|  5.10k|        case CKM_NSS_TLS_PRF_GENERAL_SHA256:
  ------------------
  |  |  233|  5.10k|#define CKM_NSS_TLS_PRF_GENERAL_SHA256 (CKM_NSS + 21)
  |  |  ------------------
  |  |  |  |  162|  5.10k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  5.10k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  5.10k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (430:9): [True: 0, False: 26.8k]
  ------------------
  431|  5.10k|            return CKK_GENERIC_SECRET;
  ------------------
  |  |  383|  5.10k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
  432|      0|        case CKM_NSS_KYBER_KEY_PAIR_GEN:
  ------------------
  |  |  267|      0|#define CKM_NSS_KYBER_KEY_PAIR_GEN (CKM_NSS + 45)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (432:9): [True: 0, False: 26.8k]
  ------------------
  433|      0|            return CKK_NSS_KYBER;
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  434|      0|        case CKM_NSS_ML_KEM_KEY_PAIR_GEN:
  ------------------
  |  |  277|      0|#define CKM_NSS_ML_KEM_KEY_PAIR_GEN (CKM_NSS + 48)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (434:9): [True: 0, False: 26.8k]
  ------------------
  435|      0|            return CKK_NSS_ML_KEM;
  ------------------
  |  |   59|      0|#define CKK_NSS_ML_KEM (CKK_NSS + 6)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  436|  2.22k|        default:
  ------------------
  |  Branch (436:9): [True: 2.22k, False: 24.6k]
  ------------------
  437|  2.22k|            return pk11_lookup(type)->keyType;
  438|  26.8k|    }
  439|  26.8k|}
PK11_GetKeyGenWithSize:
  453|  5.75k|{
  454|  5.75k|    switch (type) {
  455|      0|        case CKM_SEED_ECB:
  ------------------
  |  | 1156|      0|#define CKM_SEED_ECB 0x00000651UL
  ------------------
  |  Branch (455:9): [True: 0, False: 5.75k]
  ------------------
  456|      0|        case CKM_SEED_CBC:
  ------------------
  |  | 1157|      0|#define CKM_SEED_CBC 0x00000652UL
  ------------------
  |  Branch (456:9): [True: 0, False: 5.75k]
  ------------------
  457|      0|        case CKM_SEED_MAC:
  ------------------
  |  | 1158|      0|#define CKM_SEED_MAC 0x00000653UL
  ------------------
  |  Branch (457:9): [True: 0, False: 5.75k]
  ------------------
  458|      0|        case CKM_SEED_MAC_GENERAL:
  ------------------
  |  | 1159|      0|#define CKM_SEED_MAC_GENERAL 0x00000654UL
  ------------------
  |  Branch (458:9): [True: 0, False: 5.75k]
  ------------------
  459|      0|        case CKM_SEED_CBC_PAD:
  ------------------
  |  | 1160|      0|#define CKM_SEED_CBC_PAD 0x00000655UL
  ------------------
  |  Branch (459:9): [True: 0, False: 5.75k]
  ------------------
  460|      0|        case CKM_SEED_KEY_GEN:
  ------------------
  |  | 1155|      0|#define CKM_SEED_KEY_GEN 0x00000650UL
  ------------------
  |  Branch (460:9): [True: 0, False: 5.75k]
  ------------------
  461|      0|            return CKM_SEED_KEY_GEN;
  ------------------
  |  | 1155|      0|#define CKM_SEED_KEY_GEN 0x00000650UL
  ------------------
  462|      0|        case CKM_CAMELLIA_ECB:
  ------------------
  |  | 1136|      0|#define CKM_CAMELLIA_ECB 0x00000551UL
  ------------------
  |  Branch (462:9): [True: 0, False: 5.75k]
  ------------------
  463|      0|        case CKM_CAMELLIA_CBC:
  ------------------
  |  | 1137|      0|#define CKM_CAMELLIA_CBC 0x00000552UL
  ------------------
  |  Branch (463:9): [True: 0, False: 5.75k]
  ------------------
  464|      0|        case CKM_CAMELLIA_MAC:
  ------------------
  |  | 1138|      0|#define CKM_CAMELLIA_MAC 0x00000553UL
  ------------------
  |  Branch (464:9): [True: 0, False: 5.75k]
  ------------------
  465|      0|        case CKM_CAMELLIA_MAC_GENERAL:
  ------------------
  |  | 1139|      0|#define CKM_CAMELLIA_MAC_GENERAL 0x00000554UL
  ------------------
  |  Branch (465:9): [True: 0, False: 5.75k]
  ------------------
  466|      0|        case CKM_CAMELLIA_CBC_PAD:
  ------------------
  |  | 1140|      0|#define CKM_CAMELLIA_CBC_PAD 0x00000555UL
  ------------------
  |  Branch (466:9): [True: 0, False: 5.75k]
  ------------------
  467|      0|        case CKM_CAMELLIA_KEY_GEN:
  ------------------
  |  | 1135|      0|#define CKM_CAMELLIA_KEY_GEN 0x00000550UL
  ------------------
  |  Branch (467:9): [True: 0, False: 5.75k]
  ------------------
  468|      0|            return CKM_CAMELLIA_KEY_GEN;
  ------------------
  |  | 1135|      0|#define CKM_CAMELLIA_KEY_GEN 0x00000550UL
  ------------------
  469|  4.62k|        case CKM_NSS_CHACHA20_POLY1305:
  ------------------
  |  |  243|  4.62k|#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 28)
  |  |  ------------------
  |  |  |  |  162|  4.62k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  4.62k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  4.62k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (469:9): [True: 4.62k, False: 1.13k]
  ------------------
  470|  4.62k|        case CKM_NSS_CHACHA20_CTR:
  ------------------
  |  |  251|  4.62k|#define CKM_NSS_CHACHA20_CTR (CKM_NSS + 33)
  |  |  ------------------
  |  |  |  |  162|  4.62k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  4.62k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  4.62k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (470:9): [True: 0, False: 5.75k]
  ------------------
  471|  4.62k|            return CKM_NSS_CHACHA20_KEY_GEN;
  ------------------
  |  |  242|  4.62k|#define CKM_NSS_CHACHA20_KEY_GEN (CKM_NSS + 27)
  |  |  ------------------
  |  |  |  |  162|  4.62k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  4.62k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  4.62k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  472|      0|        case CKM_CHACHA20_POLY1305:
  ------------------
  |  | 1287|      0|#define CKM_CHACHA20_POLY1305 0x00004021UL
  ------------------
  |  Branch (472:9): [True: 0, False: 5.75k]
  ------------------
  473|      0|        case CKM_CHACHA20:
  ------------------
  |  | 1204|      0|#define CKM_CHACHA20 0x00001226UL
  ------------------
  |  Branch (473:9): [True: 0, False: 5.75k]
  ------------------
  474|      0|            return CKM_CHACHA20_KEY_GEN;
  ------------------
  |  | 1203|      0|#define CKM_CHACHA20_KEY_GEN 0x00001225UL
  ------------------
  475|      0|        case CKM_AES_ECB:
  ------------------
  |  | 1107|      0|#define CKM_AES_ECB 0x00001081UL
  ------------------
  |  Branch (475:9): [True: 0, False: 5.75k]
  ------------------
  476|      0|        case CKM_AES_CBC:
  ------------------
  |  | 1108|      0|#define CKM_AES_CBC 0x00001082UL
  ------------------
  |  Branch (476:9): [True: 0, False: 5.75k]
  ------------------
  477|      0|        case CKM_AES_CCM:
  ------------------
  |  | 1116|      0|#define CKM_AES_CCM 0x00001088UL
  ------------------
  |  Branch (477:9): [True: 0, False: 5.75k]
  ------------------
  478|      0|        case CKM_AES_CTR:
  ------------------
  |  | 1113|      0|#define CKM_AES_CTR 0x00001086UL
  ------------------
  |  Branch (478:9): [True: 0, False: 5.75k]
  ------------------
  479|      0|        case CKM_AES_CTS:
  ------------------
  |  | 1117|      0|#define CKM_AES_CTS 0x00001089UL
  ------------------
  |  Branch (479:9): [True: 0, False: 5.75k]
  ------------------
  480|      0|        case CKM_AES_GCM:
  ------------------
  |  | 1115|      0|#define CKM_AES_GCM 0x00001087UL
  ------------------
  |  Branch (480:9): [True: 0, False: 5.75k]
  ------------------
  481|      0|        case CKM_AES_MAC:
  ------------------
  |  | 1109|      0|#define CKM_AES_MAC 0x00001083UL
  ------------------
  |  Branch (481:9): [True: 0, False: 5.75k]
  ------------------
  482|      0|        case CKM_AES_MAC_GENERAL:
  ------------------
  |  | 1110|      0|#define CKM_AES_MAC_GENERAL 0x00001084UL
  ------------------
  |  Branch (482:9): [True: 0, False: 5.75k]
  ------------------
  483|      0|        case CKM_AES_CMAC:
  ------------------
  |  | 1119|      0|#define CKM_AES_CMAC 0x0000108AUL
  ------------------
  |  Branch (483:9): [True: 0, False: 5.75k]
  ------------------
  484|      0|        case CKM_AES_CMAC_GENERAL:
  ------------------
  |  | 1120|      0|#define CKM_AES_CMAC_GENERAL 0x0000108BUL
  ------------------
  |  Branch (484:9): [True: 0, False: 5.75k]
  ------------------
  485|      0|        case CKM_AES_CBC_PAD:
  ------------------
  |  | 1111|      0|#define CKM_AES_CBC_PAD 0x00001085UL
  ------------------
  |  Branch (485:9): [True: 0, False: 5.75k]
  ------------------
  486|      0|        case CKM_AES_KEY_GEN:
  ------------------
  |  | 1106|      0|#define CKM_AES_KEY_GEN 0x00001080UL
  ------------------
  |  Branch (486:9): [True: 0, False: 5.75k]
  ------------------
  487|      0|            return CKM_AES_KEY_GEN;
  ------------------
  |  | 1106|      0|#define CKM_AES_KEY_GEN 0x00001080UL
  ------------------
  488|      0|        case CKM_DES_ECB:
  ------------------
  |  |  815|      0|#define CKM_DES_ECB 0x00000121UL
  ------------------
  |  Branch (488:9): [True: 0, False: 5.75k]
  ------------------
  489|      0|        case CKM_DES_CBC:
  ------------------
  |  |  816|      0|#define CKM_DES_CBC 0x00000122UL
  ------------------
  |  Branch (489:9): [True: 0, False: 5.75k]
  ------------------
  490|      0|        case CKM_DES_MAC:
  ------------------
  |  |  817|      0|#define CKM_DES_MAC 0x00000123UL
  ------------------
  |  Branch (490:9): [True: 0, False: 5.75k]
  ------------------
  491|      0|        case CKM_DES_MAC_GENERAL:
  ------------------
  |  |  820|      0|#define CKM_DES_MAC_GENERAL 0x00000124UL
  ------------------
  |  Branch (491:9): [True: 0, False: 5.75k]
  ------------------
  492|      0|        case CKM_KEY_WRAP_LYNKS:
  ------------------
  |  | 1035|      0|#define CKM_KEY_WRAP_LYNKS 0x00000400UL
  ------------------
  |  Branch (492:9): [True: 0, False: 5.75k]
  ------------------
  493|      0|        case CKM_DES_CBC_PAD:
  ------------------
  |  |  821|      0|#define CKM_DES_CBC_PAD 0x00000125UL
  ------------------
  |  Branch (493:9): [True: 0, False: 5.75k]
  ------------------
  494|      0|        case CKM_DES_KEY_GEN:
  ------------------
  |  |  814|      0|#define CKM_DES_KEY_GEN 0x00000120UL
  ------------------
  |  Branch (494:9): [True: 0, False: 5.75k]
  ------------------
  495|      0|            return CKM_DES_KEY_GEN;
  ------------------
  |  |  814|      0|#define CKM_DES_KEY_GEN 0x00000120UL
  ------------------
  496|      1|        case CKM_DES3_ECB:
  ------------------
  |  |  825|      1|#define CKM_DES3_ECB 0x00000132UL
  ------------------
  |  Branch (496:9): [True: 1, False: 5.75k]
  ------------------
  497|      1|        case CKM_DES3_CBC:
  ------------------
  |  |  826|      1|#define CKM_DES3_CBC 0x00000133UL
  ------------------
  |  Branch (497:9): [True: 0, False: 5.75k]
  ------------------
  498|      1|        case CKM_DES3_MAC:
  ------------------
  |  |  827|      1|#define CKM_DES3_MAC 0x00000134UL
  ------------------
  |  Branch (498:9): [True: 0, False: 5.75k]
  ------------------
  499|      1|        case CKM_DES3_MAC_GENERAL:
  ------------------
  |  |  832|      1|#define CKM_DES3_MAC_GENERAL 0x00000135UL
  ------------------
  |  Branch (499:9): [True: 0, False: 5.75k]
  ------------------
  500|      1|        case CKM_DES3_CBC_PAD:
  ------------------
  |  |  833|      1|#define CKM_DES3_CBC_PAD 0x00000136UL
  ------------------
  |  Branch (500:9): [True: 0, False: 5.75k]
  ------------------
  501|      1|            return (size == 16) ? CKM_DES2_KEY_GEN : CKM_DES3_KEY_GEN;
  ------------------
  |  |  823|      0|#define CKM_DES2_KEY_GEN 0x00000130UL
  ------------------
                          return (size == 16) ? CKM_DES2_KEY_GEN : CKM_DES3_KEY_GEN;
  ------------------
  |  |  824|      1|#define CKM_DES3_KEY_GEN 0x00000131UL
  ------------------
  |  Branch (501:20): [True: 0, False: 1]
  ------------------
  502|      0|        case CKM_DES3_KEY_GEN:
  ------------------
  |  |  824|      0|#define CKM_DES3_KEY_GEN 0x00000131UL
  ------------------
  |  Branch (502:9): [True: 0, False: 5.75k]
  ------------------
  503|      0|            return CKM_DES3_KEY_GEN;
  ------------------
  |  |  824|      0|#define CKM_DES3_KEY_GEN 0x00000131UL
  ------------------
  504|      0|        case CKM_DES2_KEY_GEN:
  ------------------
  |  |  823|      0|#define CKM_DES2_KEY_GEN 0x00000130UL
  ------------------
  |  Branch (504:9): [True: 0, False: 5.75k]
  ------------------
  505|      0|            return CKM_DES2_KEY_GEN;
  ------------------
  |  |  823|      0|#define CKM_DES2_KEY_GEN 0x00000130UL
  ------------------
  506|      0|        case CKM_CDMF_ECB:
  ------------------
  |  |  835|      0|#define CKM_CDMF_ECB 0x00000141UL
  ------------------
  |  Branch (506:9): [True: 0, False: 5.75k]
  ------------------
  507|      0|        case CKM_CDMF_CBC:
  ------------------
  |  |  836|      0|#define CKM_CDMF_CBC 0x00000142UL
  ------------------
  |  Branch (507:9): [True: 0, False: 5.75k]
  ------------------
  508|      0|        case CKM_CDMF_MAC:
  ------------------
  |  |  837|      0|#define CKM_CDMF_MAC 0x00000143UL
  ------------------
  |  Branch (508:9): [True: 0, False: 5.75k]
  ------------------
  509|      0|        case CKM_CDMF_MAC_GENERAL:
  ------------------
  |  |  838|      0|#define CKM_CDMF_MAC_GENERAL 0x00000144UL
  ------------------
  |  Branch (509:9): [True: 0, False: 5.75k]
  ------------------
  510|      0|        case CKM_CDMF_CBC_PAD:
  ------------------
  |  |  839|      0|#define CKM_CDMF_CBC_PAD 0x00000145UL
  ------------------
  |  Branch (510:9): [True: 0, False: 5.75k]
  ------------------
  511|      0|        case CKM_CDMF_KEY_GEN:
  ------------------
  |  |  834|      0|#define CKM_CDMF_KEY_GEN 0x00000140UL
  ------------------
  |  Branch (511:9): [True: 0, False: 5.75k]
  ------------------
  512|      0|            return CKM_CDMF_KEY_GEN;
  ------------------
  |  |  834|      0|#define CKM_CDMF_KEY_GEN 0x00000140UL
  ------------------
  513|      0|        case CKM_RC2_ECB:
  ------------------
  |  |  804|      0|#define CKM_RC2_ECB 0x00000101UL
  ------------------
  |  Branch (513:9): [True: 0, False: 5.75k]
  ------------------
  514|      0|        case CKM_RC2_CBC:
  ------------------
  |  |  805|      0|#define CKM_RC2_CBC 0x00000102UL
  ------------------
  |  Branch (514:9): [True: 0, False: 5.75k]
  ------------------
  515|      0|        case CKM_RC2_MAC:
  ------------------
  |  |  806|      0|#define CKM_RC2_MAC 0x00000103UL
  ------------------
  |  Branch (515:9): [True: 0, False: 5.75k]
  ------------------
  516|      0|        case CKM_RC2_MAC_GENERAL:
  ------------------
  |  |  809|      0|#define CKM_RC2_MAC_GENERAL 0x00000104UL
  ------------------
  |  Branch (516:9): [True: 0, False: 5.75k]
  ------------------
  517|      0|        case CKM_RC2_CBC_PAD:
  ------------------
  |  |  810|      0|#define CKM_RC2_CBC_PAD 0x00000105UL
  ------------------
  |  Branch (517:9): [True: 0, False: 5.75k]
  ------------------
  518|      0|        case CKM_RC2_KEY_GEN:
  ------------------
  |  |  803|      0|#define CKM_RC2_KEY_GEN 0x00000100UL
  ------------------
  |  Branch (518:9): [True: 0, False: 5.75k]
  ------------------
  519|      0|            return CKM_RC2_KEY_GEN;
  ------------------
  |  |  803|      0|#define CKM_RC2_KEY_GEN 0x00000100UL
  ------------------
  520|      0|        case CKM_RC4:
  ------------------
  |  |  813|      0|#define CKM_RC4 0x00000111UL
  ------------------
  |  Branch (520:9): [True: 0, False: 5.75k]
  ------------------
  521|      0|        case CKM_RC4_KEY_GEN:
  ------------------
  |  |  812|      0|#define CKM_RC4_KEY_GEN 0x00000110UL
  ------------------
  |  Branch (521:9): [True: 0, False: 5.75k]
  ------------------
  522|      0|            return CKM_RC4_KEY_GEN;
  ------------------
  |  |  812|      0|#define CKM_RC4_KEY_GEN 0x00000110UL
  ------------------
  523|      0|        case CKM_RC5_ECB:
  ------------------
  |  |  942|      0|#define CKM_RC5_ECB 0x00000331UL
  ------------------
  |  Branch (523:9): [True: 0, False: 5.75k]
  ------------------
  524|      0|        case CKM_RC5_CBC:
  ------------------
  |  |  943|      0|#define CKM_RC5_CBC 0x00000332UL
  ------------------
  |  Branch (524:9): [True: 0, False: 5.75k]
  ------------------
  525|      0|        case CKM_RC5_MAC:
  ------------------
  |  |  944|      0|#define CKM_RC5_MAC 0x00000333UL
  ------------------
  |  Branch (525:9): [True: 0, False: 5.75k]
  ------------------
  526|      0|        case CKM_RC5_MAC_GENERAL:
  ------------------
  |  |  945|      0|#define CKM_RC5_MAC_GENERAL 0x00000334UL
  ------------------
  |  Branch (526:9): [True: 0, False: 5.75k]
  ------------------
  527|      0|        case CKM_RC5_CBC_PAD:
  ------------------
  |  |  946|      0|#define CKM_RC5_CBC_PAD 0x00000335UL
  ------------------
  |  Branch (527:9): [True: 0, False: 5.75k]
  ------------------
  528|      0|        case CKM_RC5_KEY_GEN:
  ------------------
  |  |  941|      0|#define CKM_RC5_KEY_GEN 0x00000330UL
  ------------------
  |  Branch (528:9): [True: 0, False: 5.75k]
  ------------------
  529|      0|            return CKM_RC5_KEY_GEN;
  ------------------
  |  |  941|      0|#define CKM_RC5_KEY_GEN 0x00000330UL
  ------------------
  530|      0|        case CKM_SKIPJACK_CBC64:
  ------------------
  |  | 1049|      0|#define CKM_SKIPJACK_CBC64 0x00001002UL
  ------------------
  |  Branch (530:9): [True: 0, False: 5.75k]
  ------------------
  531|      0|        case CKM_SKIPJACK_ECB64:
  ------------------
  |  | 1048|      0|#define CKM_SKIPJACK_ECB64 0x00001001UL
  ------------------
  |  Branch (531:9): [True: 0, False: 5.75k]
  ------------------
  532|      0|        case CKM_SKIPJACK_OFB64:
  ------------------
  |  | 1050|      0|#define CKM_SKIPJACK_OFB64 0x00001003UL
  ------------------
  |  Branch (532:9): [True: 0, False: 5.75k]
  ------------------
  533|      0|        case CKM_SKIPJACK_CFB64:
  ------------------
  |  | 1051|      0|#define CKM_SKIPJACK_CFB64 0x00001004UL
  ------------------
  |  Branch (533:9): [True: 0, False: 5.75k]
  ------------------
  534|      0|        case CKM_SKIPJACK_CFB32:
  ------------------
  |  | 1052|      0|#define CKM_SKIPJACK_CFB32 0x00001005UL
  ------------------
  |  Branch (534:9): [True: 0, False: 5.75k]
  ------------------
  535|      0|        case CKM_SKIPJACK_CFB16:
  ------------------
  |  | 1053|      0|#define CKM_SKIPJACK_CFB16 0x00001006UL
  ------------------
  |  Branch (535:9): [True: 0, False: 5.75k]
  ------------------
  536|      0|        case CKM_SKIPJACK_CFB8:
  ------------------
  |  | 1054|      0|#define CKM_SKIPJACK_CFB8 0x00001007UL
  ------------------
  |  Branch (536:9): [True: 0, False: 5.75k]
  ------------------
  537|      0|        case CKM_SKIPJACK_WRAP:
  ------------------
  |  | 1055|      0|#define CKM_SKIPJACK_WRAP 0x00001008UL
  ------------------
  |  Branch (537:9): [True: 0, False: 5.75k]
  ------------------
  538|      0|        case CKM_SKIPJACK_KEY_GEN:
  ------------------
  |  | 1047|      0|#define CKM_SKIPJACK_KEY_GEN 0x00001000UL
  ------------------
  |  Branch (538:9): [True: 0, False: 5.75k]
  ------------------
  539|      0|            return CKM_SKIPJACK_KEY_GEN;
  ------------------
  |  | 1047|      0|#define CKM_SKIPJACK_KEY_GEN 0x00001000UL
  ------------------
  540|      0|        case CKM_BATON_ECB128:
  ------------------
  |  | 1062|      0|#define CKM_BATON_ECB128 0x00001031UL
  ------------------
  |  Branch (540:9): [True: 0, False: 5.75k]
  ------------------
  541|      0|        case CKM_BATON_ECB96:
  ------------------
  |  | 1063|      0|#define CKM_BATON_ECB96 0x00001032UL
  ------------------
  |  Branch (541:9): [True: 0, False: 5.75k]
  ------------------
  542|      0|        case CKM_BATON_CBC128:
  ------------------
  |  | 1064|      0|#define CKM_BATON_CBC128 0x00001033UL
  ------------------
  |  Branch (542:9): [True: 0, False: 5.75k]
  ------------------
  543|      0|        case CKM_BATON_COUNTER:
  ------------------
  |  | 1065|      0|#define CKM_BATON_COUNTER 0x00001034UL
  ------------------
  |  Branch (543:9): [True: 0, False: 5.75k]
  ------------------
  544|      0|        case CKM_BATON_SHUFFLE:
  ------------------
  |  | 1066|      0|#define CKM_BATON_SHUFFLE 0x00001035UL
  ------------------
  |  Branch (544:9): [True: 0, False: 5.75k]
  ------------------
  545|      0|        case CKM_BATON_WRAP:
  ------------------
  |  | 1067|      0|#define CKM_BATON_WRAP 0x00001036UL
  ------------------
  |  Branch (545:9): [True: 0, False: 5.75k]
  ------------------
  546|      0|        case CKM_BATON_KEY_GEN:
  ------------------
  |  | 1061|      0|#define CKM_BATON_KEY_GEN 0x00001030UL
  ------------------
  |  Branch (546:9): [True: 0, False: 5.75k]
  ------------------
  547|      0|            return CKM_BATON_KEY_GEN;
  ------------------
  |  | 1061|      0|#define CKM_BATON_KEY_GEN 0x00001030UL
  ------------------
  548|      0|        case CKM_JUNIPER_ECB128:
  ------------------
  |  | 1095|      0|#define CKM_JUNIPER_ECB128 0x00001061UL
  ------------------
  |  Branch (548:9): [True: 0, False: 5.75k]
  ------------------
  549|      0|        case CKM_JUNIPER_CBC128:
  ------------------
  |  | 1096|      0|#define CKM_JUNIPER_CBC128 0x00001062UL
  ------------------
  |  Branch (549:9): [True: 0, False: 5.75k]
  ------------------
  550|      0|        case CKM_JUNIPER_COUNTER:
  ------------------
  |  | 1097|      0|#define CKM_JUNIPER_COUNTER 0x00001063UL
  ------------------
  |  Branch (550:9): [True: 0, False: 5.75k]
  ------------------
  551|      0|        case CKM_JUNIPER_SHUFFLE:
  ------------------
  |  | 1098|      0|#define CKM_JUNIPER_SHUFFLE 0x00001064UL
  ------------------
  |  Branch (551:9): [True: 0, False: 5.75k]
  ------------------
  552|      0|        case CKM_JUNIPER_WRAP:
  ------------------
  |  | 1099|      0|#define CKM_JUNIPER_WRAP 0x00001065UL
  ------------------
  |  Branch (552:9): [True: 0, False: 5.75k]
  ------------------
  553|      0|        case CKM_JUNIPER_KEY_GEN:
  ------------------
  |  | 1094|      0|#define CKM_JUNIPER_KEY_GEN 0x00001060UL
  ------------------
  |  Branch (553:9): [True: 0, False: 5.75k]
  ------------------
  554|      0|            return CKM_JUNIPER_KEY_GEN;
  ------------------
  |  | 1094|      0|#define CKM_JUNIPER_KEY_GEN 0x00001060UL
  ------------------
  555|      0|        case CKM_IDEA_CBC:
  ------------------
  |  |  949|      0|#define CKM_IDEA_CBC 0x00000342UL
  ------------------
  |  Branch (555:9): [True: 0, False: 5.75k]
  ------------------
  556|      0|        case CKM_IDEA_ECB:
  ------------------
  |  |  948|      0|#define CKM_IDEA_ECB 0x00000341UL
  ------------------
  |  Branch (556:9): [True: 0, False: 5.75k]
  ------------------
  557|      0|        case CKM_IDEA_MAC:
  ------------------
  |  |  950|      0|#define CKM_IDEA_MAC 0x00000343UL
  ------------------
  |  Branch (557:9): [True: 0, False: 5.75k]
  ------------------
  558|      0|        case CKM_IDEA_MAC_GENERAL:
  ------------------
  |  |  951|      0|#define CKM_IDEA_MAC_GENERAL 0x00000344UL
  ------------------
  |  Branch (558:9): [True: 0, False: 5.75k]
  ------------------
  559|      0|        case CKM_IDEA_CBC_PAD:
  ------------------
  |  |  952|      0|#define CKM_IDEA_CBC_PAD 0x00000345UL
  ------------------
  |  Branch (559:9): [True: 0, False: 5.75k]
  ------------------
  560|      0|        case CKM_IDEA_KEY_GEN:
  ------------------
  |  |  947|      0|#define CKM_IDEA_KEY_GEN 0x00000340UL
  ------------------
  |  Branch (560:9): [True: 0, False: 5.75k]
  ------------------
  561|      0|            return CKM_IDEA_KEY_GEN;
  ------------------
  |  |  947|      0|#define CKM_IDEA_KEY_GEN 0x00000340UL
  ------------------
  562|      0|        case CKM_CAST_ECB:
  ------------------
  |  |  918|      0|#define CKM_CAST_ECB 0x00000301UL
  ------------------
  |  Branch (562:9): [True: 0, False: 5.75k]
  ------------------
  563|      0|        case CKM_CAST_CBC:
  ------------------
  |  |  919|      0|#define CKM_CAST_CBC 0x00000302UL
  ------------------
  |  Branch (563:9): [True: 0, False: 5.75k]
  ------------------
  564|      0|        case CKM_CAST_MAC:
  ------------------
  |  |  920|      0|#define CKM_CAST_MAC 0x00000303UL
  ------------------
  |  Branch (564:9): [True: 0, False: 5.75k]
  ------------------
  565|      0|        case CKM_CAST_MAC_GENERAL:
  ------------------
  |  |  921|      0|#define CKM_CAST_MAC_GENERAL 0x00000304UL
  ------------------
  |  Branch (565:9): [True: 0, False: 5.75k]
  ------------------
  566|      0|        case CKM_CAST_CBC_PAD:
  ------------------
  |  |  922|      0|#define CKM_CAST_CBC_PAD 0x00000305UL
  ------------------
  |  Branch (566:9): [True: 0, False: 5.75k]
  ------------------
  567|      0|        case CKM_CAST_KEY_GEN:
  ------------------
  |  |  917|      0|#define CKM_CAST_KEY_GEN 0x00000300UL
  ------------------
  |  Branch (567:9): [True: 0, False: 5.75k]
  ------------------
  568|      0|            return CKM_CAST_KEY_GEN;
  ------------------
  |  |  917|      0|#define CKM_CAST_KEY_GEN 0x00000300UL
  ------------------
  569|      0|        case CKM_CAST3_ECB:
  ------------------
  |  |  924|      0|#define CKM_CAST3_ECB 0x00000311UL
  ------------------
  |  Branch (569:9): [True: 0, False: 5.75k]
  ------------------
  570|      0|        case CKM_CAST3_CBC:
  ------------------
  |  |  925|      0|#define CKM_CAST3_CBC 0x00000312UL
  ------------------
  |  Branch (570:9): [True: 0, False: 5.75k]
  ------------------
  571|      0|        case CKM_CAST3_MAC:
  ------------------
  |  |  926|      0|#define CKM_CAST3_MAC 0x00000313UL
  ------------------
  |  Branch (571:9): [True: 0, False: 5.75k]
  ------------------
  572|      0|        case CKM_CAST3_MAC_GENERAL:
  ------------------
  |  |  927|      0|#define CKM_CAST3_MAC_GENERAL 0x00000314UL
  ------------------
  |  Branch (572:9): [True: 0, False: 5.75k]
  ------------------
  573|      0|        case CKM_CAST3_CBC_PAD:
  ------------------
  |  |  928|      0|#define CKM_CAST3_CBC_PAD 0x00000315UL
  ------------------
  |  Branch (573:9): [True: 0, False: 5.75k]
  ------------------
  574|      0|        case CKM_CAST3_KEY_GEN:
  ------------------
  |  |  923|      0|#define CKM_CAST3_KEY_GEN 0x00000310UL
  ------------------
  |  Branch (574:9): [True: 0, False: 5.75k]
  ------------------
  575|      0|            return CKM_CAST3_KEY_GEN;
  ------------------
  |  |  923|      0|#define CKM_CAST3_KEY_GEN 0x00000310UL
  ------------------
  576|      0|        case CKM_CAST5_ECB:
  ------------------
  |  |  931|      0|#define CKM_CAST5_ECB 0x00000321UL
  ------------------
  |  Branch (576:9): [True: 0, False: 5.75k]
  ------------------
  577|      0|        case CKM_CAST5_CBC:
  ------------------
  |  |  933|      0|#define CKM_CAST5_CBC 0x00000322UL
  ------------------
  |  Branch (577:9): [True: 0, False: 5.75k]
  ------------------
  578|      0|        case CKM_CAST5_MAC:
  ------------------
  |  |  935|      0|#define CKM_CAST5_MAC 0x00000323UL
  ------------------
  |  Branch (578:9): [True: 0, False: 5.75k]
  ------------------
  579|      0|        case CKM_CAST5_MAC_GENERAL:
  ------------------
  |  |  937|      0|#define CKM_CAST5_MAC_GENERAL 0x00000324UL
  ------------------
  |  Branch (579:9): [True: 0, False: 5.75k]
  ------------------
  580|      0|        case CKM_CAST5_CBC_PAD:
  ------------------
  |  |  939|      0|#define CKM_CAST5_CBC_PAD 0x00000325UL
  ------------------
  |  Branch (580:9): [True: 0, False: 5.75k]
  ------------------
  581|      0|        case CKM_CAST5_KEY_GEN:
  ------------------
  |  |  929|      0|#define CKM_CAST5_KEY_GEN 0x00000320UL
  ------------------
  |  Branch (581:9): [True: 0, False: 5.75k]
  ------------------
  582|      0|            return CKM_CAST5_KEY_GEN;
  ------------------
  |  |  929|      0|#define CKM_CAST5_KEY_GEN 0x00000320UL
  ------------------
  583|      0|        case CKM_RSA_PKCS:
  ------------------
  |  |  720|      0|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (583:9): [True: 0, False: 5.75k]
  ------------------
  584|      0|        case CKM_RSA_9796:
  ------------------
  |  |  721|      0|#define CKM_RSA_9796 0x00000002UL
  ------------------
  |  Branch (584:9): [True: 0, False: 5.75k]
  ------------------
  585|      0|        case CKM_RSA_X_509:
  ------------------
  |  |  722|      0|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (585:9): [True: 0, False: 5.75k]
  ------------------
  586|      0|        case CKM_MD2_RSA_PKCS:
  ------------------
  |  |  726|      0|#define CKM_MD2_RSA_PKCS 0x00000004UL
  ------------------
  |  Branch (586:9): [True: 0, False: 5.75k]
  ------------------
  587|      0|        case CKM_MD5_RSA_PKCS:
  ------------------
  |  |  727|      0|#define CKM_MD5_RSA_PKCS 0x00000005UL
  ------------------
  |  Branch (587:9): [True: 0, False: 5.75k]
  ------------------
  588|      0|        case CKM_SHA1_RSA_PKCS:
  ------------------
  |  |  728|      0|#define CKM_SHA1_RSA_PKCS 0x00000006UL
  ------------------
  |  Branch (588:9): [True: 0, False: 5.75k]
  ------------------
  589|      0|        case CKM_SHA224_RSA_PKCS:
  ------------------
  |  |  778|      0|#define CKM_SHA224_RSA_PKCS 0x00000046UL
  ------------------
  |  Branch (589:9): [True: 0, False: 5.75k]
  ------------------
  590|      0|        case CKM_SHA256_RSA_PKCS:
  ------------------
  |  |  770|      0|#define CKM_SHA256_RSA_PKCS 0x00000040UL
  ------------------
  |  Branch (590:9): [True: 0, False: 5.75k]
  ------------------
  591|      0|        case CKM_SHA384_RSA_PKCS:
  ------------------
  |  |  771|      0|#define CKM_SHA384_RSA_PKCS 0x00000041UL
  ------------------
  |  Branch (591:9): [True: 0, False: 5.75k]
  ------------------
  592|      0|        case CKM_SHA512_RSA_PKCS:
  ------------------
  |  |  772|      0|#define CKM_SHA512_RSA_PKCS 0x00000042UL
  ------------------
  |  Branch (592:9): [True: 0, False: 5.75k]
  ------------------
  593|      0|        case CKM_KEY_WRAP_SET_OAEP:
  ------------------
  |  | 1036|      0|#define CKM_KEY_WRAP_SET_OAEP 0x00000401UL
  ------------------
  |  Branch (593:9): [True: 0, False: 5.75k]
  ------------------
  594|      0|        case CKM_RSA_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  719|      0|#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL
  ------------------
  |  Branch (594:9): [True: 0, False: 5.75k]
  ------------------
  595|      0|            return CKM_RSA_PKCS_KEY_PAIR_GEN;
  ------------------
  |  |  719|      0|#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL
  ------------------
  596|      0|        case CKM_RSA_X9_31_KEY_PAIR_GEN:
  ------------------
  |  |  738|      0|#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000AUL
  ------------------
  |  Branch (596:9): [True: 0, False: 5.75k]
  ------------------
  597|      0|            return CKM_RSA_X9_31_KEY_PAIR_GEN;
  ------------------
  |  |  738|      0|#define CKM_RSA_X9_31_KEY_PAIR_GEN 0x0000000AUL
  ------------------
  598|      0|        case CKM_DSA:
  ------------------
  |  |  745|      0|#define CKM_DSA 0x00000011UL
  ------------------
  |  Branch (598:9): [True: 0, False: 5.75k]
  ------------------
  599|      0|        case CKM_DSA_SHA1:
  ------------------
  |  |  746|      0|#define CKM_DSA_SHA1 0x00000012UL
  ------------------
  |  Branch (599:9): [True: 0, False: 5.75k]
  ------------------
  600|      0|        case CKM_DSA_KEY_PAIR_GEN:
  ------------------
  |  |  744|      0|#define CKM_DSA_KEY_PAIR_GEN 0x00000010UL
  ------------------
  |  Branch (600:9): [True: 0, False: 5.75k]
  ------------------
  601|      0|            return CKM_DSA_KEY_PAIR_GEN;
  ------------------
  |  |  744|      0|#define CKM_DSA_KEY_PAIR_GEN 0x00000010UL
  ------------------
  602|      0|        case CKM_DH_PKCS_DERIVE:
  ------------------
  |  |  759|      0|#define CKM_DH_PKCS_DERIVE 0x00000021UL
  ------------------
  |  Branch (602:9): [True: 0, False: 5.75k]
  ------------------
  603|      0|        case CKM_DH_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  758|      0|#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
  ------------------
  |  Branch (603:9): [True: 0, False: 5.75k]
  ------------------
  604|      0|            return CKM_DH_PKCS_KEY_PAIR_GEN;
  ------------------
  |  |  758|      0|#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
  ------------------
  605|      0|        case CKM_KEA_KEY_DERIVE:
  ------------------
  |  | 1059|      0|#define CKM_KEA_KEY_DERIVE 0x00001011UL
  ------------------
  |  Branch (605:9): [True: 0, False: 5.75k]
  ------------------
  606|      0|        case CKM_KEA_KEY_PAIR_GEN:
  ------------------
  |  | 1058|      0|#define CKM_KEA_KEY_PAIR_GEN 0x00001010UL
  ------------------
  |  Branch (606:9): [True: 0, False: 5.75k]
  ------------------
  607|      0|            return CKM_KEA_KEY_PAIR_GEN;
  ------------------
  |  | 1058|      0|#define CKM_KEA_KEY_PAIR_GEN 0x00001010UL
  ------------------
  608|      0|        case CKM_ECDSA:
  ------------------
  |  | 1074|      0|#define CKM_ECDSA 0x00001041UL
  ------------------
  |  Branch (608:9): [True: 0, False: 5.75k]
  ------------------
  609|      0|        case CKM_ECDSA_SHA1:
  ------------------
  |  | 1075|      0|#define CKM_ECDSA_SHA1 0x00001042UL
  ------------------
  |  Branch (609:9): [True: 0, False: 5.75k]
  ------------------
  610|      0|        case CKM_EC_KEY_PAIR_GEN: /* aka CKM_ECDSA_KEY_PAIR_GEN */
  ------------------
  |  | 1072|      0|#define CKM_EC_KEY_PAIR_GEN 0x00001040UL
  ------------------
  |  Branch (610:9): [True: 0, False: 5.75k]
  ------------------
  611|      0|        case CKM_ECDH1_DERIVE:
  ------------------
  |  | 1086|      0|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
  |  Branch (611:9): [True: 0, False: 5.75k]
  ------------------
  612|      0|            return CKM_EC_KEY_PAIR_GEN;
  ------------------
  |  | 1072|      0|#define CKM_EC_KEY_PAIR_GEN 0x00001040UL
  ------------------
  613|      0|        case CKM_EDDSA:
  ------------------
  |  | 1174|      0|#define CKM_EDDSA 0x00001057UL
  ------------------
  |  Branch (613:9): [True: 0, False: 5.75k]
  ------------------
  614|      0|            return CKM_EC_EDWARDS_KEY_PAIR_GEN;
  ------------------
  |  | 1172|      0|#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL
  ------------------
  615|  1.13k|        case CKM_SSL3_PRE_MASTER_KEY_GEN:
  ------------------
  |  |  959|  1.13k|#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL
  ------------------
  |  Branch (615:9): [True: 1.13k, False: 4.62k]
  ------------------
  616|  1.13k|        case CKM_SSL3_MASTER_KEY_DERIVE:
  ------------------
  |  |  960|  1.13k|#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL
  ------------------
  |  Branch (616:9): [True: 0, False: 5.75k]
  ------------------
  617|  1.13k|        case CKM_SSL3_KEY_AND_MAC_DERIVE:
  ------------------
  |  |  961|  1.13k|#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL
  ------------------
  |  Branch (617:9): [True: 0, False: 5.75k]
  ------------------
  618|  1.13k|        case CKM_SSL3_SHA1_MAC:
  ------------------
  |  |  976|  1.13k|#define CKM_SSL3_SHA1_MAC 0x00000381UL
  ------------------
  |  Branch (618:9): [True: 0, False: 5.75k]
  ------------------
  619|  1.13k|        case CKM_SSL3_MD5_MAC:
  ------------------
  |  |  975|  1.13k|#define CKM_SSL3_MD5_MAC 0x00000380UL
  ------------------
  |  Branch (619:9): [True: 0, False: 5.75k]
  ------------------
  620|  1.13k|        case CKM_TLS_MASTER_KEY_DERIVE:
  ------------------
  |  |  968|  1.13k|#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375UL
  ------------------
  |  Branch (620:9): [True: 0, False: 5.75k]
  ------------------
  621|  1.13k|        case CKM_TLS_KEY_AND_MAC_DERIVE:
  ------------------
  |  |  969|  1.13k|#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL
  ------------------
  |  Branch (621:9): [True: 0, False: 5.75k]
  ------------------
  622|  1.13k|        case CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256:
  ------------------
  |  |  235|  1.13k|#define CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256 (CKM_NSS + 23)
  |  |  ------------------
  |  |  |  |  162|  1.13k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  1.13k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.13k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (622:9): [True: 0, False: 5.75k]
  ------------------
  623|  1.13k|        case CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE:
  ------------------
  |  |  239|  1.13k|#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE (CKM_NSS + 25)
  |  |  ------------------
  |  |  |  |  162|  1.13k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  1.13k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.13k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (623:9): [True: 0, False: 5.75k]
  ------------------
  624|  1.13k|        case CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH:
  ------------------
  |  |  240|  1.13k|#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH (CKM_NSS + 26)
  |  |  ------------------
  |  |  |  |  162|  1.13k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  1.13k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.13k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (624:9): [True: 0, False: 5.75k]
  ------------------
  625|  1.13k|            return CKM_SSL3_PRE_MASTER_KEY_GEN;
  ------------------
  |  |  959|  1.13k|#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL
  ------------------
  626|      0|        case CKM_SHA_1_HMAC:
  ------------------
  |  |  862|      0|#define CKM_SHA_1_HMAC 0x00000221UL
  ------------------
  |  Branch (626:9): [True: 0, False: 5.75k]
  ------------------
  627|      0|        case CKM_SHA_1_HMAC_GENERAL:
  ------------------
  |  |  863|      0|#define CKM_SHA_1_HMAC_GENERAL 0x00000222UL
  ------------------
  |  Branch (627:9): [True: 0, False: 5.75k]
  ------------------
  628|      0|        case CKM_SHA224_HMAC:
  ------------------
  |  |  888|      0|#define CKM_SHA224_HMAC 0x00000256UL
  ------------------
  |  Branch (628:9): [True: 0, False: 5.75k]
  ------------------
  629|      0|        case CKM_SHA224_HMAC_GENERAL:
  ------------------
  |  |  889|      0|#define CKM_SHA224_HMAC_GENERAL 0x00000257UL
  ------------------
  |  Branch (629:9): [True: 0, False: 5.75k]
  ------------------
  630|      0|        case CKM_SHA256_HMAC:
  ------------------
  |  |  877|      0|#define CKM_SHA256_HMAC 0x00000251UL
  ------------------
  |  Branch (630:9): [True: 0, False: 5.75k]
  ------------------
  631|      0|        case CKM_SHA256_HMAC_GENERAL:
  ------------------
  |  |  878|      0|#define CKM_SHA256_HMAC_GENERAL 0x00000252UL
  ------------------
  |  Branch (631:9): [True: 0, False: 5.75k]
  ------------------
  632|      0|        case CKM_SHA384_HMAC:
  ------------------
  |  |  880|      0|#define CKM_SHA384_HMAC 0x00000261UL
  ------------------
  |  Branch (632:9): [True: 0, False: 5.75k]
  ------------------
  633|      0|        case CKM_SHA384_HMAC_GENERAL:
  ------------------
  |  |  881|      0|#define CKM_SHA384_HMAC_GENERAL 0x00000262UL
  ------------------
  |  Branch (633:9): [True: 0, False: 5.75k]
  ------------------
  634|      0|        case CKM_SHA512_HMAC:
  ------------------
  |  |  883|      0|#define CKM_SHA512_HMAC 0x00000271UL
  ------------------
  |  Branch (634:9): [True: 0, False: 5.75k]
  ------------------
  635|      0|        case CKM_SHA512_HMAC_GENERAL:
  ------------------
  |  |  884|      0|#define CKM_SHA512_HMAC_GENERAL 0x00000272UL
  ------------------
  |  Branch (635:9): [True: 0, False: 5.75k]
  ------------------
  636|      0|        case CKM_MD2_HMAC:
  ------------------
  |  |  850|      0|#define CKM_MD2_HMAC 0x00000201UL
  ------------------
  |  Branch (636:9): [True: 0, False: 5.75k]
  ------------------
  637|      0|        case CKM_MD2_HMAC_GENERAL:
  ------------------
  |  |  851|      0|#define CKM_MD2_HMAC_GENERAL 0x00000202UL
  ------------------
  |  Branch (637:9): [True: 0, False: 5.75k]
  ------------------
  638|      0|        case CKM_MD5_HMAC:
  ------------------
  |  |  856|      0|#define CKM_MD5_HMAC 0x00000211UL
  ------------------
  |  Branch (638:9): [True: 0, False: 5.75k]
  ------------------
  639|      0|        case CKM_MD5_HMAC_GENERAL:
  ------------------
  |  |  857|      0|#define CKM_MD5_HMAC_GENERAL 0x00000212UL
  ------------------
  |  Branch (639:9): [True: 0, False: 5.75k]
  ------------------
  640|      0|        case CKM_TLS_PRF_GENERAL:
  ------------------
  |  |  297|      0|#define CKM_TLS_PRF_GENERAL 0x80000373UL
  ------------------
  |  Branch (640:9): [True: 0, False: 5.75k]
  ------------------
  641|      0|        case CKM_NSS_TLS_PRF_GENERAL_SHA256:
  ------------------
  |  |  233|      0|#define CKM_NSS_TLS_PRF_GENERAL_SHA256 (CKM_NSS + 21)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (641:9): [True: 0, False: 5.75k]
  ------------------
  642|      0|        case CKM_GENERIC_SECRET_KEY_GEN:
  ------------------
  |  |  953|      0|#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL
  ------------------
  |  Branch (642:9): [True: 0, False: 5.75k]
  ------------------
  643|      0|            return CKM_GENERIC_SECRET_KEY_GEN;
  ------------------
  |  |  953|      0|#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL
  ------------------
  644|      0|        case CKM_PBE_MD2_DES_CBC:
  ------------------
  |  |  997|      0|#define CKM_PBE_MD2_DES_CBC 0x000003A0UL
  ------------------
  |  Branch (644:9): [True: 0, False: 5.75k]
  ------------------
  645|      0|        case CKM_PBE_MD5_DES_CBC:
  ------------------
  |  |  998|      0|#define CKM_PBE_MD5_DES_CBC 0x000003A1UL
  ------------------
  |  Branch (645:9): [True: 0, False: 5.75k]
  ------------------
  646|      0|        case CKM_PBA_SHA1_WITH_SHA1_HMAC:
  ------------------
  |  | 1015|      0|#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003C0UL
  ------------------
  |  Branch (646:9): [True: 0, False: 5.75k]
  ------------------
  647|      0|        case CKM_NSS_PBE_SHA1_HMAC_KEY_GEN:
  ------------------
  |  |  293|      0|#define CKM_NSS_PBE_SHA1_HMAC_KEY_GEN 0x80000009UL
  ------------------
  |  Branch (647:9): [True: 0, False: 5.75k]
  ------------------
  648|      0|        case CKM_NSS_PBE_MD5_HMAC_KEY_GEN:
  ------------------
  |  |  294|      0|#define CKM_NSS_PBE_MD5_HMAC_KEY_GEN 0x8000000aUL
  ------------------
  |  Branch (648:9): [True: 0, False: 5.75k]
  ------------------
  649|      0|        case CKM_NSS_PBE_MD2_HMAC_KEY_GEN:
  ------------------
  |  |  295|      0|#define CKM_NSS_PBE_MD2_HMAC_KEY_GEN 0x8000000bUL
  ------------------
  |  Branch (649:9): [True: 0, False: 5.75k]
  ------------------
  650|      0|        case CKM_NSS_PKCS12_PBE_SHA224_HMAC_KEY_GEN:
  ------------------
  |  |  246|      0|#define CKM_NSS_PKCS12_PBE_SHA224_HMAC_KEY_GEN (CKM_NSS + 29)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (650:9): [True: 0, False: 5.75k]
  ------------------
  651|      0|        case CKM_NSS_PKCS12_PBE_SHA256_HMAC_KEY_GEN:
  ------------------
  |  |  247|      0|#define CKM_NSS_PKCS12_PBE_SHA256_HMAC_KEY_GEN (CKM_NSS + 30)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (651:9): [True: 0, False: 5.75k]
  ------------------
  652|      0|        case CKM_NSS_PKCS12_PBE_SHA384_HMAC_KEY_GEN:
  ------------------
  |  |  248|      0|#define CKM_NSS_PKCS12_PBE_SHA384_HMAC_KEY_GEN (CKM_NSS + 31)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (652:9): [True: 0, False: 5.75k]
  ------------------
  653|      0|        case CKM_NSS_PKCS12_PBE_SHA512_HMAC_KEY_GEN:
  ------------------
  |  |  249|      0|#define CKM_NSS_PKCS12_PBE_SHA512_HMAC_KEY_GEN (CKM_NSS + 32)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (653:9): [True: 0, False: 5.75k]
  ------------------
  654|      0|        case CKM_NSS_PBE_SHA1_DES_CBC:
  ------------------
  |  |  286|      0|#define CKM_NSS_PBE_SHA1_DES_CBC 0x80000002UL
  ------------------
  |  Branch (654:9): [True: 0, False: 5.75k]
  ------------------
  655|      0|        case CKM_NSS_PBE_SHA1_40_BIT_RC2_CBC:
  ------------------
  |  |  288|      0|#define CKM_NSS_PBE_SHA1_40_BIT_RC2_CBC 0x80000004UL
  ------------------
  |  Branch (655:9): [True: 0, False: 5.75k]
  ------------------
  656|      0|        case CKM_NSS_PBE_SHA1_128_BIT_RC2_CBC:
  ------------------
  |  |  289|      0|#define CKM_NSS_PBE_SHA1_128_BIT_RC2_CBC 0x80000005UL
  ------------------
  |  Branch (656:9): [True: 0, False: 5.75k]
  ------------------
  657|      0|        case CKM_NSS_PBE_SHA1_40_BIT_RC4:
  ------------------
  |  |  290|      0|#define CKM_NSS_PBE_SHA1_40_BIT_RC4 0x80000006UL
  ------------------
  |  Branch (657:9): [True: 0, False: 5.75k]
  ------------------
  658|      0|        case CKM_NSS_PBE_SHA1_128_BIT_RC4:
  ------------------
  |  |  291|      0|#define CKM_NSS_PBE_SHA1_128_BIT_RC4 0x80000007UL
  ------------------
  |  Branch (658:9): [True: 0, False: 5.75k]
  ------------------
  659|      0|        case CKM_NSS_PBE_SHA1_TRIPLE_DES_CBC:
  ------------------
  |  |  287|      0|#define CKM_NSS_PBE_SHA1_TRIPLE_DES_CBC 0x80000003UL
  ------------------
  |  Branch (659:9): [True: 0, False: 5.75k]
  ------------------
  660|      0|        case CKM_NSS_PBE_SHA1_FAULTY_3DES_CBC:
  ------------------
  |  |  292|      0|#define CKM_NSS_PBE_SHA1_FAULTY_3DES_CBC 0x80000008UL
  ------------------
  |  Branch (660:9): [True: 0, False: 5.75k]
  ------------------
  661|      0|        case CKM_PBE_SHA1_RC2_40_CBC:
  ------------------
  |  | 1010|      0|#define CKM_PBE_SHA1_RC2_40_CBC 0x000003ABUL
  ------------------
  |  Branch (661:9): [True: 0, False: 5.75k]
  ------------------
  662|      0|        case CKM_PBE_SHA1_RC2_128_CBC:
  ------------------
  |  | 1009|      0|#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AAUL
  ------------------
  |  Branch (662:9): [True: 0, False: 5.75k]
  ------------------
  663|      0|        case CKM_PBE_SHA1_RC4_40:
  ------------------
  |  | 1006|      0|#define CKM_PBE_SHA1_RC4_40 0x000003A7UL
  ------------------
  |  Branch (663:9): [True: 0, False: 5.75k]
  ------------------
  664|      0|        case CKM_PBE_SHA1_RC4_128:
  ------------------
  |  | 1005|      0|#define CKM_PBE_SHA1_RC4_128 0x000003A6UL
  ------------------
  |  Branch (664:9): [True: 0, False: 5.75k]
  ------------------
  665|      0|        case CKM_PBE_SHA1_DES3_EDE_CBC:
  ------------------
  |  | 1007|      0|#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8UL
  ------------------
  |  Branch (665:9): [True: 0, False: 5.75k]
  ------------------
  666|      0|        case CKM_PBE_SHA1_DES2_EDE_CBC:
  ------------------
  |  | 1008|      0|#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9UL
  ------------------
  |  Branch (666:9): [True: 0, False: 5.75k]
  ------------------
  667|      0|        case CKM_PKCS5_PBKD2:
  ------------------
  |  | 1013|      0|#define CKM_PKCS5_PBKD2 0x000003B0UL
  ------------------
  |  Branch (667:9): [True: 0, False: 5.75k]
  ------------------
  668|      0|            return type;
  669|      0|        default:
  ------------------
  |  Branch (669:9): [True: 0, False: 5.75k]
  ------------------
  670|      0|            return pk11_lookup(type)->keyGen;
  671|  5.75k|    }
  672|  5.75k|}
pk11_ParamFromIVWithLen:
  877|     89|{
  878|     89|    CK_RC2_CBC_PARAMS *rc2_params = NULL;
  879|     89|    CK_RC2_PARAMS *rc2_ecb_params = NULL;
  880|     89|    CK_RC5_PARAMS *rc5_params = NULL;
  881|     89|    CK_RC5_CBC_PARAMS *rc5_cbc_params = NULL;
  882|     89|    SECItem *param;
  883|       |
  884|     89|    param = (SECItem *)PORT_Alloc(sizeof(SECItem));
  ------------------
  |  |   52|     89|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  885|     89|    if (param == NULL)
  ------------------
  |  Branch (885:9): [True: 0, False: 89]
  ------------------
  886|      0|        return NULL;
  887|     89|    param->data = NULL;
  888|     89|    param->len = 0;
  889|     89|    param->type = 0;
  890|     89|    switch (type) {
  891|      0|        case CKM_SEED_ECB:
  ------------------
  |  | 1156|      0|#define CKM_SEED_ECB 0x00000651UL
  ------------------
  |  Branch (891:9): [True: 0, False: 89]
  ------------------
  892|      0|        case CKM_CAMELLIA_ECB:
  ------------------
  |  | 1136|      0|#define CKM_CAMELLIA_ECB 0x00000551UL
  ------------------
  |  Branch (892:9): [True: 0, False: 89]
  ------------------
  893|      0|        case CKM_AES_ECB:
  ------------------
  |  | 1107|      0|#define CKM_AES_ECB 0x00001081UL
  ------------------
  |  Branch (893:9): [True: 0, False: 89]
  ------------------
  894|      0|        case CKM_DES_ECB:
  ------------------
  |  |  815|      0|#define CKM_DES_ECB 0x00000121UL
  ------------------
  |  Branch (894:9): [True: 0, False: 89]
  ------------------
  895|     89|        case CKM_DES3_ECB:
  ------------------
  |  |  825|     89|#define CKM_DES3_ECB 0x00000132UL
  ------------------
  |  Branch (895:9): [True: 89, False: 0]
  ------------------
  896|     89|        case CKM_RSA_PKCS:
  ------------------
  |  |  720|     89|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (896:9): [True: 0, False: 89]
  ------------------
  897|     89|        case CKM_RSA_X_509:
  ------------------
  |  |  722|     89|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (897:9): [True: 0, False: 89]
  ------------------
  898|     89|        case CKM_RSA_9796:
  ------------------
  |  |  721|     89|#define CKM_RSA_9796 0x00000002UL
  ------------------
  |  Branch (898:9): [True: 0, False: 89]
  ------------------
  899|     89|        case CKM_IDEA_ECB:
  ------------------
  |  |  948|     89|#define CKM_IDEA_ECB 0x00000341UL
  ------------------
  |  Branch (899:9): [True: 0, False: 89]
  ------------------
  900|     89|        case CKM_CDMF_ECB:
  ------------------
  |  |  835|     89|#define CKM_CDMF_ECB 0x00000141UL
  ------------------
  |  Branch (900:9): [True: 0, False: 89]
  ------------------
  901|     89|        case CKM_CAST_ECB:
  ------------------
  |  |  918|     89|#define CKM_CAST_ECB 0x00000301UL
  ------------------
  |  Branch (901:9): [True: 0, False: 89]
  ------------------
  902|     89|        case CKM_CAST3_ECB:
  ------------------
  |  |  924|     89|#define CKM_CAST3_ECB 0x00000311UL
  ------------------
  |  Branch (902:9): [True: 0, False: 89]
  ------------------
  903|     89|        case CKM_CAST5_ECB:
  ------------------
  |  |  931|     89|#define CKM_CAST5_ECB 0x00000321UL
  ------------------
  |  Branch (903:9): [True: 0, False: 89]
  ------------------
  904|     89|        case CKM_RC4:
  ------------------
  |  |  813|     89|#define CKM_RC4 0x00000111UL
  ------------------
  |  Branch (904:9): [True: 0, False: 89]
  ------------------
  905|     89|            break;
  906|      0|        case CKM_RC2_ECB:
  ------------------
  |  |  804|      0|#define CKM_RC2_ECB 0x00000101UL
  ------------------
  |  Branch (906:9): [True: 0, False: 89]
  ------------------
  907|      0|            rc2_ecb_params = (CK_RC2_PARAMS *)PORT_Alloc(sizeof(CK_RC2_PARAMS));
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  908|      0|            if (rc2_ecb_params == NULL)
  ------------------
  |  Branch (908:17): [True: 0, False: 0]
  ------------------
  909|      0|                break;
  910|       |            /*  Maybe we should pass the key size in too to get this value? */
  911|      0|            *rc2_ecb_params = keyLen ? keyLen * 8 : 128;
  ------------------
  |  Branch (911:31): [True: 0, False: 0]
  ------------------
  912|      0|            param->data = (unsigned char *)rc2_ecb_params;
  913|      0|            param->len = sizeof(CK_RC2_PARAMS);
  914|      0|            break;
  915|      0|        case CKM_RC2_CBC:
  ------------------
  |  |  805|      0|#define CKM_RC2_CBC 0x00000102UL
  ------------------
  |  Branch (915:9): [True: 0, False: 89]
  ------------------
  916|      0|        case CKM_RC2_CBC_PAD:
  ------------------
  |  |  810|      0|#define CKM_RC2_CBC_PAD 0x00000105UL
  ------------------
  |  Branch (916:9): [True: 0, False: 89]
  ------------------
  917|      0|            rc2_params = (CK_RC2_CBC_PARAMS *)PORT_Alloc(sizeof(CK_RC2_CBC_PARAMS));
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  918|      0|            if (rc2_params == NULL)
  ------------------
  |  Branch (918:17): [True: 0, False: 0]
  ------------------
  919|      0|                break;
  920|       |            /* Maybe we should pass the key size in too to get this value? */
  921|      0|            rc2_params->ulEffectiveBits = keyLen ? keyLen * 8 : 128;
  ------------------
  |  Branch (921:43): [True: 0, False: 0]
  ------------------
  922|      0|            if (iv && iv->data)
  ------------------
  |  Branch (922:17): [True: 0, False: 0]
  |  Branch (922:23): [True: 0, False: 0]
  ------------------
  923|      0|                PORT_Memcpy(rc2_params->iv, iv->data, sizeof(rc2_params->iv));
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  924|      0|            param->data = (unsigned char *)rc2_params;
  925|      0|            param->len = sizeof(CK_RC2_CBC_PARAMS);
  926|      0|            break;
  927|      0|        case CKM_RC5_CBC:
  ------------------
  |  |  943|      0|#define CKM_RC5_CBC 0x00000332UL
  ------------------
  |  Branch (927:9): [True: 0, False: 89]
  ------------------
  928|      0|        case CKM_RC5_CBC_PAD:
  ------------------
  |  |  946|      0|#define CKM_RC5_CBC_PAD 0x00000335UL
  ------------------
  |  Branch (928:9): [True: 0, False: 89]
  ------------------
  929|      0|            rc5_cbc_params = (CK_RC5_CBC_PARAMS *)
  930|      0|                PORT_Alloc(sizeof(CK_RC5_CBC_PARAMS) + ((iv) ? iv->len : 0));
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  |  Branch (930:57): [True: 0, False: 0]
  ------------------
  931|      0|            if (rc5_cbc_params == NULL)
  ------------------
  |  Branch (931:17): [True: 0, False: 0]
  ------------------
  932|      0|                break;
  933|      0|            if (iv && iv->data && iv->len) {
  ------------------
  |  Branch (933:17): [True: 0, False: 0]
  |  Branch (933:23): [True: 0, False: 0]
  |  Branch (933:35): [True: 0, False: 0]
  ------------------
  934|      0|                rc5_cbc_params->pIv = ((CK_BYTE_PTR)rc5_cbc_params) + sizeof(CK_RC5_CBC_PARAMS);
  935|      0|                PORT_Memcpy(rc5_cbc_params->pIv, iv->data, iv->len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  936|      0|                rc5_cbc_params->ulIvLen = iv->len;
  937|      0|                rc5_cbc_params->ulWordsize = iv->len / 2;
  938|      0|            } else {
  939|      0|                rc5_cbc_params->ulWordsize = 4;
  940|      0|                rc5_cbc_params->pIv = NULL;
  941|      0|                rc5_cbc_params->ulIvLen = 0;
  942|      0|            }
  943|      0|            rc5_cbc_params->ulRounds = 16;
  944|      0|            param->data = (unsigned char *)rc5_cbc_params;
  945|      0|            param->len = sizeof(CK_RC5_CBC_PARAMS);
  946|      0|            break;
  947|      0|        case CKM_RC5_ECB:
  ------------------
  |  |  942|      0|#define CKM_RC5_ECB 0x00000331UL
  ------------------
  |  Branch (947:9): [True: 0, False: 89]
  ------------------
  948|      0|            rc5_params = (CK_RC5_PARAMS *)PORT_Alloc(sizeof(CK_RC5_PARAMS));
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  949|      0|            if (rc5_params == NULL)
  ------------------
  |  Branch (949:17): [True: 0, False: 0]
  ------------------
  950|      0|                break;
  951|      0|            if (iv && iv->data && iv->len) {
  ------------------
  |  Branch (951:17): [True: 0, False: 0]
  |  Branch (951:23): [True: 0, False: 0]
  |  Branch (951:35): [True: 0, False: 0]
  ------------------
  952|      0|                rc5_params->ulWordsize = iv->len / 2;
  953|      0|            } else {
  954|      0|                rc5_params->ulWordsize = 4;
  955|      0|            }
  956|      0|            rc5_params->ulRounds = 16;
  957|      0|            param->data = (unsigned char *)rc5_params;
  958|      0|            param->len = sizeof(CK_RC5_PARAMS);
  959|      0|            break;
  960|       |
  961|      0|        case CKM_SEED_CBC:
  ------------------
  |  | 1157|      0|#define CKM_SEED_CBC 0x00000652UL
  ------------------
  |  Branch (961:9): [True: 0, False: 89]
  ------------------
  962|      0|        case CKM_CAMELLIA_CBC:
  ------------------
  |  | 1137|      0|#define CKM_CAMELLIA_CBC 0x00000552UL
  ------------------
  |  Branch (962:9): [True: 0, False: 89]
  ------------------
  963|      0|        case CKM_AES_CBC:
  ------------------
  |  | 1108|      0|#define CKM_AES_CBC 0x00001082UL
  ------------------
  |  Branch (963:9): [True: 0, False: 89]
  ------------------
  964|      0|        case CKM_DES_CBC:
  ------------------
  |  |  816|      0|#define CKM_DES_CBC 0x00000122UL
  ------------------
  |  Branch (964:9): [True: 0, False: 89]
  ------------------
  965|      0|        case CKM_DES3_CBC:
  ------------------
  |  |  826|      0|#define CKM_DES3_CBC 0x00000133UL
  ------------------
  |  Branch (965:9): [True: 0, False: 89]
  ------------------
  966|      0|        case CKM_IDEA_CBC:
  ------------------
  |  |  949|      0|#define CKM_IDEA_CBC 0x00000342UL
  ------------------
  |  Branch (966:9): [True: 0, False: 89]
  ------------------
  967|      0|        case CKM_CDMF_CBC:
  ------------------
  |  |  836|      0|#define CKM_CDMF_CBC 0x00000142UL
  ------------------
  |  Branch (967:9): [True: 0, False: 89]
  ------------------
  968|      0|        case CKM_CAST_CBC:
  ------------------
  |  |  919|      0|#define CKM_CAST_CBC 0x00000302UL
  ------------------
  |  Branch (968:9): [True: 0, False: 89]
  ------------------
  969|      0|        case CKM_CAST3_CBC:
  ------------------
  |  |  925|      0|#define CKM_CAST3_CBC 0x00000312UL
  ------------------
  |  Branch (969:9): [True: 0, False: 89]
  ------------------
  970|      0|        case CKM_CAST5_CBC:
  ------------------
  |  |  933|      0|#define CKM_CAST5_CBC 0x00000322UL
  ------------------
  |  Branch (970:9): [True: 0, False: 89]
  ------------------
  971|      0|        case CKM_CAMELLIA_CBC_PAD:
  ------------------
  |  | 1140|      0|#define CKM_CAMELLIA_CBC_PAD 0x00000555UL
  ------------------
  |  Branch (971:9): [True: 0, False: 89]
  ------------------
  972|      0|        case CKM_AES_CBC_PAD:
  ------------------
  |  | 1111|      0|#define CKM_AES_CBC_PAD 0x00001085UL
  ------------------
  |  Branch (972:9): [True: 0, False: 89]
  ------------------
  973|      0|        case CKM_DES_CBC_PAD:
  ------------------
  |  |  821|      0|#define CKM_DES_CBC_PAD 0x00000125UL
  ------------------
  |  Branch (973:9): [True: 0, False: 89]
  ------------------
  974|      0|        case CKM_DES3_CBC_PAD:
  ------------------
  |  |  833|      0|#define CKM_DES3_CBC_PAD 0x00000136UL
  ------------------
  |  Branch (974:9): [True: 0, False: 89]
  ------------------
  975|      0|        case CKM_IDEA_CBC_PAD:
  ------------------
  |  |  952|      0|#define CKM_IDEA_CBC_PAD 0x00000345UL
  ------------------
  |  Branch (975:9): [True: 0, False: 89]
  ------------------
  976|      0|        case CKM_CDMF_CBC_PAD:
  ------------------
  |  |  839|      0|#define CKM_CDMF_CBC_PAD 0x00000145UL
  ------------------
  |  Branch (976:9): [True: 0, False: 89]
  ------------------
  977|      0|        case CKM_CAST_CBC_PAD:
  ------------------
  |  |  922|      0|#define CKM_CAST_CBC_PAD 0x00000305UL
  ------------------
  |  Branch (977:9): [True: 0, False: 89]
  ------------------
  978|      0|        case CKM_CAST3_CBC_PAD:
  ------------------
  |  |  928|      0|#define CKM_CAST3_CBC_PAD 0x00000315UL
  ------------------
  |  Branch (978:9): [True: 0, False: 89]
  ------------------
  979|      0|        case CKM_CAST5_CBC_PAD:
  ------------------
  |  |  939|      0|#define CKM_CAST5_CBC_PAD 0x00000325UL
  ------------------
  |  Branch (979:9): [True: 0, False: 89]
  ------------------
  980|      0|        case CKM_SKIPJACK_CBC64:
  ------------------
  |  | 1049|      0|#define CKM_SKIPJACK_CBC64 0x00001002UL
  ------------------
  |  Branch (980:9): [True: 0, False: 89]
  ------------------
  981|      0|        case CKM_SKIPJACK_ECB64:
  ------------------
  |  | 1048|      0|#define CKM_SKIPJACK_ECB64 0x00001001UL
  ------------------
  |  Branch (981:9): [True: 0, False: 89]
  ------------------
  982|      0|        case CKM_SKIPJACK_OFB64:
  ------------------
  |  | 1050|      0|#define CKM_SKIPJACK_OFB64 0x00001003UL
  ------------------
  |  Branch (982:9): [True: 0, False: 89]
  ------------------
  983|      0|        case CKM_SKIPJACK_CFB64:
  ------------------
  |  | 1051|      0|#define CKM_SKIPJACK_CFB64 0x00001004UL
  ------------------
  |  Branch (983:9): [True: 0, False: 89]
  ------------------
  984|      0|        case CKM_SKIPJACK_CFB32:
  ------------------
  |  | 1052|      0|#define CKM_SKIPJACK_CFB32 0x00001005UL
  ------------------
  |  Branch (984:9): [True: 0, False: 89]
  ------------------
  985|      0|        case CKM_SKIPJACK_CFB16:
  ------------------
  |  | 1053|      0|#define CKM_SKIPJACK_CFB16 0x00001006UL
  ------------------
  |  Branch (985:9): [True: 0, False: 89]
  ------------------
  986|      0|        case CKM_SKIPJACK_CFB8:
  ------------------
  |  | 1054|      0|#define CKM_SKIPJACK_CFB8 0x00001007UL
  ------------------
  |  Branch (986:9): [True: 0, False: 89]
  ------------------
  987|      0|        case CKM_BATON_ECB128:
  ------------------
  |  | 1062|      0|#define CKM_BATON_ECB128 0x00001031UL
  ------------------
  |  Branch (987:9): [True: 0, False: 89]
  ------------------
  988|      0|        case CKM_BATON_ECB96:
  ------------------
  |  | 1063|      0|#define CKM_BATON_ECB96 0x00001032UL
  ------------------
  |  Branch (988:9): [True: 0, False: 89]
  ------------------
  989|      0|        case CKM_BATON_CBC128:
  ------------------
  |  | 1064|      0|#define CKM_BATON_CBC128 0x00001033UL
  ------------------
  |  Branch (989:9): [True: 0, False: 89]
  ------------------
  990|      0|        case CKM_BATON_COUNTER:
  ------------------
  |  | 1065|      0|#define CKM_BATON_COUNTER 0x00001034UL
  ------------------
  |  Branch (990:9): [True: 0, False: 89]
  ------------------
  991|      0|        case CKM_BATON_SHUFFLE:
  ------------------
  |  | 1066|      0|#define CKM_BATON_SHUFFLE 0x00001035UL
  ------------------
  |  Branch (991:9): [True: 0, False: 89]
  ------------------
  992|      0|        case CKM_JUNIPER_ECB128:
  ------------------
  |  | 1095|      0|#define CKM_JUNIPER_ECB128 0x00001061UL
  ------------------
  |  Branch (992:9): [True: 0, False: 89]
  ------------------
  993|      0|        case CKM_JUNIPER_CBC128:
  ------------------
  |  | 1096|      0|#define CKM_JUNIPER_CBC128 0x00001062UL
  ------------------
  |  Branch (993:9): [True: 0, False: 89]
  ------------------
  994|      0|        case CKM_JUNIPER_COUNTER:
  ------------------
  |  | 1097|      0|#define CKM_JUNIPER_COUNTER 0x00001063UL
  ------------------
  |  Branch (994:9): [True: 0, False: 89]
  ------------------
  995|      0|        case CKM_JUNIPER_SHUFFLE:
  ------------------
  |  | 1098|      0|#define CKM_JUNIPER_SHUFFLE 0x00001064UL
  ------------------
  |  Branch (995:9): [True: 0, False: 89]
  ------------------
  996|      0|            if ((iv == NULL) || (iv->data == NULL))
  ------------------
  |  Branch (996:17): [True: 0, False: 0]
  |  Branch (996:33): [True: 0, False: 0]
  ------------------
  997|      0|                break;
  998|      0|            param->data = (unsigned char *)PORT_Alloc(iv->len);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  999|      0|            if (param->data != NULL) {
  ------------------
  |  Branch (999:17): [True: 0, False: 0]
  ------------------
 1000|      0|                PORT_Memcpy(param->data, iv->data, iv->len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 1001|      0|                param->len = iv->len;
 1002|      0|            }
 1003|      0|            break;
 1004|       |        /* unknown mechanism, pass IV in if it's there */
 1005|      0|        default:
  ------------------
  |  Branch (1005:9): [True: 0, False: 89]
  ------------------
 1006|      0|            if (pk11_lookup(type)->iv == 0) {
  ------------------
  |  Branch (1006:17): [True: 0, False: 0]
  ------------------
 1007|      0|                break;
 1008|      0|            }
 1009|      0|            if ((iv == NULL) || (iv->data == NULL)) {
  ------------------
  |  Branch (1009:17): [True: 0, False: 0]
  |  Branch (1009:33): [True: 0, False: 0]
  ------------------
 1010|      0|                break;
 1011|      0|            }
 1012|      0|            param->data = (unsigned char *)PORT_Alloc(iv->len);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1013|      0|            if (param->data != NULL) {
  ------------------
  |  Branch (1013:17): [True: 0, False: 0]
  ------------------
 1014|      0|                PORT_Memcpy(param->data, iv->data, iv->len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 1015|      0|                param->len = iv->len;
 1016|      0|            }
 1017|      0|            break;
 1018|     89|    }
 1019|     89|    return param;
 1020|     89|}
PK11_ParamFromIV:
 1028|     89|{
 1029|     89|    return pk11_ParamFromIVWithLen(type, iv, 0);
 1030|     89|}
PK11_AlgtagToMechanism:
 1755|  31.9k|{
 1756|  31.9k|    SECOidData *oid = SECOID_FindOIDByTag(algTag);
  ------------------
  |  |  116|  31.9k|#define SECOID_FindOIDByTag SECOID_FindOIDByTag_Util
  ------------------
 1757|       |
 1758|  31.9k|    if (oid)
  ------------------
  |  Branch (1758:9): [True: 31.9k, False: 0]
  ------------------
 1759|  31.9k|        return (CK_MECHANISM_TYPE)oid->mechanism;
 1760|      0|    return CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|      0|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
 1761|  31.9k|}
PK11_MapSignKeyType:
 1931|  2.80k|{
 1932|  2.80k|    switch (keyType) {
 1933|  1.75k|        case rsaKey:
  ------------------
  |  Branch (1933:9): [True: 1.75k, False: 1.04k]
  ------------------
 1934|  1.75k|            return CKM_RSA_PKCS;
  ------------------
  |  |  720|  1.75k|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
 1935|      0|        case fortezzaKey:
  ------------------
  |  Branch (1935:9): [True: 0, False: 2.80k]
  ------------------
 1936|    915|        case dsaKey:
  ------------------
  |  Branch (1936:9): [True: 915, False: 1.88k]
  ------------------
 1937|    915|            return CKM_DSA;
  ------------------
  |  |  745|    915|#define CKM_DSA 0x00000011UL
  ------------------
 1938|    130|        case ecKey:
  ------------------
  |  Branch (1938:9): [True: 130, False: 2.67k]
  ------------------
 1939|    130|            return CKM_ECDSA;
  ------------------
  |  | 1074|    130|#define CKM_ECDSA 0x00001041UL
  ------------------
 1940|      0|        case edKey:
  ------------------
  |  Branch (1940:9): [True: 0, False: 2.80k]
  ------------------
 1941|      0|            return CKM_EDDSA;
  ------------------
  |  | 1174|      0|#define CKM_EDDSA 0x00001057UL
  ------------------
 1942|      0|        case dhKey:
  ------------------
  |  Branch (1942:9): [True: 0, False: 2.80k]
  ------------------
 1943|      0|        default:
  ------------------
  |  Branch (1943:9): [True: 0, False: 2.80k]
  ------------------
 1944|      0|            break;
 1945|  2.80k|    }
 1946|      0|    return CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|      0|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
 1947|  2.80k|}
pk11_mapWrapKeyType:
 1951|  1.13k|{
 1952|  1.13k|    switch (keyType) {
 1953|  1.08k|        case rsaKey:
  ------------------
  |  Branch (1953:9): [True: 1.08k, False: 47]
  ------------------
 1954|  1.08k|            return CKM_RSA_PKCS;
  ------------------
  |  |  720|  1.08k|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
 1955|       |        /* Add fortezza?? */
 1956|     47|        default:
  ------------------
  |  Branch (1956:9): [True: 47, False: 1.08k]
  ------------------
 1957|     47|            break;
 1958|  1.13k|    }
 1959|     47|    return CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|     47|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
 1960|  1.13k|}
pk11mech.c:pk11_lookup:
   75|  2.22k|{
   76|  2.22k|    int i;
   77|  2.22k|    for (i = 0; i < pk11_MechEntrySize; i++) {
  ------------------
  |  Branch (77:17): [True: 0, False: 2.22k]
  ------------------
   78|      0|        if (pk11_MechanismTable[i].type == type) {
  ------------------
  |  Branch (78:13): [True: 0, False: 0]
  ------------------
   79|      0|            return (&pk11_MechanismTable[i]);
   80|      0|        }
   81|      0|    }
   82|  2.22k|    return &pk11_default;
   83|  2.22k|}

PK11_DestroyObject:
   55|  21.9k|{
   56|  21.9k|    CK_RV crv;
   57|       |
   58|  21.9k|    PK11_EnterSlotMonitor(slot);
   59|  21.9k|    crv = PK11_GETTAB(slot)->C_DestroyObject(slot->session, object);
  ------------------
  |  |  102|  21.9k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
   60|  21.9k|    PK11_ExitSlotMonitor(slot);
   61|  21.9k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  21.9k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (61:9): [True: 0, False: 21.9k]
  ------------------
   62|      0|        return SECFailure;
   63|      0|    }
   64|  21.9k|    return SECSuccess;
   65|  21.9k|}
PK11_ReadAttribute:
  100|  1.73k|{
  101|  1.73k|    CK_ATTRIBUTE attr = { 0, NULL, 0 };
  102|  1.73k|    CK_RV crv;
  103|       |
  104|  1.73k|    attr.type = type;
  105|       |
  106|  1.73k|    PK11_EnterSlotMonitor(slot);
  107|  1.73k|    crv = PK11_GETTAB(slot)->C_GetAttributeValue(slot->session, id, &attr, 1);
  ------------------
  |  |  102|  1.73k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  108|  1.73k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.73k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (108:9): [True: 0, False: 1.73k]
  ------------------
  109|      0|        PK11_ExitSlotMonitor(slot);
  110|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  111|      0|        return SECFailure;
  112|      0|    }
  113|  1.73k|    if (arena) {
  ------------------
  |  Branch (113:9): [True: 0, False: 1.73k]
  ------------------
  114|      0|        attr.pValue = PORT_ArenaAlloc(arena, attr.ulValueLen);
  ------------------
  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  115|  1.73k|    } else {
  116|  1.73k|        attr.pValue = PORT_Alloc(attr.ulValueLen);
  ------------------
  |  |   52|  1.73k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  117|  1.73k|    }
  118|  1.73k|    if (attr.pValue == NULL) {
  ------------------
  |  Branch (118:9): [True: 0, False: 1.73k]
  ------------------
  119|      0|        PK11_ExitSlotMonitor(slot);
  120|      0|        return SECFailure;
  121|      0|    }
  122|  1.73k|    crv = PK11_GETTAB(slot)->C_GetAttributeValue(slot->session, id, &attr, 1);
  ------------------
  |  |  102|  1.73k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  123|  1.73k|    PK11_ExitSlotMonitor(slot);
  124|  1.73k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.73k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (124:9): [True: 0, False: 1.73k]
  ------------------
  125|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  126|      0|        if (!arena)
  ------------------
  |  Branch (126:13): [True: 0, False: 0]
  ------------------
  127|      0|            PORT_Free(attr.pValue);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  128|      0|        return SECFailure;
  129|      0|    }
  130|       |
  131|  1.73k|    result->data = (unsigned char *)attr.pValue;
  132|  1.73k|    result->len = attr.ulValueLen;
  133|       |
  134|  1.73k|    return SECSuccess;
  135|  1.73k|}
PK11_ReadULongAttribute:
  143|  9.19k|{
  144|  9.19k|    CK_ATTRIBUTE attr;
  145|  9.19k|    CK_ULONG value = CK_UNAVAILABLE_INFORMATION;
  ------------------
  |  |   64|  9.19k|#define CK_UNAVAILABLE_INFORMATION (~0UL)
  ------------------
  146|  9.19k|    CK_RV crv;
  147|       |
  148|  9.19k|    PK11_SETATTRS(&attr, type, &value, sizeof(value));
  ------------------
  |  |  104|  9.19k|    (x)->type = (id);              \
  |  |  105|  9.19k|    (x)->pValue = (v);             \
  |  |  106|  9.19k|    (x)->ulValueLen = (l);
  ------------------
  149|       |
  150|  9.19k|    PK11_EnterSlotMonitor(slot);
  151|  9.19k|    crv = PK11_GETTAB(slot)->C_GetAttributeValue(slot->session, id, &attr, 1);
  ------------------
  |  |  102|  9.19k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  152|  9.19k|    PK11_ExitSlotMonitor(slot);
  153|  9.19k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.19k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (153:9): [True: 0, False: 9.19k]
  ------------------
  154|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  155|      0|    }
  156|  9.19k|    return value;
  157|  9.19k|}
pk11_HasAttributeSet_Lock:
  165|  31.1k|{
  166|  31.1k|    CK_BBOOL ckvalue = CK_FALSE;
  ------------------
  |  |   23|  31.1k|#define CK_FALSE 0
  ------------------
  167|  31.1k|    CK_ATTRIBUTE theTemplate;
  168|  31.1k|    CK_RV crv;
  169|       |
  170|       |    /* Prepare to retrieve the attribute. */
  171|  31.1k|    PK11_SETATTRS(&theTemplate, type, &ckvalue, sizeof(CK_BBOOL));
  ------------------
  |  |  104|  31.1k|    (x)->type = (id);              \
  |  |  105|  31.1k|    (x)->pValue = (v);             \
  |  |  106|  31.1k|    (x)->ulValueLen = (l);
  ------------------
  172|       |
  173|       |    /* Retrieve attribute value. */
  174|  31.1k|    if (!haslock)
  ------------------
  |  Branch (174:9): [True: 31.1k, False: 0]
  ------------------
  175|  31.1k|        PK11_EnterSlotMonitor(slot);
  176|  31.1k|    crv = PK11_GETTAB(slot)->C_GetAttributeValue(slot->session, id,
  ------------------
  |  |  102|  31.1k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  177|  31.1k|                                                 &theTemplate, 1);
  178|  31.1k|    if (!haslock)
  ------------------
  |  Branch (178:9): [True: 31.1k, False: 0]
  ------------------
  179|  31.1k|        PK11_ExitSlotMonitor(slot);
  180|  31.1k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  31.1k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (180:9): [True: 0, False: 31.1k]
  ------------------
  181|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  182|      0|        return CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
  183|      0|    }
  184|       |
  185|  31.1k|    return ckvalue;
  186|  31.1k|}
PK11_HasAttributeSet:
  191|  31.1k|{
  192|  31.1k|    PR_ASSERT(haslock == PR_FALSE);
  ------------------
  |  |  208|  31.1k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 31.1k, False: 0]
  |  |  ------------------
  ------------------
  193|  31.1k|    return pk11_HasAttributeSet_Lock(slot, id, type, PR_FALSE);
  ------------------
  |  |  438|  31.1k|#define PR_FALSE 0
  ------------------
  194|  31.1k|}
PK11_GetAttributes:
  203|  9.19k|{
  204|  9.19k|    int i;
  205|       |    /* make pedantic happy... note that it's only used arena != NULL */
  206|  9.19k|    void *mark = NULL;
  207|  9.19k|    CK_RV crv;
  208|  9.19k|    if (slot->session == CK_INVALID_HANDLE)
  ------------------
  |  |   78|  9.19k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (208:9): [True: 0, False: 9.19k]
  ------------------
  209|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
  210|       |
  211|       |    /*
  212|       |     * first get all the lengths of the parameters.
  213|       |     */
  214|  9.19k|    PK11_EnterSlotMonitor(slot);
  215|  9.19k|    crv = PK11_GETTAB(slot)->C_GetAttributeValue(slot->session, obj, attr, count);
  ------------------
  |  |  102|  9.19k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  216|  9.19k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.19k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (216:9): [True: 0, False: 9.19k]
  ------------------
  217|      0|        PK11_ExitSlotMonitor(slot);
  218|      0|        return crv;
  219|      0|    }
  220|       |
  221|  9.19k|    if (arena) {
  ------------------
  |  Branch (221:9): [True: 9.19k, False: 0]
  ------------------
  222|  9.19k|        mark = PORT_ArenaMark(arena);
  ------------------
  |  |   55|  9.19k|#define PORT_ArenaMark PORT_ArenaMark_Util
  ------------------
  223|  9.19k|        if (mark == NULL)
  ------------------
  |  Branch (223:13): [True: 0, False: 9.19k]
  ------------------
  224|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  225|  9.19k|    }
  226|       |
  227|       |    /*
  228|       |     * now allocate space to store the results.
  229|       |     */
  230|  47.2k|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (230:17): [True: 38.0k, False: 9.19k]
  ------------------
  231|  38.0k|        if (attr[i].ulValueLen == 0)
  ------------------
  |  Branch (231:13): [True: 0, False: 38.0k]
  ------------------
  232|      0|            continue;
  233|  38.0k|        if (arena) {
  ------------------
  |  Branch (233:13): [True: 38.0k, False: 0]
  ------------------
  234|  38.0k|            attr[i].pValue = PORT_ArenaAlloc(arena, attr[i].ulValueLen);
  ------------------
  |  |   53|  38.0k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  235|  38.0k|            if (attr[i].pValue == NULL) {
  ------------------
  |  Branch (235:17): [True: 0, False: 38.0k]
  ------------------
  236|       |                /* arena failures, just release the mark */
  237|      0|                PORT_ArenaRelease(arena, mark);
  ------------------
  |  |   56|      0|#define PORT_ArenaRelease PORT_ArenaRelease_Util
  ------------------
  238|      0|                PK11_ExitSlotMonitor(slot);
  239|      0|                return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  240|      0|            }
  241|  38.0k|        } else {
  242|      0|            attr[i].pValue = PORT_Alloc(attr[i].ulValueLen);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  243|      0|            if (attr[i].pValue == NULL) {
  ------------------
  |  Branch (243:17): [True: 0, False: 0]
  ------------------
  244|       |                /* Separate malloc failures, loop to release what we have
  245|       |                 * so far */
  246|      0|                int j;
  247|      0|                for (j = 0; j < i; j++) {
  ------------------
  |  Branch (247:29): [True: 0, False: 0]
  ------------------
  248|      0|                    PORT_Free(attr[j].pValue);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  249|       |                    /* don't give the caller pointers to freed memory */
  250|      0|                    attr[j].pValue = NULL;
  251|      0|                }
  252|      0|                PK11_ExitSlotMonitor(slot);
  253|      0|                return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  254|      0|            }
  255|      0|        }
  256|  38.0k|    }
  257|       |
  258|       |    /*
  259|       |     * finally get the results.
  260|       |     */
  261|  9.19k|    crv = PK11_GETTAB(slot)->C_GetAttributeValue(slot->session, obj, attr, count);
  ------------------
  |  |  102|  9.19k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  262|  9.19k|    PK11_ExitSlotMonitor(slot);
  263|  9.19k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.19k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (263:9): [True: 0, False: 9.19k]
  ------------------
  264|      0|        if (arena) {
  ------------------
  |  Branch (264:13): [True: 0, False: 0]
  ------------------
  265|      0|            PORT_ArenaRelease(arena, mark);
  ------------------
  |  |   56|      0|#define PORT_ArenaRelease PORT_ArenaRelease_Util
  ------------------
  266|      0|        } else {
  267|      0|            for (i = 0; i < count; i++) {
  ------------------
  |  Branch (267:25): [True: 0, False: 0]
  ------------------
  268|      0|                PORT_Free(attr[i].pValue);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  269|       |                /* don't give the caller pointers to freed memory */
  270|      0|                attr[i].pValue = NULL;
  271|      0|            }
  272|      0|        }
  273|  9.19k|    } else if (arena && mark) {
  ------------------
  |  Branch (273:16): [True: 9.19k, False: 0]
  |  Branch (273:25): [True: 9.19k, False: 0]
  ------------------
  274|  9.19k|        PORT_ArenaUnmark(arena, mark);
  ------------------
  |  |   58|  9.19k|#define PORT_ArenaUnmark PORT_ArenaUnmark_Util
  ------------------
  275|  9.19k|    }
  276|  9.19k|    return crv;
  277|  9.19k|}
PK11_IsPermObject:
  281|  12.7k|{
  282|  12.7k|    return (PRBool)PK11_HasAttributeSet(slot, handle, CKA_TOKEN, PR_FALSE);
  ------------------
  |  |  512|  12.7k|#define CKA_TOKEN 0x00000001UL
  ------------------
                  return (PRBool)PK11_HasAttributeSet(slot, handle, CKA_TOKEN, PR_FALSE);
  ------------------
  |  |  438|  12.7k|#define PR_FALSE 0
  ------------------
  283|  12.7k|}
pk11_SignedToUnsigned:
  341|  9.52k|{
  342|  9.52k|    char *ptr = (char *)attrib->pValue;
  343|  9.52k|    unsigned long len = attrib->ulValueLen;
  344|       |
  345|  9.52k|    while ((len > 1) && (*ptr == 0)) {
  ------------------
  |  Branch (345:12): [True: 9.15k, False: 370]
  |  Branch (345:25): [True: 0, False: 9.15k]
  ------------------
  346|      0|        len--;
  347|      0|        ptr++;
  348|      0|    }
  349|  9.52k|    attrib->pValue = ptr;
  350|  9.52k|    attrib->ulValueLen = len;
  351|  9.52k|}
pk11_GetNewSession:
  359|  50.4k|{
  360|  50.4k|    CK_SESSION_HANDLE session;
  361|  50.4k|    *owner = PR_TRUE;
  ------------------
  |  |  437|  50.4k|#define PR_TRUE 1
  ------------------
  362|  50.4k|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (362:9): [True: 0, False: 50.4k]
  ------------------
  363|      0|        PK11_EnterSlotMonitor(slot);
  364|  50.4k|    if (PK11_GETTAB(slot)->C_OpenSession(slot->slotID, CKF_SERIAL_SESSION,
  ------------------
  |  |  102|  50.4k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
                  if (PK11_GETTAB(slot)->C_OpenSession(slot->slotID, CKF_SERIAL_SESSION,
  ------------------
  |  |  303|  50.4k|#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */
  ------------------
  |  Branch (364:9): [True: 0, False: 50.4k]
  ------------------
  365|  50.4k|                                         slot, pk11_notify, &session) != CKR_OK) {
  ------------------
  |  | 1388|  50.4k|#define CKR_OK 0x00000000UL
  ------------------
  366|      0|        *owner = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  367|      0|        session = slot->session;
  368|      0|    }
  369|  50.4k|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (369:9): [True: 0, False: 50.4k]
  ------------------
  370|      0|        PK11_ExitSlotMonitor(slot);
  371|       |
  372|  50.4k|    return session;
  373|  50.4k|}
pk11_CloseSession:
  377|  50.4k|{
  378|  50.4k|    if (!owner)
  ------------------
  |  Branch (378:9): [True: 4, False: 50.4k]
  ------------------
  379|      4|        return;
  380|  50.4k|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (380:9): [True: 0, False: 50.4k]
  ------------------
  381|      0|        PK11_EnterSlotMonitor(slot);
  382|  50.4k|    (void)PK11_GETTAB(slot)->C_CloseSession(session);
  ------------------
  |  |  102|  50.4k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  383|  50.4k|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (383:9): [True: 0, False: 50.4k]
  ------------------
  384|      0|        PK11_ExitSlotMonitor(slot);
  385|  50.4k|}
PK11_CreateNewObject:
  391|  6.68k|{
  392|  6.68k|    CK_SESSION_HANDLE rwsession;
  393|  6.68k|    CK_RV crv;
  394|  6.68k|    SECStatus rv = SECSuccess;
  395|       |
  396|  6.68k|    rwsession = session;
  397|  6.68k|    if (token) {
  ------------------
  |  Branch (397:9): [True: 0, False: 6.68k]
  ------------------
  398|      0|        rwsession = PK11_GetRWSession(slot);
  399|  6.68k|    } else if (rwsession == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  6.68k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (399:16): [True: 4.16k, False: 2.52k]
  ------------------
  400|  4.16k|        rwsession = slot->session;
  401|  4.16k|        if (rwsession != CK_INVALID_HANDLE)
  ------------------
  |  |   78|  4.16k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (401:13): [True: 4.16k, False: 0]
  ------------------
  402|  4.16k|            PK11_EnterSlotMonitor(slot);
  403|  4.16k|    }
  404|  6.68k|    if (rwsession == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  6.68k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (404:9): [True: 0, False: 6.68k]
  ------------------
  405|      0|        PORT_SetError(SEC_ERROR_BAD_DATA);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  406|      0|        return SECFailure;
  407|      0|    }
  408|  6.68k|    crv = PK11_GETTAB(slot)->C_CreateObject(rwsession,
  ------------------
  |  |  102|  6.68k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  409|  6.68k|                                            /* cast away const :-( */ (CK_ATTRIBUTE_PTR)theTemplate,
  410|  6.68k|                                            count, objectID);
  411|  6.68k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  6.68k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (411:9): [True: 571, False: 6.11k]
  ------------------
  412|    571|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|    571|#define PORT_SetError PORT_SetError_Util
  ------------------
  413|    571|        rv = SECFailure;
  414|    571|    }
  415|  6.68k|    if (token) {
  ------------------
  |  Branch (415:9): [True: 0, False: 6.68k]
  ------------------
  416|      0|        PK11_RestoreROSession(slot, rwsession);
  417|  6.68k|    } else if (session == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  6.68k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (417:16): [True: 4.16k, False: 2.52k]
  ------------------
  418|  4.16k|        PK11_ExitSlotMonitor(slot);
  419|  4.16k|    }
  420|       |
  421|  6.68k|    return rv;
  422|  6.68k|}
pk11_OpFlagsToAttributes:
  427|  22.8k|{
  428|       |
  429|  22.8k|    const static CK_ATTRIBUTE_TYPE attrTypes[12] = {
  430|  22.8k|        CKA_ENCRYPT, CKA_DECRYPT, 0 /* DIGEST */, CKA_SIGN,
  ------------------
  |  |  547|  22.8k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
                      CKA_ENCRYPT, CKA_DECRYPT, 0 /* DIGEST */, CKA_SIGN,
  ------------------
  |  |  548|  22.8k|#define CKA_DECRYPT 0x00000105UL
  ------------------
                      CKA_ENCRYPT, CKA_DECRYPT, 0 /* DIGEST */, CKA_SIGN,
  ------------------
  |  |  551|  22.8k|#define CKA_SIGN 0x00000108UL
  ------------------
  431|  22.8k|        CKA_SIGN_RECOVER, CKA_VERIFY, CKA_VERIFY_RECOVER, 0 /* GEN */,
  ------------------
  |  |  552|  22.8k|#define CKA_SIGN_RECOVER 0x00000109UL
  ------------------
                      CKA_SIGN_RECOVER, CKA_VERIFY, CKA_VERIFY_RECOVER, 0 /* GEN */,
  ------------------
  |  |  553|  22.8k|#define CKA_VERIFY 0x0000010AUL
  ------------------
                      CKA_SIGN_RECOVER, CKA_VERIFY, CKA_VERIFY_RECOVER, 0 /* GEN */,
  ------------------
  |  |  554|  22.8k|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
  432|  22.8k|        0 /* GEN PAIR */, CKA_WRAP, CKA_UNWRAP, CKA_DERIVE
  ------------------
  |  |  549|  22.8k|#define CKA_WRAP 0x00000106UL
  ------------------
                      0 /* GEN PAIR */, CKA_WRAP, CKA_UNWRAP, CKA_DERIVE
  ------------------
  |  |  550|  22.8k|#define CKA_UNWRAP 0x00000107UL
  ------------------
                      0 /* GEN PAIR */, CKA_WRAP, CKA_UNWRAP, CKA_DERIVE
  ------------------
  |  |  555|  22.8k|#define CKA_DERIVE 0x0000010CUL
  ------------------
  433|  22.8k|    };
  434|       |
  435|  22.8k|    const CK_ATTRIBUTE_TYPE *pType = attrTypes;
  436|  22.8k|    CK_ATTRIBUTE *attr = attrs;
  437|  22.8k|    CK_FLAGS test = CKF_ENCRYPT;
  ------------------
  |  | 1353|  22.8k|#define CKF_ENCRYPT 0x00000100UL
  ------------------
  438|       |
  439|  22.8k|    PR_ASSERT(!(flags & ~CKF_KEY_OPERATION_FLAGS));
  ------------------
  |  |  208|  22.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 22.8k, False: 0]
  |  |  ------------------
  ------------------
  440|  22.8k|    flags &= CKF_KEY_OPERATION_FLAGS;
  ------------------
  |  |  203|  22.8k|#define CKF_KEY_OPERATION_FLAGS 0x000e7b00UL
  ------------------
  441|       |
  442|   143k|    for (; flags && test <= CKF_DERIVE; test <<= 1, ++pType) {
  ------------------
  |  | 1364|   120k|#define CKF_DERIVE 0x00080000UL
  ------------------
  |  Branch (442:12): [True: 120k, False: 22.8k]
  |  Branch (442:21): [True: 120k, False: 0]
  ------------------
  443|   120k|        if (test & flags) {
  ------------------
  |  Branch (443:13): [True: 43.9k, False: 76.4k]
  ------------------
  444|  43.9k|            flags ^= test;
  445|  43.9k|            PR_ASSERT(*pType);
  ------------------
  |  |  208|  43.9k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 43.9k, False: 0]
  |  |  ------------------
  ------------------
  446|  43.9k|            PK11_SETATTRS(attr, *pType, ckTrue, sizeof *ckTrue);
  ------------------
  |  |  104|  43.9k|    (x)->type = (id);              \
  |  |  105|  43.9k|    (x)->pValue = (v);             \
  |  |  106|  43.9k|    (x)->ulValueLen = (l);
  ------------------
  447|  43.9k|            ++attr;
  448|  43.9k|        }
  449|   120k|    }
  450|  22.8k|    return (attr - attrs);
  451|  22.8k|}
pk11_BadAttrFlags:
  459|  41.1k|{
  460|  41.1k|    PK11AttrFlags trueFlags = attrFlags & 0x55555555;
  461|  41.1k|    PK11AttrFlags falseFlags = (attrFlags >> 1) & 0x55555555;
  462|  41.1k|    return ((trueFlags & falseFlags) != 0);
  463|  41.1k|}
pk11_AttrFlagsToAttributes:
  472|  25.5k|{
  473|  25.5k|    const static CK_ATTRIBUTE_TYPE attrTypes[5] = {
  474|  25.5k|        CKA_TOKEN, CKA_PRIVATE, CKA_MODIFIABLE, CKA_SENSITIVE,
  ------------------
  |  |  512|  25.5k|#define CKA_TOKEN 0x00000001UL
  ------------------
                      CKA_TOKEN, CKA_PRIVATE, CKA_MODIFIABLE, CKA_SENSITIVE,
  ------------------
  |  |  513|  25.5k|#define CKA_PRIVATE 0x00000002UL
  ------------------
                      CKA_TOKEN, CKA_PRIVATE, CKA_MODIFIABLE, CKA_SENSITIVE,
  ------------------
  |  |  593|  25.5k|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
                      CKA_TOKEN, CKA_PRIVATE, CKA_MODIFIABLE, CKA_SENSITIVE,
  ------------------
  |  |  546|  25.5k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
  475|  25.5k|        CKA_EXTRACTABLE
  ------------------
  |  |  585|  25.5k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
  476|  25.5k|    };
  477|       |
  478|  25.5k|    const CK_ATTRIBUTE_TYPE *pType = attrTypes;
  479|  25.5k|    CK_ATTRIBUTE *attr = attrs;
  480|  25.5k|    PK11AttrFlags test = PK11_ATTR_TOKEN;
  ------------------
  |  |  194|  25.5k|#define PK11_ATTR_TOKEN 0x00000001L
  ------------------
  481|       |
  482|  25.5k|    PR_ASSERT(!pk11_BadAttrFlags(attrFlags));
  ------------------
  |  |  208|  25.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 25.5k, False: 0]
  |  |  ------------------
  ------------------
  483|       |
  484|       |    /* we test two related bitflags in each iteration */
  485|  74.8k|    for (; attrFlags && test <= PK11_ATTR_EXTRACTABLE; test <<= 2, ++pType) {
  ------------------
  |  |  278|  49.3k|#define PK11_ATTR_EXTRACTABLE 0x00000100L
  ------------------
  |  Branch (485:12): [True: 49.3k, False: 25.5k]
  |  Branch (485:25): [True: 49.3k, False: 0]
  ------------------
  486|  49.3k|        if (test & attrFlags) {
  ------------------
  |  Branch (486:13): [True: 680, False: 48.6k]
  ------------------
  487|    680|            attrFlags ^= test;
  488|    680|            PK11_SETATTRS(attr, *pType, ckTrue, sizeof *ckTrue);
  ------------------
  |  |  104|    680|    (x)->type = (id);              \
  |  |  105|    680|    (x)->pValue = (v);             \
  |  |  106|    680|    (x)->ulValueLen = (l);
  ------------------
  489|    680|            ++attr;
  490|  48.6k|        } else if ((test << 1) & attrFlags) {
  ------------------
  |  Branch (490:20): [True: 38.8k, False: 9.87k]
  ------------------
  491|  38.8k|            attrFlags ^= (test << 1);
  492|  38.8k|            PK11_SETATTRS(attr, *pType, ckFalse, sizeof *ckFalse);
  ------------------
  |  |  104|  38.8k|    (x)->type = (id);              \
  |  |  105|  38.8k|    (x)->pValue = (v);             \
  |  |  106|  38.8k|    (x)->ulValueLen = (l);
  ------------------
  493|  38.8k|            ++attr;
  494|  38.8k|        }
  495|  49.3k|    }
  496|  25.5k|    return (attr - attrs);
  497|  25.5k|}
pk11_FindAttrInTemplate:
  622|  90.0k|{
  623|   218k|    for (; numAttrs > 0; ++attr, --numAttrs) {
  ------------------
  |  Branch (623:12): [True: 127k, False: 90.0k]
  ------------------
  624|   127k|        if (attr->type == target)
  ------------------
  |  Branch (624:13): [True: 0, False: 127k]
  ------------------
  625|      0|            return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  626|   127k|    }
  627|  90.0k|    return PR_FALSE;
  ------------------
  |  |  438|  90.0k|#define PR_FALSE 0
  ------------------
  628|  90.0k|}
PK11_VerifyRecover:
  637|    624|{
  638|    624|    PK11SlotInfo *slot = key->pkcs11Slot;
  639|    624|    CK_OBJECT_HANDLE id = key->pkcs11ID;
  640|    624|    CK_MECHANISM mech = { 0, NULL, 0 };
  641|    624|    PRBool owner = PR_TRUE;
  ------------------
  |  |  437|    624|#define PR_TRUE 1
  ------------------
  642|    624|    CK_SESSION_HANDLE session;
  643|    624|    CK_ULONG len;
  644|    624|    CK_RV crv;
  645|       |
  646|    624|    mech.mechanism = PK11_MapSignKeyType(key->keyType);
  647|       |
  648|    624|    if (slot == NULL) {
  ------------------
  |  Branch (648:9): [True: 81, False: 543]
  ------------------
  649|     81|        slot = PK11_GetBestSlotWithAttributes(mech.mechanism,
  650|     81|                                              CKF_VERIFY_RECOVER, 0, wincx);
  ------------------
  |  | 1359|     81|#define CKF_VERIFY_RECOVER 0x00004000UL
  ------------------
  651|     81|        if (slot == NULL) {
  ------------------
  |  Branch (651:13): [True: 0, False: 81]
  ------------------
  652|      0|            PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  653|      0|            return SECFailure;
  654|      0|        }
  655|     81|        id = PK11_ImportPublicKey(slot, key, PR_FALSE);
  ------------------
  |  |  438|     81|#define PR_FALSE 0
  ------------------
  656|    543|    } else {
  657|    543|        PK11_ReferenceSlot(slot);
  658|    543|    }
  659|       |
  660|    624|    if (id == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|    624|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (660:9): [True: 81, False: 543]
  ------------------
  661|     81|        PK11_FreeSlot(slot);
  662|     81|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|     81|#define PORT_SetError PORT_SetError_Util
  ------------------
  663|     81|        return SECFailure;
  664|     81|    }
  665|       |
  666|    543|    session = pk11_GetNewSession(slot, &owner);
  667|    543|    if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (667:9): [True: 0, False: 543]
  |  Branch (667:19): [True: 0, False: 543]
  ------------------
  668|      0|        PK11_EnterSlotMonitor(slot);
  669|    543|    crv = PK11_GETTAB(slot)->C_VerifyRecoverInit(session, &mech, id);
  ------------------
  |  |  102|    543|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  670|    543|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|    543|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (670:9): [True: 0, False: 543]
  ------------------
  671|      0|        if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (671:13): [True: 0, False: 0]
  |  Branch (671:23): [True: 0, False: 0]
  ------------------
  672|      0|            PK11_ExitSlotMonitor(slot);
  673|      0|        pk11_CloseSession(slot, session, owner);
  674|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  675|      0|        PK11_FreeSlot(slot);
  676|      0|        return SECFailure;
  677|      0|    }
  678|    543|    len = dsig->len;
  679|    543|    crv = PK11_GETTAB(slot)->C_VerifyRecover(session, sig->data,
  ------------------
  |  |  102|    543|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  680|    543|                                             sig->len, dsig->data, &len);
  681|    543|    if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (681:9): [True: 0, False: 543]
  |  Branch (681:19): [True: 0, False: 543]
  ------------------
  682|      0|        PK11_ExitSlotMonitor(slot);
  683|    543|    pk11_CloseSession(slot, session, owner);
  684|    543|    dsig->len = len;
  685|    543|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|    543|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (685:9): [True: 534, False: 9]
  ------------------
  686|    534|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|    534|#define PORT_SetError PORT_SetError_Util
  ------------------
  687|    534|        PK11_FreeSlot(slot);
  688|    534|        return SECFailure;
  689|    534|    }
  690|      9|    PK11_FreeSlot(slot);
  691|      9|    return SECSuccess;
  692|    543|}
PK11_Verify:
  700|    130|{
  701|    130|    CK_MECHANISM_TYPE mech = PK11_MapSignKeyType(key->keyType);
  702|    130|    return PK11_VerifyWithMechanism(key, mech, NULL, sig, hash, wincx);
  703|    130|}
PK11_VerifyWithMechanism:
  712|  2.17k|{
  713|  2.17k|    PK11SlotInfo *slot = key->pkcs11Slot;
  714|  2.17k|    CK_OBJECT_HANDLE id = key->pkcs11ID;
  715|  2.17k|    CK_MECHANISM mech = { 0, NULL, 0 };
  716|  2.17k|    PRBool owner = PR_TRUE;
  ------------------
  |  |  437|  2.17k|#define PR_TRUE 1
  ------------------
  717|  2.17k|    CK_SESSION_HANDLE session;
  718|  2.17k|    CK_RV crv;
  719|       |
  720|  2.17k|    mech.mechanism = mechanism;
  721|  2.17k|    if (param) {
  ------------------
  |  Branch (721:9): [True: 1.08k, False: 1.09k]
  ------------------
  722|  1.08k|        mech.pParameter = param->data;
  723|  1.08k|        mech.ulParameterLen = param->len;
  724|  1.08k|    }
  725|       |
  726|  2.17k|    if (slot == NULL) {
  ------------------
  |  Branch (726:9): [True: 2.09k, False: 79]
  ------------------
  727|  2.09k|        unsigned int length = 0;
  728|  2.09k|        if ((mech.mechanism == CKM_DSA) &&
  ------------------
  |  |  745|  2.09k|#define CKM_DSA 0x00000011UL
  ------------------
  |  Branch (728:13): [True: 915, False: 1.18k]
  ------------------
  729|       |            /* 129 is 1024 bits translated to bytes and
  730|       |             * padded with an optional '0' to maintain a
  731|       |             * positive sign */
  732|  2.09k|            (key->u.dsa.params.prime.len > 129)) {
  ------------------
  |  Branch (732:13): [True: 915, False: 0]
  ------------------
  733|       |            /* we need to get a slot that not only can do DSA, but can do DSA2
  734|       |             * key lengths */
  735|    915|            length = key->u.dsa.params.prime.len;
  736|    915|            if (key->u.dsa.params.prime.data[0] == 0) {
  ------------------
  |  Branch (736:17): [True: 0, False: 915]
  ------------------
  737|      0|                length--;
  738|      0|            }
  739|       |            /* convert keysize to bits for slot lookup */
  740|    915|            length *= 8;
  741|    915|        }
  742|  2.09k|        slot = PK11_GetBestSlotWithAttributes(mech.mechanism,
  743|  2.09k|                                              CKF_VERIFY, length, wincx);
  ------------------
  |  | 1358|  2.09k|#define CKF_VERIFY 0x00002000
  ------------------
  744|  2.09k|        if (slot == NULL) {
  ------------------
  |  Branch (744:13): [True: 0, False: 2.09k]
  ------------------
  745|      0|            PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  746|      0|            return SECFailure;
  747|      0|        }
  748|  2.09k|        id = PK11_ImportPublicKey(slot, key, PR_FALSE);
  ------------------
  |  |  438|  2.09k|#define PR_FALSE 0
  ------------------
  749|       |
  750|  2.09k|    } else {
  751|     79|        PK11_ReferenceSlot(slot);
  752|     79|    }
  753|       |
  754|  2.17k|    if (id == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  2.17k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (754:9): [True: 225, False: 1.95k]
  ------------------
  755|    225|        PK11_FreeSlot(slot);
  756|    225|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|    225|#define PORT_SetError PORT_SetError_Util
  ------------------
  757|    225|        return SECFailure;
  758|    225|    }
  759|       |
  760|  1.95k|    session = pk11_GetNewSession(slot, &owner);
  761|  1.95k|    if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (761:9): [True: 0, False: 1.95k]
  |  Branch (761:19): [True: 0, False: 1.95k]
  ------------------
  762|      0|        PK11_EnterSlotMonitor(slot);
  763|  1.95k|    crv = PK11_GETTAB(slot)->C_VerifyInit(session, &mech, id);
  ------------------
  |  |  102|  1.95k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  764|  1.95k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.95k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (764:9): [True: 0, False: 1.95k]
  ------------------
  765|      0|        if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (765:13): [True: 0, False: 0]
  |  Branch (765:23): [True: 0, False: 0]
  ------------------
  766|      0|            PK11_ExitSlotMonitor(slot);
  767|      0|        pk11_CloseSession(slot, session, owner);
  768|      0|        PK11_FreeSlot(slot);
  769|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  770|      0|        return SECFailure;
  771|      0|    }
  772|  1.95k|    crv = PK11_GETTAB(slot)->C_Verify(session, hash->data,
  ------------------
  |  |  102|  1.95k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  773|  1.95k|                                      hash->len, sig->data, sig->len);
  774|  1.95k|    if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (774:9): [True: 0, False: 1.95k]
  |  Branch (774:19): [True: 0, False: 1.95k]
  ------------------
  775|      0|        PK11_ExitSlotMonitor(slot);
  776|  1.95k|    pk11_CloseSession(slot, session, owner);
  777|  1.95k|    PK11_FreeSlot(slot);
  778|  1.95k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.95k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (778:9): [True: 1.95k, False: 0]
  ------------------
  779|  1.95k|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|  1.95k|#define PORT_SetError PORT_SetError_Util
  ------------------
  780|  1.95k|        return SECFailure;
  781|  1.95k|    }
  782|      0|    return SECSuccess;
  783|  1.95k|}
PK11_UnlinkGenericObject:
 1567|  1.68k|{
 1568|  1.68k|    if (object->prev != NULL) {
  ------------------
  |  Branch (1568:9): [True: 0, False: 1.68k]
  ------------------
 1569|      0|        object->prev->next = object->next;
 1570|      0|    }
 1571|  1.68k|    if (object->next != NULL) {
  ------------------
  |  Branch (1571:9): [True: 0, False: 1.68k]
  ------------------
 1572|      0|        object->next->prev = object->prev;
 1573|      0|    }
 1574|       |
 1575|  1.68k|    object->next = NULL;
 1576|  1.68k|    object->prev = NULL;
 1577|  1.68k|    return SECSuccess;
 1578|  1.68k|}
PK11_DestroyGenericObject:
 1587|  1.68k|{
 1588|  1.68k|    if (object == NULL) {
  ------------------
  |  Branch (1588:9): [True: 0, False: 1.68k]
  ------------------
 1589|      0|        return SECSuccess;
 1590|      0|    }
 1591|       |
 1592|  1.68k|    PK11_UnlinkGenericObject(object);
 1593|  1.68k|    if (object->slot) {
  ------------------
  |  Branch (1593:9): [True: 1.68k, False: 0]
  ------------------
 1594|  1.68k|        if (object->owner) {
  ------------------
  |  Branch (1594:13): [True: 0, False: 1.68k]
  ------------------
 1595|      0|            PK11_DestroyObject(object->slot, object->objectID);
 1596|      0|        }
 1597|  1.68k|        PK11_FreeSlot(object->slot);
 1598|  1.68k|    }
 1599|  1.68k|    PORT_Free(object);
  ------------------
  |  |   60|  1.68k|#define PORT_Free PORT_Free_Util
  ------------------
 1600|  1.68k|    return SECSuccess;
 1601|  1.68k|}
pk11_CreateGenericObjectHelper:
 1641|  1.68k|{
 1642|  1.68k|    CK_OBJECT_HANDLE objectID;
 1643|  1.68k|    PK11GenericObject *obj;
 1644|  1.68k|    CK_RV crv;
 1645|       |
 1646|  1.68k|    PK11_EnterSlotMonitor(slot);
 1647|  1.68k|    crv = PK11_CreateNewObject(slot, slot->session, pTemplate, count,
 1648|  1.68k|                               token, &objectID);
 1649|  1.68k|    PK11_ExitSlotMonitor(slot);
 1650|  1.68k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.68k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1650:9): [True: 0, False: 1.68k]
  ------------------
 1651|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1652|      0|        return NULL;
 1653|      0|    }
 1654|       |
 1655|  1.68k|    obj = PORT_New(PK11GenericObject);
  ------------------
  |  |  151|  1.68k|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|  1.68k|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
 1656|  1.68k|    if (!obj) {
  ------------------
  |  Branch (1656:9): [True: 0, False: 1.68k]
  ------------------
 1657|       |        /* error set by PORT_New */
 1658|      0|        return NULL;
 1659|      0|    }
 1660|       |
 1661|       |    /* initialize it */
 1662|  1.68k|    obj->slot = PK11_ReferenceSlot(slot);
 1663|  1.68k|    obj->objectID = objectID;
 1664|  1.68k|    obj->owner = owner;
 1665|  1.68k|    obj->next = NULL;
 1666|  1.68k|    obj->prev = NULL;
 1667|  1.68k|    return obj;
 1668|  1.68k|}
PK11_CreateGenericObject:
 1681|  1.68k|{
 1682|  1.68k|    return pk11_CreateGenericObjectHelper(slot, pTemplate, count, token,
 1683|  1.68k|                                          PR_FALSE);
  ------------------
  |  |  438|  1.68k|#define PR_FALSE 0
  ------------------
 1684|  1.68k|}
PK11_GetObjectHandle:
 1701|  1.68k|{
 1702|  1.68k|    CK_OBJECT_HANDLE handle = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  1.68k|#define CK_INVALID_HANDLE 0
  ------------------
 1703|  1.68k|    PK11SlotInfo *slot = NULL;
 1704|       |
 1705|  1.68k|    switch (objType) {
 1706|  1.68k|        case PK11_TypeGeneric:
  ------------------
  |  Branch (1706:9): [True: 1.68k, False: 0]
  ------------------
 1707|  1.68k|            slot = ((PK11GenericObject *)objSpec)->slot;
 1708|  1.68k|            handle = ((PK11GenericObject *)objSpec)->objectID;
 1709|  1.68k|            break;
 1710|      0|        case PK11_TypePrivKey:
  ------------------
  |  Branch (1710:9): [True: 0, False: 1.68k]
  ------------------
 1711|      0|            slot = ((SECKEYPrivateKey *)objSpec)->pkcs11Slot;
 1712|      0|            handle = ((SECKEYPrivateKey *)objSpec)->pkcs11ID;
 1713|      0|            break;
 1714|      0|        case PK11_TypePubKey:
  ------------------
  |  Branch (1714:9): [True: 0, False: 1.68k]
  ------------------
 1715|      0|            slot = ((SECKEYPublicKey *)objSpec)->pkcs11Slot;
 1716|      0|            handle = ((SECKEYPublicKey *)objSpec)->pkcs11ID;
 1717|      0|            break;
 1718|      0|        case PK11_TypeSymKey:
  ------------------
  |  Branch (1718:9): [True: 0, False: 1.68k]
  ------------------
 1719|      0|            slot = ((PK11SymKey *)objSpec)->slot;
 1720|      0|            handle = ((PK11SymKey *)objSpec)->objectID;
 1721|      0|            break;
 1722|      0|        case PK11_TypeCert:
  ------------------
  |  Branch (1722:9): [True: 0, False: 1.68k]
  ------------------
 1723|      0|            handle = PK11_FindObjectForCert((CERTCertificate *)objSpec, NULL,
 1724|      0|                                            &slot);
 1725|      0|            break;
 1726|      0|        default:
  ------------------
  |  Branch (1726:9): [True: 0, False: 1.68k]
  ------------------
 1727|      0|            PORT_SetError(SEC_ERROR_UNKNOWN_OBJECT_TYPE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1728|      0|            break;
 1729|  1.68k|    }
 1730|  1.68k|    if (slotp) {
  ------------------
  |  Branch (1730:9): [True: 0, False: 1.68k]
  ------------------
 1731|      0|        *slotp = slot;
 1732|      0|    }
 1733|       |    /* paranoia. If the object doesn't have a slot, then it's handle isn't
 1734|       |     * valid either */
 1735|  1.68k|    if (slot == NULL) {
  ------------------
  |  Branch (1735:9): [True: 0, False: 1.68k]
  ------------------
 1736|      0|        handle = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
 1737|      0|    }
 1738|  1.68k|    return handle;
 1739|  1.68k|}
pk11_FindObjectByTemplate:
 1866|      2|{
 1867|      2|    CK_OBJECT_HANDLE object;
 1868|      2|    CK_RV crv = CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      2|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 1869|      2|    CK_ULONG objectCount;
 1870|       |
 1871|       |    /*
 1872|       |     * issue the find
 1873|       |     */
 1874|      2|    PK11_EnterSlotMonitor(slot);
 1875|      2|    if (slot->session != CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      2|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1875:9): [True: 2, False: 0]
  ------------------
 1876|      2|        crv = PK11_GETTAB(slot)->C_FindObjectsInit(slot->session,
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1877|      2|                                                   theTemplate, tsize);
 1878|      2|    }
 1879|      2|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1879:9): [True: 0, False: 2]
  ------------------
 1880|      0|        PK11_ExitSlotMonitor(slot);
 1881|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1882|      0|        return CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
 1883|      0|    }
 1884|       |
 1885|      2|    crv = PK11_GETTAB(slot)->C_FindObjects(slot->session, &object, 1, &objectCount);
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1886|      2|    PK11_GETTAB(slot)->C_FindObjectsFinal(slot->session);
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1887|      2|    PK11_ExitSlotMonitor(slot);
 1888|      2|    if ((crv != CKR_OK) || (objectCount < 1)) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1888:9): [True: 0, False: 2]
  |  Branch (1888:28): [True: 2, False: 0]
  ------------------
 1889|       |        /* shouldn't use SSL_ERROR... here */
 1890|      2|        PORT_SetError(crv != CKR_OK ? PK11_MapError(crv) : SSL_ERROR_NO_CERTIFICATE);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(crv != CKR_OK ? PK11_MapError(crv) : SSL_ERROR_NO_CERTIFICATE);
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1890:23): [True: 0, False: 2]
  ------------------
 1891|      2|        return CK_INVALID_HANDLE;
  ------------------
  |  |   78|      2|#define CK_INVALID_HANDLE 0
  ------------------
 1892|      2|    }
 1893|       |
 1894|       |    /* blow up if the PKCS #11 module returns us and invalid object handle */
 1895|      0|    PORT_Assert(object != CK_INVALID_HANDLE);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1896|      0|    return object;
 1897|      2|}
pk11_FindObjectsByTemplate:
 1905|      2|{
 1906|      2|    CK_OBJECT_HANDLE *objID = NULL;
 1907|      2|    CK_ULONG returned_count = 0;
 1908|      2|    PRBool owner = PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 1909|      2|    CK_SESSION_HANDLE session;
 1910|      2|    PRBool haslock = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 1911|      2|    CK_RV crv = CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      2|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 1912|       |
 1913|      2|    session = pk11_GetNewSession(slot, &owner);
 1914|      2|    haslock = (!owner || !(slot->isThreadSafe));
  ------------------
  |  Branch (1914:16): [True: 0, False: 2]
  |  Branch (1914:26): [True: 0, False: 2]
  ------------------
 1915|      2|    if (haslock) {
  ------------------
  |  Branch (1915:9): [True: 0, False: 2]
  ------------------
 1916|      0|        PK11_EnterSlotMonitor(slot);
 1917|      0|    }
 1918|      2|    if (session != CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      2|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1918:9): [True: 2, False: 0]
  ------------------
 1919|      2|        crv = PK11_GETTAB(slot)->C_FindObjectsInit(session,
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1920|      2|                                                   findTemplate, templCount);
 1921|      2|    }
 1922|      2|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1922:9): [True: 0, False: 2]
  ------------------
 1923|      0|        if (haslock)
  ------------------
  |  Branch (1923:13): [True: 0, False: 0]
  ------------------
 1924|      0|            PK11_ExitSlotMonitor(slot);
 1925|      0|        pk11_CloseSession(slot, session, owner);
 1926|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1927|      0|        *object_count = -1;
 1928|      0|        return NULL;
 1929|      0|    }
 1930|       |
 1931|       |    /*
 1932|       |     * collect all the Matching Objects
 1933|       |     */
 1934|      2|    do {
 1935|      2|        CK_OBJECT_HANDLE *oldObjID = objID;
 1936|       |
 1937|      2|        if (objID == NULL) {
  ------------------
  |  Branch (1937:13): [True: 2, False: 0]
  ------------------
 1938|      2|            objID = (CK_OBJECT_HANDLE *)PORT_Alloc(sizeof(CK_OBJECT_HANDLE) *
  ------------------
  |  |   52|      2|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1939|      2|                                                   (*object_count + PK11_SEARCH_CHUNKSIZE));
  ------------------
  |  |   23|      2|#define PK11_SEARCH_CHUNKSIZE 10
  ------------------
 1940|      2|        } else {
 1941|      0|            objID = (CK_OBJECT_HANDLE *)PORT_Realloc(objID,
  ------------------
  |  |   64|      0|#define PORT_Realloc PORT_Realloc_Util
  ------------------
 1942|      0|                                                     sizeof(CK_OBJECT_HANDLE) * (*object_count + PK11_SEARCH_CHUNKSIZE));
  ------------------
  |  |   23|      0|#define PK11_SEARCH_CHUNKSIZE 10
  ------------------
 1943|      0|        }
 1944|       |
 1945|      2|        if (objID == NULL) {
  ------------------
  |  Branch (1945:13): [True: 0, False: 2]
  ------------------
 1946|      0|            if (oldObjID)
  ------------------
  |  Branch (1946:17): [True: 0, False: 0]
  ------------------
 1947|      0|                PORT_Free(oldObjID);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1948|      0|            break;
 1949|      0|        }
 1950|      2|        crv = PK11_GETTAB(slot)->C_FindObjects(session,
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1951|      2|                                               &objID[*object_count], PK11_SEARCH_CHUNKSIZE, &returned_count);
  ------------------
  |  |   23|      2|#define PK11_SEARCH_CHUNKSIZE 10
  ------------------
 1952|      2|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1952:13): [True: 0, False: 2]
  ------------------
 1953|      0|            PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1954|      0|            PORT_Free(objID);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1955|      0|            objID = NULL;
 1956|      0|            break;
 1957|      0|        }
 1958|      2|        *object_count += returned_count;
 1959|      2|    } while (returned_count == PK11_SEARCH_CHUNKSIZE);
  ------------------
  |  |   23|      2|#define PK11_SEARCH_CHUNKSIZE 10
  ------------------
  |  Branch (1959:14): [True: 0, False: 2]
  ------------------
 1960|       |
 1961|      2|    PK11_GETTAB(slot)->C_FindObjectsFinal(session);
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1962|      2|    if (haslock) {
  ------------------
  |  Branch (1962:9): [True: 0, False: 2]
  ------------------
 1963|      0|        PK11_ExitSlotMonitor(slot);
 1964|      0|    }
 1965|      2|    pk11_CloseSession(slot, session, owner);
 1966|       |
 1967|      2|    if (objID && (*object_count == 0)) {
  ------------------
  |  Branch (1967:9): [True: 2, False: 0]
  |  Branch (1967:18): [True: 2, False: 0]
  ------------------
 1968|      2|        PORT_Free(objID);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 1969|      2|        return NULL;
 1970|      2|    }
 1971|      0|    if (objID == NULL)
  ------------------
  |  Branch (1971:9): [True: 0, False: 0]
  ------------------
 1972|      0|        *object_count = -1;
 1973|      0|    return objID;
 1974|      2|}

SECMOD_CreateModuleEx:
 1154|      2|{
 1155|      2|    SECMODModule *mod;
 1156|      2|    SECStatus rv;
 1157|      2|    char *slotParams, *ciphers;
 1158|      2|    PRBool printPolicyFeedback = NSSUTIL_ArgHasFlag("flags", "printPolicyFeedback", nss);
 1159|      2|    PRUint32 policyCheckFlags = secmod_parsePolicyCheckFlags(nss);
 1160|       |
 1161|      2|    rv = secmod_parseCryptoPolicy(config, printPolicyFeedback, policyCheckFlags);
 1162|       |
 1163|       |    /* do not load the module if policy parsing fails */
 1164|      2|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1164:9): [True: 0, False: 2]
  ------------------
 1165|      0|        if (printPolicyFeedback) {
  ------------------
  |  Branch (1165:13): [True: 0, False: 0]
  ------------------
 1166|      0|            PR_SetEnv("NSS_POLICY_FAIL=1");
 1167|      0|            fprintf(stderr, "NSS-POLICY-FAIL: policy config parsing failed, not loading module %s\n", moduleName);
 1168|      0|        }
 1169|      0|        return NULL;
 1170|      0|    }
 1171|       |
 1172|      2|    mod = secmod_NewModule();
 1173|      2|    if (mod == NULL)
  ------------------
  |  Branch (1173:9): [True: 0, False: 2]
  ------------------
 1174|      0|        return NULL;
 1175|       |
 1176|      2|    mod->commonName = PORT_ArenaStrdup(mod->arena, moduleName ? moduleName : "");
  ------------------
  |  |   57|      2|#define PORT_ArenaStrdup PORT_ArenaStrdup_Util
  ------------------
  |  Branch (1176:52): [True: 2, False: 0]
  ------------------
 1177|      2|    if (library) {
  ------------------
  |  Branch (1177:9): [True: 0, False: 2]
  ------------------
 1178|      0|        mod->dllName = PORT_ArenaStrdup(mod->arena, library);
  ------------------
  |  |   57|      0|#define PORT_ArenaStrdup PORT_ArenaStrdup_Util
  ------------------
 1179|      0|    }
 1180|       |    /* new field */
 1181|      2|    if (parameters) {
  ------------------
  |  Branch (1181:9): [True: 2, False: 0]
  ------------------
 1182|      2|        mod->libraryParams = PORT_ArenaStrdup(mod->arena, parameters);
  ------------------
  |  |   57|      2|#define PORT_ArenaStrdup PORT_ArenaStrdup_Util
  ------------------
 1183|      2|    }
 1184|       |
 1185|      2|    mod->internal = NSSUTIL_ArgHasFlag("flags", "internal", nss);
 1186|      2|    mod->isFIPS = NSSUTIL_ArgHasFlag("flags", "FIPS", nss);
 1187|       |    /* if the system FIPS mode is enabled, force FIPS to be on */
 1188|      2|    if (SECMOD_GetSystemFIPSEnabled()) {
  ------------------
  |  Branch (1188:9): [True: 0, False: 2]
  ------------------
 1189|      0|        mod->isFIPS = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1190|      0|    }
 1191|      2|    mod->isCritical = NSSUTIL_ArgHasFlag("flags", "critical", nss);
 1192|      2|    slotParams = NSSUTIL_ArgGetParamValue("slotParams", nss);
 1193|      2|    mod->slotInfo = NSSUTIL_ArgParseSlotInfo(mod->arena, slotParams,
 1194|      2|                                             &mod->slotInfoCount);
 1195|      2|    if (slotParams)
  ------------------
  |  Branch (1195:9): [True: 1, False: 1]
  ------------------
 1196|      1|        PORT_Free(slotParams);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
 1197|       |    /* new field */
 1198|      2|    mod->trustOrder = NSSUTIL_ArgReadLong("trustOrder", nss,
 1199|      2|                                          NSSUTIL_DEFAULT_TRUST_ORDER, NULL);
  ------------------
  |  |   49|      2|#define NSSUTIL_DEFAULT_TRUST_ORDER 50
  ------------------
 1200|       |    /* new field */
 1201|      2|    mod->cipherOrder = NSSUTIL_ArgReadLong("cipherOrder", nss,
 1202|      2|                                           NSSUTIL_DEFAULT_CIPHER_ORDER, NULL);
  ------------------
  |  |   48|      2|#define NSSUTIL_DEFAULT_CIPHER_ORDER 0
  ------------------
 1203|       |    /* new field */
 1204|      2|    mod->isModuleDB = NSSUTIL_ArgHasFlag("flags", "moduleDB", nss);
 1205|      2|    mod->moduleDBOnly = NSSUTIL_ArgHasFlag("flags", "moduleDBOnly", nss);
 1206|      2|    if (mod->moduleDBOnly)
  ------------------
  |  Branch (1206:9): [True: 1, False: 1]
  ------------------
 1207|      1|        mod->isModuleDB = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 1208|       |
 1209|       |    /* we need more bits, but we also want to preserve binary compatibility
 1210|       |     * so we overload the isModuleDB PRBool with additional flags.
 1211|       |     * These flags are only valid if mod->isModuleDB is already set.
 1212|       |     * NOTE: this depends on the fact that PRBool is at least a char on
 1213|       |     * all platforms. These flags are only valid if moduleDB is set, so
 1214|       |     * code checking if (mod->isModuleDB) will continue to work correctly. */
 1215|      2|    if (mod->isModuleDB) {
  ------------------
  |  Branch (1215:9): [True: 1, False: 1]
  ------------------
 1216|      1|        char flags = SECMOD_FLAG_MODULE_DB_IS_MODULE_DB;
  ------------------
  |  |  108|      1|#define SECMOD_FLAG_MODULE_DB_IS_MODULE_DB 0x01 /* must be set if any of the \
  ------------------
 1217|      1|        if (NSSUTIL_ArgHasFlag("flags", "skipFirst", nss)) {
  ------------------
  |  Branch (1217:13): [True: 0, False: 1]
  ------------------
 1218|      0|            flags |= SECMOD_FLAG_MODULE_DB_SKIP_FIRST;
  ------------------
  |  |  110|      0|#define SECMOD_FLAG_MODULE_DB_SKIP_FIRST 0x02
  ------------------
 1219|      0|        }
 1220|      1|        if (NSSUTIL_ArgHasFlag("flags", "defaultModDB", nss)) {
  ------------------
  |  Branch (1220:13): [True: 1, False: 0]
  ------------------
 1221|      1|            flags |= SECMOD_FLAG_MODULE_DB_DEFAULT_MODDB;
  ------------------
  |  |  111|      1|#define SECMOD_FLAG_MODULE_DB_DEFAULT_MODDB 0x04
  ------------------
 1222|      1|        }
 1223|      1|        if (NSSUTIL_ArgHasFlag("flags", "policyOnly", nss)) {
  ------------------
  |  Branch (1223:13): [True: 0, False: 1]
  ------------------
 1224|      0|            flags |= SECMOD_FLAG_MODULE_DB_POLICY_ONLY;
  ------------------
  |  |  112|      0|#define SECMOD_FLAG_MODULE_DB_POLICY_ONLY 0x08
  ------------------
 1225|      0|        }
 1226|       |        /* additional moduleDB flags could be added here in the future */
 1227|      1|        mod->isModuleDB = (PRBool)flags;
 1228|      1|    }
 1229|       |
 1230|      2|    if (mod->internal) {
  ------------------
  |  Branch (1230:9): [True: 2, False: 0]
  ------------------
 1231|      2|        char flags = SECMOD_FLAG_INTERNAL_IS_INTERNAL;
  ------------------
  |  |  126|      2|#define SECMOD_FLAG_INTERNAL_IS_INTERNAL 0x01 /* must be set if any of \
  ------------------
 1232|       |
 1233|      2|        if (NSSUTIL_ArgHasFlag("flags", "internalKeySlot", nss)) {
  ------------------
  |  Branch (1233:13): [True: 1, False: 1]
  ------------------
 1234|      1|            flags |= SECMOD_FLAG_INTERNAL_KEY_SLOT;
  ------------------
  |  |  128|      1|#define SECMOD_FLAG_INTERNAL_KEY_SLOT 0x02
  ------------------
 1235|      1|        }
 1236|      2|        mod->internal = (PRBool)flags;
 1237|      2|    }
 1238|       |
 1239|      2|    ciphers = NSSUTIL_ArgGetParamValue("ciphers", nss);
 1240|      2|    NSSUTIL_ArgParseCipherFlags(&mod->ssl[0], ciphers);
 1241|      2|    if (ciphers)
  ------------------
  |  Branch (1241:9): [True: 0, False: 2]
  ------------------
 1242|      0|        PORT_Free(ciphers);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1243|       |
 1244|      2|    secmod_PrivateModuleCount++;
 1245|       |
 1246|      2|    return mod;
 1247|      2|}
SECMOD_GetSkipFirstFlag:
 1251|      1|{
 1252|      1|    char flags = (char)mod->isModuleDB;
 1253|       |
 1254|      1|    return (flags & SECMOD_FLAG_MODULE_DB_SKIP_FIRST) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  110|      1|#define SECMOD_FLAG_MODULE_DB_SKIP_FIRST 0x02
  ------------------
                  return (flags & SECMOD_FLAG_MODULE_DB_SKIP_FIRST) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                  return (flags & SECMOD_FLAG_MODULE_DB_SKIP_FIRST) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  |  Branch (1254:12): [True: 0, False: 1]
  ------------------
 1255|      1|}
secmod_PolicyOnly:
 1267|      2|{
 1268|      2|    char flags = (char)mod->isModuleDB;
 1269|       |
 1270|      2|    return (flags & SECMOD_FLAG_MODULE_DB_POLICY_ONLY) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  112|      2|#define SECMOD_FLAG_MODULE_DB_POLICY_ONLY 0x08
  ------------------
                  return (flags & SECMOD_FLAG_MODULE_DB_POLICY_ONLY) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                  return (flags & SECMOD_FLAG_MODULE_DB_POLICY_ONLY) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  |  Branch (1270:12): [True: 0, False: 2]
  ------------------
 1271|      2|}
secmod_IsInternalKeySlot:
 1275|      3|{
 1276|      3|    char flags = (char)mod->internal;
 1277|       |
 1278|      3|    return (flags & SECMOD_FLAG_INTERNAL_KEY_SLOT) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  128|      3|#define SECMOD_FLAG_INTERNAL_KEY_SLOT 0x02
  ------------------
                  return (flags & SECMOD_FLAG_INTERNAL_KEY_SLOT) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      3|#define PR_TRUE 1
  ------------------
                  return (flags & SECMOD_FLAG_INTERNAL_KEY_SLOT) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (1278:12): [True: 3, False: 0]
  ------------------
 1279|      3|}
SECMOD_GetModuleSpecList:
 2095|      1|{
 2096|      1|    SECMODModuleDBFunc func = (SECMODModuleDBFunc)module->moduleDBFunc;
 2097|      1|    if (func) {
  ------------------
  |  Branch (2097:9): [True: 1, False: 0]
  ------------------
 2098|      1|        return (*func)(SECMOD_MODULE_DB_FUNCTION_FIND,
  ------------------
  |  |  557|      1|#define SECMOD_MODULE_DB_FUNCTION_FIND 0
  ------------------
 2099|      1|                       module->libraryParams, NULL);
 2100|      1|    }
 2101|      0|    return NULL;
 2102|      1|}
SECMOD_FreeModuleSpecList:
 2150|      1|{
 2151|      1|    SECMODModuleDBFunc func = (SECMODModuleDBFunc)module->moduleDBFunc;
 2152|      1|    char **retString;
 2153|      1|    if (func) {
  ------------------
  |  Branch (2153:9): [True: 1, False: 0]
  ------------------
 2154|      1|        retString = (*func)(SECMOD_MODULE_DB_FUNCTION_RELEASE,
  ------------------
  |  |  560|      1|#define SECMOD_MODULE_DB_FUNCTION_RELEASE 3
  ------------------
 2155|      1|                            module->libraryParams, moduleSpecList);
 2156|      1|        if (retString != NULL)
  ------------------
  |  Branch (2156:13): [True: 1, False: 0]
  ------------------
 2157|      1|            return SECSuccess;
 2158|      1|    }
 2159|      0|    return SECFailure;
 2160|      1|}
SECMOD_LoadModule:
 2167|      2|{
 2168|      2|    char *library = NULL, *moduleName = NULL, *parameters = NULL, *nss = NULL;
 2169|      2|    char *config = NULL;
 2170|      2|    SECStatus status;
 2171|      2|    SECMODModule *module = NULL;
 2172|      2|    SECMODModule *oldModule = NULL;
 2173|      2|    SECStatus rv;
 2174|      2|    PRBool forwardPolicyFeedback = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 2175|      2|    PRUint32 forwardPolicyCheckFlags;
 2176|       |
 2177|       |    /* initialize the underlying module structures */
 2178|      2|    SECMOD_Init();
 2179|       |
 2180|      2|    status = NSSUTIL_ArgParseModuleSpecEx(modulespec, &library, &moduleName,
 2181|      2|                                          &parameters, &nss,
 2182|      2|                                          &config);
 2183|      2|    if (status != SECSuccess) {
  ------------------
  |  Branch (2183:9): [True: 0, False: 2]
  ------------------
 2184|      0|        goto loser;
 2185|      0|    }
 2186|       |
 2187|      2|    module = SECMOD_CreateModuleEx(library, moduleName, parameters, nss, config);
 2188|      2|    forwardPolicyFeedback = NSSUTIL_ArgHasFlag("flags", "printPolicyFeedback", nss);
 2189|      2|    forwardPolicyCheckFlags = secmod_parsePolicyCheckFlags(nss);
 2190|       |
 2191|      2|    if (library)
  ------------------
  |  Branch (2191:9): [True: 0, False: 2]
  ------------------
 2192|      0|        PORT_Free(library);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 2193|      2|    if (moduleName)
  ------------------
  |  Branch (2193:9): [True: 2, False: 0]
  ------------------
 2194|      2|        PORT_Free(moduleName);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 2195|      2|    if (parameters)
  ------------------
  |  Branch (2195:9): [True: 2, False: 0]
  ------------------
 2196|      2|        PORT_Free(parameters);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 2197|      2|    if (nss)
  ------------------
  |  Branch (2197:9): [True: 2, False: 0]
  ------------------
 2198|      2|        PORT_Free(nss);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 2199|      2|    if (config)
  ------------------
  |  Branch (2199:9): [True: 0, False: 2]
  ------------------
 2200|      0|        PORT_Free(config);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 2201|      2|    if (!module) {
  ------------------
  |  Branch (2201:9): [True: 0, False: 2]
  ------------------
 2202|      0|        goto loser;
 2203|      0|    }
 2204|       |
 2205|       |    /* a policy only stanza doesn't actually get 'loaded'. policy has already
 2206|       |     * been parsed as a side effect of the CreateModuleEx call */
 2207|      2|    if (secmod_PolicyOnly(module)) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 2]
  ------------------
 2208|      0|        return module;
 2209|      0|    }
 2210|      2|    if (parent) {
  ------------------
  |  Branch (2210:9): [True: 1, False: 1]
  ------------------
 2211|      1|        module->parent = SECMOD_ReferenceModule(parent);
 2212|      1|        if (module->internal && secmod_IsInternalKeySlot(parent)) {
  ------------------
  |  Branch (2212:13): [True: 1, False: 0]
  |  Branch (2212:33): [True: 1, False: 0]
  ------------------
 2213|      1|            module->internal = parent->internal;
 2214|      1|        }
 2215|      1|    }
 2216|       |
 2217|       |    /* load it */
 2218|      2|    rv = secmod_LoadPKCS11Module(module, &oldModule);
 2219|      2|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2219:9): [True: 0, False: 2]
  ------------------
 2220|      0|        goto loser;
 2221|      0|    }
 2222|       |
 2223|       |    /* if we just reload an old module, no need to add it to any lists.
 2224|       |     * we simple release all our references */
 2225|      2|    if (oldModule) {
  ------------------
  |  Branch (2225:9): [True: 0, False: 2]
  ------------------
 2226|       |        /* This module already exists, don't link it anywhere. This
 2227|       |         * will probably destroy this module */
 2228|      0|        SECMOD_DestroyModule(module);
 2229|      0|        return oldModule;
 2230|      0|    }
 2231|       |
 2232|      2|    if (recurse && module->isModuleDB) {
  ------------------
  |  Branch (2232:9): [True: 2, False: 0]
  |  Branch (2232:20): [True: 1, False: 1]
  ------------------
 2233|      1|        char **moduleSpecList;
 2234|      1|        PORT_SetError(0);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
 2235|       |
 2236|      1|        moduleSpecList = SECMOD_GetModuleSpecList(module);
 2237|      1|        if (moduleSpecList) {
  ------------------
  |  Branch (2237:13): [True: 1, False: 0]
  ------------------
 2238|      1|            char **index;
 2239|       |
 2240|      1|            index = moduleSpecList;
 2241|      1|            if (*index && SECMOD_GetSkipFirstFlag(module)) {
  ------------------
  |  Branch (2241:17): [True: 1, False: 0]
  |  Branch (2241:27): [True: 0, False: 1]
  ------------------
 2242|      0|                index++;
 2243|      0|            }
 2244|       |
 2245|      2|            for (; *index; index++) {
  ------------------
  |  Branch (2245:20): [True: 1, False: 1]
  ------------------
 2246|      1|                SECMODModule *child;
 2247|      1|                if (0 == PORT_Strcmp(*index, modulespec)) {
  ------------------
  |  |  188|      1|#define PORT_Strcmp strcmp
  ------------------
  |  Branch (2247:21): [True: 0, False: 1]
  ------------------
 2248|       |                    /* avoid trivial infinite recursion */
 2249|      0|                    PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2250|      0|                    rv = SECFailure;
 2251|      0|                    break;
 2252|      0|                }
 2253|      1|                if (!forwardPolicyFeedback) {
  ------------------
  |  Branch (2253:21): [True: 1, False: 0]
  ------------------
 2254|      1|                    child = SECMOD_LoadModule(*index, module, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 2255|      1|                } else {
 2256|       |                    /* Add printPolicyFeedback to the nss flags */
 2257|      0|                    char *specWithForwards =
 2258|      0|                        NSSUTIL_AddNSSFlagToModuleSpec(*index, "printPolicyFeedback");
 2259|      0|                    char *tmp;
 2260|      0|                    if (forwardPolicyCheckFlags & SECMOD_FLAG_POLICY_CHECK_IDENTIFIER) {
  ------------------
  |  |  131|      0|#define SECMOD_FLAG_POLICY_CHECK_IDENTIFIER 0x01
  ------------------
  |  Branch (2260:25): [True: 0, False: 0]
  ------------------
 2261|      0|                        tmp = NSSUTIL_AddNSSFlagToModuleSpec(specWithForwards, "policyCheckIdentifier");
 2262|      0|                        PORT_Free(specWithForwards);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 2263|      0|                        specWithForwards = tmp;
 2264|      0|                    }
 2265|      0|                    if (forwardPolicyCheckFlags & SECMOD_FLAG_POLICY_CHECK_VALUE) {
  ------------------
  |  |  132|      0|#define SECMOD_FLAG_POLICY_CHECK_VALUE 0x02
  ------------------
  |  Branch (2265:25): [True: 0, False: 0]
  ------------------
 2266|      0|                        tmp = NSSUTIL_AddNSSFlagToModuleSpec(specWithForwards, "policyCheckValue");
 2267|      0|                        PORT_Free(specWithForwards);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 2268|      0|                        specWithForwards = tmp;
 2269|      0|                    }
 2270|      0|                    child = SECMOD_LoadModule(specWithForwards, module, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2271|      0|                    PORT_Free(specWithForwards);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 2272|      0|                }
 2273|      1|                if (!child)
  ------------------
  |  Branch (2273:21): [True: 0, False: 1]
  ------------------
 2274|      0|                    break;
 2275|      1|                if (child->isCritical && !child->loaded) {
  ------------------
  |  Branch (2275:21): [True: 1, False: 0]
  |  Branch (2275:42): [True: 0, False: 1]
  ------------------
 2276|      0|                    int err = PORT_GetError();
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 2277|      0|                    if (!err)
  ------------------
  |  Branch (2277:25): [True: 0, False: 0]
  ------------------
 2278|      0|                        err = SEC_ERROR_NO_MODULE;
 2279|      0|                    SECMOD_DestroyModule(child);
 2280|      0|                    PORT_SetError(err);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2281|      0|                    rv = SECFailure;
 2282|      0|                    break;
 2283|      0|                }
 2284|      1|                SECMOD_DestroyModule(child);
 2285|      1|            }
 2286|      1|            SECMOD_FreeModuleSpecList(module, moduleSpecList);
 2287|      1|        } else {
 2288|      0|            if (!PORT_GetError())
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (2288:17): [True: 0, False: 0]
  ------------------
 2289|      0|                PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2290|      0|            rv = SECFailure;
 2291|      0|        }
 2292|      1|    }
 2293|       |
 2294|      2|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2294:9): [True: 0, False: 2]
  ------------------
 2295|      0|        goto loser;
 2296|      0|    }
 2297|       |
 2298|       |    /* inherit the reference */
 2299|      2|    if (!module->moduleDBOnly) {
  ------------------
  |  Branch (2299:9): [True: 1, False: 1]
  ------------------
 2300|      1|        SECMOD_AddModuleToList(module);
 2301|      1|    } else {
 2302|      1|        SECMOD_AddModuleToDBOnlyList(module);
 2303|      1|    }
 2304|       |
 2305|       |    /* handle any additional work here */
 2306|      2|    return module;
 2307|       |
 2308|      0|loser:
 2309|      0|    if (module) {
  ------------------
  |  Branch (2309:9): [True: 0, False: 0]
  ------------------
 2310|      0|        if (module->loaded) {
  ------------------
  |  Branch (2310:13): [True: 0, False: 0]
  ------------------
 2311|      0|            SECMOD_UnloadModule(module);
 2312|      0|        }
 2313|      0|        SECMOD_AddModuleToUnloadList(module);
 2314|      0|    }
 2315|      0|    return module;
 2316|      2|}
pk11pars.c:secmod_parsePolicyCheckFlags:
 1133|      4|{
 1134|      4|    PRUint32 policyCheckFlags = 0;
 1135|       |
 1136|      4|    if (NSSUTIL_ArgHasFlag("flags", "policyCheckIdentifier", nss)) {
  ------------------
  |  Branch (1136:9): [True: 0, False: 4]
  ------------------
 1137|      0|        policyCheckFlags |= SECMOD_FLAG_POLICY_CHECK_IDENTIFIER;
  ------------------
  |  |  131|      0|#define SECMOD_FLAG_POLICY_CHECK_IDENTIFIER 0x01
  ------------------
 1138|      0|    }
 1139|       |
 1140|      4|    if (NSSUTIL_ArgHasFlag("flags", "policyCheckValue", nss)) {
  ------------------
  |  Branch (1140:9): [True: 0, False: 4]
  ------------------
 1141|      0|        policyCheckFlags |= SECMOD_FLAG_POLICY_CHECK_VALUE;
  ------------------
  |  |  132|      0|#define SECMOD_FLAG_POLICY_CHECK_VALUE 0x02
  ------------------
 1142|      0|    }
 1143|       |
 1144|      4|    return policyCheckFlags;
 1145|      4|}
pk11pars.c:secmod_parseCryptoPolicy:
 1061|      2|{
 1062|      2|    char *args;
 1063|      2|    SECStatus rv;
 1064|       |
 1065|      2|    if (policyConfig == NULL) {
  ------------------
  |  Branch (1065:9): [True: 2, False: 0]
  ------------------
 1066|      2|        return SECSuccess; /* no policy given */
 1067|      2|    }
 1068|       |    /* make sure we initialize the oid table and set all the default policy
 1069|       |     * values first so we can override them here */
 1070|      0|    rv = SECOID_Init();
 1071|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1071:9): [True: 0, False: 0]
  ------------------
 1072|      0|        return rv;
 1073|      0|    }
 1074|      0|    args = NSSUTIL_ArgGetParamValue("disallow", policyConfig);
 1075|      0|    rv = secmod_applyCryptoPolicy(args, NSS_DISALLOW, printPolicyFeedback,
 1076|      0|                                  policyCheckFlags);
 1077|      0|    if (args)
  ------------------
  |  Branch (1077:9): [True: 0, False: 0]
  ------------------
 1078|      0|        PORT_Free(args);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1079|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1079:9): [True: 0, False: 0]
  ------------------
 1080|      0|        return rv;
 1081|      0|    }
 1082|      0|    args = NSSUTIL_ArgGetParamValue("allow", policyConfig);
 1083|      0|    rv = secmod_applyCryptoPolicy(args, NSS_ALLOW, printPolicyFeedback,
 1084|      0|                                  policyCheckFlags);
 1085|      0|    if (args)
  ------------------
  |  Branch (1085:9): [True: 0, False: 0]
  ------------------
 1086|      0|        PORT_Free(args);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1087|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1087:9): [True: 0, False: 0]
  ------------------
 1088|      0|        return rv;
 1089|      0|    }
 1090|      0|    args = NSSUTIL_ArgGetParamValue("disable", policyConfig);
 1091|      0|    rv = secmod_applyCryptoPolicy(args, NSS_DISABLE, printPolicyFeedback,
 1092|      0|                                  policyCheckFlags);
 1093|      0|    if (args)
  ------------------
  |  Branch (1093:9): [True: 0, False: 0]
  ------------------
 1094|      0|        PORT_Free(args);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1095|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1095:9): [True: 0, False: 0]
  ------------------
 1096|      0|        return rv;
 1097|      0|    }
 1098|      0|    args = NSSUTIL_ArgGetParamValue("enable", policyConfig);
 1099|      0|    rv = secmod_applyCryptoPolicy(args, NSS_ENABLE, printPolicyFeedback,
 1100|      0|                                  policyCheckFlags);
 1101|      0|    if (args)
  ------------------
  |  Branch (1101:9): [True: 0, False: 0]
  ------------------
 1102|      0|        PORT_Free(args);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1103|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1103:9): [True: 0, False: 0]
  ------------------
 1104|      0|        return rv;
 1105|      0|    }
 1106|       |    /* this has to be last. Everything after this will be a noop */
 1107|      0|    if (NSSUTIL_ArgHasFlag("flags", "ssl-lock", policyConfig)) {
  ------------------
  |  Branch (1107:9): [True: 0, False: 0]
  ------------------
 1108|      0|        PRInt32 locks;
 1109|       |        /* don't overwrite other (future) lock flags */
 1110|      0|        rv = NSS_OptionGet(NSS_DEFAULT_LOCKS, &locks);
  ------------------
  |  |  302|      0|#define NSS_DEFAULT_LOCKS 0x00d /* lock default values */
  ------------------
 1111|      0|        if (rv == SECSuccess) {
  ------------------
  |  Branch (1111:13): [True: 0, False: 0]
  ------------------
 1112|      0|            rv = NSS_OptionSet(NSS_DEFAULT_LOCKS, locks | NSS_DEFAULT_SSL_LOCK);
  ------------------
  |  |  302|      0|#define NSS_DEFAULT_LOCKS 0x00d /* lock default values */
  ------------------
                          rv = NSS_OptionSet(NSS_DEFAULT_LOCKS, locks | NSS_DEFAULT_SSL_LOCK);
  ------------------
  |  |  303|      0|#define NSS_DEFAULT_SSL_LOCK 1  /* lock the ssl default values */
  ------------------
 1113|      0|        }
 1114|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1114:13): [True: 0, False: 0]
  ------------------
 1115|      0|            return rv;
 1116|      0|        }
 1117|      0|    }
 1118|      0|    if (NSSUTIL_ArgHasFlag("flags", "policy-lock", policyConfig)) {
  ------------------
  |  Branch (1118:9): [True: 0, False: 0]
  ------------------
 1119|      0|        NSS_LockPolicy();
 1120|      0|    }
 1121|      0|    if (printPolicyFeedback) {
  ------------------
  |  Branch (1121:9): [True: 0, False: 0]
  ------------------
 1122|       |        /* This helps to distinguish configurations that don't contain any
 1123|       |         * policy config= statement. */
 1124|      0|        PR_SetEnv("NSS_POLICY_LOADED=1");
 1125|      0|        fprintf(stderr, "NSS-POLICY-INFO: LOADED-SUCCESSFULLY\n");
 1126|      0|        secmod_sanityCheckCryptoPolicy();
 1127|      0|    }
 1128|      0|    return rv;
 1129|      0|}
pk11pars.c:secmod_NewModule:
   25|      2|{
   26|      2|    SECMODModule *newMod;
   27|      2|    PLArenaPool *arena;
   28|       |
   29|       |    /* create an arena in which dllName and commonName can be
   30|       |     * allocated.
   31|       |     */
   32|      2|    arena = PORT_NewArena(512);
  ------------------
  |  |   63|      2|#define PORT_NewArena PORT_NewArena_Util
  ------------------
   33|      2|    if (arena == NULL) {
  ------------------
  |  Branch (33:9): [True: 0, False: 2]
  ------------------
   34|      0|        return NULL;
   35|      0|    }
   36|       |
   37|      2|    newMod = (SECMODModule *)PORT_ArenaAlloc(arena, sizeof(SECMODModule));
  ------------------
  |  |   53|      2|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
   38|      2|    if (newMod == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 2]
  ------------------
   39|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
   40|      0|        return NULL;
   41|      0|    }
   42|       |
   43|       |    /*
   44|       |     * initialize of the fields of the module
   45|       |     */
   46|      2|    newMod->arena = arena;
   47|      2|    newMod->internal = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
   48|      2|    newMod->loaded = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
   49|      2|    newMod->isFIPS = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
   50|      2|    newMod->dllName = NULL;
   51|      2|    newMod->commonName = NULL;
   52|      2|    newMod->library = NULL;
   53|      2|    newMod->functionList = NULL;
   54|      2|    newMod->slotCount = 0;
   55|      2|    newMod->slots = NULL;
   56|      2|    newMod->slotInfo = NULL;
   57|      2|    newMod->slotInfoCount = 0;
   58|      2|    newMod->refCount = 1;
   59|      2|    newMod->ssl[0] = 0;
   60|      2|    newMod->ssl[1] = 0;
   61|      2|    newMod->libraryParams = NULL;
   62|      2|    newMod->moduleDBFunc = NULL;
   63|      2|    newMod->parent = NULL;
   64|      2|    newMod->isCritical = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
   65|      2|    newMod->isModuleDB = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
   66|      2|    newMod->moduleDBOnly = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
   67|      2|    newMod->trustOrder = 0;
   68|      2|    newMod->cipherOrder = 0;
   69|      2|    newMod->evControlMask = 0;
   70|      2|    newMod->refLock = PZ_NewLock(nssILockRefLock);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
   71|      2|    if (newMod->refLock == NULL) {
  ------------------
  |  Branch (71:9): [True: 0, False: 2]
  ------------------
   72|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
   73|      0|        return NULL;
   74|      0|    }
   75|      2|    return newMod;
   76|      2|}

pk11sdr_Init:
  126|      1|{
  127|      1|    pk11sdrLock = PR_NewLock();
  128|      1|}
pk11sdr_Shutdown:
  132|      1|{
  133|      1|    if (pk11sdrLock) {
  ------------------
  |  Branch (133:9): [True: 1, False: 0]
  ------------------
  134|      1|        PR_DestroyLock(pk11sdrLock);
  135|      1|        pk11sdrLock = NULL;
  136|      1|    }
  137|      1|}

PK11_CleanKeyList:
  114|      2|{
  115|      2|    PK11SymKey *symKey = NULL;
  116|       |
  117|     14|    while (slot->freeSymKeysWithSessionHead) {
  ------------------
  |  Branch (117:12): [True: 12, False: 2]
  ------------------
  118|     12|        symKey = slot->freeSymKeysWithSessionHead;
  119|     12|        slot->freeSymKeysWithSessionHead = symKey->next;
  120|     12|        pk11_CloseSession(slot, symKey->session, symKey->sessionOwner);
  121|     12|        PORT_Free(symKey);
  ------------------
  |  |   60|     12|#define PORT_Free PORT_Free_Util
  ------------------
  122|     12|    }
  123|      6|    while (slot->freeSymKeysHead) {
  ------------------
  |  Branch (123:12): [True: 4, False: 2]
  ------------------
  124|      4|        symKey = slot->freeSymKeysHead;
  125|      4|        slot->freeSymKeysHead = symKey->next;
  126|      4|        pk11_CloseSession(slot, symKey->session, symKey->sessionOwner);
  127|      4|        PORT_Free(symKey);
  ------------------
  |  |   60|      4|#define PORT_Free PORT_Free_Util
  ------------------
  128|      4|    }
  129|      2|    return;
  130|      2|}
PK11_FreeSymKey:
  184|   178k|{
  185|   178k|    PK11SlotInfo *slot;
  186|   178k|    PRBool freeit = PR_TRUE;
  ------------------
  |  |  437|   178k|#define PR_TRUE 1
  ------------------
  187|       |
  188|   178k|    if (!symKey) {
  ------------------
  |  Branch (188:9): [True: 89.1k, False: 89.0k]
  ------------------
  189|  89.1k|        return;
  190|  89.1k|    }
  191|       |
  192|  89.0k|    if (PR_ATOMIC_DECREMENT(&symKey->refCount) == 0) {
  ------------------
  |  |  123|  89.0k|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (192:9): [True: 40.7k, False: 48.2k]
  ------------------
  193|  40.7k|        PK11SymKey *parent = symKey->parent;
  194|       |
  195|  40.7k|        symKey->parent = NULL;
  196|  40.7k|        if ((symKey->owner) && symKey->objectID != CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  40.6k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (196:13): [True: 40.6k, False: 90]
  |  Branch (196:32): [True: 38.7k, False: 1.84k]
  ------------------
  197|  38.7k|            pk11_EnterKeyMonitor(symKey);
  198|  38.7k|            (void)PK11_GETTAB(symKey->slot)->C_DestroyObject(symKey->session, symKey->objectID);
  ------------------
  |  |  102|  38.7k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  199|  38.7k|            pk11_ExitKeyMonitor(symKey);
  200|  38.7k|        }
  201|  40.7k|        if (symKey->data.data) {
  ------------------
  |  Branch (201:13): [True: 2.57k, False: 38.1k]
  ------------------
  202|  2.57k|            PORT_Memset(symKey->data.data, 0, symKey->data.len);
  ------------------
  |  |  182|  2.57k|#define PORT_Memset memset
  ------------------
  203|  2.57k|            PORT_Free(symKey->data.data);
  ------------------
  |  |   60|  2.57k|#define PORT_Free PORT_Free_Util
  ------------------
  204|  2.57k|        }
  205|       |        /* free any existing data */
  206|  40.7k|        if (symKey->userData && symKey->freeFunc) {
  ------------------
  |  Branch (206:13): [True: 0, False: 40.7k]
  |  Branch (206:33): [True: 0, False: 0]
  ------------------
  207|      0|            (*symKey->freeFunc)(symKey->userData);
  208|      0|        }
  209|  40.7k|        slot = symKey->slot;
  210|  40.7k|        PZ_Lock(slot->freeListLock);
  ------------------
  |  |  245|  40.7k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  211|  40.7k|        if (slot->keyCount < slot->maxKeyCount) {
  ------------------
  |  Branch (211:13): [True: 40.7k, False: 0]
  ------------------
  212|       |            /*
  213|       |             * freeSymkeysWithSessionHead contain a list of reusable
  214|       |             *  SymKey structures with valid sessions.
  215|       |             *    sessionOwner must be true.
  216|       |             *    session must be valid.
  217|       |             * freeSymKeysHead contain a list of SymKey structures without
  218|       |             *  valid session.
  219|       |             *    session must be CK_INVALID_HANDLE.
  220|       |             *    though sessionOwner is false, callers should not depend on
  221|       |             *    this fact.
  222|       |             */
  223|  40.7k|            if (symKey->sessionOwner) {
  ------------------
  |  Branch (223:17): [True: 34.4k, False: 6.29k]
  ------------------
  224|  34.4k|                PORT_Assert(symKey->session != CK_INVALID_HANDLE);
  ------------------
  |  |  120|  34.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  34.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 34.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  34.4k|                symKey->next = slot->freeSymKeysWithSessionHead;
  226|  34.4k|                slot->freeSymKeysWithSessionHead = symKey;
  227|  34.4k|            } else {
  228|  6.29k|                symKey->session = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  6.29k|#define CK_INVALID_HANDLE 0
  ------------------
  229|  6.29k|                symKey->next = slot->freeSymKeysHead;
  230|  6.29k|                slot->freeSymKeysHead = symKey;
  231|  6.29k|            }
  232|  40.7k|            slot->keyCount++;
  233|  40.7k|            symKey->slot = NULL;
  234|  40.7k|            freeit = PR_FALSE;
  ------------------
  |  |  438|  40.7k|#define PR_FALSE 0
  ------------------
  235|  40.7k|        }
  236|  40.7k|        PZ_Unlock(slot->freeListLock);
  ------------------
  |  |  246|  40.7k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  237|  40.7k|        if (freeit) {
  ------------------
  |  Branch (237:13): [True: 0, False: 40.7k]
  ------------------
  238|      0|            pk11_CloseSession(symKey->slot, symKey->session,
  239|      0|                              symKey->sessionOwner);
  240|      0|            PORT_Free(symKey);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  241|      0|        }
  242|  40.7k|        PK11_FreeSlot(slot);
  243|       |
  244|  40.7k|        if (parent) {
  ------------------
  |  Branch (244:13): [True: 6.29k, False: 34.4k]
  ------------------
  245|  6.29k|            PK11_FreeSymKey(parent);
  246|  6.29k|        }
  247|  40.7k|    }
  248|  89.0k|}
PK11_ReferenceSymKey:
  252|  48.2k|{
  253|  48.2k|    PR_ATOMIC_INCREMENT(&symKey->refCount);
  ------------------
  |  |  122|  48.2k|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  254|  48.2k|    return symKey;
  255|  48.2k|}
PK11_GetMechanism:
  262|     88|{
  263|     88|    return symKey->type;
  264|     88|}
PK11_GetSlotFromKey:
  271|  2.69k|{
  272|  2.69k|    return PK11_ReferenceSlot(symKey->slot);
  273|  2.69k|}
PK11_SymKeyFromHandle:
  324|  8.06k|{
  325|  8.06k|    PK11SymKey *symKey;
  326|  8.06k|    PRBool needSession = !(owner && parent);
  ------------------
  |  Branch (326:28): [True: 7.97k, False: 89]
  |  Branch (326:37): [True: 6.29k, False: 1.68k]
  ------------------
  327|       |
  328|  8.06k|    if (keyID == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  8.06k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (328:9): [True: 0, False: 8.06k]
  ------------------
  329|      0|        return NULL;
  330|      0|    }
  331|       |
  332|  8.06k|    symKey = pk11_CreateSymKey(slot, type, owner, needSession, wincx);
  333|  8.06k|    if (symKey == NULL) {
  ------------------
  |  Branch (333:9): [True: 0, False: 8.06k]
  ------------------
  334|      0|        return NULL;
  335|      0|    }
  336|       |
  337|  8.06k|    symKey->objectID = keyID;
  338|  8.06k|    symKey->origin = origin;
  339|       |
  340|       |    /* adopt the parent's session */
  341|       |    /* This is only used by SSL. What we really want here is a session
  342|       |     * structure with a ref count so  the session goes away only after all the
  343|       |     * keys do. */
  344|  8.06k|    if (!needSession) {
  ------------------
  |  Branch (344:9): [True: 6.29k, False: 1.77k]
  ------------------
  345|  6.29k|        symKey->sessionOwner = PR_FALSE;
  ------------------
  |  |  438|  6.29k|#define PR_FALSE 0
  ------------------
  346|  6.29k|        symKey->session = parent->session;
  347|  6.29k|        symKey->parent = PK11_ReferenceSymKey(parent);
  348|       |        /* This is the only case where pk11_CreateSymKey does not explicitly
  349|       |         * check symKey->session. We need to assert here to make sure.
  350|       |         * the session isn't invalid. */
  351|  6.29k|        PORT_Assert(parent->session != CK_INVALID_HANDLE);
  ------------------
  |  |  120|  6.29k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  6.29k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6.29k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  352|  6.29k|        if (parent->session == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  6.29k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (352:13): [True: 0, False: 6.29k]
  ------------------
  353|      0|            PK11_FreeSymKey(symKey);
  354|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  355|      0|            return NULL;
  356|      0|        }
  357|  6.29k|    }
  358|       |
  359|  8.06k|    return symKey;
  360|  8.06k|}
PK11_GetWrapKey:
  370|     90|{
  371|     90|    PK11SymKey *symKey = NULL;
  372|     90|    CK_OBJECT_HANDLE keyHandle;
  373|       |
  374|     90|    PK11_EnterSlotMonitor(slot);
  375|     90|    if (slot->series != series ||
  ------------------
  |  Branch (375:9): [True: 0, False: 90]
  ------------------
  376|     90|        slot->refKeys[wrap] == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|     90|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (376:9): [True: 1, False: 89]
  ------------------
  377|      1|        PK11_ExitSlotMonitor(slot);
  378|      1|        return NULL;
  379|      1|    }
  380|       |
  381|     89|    if (type == CKM_INVALID_MECHANISM) {
  ------------------
  |  |  155|     89|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  |  Branch (381:9): [True: 89, False: 0]
  ------------------
  382|     89|        type = slot->wrapMechanism;
  383|     89|    }
  384|       |
  385|     89|    keyHandle = slot->refKeys[wrap];
  386|     89|    PK11_ExitSlotMonitor(slot);
  387|     89|    symKey = PK11_SymKeyFromHandle(slot, NULL, PK11_OriginDerive,
  388|     89|                                   slot->wrapMechanism, keyHandle, PR_FALSE, wincx);
  ------------------
  |  |  438|     89|#define PR_FALSE 0
  ------------------
  389|     89|    return symKey;
  390|     90|}
PK11_SetWrapKey:
  407|      1|{
  408|      1|    PK11_EnterSlotMonitor(slot);
  409|      1|    if (wrap >= 0) {
  ------------------
  |  Branch (409:9): [True: 1, False: 0]
  ------------------
  410|      1|        size_t uwrap = (size_t)wrap;
  411|      1|        if (uwrap < PR_ARRAY_SIZE(slot->refKeys) &&
  ------------------
  |  |  167|      2|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (411:13): [True: 1, False: 0]
  ------------------
  412|      1|            slot->refKeys[uwrap] == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      1|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (412:13): [True: 1, False: 0]
  ------------------
  413|       |            /* save the handle and mechanism for the wrapping key */
  414|       |            /* mark the key and session as not owned by us so they don't get
  415|       |             * freed when the key goes way... that lets us reuse the key
  416|       |             * later */
  417|      1|            slot->refKeys[uwrap] = wrapKey->objectID;
  418|      1|            wrapKey->owner = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  419|      1|            wrapKey->sessionOwner = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  420|      1|            slot->wrapMechanism = wrapKey->type;
  421|      1|        }
  422|      1|    }
  423|      1|    PK11_ExitSlotMonitor(slot);
  424|      1|}
PK11_ImportDataKey:
  517|  1.68k|{
  518|  1.68k|    CK_OBJECT_CLASS ckoData = CKO_DATA;
  ------------------
  |  |  325|  1.68k|#define CKO_DATA 0x00000000UL
  ------------------
  519|  1.68k|    CK_ATTRIBUTE template[2] = { { CKA_CLASS, (CK_BYTE_PTR)&ckoData, sizeof(ckoData) },
  ------------------
  |  |  511|  1.68k|#define CKA_CLASS 0x00000000UL
  ------------------
  520|  1.68k|                                 { CKA_VALUE, (CK_BYTE_PTR)key->data, key->len } };
  ------------------
  |  |  516|  1.68k|#define CKA_VALUE 0x00000011UL
  ------------------
  521|  1.68k|    CK_OBJECT_HANDLE handle;
  522|  1.68k|    PK11GenericObject *genObject;
  523|       |
  524|  1.68k|    genObject = PK11_CreateGenericObject(slot, template, PR_ARRAY_SIZE(template), PR_FALSE);
  ------------------
  |  |  167|  1.68k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
                  genObject = PK11_CreateGenericObject(slot, template, PR_ARRAY_SIZE(template), PR_FALSE);
  ------------------
  |  |  438|  1.68k|#define PR_FALSE 0
  ------------------
  525|  1.68k|    if (genObject == NULL) {
  ------------------
  |  Branch (525:9): [True: 0, False: 1.68k]
  ------------------
  526|      0|        return NULL;
  527|      0|    }
  528|  1.68k|    handle = PK11_GetObjectHandle(PK11_TypeGeneric, genObject, NULL);
  529|       |    /* A note about ownership of the PKCS #11 handle:
  530|       |     * PK11_CreateGenericObject() will not destroy the object it creates
  531|       |     * on Free, For that you want PK11_CreateManagedGenericObject().
  532|       |     * Below we import the handle into the symKey structure. We pass
  533|       |     * PR_TRUE as the owner so that the symKey will destroy the object
  534|       |     * once it's freed. This is why it's safe to destroy genObject now. */
  535|  1.68k|    PK11_DestroyGenericObject(genObject);
  536|  1.68k|    if (handle == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  1.68k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (536:9): [True: 0, False: 1.68k]
  ------------------
  537|      0|        return NULL;
  538|      0|    }
  539|  1.68k|    return PK11_SymKeyFromHandle(slot, NULL, origin, type, handle, PR_TRUE, wincx);
  ------------------
  |  |  437|  1.68k|#define PR_TRUE 1
  ------------------
  540|  1.68k|}
PK11_ImportSymKeyWithFlags:
  547|    840|{
  548|    840|    PK11SymKey *symKey;
  549|    840|    unsigned int templateCount = 0;
  550|    840|    CK_OBJECT_CLASS keyClass = CKO_SECRET_KEY;
  ------------------
  |  |  329|    840|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
  551|    840|    CK_KEY_TYPE keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|    840|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
  552|    840|    CK_BBOOL cktrue = CK_TRUE; /* sigh */
  ------------------
  |  |   22|    840|#define CK_TRUE 1
  ------------------
  553|    840|    CK_ATTRIBUTE keyTemplate[MAX_TEMPL_ATTRS];
  554|    840|    CK_ATTRIBUTE *attrs = keyTemplate;
  555|       |
  556|       |    /* CKA_NSS_MESSAGE is a fake operation to distinguish between
  557|       |     * Normal Encrypt/Decrypt and MessageEncrypt/Decrypt. Don't try to set
  558|       |     * it as a real attribute */
  559|    840|    if ((operation & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   70|    840|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
                  if ((operation & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   69|    840|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
  |  Branch (559:9): [True: 0, False: 840]
  ------------------
  560|       |        /* Message is or'd with a real Attribute (CKA_ENCRYPT, CKA_DECRYPT),
  561|       |         * etc. Strip out the real attribute here */
  562|      0|        operation &= ~CKA_NSS_MESSAGE_MASK;
  ------------------
  |  |   70|      0|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
  563|      0|    }
  564|       |
  565|    840|    PK11_SETATTRS(attrs, CKA_CLASS, &keyClass, sizeof(keyClass));
  ------------------
  |  |  104|    840|    (x)->type = (id);              \
  |  |  105|    840|    (x)->pValue = (v);             \
  |  |  106|    840|    (x)->ulValueLen = (l);
  ------------------
  566|    840|    attrs++;
  567|    840|    PK11_SETATTRS(attrs, CKA_KEY_TYPE, &keyType, sizeof(keyType));
  ------------------
  |  |  104|    840|    (x)->type = (id);              \
  |  |  105|    840|    (x)->pValue = (v);             \
  |  |  106|    840|    (x)->ulValueLen = (l);
  ------------------
  568|    840|    attrs++;
  569|    840|    if (isPerm) {
  ------------------
  |  Branch (569:9): [True: 0, False: 840]
  ------------------
  570|      0|        PK11_SETATTRS(attrs, CKA_TOKEN, &cktrue, sizeof(cktrue));
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  571|      0|        attrs++;
  572|       |        /* sigh some tokens think CKA_PRIVATE = false is a reasonable
  573|       |         * default for secret keys */
  574|      0|        PK11_SETATTRS(attrs, CKA_PRIVATE, &cktrue, sizeof(cktrue));
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
  575|      0|        attrs++;
  576|      0|    }
  577|    840|    attrs += pk11_OpFlagsToAttributes(flags, attrs, &cktrue);
  578|    840|    if ((operation != CKA_FLAGS_ONLY) &&
  ------------------
  |  |   71|    840|#define CKA_FLAGS_ONLY 0 /* CKA_CLASS */
  ------------------
  |  Branch (578:9): [True: 840, False: 0]
  ------------------
  579|    840|        !pk11_FindAttrInTemplate(keyTemplate, attrs - keyTemplate, operation)) {
  ------------------
  |  Branch (579:9): [True: 840, False: 0]
  ------------------
  580|    840|        PK11_SETATTRS(attrs, operation, &cktrue, sizeof(cktrue));
  ------------------
  |  |  104|    840|    (x)->type = (id);              \
  |  |  105|    840|    (x)->pValue = (v);             \
  |  |  106|    840|    (x)->ulValueLen = (l);
  ------------------
  581|    840|        attrs++;
  582|    840|    }
  583|    840|    templateCount = attrs - keyTemplate;
  584|    840|    PR_ASSERT(templateCount + 1 <= sizeof(keyTemplate) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|    840|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 840, False: 0]
  |  |  ------------------
  ------------------
  585|       |
  586|    840|    keyType = PK11_GetKeyType(type, key->len);
  587|    840|    symKey = pk11_ImportSymKeyWithTempl(slot, type, origin, isPerm,
  588|    840|                                        keyTemplate, templateCount, key, wincx);
  589|    840|    if (symKey && isPerm) {
  ------------------
  |  Branch (589:9): [True: 840, False: 0]
  |  Branch (589:19): [True: 0, False: 840]
  ------------------
  590|      0|        symKey->owner = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  591|      0|    }
  592|    840|    return symKey;
  593|    840|}
PK11_ExtractKeyValue:
  692|  1.73k|{
  693|  1.73k|    SECStatus rv;
  694|       |
  695|  1.73k|    if (symKey == NULL) {
  ------------------
  |  Branch (695:9): [True: 0, False: 1.73k]
  ------------------
  696|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  697|      0|        return SECFailure;
  698|      0|    }
  699|       |
  700|  1.73k|    if (symKey->data.data != NULL) {
  ------------------
  |  Branch (700:9): [True: 0, False: 1.73k]
  ------------------
  701|      0|        if (symKey->size == 0) {
  ------------------
  |  Branch (701:13): [True: 0, False: 0]
  ------------------
  702|      0|            symKey->size = symKey->data.len;
  703|      0|        }
  704|      0|        return SECSuccess;
  705|      0|    }
  706|       |
  707|  1.73k|    if (symKey->slot == NULL) {
  ------------------
  |  Branch (707:9): [True: 0, False: 1.73k]
  ------------------
  708|      0|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  709|      0|        return SECFailure;
  710|      0|    }
  711|       |
  712|  1.73k|    rv = PK11_ReadAttribute(symKey->slot, symKey->objectID, CKA_VALUE, NULL,
  ------------------
  |  |  516|  1.73k|#define CKA_VALUE 0x00000011UL
  ------------------
  713|  1.73k|                            &symKey->data);
  714|  1.73k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (714:9): [True: 1.73k, False: 0]
  ------------------
  715|  1.73k|        symKey->size = symKey->data.len;
  716|  1.73k|    }
  717|  1.73k|    return rv;
  718|  1.73k|}
PK11_GetKeyData:
  733|    897|{
  734|    897|    return &symKey->data;
  735|    897|}
pk11_GetPredefinedKeyLength:
  749|    493|{
  750|    493|    int length = 0;
  751|    493|    switch (keyType) {
  752|      0|        case CKK_DES:
  ------------------
  |  |  386|      0|#define CKK_DES 0x00000013UL
  ------------------
  |  Branch (752:9): [True: 0, False: 493]
  ------------------
  753|      0|            length = 8;
  754|      0|            break;
  755|      0|        case CKK_DES2:
  ------------------
  |  |  387|      0|#define CKK_DES2 0x00000014UL
  ------------------
  |  Branch (755:9): [True: 0, False: 493]
  ------------------
  756|      0|            length = 16;
  757|      0|            break;
  758|      0|        case CKK_DES3:
  ------------------
  |  |  388|      0|#define CKK_DES3 0x00000015UL
  ------------------
  |  Branch (758:9): [True: 0, False: 493]
  ------------------
  759|      0|            length = 24;
  760|      0|            break;
  761|      0|        case CKK_SKIPJACK:
  ------------------
  |  |  398|      0|#define CKK_SKIPJACK 0x0000001BUL
  ------------------
  |  Branch (761:9): [True: 0, False: 493]
  ------------------
  762|      0|            length = 10;
  763|      0|            break;
  764|      0|        case CKK_BATON:
  ------------------
  |  |  399|      0|#define CKK_BATON 0x0000001CUL
  ------------------
  |  Branch (764:9): [True: 0, False: 493]
  ------------------
  765|      0|            length = 20;
  766|      0|            break;
  767|      0|        case CKK_JUNIPER:
  ------------------
  |  |  400|      0|#define CKK_JUNIPER 0x0000001DUL
  ------------------
  |  Branch (767:9): [True: 0, False: 493]
  ------------------
  768|      0|            length = 20;
  769|      0|            break;
  770|    493|        default:
  ------------------
  |  Branch (770:9): [True: 493, False: 0]
  ------------------
  771|    493|            break;
  772|    493|    }
  773|    493|    return length;
  774|    493|}
pk11_CopyToSlotPerm:
  903|    840|{
  904|    840|    SECStatus rv;
  905|    840|    PK11SymKey *newKey = NULL;
  906|       |
  907|       |    /* Extract the raw key data if possible */
  908|    840|    if (symKey->data.data == NULL) {
  ------------------
  |  Branch (908:9): [True: 840, False: 0]
  ------------------
  909|    840|        rv = PK11_ExtractKeyValue(symKey);
  910|       |        /* KEY is sensitive, we're try key exchanging it. */
  911|    840|        if (rv != SECSuccess) {
  ------------------
  |  Branch (911:13): [True: 0, False: 840]
  ------------------
  912|      0|            return pk11_KeyExchange(slot, type, operation,
  913|      0|                                    flags, isPerm, symKey);
  914|      0|        }
  915|    840|    }
  916|       |
  917|    840|    newKey = PK11_ImportSymKeyWithFlags(slot, type, symKey->origin,
  918|    840|                                        operation, &symKey->data, flags, isPerm, symKey->cx);
  919|    840|    if (newKey == NULL) {
  ------------------
  |  Branch (919:9): [True: 0, False: 840]
  ------------------
  920|      0|        newKey = pk11_KeyExchange(slot, type, operation, flags, isPerm, symKey);
  921|      0|    }
  922|    840|    return newKey;
  923|    840|}
pk11_CopyToSlot:
  928|    840|{
  929|    840|    return pk11_CopyToSlotPerm(slot, type, operation, 0, PR_FALSE, symKey);
  ------------------
  |  |  438|    840|#define PR_FALSE 0
  ------------------
  930|    840|}
pk11_ForceSlotMultiple:
  939|  14.3k|{
  940|  14.3k|    PK11SlotInfo *slot = symKey->slot;
  941|  14.3k|    PK11SymKey *newKey = NULL;
  942|  14.3k|    PRBool needToCopy = PR_FALSE;
  ------------------
  |  |  438|  14.3k|#define PR_FALSE 0
  ------------------
  943|  14.3k|    int i;
  944|       |
  945|  14.3k|    if (slot == NULL) {
  ------------------
  |  Branch (945:9): [True: 0, False: 14.3k]
  ------------------
  946|      0|        needToCopy = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  947|  14.3k|    } else {
  948|  14.3k|        i = 0;
  949|  28.6k|        while ((i < mechCount) && (needToCopy == PR_FALSE)) {
  ------------------
  |  |  438|  14.3k|#define PR_FALSE 0
  ------------------
  |  Branch (949:16): [True: 14.3k, False: 14.3k]
  |  Branch (949:35): [True: 14.3k, False: 0]
  ------------------
  950|  14.3k|            if (!PK11_DoesMechanism(slot, type[i])) {
  ------------------
  |  Branch (950:17): [True: 47, False: 14.2k]
  ------------------
  951|     47|                needToCopy = PR_TRUE;
  ------------------
  |  |  437|     47|#define PR_TRUE 1
  ------------------
  952|     47|            }
  953|  14.3k|            i++;
  954|  14.3k|        }
  955|  14.3k|    }
  956|       |
  957|  14.3k|    if (needToCopy == PR_TRUE) {
  ------------------
  |  |  437|  14.3k|#define PR_TRUE 1
  ------------------
  |  Branch (957:9): [True: 47, False: 14.2k]
  ------------------
  958|     47|        slot = PK11_GetBestSlotMultiple(type, mechCount, symKey->cx);
  959|     47|        if (slot == NULL) {
  ------------------
  |  Branch (959:13): [True: 47, False: 0]
  ------------------
  960|     47|            PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|     47|#define PORT_SetError PORT_SetError_Util
  ------------------
  961|     47|            return NULL;
  962|     47|        }
  963|      0|        newKey = pk11_CopyToSlot(slot, type[0], operation, symKey);
  964|      0|        PK11_FreeSlot(slot);
  965|      0|    }
  966|  14.2k|    return newKey;
  967|  14.3k|}
pk11_ForceSlot:
  975|  14.3k|{
  976|  14.3k|    return pk11_ForceSlotMultiple(symKey, &type, 1, operation);
  977|  14.3k|}
pk11_TokenKeyGenWithFlagsAndKeyType:
 1020|  5.75k|{
 1021|  5.75k|    PK11SymKey *symKey;
 1022|  5.75k|    CK_ATTRIBUTE genTemplate[MAX_TEMPL_ATTRS];
 1023|  5.75k|    CK_ATTRIBUTE *attrs = genTemplate;
 1024|  5.75k|    int count = sizeof(genTemplate) / sizeof(genTemplate[0]);
 1025|  5.75k|    CK_MECHANISM_TYPE keyGenType;
 1026|  5.75k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  5.75k|#define CK_TRUE 1
  ------------------
 1027|  5.75k|    CK_BBOOL ckfalse = CK_FALSE;
  ------------------
  |  |   23|  5.75k|#define CK_FALSE 0
  ------------------
 1028|  5.75k|    CK_ULONG ck_key_size; /* only used for variable-length keys */
 1029|       |
 1030|  5.75k|    if (pk11_BadAttrFlags(attrFlags)) {
  ------------------
  |  Branch (1030:9): [True: 0, False: 5.75k]
  ------------------
 1031|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1032|      0|        return NULL;
 1033|      0|    }
 1034|       |
 1035|  5.75k|    if ((keySize != 0) && (type != CKM_DES3_CBC) &&
  ------------------
  |  |  826|  4.62k|#define CKM_DES3_CBC 0x00000133UL
  ------------------
  |  Branch (1035:9): [True: 4.62k, False: 1.13k]
  |  Branch (1035:27): [True: 4.62k, False: 0]
  ------------------
 1036|  5.75k|        (type != CKM_DES3_CBC_PAD) && (type != CKM_DES3_ECB)) {
  ------------------
  |  |  833|  4.62k|#define CKM_DES3_CBC_PAD 0x00000136UL
  ------------------
                      (type != CKM_DES3_CBC_PAD) && (type != CKM_DES3_ECB)) {
  ------------------
  |  |  825|  4.62k|#define CKM_DES3_ECB 0x00000132UL
  ------------------
  |  Branch (1036:9): [True: 4.62k, False: 0]
  |  Branch (1036:39): [True: 4.62k, False: 0]
  ------------------
 1037|  4.62k|        ck_key_size = keySize; /* Convert to PK11 type */
 1038|       |
 1039|  4.62k|        PK11_SETATTRS(attrs, CKA_VALUE_LEN, &ck_key_size, sizeof(ck_key_size));
  ------------------
  |  |  104|  4.62k|    (x)->type = (id);              \
  |  |  105|  4.62k|    (x)->pValue = (v);             \
  |  |  106|  4.62k|    (x)->ulValueLen = (l);
  ------------------
 1040|  4.62k|        attrs++;
 1041|  4.62k|    }
 1042|       |
 1043|  5.75k|    if (keyType != -1) {
  ------------------
  |  Branch (1043:9): [True: 0, False: 5.75k]
  ------------------
 1044|      0|        PK11_SETATTRS(attrs, CKA_KEY_TYPE, &keyType, sizeof(CK_KEY_TYPE));
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1045|      0|        attrs++;
 1046|      0|    }
 1047|       |
 1048|       |    /* Include key id value if provided */
 1049|  5.75k|    if (keyid) {
  ------------------
  |  Branch (1049:9): [True: 0, False: 5.75k]
  ------------------
 1050|      0|        PK11_SETATTRS(attrs, CKA_ID, keyid->data, keyid->len);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 1051|      0|        attrs++;
 1052|      0|    }
 1053|       |
 1054|  5.75k|    attrs += pk11_AttrFlagsToAttributes(attrFlags, attrs, &cktrue, &ckfalse);
 1055|  5.75k|    attrs += pk11_OpFlagsToAttributes(opFlags, attrs, &cktrue);
 1056|       |
 1057|  5.75k|    count = attrs - genTemplate;
 1058|  5.75k|    PR_ASSERT(count <= sizeof(genTemplate) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|  5.75k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 5.75k, False: 0]
  |  |  ------------------
  ------------------
 1059|       |
 1060|  5.75k|    keyGenType = PK11_GetKeyGenWithSize(type, keySize);
 1061|  5.75k|    if (keyGenType == CKM_FAKE_RANDOM) {
  ------------------
  |  |  154|  5.75k|#define CKM_FAKE_RANDOM 0x80000efeUL
  ------------------
  |  Branch (1061:9): [True: 0, False: 5.75k]
  ------------------
 1062|      0|        PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1063|      0|        return NULL;
 1064|      0|    }
 1065|  5.75k|    symKey = PK11_KeyGenWithTemplate(slot, type, keyGenType,
 1066|  5.75k|                                     param, genTemplate, count, wincx);
 1067|  5.75k|    if (symKey != NULL) {
  ------------------
  |  Branch (1067:9): [True: 5.75k, False: 0]
  ------------------
 1068|  5.75k|        symKey->size = keySize;
 1069|  5.75k|    }
 1070|  5.75k|    return symKey;
 1071|  5.75k|}
PK11_TokenKeyGen:
 1108|  5.75k|{
 1109|  5.75k|    PK11SymKey *symKey;
 1110|  5.75k|    PRBool weird = PR_FALSE; /* hack for fortezza */
  ------------------
  |  |  438|  5.75k|#define PR_FALSE 0
  ------------------
 1111|  5.75k|    CK_FLAGS opFlags = CKF_SIGN;
  ------------------
  |  | 1356|  5.75k|#define CKF_SIGN 0x00000800UL
  ------------------
 1112|  5.75k|    PK11AttrFlags attrFlags = 0;
 1113|       |
 1114|  5.75k|    if ((keySize == -1) && (type == CKM_SKIPJACK_CBC64)) {
  ------------------
  |  | 1049|      0|#define CKM_SKIPJACK_CBC64 0x00001002UL
  ------------------
  |  Branch (1114:9): [True: 0, False: 5.75k]
  |  Branch (1114:28): [True: 0, False: 0]
  ------------------
 1115|      0|        weird = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1116|      0|        keySize = 0;
 1117|      0|    }
 1118|       |
 1119|  5.75k|    opFlags |= weird ? CKF_DECRYPT : CKF_ENCRYPT;
  ------------------
  |  | 1354|      0|#define CKF_DECRYPT 0x00000200UL
  ------------------
                  opFlags |= weird ? CKF_DECRYPT : CKF_ENCRYPT;
  ------------------
  |  | 1353|  11.5k|#define CKF_ENCRYPT 0x00000100UL
  ------------------
  |  Branch (1119:16): [True: 0, False: 5.75k]
  ------------------
 1120|       |
 1121|  5.75k|    if (isToken) {
  ------------------
  |  Branch (1121:9): [True: 0, False: 5.75k]
  ------------------
 1122|      0|        attrFlags |= (PK11_ATTR_TOKEN | PK11_ATTR_PRIVATE);
  ------------------
  |  |  194|      0|#define PK11_ATTR_TOKEN 0x00000001L
  ------------------
                      attrFlags |= (PK11_ATTR_TOKEN | PK11_ATTR_PRIVATE);
  ------------------
  |  |  216|      0|#define PK11_ATTR_PRIVATE 0x00000004L
  ------------------
 1123|      0|    }
 1124|       |
 1125|  5.75k|    symKey = pk11_TokenKeyGenWithFlagsAndKeyType(slot, type, param,
 1126|  5.75k|                                                 -1, keySize, keyid, opFlags, attrFlags, wincx);
 1127|  5.75k|    if (symKey && weird) {
  ------------------
  |  Branch (1127:9): [True: 5.75k, False: 0]
  |  Branch (1127:19): [True: 0, False: 5.75k]
  ------------------
 1128|      0|        PK11_SetFortezzaHack(symKey);
 1129|      0|    }
 1130|       |
 1131|  5.75k|    return symKey;
 1132|  5.75k|}
PK11_KeyGen:
 1137|  5.75k|{
 1138|  5.75k|    return PK11_TokenKeyGen(slot, type, param, keySize, 0, PR_FALSE, wincx);
  ------------------
  |  |  438|  5.75k|#define PR_FALSE 0
  ------------------
 1139|  5.75k|}
PK11_KeyGenWithTemplate:
 1146|  5.75k|{
 1147|  5.75k|    PK11SymKey *symKey;
 1148|  5.75k|    CK_SESSION_HANDLE session;
 1149|  5.75k|    CK_MECHANISM mechanism;
 1150|  5.75k|    CK_RV crv;
 1151|  5.75k|    PRBool isToken = CK_FALSE;
  ------------------
  |  |   23|  5.75k|#define CK_FALSE 0
  ------------------
 1152|  5.75k|    CK_ULONG keySize = 0;
 1153|  5.75k|    unsigned i;
 1154|       |
 1155|       |    /* Extract the template's CKA_VALUE_LEN into keySize and CKA_TOKEN into
 1156|       |       isToken. */
 1157|  21.9k|    for (i = 0; i < attrsCount; ++i) {
  ------------------
  |  Branch (1157:17): [True: 16.1k, False: 5.75k]
  ------------------
 1158|  16.1k|        switch (attrs[i].type) {
  ------------------
  |  Branch (1158:17): [True: 11.5k, False: 4.62k]
  ------------------
 1159|  4.62k|            case CKA_VALUE_LEN:
  ------------------
  |  |  580|  4.62k|#define CKA_VALUE_LEN 0x00000161UL
  ------------------
  |  Branch (1159:13): [True: 4.62k, False: 11.5k]
  ------------------
 1160|  4.62k|                if (attrs[i].pValue == NULL ||
  ------------------
  |  Branch (1160:21): [True: 0, False: 4.62k]
  ------------------
 1161|  4.62k|                    attrs[i].ulValueLen != sizeof(CK_ULONG)) {
  ------------------
  |  Branch (1161:21): [True: 0, False: 4.62k]
  ------------------
 1162|      0|                    PORT_SetError(PK11_MapError(CKR_TEMPLATE_INCONSISTENT));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                                  PORT_SetError(PK11_MapError(CKR_TEMPLATE_INCONSISTENT));
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 1163|      0|                    return NULL;
 1164|      0|                }
 1165|  4.62k|                keySize = *(CK_ULONG *)attrs[i].pValue;
 1166|  4.62k|                break;
 1167|      0|            case CKA_TOKEN:
  ------------------
  |  |  512|      0|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (1167:13): [True: 0, False: 16.1k]
  ------------------
 1168|      0|                if (attrs[i].pValue == NULL ||
  ------------------
  |  Branch (1168:21): [True: 0, False: 0]
  ------------------
 1169|      0|                    attrs[i].ulValueLen != sizeof(CK_BBOOL)) {
  ------------------
  |  Branch (1169:21): [True: 0, False: 0]
  ------------------
 1170|      0|                    PORT_SetError(PK11_MapError(CKR_TEMPLATE_INCONSISTENT));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                                  PORT_SetError(PK11_MapError(CKR_TEMPLATE_INCONSISTENT));
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 1171|      0|                    return NULL;
 1172|      0|                }
 1173|      0|                isToken = (*(CK_BBOOL *)attrs[i].pValue) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                              isToken = (*(CK_BBOOL *)attrs[i].pValue) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (1173:27): [True: 0, False: 0]
  ------------------
 1174|      0|                break;
 1175|  16.1k|        }
 1176|  16.1k|    }
 1177|       |
 1178|       |    /* find a slot to generate the key into */
 1179|       |    /* Only do slot management if this is not a token key */
 1180|  5.75k|    if (!isToken && (slot == NULL || !PK11_DoesMechanism(slot, type))) {
  ------------------
  |  Branch (1180:9): [True: 5.75k, False: 0]
  |  Branch (1180:22): [True: 0, False: 5.75k]
  |  Branch (1180:38): [True: 0, False: 5.75k]
  ------------------
 1181|      0|        PK11SlotInfo *bestSlot = PK11_GetBestSlot(type, wincx);
 1182|      0|        if (bestSlot == NULL) {
  ------------------
  |  Branch (1182:13): [True: 0, False: 0]
  ------------------
 1183|      0|            PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1184|      0|            return NULL;
 1185|      0|        }
 1186|      0|        symKey = pk11_CreateSymKey(bestSlot, type, !isToken, PR_TRUE, wincx);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1187|      0|        PK11_FreeSlot(bestSlot);
 1188|  5.75k|    } else {
 1189|  5.75k|        symKey = pk11_CreateSymKey(slot, type, !isToken, PR_TRUE, wincx);
  ------------------
  |  |  437|  5.75k|#define PR_TRUE 1
  ------------------
 1190|  5.75k|    }
 1191|  5.75k|    if (symKey == NULL)
  ------------------
  |  Branch (1191:9): [True: 0, False: 5.75k]
  ------------------
 1192|      0|        return NULL;
 1193|       |
 1194|  5.75k|    symKey->size = keySize;
 1195|  5.75k|    symKey->origin = PK11_OriginGenerated;
 1196|       |
 1197|       |    /* Set the parameters for the key gen if provided */
 1198|  5.75k|    mechanism.mechanism = keyGenType;
 1199|  5.75k|    mechanism.pParameter = NULL;
 1200|  5.75k|    mechanism.ulParameterLen = 0;
 1201|  5.75k|    if (param) {
  ------------------
  |  Branch (1201:9): [True: 1.13k, False: 4.62k]
  ------------------
 1202|  1.13k|        mechanism.pParameter = param->data;
 1203|  1.13k|        mechanism.ulParameterLen = param->len;
 1204|  1.13k|    }
 1205|       |
 1206|       |    /* Get session and perform locking */
 1207|  5.75k|    if (isToken) {
  ------------------
  |  Branch (1207:9): [True: 0, False: 5.75k]
  ------------------
 1208|      0|        PK11_Authenticate(symKey->slot, PR_TRUE, wincx);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1209|       |        /* Should always be original slot */
 1210|      0|        session = PK11_GetRWSession(symKey->slot);
 1211|      0|        symKey->owner = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1212|  5.75k|    } else {
 1213|  5.75k|        session = symKey->session;
 1214|  5.75k|        if (session != CK_INVALID_HANDLE)
  ------------------
  |  |   78|  5.75k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1214:13): [True: 5.75k, False: 0]
  ------------------
 1215|  5.75k|            pk11_EnterKeyMonitor(symKey);
 1216|  5.75k|    }
 1217|  5.75k|    if (session == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  5.75k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1217:9): [True: 0, False: 5.75k]
  ------------------
 1218|      0|        PK11_FreeSymKey(symKey);
 1219|      0|        PORT_SetError(SEC_ERROR_BAD_DATA);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1220|      0|        return NULL;
 1221|      0|    }
 1222|       |
 1223|  5.75k|    crv = PK11_GETTAB(symKey->slot)->C_GenerateKey(session, &mechanism, attrs, attrsCount, &symKey->objectID);
  ------------------
  |  |  102|  5.75k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1224|       |
 1225|       |    /* Release lock and session */
 1226|  5.75k|    if (isToken) {
  ------------------
  |  Branch (1226:9): [True: 0, False: 5.75k]
  ------------------
 1227|      0|        PK11_RestoreROSession(symKey->slot, session);
 1228|  5.75k|    } else {
 1229|  5.75k|        pk11_ExitKeyMonitor(symKey);
 1230|  5.75k|    }
 1231|       |
 1232|  5.75k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  5.75k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1232:9): [True: 0, False: 5.75k]
  ------------------
 1233|      0|        PK11_FreeSymKey(symKey);
 1234|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1235|      0|        return NULL;
 1236|      0|    }
 1237|       |
 1238|  5.75k|    return symKey;
 1239|  5.75k|}
PK11_PubWrapSymKey:
 1286|  1.13k|{
 1287|  1.13k|    CK_MECHANISM_TYPE inferred = pk11_mapWrapKeyType(pubKey->keyType);
 1288|  1.13k|    return PK11_PubWrapSymKeyWithMechanism(pubKey, inferred, NULL, symKey,
 1289|  1.13k|                                           wrappedKey);
 1290|  1.13k|}
PK11_PubWrapSymKeyWithMechanism:
 1298|  1.13k|{
 1299|  1.13k|    PK11SlotInfo *slot;
 1300|  1.13k|    CK_ULONG len = wrappedKey->len;
 1301|  1.13k|    PK11SymKey *newKey = NULL;
 1302|  1.13k|    CK_OBJECT_HANDLE id;
 1303|  1.13k|    CK_MECHANISM mechanism;
 1304|  1.13k|    PRBool owner = PR_TRUE;
  ------------------
  |  |  437|  1.13k|#define PR_TRUE 1
  ------------------
 1305|  1.13k|    CK_SESSION_HANDLE session;
 1306|  1.13k|    CK_RV crv;
 1307|       |
 1308|  1.13k|    if (symKey == NULL) {
  ------------------
  |  Branch (1308:9): [True: 0, False: 1.13k]
  ------------------
 1309|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1310|      0|        return SECFailure;
 1311|      0|    }
 1312|       |
 1313|       |    /* if this slot doesn't support the mechanism, go to a slot that does */
 1314|  1.13k|    newKey = pk11_ForceSlot(symKey, mechType, CKA_ENCRYPT);
  ------------------
  |  |  547|  1.13k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 1315|  1.13k|    if (newKey != NULL) {
  ------------------
  |  Branch (1315:9): [True: 0, False: 1.13k]
  ------------------
 1316|      0|        symKey = newKey;
 1317|      0|    }
 1318|       |
 1319|  1.13k|    if (symKey->slot == NULL) {
  ------------------
  |  Branch (1319:9): [True: 0, False: 1.13k]
  ------------------
 1320|      0|        PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1321|      0|        return SECFailure;
 1322|      0|    }
 1323|       |
 1324|  1.13k|    slot = symKey->slot;
 1325|       |
 1326|  1.13k|    mechanism.mechanism = mechType;
 1327|  1.13k|    if (param == NULL) {
  ------------------
  |  Branch (1327:9): [True: 1.13k, False: 0]
  ------------------
 1328|  1.13k|        mechanism.pParameter = NULL;
 1329|  1.13k|        mechanism.ulParameterLen = 0;
 1330|  1.13k|    } else {
 1331|      0|        mechanism.pParameter = param->data;
 1332|      0|        mechanism.ulParameterLen = param->len;
 1333|      0|    }
 1334|       |
 1335|  1.13k|    id = PK11_ImportPublicKey(slot, pubKey, PR_FALSE);
  ------------------
  |  |  438|  1.13k|#define PR_FALSE 0
  ------------------
 1336|  1.13k|    if (id == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  1.13k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1336:9): [True: 40, False: 1.09k]
  ------------------
 1337|     40|        if (newKey) {
  ------------------
  |  Branch (1337:13): [True: 0, False: 40]
  ------------------
 1338|      0|            PK11_FreeSymKey(newKey);
 1339|      0|        }
 1340|     40|        return SECFailure; /* Error code has been set. */
 1341|     40|    }
 1342|       |
 1343|  1.09k|    session = pk11_GetNewSession(slot, &owner);
 1344|  1.09k|    if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (1344:9): [True: 0, False: 1.09k]
  |  Branch (1344:19): [True: 0, False: 1.09k]
  ------------------
 1345|      0|        PK11_EnterSlotMonitor(slot);
 1346|  1.09k|    crv = PK11_GETTAB(slot)->C_WrapKey(session, &mechanism,
  ------------------
  |  |  102|  1.09k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1347|  1.09k|                                       id, symKey->objectID, wrappedKey->data, &len);
 1348|  1.09k|    if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (1348:9): [True: 0, False: 1.09k]
  |  Branch (1348:19): [True: 0, False: 1.09k]
  ------------------
 1349|      0|        PK11_ExitSlotMonitor(slot);
 1350|  1.09k|    pk11_CloseSession(slot, session, owner);
 1351|  1.09k|    if (newKey) {
  ------------------
  |  Branch (1351:9): [True: 0, False: 1.09k]
  ------------------
 1352|      0|        PK11_FreeSymKey(newKey);
 1353|      0|    }
 1354|       |
 1355|  1.09k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.09k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1355:9): [True: 8, False: 1.08k]
  ------------------
 1356|      8|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      8|#define PORT_SetError PORT_SetError_Util
  ------------------
 1357|      8|        return SECFailure;
 1358|      8|    }
 1359|  1.08k|    wrappedKey->len = len;
 1360|  1.08k|    return SECSuccess;
 1361|  1.09k|}
PK11_SymKeysToSameSlot:
 1486|    935|{
 1487|       |    /* usually don't return new keys */
 1488|    935|    *newMovingKey = NULL;
 1489|    935|    *newPreferedKey = NULL;
 1490|    935|    if (movingKey->slot == preferedKey->slot) {
  ------------------
  |  Branch (1490:9): [True: 95, False: 840]
  ------------------
 1491|       |
 1492|       |        /* this should be the most common case */
 1493|     95|        if ((preferedKey->slot != NULL) &&
  ------------------
  |  Branch (1493:13): [True: 95, False: 0]
  ------------------
 1494|     95|            PK11_DoesMechanism(preferedKey->slot, mech)) {
  ------------------
  |  Branch (1494:13): [True: 95, False: 0]
  ------------------
 1495|     95|            return SECSuccess;
 1496|     95|        }
 1497|       |
 1498|       |        /* we are in the same slot, but it doesn't do the operation,
 1499|       |         * move both keys to an appropriate target slot */
 1500|      0|        return pk11_moveTwoKeys(mech, preferedOperation, movingOperation,
 1501|      0|                                preferedKey, movingKey,
 1502|      0|                                newPreferedKey, newMovingKey);
 1503|     95|    }
 1504|       |
 1505|       |    /* keys are in different slot, try moving the moving key to the prefered
 1506|       |     * key's slot */
 1507|    840|    if ((preferedKey->slot != NULL) &&
  ------------------
  |  Branch (1507:9): [True: 840, False: 0]
  ------------------
 1508|    840|        PK11_DoesMechanism(preferedKey->slot, mech)) {
  ------------------
  |  Branch (1508:9): [True: 840, False: 0]
  ------------------
 1509|    840|        *newMovingKey = pk11_CopyToSlot(preferedKey->slot, movingKey->type,
 1510|    840|                                        movingOperation, movingKey);
 1511|    840|        if (*newMovingKey != NULL) {
  ------------------
  |  Branch (1511:13): [True: 840, False: 0]
  ------------------
 1512|    840|            return SECSuccess;
 1513|    840|        }
 1514|    840|    }
 1515|       |    /* couldn't moving the moving key to the prefered slot, try moving
 1516|       |     * the prefered key */
 1517|      0|    if ((movingKey->slot != NULL) &&
  ------------------
  |  Branch (1517:9): [True: 0, False: 0]
  ------------------
 1518|      0|        PK11_DoesMechanism(movingKey->slot, mech)) {
  ------------------
  |  Branch (1518:9): [True: 0, False: 0]
  ------------------
 1519|      0|        *newPreferedKey = pk11_CopyToSlot(movingKey->slot, preferedKey->type,
 1520|      0|                                          preferedOperation, preferedKey);
 1521|      0|        if (*newPreferedKey != NULL) {
  ------------------
  |  Branch (1521:13): [True: 0, False: 0]
  ------------------
 1522|      0|            return SECSuccess;
 1523|      0|        }
 1524|      0|    }
 1525|       |    /* Neither succeeded, but that could be that they were not in slots that
 1526|       |     * supported the operation, try moving both keys into a common slot that
 1527|       |     * can do the operation. */
 1528|      0|    return pk11_moveTwoKeys(mech, preferedOperation, movingOperation,
 1529|      0|                            preferedKey, movingKey,
 1530|      0|                            newPreferedKey, newMovingKey);
 1531|      0|}
PK11_WrapSymKey:
 1540|     89|{
 1541|     89|    PK11SlotInfo *slot;
 1542|     89|    CK_ULONG len = wrappedKey->len;
 1543|     89|    PK11SymKey *newSymKey = NULL;
 1544|     89|    PK11SymKey *newWrappingKey = NULL;
 1545|     89|    SECItem *param_save = NULL;
 1546|     89|    CK_MECHANISM mechanism;
 1547|     89|    PRBool owner = PR_TRUE;
  ------------------
  |  |  437|     89|#define PR_TRUE 1
  ------------------
 1548|     89|    CK_SESSION_HANDLE session;
 1549|     89|    CK_RV crv;
 1550|     89|    SECStatus rv;
 1551|       |
 1552|       |    /* force the keys into same slot */
 1553|     89|    rv = PK11_SymKeysToSameSlot(type, CKA_ENCRYPT, CKA_WRAP,
  ------------------
  |  |  547|     89|#define CKA_ENCRYPT 0x00000104UL
  ------------------
                  rv = PK11_SymKeysToSameSlot(type, CKA_ENCRYPT, CKA_WRAP,
  ------------------
  |  |  549|     89|#define CKA_WRAP 0x00000106UL
  ------------------
 1554|     89|                                symKey, wrappingKey,
 1555|     89|                                &newSymKey, &newWrappingKey);
 1556|     89|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1556:9): [True: 0, False: 89]
  ------------------
 1557|       |        /* Couldn't move the keys as desired, try to hand unwrap if possible */
 1558|      0|        if (symKey->data.data == NULL) {
  ------------------
  |  Branch (1558:13): [True: 0, False: 0]
  ------------------
 1559|      0|            rv = PK11_ExtractKeyValue(symKey);
 1560|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (1560:17): [True: 0, False: 0]
  ------------------
 1561|      0|                PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1562|      0|                return SECFailure;
 1563|      0|            }
 1564|      0|        }
 1565|      0|        if (param == NULL) {
  ------------------
  |  Branch (1565:13): [True: 0, False: 0]
  ------------------
 1566|      0|            param_save = param = PK11_ParamFromIV(type, NULL);
 1567|      0|        }
 1568|      0|        rv = pk11_HandWrap(wrappingKey, param, type, &symKey->data, wrappedKey);
 1569|      0|        if (param_save)
  ------------------
  |  Branch (1569:13): [True: 0, False: 0]
  ------------------
 1570|      0|            SECITEM_FreeItem(param_save, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                          SECITEM_FreeItem(param_save, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1571|      0|        return rv;
 1572|      0|    }
 1573|     89|    if (newSymKey) {
  ------------------
  |  Branch (1573:9): [True: 0, False: 89]
  ------------------
 1574|      0|        symKey = newSymKey;
 1575|      0|    }
 1576|     89|    if (newWrappingKey) {
  ------------------
  |  Branch (1576:9): [True: 0, False: 89]
  ------------------
 1577|      0|        wrappingKey = newWrappingKey;
 1578|      0|    }
 1579|       |
 1580|       |    /* at this point both keys are in the same token */
 1581|     89|    slot = wrappingKey->slot;
 1582|     89|    mechanism.mechanism = type;
 1583|       |    /* use NULL IV's for wrapping */
 1584|     89|    if (param == NULL) {
  ------------------
  |  Branch (1584:9): [True: 89, False: 0]
  ------------------
 1585|     89|        param_save = param = PK11_ParamFromIV(type, NULL);
 1586|     89|    }
 1587|     89|    if (param) {
  ------------------
  |  Branch (1587:9): [True: 89, False: 0]
  ------------------
 1588|     89|        mechanism.pParameter = param->data;
 1589|     89|        mechanism.ulParameterLen = param->len;
 1590|     89|    } else {
 1591|      0|        mechanism.pParameter = NULL;
 1592|      0|        mechanism.ulParameterLen = 0;
 1593|      0|    }
 1594|       |
 1595|     89|    len = wrappedKey->len;
 1596|       |
 1597|     89|    session = pk11_GetNewSession(slot, &owner);
 1598|     89|    if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (1598:9): [True: 0, False: 89]
  |  Branch (1598:19): [True: 0, False: 89]
  ------------------
 1599|      0|        PK11_EnterSlotMonitor(slot);
 1600|     89|    crv = PK11_GETTAB(slot)->C_WrapKey(session, &mechanism,
  ------------------
  |  |  102|     89|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1601|     89|                                       wrappingKey->objectID, symKey->objectID,
 1602|     89|                                       wrappedKey->data, &len);
 1603|     89|    if (!owner || !(slot->isThreadSafe))
  ------------------
  |  Branch (1603:9): [True: 0, False: 89]
  |  Branch (1603:19): [True: 0, False: 89]
  ------------------
 1604|      0|        PK11_ExitSlotMonitor(slot);
 1605|     89|    pk11_CloseSession(slot, session, owner);
 1606|     89|    rv = SECSuccess;
 1607|     89|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|     89|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1607:9): [True: 0, False: 89]
  ------------------
 1608|       |        /* can't wrap it? try hand wrapping it... */
 1609|      0|        do {
 1610|      0|            if (symKey->data.data == NULL) {
  ------------------
  |  Branch (1610:17): [True: 0, False: 0]
  ------------------
 1611|      0|                rv = PK11_ExtractKeyValue(symKey);
 1612|      0|                if (rv != SECSuccess)
  ------------------
  |  Branch (1612:21): [True: 0, False: 0]
  ------------------
 1613|      0|                    break;
 1614|      0|            }
 1615|      0|            rv = pk11_HandWrap(wrappingKey, param, type, &symKey->data,
 1616|      0|                               wrappedKey);
 1617|      0|        } while (PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  |  |  ------------------
  |  |  |  Branch (438:18): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1618|     89|    } else {
 1619|     89|        wrappedKey->len = len;
 1620|     89|    }
 1621|      0|    PK11_FreeSymKey(newSymKey);
 1622|     89|    PK11_FreeSymKey(newWrappingKey);
 1623|     89|    if (param_save)
  ------------------
  |  Branch (1623:9): [True: 89, False: 0]
  ------------------
 1624|     89|        SECITEM_FreeItem(param_save, PR_TRUE);
  ------------------
  |  |  108|     89|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(param_save, PR_TRUE);
  ------------------
  |  |  437|     89|#define PR_TRUE 1
  ------------------
 1625|     89|    return rv;
 1626|     89|}
PK11_Derive:
 1635|  8.22k|{
 1636|  8.22k|    return PK11_DeriveWithTemplate(baseKey, derive, param, target, operation,
 1637|  8.22k|                                   keySize, NULL, 0, PR_FALSE);
  ------------------
  |  |  438|  8.22k|#define PR_FALSE 0
  ------------------
 1638|  8.22k|}
PK11_DeriveWithFlags:
 1644|  16.2k|{
 1645|  16.2k|    CK_BBOOL ckTrue = CK_TRUE;
  ------------------
  |  |   22|  16.2k|#define CK_TRUE 1
  ------------------
 1646|  16.2k|    CK_ATTRIBUTE keyTemplate[MAX_TEMPL_ATTRS];
 1647|  16.2k|    unsigned int templateCount;
 1648|       |
 1649|  16.2k|    templateCount = pk11_OpFlagsToAttributes(flags, keyTemplate, &ckTrue);
 1650|  16.2k|    return PK11_DeriveWithTemplate(baseKey, derive, param, target, operation,
 1651|  16.2k|                                   keySize, keyTemplate, templateCount, PR_FALSE);
  ------------------
  |  |  438|  16.2k|#define PR_FALSE 0
  ------------------
 1652|  16.2k|}
PK11_DeriveWithTemplate:
 1680|  24.4k|{
 1681|  24.4k|    PK11SlotInfo *slot = baseKey->slot;
 1682|  24.4k|    PK11SymKey *symKey;
 1683|  24.4k|    PK11SymKey *newBaseKey = NULL;
 1684|  24.4k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  24.4k|#define CK_TRUE 1
  ------------------
 1685|  24.4k|    CK_OBJECT_CLASS keyClass = CKO_SECRET_KEY;
  ------------------
  |  |  329|  24.4k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
 1686|  24.4k|    CK_KEY_TYPE keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|  24.4k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 1687|  24.4k|    CK_ULONG valueLen = 0;
 1688|  24.4k|    CK_MECHANISM mechanism;
 1689|  24.4k|    CK_RV crv;
 1690|  24.4k|#define MAX_ADD_ATTRS 4
 1691|  24.4k|    CK_ATTRIBUTE keyTemplate[MAX_TEMPL_ATTRS + MAX_ADD_ATTRS];
 1692|  24.4k|#undef MAX_ADD_ATTRS
 1693|  24.4k|    CK_ATTRIBUTE *attrs = keyTemplate;
 1694|  24.4k|    CK_SESSION_HANDLE session;
 1695|  24.4k|    unsigned int templateCount;
 1696|       |
 1697|  24.4k|    if (numAttrs > MAX_TEMPL_ATTRS) {
  ------------------
  |  |  200|  24.4k|#define MAX_TEMPL_ATTRS 16 /* maximum attributes in template */
  ------------------
  |  Branch (1697:9): [True: 0, False: 24.4k]
  ------------------
 1698|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1699|      0|        return NULL;
 1700|      0|    }
 1701|       |    /* CKA_NSS_MESSAGE is a fake operation to distinguish between
 1702|       |     * Normal Encrypt/Decrypt and MessageEncrypt/Decrypt. Don't try to set
 1703|       |     * it as a real attribute */
 1704|  24.4k|    if ((operation & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   70|  24.4k|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
                  if ((operation & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   69|  24.4k|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
  |  Branch (1704:9): [True: 0, False: 24.4k]
  ------------------
 1705|       |        /* Message is or'd with a real Attribute (CKA_ENCRYPT, CKA_DECRYPT),
 1706|       |         * etc. Strip out the real attribute here */
 1707|      0|        operation &= ~CKA_NSS_MESSAGE_MASK;
  ------------------
  |  |   70|      0|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
 1708|      0|    }
 1709|       |
 1710|       |    /* first copy caller attributes in. */
 1711|  56.9k|    for (templateCount = 0; templateCount < numAttrs; ++templateCount) {
  ------------------
  |  Branch (1711:29): [True: 32.4k, False: 24.4k]
  ------------------
 1712|  32.4k|        *attrs++ = *userAttr++;
 1713|  32.4k|    }
 1714|       |
 1715|       |    /* We only add the following attributes to the template if the caller
 1716|       |    ** didn't already supply them.
 1717|       |    */
 1718|  24.4k|    if (!pk11_FindAttrInTemplate(keyTemplate, numAttrs, CKA_CLASS)) {
  ------------------
  |  |  511|  24.4k|#define CKA_CLASS 0x00000000UL
  ------------------
  |  Branch (1718:9): [True: 24.4k, False: 0]
  ------------------
 1719|  24.4k|        PK11_SETATTRS(attrs, CKA_CLASS, &keyClass, sizeof keyClass);
  ------------------
  |  |  104|  24.4k|    (x)->type = (id);              \
  |  |  105|  24.4k|    (x)->pValue = (v);             \
  |  |  106|  24.4k|    (x)->ulValueLen = (l);
  ------------------
 1720|  24.4k|        attrs++;
 1721|  24.4k|    }
 1722|  24.4k|    if (!pk11_FindAttrInTemplate(keyTemplate, numAttrs, CKA_KEY_TYPE)) {
  ------------------
  |  |  543|  24.4k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
  |  Branch (1722:9): [True: 24.4k, False: 0]
  ------------------
 1723|  24.4k|        keyType = PK11_GetKeyType(target, keySize);
 1724|  24.4k|        PK11_SETATTRS(attrs, CKA_KEY_TYPE, &keyType, sizeof keyType);
  ------------------
  |  |  104|  24.4k|    (x)->type = (id);              \
  |  |  105|  24.4k|    (x)->pValue = (v);             \
  |  |  106|  24.4k|    (x)->ulValueLen = (l);
  ------------------
 1725|  24.4k|        attrs++;
 1726|  24.4k|    }
 1727|  24.4k|    if (keySize > 0 &&
  ------------------
  |  Branch (1727:9): [True: 15.8k, False: 8.59k]
  ------------------
 1728|  24.4k|        !pk11_FindAttrInTemplate(keyTemplate, numAttrs, CKA_VALUE_LEN)) {
  ------------------
  |  |  580|  15.8k|#define CKA_VALUE_LEN 0x00000161UL
  ------------------
  |  Branch (1728:9): [True: 15.8k, False: 0]
  ------------------
 1729|  15.8k|        valueLen = (CK_ULONG)keySize;
 1730|  15.8k|        PK11_SETATTRS(attrs, CKA_VALUE_LEN, &valueLen, sizeof valueLen);
  ------------------
  |  |  104|  15.8k|    (x)->type = (id);              \
  |  |  105|  15.8k|    (x)->pValue = (v);             \
  |  |  106|  15.8k|    (x)->ulValueLen = (l);
  ------------------
 1731|  15.8k|        attrs++;
 1732|  15.8k|    }
 1733|  24.4k|    if ((operation != CKA_FLAGS_ONLY) &&
  ------------------
  |  |   71|  24.4k|#define CKA_FLAGS_ONLY 0 /* CKA_CLASS */
  ------------------
  |  Branch (1733:9): [True: 24.4k, False: 0]
  ------------------
 1734|  24.4k|        !pk11_FindAttrInTemplate(keyTemplate, numAttrs, operation)) {
  ------------------
  |  Branch (1734:9): [True: 24.4k, False: 0]
  ------------------
 1735|  24.4k|        PK11_SETATTRS(attrs, operation, &cktrue, sizeof cktrue);
  ------------------
  |  |  104|  24.4k|    (x)->type = (id);              \
  |  |  105|  24.4k|    (x)->pValue = (v);             \
  |  |  106|  24.4k|    (x)->ulValueLen = (l);
  ------------------
 1736|  24.4k|        attrs++;
 1737|  24.4k|    }
 1738|       |
 1739|  24.4k|    templateCount = attrs - keyTemplate;
 1740|  24.4k|    PR_ASSERT(templateCount <= sizeof(keyTemplate) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|  24.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 24.4k, False: 0]
  |  |  ------------------
  ------------------
 1741|       |
 1742|       |    /* move the key to a slot that can do the function */
 1743|  24.4k|    if (!PK11_DoesMechanism(slot, derive)) {
  ------------------
  |  Branch (1743:9): [True: 0, False: 24.4k]
  ------------------
 1744|       |        /* get a new base key & slot */
 1745|      0|        PK11SlotInfo *newSlot = PK11_GetBestSlot(derive, baseKey->cx);
 1746|       |
 1747|      0|        if (newSlot == NULL)
  ------------------
  |  Branch (1747:13): [True: 0, False: 0]
  ------------------
 1748|      0|            return NULL;
 1749|       |
 1750|      0|        newBaseKey = pk11_CopyToSlot(newSlot, derive, CKA_DERIVE,
  ------------------
  |  |  555|      0|#define CKA_DERIVE 0x0000010CUL
  ------------------
 1751|      0|                                     baseKey);
 1752|      0|        PK11_FreeSlot(newSlot);
 1753|      0|        if (newBaseKey == NULL)
  ------------------
  |  Branch (1753:13): [True: 0, False: 0]
  ------------------
 1754|      0|            return NULL;
 1755|      0|        baseKey = newBaseKey;
 1756|      0|        slot = baseKey->slot;
 1757|      0|    }
 1758|       |
 1759|       |    /* get our key Structure */
 1760|  24.4k|    symKey = pk11_CreateSymKey(slot, target, !isPerm, PR_TRUE, baseKey->cx);
  ------------------
  |  |  437|  24.4k|#define PR_TRUE 1
  ------------------
 1761|  24.4k|    if (symKey == NULL) {
  ------------------
  |  Branch (1761:9): [True: 0, False: 24.4k]
  ------------------
 1762|      0|        return NULL;
 1763|      0|    }
 1764|       |
 1765|  24.4k|    symKey->size = keySize;
 1766|       |
 1767|  24.4k|    mechanism.mechanism = derive;
 1768|  24.4k|    if (param) {
  ------------------
  |  Branch (1768:9): [True: 24.4k, False: 0]
  ------------------
 1769|  24.4k|        mechanism.pParameter = param->data;
 1770|  24.4k|        mechanism.ulParameterLen = param->len;
 1771|  24.4k|    } else {
 1772|      0|        mechanism.pParameter = NULL;
 1773|      0|        mechanism.ulParameterLen = 0;
 1774|      0|    }
 1775|  24.4k|    symKey->origin = PK11_OriginDerive;
 1776|       |
 1777|  24.4k|    if (isPerm) {
  ------------------
  |  Branch (1777:9): [True: 0, False: 24.4k]
  ------------------
 1778|      0|        session = PK11_GetRWSession(slot);
 1779|  24.4k|    } else {
 1780|  24.4k|        pk11_EnterKeyMonitor(symKey);
 1781|  24.4k|        session = symKey->session;
 1782|  24.4k|    }
 1783|  24.4k|    if (session == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  24.4k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1783:9): [True: 0, False: 24.4k]
  ------------------
 1784|      0|        if (!isPerm)
  ------------------
  |  Branch (1784:13): [True: 0, False: 0]
  ------------------
 1785|      0|            pk11_ExitKeyMonitor(symKey);
 1786|      0|        crv = CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 1787|  24.4k|    } else {
 1788|  24.4k|        crv = PK11_GETTAB(slot)->C_DeriveKey(session, &mechanism,
  ------------------
  |  |  102|  24.4k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1789|  24.4k|                                             baseKey->objectID, keyTemplate, templateCount, &symKey->objectID);
 1790|  24.4k|        if (isPerm) {
  ------------------
  |  Branch (1790:13): [True: 0, False: 24.4k]
  ------------------
 1791|      0|            PK11_RestoreROSession(slot, session);
 1792|  24.4k|        } else {
 1793|  24.4k|            pk11_ExitKeyMonitor(symKey);
 1794|  24.4k|        }
 1795|  24.4k|    }
 1796|  24.4k|    if (newBaseKey)
  ------------------
  |  Branch (1796:9): [True: 0, False: 24.4k]
  ------------------
 1797|      0|        PK11_FreeSymKey(newBaseKey);
 1798|  24.4k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  24.4k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1798:9): [True: 0, False: 24.4k]
  ------------------
 1799|      0|        PK11_FreeSymKey(symKey);
 1800|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1801|      0|        return NULL;
 1802|      0|    }
 1803|  24.4k|    return symKey;
 1804|  24.4k|}
PK11_PubDerive:
 2107|  1.11k|{
 2108|  1.11k|    PK11SlotInfo *slot = privKey->pkcs11Slot;
 2109|  1.11k|    CK_MECHANISM mechanism;
 2110|  1.11k|    PK11SymKey *symKey;
 2111|  1.11k|    CK_RV crv;
 2112|       |
 2113|       |    /* get our key Structure */
 2114|  1.11k|    symKey = pk11_CreateSymKey(slot, target, PR_TRUE, PR_TRUE, wincx);
  ------------------
  |  |  437|  1.11k|#define PR_TRUE 1
  ------------------
                  symKey = pk11_CreateSymKey(slot, target, PR_TRUE, PR_TRUE, wincx);
  ------------------
  |  |  437|  1.11k|#define PR_TRUE 1
  ------------------
 2115|  1.11k|    if (symKey == NULL) {
  ------------------
  |  Branch (2115:9): [True: 0, False: 1.11k]
  ------------------
 2116|      0|        return NULL;
 2117|      0|    }
 2118|       |
 2119|       |    /* CKA_NSS_MESSAGE is a fake operation to distinguish between
 2120|       |     * Normal Encrypt/Decrypt and MessageEncrypt/Decrypt. Don't try to set
 2121|       |     * it as a real attribute */
 2122|  1.11k|    if ((operation & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   70|  1.11k|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
                  if ((operation & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   69|  1.11k|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
  |  Branch (2122:9): [True: 0, False: 1.11k]
  ------------------
 2123|       |        /* Message is or'd with a real Attribute (CKA_ENCRYPT, CKA_DECRYPT),
 2124|       |         * etc. Strip out the real attribute here */
 2125|      0|        operation &= ~CKA_NSS_MESSAGE_MASK;
  ------------------
  |  |   70|      0|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
 2126|      0|    }
 2127|       |
 2128|  1.11k|    symKey->origin = PK11_OriginDerive;
 2129|       |
 2130|  1.11k|    switch (privKey->keyType) {
  ------------------
  |  Branch (2130:13): [True: 0, False: 1.11k]
  ------------------
 2131|      0|        case rsaKey:
  ------------------
  |  Branch (2131:9): [True: 0, False: 1.11k]
  ------------------
 2132|      0|        case rsaPssKey:
  ------------------
  |  Branch (2132:9): [True: 0, False: 1.11k]
  ------------------
 2133|      0|        case rsaOaepKey:
  ------------------
  |  Branch (2133:9): [True: 0, False: 1.11k]
  ------------------
 2134|      0|        case kyberKey:
  ------------------
  |  Branch (2134:9): [True: 0, False: 1.11k]
  ------------------
 2135|      0|        case nullKey:
  ------------------
  |  Branch (2135:9): [True: 0, False: 1.11k]
  ------------------
 2136|      0|        case edKey:
  ------------------
  |  Branch (2136:9): [True: 0, False: 1.11k]
  ------------------
 2137|      0|        case ecMontKey:
  ------------------
  |  Branch (2137:9): [True: 0, False: 1.11k]
  ------------------
 2138|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2139|      0|            break;
 2140|      0|        case dsaKey:
  ------------------
  |  Branch (2140:9): [True: 0, False: 1.11k]
  ------------------
 2141|      0|        case keaKey:
  ------------------
  |  Branch (2141:9): [True: 0, False: 1.11k]
  ------------------
 2142|      0|        case fortezzaKey: {
  ------------------
  |  Branch (2142:9): [True: 0, False: 1.11k]
  ------------------
 2143|      0|            static unsigned char rb_email[128] = { 0 };
 2144|      0|            CK_KEA_DERIVE_PARAMS param;
 2145|      0|            param.isSender = (CK_BBOOL)isSender;
 2146|      0|            param.ulRandomLen = randomA->len;
 2147|      0|            param.pRandomA = randomA->data;
 2148|      0|            param.pRandomB = rb_email;
 2149|      0|            param.pRandomB[127] = 1;
 2150|      0|            if (randomB)
  ------------------
  |  Branch (2150:17): [True: 0, False: 0]
  ------------------
 2151|      0|                param.pRandomB = randomB->data;
 2152|      0|            if (pubKey->keyType == fortezzaKey) {
  ------------------
  |  Branch (2152:17): [True: 0, False: 0]
  ------------------
 2153|      0|                param.ulPublicDataLen = pubKey->u.fortezza.KEAKey.len;
 2154|      0|                param.pPublicData = pubKey->u.fortezza.KEAKey.data;
 2155|      0|            } else {
 2156|       |                /* assert type == keaKey */
 2157|       |                /* XXX change to match key key types */
 2158|      0|                param.ulPublicDataLen = pubKey->u.fortezza.KEAKey.len;
 2159|      0|                param.pPublicData = pubKey->u.fortezza.KEAKey.data;
 2160|      0|            }
 2161|       |
 2162|      0|            mechanism.mechanism = derive;
 2163|      0|            mechanism.pParameter = &param;
 2164|      0|            mechanism.ulParameterLen = sizeof(param);
 2165|       |
 2166|       |            /* get a new symKey structure */
 2167|      0|            pk11_EnterKeyMonitor(symKey);
 2168|      0|            crv = PK11_GETTAB(slot)->C_DeriveKey(symKey->session, &mechanism,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2169|      0|                                                 privKey->pkcs11ID, NULL, 0,
 2170|      0|                                                 &symKey->objectID);
 2171|      0|            pk11_ExitKeyMonitor(symKey);
 2172|      0|            if (crv == CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2172:17): [True: 0, False: 0]
  ------------------
 2173|      0|                return symKey;
 2174|      0|            PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2175|      0|        } break;
 2176|  1.11k|        case dhKey: {
  ------------------
  |  Branch (2176:9): [True: 1.11k, False: 0]
  ------------------
 2177|  1.11k|            CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  1.11k|#define CK_TRUE 1
  ------------------
 2178|  1.11k|            CK_OBJECT_CLASS keyClass = CKO_SECRET_KEY;
  ------------------
  |  |  329|  1.11k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
 2179|  1.11k|            CK_KEY_TYPE keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|  1.11k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 2180|  1.11k|            CK_ULONG key_size = 0;
 2181|  1.11k|            CK_ATTRIBUTE keyTemplate[4];
 2182|  1.11k|            int templateCount;
 2183|  1.11k|            CK_ATTRIBUTE *attrs = keyTemplate;
 2184|       |
 2185|  1.11k|            if (pubKey->keyType != dhKey) {
  ------------------
  |  Branch (2185:17): [True: 0, False: 1.11k]
  ------------------
 2186|      0|                PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2187|      0|                break;
 2188|      0|            }
 2189|       |
 2190|  1.11k|            PK11_SETATTRS(attrs, CKA_CLASS, &keyClass, sizeof(keyClass));
  ------------------
  |  |  104|  1.11k|    (x)->type = (id);              \
  |  |  105|  1.11k|    (x)->pValue = (v);             \
  |  |  106|  1.11k|    (x)->ulValueLen = (l);
  ------------------
 2191|  1.11k|            attrs++;
 2192|  1.11k|            PK11_SETATTRS(attrs, CKA_KEY_TYPE, &keyType, sizeof(keyType));
  ------------------
  |  |  104|  1.11k|    (x)->type = (id);              \
  |  |  105|  1.11k|    (x)->pValue = (v);             \
  |  |  106|  1.11k|    (x)->ulValueLen = (l);
  ------------------
 2193|  1.11k|            attrs++;
 2194|  1.11k|            PK11_SETATTRS(attrs, operation, &cktrue, 1);
  ------------------
  |  |  104|  1.11k|    (x)->type = (id);              \
  |  |  105|  1.11k|    (x)->pValue = (v);             \
  |  |  106|  1.11k|    (x)->ulValueLen = (l);
  ------------------
 2195|  1.11k|            attrs++;
 2196|  1.11k|            PK11_SETATTRS(attrs, CKA_VALUE_LEN, &key_size, sizeof(key_size));
  ------------------
  |  |  104|  1.11k|    (x)->type = (id);              \
  |  |  105|  1.11k|    (x)->pValue = (v);             \
  |  |  106|  1.11k|    (x)->ulValueLen = (l);
  ------------------
 2197|  1.11k|            attrs++;
 2198|  1.11k|            templateCount = attrs - keyTemplate;
 2199|  1.11k|            PR_ASSERT(templateCount <= sizeof(keyTemplate) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|  1.11k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1.11k, False: 0]
  |  |  ------------------
  ------------------
 2200|       |
 2201|  1.11k|            keyType = PK11_GetKeyType(target, keySize);
 2202|  1.11k|            key_size = keySize;
 2203|  1.11k|            symKey->size = keySize;
 2204|  1.11k|            if (key_size == 0)
  ------------------
  |  Branch (2204:17): [True: 413, False: 703]
  ------------------
 2205|    413|                templateCount--;
 2206|       |
 2207|  1.11k|            mechanism.mechanism = derive;
 2208|       |
 2209|       |            /* we can undefine these when we define diffie-helman keys */
 2210|       |
 2211|  1.11k|            mechanism.pParameter = pubKey->u.dh.publicValue.data;
 2212|  1.11k|            mechanism.ulParameterLen = pubKey->u.dh.publicValue.len;
 2213|       |
 2214|  1.11k|            pk11_EnterKeyMonitor(symKey);
 2215|  1.11k|            crv = PK11_GETTAB(slot)->C_DeriveKey(symKey->session, &mechanism,
  ------------------
  |  |  102|  1.11k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2216|  1.11k|                                                 privKey->pkcs11ID, keyTemplate,
 2217|  1.11k|                                                 templateCount, &symKey->objectID);
 2218|  1.11k|            pk11_ExitKeyMonitor(symKey);
 2219|  1.11k|            if (crv == CKR_OK)
  ------------------
  |  | 1388|  1.11k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2219:17): [True: 1.11k, False: 2]
  ------------------
 2220|  1.11k|                return symKey;
 2221|      2|            PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
 2222|      2|        } break;
 2223|      0|        case ecKey: {
  ------------------
  |  Branch (2223:9): [True: 0, False: 1.11k]
  ------------------
 2224|      0|            CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|      0|#define CK_TRUE 1
  ------------------
 2225|      0|            CK_OBJECT_CLASS keyClass = CKO_SECRET_KEY;
  ------------------
  |  |  329|      0|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
 2226|      0|            CK_KEY_TYPE keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|      0|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 2227|      0|            CK_ULONG key_size = 0;
 2228|      0|            CK_ATTRIBUTE keyTemplate[4];
 2229|      0|            int templateCount;
 2230|      0|            CK_ATTRIBUTE *attrs = keyTemplate;
 2231|      0|            CK_ECDH1_DERIVE_PARAMS *mechParams = NULL;
 2232|       |
 2233|      0|            if (pubKey->keyType != ecKey) {
  ------------------
  |  Branch (2233:17): [True: 0, False: 0]
  ------------------
 2234|      0|                PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2235|      0|                break;
 2236|      0|            }
 2237|       |
 2238|      0|            PK11_SETATTRS(attrs, CKA_CLASS, &keyClass, sizeof(keyClass));
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 2239|      0|            attrs++;
 2240|      0|            PK11_SETATTRS(attrs, CKA_KEY_TYPE, &keyType, sizeof(keyType));
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 2241|      0|            attrs++;
 2242|      0|            PK11_SETATTRS(attrs, operation, &cktrue, 1);
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 2243|      0|            attrs++;
 2244|      0|            PK11_SETATTRS(attrs, CKA_VALUE_LEN, &key_size, sizeof(key_size));
  ------------------
  |  |  104|      0|    (x)->type = (id);              \
  |  |  105|      0|    (x)->pValue = (v);             \
  |  |  106|      0|    (x)->ulValueLen = (l);
  ------------------
 2245|      0|            attrs++;
 2246|      0|            templateCount = attrs - keyTemplate;
 2247|      0|            PR_ASSERT(templateCount <= sizeof(keyTemplate) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2248|       |
 2249|      0|            keyType = PK11_GetKeyType(target, keySize);
 2250|      0|            key_size = keySize;
 2251|      0|            if (key_size == 0) {
  ------------------
  |  Branch (2251:17): [True: 0, False: 0]
  ------------------
 2252|      0|                if ((key_size = pk11_GetPredefinedKeyLength(keyType))) {
  ------------------
  |  Branch (2252:21): [True: 0, False: 0]
  ------------------
 2253|      0|                    templateCount--;
 2254|      0|                } else {
 2255|       |                    /* sigh, some tokens can't figure this out and require
 2256|       |                     * CKA_VALUE_LEN to be set */
 2257|      0|                    key_size = SHA1_LENGTH;
  ------------------
  |  |   39|      0|#define SHA1_LENGTH 20
  ------------------
 2258|      0|                }
 2259|      0|            }
 2260|      0|            symKey->size = key_size;
 2261|       |
 2262|      0|            mechParams = PORT_ZNew(CK_ECDH1_DERIVE_PARAMS);
  ------------------
  |  |  148|      0|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 2263|      0|            mechParams->kdf = CKD_SHA1_KDF;
  ------------------
  |  | 1703|      0|#define CKD_SHA1_KDF 0x00000002UL
  ------------------
 2264|      0|            mechParams->ulSharedDataLen = 0;
 2265|      0|            mechParams->pSharedData = NULL;
 2266|      0|            mechParams->ulPublicDataLen = pubKey->u.ec.publicValue.len;
 2267|      0|            mechParams->pPublicData = pubKey->u.ec.publicValue.data;
 2268|       |
 2269|      0|            mechanism.mechanism = derive;
 2270|      0|            mechanism.pParameter = mechParams;
 2271|      0|            mechanism.ulParameterLen = sizeof(CK_ECDH1_DERIVE_PARAMS);
 2272|       |
 2273|      0|            pk11_EnterKeyMonitor(symKey);
 2274|      0|            crv = PK11_GETTAB(slot)->C_DeriveKey(symKey->session,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2275|      0|                                                 &mechanism, privKey->pkcs11ID, keyTemplate,
 2276|      0|                                                 templateCount, &symKey->objectID);
 2277|      0|            pk11_ExitKeyMonitor(symKey);
 2278|       |
 2279|       |            /* old PKCS #11 spec was ambiguous on what needed to be passed,
 2280|       |             * try this again with and encoded public key */
 2281|      0|            if (crv != CKR_OK && pk11_ECGetPubkeyEncoding(pubKey) != ECPoint_XOnly) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2281:17): [True: 0, False: 0]
  |  Branch (2281:34): [True: 0, False: 0]
  ------------------
 2282|      0|                SECItem *pubValue = SEC_ASN1EncodeItem(NULL, NULL,
  ------------------
  |  |   89|      0|#define SEC_ASN1EncodeItem SEC_ASN1EncodeItem_Util
  ------------------
 2283|      0|                                                       &pubKey->u.ec.publicValue,
 2284|      0|                                                       SEC_ASN1_GET(SEC_OctetStringTemplate));
  ------------------
  |  |  188|      0|#define SEC_ASN1_GET(x) x
  ------------------
 2285|      0|                if (pubValue == NULL) {
  ------------------
  |  Branch (2285:21): [True: 0, False: 0]
  ------------------
 2286|      0|                    PORT_ZFree(mechParams, sizeof(CK_ECDH1_DERIVE_PARAMS));
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 2287|      0|                    break;
 2288|      0|                }
 2289|      0|                mechParams->ulPublicDataLen = pubValue->len;
 2290|      0|                mechParams->pPublicData = pubValue->data;
 2291|       |
 2292|      0|                pk11_EnterKeyMonitor(symKey);
 2293|      0|                crv = PK11_GETTAB(slot)->C_DeriveKey(symKey->session,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2294|      0|                                                     &mechanism, privKey->pkcs11ID, keyTemplate,
 2295|      0|                                                     templateCount, &symKey->objectID);
 2296|      0|                pk11_ExitKeyMonitor(symKey);
 2297|       |
 2298|      0|                SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                              SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2299|      0|            }
 2300|       |
 2301|      0|            PORT_ZFree(mechParams, sizeof(CK_ECDH1_DERIVE_PARAMS));
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 2302|       |
 2303|      0|            if (crv == CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2303:17): [True: 0, False: 0]
  ------------------
 2304|      0|                return symKey;
 2305|      0|            PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2306|      0|        }
 2307|  1.11k|    }
 2308|       |
 2309|      2|    PK11_FreeSymKey(symKey);
 2310|      2|    return NULL;
 2311|  1.11k|}
PK11_PubDeriveWithKDF:
 2591|  1.19k|{
 2592|       |
 2593|  1.19k|    switch (privKey->keyType) {
 2594|      0|        case rsaKey:
  ------------------
  |  Branch (2594:9): [True: 0, False: 1.19k]
  ------------------
 2595|      0|        case nullKey:
  ------------------
  |  Branch (2595:9): [True: 0, False: 1.19k]
  ------------------
 2596|      0|        case dsaKey:
  ------------------
  |  Branch (2596:9): [True: 0, False: 1.19k]
  ------------------
 2597|      0|        case keaKey:
  ------------------
  |  Branch (2597:9): [True: 0, False: 1.19k]
  ------------------
 2598|      0|        case fortezzaKey:
  ------------------
  |  Branch (2598:9): [True: 0, False: 1.19k]
  ------------------
 2599|    703|        case dhKey:
  ------------------
  |  Branch (2599:9): [True: 703, False: 493]
  ------------------
 2600|    703|            return PK11_PubDerive(privKey, pubKey, isSender, randomA, randomB,
 2601|    703|                                  derive, target, operation, keySize, wincx);
 2602|    493|        case ecKey:
  ------------------
  |  Branch (2602:9): [True: 493, False: 703]
  ------------------
 2603|    493|        case ecMontKey:
  ------------------
  |  Branch (2603:9): [True: 0, False: 1.19k]
  ------------------
 2604|    493|            return pk11_PubDeriveECKeyWithKDF(privKey, pubKey, isSender,
 2605|    493|                                              randomA, randomB, derive, target,
 2606|    493|                                              operation, keySize,
 2607|    493|                                              kdf, sharedData, wincx);
 2608|      0|        default:
  ------------------
  |  Branch (2608:9): [True: 0, False: 1.19k]
  ------------------
 2609|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2610|      0|            break;
 2611|  1.19k|    }
 2612|       |
 2613|      0|    return NULL;
 2614|  1.19k|}
PK11_GetSymKeyHandle:
 3078|  2.53k|{
 3079|  2.53k|    return symKey->objectID;
 3080|  2.53k|}
pk11skey.c:pk11_EnterKeyMonitor:
   28|  70.6k|{
   29|  70.6k|    if (!symKey->sessionOwner || !(symKey->slot->isThreadSafe))
  ------------------
  |  Branch (29:9): [True: 6.29k, False: 64.3k]
  |  Branch (29:34): [True: 0, False: 64.3k]
  ------------------
   30|  6.29k|        PK11_EnterSlotMonitor(symKey->slot);
   31|  70.6k|}
pk11skey.c:pk11_ExitKeyMonitor:
   35|  70.6k|{
   36|  70.6k|    if (!symKey->sessionOwner || !(symKey->slot->isThreadSafe))
  ------------------
  |  Branch (36:9): [True: 6.29k, False: 64.3k]
  |  Branch (36:34): [True: 0, False: 64.3k]
  ------------------
   37|  6.29k|        PK11_ExitSlotMonitor(symKey->slot);
   38|  70.6k|}
pk11skey.c:pk11_CreateSymKey:
  144|  40.7k|{
  145|       |
  146|  40.7k|    PK11SymKey *symKey = pk11_getKeyFromList(slot, needSession);
  147|       |
  148|  40.7k|    if (symKey == NULL) {
  ------------------
  |  Branch (148:9): [True: 0, False: 40.7k]
  ------------------
  149|      0|        return NULL;
  150|      0|    }
  151|       |    /* if needSession was specified, make sure we have a valid session.
  152|       |     * callers which specify needSession as false should do their own
  153|       |     * check of the session before returning the symKey */
  154|  40.7k|    if (needSession && symKey->session == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|  34.4k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (154:9): [True: 34.4k, False: 6.29k]
  |  Branch (154:24): [True: 0, False: 34.4k]
  ------------------
  155|      0|        PK11_FreeSymKey(symKey);
  156|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  157|      0|        return NULL;
  158|      0|    }
  159|       |
  160|  40.7k|    symKey->type = type;
  161|  40.7k|    symKey->data.type = siBuffer;
  162|  40.7k|    symKey->data.data = NULL;
  163|  40.7k|    symKey->data.len = 0;
  164|  40.7k|    symKey->owner = owner;
  165|  40.7k|    symKey->objectID = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  40.7k|#define CK_INVALID_HANDLE 0
  ------------------
  166|  40.7k|    symKey->slot = slot;
  167|  40.7k|    symKey->series = slot->series;
  168|  40.7k|    symKey->cx = wincx;
  169|  40.7k|    symKey->size = 0;
  170|  40.7k|    symKey->refCount = 1;
  171|  40.7k|    symKey->origin = PK11_OriginNULL;
  172|  40.7k|    symKey->parent = NULL;
  173|  40.7k|    symKey->freeFunc = NULL;
  174|  40.7k|    symKey->userData = NULL;
  175|  40.7k|    PK11_ReferenceSlot(slot);
  176|  40.7k|    return symKey;
  177|  40.7k|}
pk11skey.c:pk11_getKeyFromList:
   47|  40.7k|{
   48|  40.7k|    PK11SymKey *symKey = NULL;
   49|       |
   50|  40.7k|    PZ_Lock(slot->freeListLock);
  ------------------
  |  |  245|  40.7k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
   51|       |    /* own session list are symkeys with sessions that the symkey owns.
   52|       |     * 'most' symkeys will own their own session. */
   53|  40.7k|    if (needSession) {
  ------------------
  |  Branch (53:9): [True: 34.4k, False: 6.29k]
  ------------------
   54|  34.4k|        if (slot->freeSymKeysWithSessionHead) {
  ------------------
  |  Branch (54:13): [True: 34.4k, False: 13]
  ------------------
   55|  34.4k|            symKey = slot->freeSymKeysWithSessionHead;
   56|  34.4k|            slot->freeSymKeysWithSessionHead = symKey->next;
   57|  34.4k|            slot->keyCount--;
   58|  34.4k|        }
   59|  34.4k|    }
   60|       |    /* if we don't need a symkey with its own session, or we couldn't find
   61|       |     * one on the owner list, get one from the non-owner free list. */
   62|  40.7k|    if (!symKey) {
  ------------------
  |  Branch (62:9): [True: 6.30k, False: 34.4k]
  ------------------
   63|  6.30k|        if (slot->freeSymKeysHead) {
  ------------------
  |  Branch (63:13): [True: 6.28k, False: 16]
  ------------------
   64|  6.28k|            symKey = slot->freeSymKeysHead;
   65|  6.28k|            slot->freeSymKeysHead = symKey->next;
   66|  6.28k|            slot->keyCount--;
   67|  6.28k|        }
   68|  6.30k|    }
   69|  40.7k|    PZ_Unlock(slot->freeListLock);
  ------------------
  |  |  246|  40.7k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
   70|  40.7k|    if (symKey) {
  ------------------
  |  Branch (70:9): [True: 40.7k, False: 16]
  ------------------
   71|  40.7k|        symKey->next = NULL;
   72|  40.7k|        if (!needSession) {
  ------------------
  |  Branch (72:13): [True: 6.28k, False: 34.4k]
  ------------------
   73|  6.28k|            return symKey;
   74|  6.28k|        }
   75|       |        /* if we are getting an owner key, make sure we have a valid session.
   76|       |         * session could be invalid if the token has been removed or because
   77|       |         * we got it from the non-owner free list */
   78|  34.4k|        if ((symKey->series != slot->series) ||
  ------------------
  |  Branch (78:13): [True: 0, False: 34.4k]
  ------------------
   79|  34.4k|            (symKey->session == CK_INVALID_HANDLE)) {
  ------------------
  |  |   78|  34.4k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (79:13): [True: 1, False: 34.4k]
  ------------------
   80|      1|            symKey->session = pk11_GetNewSession(slot, &symKey->sessionOwner);
   81|      1|        }
   82|  34.4k|        PORT_Assert(symKey->session != CK_INVALID_HANDLE);
  ------------------
  |  |  120|  34.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  34.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 34.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   83|  34.4k|        if (symKey->session != CK_INVALID_HANDLE)
  ------------------
  |  |   78|  34.4k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (83:13): [True: 34.4k, False: 0]
  ------------------
   84|  34.4k|            return symKey;
   85|      0|        PK11_FreeSymKey(symKey);
   86|       |        /* if we are here, we need a session, but couldn't get one, it's
   87|       |         * unlikely we pk11_GetNewSession will succeed if we call it a second
   88|       |         * time. */
   89|      0|        return NULL;
   90|  34.4k|    }
   91|       |
   92|     16|    symKey = PORT_New(PK11SymKey);
  ------------------
  |  |  151|     16|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|     16|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
   93|     16|    if (symKey == NULL) {
  ------------------
  |  Branch (93:9): [True: 0, False: 16]
  ------------------
   94|      0|        return NULL;
   95|      0|    }
   96|       |
   97|     16|    symKey->next = NULL;
   98|     16|    if (needSession) {
  ------------------
  |  Branch (98:9): [True: 12, False: 4]
  ------------------
   99|     12|        symKey->session = pk11_GetNewSession(slot, &symKey->sessionOwner);
  100|     12|        PORT_Assert(symKey->session != CK_INVALID_HANDLE);
  ------------------
  |  |  120|     12|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     12|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 12, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|     12|        if (symKey->session == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|     12|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (101:13): [True: 0, False: 12]
  ------------------
  102|      0|            PK11_FreeSymKey(symKey);
  103|      0|            symKey = NULL;
  104|      0|        }
  105|     12|    } else {
  106|      4|        symKey->session = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      4|#define CK_INVALID_HANDLE 0
  ------------------
  107|      4|    }
  108|     16|    return symKey;
  109|     16|}
pk11skey.c:pk11_ImportSymKeyWithTempl:
  442|    840|{
  443|    840|    PK11SymKey *symKey;
  444|    840|    SECStatus rv;
  445|       |
  446|    840|    symKey = pk11_CreateSymKey(slot, type, !isToken, PR_TRUE, wincx);
  ------------------
  |  |  437|    840|#define PR_TRUE 1
  ------------------
  447|    840|    if (symKey == NULL) {
  ------------------
  |  Branch (447:9): [True: 0, False: 840]
  ------------------
  448|      0|        return NULL;
  449|      0|    }
  450|       |
  451|    840|    symKey->size = key->len;
  452|       |
  453|    840|    PK11_SETATTRS(&keyTemplate[templateCount], CKA_VALUE, key->data, key->len);
  ------------------
  |  |  104|    840|    (x)->type = (id);              \
  |  |  105|    840|    (x)->pValue = (v);             \
  |  |  106|    840|    (x)->ulValueLen = (l);
  ------------------
  454|    840|    templateCount++;
  455|       |
  456|    840|    if (SECITEM_CopyItem(NULL, &symKey->data, key) != SECSuccess) {
  ------------------
  |  |  106|    840|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  |  Branch (456:9): [True: 0, False: 840]
  ------------------
  457|      0|        PK11_FreeSymKey(symKey);
  458|      0|        return NULL;
  459|      0|    }
  460|       |
  461|    840|    symKey->origin = origin;
  462|       |
  463|       |    /* import the keys */
  464|    840|    rv = PK11_CreateNewObject(slot, symKey->session, keyTemplate,
  465|    840|                              templateCount, isToken, &symKey->objectID);
  466|    840|    if (rv != SECSuccess) {
  ------------------
  |  Branch (466:9): [True: 0, False: 840]
  ------------------
  467|      0|        PK11_FreeSymKey(symKey);
  468|      0|        return NULL;
  469|      0|    }
  470|       |
  471|    840|    return symKey;
  472|    840|}
pk11skey.c:pk11_ECGetPubkeyEncoding:
 2317|    576|{
 2318|    576|    SECItem oid;
 2319|    576|    SECStatus rv;
 2320|    576|    PORTCheapArenaPool tmpArena;
 2321|    576|    ECPointEncoding encoding = ECPoint_Undefined;
 2322|       |
 2323|    576|    PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|    576|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 2324|       |
 2325|       |    /* decode the OID tag */
 2326|    576|    rv = SEC_QuickDERDecodeItem(&tmpArena.arena, &oid,
  ------------------
  |  |  102|    576|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
 2327|    576|                                SEC_ASN1_GET(SEC_ObjectIDTemplate),
  ------------------
  |  |  188|    576|#define SEC_ASN1_GET(x) x
  ------------------
 2328|    576|                                &pubKey->u.ec.DEREncodedParams);
 2329|    576|    if (rv == SECSuccess) {
  ------------------
  |  Branch (2329:9): [True: 576, False: 0]
  ------------------
 2330|    576|        SECOidTag tag = SECOID_FindOIDTag(&oid);
  ------------------
  |  |  117|    576|#define SECOID_FindOIDTag SECOID_FindOIDTag_Util
  ------------------
 2331|    576|        switch (tag) {
 2332|      0|            case SEC_OID_X25519:
  ------------------
  |  Branch (2332:13): [True: 0, False: 576]
  ------------------
 2333|    211|            case SEC_OID_CURVE25519:
  ------------------
  |  Branch (2333:13): [True: 211, False: 365]
  ------------------
 2334|    211|                encoding = ECPoint_XOnly;
 2335|    211|                break;
 2336|    193|            case SEC_OID_SECG_EC_SECP256R1:
  ------------------
  |  |  543|    193|#define SEC_OID_SECG_EC_SECP256R1 SEC_OID_ANSIX962_EC_PRIME256V1
  ------------------
  |  Branch (2336:13): [True: 193, False: 383]
  ------------------
 2337|    353|            case SEC_OID_SECG_EC_SECP384R1:
  ------------------
  |  Branch (2337:13): [True: 160, False: 416]
  ------------------
 2338|    365|            case SEC_OID_SECG_EC_SECP521R1:
  ------------------
  |  Branch (2338:13): [True: 12, False: 564]
  ------------------
 2339|    365|            default:
  ------------------
  |  Branch (2339:13): [True: 0, False: 576]
  ------------------
 2340|       |                /* unknown curve, default to uncompressed */
 2341|    365|                encoding = ECPoint_Uncompressed;
 2342|    576|        }
 2343|    576|    }
 2344|    576|    PORT_DestroyCheapArena(&tmpArena);
 2345|    576|    return encoding;
 2346|    576|}
pk11skey.c:pk11_PubDeriveECKeyWithKDF:
 2374|    493|{
 2375|    493|    PK11SlotInfo *slot = privKey->pkcs11Slot;
 2376|    493|    PK11SymKey *symKey;
 2377|    493|    PK11SymKey *SharedSecret;
 2378|    493|    CK_MECHANISM mechanism;
 2379|    493|    CK_RV crv;
 2380|    493|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|    493|#define CK_TRUE 1
  ------------------
 2381|    493|    CK_OBJECT_CLASS keyClass = CKO_SECRET_KEY;
  ------------------
  |  |  329|    493|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
 2382|    493|    CK_KEY_TYPE keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|    493|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 2383|    493|    CK_ULONG key_size = 0;
 2384|    493|    CK_ATTRIBUTE keyTemplate[4];
 2385|    493|    int templateCount;
 2386|    493|    CK_ATTRIBUTE *attrs = keyTemplate;
 2387|    493|    CK_ECDH1_DERIVE_PARAMS *mechParams = NULL;
 2388|       |
 2389|    493|    if (pubKey->keyType != ecKey && pubKey->keyType != ecMontKey) {
  ------------------
  |  Branch (2389:9): [True: 0, False: 493]
  |  Branch (2389:37): [True: 0, False: 0]
  ------------------
 2390|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2391|      0|        return NULL;
 2392|      0|    }
 2393|    493|    if ((kdf != CKD_NULL) && (kdf != CKD_SHA1_KDF) &&
  ------------------
  |  | 1702|    493|#define CKD_NULL 0x00000001UL
  ------------------
                  if ((kdf != CKD_NULL) && (kdf != CKD_SHA1_KDF) &&
  ------------------
  |  | 1703|      0|#define CKD_SHA1_KDF 0x00000002UL
  ------------------
  |  Branch (2393:9): [True: 0, False: 493]
  |  Branch (2393:30): [True: 0, False: 0]
  ------------------
 2394|    493|        (kdf != CKD_SHA224_KDF) && (kdf != CKD_SHA256_KDF) &&
  ------------------
  |  | 1704|      0|#define CKD_SHA224_KDF 0x00000005UL
  ------------------
                      (kdf != CKD_SHA224_KDF) && (kdf != CKD_SHA256_KDF) &&
  ------------------
  |  | 1705|      0|#define CKD_SHA256_KDF 0x00000006UL
  ------------------
  |  Branch (2394:9): [True: 0, False: 0]
  |  Branch (2394:36): [True: 0, False: 0]
  ------------------
 2395|    493|        (kdf != CKD_SHA384_KDF) && (kdf != CKD_SHA512_KDF)) {
  ------------------
  |  | 1706|      0|#define CKD_SHA384_KDF 0x00000007UL
  ------------------
                      (kdf != CKD_SHA384_KDF) && (kdf != CKD_SHA512_KDF)) {
  ------------------
  |  | 1707|      0|#define CKD_SHA512_KDF 0x00000008UL
  ------------------
  |  Branch (2395:9): [True: 0, False: 0]
  |  Branch (2395:36): [True: 0, False: 0]
  ------------------
 2396|      0|        PORT_SetError(SEC_ERROR_INVALID_ALGORITHM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2397|      0|        return NULL;
 2398|      0|    }
 2399|       |
 2400|       |    /* get our key Structure */
 2401|    493|    symKey = pk11_CreateSymKey(slot, target, PR_TRUE, PR_TRUE, wincx);
  ------------------
  |  |  437|    493|#define PR_TRUE 1
  ------------------
                  symKey = pk11_CreateSymKey(slot, target, PR_TRUE, PR_TRUE, wincx);
  ------------------
  |  |  437|    493|#define PR_TRUE 1
  ------------------
 2402|    493|    if (symKey == NULL) {
  ------------------
  |  Branch (2402:9): [True: 0, False: 493]
  ------------------
 2403|      0|        return NULL;
 2404|      0|    }
 2405|       |    /* CKA_NSS_MESSAGE is a fake operation to distinguish between
 2406|       |     * Normal Encrypt/Decrypt and MessageEncrypt/Decrypt. Don't try to set
 2407|       |     * it as a real attribute */
 2408|    493|    if ((operation & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   70|    493|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
                  if ((operation & CKA_NSS_MESSAGE_MASK) == CKA_NSS_MESSAGE) {
  ------------------
  |  |   69|    493|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
  |  Branch (2408:9): [True: 0, False: 493]
  ------------------
 2409|       |        /* Message is or'd with a real Attribute (CKA_ENCRYPT, CKA_DECRYPT),
 2410|       |         * etc. Strip out the real attribute here */
 2411|      0|        operation &= ~CKA_NSS_MESSAGE_MASK;
  ------------------
  |  |   70|      0|#define CKA_NSS_MESSAGE_MASK 0xff000000L
  ------------------
 2412|      0|    }
 2413|       |
 2414|    493|    symKey->origin = PK11_OriginDerive;
 2415|       |
 2416|    493|    PK11_SETATTRS(attrs, CKA_CLASS, &keyClass, sizeof(keyClass));
  ------------------
  |  |  104|    493|    (x)->type = (id);              \
  |  |  105|    493|    (x)->pValue = (v);             \
  |  |  106|    493|    (x)->ulValueLen = (l);
  ------------------
 2417|    493|    attrs++;
 2418|    493|    PK11_SETATTRS(attrs, CKA_KEY_TYPE, &keyType, sizeof(keyType));
  ------------------
  |  |  104|    493|    (x)->type = (id);              \
  |  |  105|    493|    (x)->pValue = (v);             \
  |  |  106|    493|    (x)->ulValueLen = (l);
  ------------------
 2419|    493|    attrs++;
 2420|    493|    PK11_SETATTRS(attrs, operation, &cktrue, 1);
  ------------------
  |  |  104|    493|    (x)->type = (id);              \
  |  |  105|    493|    (x)->pValue = (v);             \
  |  |  106|    493|    (x)->ulValueLen = (l);
  ------------------
 2421|    493|    attrs++;
 2422|    493|    PK11_SETATTRS(attrs, CKA_VALUE_LEN, &key_size, sizeof(key_size));
  ------------------
  |  |  104|    493|    (x)->type = (id);              \
  |  |  105|    493|    (x)->pValue = (v);             \
  |  |  106|    493|    (x)->ulValueLen = (l);
  ------------------
 2423|    493|    attrs++;
 2424|    493|    templateCount = attrs - keyTemplate;
 2425|    493|    PR_ASSERT(templateCount <= sizeof(keyTemplate) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  208|    493|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 493, False: 0]
  |  |  ------------------
  ------------------
 2426|       |
 2427|    493|    keyType = PK11_GetKeyType(target, keySize);
 2428|    493|    key_size = keySize;
 2429|    493|    if (key_size == 0) {
  ------------------
  |  Branch (2429:9): [True: 493, False: 0]
  ------------------
 2430|    493|        if ((key_size = pk11_GetPredefinedKeyLength(keyType))) {
  ------------------
  |  Branch (2430:13): [True: 0, False: 493]
  ------------------
 2431|      0|            templateCount--;
 2432|    493|        } else {
 2433|       |            /* sigh, some tokens can't figure this out and require
 2434|       |             * CKA_VALUE_LEN to be set */
 2435|    493|            switch (kdf) {
 2436|    493|                case CKD_NULL:
  ------------------
  |  | 1702|    493|#define CKD_NULL 0x00000001UL
  ------------------
  |  Branch (2436:17): [True: 493, False: 0]
  ------------------
 2437|    493|                    key_size = pk11_ECPubKeySize(pubKey);
 2438|    493|                    if (key_size == 0) {
  ------------------
  |  Branch (2438:25): [True: 0, False: 493]
  ------------------
 2439|      0|                        PK11_FreeSymKey(symKey);
 2440|      0|                        return NULL;
 2441|      0|                    }
 2442|    493|                    break;
 2443|    493|                case CKD_SHA1_KDF:
  ------------------
  |  | 1703|      0|#define CKD_SHA1_KDF 0x00000002UL
  ------------------
  |  Branch (2443:17): [True: 0, False: 493]
  ------------------
 2444|      0|                    key_size = SHA1_LENGTH;
  ------------------
  |  |   39|      0|#define SHA1_LENGTH 20
  ------------------
 2445|      0|                    break;
 2446|      0|                case CKD_SHA224_KDF:
  ------------------
  |  | 1704|      0|#define CKD_SHA224_KDF 0x00000005UL
  ------------------
  |  Branch (2446:17): [True: 0, False: 493]
  ------------------
 2447|      0|                    key_size = SHA224_LENGTH;
  ------------------
  |  |   40|      0|#define SHA224_LENGTH 28
  ------------------
 2448|      0|                    break;
 2449|      0|                case CKD_SHA256_KDF:
  ------------------
  |  | 1705|      0|#define CKD_SHA256_KDF 0x00000006UL
  ------------------
  |  Branch (2449:17): [True: 0, False: 493]
  ------------------
 2450|      0|                    key_size = SHA256_LENGTH;
  ------------------
  |  |   41|      0|#define SHA256_LENGTH 32
  ------------------
 2451|      0|                    break;
 2452|      0|                case CKD_SHA384_KDF:
  ------------------
  |  | 1706|      0|#define CKD_SHA384_KDF 0x00000007UL
  ------------------
  |  Branch (2452:17): [True: 0, False: 493]
  ------------------
 2453|      0|                    key_size = SHA384_LENGTH;
  ------------------
  |  |   42|      0|#define SHA384_LENGTH 48
  ------------------
 2454|      0|                    break;
 2455|      0|                case CKD_SHA512_KDF:
  ------------------
  |  | 1707|      0|#define CKD_SHA512_KDF 0x00000008UL
  ------------------
  |  Branch (2455:17): [True: 0, False: 493]
  ------------------
 2456|      0|                    key_size = SHA512_LENGTH;
  ------------------
  |  |   43|      0|#define SHA512_LENGTH 64
  ------------------
 2457|      0|                    break;
 2458|      0|                default:
  ------------------
  |  Branch (2458:17): [True: 0, False: 493]
  ------------------
 2459|      0|                    PORT_AssertNotReached("Invalid CKD");
  ------------------
  |  |  127|      0|#define PORT_AssertNotReached(reasonStr) PR_NOT_REACHED(reasonStr)
  |  |  ------------------
  |  |  |  |  213|      0|    PR_Assert(_reasonStr,__FILE__,__LINE__)
  |  |  ------------------
  ------------------
 2460|      0|                    PORT_SetError(SEC_ERROR_INVALID_ALGORITHM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2461|      0|                    PK11_FreeSymKey(symKey);
 2462|      0|                    return NULL;
 2463|    493|            }
 2464|    493|        }
 2465|    493|    }
 2466|    493|    symKey->size = key_size;
 2467|       |
 2468|    493|    mechParams = PORT_ZNew(CK_ECDH1_DERIVE_PARAMS);
  ------------------
  |  |  148|    493|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|    493|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 2469|    493|    if (!mechParams) {
  ------------------
  |  Branch (2469:9): [True: 0, False: 493]
  ------------------
 2470|      0|        PK11_FreeSymKey(symKey);
 2471|      0|        return NULL;
 2472|      0|    }
 2473|    493|    mechParams->kdf = kdf;
 2474|    493|    if (sharedData == NULL) {
  ------------------
  |  Branch (2474:9): [True: 493, False: 0]
  ------------------
 2475|    493|        mechParams->ulSharedDataLen = 0;
 2476|    493|        mechParams->pSharedData = NULL;
 2477|    493|    } else {
 2478|      0|        mechParams->ulSharedDataLen = sharedData->len;
 2479|      0|        mechParams->pSharedData = sharedData->data;
 2480|      0|    }
 2481|    493|    mechParams->ulPublicDataLen = pubKey->u.ec.publicValue.len;
 2482|    493|    mechParams->pPublicData = pubKey->u.ec.publicValue.data;
 2483|       |
 2484|    493|    mechanism.mechanism = derive;
 2485|    493|    mechanism.pParameter = mechParams;
 2486|    493|    mechanism.ulParameterLen = sizeof(CK_ECDH1_DERIVE_PARAMS);
 2487|       |
 2488|    493|    pk11_EnterKeyMonitor(symKey);
 2489|    493|    crv = PK11_GETTAB(slot)->C_DeriveKey(symKey->session, &mechanism,
  ------------------
  |  |  102|    493|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2490|    493|                                         privKey->pkcs11ID, keyTemplate,
 2491|    493|                                         templateCount, &symKey->objectID);
 2492|    493|    pk11_ExitKeyMonitor(symKey);
 2493|       |
 2494|       |    /* old PKCS #11 spec was ambiguous on what needed to be passed,
 2495|       |     * try this again with an encoded public key */
 2496|    493|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|    493|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2496:9): [True: 83, False: 410]
  ------------------
 2497|       |        /* For curves that only use X as public value and no encoding we don't
 2498|       |         * have to try again. (Currently only Curve25519) */
 2499|     83|        if (pk11_ECGetPubkeyEncoding(pubKey) == ECPoint_XOnly) {
  ------------------
  |  Branch (2499:13): [True: 18, False: 65]
  ------------------
 2500|     18|            goto loser;
 2501|     18|        }
 2502|     65|        SECItem *pubValue = SEC_ASN1EncodeItem(NULL, NULL,
  ------------------
  |  |   89|     65|#define SEC_ASN1EncodeItem SEC_ASN1EncodeItem_Util
  ------------------
 2503|     65|                                               &pubKey->u.ec.publicValue,
 2504|     65|                                               SEC_ASN1_GET(SEC_OctetStringTemplate));
  ------------------
  |  |  188|     65|#define SEC_ASN1_GET(x) x
  ------------------
 2505|     65|        if (pubValue == NULL) {
  ------------------
  |  Branch (2505:13): [True: 0, False: 65]
  ------------------
 2506|      0|            goto loser;
 2507|      0|        }
 2508|     65|        mechParams->ulPublicDataLen = pubValue->len;
 2509|     65|        mechParams->pPublicData = pubValue->data;
 2510|       |
 2511|     65|        pk11_EnterKeyMonitor(symKey);
 2512|     65|        crv = PK11_GETTAB(slot)->C_DeriveKey(symKey->session,
  ------------------
  |  |  102|     65|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2513|     65|                                             &mechanism, privKey->pkcs11ID, keyTemplate,
 2514|     65|                                             templateCount, &symKey->objectID);
 2515|     65|        pk11_ExitKeyMonitor(symKey);
 2516|       |
 2517|     65|        if ((crv != CKR_OK) && (kdf != CKD_NULL)) {
  ------------------
  |  | 1388|     65|#define CKR_OK 0x00000000UL
  ------------------
                      if ((crv != CKR_OK) && (kdf != CKD_NULL)) {
  ------------------
  |  | 1702|     65|#define CKD_NULL 0x00000001UL
  ------------------
  |  Branch (2517:13): [True: 65, False: 0]
  |  Branch (2517:32): [True: 0, False: 65]
  ------------------
 2518|       |            /* Some PKCS #11 libraries cannot perform the key derivation
 2519|       |             * function. So, try calling C_DeriveKey with CKD_NULL and then
 2520|       |             * performing the KDF separately.
 2521|       |             */
 2522|      0|            CK_ULONG derivedKeySize = key_size;
 2523|       |
 2524|      0|            keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|      0|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 2525|      0|            key_size = pk11_ECPubKeySize(pubKey);
 2526|      0|            if (key_size == 0) {
  ------------------
  |  Branch (2526:17): [True: 0, False: 0]
  ------------------
 2527|      0|                SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                              SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2528|      0|                goto loser;
 2529|      0|            }
 2530|      0|            SharedSecret = symKey;
 2531|      0|            SharedSecret->size = key_size;
 2532|       |
 2533|      0|            mechParams->kdf = CKD_NULL;
  ------------------
  |  | 1702|      0|#define CKD_NULL 0x00000001UL
  ------------------
 2534|      0|            mechParams->ulSharedDataLen = 0;
 2535|      0|            mechParams->pSharedData = NULL;
 2536|      0|            mechParams->ulPublicDataLen = pubKey->u.ec.publicValue.len;
 2537|      0|            mechParams->pPublicData = pubKey->u.ec.publicValue.data;
 2538|       |
 2539|      0|            pk11_EnterKeyMonitor(SharedSecret);
 2540|      0|            crv = PK11_GETTAB(slot)->C_DeriveKey(SharedSecret->session,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2541|      0|                                                 &mechanism, privKey->pkcs11ID, keyTemplate,
 2542|      0|                                                 templateCount, &SharedSecret->objectID);
 2543|      0|            pk11_ExitKeyMonitor(SharedSecret);
 2544|       |
 2545|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2545:17): [True: 0, False: 0]
  ------------------
 2546|       |                /* old PKCS #11 spec was ambiguous on what needed to be passed,
 2547|       |                 * try this one final time with an encoded public key */
 2548|      0|                mechParams->ulPublicDataLen = pubValue->len;
 2549|      0|                mechParams->pPublicData = pubValue->data;
 2550|       |
 2551|      0|                pk11_EnterKeyMonitor(SharedSecret);
 2552|      0|                crv = PK11_GETTAB(slot)->C_DeriveKey(SharedSecret->session,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2553|      0|                                                     &mechanism, privKey->pkcs11ID, keyTemplate,
 2554|      0|                                                     templateCount, &SharedSecret->objectID);
 2555|      0|                pk11_ExitKeyMonitor(SharedSecret);
 2556|      0|            }
 2557|       |
 2558|       |            /* Perform KDF. */
 2559|      0|            if (crv == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2559:17): [True: 0, False: 0]
  ------------------
 2560|      0|                symKey = pk11_ANSIX963Derive(SharedSecret, kdf,
 2561|      0|                                             sharedData, target, operation,
 2562|      0|                                             derivedKeySize);
 2563|      0|                PK11_FreeSymKey(SharedSecret);
 2564|      0|                if (symKey == NULL) {
  ------------------
  |  Branch (2564:21): [True: 0, False: 0]
  ------------------
 2565|      0|                    SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                                  SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2566|      0|                    PORT_ZFree(mechParams, sizeof(CK_ECDH1_DERIVE_PARAMS));
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 2567|      0|                    return NULL;
 2568|      0|                }
 2569|      0|            }
 2570|      0|        }
 2571|     65|        SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  108|     65|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  437|     65|#define PR_TRUE 1
  ------------------
 2572|     65|    }
 2573|       |
 2574|    493|loser:
 2575|    493|    PORT_ZFree(mechParams, sizeof(CK_ECDH1_DERIVE_PARAMS));
  ------------------
  |  |   75|    493|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 2576|       |
 2577|    493|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|    493|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2577:9): [True: 83, False: 410]
  ------------------
 2578|     83|        PK11_FreeSymKey(symKey);
 2579|     83|        symKey = NULL;
 2580|     83|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|     83|#define PORT_SetError PORT_SetError_Util
  ------------------
 2581|     83|    }
 2582|    493|    return symKey;
 2583|    493|}
pk11skey.c:pk11_ECPubKeySize:
 2352|    493|{
 2353|    493|    SECItem *publicValue = &pubKey->u.ec.publicValue;
 2354|       |
 2355|    493|    ECPointEncoding encoding = pk11_ECGetPubkeyEncoding(pubKey);
 2356|    493|    if (encoding == ECPoint_XOnly) {
  ------------------
  |  Branch (2356:9): [True: 193, False: 300]
  ------------------
 2357|    193|        return publicValue->len;
 2358|    193|    }
 2359|    300|    if (encoding == ECPoint_Uncompressed) {
  ------------------
  |  Branch (2359:9): [True: 300, False: 0]
  ------------------
 2360|       |        /* key encoded in uncompressed form */
 2361|    300|        return ((publicValue->len - 1) / 2);
 2362|    300|    }
 2363|       |    /* key encoding not recognized */
 2364|      0|    return 0;
 2365|    300|}

PK11_NewSlotList:
  108|  10.8k|{
  109|  10.8k|    PK11SlotList *list;
  110|       |
  111|  10.8k|    list = (PK11SlotList *)PORT_Alloc(sizeof(PK11SlotList));
  ------------------
  |  |   52|  10.8k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  112|  10.8k|    if (list == NULL)
  ------------------
  |  Branch (112:9): [True: 0, False: 10.8k]
  ------------------
  113|      0|        return NULL;
  114|  10.8k|    list->head = NULL;
  115|  10.8k|    list->tail = NULL;
  116|  10.8k|    list->lock = PZ_NewLock(nssILockList);
  ------------------
  |  |  243|  10.8k|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  117|  10.8k|    if (list->lock == NULL) {
  ------------------
  |  Branch (117:9): [True: 0, False: 10.8k]
  ------------------
  118|      0|        PORT_Free(list);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  119|      0|        return NULL;
  120|      0|    }
  121|       |
  122|  10.8k|    return list;
  123|  10.8k|}
PK11_FreeSlotListElement:
  130|  74.8k|{
  131|  74.8k|    PRBool freeit = PR_FALSE;
  ------------------
  |  |  438|  74.8k|#define PR_FALSE 0
  ------------------
  132|       |
  133|  74.8k|    if (list == NULL || le == NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 74.8k]
  |  Branch (133:25): [True: 0, False: 74.8k]
  ------------------
  134|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  135|      0|        return SECFailure;
  136|      0|    }
  137|       |
  138|  74.8k|    PZ_Lock(list->lock);
  ------------------
  |  |  245|  74.8k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  139|  74.8k|    if (le->refCount-- == 1) {
  ------------------
  |  Branch (139:9): [True: 7.25k, False: 67.6k]
  ------------------
  140|  7.25k|        freeit = PR_TRUE;
  ------------------
  |  |  437|  7.25k|#define PR_TRUE 1
  ------------------
  141|  7.25k|    }
  142|  74.8k|    PZ_Unlock(list->lock);
  ------------------
  |  |  246|  74.8k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  143|  74.8k|    if (freeit) {
  ------------------
  |  Branch (143:9): [True: 7.25k, False: 67.6k]
  ------------------
  144|  7.25k|        PK11_FreeSlot(le->slot);
  145|  7.25k|        PORT_Free(le);
  ------------------
  |  |   60|  7.25k|#define PORT_Free PORT_Free_Util
  ------------------
  146|  7.25k|    }
  147|  74.8k|    return SECSuccess;
  148|  74.8k|}
PK11_FreeSlotList:
  174|  10.8k|{
  175|  10.8k|    pk11_FreeSlotListStatic(list);
  176|  10.8k|    PORT_Free(list);
  ------------------
  |  |   60|  10.8k|#define PORT_Free PORT_Free_Util
  ------------------
  177|  10.8k|}
PK11_AddSlotToList:
  188|  7.25k|{
  189|  7.25k|    PK11SlotListElement *le;
  190|  7.25k|    PK11SlotListElement *element;
  191|       |
  192|  7.25k|    le = (PK11SlotListElement *)PORT_Alloc(sizeof(PK11SlotListElement));
  ------------------
  |  |   52|  7.25k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  193|  7.25k|    if (le == NULL)
  ------------------
  |  Branch (193:9): [True: 0, False: 7.25k]
  ------------------
  194|      0|        return SECFailure;
  195|       |
  196|  7.25k|    le->slot = PK11_ReferenceSlot(slot);
  197|  7.25k|    le->prev = NULL;
  198|  7.25k|    le->refCount = 1;
  199|  7.25k|    PZ_Lock(list->lock);
  ------------------
  |  |  245|  7.25k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  200|  7.25k|    element = list->head;
  201|       |    /* Insertion sort, with higher cipherOrders are sorted first in the list */
  202|  7.25k|    while (element && sorted && (element->slot->module->cipherOrder > le->slot->module->cipherOrder)) {
  ------------------
  |  Branch (202:12): [True: 3.62k, False: 3.63k]
  |  Branch (202:23): [True: 3.61k, False: 1]
  |  Branch (202:33): [True: 0, False: 3.61k]
  ------------------
  203|      0|        element = element->next;
  204|      0|    }
  205|  7.25k|    if (element) {
  ------------------
  |  Branch (205:9): [True: 3.62k, False: 3.63k]
  ------------------
  206|  3.62k|        le->prev = element->prev;
  207|  3.62k|        element->prev = le;
  208|  3.62k|        le->next = element;
  209|  3.63k|    } else {
  210|  3.63k|        le->prev = list->tail;
  211|  3.63k|        le->next = NULL;
  212|  3.63k|        list->tail = le;
  213|  3.63k|    }
  214|  7.25k|    if (le->prev)
  ------------------
  |  Branch (214:9): [True: 0, False: 7.25k]
  ------------------
  215|      0|        le->prev->next = le;
  216|  7.25k|    if (list->head == element)
  ------------------
  |  Branch (216:9): [True: 7.25k, False: 0]
  ------------------
  217|  7.25k|        list->head = le;
  218|  7.25k|    PZ_Unlock(list->lock);
  ------------------
  |  |  246|  7.25k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  219|       |
  220|  7.25k|    return SECSuccess;
  221|  7.25k|}
PK11_DeleteSlotFromList:
  228|     18|{
  229|     18|    PZ_Lock(list->lock);
  ------------------
  |  |  245|     18|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  230|     18|    if (le->prev)
  ------------------
  |  Branch (230:9): [True: 0, False: 18]
  ------------------
  231|      0|        le->prev->next = le->next;
  232|     18|    else
  233|     18|        list->head = le->next;
  234|     18|    if (le->next)
  ------------------
  |  Branch (234:9): [True: 1, False: 17]
  ------------------
  235|      1|        le->next->prev = le->prev;
  236|     17|    else
  237|     17|        list->tail = le->prev;
  238|     18|    le->next = le->prev = NULL;
  239|     18|    PZ_Unlock(list->lock);
  ------------------
  |  |  246|     18|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  240|     18|    PK11_FreeSlotListElement(list, le);
  241|     18|    return SECSuccess;
  242|     18|}
pk11_MoveListToList:
  251|  7.23k|{
  252|  7.23k|    if (src->head == NULL)
  ------------------
  |  Branch (252:9): [True: 7.23k, False: 0]
  ------------------
  253|  7.23k|        return SECSuccess;
  254|       |
  255|      0|    if (target->tail == NULL) {
  ------------------
  |  Branch (255:9): [True: 0, False: 0]
  ------------------
  256|      0|        target->head = src->head;
  257|      0|    } else {
  258|      0|        target->tail->next = src->head;
  259|      0|    }
  260|      0|    src->head->prev = target->tail;
  261|      0|    target->tail = src->tail;
  262|      0|    src->head = src->tail = NULL;
  263|      0|    return SECSuccess;
  264|  7.23k|}
PK11_GetFirstSafe:
  300|  67.5k|{
  301|  67.5k|    PK11SlotListElement *le;
  302|       |
  303|  67.5k|    PZ_Lock(list->lock);
  ------------------
  |  |  245|  67.5k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  304|  67.5k|    le = list->head;
  305|  67.5k|    if (le != NULL)
  ------------------
  |  Branch (305:9): [True: 67.5k, False: 0]
  ------------------
  306|  67.5k|        (le)->refCount++;
  307|  67.5k|    PZ_Unlock(list->lock);
  ------------------
  |  |  246|  67.5k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  308|  67.5k|    return le;
  309|  67.5k|}
PK11_GetNextSafe:
  318|    445|{
  319|    445|    PK11SlotListElement *new_le;
  320|    445|    PZ_Lock(list->lock);
  ------------------
  |  |  245|    445|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  321|    445|    new_le = le->next;
  322|    445|    if (le->next == NULL) {
  ------------------
  |  Branch (322:9): [True: 398, False: 47]
  ------------------
  323|       |        /* if the prev and next fields are NULL then either this element
  324|       |         * has been removed and we need to walk the list again (if restart
  325|       |         * is true) or this was the only element on the list */
  326|    398|        if ((le->prev == NULL) && restart && (list->head != le)) {
  ------------------
  |  Branch (326:13): [True: 351, False: 47]
  |  Branch (326:35): [True: 351, False: 0]
  |  Branch (326:46): [True: 0, False: 351]
  ------------------
  327|      0|            new_le = list->head;
  328|      0|        }
  329|    398|    }
  330|    445|    if (new_le)
  ------------------
  |  Branch (330:9): [True: 47, False: 398]
  ------------------
  331|     47|        new_le->refCount++;
  332|    445|    PZ_Unlock(list->lock);
  ------------------
  |  |  246|    445|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  333|    445|    PK11_FreeSlotListElement(list, le);
  334|    445|    return new_le;
  335|    445|}
PK11_FindSlotElement:
  342|     18|{
  343|     18|    PK11SlotListElement *le;
  344|       |
  345|     18|    for (le = PK11_GetFirstSafe(list); le;
  ------------------
  |  Branch (345:40): [True: 18, False: 0]
  ------------------
  346|     18|         le = PK11_GetNextSafe(list, le, PR_TRUE)) {
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  347|     18|        if (le->slot == slot)
  ------------------
  |  Branch (347:13): [True: 18, False: 0]
  ------------------
  348|     18|            return le;
  349|     18|    }
  350|      0|    return NULL;
  351|     18|}
PK11_NewSlotInfo:
  361|      2|{
  362|      2|    PK11SlotInfo *slot;
  363|       |
  364|      2|    slot = (PK11SlotInfo *)PORT_Alloc(sizeof(PK11SlotInfo));
  ------------------
  |  |   52|      2|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  365|      2|    if (slot == NULL) {
  ------------------
  |  Branch (365:9): [True: 0, False: 2]
  ------------------
  366|      0|        return slot;
  367|      0|    }
  368|      2|    slot->freeListLock = PZ_NewLock(nssILockFreelist);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  369|      2|    if (slot->freeListLock == NULL) {
  ------------------
  |  Branch (369:9): [True: 0, False: 2]
  ------------------
  370|      0|        PORT_Free(slot);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  371|      0|        return NULL;
  372|      0|    }
  373|      2|    slot->nssTokenLock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  374|      2|    if (slot->nssTokenLock == NULL) {
  ------------------
  |  Branch (374:9): [True: 0, False: 2]
  ------------------
  375|      0|        PZ_DestroyLock(slot->freeListLock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  376|      0|        PORT_Free(slot);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  377|      0|        return NULL;
  378|      0|    }
  379|      2|    slot->sessionLock = mod->isThreadSafe ? PZ_NewLock(nssILockSession) : mod->refLock;
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  |  Branch (379:25): [True: 2, False: 0]
  ------------------
  380|      2|    if (slot->sessionLock == NULL) {
  ------------------
  |  Branch (380:9): [True: 0, False: 2]
  ------------------
  381|      0|        PZ_DestroyLock(slot->nssTokenLock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  382|      0|        PZ_DestroyLock(slot->freeListLock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  383|      0|        PORT_Free(slot);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  384|      0|        return NULL;
  385|      0|    }
  386|      2|    slot->freeSymKeysWithSessionHead = NULL;
  387|      2|    slot->freeSymKeysHead = NULL;
  388|      2|    slot->keyCount = 0;
  389|      2|    slot->maxKeyCount = 0;
  390|      2|    slot->functionList = NULL;
  391|      2|    slot->needTest = PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
  392|      2|    slot->isPerm = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  393|      2|    slot->isHW = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  394|      2|    slot->isInternal = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  395|      2|    slot->isThreadSafe = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  396|      2|    slot->disabled = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  397|      2|    slot->series = 1;
  398|      2|    slot->flagSeries = 0;
  399|      2|    slot->flagState = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  400|      2|    slot->wrapKey = 0;
  401|      2|    slot->wrapMechanism = CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|      2|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  402|      2|    slot->refKeys[0] = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      2|#define CK_INVALID_HANDLE 0
  ------------------
  403|      2|    slot->reason = PK11_DIS_NONE;
  404|      2|    slot->readOnly = PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
  405|      2|    slot->needLogin = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  406|      2|    slot->hasRandom = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  407|      2|    slot->defRWSession = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  408|      2|    slot->protectedAuthPath = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  409|      2|    slot->flags = 0;
  410|      2|    slot->session = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      2|#define CK_INVALID_HANDLE 0
  ------------------
  411|      2|    slot->slotID = 0;
  412|      2|    slot->defaultFlags = 0;
  413|      2|    slot->refCount = 1;
  414|      2|    slot->askpw = 0;
  415|      2|    slot->timeout = 0;
  416|      2|    slot->mechanismList = NULL;
  417|      2|    slot->mechanismCount = 0;
  418|      2|    slot->cert_array = NULL;
  419|      2|    slot->cert_count = 0;
  420|      2|    slot->slot_name[0] = 0;
  421|      2|    slot->token_name[0] = 0;
  422|      2|    PORT_Memset(slot->serial, ' ', sizeof(slot->serial));
  ------------------
  |  |  182|      2|#define PORT_Memset memset
  ------------------
  423|      2|    PORT_Memset(&slot->tokenInfo, 0, sizeof(slot->tokenInfo));
  ------------------
  |  |  182|      2|#define PORT_Memset memset
  ------------------
  424|      2|    slot->module = NULL;
  425|      2|    slot->authTransact = 0;
  426|      2|    slot->authTime = LL_ZERO;
  ------------------
  |  |   41|      2|#define LL_ZERO     0L
  ------------------
  427|      2|    slot->minPassword = 0;
  428|      2|    slot->maxPassword = 0;
  429|      2|    slot->hasRootCerts = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  430|      2|    slot->hasRootTrust = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  431|      2|    slot->nssToken = NULL;
  432|      2|    slot->profileList = NULL;
  433|      2|    slot->profileCount = 0;
  434|      2|    return slot;
  435|      2|}
PK11_ReferenceSlot:
  440|  3.62M|{
  441|  3.62M|    PR_ATOMIC_INCREMENT(&slot->refCount);
  ------------------
  |  |  122|  3.62M|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  442|  3.62M|    return slot;
  443|  3.62M|}
PK11_DestroySlot:
  448|      2|{
  449|       |    /* free up the cached keys and sessions */
  450|      2|    PK11_CleanKeyList(slot);
  451|       |
  452|       |    /* free up all the sessions on this slot */
  453|      2|    if (slot->functionList) {
  ------------------
  |  Branch (453:9): [True: 2, False: 0]
  ------------------
  454|      2|        PK11_GETTAB(slot)
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
  455|      2|            ->C_CloseAllSessions(slot->slotID);
  456|      2|    }
  457|       |
  458|      2|    if (slot->mechanismList) {
  ------------------
  |  Branch (458:9): [True: 2, False: 0]
  ------------------
  459|      2|        PORT_Free(slot->mechanismList);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
  460|      2|    }
  461|      2|    if (slot->profileList) {
  ------------------
  |  Branch (461:9): [True: 0, False: 2]
  ------------------
  462|      0|        PORT_Free(slot->profileList);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  463|      0|    }
  464|      2|    if (slot->isThreadSafe && slot->sessionLock) {
  ------------------
  |  Branch (464:9): [True: 2, False: 0]
  |  Branch (464:31): [True: 2, False: 0]
  ------------------
  465|      2|        PZ_DestroyLock(slot->sessionLock);
  ------------------
  |  |  244|      2|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  466|      2|    }
  467|      2|    slot->sessionLock = NULL;
  468|      2|    if (slot->freeListLock) {
  ------------------
  |  Branch (468:9): [True: 2, False: 0]
  ------------------
  469|      2|        PZ_DestroyLock(slot->freeListLock);
  ------------------
  |  |  244|      2|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  470|      2|        slot->freeListLock = NULL;
  471|      2|    }
  472|      2|    if (slot->nssTokenLock) {
  ------------------
  |  Branch (472:9): [True: 2, False: 0]
  ------------------
  473|      2|        PZ_DestroyLock(slot->nssTokenLock);
  ------------------
  |  |  244|      2|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  474|      2|        slot->nssTokenLock = NULL;
  475|      2|    }
  476|       |
  477|       |    /* finally Tell our parent module that we've gone away so it can unload */
  478|      2|    if (slot->module) {
  ------------------
  |  Branch (478:9): [True: 2, False: 0]
  ------------------
  479|      2|        SECMOD_SlotDestroyModule(slot->module, PR_TRUE);
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
  480|      2|    }
  481|       |
  482|       |    /* ok, well not quit finally... now we free the memory */
  483|      2|    PORT_Free(slot);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
  484|      2|}
PK11_FreeSlot:
  489|  3.62M|{
  490|  3.62M|    if (PR_ATOMIC_DECREMENT(&slot->refCount) == 0) {
  ------------------
  |  |  123|  3.62M|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (490:9): [True: 2, False: 3.62M]
  ------------------
  491|      2|        PK11_DestroySlot(slot);
  492|      2|    }
  493|  3.62M|}
PK11_EnterSlotMonitor:
  497|   104k|{
  498|   104k|    PZ_Lock(slot->sessionLock);
  ------------------
  |  |  245|   104k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  499|   104k|}
PK11_ExitSlotMonitor:
  503|   104k|{
  504|   104k|    PZ_Unlock(slot->sessionLock);
  ------------------
  |  |  246|   104k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  505|   104k|}
PK11_InitSlotLists:
  831|      1|{
  832|      1|    pk11_InitSlotListStatic(&pk11_seedSlotList);
  833|      1|    pk11_InitSlotListStatic(&pk11_camelliaSlotList);
  834|      1|    pk11_InitSlotListStatic(&pk11_aesSlotList);
  835|      1|    pk11_InitSlotListStatic(&pk11_desSlotList);
  836|      1|    pk11_InitSlotListStatic(&pk11_rc4SlotList);
  837|      1|    pk11_InitSlotListStatic(&pk11_rc2SlotList);
  838|      1|    pk11_InitSlotListStatic(&pk11_rc5SlotList);
  839|      1|    pk11_InitSlotListStatic(&pk11_md5SlotList);
  840|      1|    pk11_InitSlotListStatic(&pk11_md2SlotList);
  841|      1|    pk11_InitSlotListStatic(&pk11_sha1SlotList);
  842|      1|    pk11_InitSlotListStatic(&pk11_rsaSlotList);
  843|      1|    pk11_InitSlotListStatic(&pk11_dsaSlotList);
  844|      1|    pk11_InitSlotListStatic(&pk11_dhSlotList);
  845|      1|    pk11_InitSlotListStatic(&pk11_ecSlotList);
  846|      1|    pk11_InitSlotListStatic(&pk11_ideaSlotList);
  847|      1|    pk11_InitSlotListStatic(&pk11_sslSlotList);
  848|      1|    pk11_InitSlotListStatic(&pk11_tlsSlotList);
  849|      1|    pk11_InitSlotListStatic(&pk11_randomSlotList);
  850|      1|    pk11_InitSlotListStatic(&pk11_sha256SlotList);
  851|      1|    pk11_InitSlotListStatic(&pk11_sha512SlotList);
  852|      1|    return SECSuccess;
  853|      1|}
PK11_DestroySlotLists:
  857|      1|{
  858|      1|    pk11_FreeSlotListStatic(&pk11_seedSlotList);
  859|      1|    pk11_FreeSlotListStatic(&pk11_camelliaSlotList);
  860|      1|    pk11_FreeSlotListStatic(&pk11_aesSlotList);
  861|      1|    pk11_FreeSlotListStatic(&pk11_desSlotList);
  862|      1|    pk11_FreeSlotListStatic(&pk11_rc4SlotList);
  863|      1|    pk11_FreeSlotListStatic(&pk11_rc2SlotList);
  864|      1|    pk11_FreeSlotListStatic(&pk11_rc5SlotList);
  865|      1|    pk11_FreeSlotListStatic(&pk11_md5SlotList);
  866|      1|    pk11_FreeSlotListStatic(&pk11_md2SlotList);
  867|      1|    pk11_FreeSlotListStatic(&pk11_sha1SlotList);
  868|      1|    pk11_FreeSlotListStatic(&pk11_rsaSlotList);
  869|      1|    pk11_FreeSlotListStatic(&pk11_dsaSlotList);
  870|      1|    pk11_FreeSlotListStatic(&pk11_dhSlotList);
  871|      1|    pk11_FreeSlotListStatic(&pk11_ecSlotList);
  872|      1|    pk11_FreeSlotListStatic(&pk11_ideaSlotList);
  873|      1|    pk11_FreeSlotListStatic(&pk11_sslSlotList);
  874|      1|    pk11_FreeSlotListStatic(&pk11_tlsSlotList);
  875|      1|    pk11_FreeSlotListStatic(&pk11_randomSlotList);
  876|      1|    pk11_FreeSlotListStatic(&pk11_sha256SlotList);
  877|      1|    pk11_FreeSlotListStatic(&pk11_sha512SlotList);
  878|      1|    return;
  879|      1|}
PK11_GetSlotList:
  884|  67.6k|{
  885|       |/* XXX a workaround for Bugzilla bug #55267 */
  886|       |#if defined(HPUX) && defined(__LP64__)
  887|       |    if (CKM_INVALID_MECHANISM == type)
  888|       |        return NULL;
  889|       |#endif
  890|  67.6k|    switch (type) {
  ------------------
  |  Branch (890:13): [True: 2.70k, False: 64.9k]
  ------------------
  891|      2|        case CKM_SEED_CBC:
  ------------------
  |  | 1157|      2|#define CKM_SEED_CBC 0x00000652UL
  ------------------
  |  Branch (891:9): [True: 2, False: 67.6k]
  ------------------
  892|      2|        case CKM_SEED_ECB:
  ------------------
  |  | 1156|      2|#define CKM_SEED_ECB 0x00000651UL
  ------------------
  |  Branch (892:9): [True: 0, False: 67.6k]
  ------------------
  893|      2|            return &pk11_seedSlotList;
  894|      2|        case CKM_CAMELLIA_CBC:
  ------------------
  |  | 1137|      2|#define CKM_CAMELLIA_CBC 0x00000552UL
  ------------------
  |  Branch (894:9): [True: 2, False: 67.6k]
  ------------------
  895|      2|        case CKM_CAMELLIA_ECB:
  ------------------
  |  | 1136|      2|#define CKM_CAMELLIA_ECB 0x00000551UL
  ------------------
  |  Branch (895:9): [True: 0, False: 67.6k]
  ------------------
  896|      2|            return &pk11_camelliaSlotList;
  897|      2|        case CKM_AES_CBC:
  ------------------
  |  | 1108|      2|#define CKM_AES_CBC 0x00001082UL
  ------------------
  |  Branch (897:9): [True: 2, False: 67.6k]
  ------------------
  898|      2|        case CKM_AES_CCM:
  ------------------
  |  | 1116|      2|#define CKM_AES_CCM 0x00001088UL
  ------------------
  |  Branch (898:9): [True: 0, False: 67.6k]
  ------------------
  899|      2|        case CKM_AES_CTR:
  ------------------
  |  | 1113|      2|#define CKM_AES_CTR 0x00001086UL
  ------------------
  |  Branch (899:9): [True: 0, False: 67.6k]
  ------------------
  900|      2|        case CKM_AES_CTS:
  ------------------
  |  | 1117|      2|#define CKM_AES_CTS 0x00001089UL
  ------------------
  |  Branch (900:9): [True: 0, False: 67.6k]
  ------------------
  901|      2|        case CKM_AES_GCM:
  ------------------
  |  | 1115|      2|#define CKM_AES_GCM 0x00001087UL
  ------------------
  |  Branch (901:9): [True: 0, False: 67.6k]
  ------------------
  902|      2|        case CKM_AES_ECB:
  ------------------
  |  | 1107|      2|#define CKM_AES_ECB 0x00001081UL
  ------------------
  |  Branch (902:9): [True: 0, False: 67.6k]
  ------------------
  903|      2|            return &pk11_aesSlotList;
  904|      2|        case CKM_DES_CBC:
  ------------------
  |  |  816|      2|#define CKM_DES_CBC 0x00000122UL
  ------------------
  |  Branch (904:9): [True: 2, False: 67.6k]
  ------------------
  905|      2|        case CKM_DES_ECB:
  ------------------
  |  |  815|      2|#define CKM_DES_ECB 0x00000121UL
  ------------------
  |  Branch (905:9): [True: 0, False: 67.6k]
  ------------------
  906|      2|        case CKM_DES3_ECB:
  ------------------
  |  |  825|      2|#define CKM_DES3_ECB 0x00000132UL
  ------------------
  |  Branch (906:9): [True: 0, False: 67.6k]
  ------------------
  907|      2|        case CKM_DES3_CBC:
  ------------------
  |  |  826|      2|#define CKM_DES3_CBC 0x00000133UL
  ------------------
  |  Branch (907:9): [True: 0, False: 67.6k]
  ------------------
  908|      2|            return &pk11_desSlotList;
  909|      2|        case CKM_RC4:
  ------------------
  |  |  813|      2|#define CKM_RC4 0x00000111UL
  ------------------
  |  Branch (909:9): [True: 2, False: 67.6k]
  ------------------
  910|      2|            return &pk11_rc4SlotList;
  911|      0|        case CKM_RC5_CBC:
  ------------------
  |  |  943|      0|#define CKM_RC5_CBC 0x00000332UL
  ------------------
  |  Branch (911:9): [True: 0, False: 67.6k]
  ------------------
  912|      0|            return &pk11_rc5SlotList;
  913|  15.1k|        case CKM_SHA_1:
  ------------------
  |  |  859|  15.1k|#define CKM_SHA_1 0x00000220UL
  ------------------
  |  Branch (913:9): [True: 15.1k, False: 52.4k]
  ------------------
  914|  15.1k|            return &pk11_sha1SlotList;
  915|      0|        case CKM_SHA224:
  ------------------
  |  |  887|      0|#define CKM_SHA224 0x00000255UL
  ------------------
  |  Branch (915:9): [True: 0, False: 67.6k]
  ------------------
  916|  8.92k|        case CKM_SHA256:
  ------------------
  |  |  876|  8.92k|#define CKM_SHA256 0x00000250UL
  ------------------
  |  Branch (916:9): [True: 8.92k, False: 58.6k]
  ------------------
  917|  8.92k|        case CKM_SHA3_224:
  ------------------
  |  |  902|  8.92k|#define CKM_SHA3_224 0x000002B5UL
  ------------------
  |  Branch (917:9): [True: 0, False: 67.6k]
  ------------------
  918|  8.92k|        case CKM_SHA3_256:
  ------------------
  |  |  898|  8.92k|#define CKM_SHA3_256 0x000002B0UL
  ------------------
  |  Branch (918:9): [True: 0, False: 67.6k]
  ------------------
  919|  8.92k|            return &pk11_sha256SlotList;
  920|  6.85k|        case CKM_SHA384:
  ------------------
  |  |  879|  6.85k|#define CKM_SHA384 0x00000260UL
  ------------------
  |  Branch (920:9): [True: 6.85k, False: 60.7k]
  ------------------
  921|  7.36k|        case CKM_SHA512:
  ------------------
  |  |  882|  7.36k|#define CKM_SHA512 0x00000270UL
  ------------------
  |  Branch (921:9): [True: 506, False: 67.1k]
  ------------------
  922|  7.36k|        case CKM_SHA3_384:
  ------------------
  |  |  906|  7.36k|#define CKM_SHA3_384 0x000002C0UL
  ------------------
  |  Branch (922:9): [True: 0, False: 67.6k]
  ------------------
  923|  7.36k|        case CKM_SHA3_512:
  ------------------
  |  |  910|  7.36k|#define CKM_SHA3_512 0x000002D0UL
  ------------------
  |  Branch (923:9): [True: 0, False: 67.6k]
  ------------------
  924|  7.36k|            return &pk11_sha512SlotList;
  925|    490|        case CKM_MD5:
  ------------------
  |  |  853|    490|#define CKM_MD5 0x00000210UL
  ------------------
  |  Branch (925:9): [True: 490, False: 67.1k]
  ------------------
  926|    490|            return &pk11_md5SlotList;
  927|      2|        case CKM_MD2:
  ------------------
  |  |  847|      2|#define CKM_MD2 0x00000200UL
  ------------------
  |  Branch (927:9): [True: 2, False: 67.6k]
  ------------------
  928|      2|            return &pk11_md2SlotList;
  929|      0|        case CKM_RC2_ECB:
  ------------------
  |  |  804|      0|#define CKM_RC2_ECB 0x00000101UL
  ------------------
  |  Branch (929:9): [True: 0, False: 67.6k]
  ------------------
  930|      2|        case CKM_RC2_CBC:
  ------------------
  |  |  805|      2|#define CKM_RC2_CBC 0x00000102UL
  ------------------
  |  Branch (930:9): [True: 2, False: 67.6k]
  ------------------
  931|      2|            return &pk11_rc2SlotList;
  932|    133|        case CKM_RSA_PKCS:
  ------------------
  |  |  720|    133|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (932:9): [True: 133, False: 67.4k]
  ------------------
  933|    133|        case CKM_RSA_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  719|    133|#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL
  ------------------
  |  Branch (933:9): [True: 0, False: 67.6k]
  ------------------
  934|    133|        case CKM_RSA_X_509:
  ------------------
  |  |  722|    133|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (934:9): [True: 0, False: 67.6k]
  ------------------
  935|    133|            return &pk11_rsaSlotList;
  936|    915|        case CKM_DSA:
  ------------------
  |  |  745|    915|#define CKM_DSA 0x00000011UL
  ------------------
  |  Branch (936:9): [True: 915, False: 66.6k]
  ------------------
  937|    915|            return &pk11_dsaSlotList;
  938|  1.60k|        case CKM_DH_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  758|  1.60k|#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
  ------------------
  |  Branch (938:9): [True: 1.60k, False: 66.0k]
  ------------------
  939|  1.60k|        case CKM_DH_PKCS_DERIVE:
  ------------------
  |  |  759|  1.60k|#define CKM_DH_PKCS_DERIVE 0x00000021UL
  ------------------
  |  Branch (939:9): [True: 2, False: 67.6k]
  ------------------
  940|  1.60k|            return &pk11_dhSlotList;
  941|      2|        case CKM_EDDSA:
  ------------------
  |  | 1174|      2|#define CKM_EDDSA 0x00001057UL
  ------------------
  |  Branch (941:9): [True: 2, False: 67.6k]
  ------------------
  942|      2|        case CKM_EC_EDWARDS_KEY_PAIR_GEN:
  ------------------
  |  | 1172|      2|#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL
  ------------------
  |  Branch (942:9): [True: 0, False: 67.6k]
  ------------------
  943|     55|        case CKM_ECDSA:
  ------------------
  |  | 1074|     55|#define CKM_ECDSA 0x00001041UL
  ------------------
  |  Branch (943:9): [True: 53, False: 67.5k]
  ------------------
  944|    174|        case CKM_ECDSA_SHA1:
  ------------------
  |  | 1075|    174|#define CKM_ECDSA_SHA1 0x00001042UL
  ------------------
  |  Branch (944:9): [True: 119, False: 67.4k]
  ------------------
  945|    174|        case CKM_EC_KEY_PAIR_GEN: /* aka CKM_ECDSA_KEY_PAIR_GEN */
  ------------------
  |  | 1072|    174|#define CKM_EC_KEY_PAIR_GEN 0x00001040UL
  ------------------
  |  Branch (945:9): [True: 0, False: 67.6k]
  ------------------
  946|    174|        case CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN:
  ------------------
  |  |  274|    174|#define CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN (CKM_NSS + 47)
  |  |  ------------------
  |  |  |  |  162|    174|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    174|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    174|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (946:9): [True: 0, False: 67.6k]
  ------------------
  947|  11.8k|        case CKM_ECDH1_DERIVE:
  ------------------
  |  | 1086|  11.8k|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
  |  Branch (947:9): [True: 11.6k, False: 55.9k]
  ------------------
  948|  11.8k|        case CKM_NSS_KYBER_KEY_PAIR_GEN: /* Bug 1893029 */
  ------------------
  |  |  267|  11.8k|#define CKM_NSS_KYBER_KEY_PAIR_GEN (CKM_NSS + 45)
  |  |  ------------------
  |  |  |  |  162|  11.8k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  11.8k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  11.8k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (948:9): [True: 0, False: 67.6k]
  ------------------
  949|  11.8k|        case CKM_NSS_KYBER:
  ------------------
  |  |  268|  11.8k|#define CKM_NSS_KYBER (CKM_NSS + 46)
  |  |  ------------------
  |  |  |  |  162|  11.8k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  11.8k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  11.8k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (949:9): [True: 0, False: 67.6k]
  ------------------
  950|  11.8k|        case CKM_NSS_ML_KEM_KEY_PAIR_GEN: /* Bug 1893029 */
  ------------------
  |  |  277|  11.8k|#define CKM_NSS_ML_KEM_KEY_PAIR_GEN (CKM_NSS + 48)
  |  |  ------------------
  |  |  |  |  162|  11.8k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  11.8k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  11.8k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (950:9): [True: 0, False: 67.6k]
  ------------------
  951|  11.8k|        case CKM_NSS_ML_KEM:
  ------------------
  |  |  278|  11.8k|#define CKM_NSS_ML_KEM (CKM_NSS + 49)
  |  |  ------------------
  |  |  |  |  162|  11.8k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  11.8k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  11.8k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (951:9): [True: 0, False: 67.6k]
  ------------------
  952|  11.8k|            return &pk11_ecSlotList;
  953|  1.48k|        case CKM_SSL3_PRE_MASTER_KEY_GEN:
  ------------------
  |  |  959|  1.48k|#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL
  ------------------
  |  Branch (953:9): [True: 1.48k, False: 66.1k]
  ------------------
  954|  1.48k|        case CKM_SSL3_MASTER_KEY_DERIVE:
  ------------------
  |  |  960|  1.48k|#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL
  ------------------
  |  Branch (954:9): [True: 0, False: 67.6k]
  ------------------
  955|  1.48k|        case CKM_SSL3_SHA1_MAC:
  ------------------
  |  |  976|  1.48k|#define CKM_SSL3_SHA1_MAC 0x00000381UL
  ------------------
  |  Branch (955:9): [True: 0, False: 67.6k]
  ------------------
  956|  1.48k|        case CKM_SSL3_MD5_MAC:
  ------------------
  |  |  975|  1.48k|#define CKM_SSL3_MD5_MAC 0x00000380UL
  ------------------
  |  Branch (956:9): [True: 0, False: 67.6k]
  ------------------
  957|  1.48k|            return &pk11_sslSlotList;
  958|      2|        case CKM_TLS_MASTER_KEY_DERIVE:
  ------------------
  |  |  968|      2|#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375UL
  ------------------
  |  Branch (958:9): [True: 2, False: 67.6k]
  ------------------
  959|      2|        case CKM_TLS_KEY_AND_MAC_DERIVE:
  ------------------
  |  |  969|      2|#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL
  ------------------
  |  Branch (959:9): [True: 0, False: 67.6k]
  ------------------
  960|      2|        case CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256:
  ------------------
  |  |  235|      2|#define CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256 (CKM_NSS + 23)
  |  |  ------------------
  |  |  |  |  162|      2|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      2|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      2|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (960:9): [True: 0, False: 67.6k]
  ------------------
  961|      2|            return &pk11_tlsSlotList;
  962|      0|        case CKM_IDEA_CBC:
  ------------------
  |  |  949|      0|#define CKM_IDEA_CBC 0x00000342UL
  ------------------
  |  Branch (962:9): [True: 0, False: 67.6k]
  ------------------
  963|      0|        case CKM_IDEA_ECB:
  ------------------
  |  |  948|      0|#define CKM_IDEA_ECB 0x00000341UL
  ------------------
  |  Branch (963:9): [True: 0, False: 67.6k]
  ------------------
  964|      0|            return &pk11_ideaSlotList;
  965|  17.0k|        case CKM_FAKE_RANDOM:
  ------------------
  |  |  154|  17.0k|#define CKM_FAKE_RANDOM 0x80000efeUL
  ------------------
  |  Branch (965:9): [True: 17.0k, False: 50.5k]
  ------------------
  966|  17.0k|            return &pk11_randomSlotList;
  967|  67.6k|    }
  968|  2.70k|    return NULL;
  969|  67.6k|}
PK11_LoadSlotList:
  978|      2|{
  979|      2|    int i;
  980|       |
  981|      3|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (981:17): [True: 2, False: 1]
  ------------------
  982|      2|        if (psi[i].slotID == slot->slotID)
  ------------------
  |  Branch (982:13): [True: 1, False: 1]
  ------------------
  983|      1|            break;
  984|      2|    }
  985|       |
  986|      2|    if (i == count)
  ------------------
  |  Branch (986:9): [True: 1, False: 1]
  ------------------
  987|      1|        return;
  988|       |
  989|      1|    slot->defaultFlags = psi[i].defaultFlags;
  990|      1|    slot->askpw = psi[i].askpw;
  991|      1|    slot->timeout = psi[i].timeout;
  992|      1|    slot->hasRootCerts = psi[i].hasRootCerts;
  993|       |
  994|       |    /* if the slot is already disabled, don't load them into the
  995|       |     * default slot lists. We get here so we can save the default
  996|       |     * list value. */
  997|      1|    if (slot->disabled)
  ------------------
  |  Branch (997:9): [True: 0, False: 1]
  ------------------
  998|      0|        return;
  999|       |
 1000|       |    /* if the user has disabled us, don't load us in */
 1001|      1|    if (slot->defaultFlags & PK11_DISABLE_FLAG) {
  ------------------
  |  |   37|      1|#define PK11_DISABLE_FLAG 0x40000000L
  ------------------
  |  Branch (1001:9): [True: 0, False: 1]
  ------------------
 1002|      0|        slot->disabled = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1003|      0|        slot->reason = PK11_DIS_USER_SELECTED;
 1004|       |        /* free up sessions and things?? */
 1005|      0|        return;
 1006|      0|    }
 1007|       |
 1008|     23|    for (i = 0; i < num_pk11_default_mechanisms; i++) {
  ------------------
  |  Branch (1008:17): [True: 22, False: 1]
  ------------------
 1009|     22|        if (slot->defaultFlags & PK11_DefaultArray[i].flag) {
  ------------------
  |  Branch (1009:13): [True: 18, False: 4]
  ------------------
 1010|     18|            CK_MECHANISM_TYPE mechanism = PK11_DefaultArray[i].mechanism;
 1011|     18|            PK11SlotList *slotList = PK11_GetSlotList(mechanism);
 1012|       |
 1013|     18|            if (slotList)
  ------------------
  |  Branch (1013:17): [True: 18, False: 0]
  ------------------
 1014|     18|                PK11_AddSlotToList(slotList, slot, PR_FALSE);
  ------------------
  |  |  438|     18|#define PR_FALSE 0
  ------------------
 1015|     18|        }
 1016|     22|    }
 1017|       |
 1018|      1|    return;
 1019|      1|}
PK11_ClearSlotList:
 1065|      2|{
 1066|      2|    int i;
 1067|       |
 1068|      2|    if (slot->disabled)
  ------------------
  |  Branch (1068:9): [True: 0, False: 2]
  ------------------
 1069|      0|        return;
 1070|      2|    if (slot->defaultFlags == 0)
  ------------------
  |  Branch (1070:9): [True: 1, False: 1]
  ------------------
 1071|      1|        return;
 1072|       |
 1073|     23|    for (i = 0; i < num_pk11_default_mechanisms; i++) {
  ------------------
  |  Branch (1073:17): [True: 22, False: 1]
  ------------------
 1074|     22|        if (slot->defaultFlags & PK11_DefaultArray[i].flag) {
  ------------------
  |  Branch (1074:13): [True: 18, False: 4]
  ------------------
 1075|     18|            CK_MECHANISM_TYPE mechanism = PK11_DefaultArray[i].mechanism;
 1076|     18|            PK11SlotList *slotList = PK11_GetSlotList(mechanism);
 1077|     18|            PK11SlotListElement *le = NULL;
 1078|       |
 1079|     18|            if (slotList)
  ------------------
  |  Branch (1079:17): [True: 18, False: 0]
  ------------------
 1080|     18|                le = PK11_FindSlotElement(slotList, slot);
 1081|       |
 1082|     18|            if (le) {
  ------------------
  |  Branch (1082:17): [True: 18, False: 0]
  ------------------
 1083|     18|                PK11_DeleteSlotFromList(slotList, le);
 1084|     18|                PK11_FreeSlotListElement(slotList, le);
 1085|     18|            }
 1086|     18|        }
 1087|     22|    }
 1088|      1|}
PK11_MakeString:
 1099|      4|{
 1100|      4|    int i;
 1101|      4|    char *newString;
 1102|     71|    for (i = (stringLen - 1); i >= 0; i--) {
  ------------------
  |  Branch (1102:31): [True: 71, False: 0]
  ------------------
 1103|     71|        if (staticString[i] != ' ')
  ------------------
  |  Branch (1103:13): [True: 4, False: 67]
  ------------------
 1104|      4|            break;
 1105|     71|    }
 1106|       |    /* move i to point to the last space */
 1107|      4|    i++;
 1108|      4|    if (arena) {
  ------------------
  |  Branch (1108:9): [True: 0, False: 4]
  ------------------
 1109|      0|        newString = (char *)PORT_ArenaAlloc(arena, i + 1 /* space for NULL */);
  ------------------
  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
 1110|      4|    } else if (space) {
  ------------------
  |  Branch (1110:16): [True: 4, False: 0]
  ------------------
 1111|      4|        newString = space;
 1112|      4|    } else {
 1113|      0|        newString = (char *)PORT_Alloc(i + 1 /* space for NULL */);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1114|      0|    }
 1115|      4|    if (newString == NULL)
  ------------------
  |  Branch (1115:9): [True: 0, False: 4]
  ------------------
 1116|      0|        return NULL;
 1117|       |
 1118|      4|    if (i)
  ------------------
  |  Branch (1118:9): [True: 4, False: 0]
  ------------------
 1119|      4|        PORT_Memcpy(newString, staticString, i);
  ------------------
  |  |  180|      4|#define PORT_Memcpy memcpy
  ------------------
 1120|      4|    newString[i] = 0;
 1121|       |
 1122|      4|    return newString;
 1123|      4|}
PK11_ReadMechanismList:
 1153|      2|{
 1154|      2|    CK_ULONG count;
 1155|      2|    CK_RV crv;
 1156|      2|    PRUint32 i;
 1157|       |
 1158|      2|    if (slot->mechanismList) {
  ------------------
  |  Branch (1158:9): [True: 0, False: 2]
  ------------------
 1159|      0|        PORT_Free(slot->mechanismList);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1160|      0|        slot->mechanismList = NULL;
 1161|      0|    }
 1162|      2|    slot->mechanismCount = 0;
 1163|       |
 1164|      2|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (1164:9): [True: 0, False: 2]
  ------------------
 1165|      0|        PK11_EnterSlotMonitor(slot);
 1166|      2|    crv = PK11_GETTAB(slot)->C_GetMechanismList(slot->slotID, NULL, &count);
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1167|      2|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1167:9): [True: 0, False: 2]
  ------------------
 1168|      0|        if (!slot->isThreadSafe)
  ------------------
  |  Branch (1168:13): [True: 0, False: 0]
  ------------------
 1169|      0|            PK11_ExitSlotMonitor(slot);
 1170|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1171|      0|        return SECFailure;
 1172|      0|    }
 1173|       |
 1174|      2|    slot->mechanismList = (CK_MECHANISM_TYPE *)
 1175|      2|        PORT_Alloc(count * sizeof(CK_MECHANISM_TYPE));
  ------------------
  |  |   52|      2|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1176|      2|    if (slot->mechanismList == NULL) {
  ------------------
  |  Branch (1176:9): [True: 0, False: 2]
  ------------------
 1177|      0|        if (!slot->isThreadSafe)
  ------------------
  |  Branch (1177:13): [True: 0, False: 0]
  ------------------
 1178|      0|            PK11_ExitSlotMonitor(slot);
 1179|      0|        return SECFailure;
 1180|      0|    }
 1181|      2|    crv = PK11_GETTAB(slot)->C_GetMechanismList(slot->slotID,
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1182|      2|                                                slot->mechanismList, &count);
 1183|      2|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (1183:9): [True: 0, False: 2]
  ------------------
 1184|      0|        PK11_ExitSlotMonitor(slot);
 1185|      2|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1185:9): [True: 0, False: 2]
  ------------------
 1186|      0|        PORT_Free(slot->mechanismList);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1187|      0|        slot->mechanismList = NULL;
 1188|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1189|      0|        return SECSuccess;
 1190|      0|    }
 1191|      2|    slot->mechanismCount = count;
 1192|      2|    PORT_Memset(slot->mechanismBits, 0, sizeof(slot->mechanismBits));
  ------------------
  |  |  182|      2|#define PORT_Memset memset
  ------------------
 1193|       |
 1194|    409|    for (i = 0; i < count; i++) {
  ------------------
  |  Branch (1194:17): [True: 407, False: 2]
  ------------------
 1195|    407|        CK_MECHANISM_TYPE mech = slot->mechanismList[i];
 1196|    407|        if (mech < 0x7ff) {
  ------------------
  |  Branch (1196:13): [True: 240, False: 167]
  ------------------
 1197|    240|            slot->mechanismBits[mech & 0xff] |= 1 << (mech >> 8);
 1198|    240|        }
 1199|    407|    }
 1200|      2|    return SECSuccess;
 1201|      2|}
PK11_InitToken:
 1281|      2|{
 1282|      2|    CK_RV crv;
 1283|      2|    SECStatus rv;
 1284|      2|    PRStatus status;
 1285|      2|    NSSToken *nssToken;
 1286|       |
 1287|       |    /* set the slot flags to the current token values */
 1288|      2|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (1288:9): [True: 0, False: 2]
  ------------------
 1289|      0|        PK11_EnterSlotMonitor(slot);
 1290|      2|    crv = PK11_GETTAB(slot)->C_GetTokenInfo(slot->slotID, &slot->tokenInfo);
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1291|      2|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (1291:9): [True: 0, False: 2]
  ------------------
 1292|      0|        PK11_ExitSlotMonitor(slot);
 1293|      2|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1293:9): [True: 0, False: 2]
  ------------------
 1294|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1295|      0|        return SECFailure;
 1296|      0|    }
 1297|       |
 1298|       |    /* set the slot flags to the current token values */
 1299|      2|    slot->series++; /* allow other objects to detect that the
 1300|       |                     * slot is different */
 1301|      2|    slot->flags = slot->tokenInfo.flags;
 1302|      2|    slot->needLogin = ((slot->tokenInfo.flags & CKF_LOGIN_REQUIRED) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  176|      2|#define CKF_LOGIN_REQUIRED 0x00000004UL       /* user must \
  ------------------
                  slot->needLogin = ((slot->tokenInfo.flags & CKF_LOGIN_REQUIRED) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                  slot->needLogin = ((slot->tokenInfo.flags & CKF_LOGIN_REQUIRED) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  |  Branch (1302:24): [True: 0, False: 2]
  ------------------
 1303|      2|    slot->readOnly = ((slot->tokenInfo.flags & CKF_WRITE_PROTECTED) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  173|      2|#define CKF_WRITE_PROTECTED 0x00000002UL      /* token is \
  ------------------
                  slot->readOnly = ((slot->tokenInfo.flags & CKF_WRITE_PROTECTED) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
                  slot->readOnly = ((slot->tokenInfo.flags & CKF_WRITE_PROTECTED) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (1303:23): [True: 2, False: 0]
  ------------------
 1304|       |
 1305|      2|    slot->hasRandom = ((slot->tokenInfo.flags & CKF_RNG) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  171|      2|#define CKF_RNG 0x00000001UL                  /* has random # \
  ------------------
                  slot->hasRandom = ((slot->tokenInfo.flags & CKF_RNG) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
                  slot->hasRandom = ((slot->tokenInfo.flags & CKF_RNG) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (1305:24): [True: 2, False: 0]
  ------------------
 1306|      2|    slot->protectedAuthPath =
 1307|      2|        ((slot->tokenInfo.flags & CKF_PROTECTED_AUTHENTICATION_PATH)
  ------------------
  |  |  195|      2|#define CKF_PROTECTED_AUTHENTICATION_PATH 0x00000100UL
  ------------------
  |  Branch (1307:10): [True: 0, False: 2]
  ------------------
 1308|      2|             ? PR_TRUE
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1309|      2|             : PR_FALSE);
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 1310|      2|    slot->lastLoginCheck = 0;
 1311|      2|    slot->lastState = 0;
 1312|       |    /* on some platforms Active Card incorrectly sets the
 1313|       |     * CKF_PROTECTED_AUTHENTICATION_PATH bit when it doesn't mean to. */
 1314|      2|    if (slot->isActiveCard) {
  ------------------
  |  Branch (1314:9): [True: 0, False: 2]
  ------------------
 1315|      0|        slot->protectedAuthPath = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1316|      0|    }
 1317|      2|    (void)PK11_MakeString(NULL, slot->token_name,
 1318|      2|                          (char *)slot->tokenInfo.label, sizeof(slot->tokenInfo.label));
 1319|      2|    slot->minPassword = slot->tokenInfo.ulMinPinLen;
 1320|      2|    slot->maxPassword = slot->tokenInfo.ulMaxPinLen;
 1321|      2|    PORT_Memcpy(slot->serial, slot->tokenInfo.serialNumber, sizeof(slot->serial));
  ------------------
  |  |  180|      2|#define PORT_Memcpy memcpy
  ------------------
 1322|       |
 1323|      2|    nssToken = PK11Slot_GetNSSToken(slot);
 1324|      2|    nssToken_UpdateName(nssToken); /* null token is OK */
 1325|      2|    (void)nssToken_Destroy(nssToken);
 1326|       |
 1327|      2|    slot->defRWSession = (PRBool)((!slot->readOnly) &&
  ------------------
  |  Branch (1327:35): [True: 0, False: 2]
  ------------------
 1328|      2|                                  (slot->tokenInfo.ulMaxSessionCount == 1));
  ------------------
  |  Branch (1328:35): [True: 0, False: 0]
  ------------------
 1329|      2|    rv = PK11_ReadMechanismList(slot);
 1330|      2|    if (rv != SECSuccess)
  ------------------
  |  Branch (1330:9): [True: 0, False: 2]
  ------------------
 1331|      0|        return rv;
 1332|       |
 1333|      2|    slot->hasRSAInfo = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 1334|      2|    slot->RSAInfoFlags = 0;
 1335|       |
 1336|       |    /* initialize the maxKeyCount value */
 1337|      2|    if (slot->tokenInfo.ulMaxSessionCount == 0) {
  ------------------
  |  Branch (1337:9): [True: 2, False: 0]
  ------------------
 1338|      2|        slot->maxKeyCount = 800; /* should be #define or a config param */
 1339|      2|    } else if (slot->tokenInfo.ulMaxSessionCount < 20) {
  ------------------
  |  Branch (1339:16): [True: 0, False: 0]
  ------------------
 1340|       |        /* don't have enough sessions to keep that many keys around */
 1341|      0|        slot->maxKeyCount = 0;
 1342|      0|    } else {
 1343|      0|        slot->maxKeyCount = slot->tokenInfo.ulMaxSessionCount / 2;
 1344|      0|    }
 1345|       |
 1346|       |    /* Make sure our session handle is valid */
 1347|      2|    if (slot->session == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      2|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1347:9): [True: 2, False: 0]
  ------------------
 1348|       |        /* we know we don't have a valid session, go get one */
 1349|      2|        CK_SESSION_HANDLE session;
 1350|       |
 1351|       |        /* session should be Readonly, serial */
 1352|      2|        if (!slot->isThreadSafe)
  ------------------
  |  Branch (1352:13): [True: 0, False: 2]
  ------------------
 1353|      0|            PK11_EnterSlotMonitor(slot);
 1354|      2|        crv = PK11_GETTAB(slot)->C_OpenSession(slot->slotID,
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1355|      2|                                               (slot->defRWSession ? CKF_RW_SESSION : 0) | CKF_SERIAL_SESSION,
  ------------------
  |  |  302|      0|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
                                                             (slot->defRWSession ? CKF_RW_SESSION : 0) | CKF_SERIAL_SESSION,
  ------------------
  |  |  303|      2|#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */
  ------------------
  |  Branch (1355:49): [True: 0, False: 2]
  ------------------
 1356|      2|                                               slot, pk11_notify, &session);
 1357|      2|        if (!slot->isThreadSafe)
  ------------------
  |  Branch (1357:13): [True: 0, False: 2]
  ------------------
 1358|      0|            PK11_ExitSlotMonitor(slot);
 1359|      2|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1359:13): [True: 0, False: 2]
  ------------------
 1360|      0|            PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1361|      0|            return SECFailure;
 1362|      0|        }
 1363|      2|        slot->session = session;
 1364|      2|    } else {
 1365|       |        /* The session we have may be defunct (the token associated with it)
 1366|       |         * has been removed   */
 1367|      0|        CK_SESSION_INFO sessionInfo;
 1368|       |
 1369|      0|        if (!slot->isThreadSafe)
  ------------------
  |  Branch (1369:13): [True: 0, False: 0]
  ------------------
 1370|      0|            PK11_EnterSlotMonitor(slot);
 1371|      0|        crv = PK11_GETTAB(slot)->C_GetSessionInfo(slot->session, &sessionInfo);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1372|      0|        if (crv == CKR_DEVICE_ERROR) {
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
  |  Branch (1372:13): [True: 0, False: 0]
  ------------------
 1373|      0|            PK11_GETTAB(slot)
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1374|      0|                ->C_CloseSession(slot->session);
 1375|      0|            crv = CKR_SESSION_CLOSED;
  ------------------
  |  | 1463|      0|#define CKR_SESSION_CLOSED 0x000000B0UL
  ------------------
 1376|      0|        }
 1377|      0|        if ((crv == CKR_SESSION_CLOSED) || (crv == CKR_SESSION_HANDLE_INVALID)) {
  ------------------
  |  | 1463|      0|#define CKR_SESSION_CLOSED 0x000000B0UL
  ------------------
                      if ((crv == CKR_SESSION_CLOSED) || (crv == CKR_SESSION_HANDLE_INVALID)) {
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
  |  Branch (1377:13): [True: 0, False: 0]
  |  Branch (1377:44): [True: 0, False: 0]
  ------------------
 1378|      0|            crv = PK11_GETTAB(slot)->C_OpenSession(slot->slotID,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1379|      0|                                                   (slot->defRWSession ? CKF_RW_SESSION : 0) | CKF_SERIAL_SESSION,
  ------------------
  |  |  302|      0|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
                                                                 (slot->defRWSession ? CKF_RW_SESSION : 0) | CKF_SERIAL_SESSION,
  ------------------
  |  |  303|      0|#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */
  ------------------
  |  Branch (1379:53): [True: 0, False: 0]
  ------------------
 1380|      0|                                                   slot, pk11_notify, &slot->session);
 1381|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1381:17): [True: 0, False: 0]
  ------------------
 1382|      0|                PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1383|      0|                slot->session = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
 1384|      0|                if (!slot->isThreadSafe)
  ------------------
  |  Branch (1384:21): [True: 0, False: 0]
  ------------------
 1385|      0|                    PK11_ExitSlotMonitor(slot);
 1386|      0|                return SECFailure;
 1387|      0|            }
 1388|      0|        }
 1389|      0|        if (!slot->isThreadSafe)
  ------------------
  |  Branch (1389:13): [True: 0, False: 0]
  ------------------
 1390|      0|            PK11_ExitSlotMonitor(slot);
 1391|      0|    }
 1392|       |
 1393|      2|    nssToken = PK11Slot_GetNSSToken(slot);
 1394|      2|    status = nssToken_Refresh(nssToken); /* null token is OK */
 1395|      2|    (void)nssToken_Destroy(nssToken);
 1396|      2|    if (status != PR_SUCCESS)
  ------------------
  |  Branch (1396:9): [True: 0, False: 2]
  ------------------
 1397|      0|        return SECFailure;
 1398|       |
 1399|       |    /* Not all tokens have profile objects or even recognize what profile
 1400|       |     * objects are it's OK for pk11_ReadProfileList to fail */
 1401|      2|    (void)pk11_ReadProfileList(slot);
 1402|       |
 1403|      2|    if (!(slot->isInternal) && (slot->hasRandom)) {
  ------------------
  |  Branch (1403:9): [True: 0, False: 2]
  |  Branch (1403:32): [True: 0, False: 0]
  ------------------
 1404|       |        /* if this slot has a random number generater, use it to add entropy
 1405|       |         * to the internal slot. */
 1406|      0|        PK11SlotInfo *int_slot = PK11_GetInternalSlot();
 1407|       |
 1408|      0|        if (int_slot) {
  ------------------
  |  Branch (1408:13): [True: 0, False: 0]
  ------------------
 1409|      0|            unsigned char random_bytes[32];
 1410|       |
 1411|       |            /* if this slot can issue random numbers, get some entropy from
 1412|       |             * that random number generater and give it to our internal token.
 1413|       |             */
 1414|      0|            PK11_EnterSlotMonitor(slot);
 1415|      0|            crv = PK11_GETTAB(slot)->C_GenerateRandom(slot->session, random_bytes, sizeof(random_bytes));
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1416|      0|            PK11_ExitSlotMonitor(slot);
 1417|      0|            if (crv == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1417:17): [True: 0, False: 0]
  ------------------
 1418|      0|                PK11_EnterSlotMonitor(int_slot);
 1419|      0|                PK11_GETTAB(int_slot)
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1420|      0|                    ->C_SeedRandom(int_slot->session,
 1421|      0|                                   random_bytes, sizeof(random_bytes));
 1422|      0|                PK11_ExitSlotMonitor(int_slot);
 1423|      0|            }
 1424|       |
 1425|       |            /* Now return the favor and send entropy to the token's random
 1426|       |             * number generater */
 1427|      0|            PK11_EnterSlotMonitor(int_slot);
 1428|      0|            crv = PK11_GETTAB(int_slot)->C_GenerateRandom(int_slot->session,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1429|      0|                                                          random_bytes, sizeof(random_bytes));
 1430|      0|            PK11_ExitSlotMonitor(int_slot);
 1431|      0|            if (crv == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1431:17): [True: 0, False: 0]
  ------------------
 1432|      0|                PK11_EnterSlotMonitor(slot);
 1433|      0|                crv = PK11_GETTAB(slot)->C_SeedRandom(slot->session,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1434|      0|                                                      random_bytes, sizeof(random_bytes));
 1435|      0|                PK11_ExitSlotMonitor(slot);
 1436|      0|            }
 1437|      0|            PK11_FreeSlot(int_slot);
 1438|      0|        }
 1439|      0|    }
 1440|       |    /* work around a problem in softoken where it incorrectly
 1441|       |     * reports databases opened read only as read/write. */
 1442|      2|    if (slot->isInternal && !slot->readOnly) {
  ------------------
  |  Branch (1442:9): [True: 2, False: 0]
  |  Branch (1442:29): [True: 0, False: 2]
  ------------------
 1443|      0|        CK_SESSION_HANDLE session = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
 1444|       |
 1445|       |        /* try to open a R/W session */
 1446|      0|        crv = PK11_GETTAB(slot)->C_OpenSession(slot->slotID,
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1447|      0|                                               CKF_RW_SESSION | CKF_SERIAL_SESSION, slot, pk11_notify, &session);
  ------------------
  |  |  302|      0|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
                                                             CKF_RW_SESSION | CKF_SERIAL_SESSION, slot, pk11_notify, &session);
  ------------------
  |  |  303|      0|#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */
  ------------------
 1448|       |        /* what a well behaved token should return if you open
 1449|       |         * a RW session on a read only token */
 1450|      0|        if (crv == CKR_TOKEN_WRITE_PROTECTED) {
  ------------------
  |  | 1481|      0|#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2UL
  ------------------
  |  Branch (1450:13): [True: 0, False: 0]
  ------------------
 1451|      0|            slot->readOnly = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1452|      0|        } else if (crv == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1452:20): [True: 0, False: 0]
  ------------------
 1453|      0|            CK_SESSION_INFO sessionInfo;
 1454|       |
 1455|       |            /* Because of a second bug in softoken, which silently returns
 1456|       |             * a RO session, we need to check what type of session we got. */
 1457|      0|            crv = PK11_GETTAB(slot)->C_GetSessionInfo(session, &sessionInfo);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1458|      0|            if (crv == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1458:17): [True: 0, False: 0]
  ------------------
 1459|      0|                if ((sessionInfo.flags & CKF_RW_SESSION) == 0) {
  ------------------
  |  |  302|      0|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (1459:21): [True: 0, False: 0]
  ------------------
 1460|       |                    /* session was readonly, so this softoken slot must be readonly */
 1461|      0|                    slot->readOnly = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1462|      0|                }
 1463|      0|            }
 1464|      0|            PK11_GETTAB(slot)
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1465|      0|                ->C_CloseSession(session);
 1466|      0|        }
 1467|      0|    }
 1468|       |
 1469|      2|    return SECSuccess;
 1470|      2|}
PK11_InitSlot:
 1542|      2|{
 1543|      2|    SECStatus rv;
 1544|      2|    CK_SLOT_INFO slotInfo;
 1545|       |
 1546|      2|    slot->functionList = mod->functionList;
 1547|      2|    slot->isInternal = mod->internal;
 1548|      2|    slot->slotID = slotID;
 1549|      2|    slot->isThreadSafe = mod->isThreadSafe;
 1550|      2|    slot->hasRSAInfo = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 1551|      2|    slot->module = mod; /* NOTE: we don't make a reference here because
 1552|       |                         * modules have references to their slots. This
 1553|       |                         * works because modules keep implicit references
 1554|       |                         * from their slots, and won't unload and disappear
 1555|       |                         * until all their slots have been freed */
 1556|       |
 1557|      2|    if (PK11_GetSlotInfo(slot, &slotInfo) != SECSuccess) {
  ------------------
  |  Branch (1557:9): [True: 0, False: 2]
  ------------------
 1558|      0|        slot->disabled = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1559|      0|        slot->reason = PK11_DIS_COULD_NOT_INIT_TOKEN;
 1560|      0|        return;
 1561|      0|    }
 1562|       |
 1563|       |    /* test to make sure claimed mechanism work */
 1564|      2|    slot->needTest = mod->internal ? PR_FALSE : PR_TRUE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
                  slot->needTest = mod->internal ? PR_FALSE : PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
  |  Branch (1564:22): [True: 2, False: 0]
  ------------------
 1565|      2|    (void)PK11_MakeString(NULL, slot->slot_name,
 1566|      2|                          (char *)slotInfo.slotDescription, sizeof(slotInfo.slotDescription));
 1567|      2|    slot->isHW = (PRBool)((slotInfo.flags & CKF_HW_SLOT) == CKF_HW_SLOT);
  ------------------
  |  |  133|      2|#define CKF_HW_SLOT 0x00000004UL          /* hardware slot */
  ------------------
                  slot->isHW = (PRBool)((slotInfo.flags & CKF_HW_SLOT) == CKF_HW_SLOT);
  ------------------
  |  |  133|      2|#define CKF_HW_SLOT 0x00000004UL          /* hardware slot */
  ------------------
 1568|      2|#define ACTIVE_CARD "ActivCard SA"
 1569|      2|    slot->isActiveCard = (PRBool)(PORT_Strncmp((char *)slotInfo.manufacturerID,
  ------------------
  |  |  193|      2|#define PORT_Strncmp strncmp
  ------------------
 1570|      2|                                               ACTIVE_CARD, sizeof(ACTIVE_CARD) - 1) == 0);
  ------------------
  |  | 1568|      2|#define ACTIVE_CARD "ActivCard SA"
  ------------------
                                                             ACTIVE_CARD, sizeof(ACTIVE_CARD) - 1) == 0);
  ------------------
  |  | 1568|      2|#define ACTIVE_CARD "ActivCard SA"
  ------------------
 1571|      2|    if ((slotInfo.flags & CKF_REMOVABLE_DEVICE) == 0) {
  ------------------
  |  |  132|      2|#define CKF_REMOVABLE_DEVICE 0x00000002UL /* removable devices*/
  ------------------
  |  Branch (1571:9): [True: 2, False: 0]
  ------------------
 1572|      2|        slot->isPerm = PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 1573|       |        /* permanment slots must have the token present always */
 1574|      2|        if ((slotInfo.flags & CKF_TOKEN_PRESENT) == 0) {
  ------------------
  |  |  131|      2|#define CKF_TOKEN_PRESENT 0x00000001UL    /* a token is there */
  ------------------
  |  Branch (1574:13): [True: 0, False: 2]
  ------------------
 1575|      0|            slot->disabled = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1576|      0|            slot->reason = PK11_DIS_TOKEN_NOT_PRESENT;
 1577|      0|            return; /* nothing else to do */
 1578|      0|        }
 1579|      2|    }
 1580|       |    /* if the token is present, initialize it */
 1581|      2|    if ((slotInfo.flags & CKF_TOKEN_PRESENT) != 0) {
  ------------------
  |  |  131|      2|#define CKF_TOKEN_PRESENT 0x00000001UL    /* a token is there */
  ------------------
  |  Branch (1581:9): [True: 2, False: 0]
  ------------------
 1582|      2|        rv = PK11_InitToken(slot, PR_TRUE);
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 1583|       |        /* the only hard failures are on permanent devices, or function
 1584|       |         * verify failures... function verify failures are already handled
 1585|       |         * by tokenInit */
 1586|      2|        if ((rv != SECSuccess) && (slot->isPerm) && (!slot->disabled)) {
  ------------------
  |  Branch (1586:13): [True: 0, False: 2]
  |  Branch (1586:35): [True: 0, False: 0]
  |  Branch (1586:53): [True: 0, False: 0]
  ------------------
 1587|      0|            slot->disabled = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1588|      0|            slot->reason = PK11_DIS_COULD_NOT_INIT_TOKEN;
 1589|      0|        }
 1590|      2|        if (rv == SECSuccess && pk11_isRootSlot(slot)) {
  ------------------
  |  Branch (1590:13): [True: 2, False: 0]
  |  Branch (1590:33): [True: 0, False: 2]
  ------------------
 1591|      0|            if (!slot->hasRootCerts) {
  ------------------
  |  Branch (1591:17): [True: 0, False: 0]
  ------------------
 1592|      0|                slot->module->trustOrder = 100;
 1593|      0|            }
 1594|      0|            slot->hasRootCerts = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1595|      0|        }
 1596|      2|    }
 1597|      2|    if ((slotInfo.flags & CKF_USER_PIN_INITIALIZED) != 0) {
  ------------------
  |  |  178|      2|#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's \
  ------------------
  |  Branch (1597:9): [True: 2, False: 0]
  ------------------
 1598|      2|        slot->flags |= CKF_USER_PIN_INITIALIZED;
  ------------------
  |  |  178|      2|#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's \
  ------------------
 1599|      2|    }
 1600|      2|}
PK11_IsPresent:
 1690|  67.6k|{
 1691|  67.6k|    return pk11_IsPresentCertLoad(slot, PR_TRUE);
  ------------------
  |  |  437|  67.6k|#define PR_TRUE 1
  ------------------
 1692|  67.6k|}
PK11_IsDisabled:
 1697|  62.6k|{
 1698|  62.6k|    return slot->disabled;
 1699|  62.6k|}
PK11_IsInternal:
 1780|      2|{
 1781|      2|    return slot->isInternal;
 1782|      2|}
PK11_GetSlotSeries:
 1887|     89|{
 1888|     89|    return slot->series;
 1889|     89|}
PK11_GetCurrentWrapIndex:
 1893|     89|{
 1894|     89|    return slot->wrapKey;
 1895|     89|}
PK11_GetSlotID:
 1899|     89|{
 1900|     89|    return slot->slotID;
 1901|     89|}
PK11_GetModuleID:
 1905|     89|{
 1906|     89|    return slot->module->moduleID;
 1907|     89|}
PK11_GetSlotInfo:
 1929|      2|{
 1930|      2|    CK_RV crv;
 1931|       |
 1932|      2|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (1932:9): [True: 0, False: 2]
  ------------------
 1933|      0|        PK11_EnterSlotMonitor(slot);
 1934|       |    /*
 1935|       |     * some buggy drivers do not fill the buffer completely,
 1936|       |     * erase the buffer first
 1937|       |     */
 1938|      2|    PORT_Memset(info->slotDescription, ' ', sizeof(info->slotDescription));
  ------------------
  |  |  182|      2|#define PORT_Memset memset
  ------------------
 1939|      2|    PORT_Memset(info->manufacturerID, ' ', sizeof(info->manufacturerID));
  ------------------
  |  |  182|      2|#define PORT_Memset memset
  ------------------
 1940|      2|    crv = PK11_GETTAB(slot)->C_GetSlotInfo(slot->slotID, info);
  ------------------
  |  |  102|      2|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1941|      2|    pk11_zeroTerminatedToBlankPadded(info->slotDescription,
 1942|      2|                                     sizeof(info->slotDescription));
 1943|      2|    pk11_zeroTerminatedToBlankPadded(info->manufacturerID,
 1944|      2|                                     sizeof(info->manufacturerID));
 1945|      2|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (1945:9): [True: 0, False: 2]
  ------------------
 1946|      0|        PK11_ExitSlotMonitor(slot);
 1947|      2|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1947:9): [True: 0, False: 2]
  ------------------
 1948|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1949|      0|        return SECFailure;
 1950|      0|    }
 1951|      2|    return SECSuccess;
 1952|      2|}
pk11_SetInternalKeySlot:
 2053|      1|{
 2054|      1|    if (pk11InternalKeySlot) {
  ------------------
  |  Branch (2054:9): [True: 1, False: 0]
  ------------------
 2055|      1|        PK11_FreeSlot(pk11InternalKeySlot);
 2056|      1|    }
 2057|      1|    pk11InternalKeySlot = slot ? PK11_ReferenceSlot(slot) : NULL;
  ------------------
  |  Branch (2057:27): [True: 0, False: 1]
  ------------------
 2058|      1|}
pk11_SetInternalKeySlotIfFirst:
 2067|      1|{
 2068|      1|    if (pk11InternalKeySlot) {
  ------------------
  |  Branch (2068:9): [True: 0, False: 1]
  ------------------
 2069|      0|        return;
 2070|      0|    }
 2071|      1|    pk11InternalKeySlot = slot ? PK11_ReferenceSlot(slot) : NULL;
  ------------------
  |  Branch (2071:27): [True: 1, False: 0]
  ------------------
 2072|      1|}
PK11_GetInternalSlot:
 2109|  3.43M|{
 2110|  3.43M|    SECMODModule *mod = SECMOD_GetInternalModule();
 2111|  3.43M|    PORT_Assert(mod != NULL);
  ------------------
  |  |  120|  3.43M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.43M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.43M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2112|  3.43M|    if (!mod) {
  ------------------
  |  Branch (2112:9): [True: 0, False: 3.43M]
  ------------------
 2113|      0|        PORT_SetError(SEC_ERROR_NO_MODULE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2114|      0|        return NULL;
 2115|      0|    }
 2116|  3.43M|    if (mod->isFIPS) {
  ------------------
  |  Branch (2116:9): [True: 0, False: 3.43M]
  ------------------
 2117|      0|        return PK11_GetInternalKeySlot();
 2118|      0|    }
 2119|  3.43M|    return PK11_ReferenceSlot(mod->slots[0]);
 2120|  3.43M|}
PK11_DoesMechanism:
 2127|  3.56M|{
 2128|  3.56M|    int i;
 2129|       |
 2130|       |    /* CKM_FAKE_RANDOM is not a real PKCS mechanism. It's a marker to
 2131|       |     * tell us we're looking form someone that has implemented get
 2132|       |     * random bits */
 2133|  3.56M|    if (type == CKM_FAKE_RANDOM) {
  ------------------
  |  |  154|  3.56M|#define CKM_FAKE_RANDOM 0x80000efeUL
  ------------------
  |  Branch (2133:9): [True: 17.0k, False: 3.54M]
  ------------------
 2134|  17.0k|        return slot->hasRandom;
 2135|  17.0k|    }
 2136|       |
 2137|       |    /* for most mechanism, bypass the linear lookup */
 2138|  3.54M|    if (type < 0x7ff) {
  ------------------
  |  Branch (2138:9): [True: 1.93M, False: 1.60M]
  ------------------
 2139|  1.93M|        return (slot->mechanismBits[type & 0xff] & (1 << (type >> 8))) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|  1.93M|#define PR_TRUE 1
  ------------------
                      return (slot->mechanismBits[type & 0xff] & (1 << (type >> 8))) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (2139:16): [True: 1.93M, False: 0]
  ------------------
 2140|  1.93M|    }
 2141|       |
 2142|  82.9M|    for (i = 0; i < (int)slot->mechanismCount; i++) {
  ------------------
  |  Branch (2142:17): [True: 82.9M, False: 492]
  ------------------
 2143|  82.9M|        if (slot->mechanismList[i] == type)
  ------------------
  |  Branch (2143:13): [True: 1.60M, False: 81.3M]
  ------------------
 2144|  1.60M|            return PR_TRUE;
  ------------------
  |  |  437|  1.60M|#define PR_TRUE 1
  ------------------
 2145|  82.9M|    }
 2146|    492|    return PR_FALSE;
  ------------------
  |  |  438|    492|#define PR_FALSE 0
  ------------------
 2147|  1.60M|}
PK11_DoesMechanismFlag:
 2158|  1.26k|{
 2159|  1.26k|    return !pk11_filterSlot(slot, type, flags, 0);
 2160|  1.26k|}
PK11_TokenExists:
 2169|  3.42M|{
 2170|  3.42M|    SECMODModuleList *mlp;
 2171|  3.42M|    SECMODModuleList *modules;
 2172|  3.42M|    SECMODListLock *moduleLock = SECMOD_GetDefaultModuleListLock();
 2173|  3.42M|    PK11SlotInfo *slot;
 2174|  3.42M|    PRBool found = PR_FALSE;
  ------------------
  |  |  438|  3.42M|#define PR_FALSE 0
  ------------------
 2175|  3.42M|    int i;
 2176|       |
 2177|  3.42M|    if (!moduleLock) {
  ------------------
  |  Branch (2177:9): [True: 0, False: 3.42M]
  ------------------
 2178|      0|        PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2179|      0|        return found;
 2180|      0|    }
 2181|       |    /* we only need to know if there is a token that does this mechanism.
 2182|       |     * check the internal module first because it's fast, and supports
 2183|       |     * almost everything. */
 2184|  3.42M|    slot = PK11_GetInternalSlot();
 2185|  3.42M|    if (slot) {
  ------------------
  |  Branch (2185:9): [True: 3.42M, False: 0]
  ------------------
 2186|  3.42M|        found = PK11_DoesMechanism(slot, type);
 2187|  3.42M|        PK11_FreeSlot(slot);
 2188|  3.42M|    }
 2189|  3.42M|    if (found)
  ------------------
  |  Branch (2189:9): [True: 3.42M, False: 0]
  ------------------
 2190|  3.42M|        return PR_TRUE; /* bypass getting module locks */
  ------------------
  |  |  437|  3.42M|#define PR_TRUE 1
  ------------------
 2191|       |
 2192|      0|    SECMOD_GetReadLock(moduleLock);
 2193|      0|    modules = SECMOD_GetDefaultModuleList();
 2194|      0|    for (mlp = modules; mlp != NULL && (!found); mlp = mlp->next) {
  ------------------
  |  Branch (2194:25): [True: 0, False: 0]
  |  Branch (2194:40): [True: 0, False: 0]
  ------------------
 2195|      0|        for (i = 0; i < mlp->module->slotCount; i++) {
  ------------------
  |  Branch (2195:21): [True: 0, False: 0]
  ------------------
 2196|      0|            slot = mlp->module->slots[i];
 2197|      0|            if (PK11_IsPresent(slot)) {
  ------------------
  |  Branch (2197:17): [True: 0, False: 0]
  ------------------
 2198|      0|                if (PK11_DoesMechanism(slot, type)) {
  ------------------
  |  Branch (2198:21): [True: 0, False: 0]
  ------------------
 2199|      0|                    found = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2200|      0|                    break;
 2201|      0|                }
 2202|      0|            }
 2203|      0|        }
 2204|      0|    }
 2205|      0|    SECMOD_ReleaseReadLock(moduleLock);
 2206|      0|    return found;
 2207|  3.42M|}
PK11_GetAllTokens:
 2218|  3.61k|{
 2219|  3.61k|    PK11SlotList *list;
 2220|  3.61k|    PK11SlotList *loginList;
 2221|  3.61k|    PK11SlotList *friendlyList;
 2222|  3.61k|    SECMODModuleList *mlp;
 2223|  3.61k|    SECMODModuleList *modules;
 2224|  3.61k|    SECMODListLock *moduleLock;
 2225|  3.61k|    int i;
 2226|       |
 2227|  3.61k|    moduleLock = SECMOD_GetDefaultModuleListLock();
 2228|  3.61k|    if (!moduleLock) {
  ------------------
  |  Branch (2228:9): [True: 0, False: 3.61k]
  ------------------
 2229|      0|        PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2230|      0|        return NULL;
 2231|      0|    }
 2232|       |
 2233|  3.61k|    list = PK11_NewSlotList();
 2234|  3.61k|    loginList = PK11_NewSlotList();
 2235|  3.61k|    friendlyList = PK11_NewSlotList();
 2236|  3.61k|    if ((list == NULL) || (loginList == NULL) || (friendlyList == NULL)) {
  ------------------
  |  Branch (2236:9): [True: 0, False: 3.61k]
  |  Branch (2236:27): [True: 0, False: 3.61k]
  |  Branch (2236:50): [True: 0, False: 3.61k]
  ------------------
 2237|      0|        if (list)
  ------------------
  |  Branch (2237:13): [True: 0, False: 0]
  ------------------
 2238|      0|            PK11_FreeSlotList(list);
 2239|      0|        if (loginList)
  ------------------
  |  Branch (2239:13): [True: 0, False: 0]
  ------------------
 2240|      0|            PK11_FreeSlotList(loginList);
 2241|      0|        if (friendlyList)
  ------------------
  |  Branch (2241:13): [True: 0, False: 0]
  ------------------
 2242|      0|            PK11_FreeSlotList(friendlyList);
 2243|      0|        return NULL;
 2244|      0|    }
 2245|       |
 2246|  3.61k|    SECMOD_GetReadLock(moduleLock);
 2247|       |
 2248|  3.61k|    modules = SECMOD_GetDefaultModuleList();
 2249|  7.23k|    for (mlp = modules; mlp != NULL; mlp = mlp->next) {
  ------------------
  |  Branch (2249:25): [True: 3.61k, False: 3.61k]
  ------------------
 2250|  10.8k|        for (i = 0; i < mlp->module->slotCount; i++) {
  ------------------
  |  Branch (2250:21): [True: 7.23k, False: 3.61k]
  ------------------
 2251|  7.23k|            PK11SlotInfo *slot = mlp->module->slots[i];
 2252|       |
 2253|  7.23k|            if (pk11_IsPresentCertLoad(slot, loadCerts)) {
  ------------------
  |  Branch (2253:17): [True: 7.23k, False: 0]
  ------------------
 2254|  7.23k|                if (needRW && slot->readOnly)
  ------------------
  |  Branch (2254:21): [True: 0, False: 7.23k]
  |  Branch (2254:31): [True: 0, False: 0]
  ------------------
 2255|      0|                    continue;
 2256|  7.23k|                if ((type == CKM_INVALID_MECHANISM) || PK11_DoesMechanism(slot, type)) {
  ------------------
  |  |  155|  7.23k|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  |  Branch (2256:21): [True: 94, False: 7.14k]
  |  Branch (2256:56): [True: 7.14k, False: 0]
  ------------------
 2257|  7.23k|                    if (pk11_LoginStillRequired(slot, wincx)) {
  ------------------
  |  Branch (2257:25): [True: 0, False: 7.23k]
  ------------------
 2258|      0|                        if (PK11_IsFriendly(slot)) {
  ------------------
  |  Branch (2258:29): [True: 0, False: 0]
  ------------------
 2259|      0|                            PK11_AddSlotToList(friendlyList, slot, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2260|      0|                        } else {
 2261|      0|                            PK11_AddSlotToList(loginList, slot, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2262|      0|                        }
 2263|  7.23k|                    } else {
 2264|  7.23k|                        PK11_AddSlotToList(list, slot, PR_TRUE);
  ------------------
  |  |  437|  7.23k|#define PR_TRUE 1
  ------------------
 2265|  7.23k|                    }
 2266|  7.23k|                }
 2267|  7.23k|            }
 2268|  7.23k|        }
 2269|  3.61k|    }
 2270|  3.61k|    SECMOD_ReleaseReadLock(moduleLock);
 2271|       |
 2272|  3.61k|    pk11_MoveListToList(list, friendlyList);
 2273|  3.61k|    PK11_FreeSlotList(friendlyList);
 2274|  3.61k|    pk11_MoveListToList(list, loginList);
 2275|  3.61k|    PK11_FreeSlotList(loginList);
 2276|       |
 2277|  3.61k|    return list;
 2278|  3.61k|}
pk11_filterSlot:
 2312|  4.30k|{
 2313|  4.30k|    CK_MECHANISM_INFO mechanism_info;
 2314|  4.30k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  4.30k|#define CKR_OK 0x00000000UL
  ------------------
 2315|       |
 2316|       |    /* handle the only case where we don't actually fetch the mechanisms
 2317|       |     * on the fly */
 2318|  4.30k|    if ((keySize == 0) && (mechanism == CKM_RSA_PKCS) && (slot->hasRSAInfo)) {
  ------------------
  |  |  720|  3.38k|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (2318:9): [True: 3.38k, False: 915]
  |  Branch (2318:27): [True: 131, False: 3.25k]
  |  Branch (2318:58): [True: 130, False: 1]
  ------------------
 2319|    130|        mechanism_info.flags = slot->RSAInfoFlags;
 2320|  4.17k|    } else {
 2321|  4.17k|        if (!slot->isThreadSafe)
  ------------------
  |  Branch (2321:13): [True: 0, False: 4.17k]
  ------------------
 2322|      0|            PK11_EnterSlotMonitor(slot);
 2323|  4.17k|        crv = PK11_GETTAB(slot)->C_GetMechanismInfo(slot->slotID, mechanism,
  ------------------
  |  |  102|  4.17k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2324|  4.17k|                                                    &mechanism_info);
 2325|  4.17k|        if (!slot->isThreadSafe)
  ------------------
  |  Branch (2325:13): [True: 0, False: 4.17k]
  ------------------
 2326|      0|            PK11_ExitSlotMonitor(slot);
 2327|       |        /* if we were getting the RSA flags, save them */
 2328|  4.17k|        if ((crv == CKR_OK) && (mechanism == CKM_RSA_PKCS) && (!slot->hasRSAInfo)) {
  ------------------
  |  | 1388|  4.17k|#define CKR_OK 0x00000000UL
  ------------------
                      if ((crv == CKR_OK) && (mechanism == CKM_RSA_PKCS) && (!slot->hasRSAInfo)) {
  ------------------
  |  |  720|  4.17k|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (2328:13): [True: 4.17k, False: 0]
  |  Branch (2328:32): [True: 1, False: 4.16k]
  |  Branch (2328:63): [True: 1, False: 0]
  ------------------
 2329|      1|            slot->RSAInfoFlags = mechanism_info.flags;
 2330|      1|            slot->hasRSAInfo = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 2331|      1|        }
 2332|  4.17k|    }
 2333|       |    /* couldn't get the mechanism info */
 2334|  4.30k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  4.30k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2334:9): [True: 0, False: 4.30k]
  ------------------
 2335|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2336|      0|    }
 2337|  4.30k|    if (keySize && ((mechanism_info.ulMinKeySize > keySize) || (mechanism_info.ulMaxKeySize < keySize))) {
  ------------------
  |  Branch (2337:9): [True: 915, False: 3.38k]
  |  Branch (2337:21): [True: 0, False: 915]
  |  Branch (2337:64): [True: 0, False: 915]
  ------------------
 2338|       |        /* Token can do mechanism, but not at the key size we
 2339|       |         * want */
 2340|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2341|      0|    }
 2342|  4.30k|    if (mechanismInfoFlags && ((mechanism_info.flags & mechanismInfoFlags) !=
  ------------------
  |  Branch (2342:9): [True: 4.30k, False: 0]
  |  Branch (2342:31): [True: 0, False: 4.30k]
  ------------------
 2343|  4.30k|                               mechanismInfoFlags)) {
 2344|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2345|      0|    }
 2346|  4.30k|    return PR_FALSE;
  ------------------
  |  |  438|  4.30k|#define PR_FALSE 0
  ------------------
 2347|  4.30k|}
PK11_GetBestSlotMultipleWithAttributes:
 2362|  67.5k|{
 2363|  67.5k|    PK11SlotList *list = NULL;
 2364|  67.5k|    PK11SlotListElement *le;
 2365|  67.5k|    PK11SlotInfo *slot = NULL;
 2366|  67.5k|    PRBool freeit = PR_FALSE;
  ------------------
  |  |  438|  67.5k|#define PR_FALSE 0
  ------------------
 2367|  67.5k|    PRBool listNeedLogin = PR_FALSE;
  ------------------
  |  |  438|  67.5k|#define PR_FALSE 0
  ------------------
 2368|  67.5k|    unsigned int i;
 2369|  67.5k|    SECStatus rv;
 2370|       |
 2371|  67.5k|    list = PK11_GetSlotList(type[0]);
 2372|       |
 2373|  67.5k|    if ((list == NULL) || (list->head == NULL)) {
  ------------------
  |  Branch (2373:9): [True: 2.70k, False: 64.8k]
  |  Branch (2373:27): [True: 915, False: 63.9k]
  ------------------
 2374|       |        /* We need to look up all the tokens for the mechanism */
 2375|  3.61k|        list = PK11_GetAllTokens(type[0], PR_FALSE, PR_TRUE, wincx);
  ------------------
  |  |  438|  3.61k|#define PR_FALSE 0
  ------------------
                      list = PK11_GetAllTokens(type[0], PR_FALSE, PR_TRUE, wincx);
  ------------------
  |  |  437|  3.61k|#define PR_TRUE 1
  ------------------
 2376|  3.61k|        freeit = PR_TRUE;
  ------------------
  |  |  437|  3.61k|#define PR_TRUE 1
  ------------------
 2377|  3.61k|    }
 2378|       |
 2379|       |    /* no one can do it! */
 2380|  67.5k|    if (list == NULL) {
  ------------------
  |  Branch (2380:9): [True: 0, False: 67.5k]
  ------------------
 2381|      0|        PORT_SetError(SEC_ERROR_NO_TOKEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2382|      0|        return NULL;
 2383|      0|    }
 2384|       |
 2385|  67.5k|    PORT_SetError(0);
  ------------------
  |  |   65|  67.5k|#define PORT_SetError PORT_SetError_Util
  ------------------
 2386|       |
 2387|  67.5k|    listNeedLogin = PR_FALSE;
  ------------------
  |  |  438|  67.5k|#define PR_FALSE 0
  ------------------
 2388|   116k|    for (i = 0; i < mech_count; i++) {
  ------------------
  |  Branch (2388:17): [True: 67.5k, False: 48.9k]
  ------------------
 2389|  67.5k|        if ((type[i] != CKM_FAKE_RANDOM) &&
  ------------------
  |  |  154|  67.5k|#define CKM_FAKE_RANDOM 0x80000efeUL
  ------------------
  |  Branch (2389:13): [True: 50.5k, False: 17.0k]
  ------------------
 2390|  67.5k|            (type[i] != CKM_SHA_1) &&
  ------------------
  |  |  859|  50.5k|#define CKM_SHA_1 0x00000220UL
  ------------------
  |  Branch (2390:13): [True: 35.4k, False: 15.1k]
  ------------------
 2391|  67.5k|            (type[i] != CKM_SHA224) &&
  ------------------
  |  |  887|  35.4k|#define CKM_SHA224 0x00000255UL
  ------------------
  |  Branch (2391:13): [True: 35.4k, False: 0]
  ------------------
 2392|  67.5k|            (type[i] != CKM_SHA256) &&
  ------------------
  |  |  876|  35.4k|#define CKM_SHA256 0x00000250UL
  ------------------
  |  Branch (2392:13): [True: 26.4k, False: 8.92k]
  ------------------
 2393|  67.5k|            (type[i] != CKM_SHA384) &&
  ------------------
  |  |  879|  26.4k|#define CKM_SHA384 0x00000260UL
  ------------------
  |  Branch (2393:13): [True: 19.6k, False: 6.85k]
  ------------------
 2394|  67.5k|            (type[i] != CKM_SHA512) &&
  ------------------
  |  |  882|  19.6k|#define CKM_SHA512 0x00000270UL
  ------------------
  |  Branch (2394:13): [True: 19.1k, False: 504]
  ------------------
 2395|  67.5k|            (type[i] != CKM_MD5) &&
  ------------------
  |  |  853|  19.1k|#define CKM_MD5 0x00000210UL
  ------------------
  |  Branch (2395:13): [True: 18.6k, False: 488]
  ------------------
 2396|  67.5k|            (type[i] != CKM_MD2)) {
  ------------------
  |  |  847|  18.6k|#define CKM_MD2 0x00000200UL
  ------------------
  |  Branch (2396:13): [True: 18.6k, False: 0]
  ------------------
 2397|  18.6k|            listNeedLogin = PR_TRUE;
  ------------------
  |  |  437|  18.6k|#define PR_TRUE 1
  ------------------
 2398|  18.6k|            break;
 2399|  18.6k|        }
 2400|  67.5k|    }
 2401|       |
 2402|  68.0k|    for (le = PK11_GetFirstSafe(list); le;
  ------------------
  |  Branch (2402:40): [True: 67.6k, False: 398]
  ------------------
 2403|  67.6k|         le = PK11_GetNextSafe(list, le, PR_TRUE)) {
  ------------------
  |  |  437|    445|#define PR_TRUE 1
  ------------------
 2404|  67.6k|        if (PK11_IsPresent(le->slot)) {
  ------------------
  |  Branch (2404:13): [True: 67.6k, False: 0]
  ------------------
 2405|  67.6k|            PRBool doExit = PR_FALSE;
  ------------------
  |  |  438|  67.6k|#define PR_FALSE 0
  ------------------
 2406|   137k|            for (i = 0; i < mech_count; i++) {
  ------------------
  |  Branch (2406:25): [True: 70.2k, False: 67.1k]
  ------------------
 2407|  70.2k|                if (!PK11_DoesMechanism(le->slot, type[i])) {
  ------------------
  |  Branch (2407:21): [True: 445, False: 69.7k]
  ------------------
 2408|    445|                    doExit = PR_TRUE;
  ------------------
  |  |  437|    445|#define PR_TRUE 1
  ------------------
 2409|    445|                    break;
 2410|    445|                }
 2411|  69.7k|                if ((mechanismInfoFlags && mechanismInfoFlags[i]) ||
  ------------------
  |  Branch (2411:22): [True: 3.03k, False: 66.7k]
  |  Branch (2411:44): [True: 3.03k, False: 0]
  ------------------
 2412|  69.7k|                    (keySize && keySize[i])) {
  ------------------
  |  Branch (2412:22): [True: 0, False: 66.7k]
  |  Branch (2412:33): [True: 0, False: 0]
  ------------------
 2413|  3.03k|                    if (pk11_filterSlot(le->slot, type[i],
  ------------------
  |  Branch (2413:25): [True: 0, False: 3.03k]
  ------------------
 2414|  3.03k|                                        mechanismInfoFlags ? mechanismInfoFlags[i] : 0,
  ------------------
  |  Branch (2414:41): [True: 3.03k, False: 0]
  ------------------
 2415|  3.03k|                                        keySize ? keySize[i] : 0)) {
  ------------------
  |  Branch (2415:41): [True: 3.03k, False: 0]
  ------------------
 2416|      0|                        doExit = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2417|      0|                        break;
 2418|      0|                    }
 2419|  3.03k|                }
 2420|  69.7k|            }
 2421|       |
 2422|  67.6k|            if (doExit)
  ------------------
  |  Branch (2422:17): [True: 445, False: 67.1k]
  ------------------
 2423|    445|                continue;
 2424|       |
 2425|  67.1k|            if (listNeedLogin && le->slot->needLogin) {
  ------------------
  |  Branch (2425:17): [True: 18.2k, False: 48.9k]
  |  Branch (2425:34): [True: 0, False: 18.2k]
  ------------------
 2426|      0|                rv = PK11_Authenticate(le->slot, PR_TRUE, wincx);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2427|      0|                if (rv != SECSuccess)
  ------------------
  |  Branch (2427:21): [True: 0, False: 0]
  ------------------
 2428|      0|                    continue;
 2429|      0|            }
 2430|  67.1k|            slot = le->slot;
 2431|  67.1k|            PK11_ReferenceSlot(slot);
 2432|  67.1k|            PK11_FreeSlotListElement(list, le);
 2433|  67.1k|            if (freeit) {
  ------------------
  |  Branch (2433:17): [True: 3.57k, False: 63.6k]
  ------------------
 2434|  3.57k|                PK11_FreeSlotList(list);
 2435|  3.57k|            }
 2436|  67.1k|            return slot;
 2437|  67.1k|        }
 2438|  67.6k|    }
 2439|    398|    if (freeit) {
  ------------------
  |  Branch (2439:9): [True: 47, False: 351]
  ------------------
 2440|     47|        PK11_FreeSlotList(list);
 2441|     47|    }
 2442|    398|    if (PORT_GetError() == 0) {
  ------------------
  |  |   62|    398|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (2442:9): [True: 398, False: 0]
  ------------------
 2443|    398|        PORT_SetError(SEC_ERROR_NO_TOKEN);
  ------------------
  |  |   65|    398|#define PORT_SetError PORT_SetError_Util
  ------------------
 2444|    398|    }
 2445|    398|    return NULL;
 2446|  67.5k|}
PK11_GetBestSlotMultiple:
 2451|  1.52k|{
 2452|  1.52k|    return PK11_GetBestSlotMultipleWithAttributes(type, NULL, NULL,
 2453|  1.52k|                                                  mech_count, wincx);
 2454|  1.52k|}
PK11_GetBestSlot:
 2459|  63.0k|{
 2460|  63.0k|    return PK11_GetBestSlotMultipleWithAttributes(&type, NULL, NULL, 1, wincx);
 2461|  63.0k|}
PK11_GetBestSlotWithAttributes:
 2466|  3.03k|{
 2467|  3.03k|    return PK11_GetBestSlotMultipleWithAttributes(&type, &mechanismFlags,
 2468|  3.03k|                                                  &keySize, 1, wincx);
 2469|  3.03k|}
PK11_GetBestKeyLength:
 2473|      1|{
 2474|      1|    CK_MECHANISM_INFO mechanism_info;
 2475|      1|    CK_RV crv;
 2476|       |
 2477|      1|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (2477:9): [True: 0, False: 1]
  ------------------
 2478|      0|        PK11_EnterSlotMonitor(slot);
 2479|      1|    crv = PK11_GETTAB(slot)->C_GetMechanismInfo(slot->slotID,
  ------------------
  |  |  102|      1|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2480|      1|                                                mechanism, &mechanism_info);
 2481|      1|    if (!slot->isThreadSafe)
  ------------------
  |  Branch (2481:9): [True: 0, False: 1]
  ------------------
 2482|      0|        PK11_ExitSlotMonitor(slot);
 2483|      1|    if (crv != CKR_OK)
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2483:9): [True: 0, False: 1]
  ------------------
 2484|      0|        return 0;
 2485|       |
 2486|      1|    if (mechanism_info.ulMinKeySize == mechanism_info.ulMaxKeySize)
  ------------------
  |  Branch (2486:9): [True: 1, False: 0]
  ------------------
 2487|      1|        return 0;
 2488|      0|    return mechanism_info.ulMaxKeySize;
 2489|      1|}
PK11_GenerateRandomOnSlot:
 2574|  17.0k|{
 2575|  17.0k|    CK_RV crv;
 2576|       |
 2577|  17.0k|    if (!slot->isInternal)
  ------------------
  |  Branch (2577:9): [True: 0, False: 17.0k]
  ------------------
 2578|      0|        PK11_EnterSlotMonitor(slot);
 2579|  17.0k|    crv = PK11_GETTAB(slot)->C_GenerateRandom(slot->session, data,
  ------------------
  |  |  102|  17.0k|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 2580|  17.0k|                                              (CK_ULONG)len);
 2581|  17.0k|    if (!slot->isInternal)
  ------------------
  |  Branch (2581:9): [True: 0, False: 17.0k]
  ------------------
 2582|      0|        PK11_ExitSlotMonitor(slot);
 2583|  17.0k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  17.0k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2583:9): [True: 0, False: 17.0k]
  ------------------
 2584|      0|        PORT_SetError(PK11_MapError(crv));
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2585|      0|        return SECFailure;
 2586|      0|    }
 2587|  17.0k|    return SECSuccess;
 2588|  17.0k|}
PK11_GenerateRandom:
 2628|  17.0k|{
 2629|  17.0k|    PK11SlotInfo *slot;
 2630|  17.0k|    SECStatus rv;
 2631|       |
 2632|  17.0k|    slot = PK11_GetBestSlot(CKM_FAKE_RANDOM, NULL);
  ------------------
  |  |  154|  17.0k|#define CKM_FAKE_RANDOM 0x80000efeUL
  ------------------
 2633|  17.0k|    if (slot == NULL)
  ------------------
  |  Branch (2633:9): [True: 0, False: 17.0k]
  ------------------
 2634|      0|        return SECFailure;
 2635|       |
 2636|  17.0k|    rv = PK11_GenerateRandomOnSlot(slot, data, len);
 2637|  17.0k|    PK11_FreeSlot(slot);
 2638|  17.0k|    return rv;
 2639|  17.0k|}
PK11Slot_SetNSSToken:
 2693|      4|{
 2694|      4|    NSSToken *old;
 2695|      4|    if (nsst) {
  ------------------
  |  Branch (2695:9): [True: 2, False: 2]
  ------------------
 2696|      2|        nsst = nssToken_AddRef(nsst);
 2697|      2|    }
 2698|       |
 2699|      4|    PZ_Lock(sl->nssTokenLock);
  ------------------
  |  |  245|      4|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 2700|      4|    old = sl->nssToken;
 2701|      4|    sl->nssToken = nsst;
 2702|      4|    PZ_Unlock(sl->nssTokenLock);
  ------------------
  |  |  246|      4|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 2703|       |
 2704|      4|    if (old) {
  ------------------
  |  Branch (2704:9): [True: 2, False: 2]
  ------------------
 2705|      2|        (void)nssToken_Destroy(old);
 2706|      2|    }
 2707|      4|}
PK11Slot_GetNSSToken:
 2711|  31.3k|{
 2712|  31.3k|    NSSToken *rv = NULL;
 2713|       |
 2714|  31.3k|    PZ_Lock(sl->nssTokenLock);
  ------------------
  |  |  245|  31.3k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 2715|  31.3k|    if (sl->nssToken) {
  ------------------
  |  Branch (2715:9): [True: 31.3k, False: 4]
  ------------------
 2716|  31.3k|        rv = nssToken_AddRef(sl->nssToken);
 2717|  31.3k|    }
 2718|  31.3k|    PZ_Unlock(sl->nssTokenLock);
  ------------------
  |  |  246|  31.3k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 2719|       |
 2720|  31.3k|    return rv;
 2721|  31.3k|}
pk11slot.c:pk11_FreeSlotListStatic:
  152|  10.8k|{
  153|  10.8k|    PK11SlotListElement *le, *next;
  154|  10.8k|    if (list == NULL)
  ------------------
  |  Branch (154:9): [True: 0, False: 10.8k]
  ------------------
  155|      0|        return;
  156|       |
  157|  18.1k|    for (le = list->head; le; le = next) {
  ------------------
  |  Branch (157:27): [True: 7.23k, False: 10.8k]
  ------------------
  158|  7.23k|        next = le->next;
  159|  7.23k|        PK11_FreeSlotListElement(list, le);
  160|  7.23k|    }
  161|  10.8k|    if (list->lock) {
  ------------------
  |  Branch (161:9): [True: 10.8k, False: 0]
  ------------------
  162|  10.8k|        PZ_DestroyLock(list->lock);
  ------------------
  |  |  244|  10.8k|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  163|  10.8k|    }
  164|  10.8k|    list->lock = NULL;
  165|  10.8k|    list->head = NULL;
  166|  10.8k|}
pk11slot.c:pk11_InitSlotListStatic:
  823|     20|{
  824|     20|    list->lock = PZ_NewLock(nssILockList);
  ------------------
  |  |  243|     20|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  825|     20|    list->head = NULL;
  826|     20|}
pk11slot.c:pk11_ReadProfileList:
 1205|      2|{
 1206|      2|    CK_ATTRIBUTE findTemp[2];
 1207|      2|    CK_ATTRIBUTE *attrs;
 1208|      2|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|      2|#define CK_TRUE 1
  ------------------
 1209|      2|    CK_OBJECT_CLASS oclass = CKO_PROFILE;
  ------------------
  |  |  334|      2|#define CKO_PROFILE 0x00000009UL
  ------------------
 1210|      2|    size_t tsize;
 1211|      2|    int objCount;
 1212|      2|    CK_OBJECT_HANDLE *handles = NULL;
 1213|      2|    int i;
 1214|       |
 1215|      2|    attrs = findTemp;
 1216|      2|    PK11_SETATTRS(attrs, CKA_TOKEN, &cktrue, sizeof(cktrue));
  ------------------
  |  |  104|      2|    (x)->type = (id);              \
  |  |  105|      2|    (x)->pValue = (v);             \
  |  |  106|      2|    (x)->ulValueLen = (l);
  ------------------
 1217|      2|    attrs++;
 1218|      2|    PK11_SETATTRS(attrs, CKA_CLASS, &oclass, sizeof(oclass));
  ------------------
  |  |  104|      2|    (x)->type = (id);              \
  |  |  105|      2|    (x)->pValue = (v);             \
  |  |  106|      2|    (x)->ulValueLen = (l);
  ------------------
 1219|      2|    attrs++;
 1220|      2|    tsize = attrs - findTemp;
 1221|      2|    PORT_Assert(tsize <= sizeof(findTemp) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1222|       |
 1223|      2|    if (slot->profileList) {
  ------------------
  |  Branch (1223:9): [True: 0, False: 2]
  ------------------
 1224|      0|        PORT_Free(slot->profileList);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1225|      0|        slot->profileList = NULL;
 1226|      0|    }
 1227|      2|    slot->profileCount = 0;
 1228|       |
 1229|      2|    objCount = 0;
 1230|      2|    handles = pk11_FindObjectsByTemplate(slot, findTemp, tsize, &objCount);
 1231|      2|    if (handles == NULL) {
  ------------------
  |  Branch (1231:9): [True: 2, False: 0]
  ------------------
 1232|      2|        if (objCount < 0) {
  ------------------
  |  Branch (1232:13): [True: 0, False: 2]
  ------------------
 1233|      0|            return SECFailure; /* error code is set */
 1234|      0|        }
 1235|      2|        PORT_Assert(objCount == 0);
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1236|      2|        return SECSuccess;
 1237|      2|    }
 1238|       |
 1239|      0|    slot->profileList = (CK_PROFILE_ID *)
 1240|      0|        PORT_Alloc(objCount * sizeof(CK_PROFILE_ID));
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1241|      0|    if (slot->profileList == NULL) {
  ------------------
  |  Branch (1241:9): [True: 0, False: 0]
  ------------------
 1242|      0|        PORT_Free(handles);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1243|      0|        return SECFailure; /* error code is set */
 1244|      0|    }
 1245|       |
 1246|      0|    for (i = 0; i < objCount; i++) {
  ------------------
  |  Branch (1246:17): [True: 0, False: 0]
  ------------------
 1247|      0|        CK_ULONG value;
 1248|       |
 1249|      0|        value = PK11_ReadULongAttribute(slot, handles[i], CKA_PROFILE_ID);
  ------------------
  |  |  663|      0|#define CKA_PROFILE_ID 0x00000601UL
  ------------------
 1250|      0|        if (value == CK_UNAVAILABLE_INFORMATION) {
  ------------------
  |  |   64|      0|#define CK_UNAVAILABLE_INFORMATION (~0UL)
  ------------------
  |  Branch (1250:13): [True: 0, False: 0]
  ------------------
 1251|      0|            continue;
 1252|      0|        }
 1253|      0|        slot->profileList[slot->profileCount++] = value;
 1254|      0|    }
 1255|       |
 1256|      0|    PORT_Free(handles);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1257|      0|    return SECSuccess;
 1258|      0|}
pk11slot.c:pk11_isRootSlot:
 1512|      2|{
 1513|      2|    CK_ATTRIBUTE findTemp[1];
 1514|      2|    CK_ATTRIBUTE *attrs;
 1515|      2|    CK_OBJECT_CLASS oclass = CKO_NSS_BUILTIN_ROOT_LIST;
  ------------------
  |  |   38|      2|#define CKO_NSS_BUILTIN_ROOT_LIST (CKO_NSS + 4)
  |  |  ------------------
  |  |  |  |   33|      2|#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      2|#define CKO_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      2|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1516|      2|    size_t tsize;
 1517|      2|    CK_OBJECT_HANDLE handle;
 1518|       |
 1519|      2|    attrs = findTemp;
 1520|      2|    PK11_SETATTRS(attrs, CKA_CLASS, &oclass, sizeof(oclass));
  ------------------
  |  |  104|      2|    (x)->type = (id);              \
  |  |  105|      2|    (x)->pValue = (v);             \
  |  |  106|      2|    (x)->ulValueLen = (l);
  ------------------
 1521|      2|    attrs++;
 1522|      2|    tsize = attrs - findTemp;
 1523|      2|    PORT_Assert(tsize <= sizeof(findTemp) / sizeof(CK_ATTRIBUTE));
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1524|       |
 1525|      2|    handle = pk11_FindObjectByTemplate(slot, findTemp, tsize);
 1526|      2|    if (handle == CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      2|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1526:9): [True: 2, False: 0]
  ------------------
 1527|      2|        return PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 1528|      2|    }
 1529|      0|    return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1530|      2|}
pk11slot.c:pk11_IsPresentCertLoad:
 1613|  74.8k|{
 1614|  74.8k|    CK_SLOT_INFO slotInfo;
 1615|  74.8k|    CK_SESSION_INFO sessionInfo;
 1616|  74.8k|    CK_RV crv;
 1617|       |
 1618|       |    /* disabled slots are never present */
 1619|  74.8k|    if (slot->disabled) {
  ------------------
  |  Branch (1619:9): [True: 0, False: 74.8k]
  ------------------
 1620|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1621|      0|    }
 1622|       |
 1623|       |    /* permanent slots are always present */
 1624|  74.8k|    if (slot->isPerm && (slot->session != CK_INVALID_HANDLE)) {
  ------------------
  |  |   78|  74.8k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1624:9): [True: 74.8k, False: 0]
  |  Branch (1624:25): [True: 74.8k, False: 0]
  ------------------
 1625|  74.8k|        return PR_TRUE;
  ------------------
  |  |  437|  74.8k|#define PR_TRUE 1
  ------------------
 1626|  74.8k|    }
 1627|       |
 1628|      0|    NSSToken *nssToken = PK11Slot_GetNSSToken(slot);
 1629|      0|    if (nssToken) {
  ------------------
  |  Branch (1629:9): [True: 0, False: 0]
  ------------------
 1630|      0|        PRBool present = nssToken_IsPresent(nssToken);
 1631|      0|        (void)nssToken_Destroy(nssToken);
 1632|      0|        return present;
 1633|      0|    }
 1634|       |
 1635|       |    /* removable slots have a flag that says they are present */
 1636|      0|    if (PK11_GetSlotInfo(slot, &slotInfo) != SECSuccess) {
  ------------------
  |  Branch (1636:9): [True: 0, False: 0]
  ------------------
 1637|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1638|      0|    }
 1639|       |
 1640|      0|    if ((slotInfo.flags & CKF_TOKEN_PRESENT) == 0) {
  ------------------
  |  |  131|      0|#define CKF_TOKEN_PRESENT 0x00000001UL    /* a token is there */
  ------------------
  |  Branch (1640:9): [True: 0, False: 0]
  ------------------
 1641|       |        /* if the slot is no longer present, close the session */
 1642|      0|        if (slot->session != CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1642:13): [True: 0, False: 0]
  ------------------
 1643|      0|            if (!slot->isThreadSafe) {
  ------------------
  |  Branch (1643:17): [True: 0, False: 0]
  ------------------
 1644|      0|                PK11_EnterSlotMonitor(slot);
 1645|      0|            }
 1646|      0|            PK11_GETTAB(slot)
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1647|      0|                ->C_CloseSession(slot->session);
 1648|      0|            slot->session = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
 1649|      0|            if (!slot->isThreadSafe) {
  ------------------
  |  Branch (1649:17): [True: 0, False: 0]
  ------------------
 1650|      0|                PK11_ExitSlotMonitor(slot);
 1651|      0|            }
 1652|      0|        }
 1653|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1654|      0|    }
 1655|       |
 1656|       |    /* use the session Info to determine if the card has been removed and then
 1657|       |     * re-inserted */
 1658|      0|    if (slot->session != CK_INVALID_HANDLE) {
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1658:9): [True: 0, False: 0]
  ------------------
 1659|      0|        if (slot->isThreadSafe) {
  ------------------
  |  Branch (1659:13): [True: 0, False: 0]
  ------------------
 1660|      0|            PK11_EnterSlotMonitor(slot);
 1661|      0|        }
 1662|      0|        crv = PK11_GETTAB(slot)->C_GetSessionInfo(slot->session, &sessionInfo);
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1663|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1663:13): [True: 0, False: 0]
  ------------------
 1664|      0|            PK11_GETTAB(slot)
  ------------------
  |  |  102|      0|#define PK11_GETTAB(x) ((CK_FUNCTION_LIST_3_0_PTR)((x)->functionList))
  ------------------
 1665|      0|                ->C_CloseSession(slot->session);
 1666|      0|            slot->session = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
 1667|      0|        }
 1668|      0|        if (slot->isThreadSafe) {
  ------------------
  |  Branch (1668:13): [True: 0, False: 0]
  ------------------
 1669|      0|            PK11_ExitSlotMonitor(slot);
 1670|      0|        }
 1671|      0|    }
 1672|       |
 1673|       |    /* card has not been removed, current token info is correct */
 1674|      0|    if (slot->session != CK_INVALID_HANDLE)
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (1674:9): [True: 0, False: 0]
  ------------------
 1675|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1676|       |
 1677|       |    /* initialize the token info state */
 1678|      0|    if (PK11_InitToken(slot, loadCerts) != SECSuccess) {
  ------------------
  |  Branch (1678:9): [True: 0, False: 0]
  ------------------
 1679|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1680|      0|    }
 1681|       |
 1682|      0|    return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1683|      0|}
pk11slot.c:pk11_zeroTerminatedToBlankPadded:
 1911|      4|{
 1912|      4|    CK_CHAR *walk = buffer;
 1913|      4|    CK_CHAR *end = buffer + buffer_size;
 1914|       |
 1915|       |    /* find the NULL */
 1916|    196|    while (walk < end && *walk != '\0') {
  ------------------
  |  Branch (1916:12): [True: 192, False: 4]
  |  Branch (1916:26): [True: 192, False: 0]
  ------------------
 1917|    192|        walk++;
 1918|    192|    }
 1919|       |
 1920|       |    /* clear out the buffer */
 1921|      4|    while (walk < end) {
  ------------------
  |  Branch (1921:12): [True: 0, False: 4]
  ------------------
 1922|      0|        *walk++ = ' ';
 1923|      0|    }
 1924|      4|}

SECMOD_Init:
   37|      2|{
   38|       |    /* don't initialize twice */
   39|      2|    if (moduleLock)
  ------------------
  |  Branch (39:9): [True: 1, False: 1]
  ------------------
   40|      1|        return;
   41|       |
   42|      1|    moduleLock = SECMOD_NewListLock();
   43|      1|    PK11_InitSlotLists();
   44|      1|}
SECMOD_Shutdown:
   48|      1|{
   49|       |    /* destroy the lock */
   50|      1|    if (moduleLock) {
  ------------------
  |  Branch (50:9): [True: 1, False: 0]
  ------------------
   51|      1|        SECMOD_DestroyListLock(moduleLock);
   52|      1|        moduleLock = NULL;
   53|      1|    }
   54|       |    /* free the internal module */
   55|      1|    if (internalModule) {
  ------------------
  |  Branch (55:9): [True: 1, False: 0]
  ------------------
   56|      1|        SECMOD_DestroyModule(internalModule);
   57|      1|        internalModule = NULL;
   58|      1|    }
   59|       |
   60|       |    /* free the default database module */
   61|      1|    if (defaultDBModule) {
  ------------------
  |  Branch (61:9): [True: 1, False: 0]
  ------------------
   62|      1|        SECMOD_DestroyModule(defaultDBModule);
   63|      1|        defaultDBModule = NULL;
   64|      1|    }
   65|       |
   66|       |    /* destroy the list */
   67|      1|    if (modules) {
  ------------------
  |  Branch (67:9): [True: 1, False: 0]
  ------------------
   68|      1|        SECMOD_DestroyModuleList(modules);
   69|      1|        modules = NULL;
   70|      1|    }
   71|       |
   72|      1|    if (modulesDB) {
  ------------------
  |  Branch (72:9): [True: 1, False: 0]
  ------------------
   73|      1|        SECMOD_DestroyModuleList(modulesDB);
   74|      1|        modulesDB = NULL;
   75|      1|    }
   76|       |
   77|      1|    if (modulesUnload) {
  ------------------
  |  Branch (77:9): [True: 0, False: 1]
  ------------------
   78|      0|        SECMOD_DestroyModuleList(modulesUnload);
   79|      0|        modulesUnload = NULL;
   80|      0|    }
   81|       |
   82|       |    /* make all the slots and the lists go away */
   83|      1|    PK11_DestroySlotLists();
   84|       |
   85|      1|    nss_DumpModuleLog();
   86|       |
   87|      1|#ifdef DEBUG
   88|      1|    if (PR_GetEnvSecure("NSS_STRICT_SHUTDOWN")) {
  ------------------
  |  Branch (88:9): [True: 0, False: 1]
  ------------------
   89|      0|        PORT_Assert(secmod_PrivateModuleCount == 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|      0|    }
   91|      1|#endif
   92|      1|    if (secmod_PrivateModuleCount) {
  ------------------
  |  Branch (92:9): [True: 0, False: 1]
  ------------------
   93|      0|        PORT_SetError(SEC_ERROR_BUSY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   94|      0|        return SECFailure;
   95|      0|    }
   96|      1|    return SECSuccess;
   97|      1|}
SECMOD_GetSystemFIPSEnabled:
  101|      2|{
  102|      2|    return NSS_GetSystemFIPSEnabled();
  103|      2|}
SECMOD_GetInternalModule:
  110|  3.44M|{
  111|  3.44M|    return internalModule;
  112|  3.44M|}
secmod_AddModuleToList:
  116|      2|{
  117|      2|    SECMODModuleList *mlp, *newListElement, *last = NULL;
  118|       |
  119|      2|    newListElement = SECMOD_NewModuleListElement();
  120|      2|    if (newListElement == NULL) {
  ------------------
  |  Branch (120:9): [True: 0, False: 2]
  ------------------
  121|      0|        return SECFailure;
  122|      0|    }
  123|       |
  124|      2|    newListElement->module = SECMOD_ReferenceModule(newModule);
  125|       |
  126|      2|    SECMOD_GetWriteLock(moduleLock);
  127|       |    /* Added it to the end (This is very inefficient, but Adding a module
  128|       |     * on the fly should happen maybe 2-3 times through the life this program
  129|       |     * on a given computer, and this list should be *SHORT*. */
  130|      2|    for (mlp = *moduleList; mlp != NULL; mlp = mlp->next) {
  ------------------
  |  Branch (130:29): [True: 0, False: 2]
  ------------------
  131|      0|        last = mlp;
  132|      0|    }
  133|       |
  134|      2|    if (last == NULL) {
  ------------------
  |  Branch (134:9): [True: 2, False: 0]
  ------------------
  135|      2|        *moduleList = newListElement;
  136|      2|    } else {
  137|      0|        SECMOD_AddList(last, newListElement, NULL);
  138|      0|    }
  139|      2|    SECMOD_ReleaseWriteLock(moduleLock);
  140|      2|    return SECSuccess;
  141|      2|}
SECMOD_AddModuleToList:
  145|      1|{
  146|      1|    if (newModule->internal && !internalModule) {
  ------------------
  |  Branch (146:9): [True: 1, False: 0]
  |  Branch (146:32): [True: 1, False: 0]
  ------------------
  147|      1|        internalModule = SECMOD_ReferenceModule(newModule);
  148|      1|    }
  149|      1|    return secmod_AddModuleToList(&modules, newModule);
  150|      1|}
SECMOD_AddModuleToDBOnlyList:
  154|      1|{
  155|      1|    if (defaultDBModule && SECMOD_GetDefaultModDBFlag(newModule)) {
  ------------------
  |  Branch (155:9): [True: 0, False: 1]
  |  Branch (155:28): [True: 0, False: 0]
  ------------------
  156|      0|        SECMOD_DestroyModule(defaultDBModule);
  157|      0|        defaultDBModule = SECMOD_ReferenceModule(newModule);
  158|      1|    } else if (defaultDBModule == NULL) {
  ------------------
  |  Branch (158:16): [True: 1, False: 0]
  ------------------
  159|      1|        defaultDBModule = SECMOD_ReferenceModule(newModule);
  160|      1|    }
  161|      1|    return secmod_AddModuleToList(&modulesDB, newModule);
  162|      1|}
SECMOD_GetDefaultModuleList:
  175|  3.62k|{
  176|  3.62k|    return modules;
  177|  3.62k|}
SECMOD_GetDefaultModuleListLock:
  202|  3.42M|{
  203|  3.42M|    return moduleLock;
  204|  3.42M|}
PK11_IsFIPS:
  666|  7.93k|{
  667|  7.93k|    SECMODModule *mod = SECMOD_GetInternalModule();
  668|       |
  669|  7.93k|    if (mod && mod->internal) {
  ------------------
  |  Branch (669:9): [True: 7.93k, False: 0]
  |  Branch (669:16): [True: 7.93k, False: 0]
  ------------------
  670|  7.93k|        return mod->isFIPS;
  671|  7.93k|    }
  672|       |
  673|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  674|  7.93k|}
SECMOD_NewModuleListElement:
  839|      2|{
  840|      2|    SECMODModuleList *newModList;
  841|       |
  842|      2|    newModList = (SECMODModuleList *)PORT_Alloc(sizeof(SECMODModuleList));
  ------------------
  |  |   52|      2|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  843|      2|    if (newModList) {
  ------------------
  |  Branch (843:9): [True: 2, False: 0]
  ------------------
  844|      2|        newModList->next = NULL;
  845|      2|        newModList->module = NULL;
  846|      2|    }
  847|      2|    return newModList;
  848|      2|}
SECMOD_ReferenceModule:
  855|      5|{
  856|      5|    PZ_Lock(module->refLock);
  ------------------
  |  |  245|      5|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  857|      5|    PORT_Assert(module->refCount > 0);
  ------------------
  |  |  120|      5|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      5|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  858|       |
  859|      5|    module->refCount++;
  860|      5|    PZ_Unlock(module->refLock);
  ------------------
  |  |  246|      5|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  861|      5|    return module;
  862|      5|}
SECMOD_DestroyModule:
  867|      7|{
  868|      7|    PRBool willfree = PR_FALSE;
  ------------------
  |  |  438|      7|#define PR_FALSE 0
  ------------------
  869|      7|    int slotCount;
  870|      7|    int i;
  871|       |
  872|      7|    PZ_Lock(module->refLock);
  ------------------
  |  |  245|      7|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  873|      7|    if (module->refCount-- == 1) {
  ------------------
  |  Branch (873:9): [True: 2, False: 5]
  ------------------
  874|      2|        willfree = PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
  875|      2|    }
  876|      7|    PORT_Assert(willfree || (module->refCount > 0));
  ------------------
  |  |  120|      7|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     12|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2, False: 5]
  |  |  |  |  |  Branch (208:7): [True: 5, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  877|      7|    PZ_Unlock(module->refLock);
  ------------------
  |  |  246|      7|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  878|       |
  879|      7|    if (!willfree) {
  ------------------
  |  Branch (879:9): [True: 5, False: 2]
  ------------------
  880|      5|        return;
  881|      5|    }
  882|       |
  883|      2|    if (module->parent != NULL) {
  ------------------
  |  Branch (883:9): [True: 1, False: 1]
  ------------------
  884|      1|        SECMODModule *parent = module->parent;
  885|       |        /* paranoia, don't loop forever if the modules are looped */
  886|      1|        module->parent = NULL;
  887|      1|        SECMOD_DestroyModule(parent);
  888|      1|    }
  889|       |
  890|       |    /* slots can't really disappear until our module starts freeing them,
  891|       |     * so this check is safe */
  892|      2|    slotCount = module->slotCount;
  893|      2|    if (slotCount == 0) {
  ------------------
  |  Branch (893:9): [True: 1, False: 1]
  ------------------
  894|      1|        SECMOD_SlotDestroyModule(module, PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  895|      1|        return;
  896|      1|    }
  897|       |
  898|       |    /* now free all out slots, when they are done, they will cause the
  899|       |     * module to disappear altogether */
  900|      3|    for (i = 0; i < slotCount; i++) {
  ------------------
  |  Branch (900:17): [True: 2, False: 1]
  ------------------
  901|      2|        if (!module->slots[i]->disabled) {
  ------------------
  |  Branch (901:13): [True: 2, False: 0]
  ------------------
  902|      2|            PK11_ClearSlotList(module->slots[i]);
  903|      2|        }
  904|      2|        PK11_FreeSlot(module->slots[i]);
  905|      2|    }
  906|       |    /* WARNING: once the last slot has been freed is it possible (even likely)
  907|       |     * that module is no more... touching it now is a good way to go south */
  908|      1|}
SECMOD_SlotDestroyModule:
  914|      3|{
  915|      3|    PRBool willfree = PR_FALSE;
  ------------------
  |  |  438|      3|#define PR_FALSE 0
  ------------------
  916|      3|    if (fromSlot) {
  ------------------
  |  Branch (916:9): [True: 2, False: 1]
  ------------------
  917|      2|        PORT_Assert(module->refCount == 0);
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  918|      2|        PZ_Lock(module->refLock);
  ------------------
  |  |  245|      2|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  919|      2|        if (module->slotCount-- == 1) {
  ------------------
  |  Branch (919:13): [True: 1, False: 1]
  ------------------
  920|      1|            willfree = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  921|      1|        }
  922|      2|        PORT_Assert(willfree || (module->slotCount > 0));
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      3|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  923|      2|        PZ_Unlock(module->refLock);
  ------------------
  |  |  246|      2|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  924|      2|        if (!willfree)
  ------------------
  |  Branch (924:13): [True: 1, False: 1]
  ------------------
  925|      1|            return;
  926|      2|    }
  927|       |
  928|      2|    if (module == pendingModule) {
  ------------------
  |  Branch (928:9): [True: 0, False: 2]
  ------------------
  929|      0|        pendingModule = NULL;
  930|      0|    }
  931|       |
  932|      2|    if (module->loaded) {
  ------------------
  |  Branch (932:9): [True: 2, False: 0]
  ------------------
  933|      2|        SECMOD_UnloadModule(module);
  934|      2|    }
  935|      2|    PZ_DestroyLock(module->refLock);
  ------------------
  |  |  244|      2|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  936|      2|    PORT_FreeArena(module->arena, PR_FALSE);
  ------------------
  |  |   61|      2|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                  PORT_FreeArena(module->arena, PR_FALSE);
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  937|      2|    secmod_PrivateModuleCount--;
  938|      2|}
SECMOD_DestroyModuleListElement:
  946|      2|{
  947|      2|    SECMODModuleList *next = element->next;
  948|       |
  949|      2|    if (element->module) {
  ------------------
  |  Branch (949:9): [True: 2, False: 0]
  ------------------
  950|      2|        SECMOD_DestroyModule(element->module);
  951|      2|        element->module = NULL;
  952|      2|    }
  953|      2|    PORT_Free(element);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
  954|      2|    return next;
  955|      2|}
SECMOD_DestroyModuleList:
  962|      2|{
  963|      2|    SECMODModuleList *lp;
  964|       |
  965|      4|    for (lp = list; lp != NULL; lp = SECMOD_DestroyModuleListElement(lp))
  ------------------
  |  Branch (965:21): [True: 2, False: 2]
  ------------------
  966|      2|        ;
  967|      2|}

nssDecodedCert_Destroy:
   46|  5.21k|{
   47|  5.21k|    if (!dc) {
  ------------------
  |  Branch (47:9): [True: 0, False: 5.21k]
  ------------------
   48|      0|        return PR_FAILURE;
   49|      0|    }
   50|  5.21k|    switch (dc->type) {
   51|  5.21k|        case NSSCertificateType_PKIX:
  ------------------
  |  Branch (51:9): [True: 5.21k, False: 0]
  ------------------
   52|  5.21k|            return nssDecodedPKIXCertificate_Destroy(dc);
   53|      0|        default:
  ------------------
  |  Branch (53:9): [True: 0, False: 5.21k]
  ------------------
   54|       |#if 0
   55|       |    nss_SetError(NSS_ERROR_INVALID_ARGUMENT);
   56|       |#endif
   57|      0|            break;
   58|  5.21k|    }
   59|      0|    return PR_FAILURE;
   60|  5.21k|}

nssCertificate_AddRef:
   79|  9.88k|{
   80|  9.88k|    if (c) {
  ------------------
  |  Branch (80:9): [True: 9.88k, False: 0]
  ------------------
   81|  9.88k|        nssPKIObject_AddRef(&c->object);
   82|  9.88k|    }
   83|  9.88k|    return c;
   84|  9.88k|}
nssCertificate_Destroy:
   89|  15.0k|{
   90|  15.0k|    nssCertificateStoreTrace lockTrace = { NULL, NULL, PR_FALSE, PR_FALSE };
  ------------------
  |  |  438|  15.0k|#define PR_FALSE 0
  ------------------
                  nssCertificateStoreTrace lockTrace = { NULL, NULL, PR_FALSE, PR_FALSE };
  ------------------
  |  |  438|  15.0k|#define PR_FALSE 0
  ------------------
   91|  15.0k|    nssCertificateStoreTrace unlockTrace = { NULL, NULL, PR_FALSE, PR_FALSE };
  ------------------
  |  |  438|  15.0k|#define PR_FALSE 0
  ------------------
                  nssCertificateStoreTrace unlockTrace = { NULL, NULL, PR_FALSE, PR_FALSE };
  ------------------
  |  |  438|  15.0k|#define PR_FALSE 0
  ------------------
   92|       |
   93|  15.0k|    if (c) {
  ------------------
  |  Branch (93:9): [True: 15.0k, False: 0]
  ------------------
   94|  15.0k|        PRUint32 i;
   95|  15.0k|        nssDecodedCert *dc = c->decoding;
   96|  15.0k|        NSSTrustDomain *td = STAN_GetDefaultTrustDomain();
   97|  15.0k|        NSSCryptoContext *cc = c->object.cryptoContext;
   98|       |
   99|  15.0k|        PR_ASSERT(c->object.refCount > 0);
  ------------------
  |  |  208|  15.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 15.0k, False: 0]
  |  |  ------------------
  ------------------
  100|       |
  101|       |        /* --- LOCK storage --- */
  102|  15.0k|        if (cc) {
  ------------------
  |  Branch (102:13): [True: 15.0k, False: 0]
  ------------------
  103|  15.0k|            nssCertificateStore_Lock(cc->certStore, &lockTrace);
  104|  15.0k|        } else {
  105|      0|            nssTrustDomain_LockCertCache(td);
  106|      0|        }
  107|  15.0k|        if (PR_ATOMIC_DECREMENT(&c->object.refCount) == 0) {
  ------------------
  |  |  123|  15.0k|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (107:13): [True: 5.21k, False: 9.88k]
  ------------------
  108|       |            /* --- remove cert and UNLOCK storage --- */
  109|  5.21k|            if (cc) {
  ------------------
  |  Branch (109:17): [True: 5.21k, False: 0]
  ------------------
  110|  5.21k|                nssCertificateStore_RemoveCertLOCKED(cc->certStore, c);
  111|  5.21k|                nssCertificateStore_Unlock(cc->certStore, &lockTrace,
  112|  5.21k|                                           &unlockTrace);
  113|  5.21k|            } else {
  114|      0|                nssTrustDomain_RemoveCertFromCacheLOCKED(td, c);
  115|      0|                nssTrustDomain_UnlockCertCache(td);
  116|      0|            }
  117|       |            /* free cert data */
  118|  5.21k|            for (i = 0; i < c->object.numInstances; i++) {
  ------------------
  |  Branch (118:25): [True: 0, False: 5.21k]
  ------------------
  119|      0|                nssCryptokiObject_Destroy(c->object.instances[i]);
  120|      0|            }
  121|  5.21k|            nssPKIObject_DestroyLock(&c->object);
  122|  5.21k|            nssArena_Destroy(c->object.arena);
  123|  5.21k|            nssDecodedCert_Destroy(dc);
  124|  9.88k|        } else {
  125|       |            /* --- UNLOCK storage --- */
  126|  9.88k|            if (cc) {
  ------------------
  |  Branch (126:17): [True: 9.88k, False: 0]
  ------------------
  127|  9.88k|                nssCertificateStore_Unlock(cc->certStore,
  128|  9.88k|                                           &lockTrace,
  129|  9.88k|                                           &unlockTrace);
  130|  9.88k|            } else {
  131|      0|                nssTrustDomain_UnlockCertCache(td);
  132|      0|            }
  133|  9.88k|        }
  134|  15.0k|    }
  135|  15.0k|    return PR_SUCCESS;
  136|  15.0k|}
NSSCertificate_Destroy:
  140|  15.0k|{
  141|  15.0k|    return nssCertificate_Destroy(c);
  142|  15.0k|}

nssCryptoContext_Create:
   24|      1|{
   25|      1|    NSSArena *arena;
   26|      1|    NSSCryptoContext *rvCC;
   27|      1|    arena = NSSArena_Create();
   28|      1|    if (!arena) {
  ------------------
  |  Branch (28:9): [True: 0, False: 1]
  ------------------
   29|      0|        return NULL;
   30|      0|    }
   31|      1|    rvCC = nss_ZNEW(arena, NSSCryptoContext);
  ------------------
  |  |  348|      1|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
   32|      1|    if (!rvCC) {
  ------------------
  |  Branch (32:9): [True: 0, False: 1]
  ------------------
   33|      0|        return NULL;
   34|      0|    }
   35|      1|    rvCC->td = td;
   36|      1|    rvCC->arena = arena;
   37|      1|    rvCC->certStore = nssCertificateStore_Create(rvCC->arena);
   38|      1|    if (!rvCC->certStore) {
  ------------------
  |  Branch (38:9): [True: 0, False: 1]
  ------------------
   39|      0|        nssArena_Destroy(arena);
   40|      0|        return NULL;
   41|      0|    }
   42|       |
   43|      1|    return rvCC;
   44|      1|}
NSSCryptoContext_Destroy:
   48|      1|{
   49|      1|    PRStatus status = PR_SUCCESS;
   50|      1|    PORT_Assert(cc && cc->certStore);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   51|      1|    if (!cc) {
  ------------------
  |  Branch (51:9): [True: 0, False: 1]
  ------------------
   52|      0|        return PR_FAILURE;
   53|      0|    }
   54|      1|    if (cc->certStore) {
  ------------------
  |  Branch (54:9): [True: 1, False: 0]
  ------------------
   55|      1|        status = nssCertificateStore_Destroy(cc->certStore);
   56|      1|        if (status == PR_FAILURE) {
  ------------------
  |  Branch (56:13): [True: 0, False: 1]
  ------------------
   57|      0|            return status;
   58|      0|        }
   59|      1|    } else {
   60|      0|        status = PR_FAILURE;
   61|      0|    }
   62|      1|    nssArena_Destroy(cc->arena);
   63|      1|    return status;
   64|      1|}
NSSCryptoContext_FindOrImportCertificate:
   96|  5.21k|{
   97|  5.21k|    NSSCertificate *rvCert = NULL;
   98|       |
   99|  5.21k|    PORT_Assert(cc && cc->certStore);
  ------------------
  |  |  120|  5.21k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 5.21k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 5.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  100|  5.21k|    if (!cc || !cc->certStore) {
  ------------------
  |  Branch (100:9): [True: 0, False: 5.21k]
  |  Branch (100:16): [True: 0, False: 5.21k]
  ------------------
  101|      0|        nss_SetError(NSS_ERROR_INVALID_ARGUMENT);
  102|      0|        return rvCert;
  103|      0|    }
  104|  5.21k|    rvCert = nssCertificateStore_FindOrAdd(cc->certStore, c);
  105|  5.21k|    if (rvCert == c && c->object.cryptoContext != cc) {
  ------------------
  |  Branch (105:9): [True: 5.21k, False: 0]
  |  Branch (105:24): [True: 0, False: 5.21k]
  ------------------
  106|      0|        PORT_Assert(!c->object.cryptoContext);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  107|      0|        c->object.cryptoContext = cc;
  108|      0|    }
  109|  5.21k|    if (rvCert) {
  ------------------
  |  Branch (109:9): [True: 5.21k, False: 0]
  ------------------
  110|       |        /* an NSSCertificate cannot be part of two crypto contexts
  111|       |        ** simultaneously.  If this assertion fails, then there is
  112|       |        ** a serious Stan design flaw.
  113|       |        */
  114|  5.21k|        PORT_Assert(cc == c->object.cryptoContext);
  ------------------
  |  |  120|  5.21k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.21k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  115|  5.21k|    }
  116|  5.21k|    return rvCert;
  117|  5.21k|}
NSSCryptoContext_FindCertificateByEncodedCertificate:
  338|  5.40k|{
  339|  5.40k|    PORT_Assert(cc && cc->certStore);
  ------------------
  |  |  120|  5.40k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 5.40k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 5.40k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  340|  5.40k|    if (!cc || !cc->certStore) {
  ------------------
  |  Branch (340:9): [True: 0, False: 5.40k]
  |  Branch (340:16): [True: 0, False: 5.40k]
  ------------------
  341|      0|        return NULL;
  342|      0|    }
  343|  5.40k|    return nssCertificateStore_FindCertificateByEncodedCertificate(
  344|  5.40k|        cc->certStore,
  345|  5.40k|        encodedCertificate);
  346|  5.40k|}
nssCryptoContext_FindTrustForCertificate:
  493|  5.21k|{
  494|  5.21k|    PORT_Assert(cc && cc->certStore);
  ------------------
  |  |  120|  5.21k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 5.21k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 5.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  495|  5.21k|    if (!cc || !cc->certStore) {
  ------------------
  |  Branch (495:9): [True: 0, False: 5.21k]
  |  Branch (495:16): [True: 0, False: 5.21k]
  ------------------
  496|      0|        return NULL;
  497|      0|    }
  498|  5.21k|    return nssCertificateStore_FindTrustForCertificate(cc->certStore, cert);
  499|  5.21k|}

STAN_GetDefaultTrustDomain:
   49|  20.5k|{
   50|  20.5k|    return g_default_trust_domain;
   51|  20.5k|}
STAN_GetDefaultCryptoContext:
   55|  5.40k|{
   56|  5.40k|    return g_default_crypto_context;
   57|  5.40k|}
STAN_InitTokenForSlotInfo:
   64|      2|{
   65|      2|    NSSToken *token;
   66|      2|    if (!td) {
  ------------------
  |  Branch (66:9): [True: 0, False: 2]
  ------------------
   67|      0|        td = g_default_trust_domain;
   68|      0|        if (!td) {
  ------------------
  |  Branch (68:13): [True: 0, False: 0]
  ------------------
   69|       |            /* we're called while still initting. slot will get added
   70|       |             * appropriately through normal init processes */
   71|      0|            return PR_SUCCESS;
   72|      0|        }
   73|      0|    }
   74|      2|    token = nssToken_CreateFromPK11SlotInfo(td, slot);
   75|      2|    if (token) {
  ------------------
  |  Branch (75:9): [True: 2, False: 0]
  ------------------
   76|       |        /* PK11Slot_SetNSSToken increments the refcount on |token| to 2 */
   77|      2|        PK11Slot_SetNSSToken(slot, token);
   78|       |
   79|       |        /* we give our reference to |td->tokenList| */
   80|      2|        NSSRWLock_LockWrite(td->tokensLock);
  ------------------
  |  |   48|      2|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  ------------------
   81|      2|        nssList_Add(td->tokenList, token);
   82|      2|        NSSRWLock_UnlockWrite(td->tokensLock);
  ------------------
  |  |   51|      2|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  ------------------
   83|      2|    } else {
   84|      0|        PK11Slot_SetNSSToken(slot, NULL);
   85|      0|    }
   86|      2|    return PR_SUCCESS;
   87|      2|}
STAN_LoadDefaultNSS3TrustDomain:
  110|      1|{
  111|      1|    NSSTrustDomain *td;
  112|      1|    SECMODModuleList *mlp;
  113|      1|    SECMODListLock *moduleLock = SECMOD_GetDefaultModuleListLock();
  114|      1|    int i;
  115|       |
  116|      1|    if (g_default_trust_domain || g_default_crypto_context) {
  ------------------
  |  Branch (116:9): [True: 0, False: 1]
  |  Branch (116:35): [True: 0, False: 1]
  ------------------
  117|       |        /* Stan is already initialized or a previous shutdown failed. */
  118|      0|        nss_SetError(NSS_ERROR_ALREADY_INITIALIZED);
  119|      0|        return PR_FAILURE;
  120|      0|    }
  121|      1|    td = NSSTrustDomain_Create(NULL, NULL, NULL, NULL);
  122|      1|    if (!td) {
  ------------------
  |  Branch (122:9): [True: 0, False: 1]
  ------------------
  123|      0|        return PR_FAILURE;
  124|      0|    }
  125|       |    /*
  126|       |     * Deadlock warning: we should never acquire the moduleLock while
  127|       |     * we hold the tokensLock. We can use the NSSRWLock Rank feature to
  128|       |     * guarrentee this. tokensLock have a higher rank than module lock.
  129|       |     */
  130|      1|    td->tokenList = nssList_Create(td->arena, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  131|      1|    if (!td->tokenList) {
  ------------------
  |  Branch (131:9): [True: 0, False: 1]
  ------------------
  132|      0|        goto loser;
  133|      0|    }
  134|      1|    SECMOD_GetReadLock(moduleLock);
  135|      1|    NSSRWLock_LockWrite(td->tokensLock);
  ------------------
  |  |   48|      1|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  ------------------
  136|      2|    for (mlp = SECMOD_GetDefaultModuleList(); mlp != NULL; mlp = mlp->next) {
  ------------------
  |  Branch (136:47): [True: 1, False: 1]
  ------------------
  137|      3|        for (i = 0; i < mlp->module->slotCount; i++) {
  ------------------
  |  Branch (137:21): [True: 2, False: 1]
  ------------------
  138|      2|            STAN_InitTokenForSlotInfo(td, mlp->module->slots[i]);
  139|      2|        }
  140|      1|    }
  141|      1|    td->tokens = nssList_CreateIterator(td->tokenList);
  142|      1|    NSSRWLock_UnlockWrite(td->tokensLock);
  ------------------
  |  |   51|      1|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  ------------------
  143|      1|    SECMOD_ReleaseReadLock(moduleLock);
  144|      1|    if (!td->tokens) {
  ------------------
  |  Branch (144:9): [True: 0, False: 1]
  ------------------
  145|      0|        goto loser;
  146|      0|    }
  147|      1|    g_default_crypto_context = NSSTrustDomain_CreateCryptoContext(td, NULL);
  148|      1|    if (!g_default_crypto_context) {
  ------------------
  |  Branch (148:9): [True: 0, False: 1]
  ------------------
  149|      0|        goto loser;
  150|      0|    }
  151|      1|    g_default_trust_domain = td;
  152|      1|    return PR_SUCCESS;
  153|       |
  154|      0|loser:
  155|      0|    NSSTrustDomain_Destroy(td);
  156|      0|    return PR_FAILURE;
  157|      1|}
STAN_Shutdown:
  208|      1|{
  209|      1|    PRStatus status = PR_SUCCESS;
  210|      1|    if (g_default_trust_domain) {
  ------------------
  |  Branch (210:9): [True: 1, False: 0]
  ------------------
  211|      1|        if (NSSTrustDomain_Destroy(g_default_trust_domain) == PR_SUCCESS) {
  ------------------
  |  Branch (211:13): [True: 1, False: 0]
  ------------------
  212|      1|            g_default_trust_domain = NULL;
  213|      1|        } else {
  214|      0|            status = PR_FAILURE;
  215|      0|        }
  216|      1|    }
  217|      1|    if (g_default_crypto_context) {
  ------------------
  |  Branch (217:9): [True: 1, False: 0]
  ------------------
  218|      1|        if (NSSCryptoContext_Destroy(g_default_crypto_context) == PR_SUCCESS) {
  ------------------
  |  Branch (218:13): [True: 1, False: 0]
  ------------------
  219|      1|            g_default_crypto_context = NULL;
  220|      1|        } else {
  221|      0|            status = PR_FAILURE;
  222|      0|        }
  223|      1|    }
  224|      1|    return status;
  225|      1|}
nssPKIX509_GetIssuerAndSerialFromDER:
  257|  10.8k|{
  258|  10.8k|    SECItem derCert = { 0 };
  259|  10.8k|    SECItem derIssuer = { 0 };
  260|  10.8k|    SECItem derSerial = { 0 };
  261|  10.8k|    SECStatus secrv;
  262|  10.8k|    derCert.data = (unsigned char *)der->data;
  263|  10.8k|    derCert.len = der->size;
  264|  10.8k|    secrv = CERT_IssuerNameFromDERCert(&derCert, &derIssuer);
  265|  10.8k|    if (secrv != SECSuccess) {
  ------------------
  |  Branch (265:9): [True: 326, False: 10.4k]
  ------------------
  266|    326|        return PR_FAILURE;
  267|    326|    }
  268|  10.4k|    secrv = CERT_SerialNumberFromDERCert(&derCert, &derSerial);
  269|  10.4k|    if (secrv != SECSuccess) {
  ------------------
  |  Branch (269:9): [True: 0, False: 10.4k]
  ------------------
  270|      0|        PORT_Free(derSerial.data);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  271|      0|        return PR_FAILURE;
  272|      0|    }
  273|  10.4k|    issuer->data = derIssuer.data;
  274|  10.4k|    issuer->size = derIssuer.len;
  275|  10.4k|    serial->data = derSerial.data;
  276|  10.4k|    serial->size = derSerial.len;
  277|  10.4k|    return PR_SUCCESS;
  278|  10.4k|}
nssDecodedPKIXCertificate_Create:
  490|  5.40k|{
  491|  5.40k|    nssDecodedCert *rvDC = NULL;
  492|  5.40k|    CERTCertificate *cert;
  493|  5.40k|    SECItem secDER;
  494|       |
  495|  5.40k|    SECITEM_FROM_NSSITEM(&secDER, encoding);
  ------------------
  |  |   31|  5.40k|    (secit)->data = (unsigned char *)(nssit)->data; \
  |  |   32|  5.40k|    (secit)->len = (unsigned int)(nssit)->size;
  ------------------
  496|  5.40k|    cert = CERT_DecodeDERCertificate(&secDER, PR_TRUE, NULL);
  ------------------
  |  |  437|  5.40k|#define PR_TRUE 1
  ------------------
  497|  5.40k|    if (cert) {
  ------------------
  |  Branch (497:9): [True: 5.21k, False: 193]
  ------------------
  498|  5.21k|        rvDC = nss_ZNEW(arenaOpt, nssDecodedCert);
  ------------------
  |  |  348|  5.21k|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  499|  5.21k|        if (rvDC) {
  ------------------
  |  Branch (499:13): [True: 5.21k, False: 0]
  ------------------
  500|  5.21k|            rvDC->type = NSSCertificateType_PKIX;
  501|  5.21k|            rvDC->data = (void *)cert;
  502|  5.21k|            rvDC->getIdentifier = nss3certificate_getIdentifier;
  503|  5.21k|            rvDC->getIssuerIdentifier = nss3certificate_getIssuerIdentifier;
  504|  5.21k|            rvDC->matchIdentifier = nss3certificate_matchIdentifier;
  505|  5.21k|            rvDC->isValidIssuer = nss3certificate_isValidIssuer;
  506|  5.21k|            rvDC->getUsage = nss3certificate_getUsage;
  507|  5.21k|            rvDC->isValidAtTime = nss3certificate_isValidAtTime;
  508|  5.21k|            rvDC->isNewerThan = nss3certificate_isNewerThan;
  509|  5.21k|            rvDC->matchUsage = nss3certificate_matchUsage;
  510|  5.21k|            rvDC->isTrustedForUsage = nss3certificate_isTrustedForUsage;
  511|  5.21k|            rvDC->getEmailAddress = nss3certificate_getEmailAddress;
  512|  5.21k|            rvDC->getDERSerialNumber = nss3certificate_getDERSerialNumber;
  513|  5.21k|        } else {
  514|      0|            CERT_DestroyCertificate(cert);
  515|      0|        }
  516|  5.21k|    }
  517|  5.40k|    return rvDC;
  518|  5.40k|}
nssDecodedPKIXCertificate_Destroy:
  546|  5.21k|{
  547|  5.21k|    CERTCertificate *cert = (CERTCertificate *)dc->data;
  548|       |
  549|       |    /* The decoder may only be half initialized (the case where we find we
  550|       |     * could not decode the certificate). In this case, there is not cert to
  551|       |     * free, just free the dc structure. */
  552|  5.21k|    if (cert) {
  ------------------
  |  Branch (552:9): [True: 5.21k, False: 0]
  ------------------
  553|  5.21k|        PRBool freeSlot = cert->ownSlot;
  554|  5.21k|        PK11SlotInfo *slot = cert->slot;
  555|  5.21k|        PLArenaPool *arena = cert->arena;
  556|       |        /* zero cert before freeing. Any stale references to this cert
  557|       |         * after this point will probably cause an exception.  */
  558|  5.21k|        PORT_Memset(cert, 0, sizeof *cert);
  ------------------
  |  |  182|  5.21k|#define PORT_Memset memset
  ------------------
  559|       |        /* free the arena that contains the cert. */
  560|  5.21k|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|  5.21k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|  5.21k|#define PR_FALSE 0
  ------------------
  561|  5.21k|        if (slot && freeSlot) {
  ------------------
  |  Branch (561:13): [True: 0, False: 5.21k]
  |  Branch (561:21): [True: 0, False: 0]
  ------------------
  562|      0|            PK11_FreeSlot(slot);
  563|      0|        }
  564|  5.21k|    }
  565|  5.21k|    nss_ZFreeIf(dc);
  566|  5.21k|    return PR_SUCCESS;
  567|  5.21k|}
STAN_GetCERTCertificate:
  977|  5.40k|{
  978|  5.40k|    return stan_GetCERTCertificate(c, PR_FALSE);
  ------------------
  |  |  438|  5.40k|#define PR_FALSE 0
  ------------------
  979|  5.40k|}
STAN_GetCERTCertificateOrRelease:
  990|  5.21k|{
  991|  5.21k|    CERTCertificate *nss3cert = stan_GetCERTCertificate(c, PR_FALSE);
  ------------------
  |  |  438|  5.21k|#define PR_FALSE 0
  ------------------
  992|  5.21k|    if (!nss3cert) {
  ------------------
  |  Branch (992:9): [True: 0, False: 5.21k]
  ------------------
  993|      0|        nssCertificate_Destroy(c);
  994|      0|    }
  995|  5.21k|    return nss3cert;
  996|  5.21k|}
STAN_GetNSSCertificate:
 1024|  4.66k|{
 1025|  4.66k|    NSSCertificate *c;
 1026|  4.66k|    nssCryptokiInstance *instance;
 1027|  4.66k|    nssPKIObject *pkiob;
 1028|  4.66k|    NSSArena *arena;
 1029|  4.66k|    CERT_LockCertTempPerm(cc);
 1030|  4.66k|    c = cc->nssCertificate;
 1031|  4.66k|    CERT_UnlockCertTempPerm(cc);
 1032|  4.66k|    if (c) {
  ------------------
  |  Branch (1032:9): [True: 4.66k, False: 0]
  ------------------
 1033|  4.66k|        return c;
 1034|  4.66k|    }
 1035|       |    /* i don't think this should happen.  but if it can, need to create
 1036|       |     * NSSCertificate from CERTCertificate values here.  */
 1037|       |    /* Yup, it can happen. */
 1038|      0|    arena = NSSArena_Create();
 1039|      0|    if (!arena) {
  ------------------
  |  Branch (1039:9): [True: 0, False: 0]
  ------------------
 1040|      0|        return NULL;
 1041|      0|    }
 1042|      0|    c = nss_ZNEW(arena, NSSCertificate);
  ------------------
  |  |  348|      0|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
 1043|      0|    if (!c) {
  ------------------
  |  Branch (1043:9): [True: 0, False: 0]
  ------------------
 1044|      0|        nssArena_Destroy(arena);
 1045|      0|        return NULL;
 1046|      0|    }
 1047|      0|    NSSITEM_FROM_SECITEM(&c->encoding, &cc->derCert);
  ------------------
  |  |   27|      0|    (nssit)->data = (void *)(secit)->data; \
  |  |   28|      0|    (nssit)->size = (PRUint32)(secit)->len;
  ------------------
 1048|      0|    c->type = NSSCertificateType_PKIX;
 1049|      0|    pkiob = nssPKIObject_Create(arena, NULL, cc->dbhandle, NULL, nssPKIMonitor);
 1050|      0|    if (!pkiob) {
  ------------------
  |  Branch (1050:9): [True: 0, False: 0]
  ------------------
 1051|      0|        nssArena_Destroy(arena);
 1052|      0|        return NULL;
 1053|      0|    }
 1054|      0|    c->object = *pkiob;
 1055|      0|    nssItem_Create(arena,
 1056|      0|                   &c->issuer, cc->derIssuer.len, cc->derIssuer.data);
 1057|      0|    nssItem_Create(arena,
 1058|      0|                   &c->subject, cc->derSubject.len, cc->derSubject.data);
 1059|       |    /* CERTCertificate stores serial numbers decoded.  I need the DER
 1060|       |     * here.  sigh.
 1061|       |     */
 1062|      0|    SECItem derSerial;
 1063|      0|    SECStatus secrv;
 1064|      0|    secrv = CERT_SerialNumberFromDERCert(&cc->derCert, &derSerial);
 1065|      0|    if (secrv == SECFailure) {
  ------------------
  |  Branch (1065:9): [True: 0, False: 0]
  ------------------
 1066|      0|        nssArena_Destroy(arena);
 1067|      0|        return NULL;
 1068|      0|    }
 1069|      0|    nssItem_Create(arena, &c->serial, derSerial.len, derSerial.data);
 1070|      0|    PORT_Free(derSerial.data);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1071|       |
 1072|      0|    if (cc->emailAddr && cc->emailAddr[0]) {
  ------------------
  |  Branch (1072:9): [True: 0, False: 0]
  |  Branch (1072:26): [True: 0, False: 0]
  ------------------
 1073|      0|        c->email = nssUTF8_Create(arena,
 1074|      0|                                  nssStringType_PrintableString,
 1075|      0|                                  (NSSUTF8 *)cc->emailAddr,
 1076|      0|                                  PORT_Strlen(cc->emailAddr));
  ------------------
  |  |  190|      0|#define PORT_Strlen(s) strlen(s)
  ------------------
 1077|      0|    }
 1078|      0|    if (cc->slot) {
  ------------------
  |  Branch (1078:9): [True: 0, False: 0]
  ------------------
 1079|      0|        instance = nss_ZNEW(arena, nssCryptokiInstance);
  ------------------
  |  |  348|      0|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
 1080|      0|        if (!instance) {
  ------------------
  |  Branch (1080:13): [True: 0, False: 0]
  ------------------
 1081|      0|            nssArena_Destroy(arena);
 1082|      0|            return NULL;
 1083|      0|        }
 1084|      0|        instance->token = PK11Slot_GetNSSToken(cc->slot);
 1085|      0|        if (!instance->token) {
  ------------------
  |  Branch (1085:13): [True: 0, False: 0]
  ------------------
 1086|      0|            nssArena_Destroy(arena);
 1087|      0|            return NULL;
 1088|      0|        }
 1089|      0|        instance->handle = cc->pkcs11ID;
 1090|      0|        instance->isTokenObject = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1091|      0|        if (cc->nickname) {
  ------------------
  |  Branch (1091:13): [True: 0, False: 0]
  ------------------
 1092|      0|            instance->label = nssUTF8_Create(arena,
 1093|      0|                                             nssStringType_UTF8String,
 1094|      0|                                             (NSSUTF8 *)cc->nickname,
 1095|      0|                                             PORT_Strlen(cc->nickname));
  ------------------
  |  |  190|      0|#define PORT_Strlen(s) strlen(s)
  ------------------
 1096|      0|        }
 1097|      0|        nssPKIObject_AddInstance(&c->object, instance);
 1098|      0|    }
 1099|      0|    c->decoding = create_decoded_pkix_cert_from_nss3cert(NULL, cc);
 1100|      0|    CERT_LockCertTempPerm(cc);
 1101|      0|    cc->nssCertificate = c;
 1102|      0|    CERT_UnlockCertTempPerm(cc);
 1103|      0|    return c;
 1104|      0|}
pki3hack.c:get_cert_instance:
  643|  5.21k|{
  644|  5.21k|    nssCryptokiObject *instance, **ci;
  645|  5.21k|    nssCryptokiObject **instances = nssPKIObject_GetInstances(&c->object);
  646|  5.21k|    if (!instances) {
  ------------------
  |  Branch (646:9): [True: 5.21k, False: 0]
  ------------------
  647|  5.21k|        return NULL;
  648|  5.21k|    }
  649|      0|    instance = NULL;
  650|      0|    for (ci = instances; *ci; ci++) {
  ------------------
  |  Branch (650:26): [True: 0, False: 0]
  ------------------
  651|      0|        if (!instance) {
  ------------------
  |  Branch (651:13): [True: 0, False: 0]
  ------------------
  652|      0|            instance = nssCryptokiObject_Clone(*ci);
  653|      0|        } else {
  654|       |            /* This only really works for two instances...  But 3.4 can't
  655|       |             * handle more anyway.  The logic is, if there are multiple
  656|       |             * instances, prefer the one that is not internal (e.g., on
  657|       |             * a hardware device.
  658|       |             */
  659|      0|            if (PK11_IsInternal(instance->token->pk11slot)) {
  ------------------
  |  Branch (659:17): [True: 0, False: 0]
  ------------------
  660|      0|                nssCryptokiObject_Destroy(instance);
  661|      0|                instance = nssCryptokiObject_Clone(*ci);
  662|      0|            }
  663|      0|        }
  664|      0|    }
  665|      0|    nssCryptokiObjectArray_Destroy(instances);
  666|      0|    return instance;
  667|  5.21k|}
pki3hack.c:stan_GetCERTCertificate:
  889|  10.6k|{
  890|  10.6k|    nssDecodedCert *dc = NULL;
  891|  10.6k|    CERTCertificate *cc = NULL;
  892|  10.6k|    CERTCertTrust certTrust;
  893|       |
  894|       |    /* make sure object does not go away until we finish */
  895|  10.6k|    nssPKIObject_AddRef(&c->object);
  896|  10.6k|    nssPKIObject_Lock(&c->object);
  897|       |
  898|  10.6k|    dc = c->decoding;
  899|  10.6k|    if (!dc) {
  ------------------
  |  Branch (899:9): [True: 5.40k, False: 5.21k]
  ------------------
  900|  5.40k|        dc = nssDecodedPKIXCertificate_Create(NULL, &c->encoding);
  901|  5.40k|        if (!dc) {
  ------------------
  |  Branch (901:13): [True: 193, False: 5.21k]
  ------------------
  902|    193|            goto loser;
  903|    193|        }
  904|  5.21k|        cc = (CERTCertificate *)dc->data;
  905|  5.21k|        PORT_Assert(cc); /* software error */
  ------------------
  |  |  120|  5.21k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.21k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  906|  5.21k|        if (!cc) {
  ------------------
  |  Branch (906:13): [True: 0, False: 5.21k]
  ------------------
  907|      0|            nssDecodedPKIXCertificate_Destroy(dc);
  908|      0|            nss_SetError(NSS_ERROR_INTERNAL_ERROR);
  909|      0|            goto loser;
  910|      0|        }
  911|  5.21k|        PORT_Assert(!c->decoding);
  ------------------
  |  |  120|  5.21k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.21k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  912|  5.21k|        if (!c->decoding) {
  ------------------
  |  Branch (912:13): [True: 5.21k, False: 0]
  ------------------
  913|  5.21k|            c->decoding = dc;
  914|  5.21k|        } else {
  915|       |            /* this should never happen. Fail. */
  916|      0|            nssDecodedPKIXCertificate_Destroy(dc);
  917|      0|            nss_SetError(NSS_ERROR_INTERNAL_ERROR);
  918|      0|            goto loser;
  919|      0|        }
  920|  5.21k|    }
  921|  10.4k|    cc = (CERTCertificate *)dc->data;
  922|  10.4k|    PORT_Assert(cc);
  ------------------
  |  |  120|  10.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  923|  10.4k|    if (!cc) {
  ------------------
  |  Branch (923:9): [True: 0, False: 10.4k]
  ------------------
  924|      0|        nss_SetError(NSS_ERROR_INTERNAL_ERROR);
  925|      0|        goto loser;
  926|      0|    }
  927|  10.4k|    CERT_LockCertTempPerm(cc);
  928|  10.4k|    NSSCertificate *nssCert = cc->nssCertificate;
  929|  10.4k|    CERT_UnlockCertTempPerm(cc);
  930|  10.4k|    if (!nssCert || forceUpdate) {
  ------------------
  |  Branch (930:9): [True: 5.21k, False: 5.21k]
  |  Branch (930:21): [True: 0, False: 5.21k]
  ------------------
  931|  5.21k|        fill_CERTCertificateFields(c, cc, forceUpdate);
  932|  5.21k|    } else if (CERT_GetCertTrust(cc, &certTrust) != SECSuccess) {
  ------------------
  |  Branch (932:16): [True: 5.21k, False: 0]
  ------------------
  933|  5.21k|        CERTCertTrust *trust;
  934|  5.21k|        if (!c->object.cryptoContext) {
  ------------------
  |  Branch (934:13): [True: 0, False: 5.21k]
  ------------------
  935|       |            /* If it's a perm cert, it might have been stored before the
  936|       |             * trust, so look for the trust again.
  937|       |             */
  938|      0|            trust = nssTrust_GetCERTCertTrustForCert(c, cc);
  939|  5.21k|        } else {
  940|       |            /* If it's a temp cert, it might have been stored before the
  941|       |             * builtin trust module is loaded, so look for the trust
  942|       |             * again, but don't set the empty trust if it is not found.
  943|       |             */
  944|  5.21k|            NSSTrust *t = nssTrustDomain_FindTrustForCertificate(c->object.cryptoContext->td, c);
  945|  5.21k|            if (!t) {
  ------------------
  |  Branch (945:17): [True: 5.21k, False: 0]
  ------------------
  946|  5.21k|                goto loser;
  947|  5.21k|            }
  948|      0|            trust = cert_trust_from_stan_trust(t, cc->arena);
  949|      0|            nssTrust_Destroy(t);
  950|      0|            if (!trust) {
  ------------------
  |  Branch (950:17): [True: 0, False: 0]
  ------------------
  951|      0|                goto loser;
  952|      0|            }
  953|      0|        }
  954|       |
  955|      0|        CERT_LockCertTrust(cc);
  956|      0|        cc->trust = trust;
  957|      0|        CERT_UnlockCertTrust(cc);
  958|      0|    }
  959|       |
  960|  10.6k|loser:
  961|  10.6k|    nssPKIObject_Unlock(&c->object);
  962|  10.6k|    nssPKIObject_Destroy(&c->object);
  963|  10.6k|    return cc;
  964|  10.4k|}
pki3hack.c:fill_CERTCertificateFields:
  731|  5.21k|{
  732|  5.21k|    CERTCertTrust *trust = NULL;
  733|  5.21k|    NSSTrust *nssTrust;
  734|  5.21k|    NSSCryptoContext *context = c->object.cryptoContext;
  735|  5.21k|    nssCryptokiInstance *instance;
  736|  5.21k|    NSSUTF8 *stanNick = NULL;
  737|       |
  738|       |    /* We are holding the base class object's lock on entry of this function
  739|       |     * This lock protects writes to fields of the CERTCertificate .
  740|       |     * It is also needed by some functions to compute values such as trust.
  741|       |     */
  742|  5.21k|    instance = get_cert_instance(c);
  743|       |
  744|  5.21k|    if (instance) {
  ------------------
  |  Branch (744:9): [True: 0, False: 5.21k]
  ------------------
  745|      0|        stanNick = instance->label;
  746|  5.21k|    } else if (context) {
  ------------------
  |  Branch (746:16): [True: 5.21k, False: 0]
  ------------------
  747|  5.21k|        stanNick = c->object.tempName;
  748|  5.21k|    }
  749|       |    /* fill other fields needed by NSS3 functions using CERTCertificate */
  750|  5.21k|    if ((!cc->nickname && stanNick) || forced) {
  ------------------
  |  Branch (750:10): [True: 5.21k, False: 0]
  |  Branch (750:27): [True: 0, False: 5.21k]
  |  Branch (750:40): [True: 0, False: 5.21k]
  ------------------
  751|      0|        PRStatus nssrv;
  752|      0|        int nicklen, tokenlen, len;
  753|      0|        NSSUTF8 *tokenName = NULL;
  754|      0|        char *nick;
  755|      0|        if (instance &&
  ------------------
  |  Branch (755:13): [True: 0, False: 0]
  ------------------
  756|      0|            (!PK11_IsInternalKeySlot(instance->token->pk11slot) ||
  ------------------
  |  Branch (756:14): [True: 0, False: 0]
  ------------------
  757|      0|             (stanNick && PORT_Strchr(stanNick, ':') != NULL))) {
  ------------------
  |  |  186|      0|#define PORT_Strchr strchr
  ------------------
  |  Branch (757:15): [True: 0, False: 0]
  |  Branch (757:27): [True: 0, False: 0]
  ------------------
  758|      0|            tokenName = nssToken_GetName(instance->token);
  759|      0|            tokenlen = nssUTF8_Size(tokenName, &nssrv);
  760|      0|        } else {
  761|       |            /* don't use token name for internal slot; 3.3 didn't */
  762|      0|            tokenlen = 0;
  763|      0|        }
  764|      0|        if (stanNick) {
  ------------------
  |  Branch (764:13): [True: 0, False: 0]
  ------------------
  765|      0|            nicklen = nssUTF8_Size(stanNick, &nssrv);
  766|      0|            len = tokenlen + nicklen;
  767|      0|            nick = PORT_ArenaAlloc(cc->arena, len);
  ------------------
  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  768|      0|            if (tokenName) {
  ------------------
  |  Branch (768:17): [True: 0, False: 0]
  ------------------
  769|      0|                memcpy(nick, tokenName, tokenlen - 1);
  770|      0|                nick[tokenlen - 1] = ':';
  771|      0|                memcpy(nick + tokenlen, stanNick, nicklen - 1);
  772|      0|            } else {
  773|      0|                memcpy(nick, stanNick, nicklen - 1);
  774|      0|            }
  775|      0|            nick[len - 1] = '\0';
  776|      0|            cc->nickname = nick;
  777|      0|        } else {
  778|      0|            cc->nickname = NULL;
  779|      0|        }
  780|      0|    }
  781|  5.21k|    if (context) {
  ------------------
  |  Branch (781:9): [True: 5.21k, False: 0]
  ------------------
  782|       |        /* trust */
  783|  5.21k|        nssTrust = nssCryptoContext_FindTrustForCertificate(context, c);
  784|  5.21k|        if (!nssTrust) {
  ------------------
  |  Branch (784:13): [True: 5.21k, False: 0]
  ------------------
  785|       |            /* chicken and egg issue:
  786|       |             *
  787|       |             * c->issuer and c->serial are empty at this point, but
  788|       |             * nssTrustDomain_FindTrustForCertificate use them to look up
  789|       |             * up the trust object, so we point them to cc->derIssuer and
  790|       |             * cc->serialNumber.
  791|       |             *
  792|       |             * Our caller will fill these in with proper arena copies when we
  793|       |             * return. */
  794|  5.21k|            c->issuer.data = cc->derIssuer.data;
  795|  5.21k|            c->issuer.size = cc->derIssuer.len;
  796|  5.21k|            c->serial.data = cc->serialNumber.data;
  797|  5.21k|            c->serial.size = cc->serialNumber.len;
  798|  5.21k|            nssTrust = nssTrustDomain_FindTrustForCertificate(context->td, c);
  799|  5.21k|        }
  800|  5.21k|        if (nssTrust) {
  ------------------
  |  Branch (800:13): [True: 0, False: 5.21k]
  ------------------
  801|      0|            trust = cert_trust_from_stan_trust(nssTrust, cc->arena);
  802|      0|            if (trust) {
  ------------------
  |  Branch (802:17): [True: 0, False: 0]
  ------------------
  803|       |                /* we should destroy cc->trust before replacing it, but it's
  804|       |                   allocated in cc->arena, so memory growth will occur on each
  805|       |                   refresh */
  806|      0|                CERT_LockCertTrust(cc);
  807|      0|                cc->trust = trust;
  808|      0|                CERT_UnlockCertTrust(cc);
  809|      0|            }
  810|      0|            nssTrust_Destroy(nssTrust);
  811|      0|        }
  812|  5.21k|    } else if (instance) {
  ------------------
  |  Branch (812:16): [True: 0, False: 0]
  ------------------
  813|       |        /* slot */
  814|      0|        if (cc->slot != instance->token->pk11slot) {
  ------------------
  |  Branch (814:13): [True: 0, False: 0]
  ------------------
  815|      0|            if (cc->slot) {
  ------------------
  |  Branch (815:17): [True: 0, False: 0]
  ------------------
  816|      0|                PK11_FreeSlot(cc->slot);
  817|      0|            }
  818|      0|            cc->slot = PK11_ReferenceSlot(instance->token->pk11slot);
  819|      0|        }
  820|      0|        cc->ownSlot = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  821|       |        /* pkcs11ID */
  822|      0|        cc->pkcs11ID = instance->handle;
  823|       |        /* trust */
  824|      0|        trust = nssTrust_GetCERTCertTrustForCert(c, cc);
  825|      0|        if (trust) {
  ------------------
  |  Branch (825:13): [True: 0, False: 0]
  ------------------
  826|       |            /* we should destroy cc->trust before replacing it, but it's
  827|       |               allocated in cc->arena, so memory growth will occur on each
  828|       |               refresh */
  829|      0|            CERT_LockCertTrust(cc);
  830|      0|            cc->trust = trust;
  831|      0|            CERT_UnlockCertTrust(cc);
  832|      0|        }
  833|       |        /* Read the distrust fields from a nssckbi/builtins certificate and
  834|       |         * fill the fields in CERTCertificate structure when any valid date
  835|       |         * is found. */
  836|      0|        if (PK11_IsReadOnly(cc->slot) && PK11_HasRootCerts(cc->slot)) {
  ------------------
  |  Branch (836:13): [True: 0, False: 0]
  |  Branch (836:42): [True: 0, False: 0]
  ------------------
  837|       |            /* The values are hard-coded and readonly. Read just once. */
  838|      0|            if (cc->distrust == NULL) {
  ------------------
  |  Branch (838:17): [True: 0, False: 0]
  ------------------
  839|      0|                CERTCertDistrust distrustModel;
  840|      0|                SECItem model = { siUTCTime, NULL, 0 };
  841|      0|                distrustModel.serverDistrustAfter = model;
  842|      0|                distrustModel.emailDistrustAfter = model;
  843|      0|                SECStatus rServer = PK11_ReadAttribute(
  844|      0|                    cc->slot, cc->pkcs11ID, CKA_NSS_SERVER_DISTRUST_AFTER,
  ------------------
  |  |  105|      0|#define CKA_NSS_SERVER_DISTRUST_AFTER (CKA_NSS + 35)
  |  |  ------------------
  |  |  |  |   77|      0|#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  692|      0|#define CKA_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  845|      0|                    cc->arena, &distrustModel.serverDistrustAfter);
  846|      0|                SECStatus rEmail = PK11_ReadAttribute(
  847|      0|                    cc->slot, cc->pkcs11ID, CKA_NSS_EMAIL_DISTRUST_AFTER,
  ------------------
  |  |  106|      0|#define CKA_NSS_EMAIL_DISTRUST_AFTER (CKA_NSS + 36)
  |  |  ------------------
  |  |  |  |   77|      0|#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  692|      0|#define CKA_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  848|      0|                    cc->arena, &distrustModel.emailDistrustAfter);
  849|       |                /* Only allocate the Distrust structure if a valid date is found.
  850|       |                 * The result length of a encoded valid timestamp is exactly 13 */
  851|      0|                const unsigned int kDistrustFieldSize = 13;
  852|      0|                if ((rServer == SECSuccess && rEmail == SECSuccess) &&
  ------------------
  |  Branch (852:22): [True: 0, False: 0]
  |  Branch (852:47): [True: 0, False: 0]
  ------------------
  853|      0|                    (distrustModel.serverDistrustAfter.len == kDistrustFieldSize ||
  ------------------
  |  Branch (853:22): [True: 0, False: 0]
  ------------------
  854|      0|                     distrustModel.emailDistrustAfter.len == kDistrustFieldSize)) {
  ------------------
  |  Branch (854:22): [True: 0, False: 0]
  ------------------
  855|      0|                    CERTCertDistrust *tmpPtr = PORT_ArenaAlloc(
  ------------------
  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  856|      0|                        cc->arena, sizeof(CERTCertDistrust));
  857|      0|                    PORT_Memcpy(tmpPtr, &distrustModel,
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  858|      0|                                sizeof(CERTCertDistrust));
  859|      0|                    cc->distrust = tmpPtr;
  860|      0|                }
  861|      0|            }
  862|      0|        }
  863|      0|    }
  864|  5.21k|    if (instance) {
  ------------------
  |  Branch (864:9): [True: 0, False: 5.21k]
  ------------------
  865|      0|        nssCryptokiObject_Destroy(instance);
  866|      0|    }
  867|       |    /* database handle is now the trust domain */
  868|  5.21k|    cc->dbhandle = c->object.trustDomain;
  869|       |    /* subjectList ? */
  870|       |    /* istemp and isperm are supported in NSS 3.4 */
  871|  5.21k|    CERT_LockCertTempPerm(cc);
  872|  5.21k|    cc->istemp = PR_FALSE; /* CERT_NewTemp will override this */
  ------------------
  |  |  438|  5.21k|#define PR_FALSE 0
  ------------------
  873|  5.21k|    cc->isperm = PR_TRUE;  /* by default */
  ------------------
  |  |  437|  5.21k|#define PR_TRUE 1
  ------------------
  874|       |    /* pointer back */
  875|  5.21k|    cc->nssCertificate = c;
  876|  5.21k|    CERT_UnlockCertTempPerm(cc);
  877|  5.21k|    if (trust) {
  ------------------
  |  Branch (877:9): [True: 0, False: 5.21k]
  ------------------
  878|       |        /* force the cert type to be recomputed to include trust info */
  879|      0|        PRUint32 nsCertType = cert_ComputeCertType(cc);
  880|       |
  881|       |        /* Assert that it is safe to cast &cc->nsCertType to "PRInt32 *" */
  882|      0|        PORT_Assert(sizeof(cc->nsCertType) == sizeof(PRInt32));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  883|      0|        PR_ATOMIC_SET((PRInt32 *)&cc->nsCertType, nsCertType);
  ------------------
  |  |  124|      0|#define PR_ATOMIC_SET(val, newval) __sync_lock_test_and_set(val, newval)
  ------------------
  884|      0|    }
  885|  5.21k|}

nssPKIObject_Lock:
   19|  15.8k|{
   20|  15.8k|    switch (object->lockType) {
   21|  15.8k|        case nssPKIMonitor:
  ------------------
  |  Branch (21:9): [True: 15.8k, False: 0]
  ------------------
   22|  15.8k|            PZ_EnterMonitor(object->sync.mlock);
  ------------------
  |  |  256|  15.8k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  ------------------
   23|  15.8k|            break;
   24|      0|        case nssPKILock:
  ------------------
  |  Branch (24:9): [True: 0, False: 15.8k]
  ------------------
   25|      0|            PZ_Lock(object->sync.lock);
  ------------------
  |  |  245|      0|#define PZ_Lock(k) PR_Lock((k))
  ------------------
   26|      0|            break;
   27|      0|        default:
  ------------------
  |  Branch (27:9): [True: 0, False: 15.8k]
  ------------------
   28|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   29|  15.8k|    }
   30|  15.8k|}
nssPKIObject_Unlock:
   34|  15.8k|{
   35|  15.8k|    switch (object->lockType) {
   36|  15.8k|        case nssPKIMonitor:
  ------------------
  |  Branch (36:9): [True: 15.8k, False: 0]
  ------------------
   37|  15.8k|            PZ_ExitMonitor(object->sync.mlock);
  ------------------
  |  |  257|  15.8k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  ------------------
   38|  15.8k|            break;
   39|      0|        case nssPKILock:
  ------------------
  |  Branch (39:9): [True: 0, False: 15.8k]
  ------------------
   40|      0|            PZ_Unlock(object->sync.lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
   41|      0|            break;
   42|      0|        default:
  ------------------
  |  Branch (42:9): [True: 0, False: 15.8k]
  ------------------
   43|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   44|  15.8k|    }
   45|  15.8k|}
nssPKIObject_NewLock:
   49|  5.40k|{
   50|  5.40k|    object->lockType = lockType;
   51|  5.40k|    switch (lockType) {
   52|  5.40k|        case nssPKIMonitor:
  ------------------
  |  Branch (52:9): [True: 5.40k, False: 0]
  ------------------
   53|  5.40k|            object->sync.mlock = PZ_NewMonitor(nssILockSSL);
  ------------------
  |  |  254|  5.40k|#define PZ_NewMonitor(t) PR_NewMonitor()
  ------------------
   54|  5.40k|            return (object->sync.mlock ? PR_SUCCESS : PR_FAILURE);
  ------------------
  |  Branch (54:21): [True: 5.40k, False: 0]
  ------------------
   55|      0|        case nssPKILock:
  ------------------
  |  Branch (55:9): [True: 0, False: 5.40k]
  ------------------
   56|      0|            object->sync.lock = PZ_NewLock(nssILockSSL);
  ------------------
  |  |  243|      0|#define PZ_NewLock(t) PR_NewLock()
  ------------------
   57|      0|            return (object->sync.lock ? PR_SUCCESS : PR_FAILURE);
  ------------------
  |  Branch (57:21): [True: 0, False: 0]
  ------------------
   58|      0|        default:
  ------------------
  |  Branch (58:9): [True: 0, False: 5.40k]
  ------------------
   59|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   60|      0|            return PR_FAILURE;
   61|  5.40k|    }
   62|  5.40k|}
nssPKIObject_DestroyLock:
   66|  5.40k|{
   67|  5.40k|    switch (object->lockType) {
   68|  5.40k|        case nssPKIMonitor:
  ------------------
  |  Branch (68:9): [True: 5.40k, False: 0]
  ------------------
   69|  5.40k|            PZ_DestroyMonitor(object->sync.mlock);
  ------------------
  |  |  255|  5.40k|#define PZ_DestroyMonitor(m) PR_DestroyMonitor((m))
  ------------------
   70|  5.40k|            object->sync.mlock = NULL;
   71|  5.40k|            break;
   72|      0|        case nssPKILock:
  ------------------
  |  Branch (72:9): [True: 0, False: 5.40k]
  ------------------
   73|      0|            PZ_DestroyLock(object->sync.lock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
   74|      0|            object->sync.lock = NULL;
   75|      0|            break;
   76|      0|        default:
  ------------------
  |  Branch (76:9): [True: 0, False: 5.40k]
  ------------------
   77|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   78|  5.40k|    }
   79|  5.40k|}
nssPKIObject_Create:
   88|  5.40k|{
   89|  5.40k|    NSSArena *arena;
   90|  5.40k|    nssArenaMark *mark = NULL;
   91|  5.40k|    nssPKIObject *object;
   92|  5.40k|    if (arenaOpt) {
  ------------------
  |  Branch (92:9): [True: 0, False: 5.40k]
  ------------------
   93|      0|        arena = arenaOpt;
   94|      0|        mark = nssArena_Mark(arena);
   95|  5.40k|    } else {
   96|  5.40k|        arena = nssArena_Create();
   97|  5.40k|        if (!arena) {
  ------------------
  |  Branch (97:13): [True: 0, False: 5.40k]
  ------------------
   98|      0|            return (nssPKIObject *)NULL;
   99|      0|        }
  100|  5.40k|    }
  101|  5.40k|    object = nss_ZNEW(arena, nssPKIObject);
  ------------------
  |  |  348|  5.40k|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  102|  5.40k|    if (!object) {
  ------------------
  |  Branch (102:9): [True: 0, False: 5.40k]
  ------------------
  103|      0|        goto loser;
  104|      0|    }
  105|  5.40k|    object->arena = arena;
  106|  5.40k|    object->trustDomain = td; /* XXX */
  107|  5.40k|    object->cryptoContext = cc;
  108|  5.40k|    if (PR_SUCCESS != nssPKIObject_NewLock(object, lockType)) {
  ------------------
  |  Branch (108:9): [True: 0, False: 5.40k]
  ------------------
  109|      0|        goto loser;
  110|      0|    }
  111|  5.40k|    if (instanceOpt) {
  ------------------
  |  Branch (111:9): [True: 0, False: 5.40k]
  ------------------
  112|      0|        if (nssPKIObject_AddInstance(object, instanceOpt) != PR_SUCCESS) {
  ------------------
  |  Branch (112:13): [True: 0, False: 0]
  ------------------
  113|      0|            goto loser;
  114|      0|        }
  115|      0|    }
  116|  5.40k|    PR_ATOMIC_INCREMENT(&object->refCount);
  ------------------
  |  |  122|  5.40k|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  117|  5.40k|    if (mark) {
  ------------------
  |  Branch (117:9): [True: 0, False: 5.40k]
  ------------------
  118|      0|        nssArena_Unmark(arena, mark);
  119|      0|    }
  120|  5.40k|    return object;
  121|      0|loser:
  122|      0|    if (mark) {
  ------------------
  |  Branch (122:9): [True: 0, False: 0]
  ------------------
  123|      0|        nssArena_Release(arena, mark);
  124|      0|    } else {
  125|      0|        nssArena_Destroy(arena);
  126|      0|    }
  127|      0|    return (nssPKIObject *)NULL;
  128|  5.40k|}
nssPKIObject_Destroy:
  133|  10.8k|{
  134|  10.8k|    PRUint32 i;
  135|  10.8k|    PR_ASSERT(object->refCount > 0);
  ------------------
  |  |  208|  10.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 10.8k, False: 0]
  |  |  ------------------
  ------------------
  136|  10.8k|    if (PR_ATOMIC_DECREMENT(&object->refCount) == 0) {
  ------------------
  |  |  123|  10.8k|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (136:9): [True: 193, False: 10.6k]
  ------------------
  137|    193|        for (i = 0; i < object->numInstances; i++) {
  ------------------
  |  Branch (137:21): [True: 0, False: 193]
  ------------------
  138|      0|            nssCryptokiObject_Destroy(object->instances[i]);
  139|      0|        }
  140|    193|        nssPKIObject_DestroyLock(object);
  141|    193|        nssArena_Destroy(object->arena);
  142|    193|        return PR_TRUE;
  ------------------
  |  |  437|    193|#define PR_TRUE 1
  ------------------
  143|    193|    }
  144|  10.6k|    return PR_FALSE;
  ------------------
  |  |  438|  10.6k|#define PR_FALSE 0
  ------------------
  145|  10.8k|}
nssPKIObject_AddRef:
  150|  20.4k|{
  151|  20.4k|    PR_ATOMIC_INCREMENT(&object->refCount);
  ------------------
  |  |  122|  20.4k|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  152|  20.4k|    return object;
  153|  20.4k|}
nssPKIObject_GetInstances:
  333|  5.21k|{
  334|  5.21k|    nssCryptokiObject **instances = NULL;
  335|  5.21k|    PRUint32 i;
  336|       |
  337|  5.21k|    nssPKIObject_Lock(object);
  338|  5.21k|    if (object->numInstances == 0) {
  ------------------
  |  Branch (338:9): [True: 5.21k, False: 0]
  ------------------
  339|  5.21k|        nssPKIObject_Unlock(object);
  340|  5.21k|        return (nssCryptokiObject **)NULL;
  341|  5.21k|    }
  342|      0|    instances = nss_ZNEWARRAY(NULL, nssCryptokiObject *,
  ------------------
  |  |  371|      0|    ((type *)nss_ZAlloc((arenaOpt), sizeof(type) * (quantity)))
  ------------------
  343|      0|                              object->numInstances + 1);
  344|      0|    if (instances) {
  ------------------
  |  Branch (344:9): [True: 0, False: 0]
  ------------------
  345|      0|        for (i = 0; i < object->numInstances; i++) {
  ------------------
  |  Branch (345:21): [True: 0, False: 0]
  ------------------
  346|      0|            instances[i] = nssCryptokiObject_Clone(object->instances[i]);
  347|      0|        }
  348|      0|    }
  349|      0|    nssPKIObject_Unlock(object);
  350|      0|    return instances;
  351|  5.21k|}

nssCertificateStore_Create:
   64|      1|{
   65|      1|    NSSArena *arena;
   66|      1|    nssCertificateStore *store;
   67|      1|    PRBool i_alloced_arena;
   68|      1|    if (arenaOpt) {
  ------------------
  |  Branch (68:9): [True: 1, False: 0]
  ------------------
   69|      1|        arena = arenaOpt;
   70|      1|        i_alloced_arena = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
   71|      1|    } else {
   72|      0|        arena = nssArena_Create();
   73|      0|        if (!arena) {
  ------------------
  |  Branch (73:13): [True: 0, False: 0]
  ------------------
   74|      0|            return NULL;
   75|      0|        }
   76|      0|        i_alloced_arena = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
   77|      0|    }
   78|      1|    store = nss_ZNEW(arena, nssCertificateStore);
  ------------------
  |  |  348|      1|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
   79|      1|    if (!store) {
  ------------------
  |  Branch (79:9): [True: 0, False: 1]
  ------------------
   80|      0|        goto loser;
   81|      0|    }
   82|      1|    store->lock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
   83|      1|    if (!store->lock) {
  ------------------
  |  Branch (83:9): [True: 0, False: 1]
  ------------------
   84|      0|        goto loser;
   85|      0|    }
   86|       |    /* Create the issuer/serial --> {cert, trust, S/MIME profile } hash */
   87|      1|    store->issuer_and_serial = nssHash_CreateCertificate(arena, 0);
   88|      1|    if (!store->issuer_and_serial) {
  ------------------
  |  Branch (88:9): [True: 0, False: 1]
  ------------------
   89|      0|        goto loser;
   90|      0|    }
   91|       |    /* Create the subject DER --> subject list hash */
   92|      1|    store->subject = nssHash_CreateItem(arena, 0);
   93|      1|    if (!store->subject) {
  ------------------
  |  Branch (93:9): [True: 0, False: 1]
  ------------------
   94|      0|        goto loser;
   95|      0|    }
   96|      1|    store->arena = arena;
   97|      1|    store->i_alloced_arena = i_alloced_arena;
   98|      1|    return store;
   99|      0|loser:
  100|      0|    if (store) {
  ------------------
  |  Branch (100:9): [True: 0, False: 0]
  ------------------
  101|      0|        if (store->lock) {
  ------------------
  |  Branch (101:13): [True: 0, False: 0]
  ------------------
  102|      0|            PZ_DestroyLock(store->lock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  103|      0|        }
  104|      0|        if (store->issuer_and_serial) {
  ------------------
  |  Branch (104:13): [True: 0, False: 0]
  ------------------
  105|      0|            nssHash_Destroy(store->issuer_and_serial);
  106|      0|        }
  107|      0|        if (store->subject) {
  ------------------
  |  Branch (107:13): [True: 0, False: 0]
  ------------------
  108|      0|            nssHash_Destroy(store->subject);
  109|      0|        }
  110|      0|    }
  111|      0|    if (i_alloced_arena) {
  ------------------
  |  Branch (111:9): [True: 0, False: 0]
  ------------------
  112|      0|        nssArena_Destroy(arena);
  113|      0|    }
  114|      0|    return NULL;
  115|      1|}
nssCertificateStore_Destroy:
  121|      1|{
  122|      1|    if (nssHash_Count(store->issuer_and_serial) > 0) {
  ------------------
  |  Branch (122:9): [True: 0, False: 1]
  ------------------
  123|      0|        nss_SetError(NSS_ERROR_BUSY);
  124|      0|        return PR_FAILURE;
  125|      0|    }
  126|      1|    PZ_DestroyLock(store->lock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  127|      1|    nssHash_Destroy(store->issuer_and_serial);
  128|      1|    nssHash_Destroy(store->subject);
  129|      1|    if (store->i_alloced_arena) {
  ------------------
  |  Branch (129:9): [True: 0, False: 1]
  ------------------
  130|      0|        nssArena_Destroy(store->arena);
  131|      1|    } else {
  132|      1|        nss_ZFreeIf(store);
  133|      1|    }
  134|      1|    return PR_SUCCESS;
  135|      1|}
nssCertificateStore_FindOrAdd:
  211|  5.21k|{
  212|  5.21k|    PRStatus nssrv;
  213|  5.21k|    NSSCertificate *rvCert = NULL;
  214|       |
  215|  5.21k|    PZ_Lock(store->lock);
  ------------------
  |  |  245|  5.21k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  216|  5.21k|    rvCert = nssCertStore_FindCertByIssuerAndSerialNumberLocked(
  217|  5.21k|        store, &c->issuer, &c->serial);
  218|  5.21k|    if (!rvCert) {
  ------------------
  |  Branch (218:9): [True: 5.21k, False: 0]
  ------------------
  219|  5.21k|        nssrv = nssCertificateStore_AddLocked(store, c);
  220|  5.21k|        if (PR_SUCCESS == nssrv) {
  ------------------
  |  Branch (220:13): [True: 5.21k, False: 0]
  ------------------
  221|  5.21k|            rvCert = nssCertificate_AddRef(c);
  222|  5.21k|        }
  223|  5.21k|    }
  224|  5.21k|    PZ_Unlock(store->lock);
  ------------------
  |  |  246|  5.21k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  225|  5.21k|    return rvCert;
  226|  5.21k|}
nssCertificateStore_RemoveCertLOCKED:
  278|  5.21k|{
  279|  5.21k|    certificate_hash_entry *entry;
  280|  5.21k|    entry = (certificate_hash_entry *)
  281|  5.21k|        nssHash_Lookup(store->issuer_and_serial, cert);
  282|  5.21k|    if (entry && entry->cert == cert) {
  ------------------
  |  Branch (282:9): [True: 5.21k, False: 0]
  |  Branch (282:18): [True: 5.21k, False: 0]
  ------------------
  283|  5.21k|        remove_certificate_entry(store, cert);
  284|  5.21k|        remove_subject_entry(store, cert);
  285|  5.21k|    }
  286|  5.21k|}
nssCertificateStore_Lock:
  290|  15.0k|{
  291|  15.0k|#ifdef DEBUG
  292|  15.0k|    PORT_Assert(out);
  ------------------
  |  |  120|  15.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 15.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  293|  15.0k|    out->store = store;
  294|  15.0k|    out->lock = store->lock;
  295|  15.0k|    out->locked = PR_TRUE;
  ------------------
  |  |  437|  15.0k|#define PR_TRUE 1
  ------------------
  296|  15.0k|    PZ_Lock(out->lock);
  ------------------
  |  |  245|  15.0k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  297|       |#else
  298|       |    PZ_Lock(store->lock);
  299|       |#endif
  300|  15.0k|}
nssCertificateStore_Unlock:
  306|  15.0k|{
  307|  15.0k|#ifdef DEBUG
  308|  15.0k|    PORT_Assert(in);
  ------------------
  |  |  120|  15.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 15.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  309|  15.0k|    PORT_Assert(out);
  ------------------
  |  |  120|  15.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 15.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  310|  15.0k|    out->store = store;
  311|  15.0k|    out->lock = store->lock;
  312|  15.0k|    PORT_Assert(!out->locked);
  ------------------
  |  |  120|  15.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 15.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|  15.0k|    out->unlocked = PR_TRUE;
  ------------------
  |  |  437|  15.0k|#define PR_TRUE 1
  ------------------
  314|       |
  315|  15.0k|    PORT_Assert(in->store == out->store);
  ------------------
  |  |  120|  15.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 15.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  15.0k|    PORT_Assert(in->lock == out->lock);
  ------------------
  |  |  120|  15.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 15.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|  15.0k|    PORT_Assert(in->locked);
  ------------------
  |  |  120|  15.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 15.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  15.0k|    PORT_Assert(!in->unlocked);
  ------------------
  |  |  120|  15.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 15.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|       |
  320|  15.0k|    PZ_Unlock(out->lock);
  ------------------
  |  |  246|  15.0k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  321|       |#else
  322|       |    PZ_Unlock(store->lock);
  323|       |#endif
  324|  15.0k|}
nssCertificateStore_FindCertificateByIssuerAndSerialNumber:
  520|  5.24k|{
  521|  5.24k|    NSSCertificate *rvCert = NULL;
  522|       |
  523|  5.24k|    PZ_Lock(store->lock);
  ------------------
  |  |  245|  5.24k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  524|  5.24k|    rvCert = nssCertStore_FindCertByIssuerAndSerialNumberLocked(
  525|  5.24k|        store, issuer, serial);
  526|  5.24k|    PZ_Unlock(store->lock);
  ------------------
  |  |  246|  5.24k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  527|  5.24k|    return rvCert;
  528|  5.24k|}
nssCertificateStore_FindCertificateByEncodedCertificate:
  534|  5.40k|{
  535|  5.40k|    PRStatus nssrv = PR_FAILURE;
  536|  5.40k|    NSSDER issuer, serial;
  537|  5.40k|    NSSCertificate *rvCert = NULL;
  538|  5.40k|    nssrv = nssPKIX509_GetIssuerAndSerialFromDER(encoding, &issuer, &serial);
  539|  5.40k|    if (nssrv != PR_SUCCESS) {
  ------------------
  |  Branch (539:9): [True: 163, False: 5.24k]
  ------------------
  540|    163|        return NULL;
  541|    163|    }
  542|  5.24k|    rvCert = nssCertificateStore_FindCertificateByIssuerAndSerialNumber(store,
  543|  5.24k|                                                                        &issuer,
  544|  5.24k|                                                                        &serial);
  545|  5.24k|    PORT_Free(issuer.data);
  ------------------
  |  |   60|  5.24k|#define PORT_Free PORT_Free_Util
  ------------------
  546|  5.24k|    PORT_Free(serial.data);
  ------------------
  |  |   60|  5.24k|#define PORT_Free PORT_Free_Util
  ------------------
  547|  5.24k|    return rvCert;
  548|  5.40k|}
nssCertificateStore_FindTrustForCertificate:
  576|  5.21k|{
  577|  5.21k|    certificate_hash_entry *entry;
  578|  5.21k|    NSSTrust *rvTrust = NULL;
  579|  5.21k|    PZ_Lock(store->lock);
  ------------------
  |  |  245|  5.21k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  580|  5.21k|    entry = (certificate_hash_entry *)
  581|  5.21k|        nssHash_Lookup(store->issuer_and_serial, cert);
  582|  5.21k|    if (entry && entry->trust) {
  ------------------
  |  Branch (582:9): [True: 0, False: 5.21k]
  |  Branch (582:18): [True: 0, False: 0]
  ------------------
  583|      0|        rvTrust = nssTrust_AddRef(entry->trust);
  584|      0|    }
  585|  5.21k|    PZ_Unlock(store->lock);
  ------------------
  |  |  246|  5.21k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  586|  5.21k|    return rvTrust;
  587|  5.21k|}
nssHash_CreateCertificate:
  658|      2|{
  659|      2|    return nssHash_Create(arenaOpt,
  660|      2|                          numBuckets,
  661|      2|                          nss_certificate_hash,
  662|      2|                          nss_compare_certs,
  663|      2|                          PL_CompareValues);
  664|      2|}
pkistore.c:nssCertificateStore_AddLocked:
  196|  5.21k|{
  197|  5.21k|    PRStatus nssrv = add_certificate_entry(store, cert);
  198|  5.21k|    if (nssrv == PR_SUCCESS) {
  ------------------
  |  Branch (198:9): [True: 5.21k, False: 0]
  ------------------
  199|  5.21k|        nssrv = add_subject_entry(store, cert);
  200|  5.21k|        if (nssrv == PR_FAILURE) {
  ------------------
  |  Branch (200:13): [True: 0, False: 5.21k]
  ------------------
  201|      0|            remove_certificate_entry(store, cert);
  202|      0|        }
  203|  5.21k|    }
  204|  5.21k|    return nssrv;
  205|  5.21k|}
pkistore.c:add_certificate_entry:
  141|  5.21k|{
  142|  5.21k|    PRStatus nssrv;
  143|  5.21k|    certificate_hash_entry *entry;
  144|  5.21k|    entry = nss_ZNEW(cert->object.arena, certificate_hash_entry);
  ------------------
  |  |  348|  5.21k|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  145|  5.21k|    if (!entry) {
  ------------------
  |  Branch (145:9): [True: 0, False: 5.21k]
  ------------------
  146|      0|        return PR_FAILURE;
  147|      0|    }
  148|  5.21k|    entry->cert = cert;
  149|  5.21k|    nssrv = nssHash_Add(store->issuer_and_serial, cert, entry);
  150|  5.21k|    if (nssrv != PR_SUCCESS) {
  ------------------
  |  Branch (150:9): [True: 0, False: 5.21k]
  ------------------
  151|      0|        nss_ZFreeIf(entry);
  152|      0|    }
  153|  5.21k|    return nssrv;
  154|  5.21k|}
pkistore.c:add_subject_entry:
  160|  5.21k|{
  161|  5.21k|    PRStatus nssrv;
  162|  5.21k|    nssList *subjectList;
  163|  5.21k|    subjectList = (nssList *)nssHash_Lookup(store->subject, &cert->subject);
  164|  5.21k|    if (subjectList) {
  ------------------
  |  Branch (164:9): [True: 0, False: 5.21k]
  ------------------
  165|       |        /* The subject is already in, add this cert to the list */
  166|      0|        nssrv = nssList_AddUnique(subjectList, cert);
  167|  5.21k|    } else {
  168|       |        /* Create a new subject list for the subject */
  169|  5.21k|        subjectList = nssList_Create(NULL, PR_FALSE);
  ------------------
  |  |  438|  5.21k|#define PR_FALSE 0
  ------------------
  170|  5.21k|        if (!subjectList) {
  ------------------
  |  Branch (170:13): [True: 0, False: 5.21k]
  ------------------
  171|      0|            return PR_FAILURE;
  172|      0|        }
  173|  5.21k|        nssList_SetSortFunction(subjectList, nssCertificate_SubjectListSort);
  174|       |        /* Add the cert entry to this list of subjects */
  175|  5.21k|        nssrv = nssList_Add(subjectList, cert);
  176|  5.21k|        if (nssrv != PR_SUCCESS) {
  ------------------
  |  Branch (176:13): [True: 0, False: 5.21k]
  ------------------
  177|      0|            return nssrv;
  178|      0|        }
  179|       |        /* Add the subject list to the cache */
  180|  5.21k|        nssrv = nssHash_Add(store->subject, &cert->subject, subjectList);
  181|  5.21k|    }
  182|  5.21k|    return nssrv;
  183|  5.21k|}
pkistore.c:remove_certificate_entry:
  232|  5.21k|{
  233|  5.21k|    certificate_hash_entry *entry;
  234|  5.21k|    entry = (certificate_hash_entry *)
  235|  5.21k|        nssHash_Lookup(store->issuer_and_serial, cert);
  236|  5.21k|    if (entry) {
  ------------------
  |  Branch (236:9): [True: 5.21k, False: 0]
  ------------------
  237|  5.21k|        nssHash_Remove(store->issuer_and_serial, cert);
  238|  5.21k|        if (entry->trust) {
  ------------------
  |  Branch (238:13): [True: 0, False: 5.21k]
  ------------------
  239|      0|            nssTrust_Destroy(entry->trust);
  240|      0|        }
  241|  5.21k|        if (entry->profile) {
  ------------------
  |  Branch (241:13): [True: 0, False: 5.21k]
  ------------------
  242|      0|            nssSMIMEProfile_Destroy(entry->profile);
  243|      0|        }
  244|  5.21k|        nss_ZFreeIf(entry);
  245|  5.21k|    }
  246|  5.21k|}
pkistore.c:remove_subject_entry:
  252|  5.21k|{
  253|  5.21k|    nssList *subjectList;
  254|       |    /* Get the subject list for the cert's subject */
  255|  5.21k|    subjectList = (nssList *)nssHash_Lookup(store->subject, &cert->subject);
  256|  5.21k|    if (subjectList) {
  ------------------
  |  Branch (256:9): [True: 5.21k, False: 0]
  ------------------
  257|       |        /* Remove the cert from the subject hash */
  258|  5.21k|        nssList_Remove(subjectList, cert);
  259|  5.21k|        nssHash_Remove(store->subject, &cert->subject);
  260|  5.21k|        if (nssList_Count(subjectList) == 0) {
  ------------------
  |  Branch (260:13): [True: 5.21k, False: 0]
  ------------------
  261|  5.21k|            nssList_Destroy(subjectList);
  262|  5.21k|        } else {
  263|       |            /* The cert being released may have keyed the subject entry.
  264|       |             * Since there are still subject certs around, get another and
  265|       |             * rekey the entry just in case.
  266|       |             */
  267|      0|            NSSCertificate *subjectCert;
  268|      0|            (void)nssList_GetArray(subjectList, (void **)&subjectCert, 1);
  269|      0|            nssHash_Add(store->subject, &subjectCert->subject, subjectList);
  270|      0|        }
  271|  5.21k|    }
  272|  5.21k|}
pkistore.c:nssCertStore_FindCertByIssuerAndSerialNumberLocked:
  500|  10.4k|{
  501|  10.4k|    certificate_hash_entry *entry;
  502|  10.4k|    NSSCertificate *rvCert = NULL;
  503|  10.4k|    NSSCertificate index;
  504|       |
  505|  10.4k|    index.issuer = *issuer;
  506|  10.4k|    index.serial = *serial;
  507|  10.4k|    entry = (certificate_hash_entry *)
  508|  10.4k|        nssHash_Lookup(store->issuer_and_serial, &index);
  509|  10.4k|    if (entry) {
  ------------------
  |  Branch (509:9): [True: 0, False: 10.4k]
  ------------------
  510|      0|        rvCert = nssCertificate_AddRef(entry->cert);
  511|      0|    }
  512|  10.4k|    return rvCert;
  513|  10.4k|}
pkistore.c:nss_certificate_hash:
  632|  41.7k|{
  633|  41.7k|    unsigned int i;
  634|  41.7k|    PLHashNumber h;
  635|  41.7k|    NSSCertificate *c = (NSSCertificate *)key;
  636|  41.7k|    h = 0;
  637|   716k|    for (i = 0; i < c->issuer.size; i++)
  ------------------
  |  Branch (637:17): [True: 674k, False: 41.7k]
  ------------------
  638|   674k|        h = PR_ROTATE_LEFT32(h, 4) ^ ((unsigned char *)c->issuer.data)[i];
  ------------------
  |  |  147|   674k|#define PR_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits))))
  ------------------
  639|   154k|    for (i = 0; i < c->serial.size; i++)
  ------------------
  |  Branch (639:17): [True: 113k, False: 41.7k]
  ------------------
  640|   113k|        h = PR_ROTATE_LEFT32(h, 4) ^ ((unsigned char *)c->serial.data)[i];
  ------------------
  |  |  147|   113k|#define PR_ROTATE_LEFT32(a, bits) (((a) << (bits)) | ((a) >> (32 - (bits))))
  ------------------
  641|  41.7k|    return h;
  642|  41.7k|}
pkistore.c:nss_compare_certs:
  646|  15.6k|{
  647|  15.6k|    PRStatus ignore;
  648|  15.6k|    NSSCertificate *c1 = (NSSCertificate *)v1;
  649|  15.6k|    NSSCertificate *c2 = (NSSCertificate *)v2;
  650|  15.6k|    return (int)(nssItem_Equal(&c1->issuer, &c2->issuer, &ignore) &&
  ------------------
  |  Branch (650:18): [True: 15.6k, False: 0]
  ------------------
  651|  15.6k|                 nssItem_Equal(&c1->serial, &c2->serial, &ignore));
  ------------------
  |  Branch (651:18): [True: 15.6k, False: 0]
  ------------------
  652|  15.6k|}

nssTrustDomain_InitializeCache:
  121|      1|{
  122|      1|    NSSArena *arena;
  123|      1|    nssTDCertificateCache *cache = td->cache;
  124|       |#ifdef DEBUG_CACHE
  125|       |    s_log = PR_NewLogModule("nss_cache");
  126|       |    PR_ASSERT(s_log);
  127|       |#endif
  128|      1|    PR_ASSERT(!cache);
  ------------------
  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  129|      1|    arena = nssArena_Create();
  130|      1|    if (!arena) {
  ------------------
  |  Branch (130:9): [True: 0, False: 1]
  ------------------
  131|      0|        return PR_FAILURE;
  132|      0|    }
  133|      1|    cache = nss_ZNEW(arena, nssTDCertificateCache);
  ------------------
  |  |  348|      1|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
  134|      1|    if (!cache) {
  ------------------
  |  Branch (134:9): [True: 0, False: 1]
  ------------------
  135|      0|        nssArena_Destroy(arena);
  136|      0|        return PR_FAILURE;
  137|      0|    }
  138|      1|    cache->lock = PZ_NewLock(nssILockCache);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  139|      1|    if (!cache->lock) {
  ------------------
  |  Branch (139:9): [True: 0, False: 1]
  ------------------
  140|      0|        nssArena_Destroy(arena);
  141|      0|        return PR_FAILURE;
  142|      0|    }
  143|       |    /* Create the issuer and serial DER --> certificate hash */
  144|      1|    cache->issuerAndSN = nssHash_CreateCertificate(arena, cacheSize);
  145|      1|    if (!cache->issuerAndSN) {
  ------------------
  |  Branch (145:9): [True: 0, False: 1]
  ------------------
  146|      0|        goto loser;
  147|      0|    }
  148|       |    /* Create the subject DER --> subject list hash */
  149|      1|    cache->subject = nssHash_CreateItem(arena, cacheSize);
  150|      1|    if (!cache->subject) {
  ------------------
  |  Branch (150:9): [True: 0, False: 1]
  ------------------
  151|      0|        goto loser;
  152|      0|    }
  153|       |    /* Create the nickname --> subject list hash */
  154|      1|    cache->nickname = nssHash_CreateString(arena, cacheSize);
  155|      1|    if (!cache->nickname) {
  ------------------
  |  Branch (155:9): [True: 0, False: 1]
  ------------------
  156|      0|        goto loser;
  157|      0|    }
  158|       |    /* Create the email --> list of subject lists hash */
  159|      1|    cache->email = nssHash_CreateString(arena, cacheSize);
  160|      1|    if (!cache->email) {
  ------------------
  |  Branch (160:9): [True: 0, False: 1]
  ------------------
  161|      0|        goto loser;
  162|      0|    }
  163|      1|    cache->arena = arena;
  164|      1|    td->cache = cache;
  165|       |#ifdef DEBUG_CACHE
  166|       |    PR_LOG(s_log, PR_LOG_DEBUG, ("Cache initialized."));
  167|       |#endif
  168|      1|    return PR_SUCCESS;
  169|      0|loser:
  170|      0|    PZ_DestroyLock(cache->lock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  171|      0|    nssArena_Destroy(arena);
  172|      0|    td->cache = NULL;
  173|       |#ifdef DEBUG_CACHE
  174|       |    PR_LOG(s_log, PR_LOG_DEBUG, ("Cache initialization failed."));
  175|       |#endif
  176|      0|    return PR_FAILURE;
  177|      1|}
nssTrustDomain_DestroyCache:
  191|      1|{
  192|      1|    if (!td->cache) {
  ------------------
  |  Branch (192:9): [True: 0, False: 1]
  ------------------
  193|      0|        nss_SetError(NSS_ERROR_INTERNAL_ERROR);
  194|      0|        return PR_FAILURE;
  195|      0|    }
  196|      1|    if (nssHash_Count(td->cache->issuerAndSN) > 0) {
  ------------------
  |  Branch (196:9): [True: 0, False: 1]
  ------------------
  197|      0|        nss_SetError(NSS_ERROR_BUSY);
  198|      0|        return PR_FAILURE;
  199|      0|    }
  200|      1|    PZ_DestroyLock(td->cache->lock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  201|      1|    nssHash_Destroy(td->cache->issuerAndSN);
  202|      1|    nssHash_Destroy(td->cache->subject);
  203|      1|    nssHash_Destroy(td->cache->nickname);
  204|      1|    nssHash_Destroy(td->cache->email);
  205|      1|    nssArena_Destroy(td->cache->arena);
  206|      1|    td->cache = NULL;
  207|       |#ifdef DEBUG_CACHE
  208|       |    PR_LOG(s_log, PR_LOG_DEBUG, ("Cache destroyed."));
  209|       |#endif
  210|      1|    return PR_SUCCESS;
  211|      1|}
nssTrustDomain_GetCertForIssuerAndSNFromCache:
 1017|  5.24k|{
 1018|  5.24k|    NSSCertificate certkey;
 1019|  5.24k|    NSSCertificate *rvCert = NULL;
 1020|  5.24k|    cache_entry *ce;
 1021|  5.24k|    certkey.issuer.data = issuer->data;
 1022|  5.24k|    certkey.issuer.size = issuer->size;
 1023|  5.24k|    certkey.serial.data = serial->data;
 1024|  5.24k|    certkey.serial.size = serial->size;
 1025|       |#ifdef DEBUG_CACHE
 1026|       |    log_item_dump("looking for cert by issuer/sn, issuer", issuer);
 1027|       |    log_item_dump("                               serial", serial);
 1028|       |#endif
 1029|  5.24k|    PZ_Lock(td->cache->lock);
  ------------------
  |  |  245|  5.24k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1030|  5.24k|    ce = (cache_entry *)nssHash_Lookup(td->cache->issuerAndSN, &certkey);
 1031|  5.24k|    if (ce) {
  ------------------
  |  Branch (1031:9): [True: 0, False: 5.24k]
  ------------------
 1032|      0|        ce->hits++;
 1033|      0|        ce->lastHit = PR_Now();
 1034|      0|        rvCert = nssCertificate_AddRef(ce->entry.cert);
 1035|       |#ifdef DEBUG_CACHE
 1036|       |        PR_LOG(s_log, PR_LOG_DEBUG, ("... found, %d hits", ce->hits));
 1037|       |#endif
 1038|      0|    }
 1039|  5.24k|    PZ_Unlock(td->cache->lock);
  ------------------
  |  |  246|  5.24k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1040|  5.24k|    return rvCert;
 1041|  5.24k|}

NSSTrustDomain_Create:
   32|      1|{
   33|      1|    NSSArena *arena;
   34|      1|    NSSTrustDomain *rvTD;
   35|      1|    arena = NSSArena_Create();
   36|      1|    if (!arena) {
  ------------------
  |  Branch (36:9): [True: 0, False: 1]
  ------------------
   37|      0|        return (NSSTrustDomain *)NULL;
   38|      0|    }
   39|      1|    rvTD = nss_ZNEW(arena, NSSTrustDomain);
  ------------------
  |  |  348|      1|#define nss_ZNEW(arenaOpt, type) ((type *)nss_ZAlloc((arenaOpt), sizeof(type)))
  ------------------
   40|      1|    if (!rvTD) {
  ------------------
  |  Branch (40:9): [True: 0, False: 1]
  ------------------
   41|      0|        goto loser;
   42|      0|    }
   43|       |    /* protect the token list and the token iterator */
   44|      1|    rvTD->tokensLock = NSSRWLock_New(100, "tokens");
  ------------------
  |  |   49|      1|#define NSSRWLock_New NSSRWLock_New_Util
  ------------------
   45|      1|    if (!rvTD->tokensLock) {
  ------------------
  |  Branch (45:9): [True: 0, False: 1]
  ------------------
   46|      0|        goto loser;
   47|      0|    }
   48|      1|    nssTrustDomain_InitializeCache(rvTD, NSSTRUSTDOMAIN_DEFAULT_CACHE_SIZE);
  ------------------
  |  |   20|      1|#define NSSTRUSTDOMAIN_DEFAULT_CACHE_SIZE 32
  ------------------
   49|      1|    rvTD->arena = arena;
   50|      1|    rvTD->refCount = 1;
   51|      1|    rvTD->statusConfig = NULL;
   52|      1|    return rvTD;
   53|      0|loser:
   54|      0|    if (rvTD && rvTD->tokensLock) {
  ------------------
  |  Branch (54:9): [True: 0, False: 0]
  |  Branch (54:17): [True: 0, False: 0]
  ------------------
   55|      0|        NSSRWLock_Destroy(rvTD->tokensLock);
  ------------------
  |  |   45|      0|#define NSSRWLock_Destroy NSSRWLock_Destroy_Util
  ------------------
   56|      0|    }
   57|      0|    nssArena_Destroy(arena);
   58|      0|    return (NSSTrustDomain *)NULL;
   59|      1|}
NSSTrustDomain_Destroy:
   78|      1|{
   79|      1|    PRStatus status = PR_SUCCESS;
   80|      1|    if (--td->refCount == 0) {
  ------------------
  |  Branch (80:9): [True: 1, False: 0]
  ------------------
   81|       |        /* Destroy each token in the list of tokens */
   82|      1|        if (td->tokens) {
  ------------------
  |  Branch (82:13): [True: 1, False: 0]
  ------------------
   83|      1|            nssListIterator_Destroy(td->tokens);
   84|      1|            td->tokens = NULL;
   85|      1|        }
   86|      1|        if (td->tokenList) {
  ------------------
  |  Branch (86:13): [True: 1, False: 0]
  ------------------
   87|      1|            nssList_Clear(td->tokenList, token_destructor);
   88|      1|            nssList_Destroy(td->tokenList);
   89|      1|            td->tokenList = NULL;
   90|      1|        }
   91|      1|        NSSRWLock_Destroy(td->tokensLock);
  ------------------
  |  |   45|      1|#define NSSRWLock_Destroy NSSRWLock_Destroy_Util
  ------------------
   92|      1|        td->tokensLock = NULL;
   93|      1|        status = nssTrustDomain_DestroyCache(td);
   94|      1|        if (status == PR_FAILURE) {
  ------------------
  |  Branch (94:13): [True: 0, False: 1]
  ------------------
   95|      0|            return status;
   96|      0|        }
   97|      1|        if (td->statusConfig) {
  ------------------
  |  Branch (97:13): [True: 0, False: 1]
  ------------------
   98|      0|            td->statusConfig->statusDestroy(td->statusConfig);
   99|      0|            td->statusConfig = NULL;
  100|      0|        }
  101|       |        /* Destroy the trust domain */
  102|      1|        nssArena_Destroy(td->arena);
  103|      1|    }
  104|      1|    return status;
  105|      1|}
nssTrustDomain_FindCertificateByIssuerAndSerialNumber:
  751|  5.24k|{
  752|  5.24k|    NSSSlot **slots = NULL;
  753|  5.24k|    NSSSlot **slotp;
  754|  5.24k|    NSSCertificate *rvCert = NULL;
  755|  5.24k|    nssPKIObjectCollection *collection = NULL;
  756|  5.24k|    nssUpdateLevel updateLevel;
  757|       |
  758|       |    /* see if this search is already cached */
  759|  5.24k|    rvCert = nssTrustDomain_GetCertForIssuerAndSNFromCache(td,
  760|  5.24k|                                                           issuer,
  761|  5.24k|                                                           serial);
  762|  5.24k|    if (rvCert) {
  ------------------
  |  Branch (762:9): [True: 0, False: 5.24k]
  ------------------
  763|      0|        return rvCert;
  764|      0|    }
  765|  5.24k|    slots = nssTrustDomain_GetActiveSlots(td, &updateLevel);
  766|  5.24k|    if (slots) {
  ------------------
  |  Branch (766:9): [True: 5.24k, False: 0]
  ------------------
  767|  15.7k|        for (slotp = slots; *slotp; slotp++) {
  ------------------
  |  Branch (767:29): [True: 10.4k, False: 5.24k]
  ------------------
  768|  10.4k|            NSSToken *token = nssSlot_GetToken(*slotp);
  769|  10.4k|            nssSession *session;
  770|  10.4k|            nssCryptokiObject *instance;
  771|  10.4k|            nssTokenSearchType tokenOnly = nssTokenSearchType_TokenOnly;
  772|  10.4k|            PRStatus status = PR_FAILURE;
  773|       |
  774|  10.4k|            if (!token)
  ------------------
  |  Branch (774:17): [True: 0, False: 10.4k]
  ------------------
  775|      0|                continue;
  776|  10.4k|            session = nssTrustDomain_GetSessionForToken(td, token);
  777|  10.4k|            if (session) {
  ------------------
  |  Branch (777:17): [True: 10.4k, False: 0]
  ------------------
  778|  10.4k|                instance = nssToken_FindCertificateByIssuerAndSerialNumber(
  779|  10.4k|                    token,
  780|  10.4k|                    session,
  781|  10.4k|                    issuer,
  782|  10.4k|                    serial,
  783|  10.4k|                    tokenOnly,
  784|  10.4k|                    &status);
  785|  10.4k|            }
  786|  10.4k|            (void)nssToken_Destroy(token);
  787|  10.4k|            if (status != PR_SUCCESS) {
  ------------------
  |  Branch (787:17): [True: 0, False: 10.4k]
  ------------------
  788|      0|                continue;
  789|      0|            }
  790|  10.4k|            if (instance) {
  ------------------
  |  Branch (790:17): [True: 0, False: 10.4k]
  ------------------
  791|      0|                if (!collection) {
  ------------------
  |  Branch (791:21): [True: 0, False: 0]
  ------------------
  792|      0|                    collection = nssCertificateCollection_Create(td, NULL);
  793|      0|                    if (!collection) {
  ------------------
  |  Branch (793:25): [True: 0, False: 0]
  ------------------
  794|      0|                        break; /* don't keep looping if out if memory */
  795|      0|                    }
  796|      0|                }
  797|      0|                status = nssPKIObjectCollection_AddInstances(collection,
  798|      0|                                                             &instance, 1);
  799|      0|                if (status == PR_SUCCESS) {
  ------------------
  |  Branch (799:21): [True: 0, False: 0]
  ------------------
  800|      0|                    (void)nssPKIObjectCollection_GetCertificates(
  801|      0|                        collection, &rvCert, 1, NULL);
  802|      0|                }
  803|      0|                if (rvCert) {
  ------------------
  |  Branch (803:21): [True: 0, False: 0]
  ------------------
  804|      0|                    break; /* found one cert, all done */
  805|      0|                }
  806|      0|            }
  807|  10.4k|        }
  808|  5.24k|    }
  809|  5.24k|    if (collection) {
  ------------------
  |  Branch (809:9): [True: 0, False: 5.24k]
  ------------------
  810|      0|        nssPKIObjectCollection_Destroy(collection);
  811|      0|    }
  812|  5.24k|    if (slots) {
  ------------------
  |  Branch (812:9): [True: 5.24k, False: 0]
  ------------------
  813|  5.24k|        nssSlotArray_Destroy(slots);
  814|  5.24k|    }
  815|  5.24k|    return rvCert;
  816|  5.24k|}
nssTrustDomain_FindCertificateByEncodedCertificate:
  833|  5.40k|{
  834|  5.40k|    PRStatus status;
  835|  5.40k|    NSSCertificate *rvCert = NULL;
  836|  5.40k|    NSSDER issuer = { 0 };
  837|  5.40k|    NSSDER serial = { 0 };
  838|       |    /* XXX this is not generic...  will any cert crack into issuer/serial? */
  839|  5.40k|    status = nssPKIX509_GetIssuerAndSerialFromDER(ber, &issuer, &serial);
  840|  5.40k|    if (status != PR_SUCCESS) {
  ------------------
  |  Branch (840:9): [True: 163, False: 5.24k]
  ------------------
  841|    163|        return NULL;
  842|    163|    }
  843|  5.24k|    rvCert = nssTrustDomain_FindCertificateByIssuerAndSerialNumber(td,
  844|  5.24k|                                                                   &issuer,
  845|  5.24k|                                                                   &serial);
  846|  5.24k|    PORT_Free(issuer.data);
  ------------------
  |  |   60|  5.24k|#define PORT_Free PORT_Free_Util
  ------------------
  847|  5.24k|    PORT_Free(serial.data);
  ------------------
  |  |   60|  5.24k|#define PORT_Free PORT_Free_Util
  ------------------
  848|  5.24k|    return rvCert;
  849|  5.40k|}
NSSTrustDomain_FindCertificateByEncodedCertificate:
  855|  5.40k|{
  856|  5.40k|    return nssTrustDomain_FindCertificateByEncodedCertificate(td, ber);
  857|  5.40k|}
nssTrustDomain_FindTrustForCertificate:
 1051|  10.4k|{
 1052|  10.4k|    NSSSlot **slots;
 1053|  10.4k|    NSSSlot **slotp;
 1054|  10.4k|    nssCryptokiObject *to = NULL;
 1055|  10.4k|    nssPKIObject *pkio = NULL;
 1056|  10.4k|    NSSTrust *rvt = NULL;
 1057|  10.4k|    nssUpdateLevel updateLevel;
 1058|  10.4k|    slots = nssTrustDomain_GetActiveSlots(td, &updateLevel);
 1059|  10.4k|    if (!slots) {
  ------------------
  |  Branch (1059:9): [True: 0, False: 10.4k]
  ------------------
 1060|      0|        return (NSSTrust *)NULL;
 1061|      0|    }
 1062|  31.2k|    for (slotp = slots; *slotp; slotp++) {
  ------------------
  |  Branch (1062:25): [True: 20.8k, False: 10.4k]
  ------------------
 1063|  20.8k|        NSSToken *token = nssSlot_GetToken(*slotp);
 1064|       |
 1065|  20.8k|        if (token) {
  ------------------
  |  Branch (1065:13): [True: 20.8k, False: 0]
  ------------------
 1066|  20.8k|            to = nssToken_FindTrustForCertificate(token, NULL,
 1067|  20.8k|                                                  &c->encoding,
 1068|  20.8k|                                                  &c->issuer,
 1069|  20.8k|                                                  &c->serial,
 1070|  20.8k|                                                  nssTokenSearchType_TokenOnly);
 1071|  20.8k|            if (to) {
  ------------------
  |  Branch (1071:17): [True: 0, False: 20.8k]
  ------------------
 1072|      0|                PRStatus status;
 1073|      0|                if (!pkio) {
  ------------------
  |  Branch (1073:21): [True: 0, False: 0]
  ------------------
 1074|      0|                    pkio = nssPKIObject_Create(NULL, to, td, NULL, nssPKILock);
 1075|      0|                    status = pkio ? PR_SUCCESS : PR_FAILURE;
  ------------------
  |  Branch (1075:30): [True: 0, False: 0]
  ------------------
 1076|      0|                } else {
 1077|      0|                    status = nssPKIObject_AddInstance(pkio, to);
 1078|      0|                }
 1079|      0|                if (status != PR_SUCCESS) {
  ------------------
  |  Branch (1079:21): [True: 0, False: 0]
  ------------------
 1080|      0|                    nssCryptokiObject_Destroy(to);
 1081|      0|                }
 1082|      0|            }
 1083|  20.8k|            (void)nssToken_Destroy(token);
 1084|  20.8k|        }
 1085|  20.8k|    }
 1086|  10.4k|    if (pkio) {
  ------------------
  |  Branch (1086:9): [True: 0, False: 10.4k]
  ------------------
 1087|      0|        rvt = nssTrust_Create(pkio, &c->encoding);
 1088|      0|        if (rvt) {
  ------------------
  |  Branch (1088:13): [True: 0, False: 0]
  ------------------
 1089|      0|            pkio = NULL; /* rvt object now owns the pkio reference */
 1090|      0|        }
 1091|      0|    }
 1092|  10.4k|    nssSlotArray_Destroy(slots);
 1093|  10.4k|    if (pkio) {
  ------------------
  |  Branch (1093:9): [True: 0, False: 10.4k]
  ------------------
 1094|      0|        nssPKIObject_Destroy(pkio);
 1095|      0|    }
 1096|  10.4k|    return rvt;
 1097|  10.4k|}
nssTrustDomain_CreateCryptoContext:
 1202|      1|{
 1203|      1|    return nssCryptoContext_Create(td, uhhOpt);
 1204|      1|}
NSSTrustDomain_CreateCryptoContext:
 1210|      1|{
 1211|      1|    return nssTrustDomain_CreateCryptoContext(td, uhhOpt);
 1212|      1|}
trustdomain.c:token_destructor:
   63|      2|{
   64|      2|    NSSToken *tok = (NSSToken *)t;
   65|       |    /* Remove the token list's reference to the token */
   66|      2|    (void)nssToken_Destroy(tok);
   67|       |
   68|       |    /* Signal that the slot should not give out any more references to the
   69|       |     * token. The token might still have a positive refcount after this call.
   70|       |     * The token has a reference to the slot, so the slot will not be destroyed
   71|       |     * until after the token's refcount drops to 0. */
   72|      2|    PK11Slot_SetNSSToken(tok->pk11slot, NULL);
   73|      2|}
trustdomain.c:nssTrustDomain_GetActiveSlots:
  112|  15.6k|{
  113|  15.6k|    PRUint32 count;
  114|  15.6k|    NSSSlot **slots = NULL;
  115|  15.6k|    NSSToken **tp, **tokens;
  116|  15.6k|    *updateLevel = 1;
  117|  15.6k|    if (!td->tokenList) {
  ------------------
  |  Branch (117:9): [True: 0, False: 15.6k]
  ------------------
  118|      0|        return NULL;
  119|      0|    }
  120|  15.6k|    NSSRWLock_LockRead(td->tokensLock);
  ------------------
  |  |   47|  15.6k|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  ------------------
  121|  15.6k|    count = nssList_Count(td->tokenList);
  122|  15.6k|    tokens = nss_ZNEWARRAY(NULL, NSSToken *, count + 1);
  ------------------
  |  |  371|  15.6k|    ((type *)nss_ZAlloc((arenaOpt), sizeof(type) * (quantity)))
  ------------------
  123|  15.6k|    if (!tokens) {
  ------------------
  |  Branch (123:9): [True: 0, False: 15.6k]
  ------------------
  124|      0|        NSSRWLock_UnlockRead(td->tokensLock);
  ------------------
  |  |   50|      0|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  ------------------
  125|      0|        return NULL;
  126|      0|    }
  127|  15.6k|    slots = nss_ZNEWARRAY(NULL, NSSSlot *, count + 1);
  ------------------
  |  |  371|  15.6k|    ((type *)nss_ZAlloc((arenaOpt), sizeof(type) * (quantity)))
  ------------------
  128|  15.6k|    if (!slots) {
  ------------------
  |  Branch (128:9): [True: 0, False: 15.6k]
  ------------------
  129|      0|        NSSRWLock_UnlockRead(td->tokensLock);
  ------------------
  |  |   50|      0|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  ------------------
  130|      0|        nss_ZFreeIf(tokens);
  131|      0|        return NULL;
  132|      0|    }
  133|  15.6k|    nssList_GetArray(td->tokenList, (void **)tokens, count);
  134|  15.6k|    count = 0;
  135|  47.0k|    for (tp = tokens; *tp; tp++) {
  ------------------
  |  Branch (135:23): [True: 31.3k, False: 15.6k]
  ------------------
  136|  31.3k|        NSSSlot *slot = nssToken_GetSlot(*tp);
  137|  31.3k|        if (!PK11_IsDisabled(slot->pk11slot)) {
  ------------------
  |  Branch (137:13): [True: 31.3k, False: 0]
  ------------------
  138|  31.3k|            slots[count++] = slot;
  139|  31.3k|        } else {
  140|      0|            nssSlot_Destroy(slot);
  141|      0|        }
  142|  31.3k|    }
  143|  15.6k|    NSSRWLock_UnlockRead(td->tokensLock);
  ------------------
  |  |   50|  15.6k|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  ------------------
  144|  15.6k|    nss_ZFreeIf(tokens);
  145|  15.6k|    if (!count) {
  ------------------
  |  Branch (145:9): [True: 0, False: 15.6k]
  ------------------
  146|      0|        nss_ZFreeIf(slots);
  147|      0|        slots = NULL;
  148|      0|    }
  149|  15.6k|    return slots;
  150|  15.6k|}
trustdomain.c:nssTrustDomain_GetSessionForToken:
  157|  10.4k|{
  158|  10.4k|    return nssToken_GetDefaultSession(token);
  159|  10.4k|}

nsslowkey_DestroyPrivateKey:
  214|  9.81k|{
  215|  9.81k|    if (privk && privk->arena) {
  ------------------
  |  Branch (215:9): [True: 9.81k, False: 0]
  |  Branch (215:18): [True: 9.81k, False: 0]
  ------------------
  216|  9.81k|        PORT_FreeArena(privk->arena, PR_TRUE);
  ------------------
  |  |   61|  9.81k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(privk->arena, PR_TRUE);
  ------------------
  |  |  437|  9.81k|#define PR_TRUE 1
  ------------------
  217|  9.81k|    }
  218|  9.81k|}
nsslowkey_DestroyPublicKey:
  222|  13.5k|{
  223|  13.5k|    if (pubk && pubk->arena) {
  ------------------
  |  Branch (223:9): [True: 13.5k, False: 0]
  |  Branch (223:17): [True: 13.5k, False: 0]
  ------------------
  224|  13.5k|        PORT_FreeArena(pubk->arena, PR_TRUE);
  ------------------
  |  |   61|  13.5k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(pubk->arena, PR_TRUE);
  ------------------
  |  |  437|  13.5k|#define PR_TRUE 1
  ------------------
  225|  13.5k|    }
  226|  13.5k|}
nsslowkey_PublicModulusLen:
  229|  1.08k|{
  230|       |    /* interpret modulus length as key strength... in
  231|       |     * fortezza that's the public key length */
  232|       |
  233|  1.08k|    switch (pubk->keyType) {
  234|  1.08k|        case NSSLOWKEYRSAKey:
  ------------------
  |  Branch (234:9): [True: 1.08k, False: 0]
  ------------------
  235|  1.08k|            if (pubk->u.rsa.modulus.len == 0) {
  ------------------
  |  Branch (235:17): [True: 0, False: 1.08k]
  ------------------
  236|      0|                return 0;
  237|      0|            }
  238|  1.08k|            if (pubk->u.rsa.modulus.data[0] == 0) {
  ------------------
  |  Branch (238:17): [True: 0, False: 1.08k]
  ------------------
  239|      0|                return pubk->u.rsa.modulus.len - 1;
  240|      0|            }
  241|  1.08k|            return pubk->u.rsa.modulus.len;
  242|      0|        default:
  ------------------
  |  Branch (242:9): [True: 0, False: 1.08k]
  ------------------
  243|      0|            break;
  244|  1.08k|    }
  245|      0|    return 0;
  246|  1.08k|}

sftk_PBELockInit:
  585|      1|{
  586|      1|    if (!PBECache.lock) {
  ------------------
  |  Branch (586:9): [True: 1, False: 0]
  ------------------
  587|      1|        PBECache.lock = PZ_NewLock(nssIPBECacheLock);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  588|      1|    }
  589|      1|}
sftk_PBELockShutdown:
  716|      1|{
  717|      1|    int i;
  718|      1|    if (PBECache.lock) {
  ------------------
  |  Branch (718:9): [True: 1, False: 0]
  ------------------
  719|      1|        PZ_DestroyLock(PBECache.lock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  720|      1|        PBECache.lock = 0;
  721|      1|    }
  722|      1|    sftk_clearPBECommonCacheItemsLocked(&PBECache.cacheKDF1.common);
  723|    151|    for (i = 0; i < KDF2_CACHE_COUNT; i++) {
  ------------------
  |  |  569|    151|#define KDF2_CACHE_COUNT 150
  ------------------
  |  Branch (723:17): [True: 150, False: 1]
  ------------------
  724|    150|        sftk_clearPBECommonCacheItemsLocked(&PBECache.cacheKDF2.common[i]);
  725|    150|    }
  726|      1|    PBECache.cacheKDF2.next = 0;
  727|      1|}
lowpbe.c:sftk_clearPBECommonCacheItemsLocked:
  593|    151|{
  594|    151|    if (item->hash) {
  ------------------
  |  Branch (594:9): [True: 0, False: 151]
  ------------------
  595|      0|        SECITEM_ZfreeItem(item->hash, PR_TRUE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                      SECITEM_ZfreeItem(item->hash, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  596|      0|        item->hash = NULL;
  597|      0|    }
  598|    151|    if (item->salt) {
  ------------------
  |  Branch (598:9): [True: 0, False: 151]
  ------------------
  599|      0|        SECITEM_ZfreeItem(item->salt, PR_TRUE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                      SECITEM_ZfreeItem(item->salt, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  600|      0|        item->salt = NULL;
  601|      0|    }
  602|    151|    if (item->pwItem) {
  ------------------
  |  Branch (602:9): [True: 0, False: 151]
  ------------------
  603|      0|        SECITEM_ZfreeItem(item->pwItem, PR_TRUE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                      SECITEM_ZfreeItem(item->pwItem, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  604|      0|        item->pwItem = NULL;
  605|      0|    }
  606|    151|}

SFTKFree_nsslowkey_DestroyPublicKey:
  678|  13.5k|    {                              \
  679|  13.5k|        ctxtype *p = vp;           \
  680|  13.5k|        mmm(p);                    \
  681|  13.5k|    }
SFTKFree_nsslowkey_DestroyPrivateKey:
  678|  9.81k|    {                              \
  679|  9.81k|        ctxtype *p = vp;           \
  680|  9.81k|        mmm(p);                    \
  681|  9.81k|    }
sftk_defaultAttribute:
  793|   990k|{
  794|   990k|    if (!sftk_hasAttribute(object, type)) {
  ------------------
  |  Branch (794:9): [True: 728k, False: 262k]
  ------------------
  795|   728k|        return sftk_AddAttributeType(object, type, value, len);
  796|   728k|    }
  797|   262k|    return CKR_OK;
  ------------------
  |  | 1388|   262k|#define CKR_OK 0x00000000UL
  ------------------
  798|   990k|}
sftk_handleObject:
 1756|  62.5k|{
 1757|  62.5k|    SFTKSlot *slot = session->slot;
 1758|  62.5k|    SFTKAttribute *attribute;
 1759|  62.5k|    CK_BBOOL ckfalse = CK_FALSE;
  ------------------
  |  |   23|  62.5k|#define CK_FALSE 0
  ------------------
 1760|  62.5k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  62.5k|#define CK_TRUE 1
  ------------------
 1761|  62.5k|    PRBool isLoggedIn, needLogin;
 1762|  62.5k|    CK_RV crv;
 1763|       |
 1764|       |    /* make sure all the base object types are defined. If not set the
 1765|       |     * defaults */
 1766|  62.5k|    crv = sftk_defaultAttribute(object, CKA_TOKEN, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  512|  62.5k|#define CKA_TOKEN 0x00000001UL
  ------------------
 1767|  62.5k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  62.5k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1767:9): [True: 0, False: 62.5k]
  ------------------
 1768|      0|        return crv;
 1769|  62.5k|    crv = sftk_defaultAttribute(object, CKA_PRIVATE, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  513|  62.5k|#define CKA_PRIVATE 0x00000002UL
  ------------------
 1770|  62.5k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  62.5k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1770:9): [True: 0, False: 62.5k]
  ------------------
 1771|      0|        return crv;
 1772|  62.5k|    crv = sftk_defaultAttribute(object, CKA_LABEL, NULL, 0);
  ------------------
  |  |  514|  62.5k|#define CKA_LABEL 0x00000003UL
  ------------------
 1773|  62.5k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  62.5k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1773:9): [True: 0, False: 62.5k]
  ------------------
 1774|      0|        return crv;
 1775|  62.5k|    crv = sftk_defaultAttribute(object, CKA_MODIFIABLE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  593|  62.5k|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
 1776|  62.5k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  62.5k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1776:9): [True: 0, False: 62.5k]
  ------------------
 1777|      0|        return crv;
 1778|       |
 1779|  62.5k|    PZ_Lock(slot->slotLock);
  ------------------
  |  |  245|  62.5k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1780|  62.5k|    isLoggedIn = slot->isLoggedIn;
 1781|  62.5k|    needLogin = slot->needLogin;
 1782|  62.5k|    PZ_Unlock(slot->slotLock);
  ------------------
  |  |  246|  62.5k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1783|       |
 1784|       |    /* don't create a private object if we aren't logged in */
 1785|  62.5k|    if (!isLoggedIn && needLogin && sftk_isTrue(object, CKA_PRIVATE)) {
  ------------------
  |  |  513|      0|#define CKA_PRIVATE 0x00000002UL
  ------------------
  |  Branch (1785:9): [True: 62.5k, False: 0]
  |  Branch (1785:24): [True: 0, False: 62.5k]
  |  Branch (1785:37): [True: 0, False: 0]
  ------------------
 1786|      0|        return CKR_USER_NOT_LOGGED_IN;
  ------------------
  |  | 1486|      0|#define CKR_USER_NOT_LOGGED_IN 0x00000101UL
  ------------------
 1787|      0|    }
 1788|       |
 1789|  62.5k|    if (((session->info.flags & CKF_RW_SESSION) == 0) &&
  ------------------
  |  |  302|  62.5k|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (1789:9): [True: 62.5k, False: 0]
  ------------------
 1790|  62.5k|        (sftk_isTrue(object, CKA_TOKEN))) {
  ------------------
  |  |  512|  62.5k|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (1790:9): [True: 0, False: 62.5k]
  ------------------
 1791|      0|        return CKR_SESSION_READ_ONLY;
  ------------------
  |  | 1467|      0|#define CKR_SESSION_READ_ONLY 0x000000B5UL
  ------------------
 1792|      0|    }
 1793|       |
 1794|       |    /* Assign a unique SESSION object handle to every new object,
 1795|       |     * whether it is a session object or a token object.
 1796|       |     * At this point, all new objects are structured as session objects.
 1797|       |     * Objects with the CKA_TOKEN attribute true will be turned into
 1798|       |     * token objects and will have a token object handle assigned to
 1799|       |     * them by a call to sftk_mkHandle in the handler for each object
 1800|       |     * class, invoked below.
 1801|       |     *
 1802|       |     * It may be helpful to note/remember that
 1803|       |     * sftk_narrowToXxxObject uses sftk_isToken,
 1804|       |     * sftk_isToken examines the sign bit of the object's handle, but
 1805|       |     * sftk_isTrue(...,CKA_TOKEN) examines the CKA_TOKEN attribute.
 1806|       |     */
 1807|  62.5k|    object->handle = sftk_getNextHandle(slot);
 1808|       |
 1809|       |    /* get the object class */
 1810|  62.5k|    attribute = sftk_FindAttribute(object, CKA_CLASS);
  ------------------
  |  |  511|  62.5k|#define CKA_CLASS 0x00000000UL
  ------------------
 1811|  62.5k|    if (attribute == NULL) {
  ------------------
  |  Branch (1811:9): [True: 0, False: 62.5k]
  ------------------
 1812|      0|        return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1813|      0|    }
 1814|  62.5k|    object->objclass = *(CK_OBJECT_CLASS *)attribute->attrib.pValue;
 1815|  62.5k|    sftk_FreeAttribute(attribute);
 1816|       |
 1817|       |    /* Now handle the specific object class.
 1818|       |     * At this point, all objects are session objects, and the session
 1819|       |     * number must be passed to the object class handlers.
 1820|       |     */
 1821|  62.5k|    switch (object->objclass) {
 1822|  2.58k|        case CKO_DATA:
  ------------------
  |  |  325|  2.58k|#define CKO_DATA 0x00000000UL
  ------------------
  |  Branch (1822:9): [True: 2.58k, False: 59.9k]
  ------------------
 1823|  2.58k|            crv = sftk_handleDataObject(session, object);
 1824|  2.58k|            break;
 1825|      0|        case CKO_CERTIFICATE:
  ------------------
  |  |  326|      0|#define CKO_CERTIFICATE 0x00000001UL
  ------------------
  |  Branch (1825:9): [True: 0, False: 62.5k]
  ------------------
 1826|      0|            crv = sftk_handleCertObject(session, object);
 1827|      0|            break;
 1828|      0|        case CKO_NSS_TRUST:
  ------------------
  |  |   37|      0|#define CKO_NSS_TRUST (CKO_NSS + 3)
  |  |  ------------------
  |  |  |  |   33|      0|#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define CKO_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1828:9): [True: 0, False: 62.5k]
  ------------------
 1829|      0|            crv = sftk_handleTrustObject(session, object);
 1830|      0|            break;
 1831|      0|        case CKO_NSS_CRL:
  ------------------
  |  |   35|      0|#define CKO_NSS_CRL (CKO_NSS + 1)
  |  |  ------------------
  |  |  |  |   33|      0|#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define CKO_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1831:9): [True: 0, False: 62.5k]
  ------------------
 1832|      0|            crv = sftk_handleCrlObject(session, object);
 1833|      0|            break;
 1834|      0|        case CKO_NSS_SMIME:
  ------------------
  |  |   36|      0|#define CKO_NSS_SMIME (CKO_NSS + 2)
  |  |  ------------------
  |  |  |  |   33|      0|#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|      0|#define CKO_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1834:9): [True: 0, False: 62.5k]
  ------------------
 1835|      0|            crv = sftk_handleSMimeObject(session, object);
 1836|      0|            break;
 1837|  9.81k|        case CKO_PRIVATE_KEY:
  ------------------
  |  |  328|  9.81k|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
  |  Branch (1837:9): [True: 9.81k, False: 52.7k]
  ------------------
 1838|  23.7k|        case CKO_PUBLIC_KEY:
  ------------------
  |  |  327|  23.7k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
  |  Branch (1838:9): [True: 13.9k, False: 48.6k]
  ------------------
 1839|  59.9k|        case CKO_SECRET_KEY:
  ------------------
  |  |  329|  59.9k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
  |  Branch (1839:9): [True: 36.2k, False: 26.3k]
  ------------------
 1840|  59.9k|            crv = sftk_handleKeyObject(session, object);
 1841|  59.9k|            break;
 1842|      0|        case CKO_DOMAIN_PARAMETERS:
  ------------------
  |  |  331|      0|#define CKO_DOMAIN_PARAMETERS 0x00000006UL
  ------------------
  |  Branch (1842:9): [True: 0, False: 62.5k]
  ------------------
 1843|      0|            crv = sftk_handleKeyParameterObject(session, object);
 1844|      0|            break;
 1845|      0|        default:
  ------------------
  |  Branch (1845:9): [True: 0, False: 62.5k]
  ------------------
 1846|      0|            crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 1847|      0|            break;
 1848|  62.5k|    }
 1849|       |
 1850|       |    /* can't fail from here on out unless the pk_handlXXX functions have
 1851|       |     * failed the request */
 1852|  62.5k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  62.5k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1852:9): [True: 571, False: 62.0k]
  ------------------
 1853|    571|        return crv;
 1854|    571|    }
 1855|       |
 1856|       |    /* Now link the object into the slot and session structures.
 1857|       |     * If the object has a true CKA_TOKEN attribute, the above object
 1858|       |     * class handlers will have set the sign bit in the object handle,
 1859|       |     * causing the following test to be true.
 1860|       |     */
 1861|  62.0k|    if (sftk_isToken(object->handle)) {
  ------------------
  |  |  504|  62.0k|#define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  478|  62.0k|#define SFTK_TOKEN_MASK 0x80000000L
  |  |  ------------------
  |  |               #define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  479|  62.0k|#define SFTK_TOKEN_MAGIC 0x80000000L
  |  |  ------------------
  |  |  |  Branch (504:26): [True: 0, False: 62.0k]
  |  |  ------------------
  ------------------
 1862|      0|        sftk_convertSessionToToken(object);
 1863|  62.0k|    } else {
 1864|  62.0k|        object->slot = slot;
 1865|  62.0k|        sftk_AddObject(session, object);
 1866|  62.0k|    }
 1867|       |
 1868|  62.0k|    return CKR_OK;
  ------------------
  |  | 1388|  62.0k|#define CKR_OK 0x00000000UL
  ------------------
 1869|  62.5k|}
sftk_GetPubKey:
 1878|  17.2k|{
 1879|  17.2k|    NSSLOWKEYPublicKey *pubKey;
 1880|  17.2k|    PLArenaPool *arena;
 1881|  17.2k|    CK_RV crv;
 1882|       |
 1883|  17.2k|    if (object->objclass != CKO_PUBLIC_KEY) {
  ------------------
  |  |  327|  17.2k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
  |  Branch (1883:9): [True: 0, False: 17.2k]
  ------------------
 1884|      0|        *crvp = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1885|      0|        return NULL;
 1886|      0|    }
 1887|       |
 1888|  17.2k|    if (sftk_isToken(object->handle)) {
  ------------------
  |  |  504|  17.2k|#define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  478|  17.2k|#define SFTK_TOKEN_MASK 0x80000000L
  |  |  ------------------
  |  |               #define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  479|  17.2k|#define SFTK_TOKEN_MAGIC 0x80000000L
  |  |  ------------------
  |  |  |  Branch (504:26): [True: 0, False: 17.2k]
  |  |  ------------------
  ------------------
 1889|       |        /* ferret out the token object handle */
 1890|      0|    }
 1891|       |
 1892|       |    /* If we already have a key, use it */
 1893|  17.2k|    if (object->objectInfo) {
  ------------------
  |  Branch (1893:9): [True: 3.57k, False: 13.6k]
  ------------------
 1894|  3.57k|        *crvp = CKR_OK;
  ------------------
  |  | 1388|  3.57k|#define CKR_OK 0x00000000UL
  ------------------
 1895|  3.57k|        return (NSSLOWKEYPublicKey *)object->objectInfo;
 1896|  3.57k|    }
 1897|       |
 1898|       |    /* allocate the structure */
 1899|  13.6k|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  13.6k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  13.6k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 1900|  13.6k|    if (arena == NULL) {
  ------------------
  |  Branch (1900:9): [True: 0, False: 13.6k]
  ------------------
 1901|      0|        *crvp = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1902|      0|        return NULL;
 1903|      0|    }
 1904|       |
 1905|  13.6k|    pubKey = (NSSLOWKEYPublicKey *)
 1906|  13.6k|        PORT_ArenaAlloc(arena, sizeof(NSSLOWKEYPublicKey));
  ------------------
  |  |   53|  13.6k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
 1907|  13.6k|    if (pubKey == NULL) {
  ------------------
  |  Branch (1907:9): [True: 0, False: 13.6k]
  ------------------
 1908|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1909|      0|        *crvp = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1910|      0|        return NULL;
 1911|      0|    }
 1912|       |
 1913|       |    /* fill in the structure */
 1914|  13.6k|    pubKey->arena = arena;
 1915|  13.6k|    switch (key_type) {
 1916|  2.58k|        case CKK_RSA:
  ------------------
  |  |  372|  2.58k|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (1916:9): [True: 2.58k, False: 11.0k]
  ------------------
 1917|  2.58k|            pubKey->keyType = NSSLOWKEYRSAKey;
 1918|  2.58k|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.rsa.modulus,
 1919|  2.58k|                                          object, CKA_MODULUS);
  ------------------
  |  |  558|  2.58k|#define CKA_MODULUS 0x00000120UL
  ------------------
 1920|  2.58k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  2.58k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1920:17): [True: 0, False: 2.58k]
  ------------------
 1921|      0|                break;
 1922|  2.58k|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.rsa.publicExponent,
 1923|  2.58k|                                          object, CKA_PUBLIC_EXPONENT);
  ------------------
  |  |  560|  2.58k|#define CKA_PUBLIC_EXPONENT 0x00000122UL
  ------------------
 1924|  2.58k|            break;
 1925|    914|        case CKK_DSA:
  ------------------
  |  |  373|    914|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (1925:9): [True: 914, False: 12.7k]
  ------------------
 1926|    914|            pubKey->keyType = NSSLOWKEYDSAKey;
 1927|    914|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.dsa.params.prime,
 1928|    914|                                          object, CKA_PRIME);
  ------------------
  |  |  569|    914|#define CKA_PRIME 0x00000130UL
  ------------------
 1929|    914|            if (crv != CKR_OK)
  ------------------
  |  | 1388|    914|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1929:17): [True: 0, False: 914]
  ------------------
 1930|      0|                break;
 1931|    914|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.dsa.params.subPrime,
 1932|    914|                                          object, CKA_SUBPRIME);
  ------------------
  |  |  570|    914|#define CKA_SUBPRIME 0x00000131UL
  ------------------
 1933|    914|            if (crv != CKR_OK)
  ------------------
  |  | 1388|    914|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1933:17): [True: 0, False: 914]
  ------------------
 1934|      0|                break;
 1935|    914|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.dsa.params.base,
 1936|    914|                                          object, CKA_BASE);
  ------------------
  |  |  571|    914|#define CKA_BASE 0x00000132UL
  ------------------
 1937|    914|            if (crv != CKR_OK)
  ------------------
  |  | 1388|    914|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1937:17): [True: 0, False: 914]
  ------------------
 1938|      0|                break;
 1939|    914|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.dsa.publicValue,
 1940|    914|                                          object, CKA_VALUE);
  ------------------
  |  |  516|    914|#define CKA_VALUE 0x00000011UL
  ------------------
 1941|    914|            break;
 1942|  1.91k|        case CKK_DH:
  ------------------
  |  |  374|  1.91k|#define CKK_DH 0x00000002UL
  ------------------
  |  Branch (1942:9): [True: 1.91k, False: 11.7k]
  ------------------
 1943|  1.91k|            pubKey->keyType = NSSLOWKEYDHKey;
 1944|  1.91k|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.dh.prime,
 1945|  1.91k|                                          object, CKA_PRIME);
  ------------------
  |  |  569|  1.91k|#define CKA_PRIME 0x00000130UL
  ------------------
 1946|  1.91k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1946:17): [True: 0, False: 1.91k]
  ------------------
 1947|      0|                break;
 1948|  1.91k|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.dh.base,
 1949|  1.91k|                                          object, CKA_BASE);
  ------------------
  |  |  571|  1.91k|#define CKA_BASE 0x00000132UL
  ------------------
 1950|  1.91k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1950:17): [True: 0, False: 1.91k]
  ------------------
 1951|      0|                break;
 1952|  1.91k|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.dh.publicValue,
 1953|  1.91k|                                          object, CKA_VALUE);
  ------------------
  |  |  516|  1.91k|#define CKA_VALUE 0x00000011UL
  ------------------
 1954|  1.91k|            break;
 1955|      0|        case CKK_EC_EDWARDS:
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (1955:9): [True: 0, False: 13.6k]
  ------------------
 1956|      0|        case CKK_EC_MONTGOMERY:
  ------------------
  |  |  449|      0|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (1956:9): [True: 0, False: 13.6k]
  ------------------
 1957|  8.22k|        case CKK_EC:
  ------------------
  |  |  379|  8.22k|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (1957:9): [True: 8.22k, False: 5.41k]
  ------------------
 1958|  8.22k|            pubKey->keyType = NSSLOWKEYECKey;
 1959|  8.22k|            crv = sftk_Attribute2SSecItem(arena,
 1960|  8.22k|                                          &pubKey->u.ec.ecParams.DEREncoding,
 1961|  8.22k|                                          object, CKA_EC_PARAMS);
  ------------------
  |  |  602|  8.22k|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
 1962|  8.22k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  8.22k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1962:17): [True: 0, False: 8.22k]
  ------------------
 1963|      0|                break;
 1964|       |
 1965|       |            /* Fill out the rest of the ecParams structure
 1966|       |             * based on the encoded params
 1967|       |             */
 1968|  8.22k|            if (EC_FillParams(arena, &pubKey->u.ec.ecParams.DEREncoding,
  ------------------
  |  Branch (1968:17): [True: 108, False: 8.11k]
  ------------------
 1969|  8.22k|                              &pubKey->u.ec.ecParams) != SECSuccess) {
 1970|    108|                crv = CKR_DOMAIN_PARAMS_INVALID;
  ------------------
  |  | 1508|    108|#define CKR_DOMAIN_PARAMS_INVALID 0x00000130UL
  ------------------
 1971|    108|                break;
 1972|    108|            }
 1973|       |
 1974|  8.11k|            crv = sftk_Attribute2SSecItem(arena, &pubKey->u.ec.publicValue,
 1975|  8.11k|                                          object, CKA_EC_POINT);
  ------------------
  |  |  604|  8.11k|#define CKA_EC_POINT 0x00000181UL
  ------------------
 1976|  8.11k|            if (crv == CKR_OK) {
  ------------------
  |  | 1388|  8.11k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1976:17): [True: 8.11k, False: 0]
  ------------------
 1977|  8.11k|                unsigned int keyLen = EC_GetPointSize(&pubKey->u.ec.ecParams);
 1978|       |
 1979|       |                /* special note: We can't just use the first byte to distinguish
 1980|       |                 * between EC_POINT_FORM_UNCOMPRESSED and SEC_ASN1_OCTET_STRING.
 1981|       |                 * Both are 0x04. */
 1982|       |
 1983|       |                /* Handle the non-DER encoded case.
 1984|       |                 * Some curves are always pressumed to be non-DER.
 1985|       |                 */
 1986|  8.11k|                if (pubKey->u.ec.ecParams.type != ec_params_named ||
  ------------------
  |  Branch (1986:21): [True: 7.55k, False: 560]
  ------------------
 1987|  8.11k|                    (pubKey->u.ec.publicValue.len == keyLen &&
  ------------------
  |  Branch (1987:22): [True: 0, False: 560]
  ------------------
 1988|  7.55k|                     pubKey->u.ec.publicValue.data[0] == EC_POINT_FORM_UNCOMPRESSED)) {
  ------------------
  |  |   92|      0|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (1988:22): [True: 0, False: 0]
  ------------------
 1989|  7.55k|                    break; /* key was not DER encoded, no need to unwrap */
 1990|  7.55k|                }
 1991|       |
 1992|       |                /* handle the encoded case */
 1993|    560|                if ((pubKey->u.ec.publicValue.data[0] == SEC_ASN1_OCTET_STRING) &&
  ------------------
  |  |   80|    560|#define SEC_ASN1_OCTET_STRING 0x04
  ------------------
  |  Branch (1993:21): [True: 560, False: 0]
  ------------------
 1994|    560|                    pubKey->u.ec.publicValue.len > keyLen) {
  ------------------
  |  Branch (1994:21): [True: 556, False: 4]
  ------------------
 1995|    556|                    SECItem publicValue;
 1996|    556|                    SECStatus rv;
 1997|       |
 1998|    556|                    rv = SEC_QuickDERDecodeItem(arena, &publicValue,
  ------------------
  |  |  102|    556|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
 1999|    556|                                                SEC_ASN1_GET(SEC_OctetStringTemplate),
  ------------------
  |  |  188|    556|#define SEC_ASN1_GET(x) x
  ------------------
 2000|    556|                                                &pubKey->u.ec.publicValue);
 2001|       |                    /* nope, didn't decode correctly */
 2002|    556|                    if ((rv != SECSuccess) || (publicValue.len != keyLen)) {
  ------------------
  |  Branch (2002:25): [True: 0, False: 556]
  |  Branch (2002:47): [True: 3, False: 553]
  ------------------
 2003|      3|                        crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      3|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 2004|      3|                        break;
 2005|      3|                    }
 2006|       |                    /* we don't handle compressed points except in the case of ECCurve25519 */
 2007|    553|                    if (publicValue.data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|    553|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (2007:25): [True: 12, False: 541]
  ------------------
 2008|     12|                        crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|     12|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 2009|     12|                        break;
 2010|     12|                    }
 2011|       |                    /* replace our previous with the decoded key */
 2012|    541|                    pubKey->u.ec.publicValue = publicValue;
 2013|    541|                    break;
 2014|    553|                }
 2015|      4|                crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      4|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 2016|      4|            }
 2017|      4|            break;
 2018|      4|        case CKK_NSS_KYBER:
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2018:9): [True: 0, False: 13.6k]
  ------------------
 2019|      0|        case CKK_NSS_ML_KEM:
  ------------------
  |  |   59|      0|#define CKK_NSS_ML_KEM (CKK_NSS + 6)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2019:9): [True: 0, False: 13.6k]
  ------------------
 2020|      0|            crv = CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
 2021|      0|            break;
 2022|      0|        default:
  ------------------
  |  Branch (2022:9): [True: 0, False: 13.6k]
  ------------------
 2023|      0|            crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 2024|      0|            break;
 2025|  13.6k|    }
 2026|  13.6k|    *crvp = crv;
 2027|  13.6k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  13.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2027:9): [True: 127, False: 13.5k]
  ------------------
 2028|    127|        PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |   61|    127|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |  437|    127|#define PR_TRUE 1
  ------------------
 2029|    127|        return NULL;
 2030|    127|    }
 2031|       |
 2032|  13.5k|    object->objectInfo = pubKey;
 2033|  13.5k|    object->infoFree = SFTKFree_nsslowkey_DestroyPublicKey;
 2034|  13.5k|    return pubKey;
 2035|  13.6k|}
sftk_GetPrivKey:
 2377|  2.46k|{
 2378|  2.46k|    NSSLOWKEYPrivateKey *priv = NULL;
 2379|       |
 2380|  2.46k|    if (object->objclass != CKO_PRIVATE_KEY) {
  ------------------
  |  |  328|  2.46k|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
  |  Branch (2380:9): [True: 0, False: 2.46k]
  ------------------
 2381|      0|        *crvp = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 2382|      0|        return NULL;
 2383|      0|    }
 2384|  2.46k|    if (object->objectInfo) {
  ------------------
  |  Branch (2384:9): [True: 2.46k, False: 0]
  ------------------
 2385|  2.46k|        *crvp = CKR_OK;
  ------------------
  |  | 1388|  2.46k|#define CKR_OK 0x00000000UL
  ------------------
 2386|  2.46k|        return (NSSLOWKEYPrivateKey *)object->objectInfo;
 2387|  2.46k|    }
 2388|       |
 2389|      0|    priv = sftk_mkPrivKey(object, key_type, crvp);
 2390|      0|    object->objectInfo = priv;
 2391|      0|    object->infoFree = SFTKFree_nsslowkey_DestroyPrivateKey;
 2392|      0|    return priv;
 2393|  2.46k|}
sftk_FormatDESKey:
 2523|  1.51k|{
 2524|  1.51k|    int i;
 2525|       |
 2526|       |    /* format the des key */
 2527|  33.1k|    for (i = 0; i < length; i++) {
  ------------------
  |  Branch (2527:17): [True: 31.6k, False: 1.51k]
  ------------------
 2528|  31.6k|        key[i] = parityTable[key[i] >> 1];
 2529|  31.6k|    }
 2530|  1.51k|}
sftk_IsWeakKey:
 2556|      1|{
 2557|       |
 2558|      1|    switch (key_type) {
 2559|      0|        case CKK_DES:
  ------------------
  |  |  386|      0|#define CKK_DES 0x00000013UL
  ------------------
  |  Branch (2559:9): [True: 0, False: 1]
  ------------------
 2560|      0|            return sftk_CheckDESKey(key);
 2561|      0|        case CKM_DES2_KEY_GEN:
  ------------------
  |  |  823|      0|#define CKM_DES2_KEY_GEN 0x00000130UL
  ------------------
  |  Branch (2561:9): [True: 0, False: 1]
  ------------------
 2562|      0|            if (sftk_CheckDESKey(key))
  ------------------
  |  Branch (2562:17): [True: 0, False: 0]
  ------------------
 2563|      0|                return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2564|      0|            return sftk_CheckDESKey(&key[8]);
 2565|      0|        case CKM_DES3_KEY_GEN:
  ------------------
  |  |  824|      0|#define CKM_DES3_KEY_GEN 0x00000131UL
  ------------------
  |  Branch (2565:9): [True: 0, False: 1]
  ------------------
 2566|      0|            if (sftk_CheckDESKey(key))
  ------------------
  |  Branch (2566:17): [True: 0, False: 0]
  ------------------
 2567|      0|                return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2568|      0|            if (sftk_CheckDESKey(&key[8]))
  ------------------
  |  Branch (2568:17): [True: 0, False: 0]
  ------------------
 2569|      0|                return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2570|      0|            return sftk_CheckDESKey(&key[16]);
 2571|      1|        default:
  ------------------
  |  Branch (2571:9): [True: 1, False: 0]
  ------------------
 2572|      1|            break;
 2573|      1|    }
 2574|      1|    return PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 2575|      1|}
NSC_GetInterface:
 2642|      2|{
 2643|      2|    int i;
 2644|      5|    for (i = 0; i < NSS_INTERFACE_COUNT; i++) {
  ------------------
  |  |  191|      5|#define NSS_INTERFACE_COUNT 5
  ------------------
  |  Branch (2644:17): [True: 5, False: 0]
  ------------------
 2645|      5|        CK_INTERFACE_PTR interface = &nss_interfaces[i];
 2646|      5|        if (pInterfaceName && PORT_Strcmp((char *)pInterfaceName, (char *)interface->pInterfaceName) != 0) {
  ------------------
  |  |  188|      5|#define PORT_Strcmp strcmp
  ------------------
  |  Branch (2646:13): [True: 5, False: 0]
  |  Branch (2646:31): [True: 3, False: 2]
  ------------------
 2647|      3|            continue;
 2648|      3|        }
 2649|      2|        if (pVersion && PORT_Memcmp(pVersion, (CK_VERSION *)interface->pFunctionList, sizeof(CK_VERSION)) != 0) {
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (2649:13): [True: 0, False: 2]
  |  Branch (2649:25): [True: 0, False: 0]
  ------------------
 2650|      0|            continue;
 2651|      0|        }
 2652|      2|        if (flags & ((interface->flags & flags) != flags)) {
  ------------------
  |  Branch (2652:13): [True: 0, False: 2]
  ------------------
 2653|      0|            continue;
 2654|      0|        }
 2655|      2|        *ppInterface = interface;
 2656|      2|        return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 2657|      2|    }
 2658|      0|    return CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 2659|      2|}
sftk_getDefTokName:
 2689|      2|{
 2690|      2|    static char buf[33];
 2691|       |
 2692|      2|    switch (slotID) {
 2693|      1|        case NETSCAPE_SLOT_ID:
  ------------------
  |  |  498|      1|#define NETSCAPE_SLOT_ID 1
  ------------------
  |  Branch (2693:9): [True: 1, False: 1]
  ------------------
 2694|      1|            return "NSS Generic Crypto Services     ";
 2695|      1|        case PRIVATE_KEY_SLOT_ID:
  ------------------
  |  |  499|      1|#define PRIVATE_KEY_SLOT_ID 2
  ------------------
  |  Branch (2695:9): [True: 1, False: 1]
  ------------------
 2696|      1|            return "NSS Certificate DB              ";
 2697|      0|        case FIPS_SLOT_ID:
  ------------------
  |  |  500|      0|#define FIPS_SLOT_ID 3
  ------------------
  |  Branch (2697:9): [True: 0, False: 2]
  ------------------
 2698|      0|            return "NSS FIPS 140-2 Certificate DB   ";
 2699|      0|        default:
  ------------------
  |  Branch (2699:9): [True: 0, False: 2]
  ------------------
 2700|      0|            break;
 2701|      2|    }
 2702|      0|    snprintf(buf, sizeof(buf), "NSS Application Token %08x  ", (unsigned int)slotID);
 2703|      0|    return buf;
 2704|      2|}
sftk_getDefSlotName:
 2708|      2|{
 2709|      2|    static char buf[65];
 2710|       |
 2711|      2|    switch (slotID) {
 2712|      1|        case NETSCAPE_SLOT_ID:
  ------------------
  |  |  498|      1|#define NETSCAPE_SLOT_ID 1
  ------------------
  |  Branch (2712:9): [True: 1, False: 1]
  ------------------
 2713|      1|            return "NSS Internal Cryptographic Services                             ";
 2714|      1|        case PRIVATE_KEY_SLOT_ID:
  ------------------
  |  |  499|      1|#define PRIVATE_KEY_SLOT_ID 2
  ------------------
  |  Branch (2714:9): [True: 1, False: 1]
  ------------------
 2715|      1|            return "NSS User Private Key and Certificate Services                   ";
 2716|      0|        case FIPS_SLOT_ID:
  ------------------
  |  |  500|      0|#define FIPS_SLOT_ID 3
  ------------------
  |  Branch (2716:9): [True: 0, False: 2]
  ------------------
 2717|      0|            return "NSS FIPS 140-2 User Private Key Services                        ";
 2718|      0|        default:
  ------------------
  |  Branch (2718:9): [True: 0, False: 2]
  ------------------
 2719|      0|            break;
 2720|      2|    }
 2721|      0|    snprintf(buf, sizeof(buf),
 2722|      0|             "NSS Application Slot %08x                                   ",
 2723|      0|             (unsigned int)slotID);
 2724|      0|    return buf;
 2725|      2|}
sftk_SlotFromID:
 2747|   827k|{
 2748|   827k|    SFTKSlot *slot;
 2749|   827k|    unsigned int index = sftk_GetModuleIndex(slotID);
 2750|       |
 2751|   827k|    if (nscSlotHashTable[index] == NULL)
  ------------------
  |  Branch (2751:9): [True: 0, False: 827k]
  ------------------
 2752|      0|        return NULL;
 2753|   827k|    slot = (SFTKSlot *)PL_HashTableLookupConst(nscSlotHashTable[index],
 2754|   827k|                                               (void *)(uintptr_t)slotID);
 2755|       |    /* cleared slots shouldn't 'show up' */
 2756|   827k|    if (slot && !all && !slot->present)
  ------------------
  |  Branch (2756:9): [True: 827k, False: 0]
  |  Branch (2756:17): [True: 827k, False: 2]
  |  Branch (2756:25): [True: 0, False: 827k]
  ------------------
 2757|      0|        slot = NULL;
 2758|   827k|    return slot;
 2759|   827k|}
sftk_SlotIDFromSessionHandle:
 2763|   726k|{
 2764|   726k|    CK_ULONG slotIDIndex = (handle >> 24) & 0x7f;
 2765|   726k|    CK_ULONG moduleIndex = (handle >> 31) & 1;
 2766|       |
 2767|   726k|    if (slotIDIndex >= nscSlotCount[moduleIndex]) {
  ------------------
  |  Branch (2767:9): [True: 0, False: 726k]
  ------------------
 2768|      0|        return (CK_SLOT_ID)-1;
 2769|      0|    }
 2770|   726k|    return nscSlotList[moduleIndex][slotIDIndex];
 2771|   726k|}
sftk_SlotFromSessionHandle:
 2775|   726k|{
 2776|   726k|    return sftk_SlotFromID(sftk_SlotIDFromSessionHandle(handle), PR_FALSE);
  ------------------
  |  |  438|   726k|#define PR_FALSE 0
  ------------------
 2777|   726k|}
SFTK_SlotReInit:
 2861|      2|{
 2862|      2|    PRBool needLogin = !params->noKeyDB;
 2863|      2|    CK_RV crv;
 2864|       |
 2865|      2|    slot->hasTokens = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 2866|      2|    slot->sessionIDConflict = 0;
 2867|      2|    slot->sessionCount = 0;
 2868|      2|    slot->rwSessionCount = 0;
 2869|      2|    slot->needLogin = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 2870|      2|    slot->isLoggedIn = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 2871|      2|    slot->ssoLoggedIn = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 2872|      2|    slot->DB_loaded = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 2873|      2|    slot->certDB = NULL;
 2874|      2|    slot->keyDB = NULL;
 2875|      2|    slot->minimumPinLen = 0;
 2876|      2|    slot->readOnly = params->readOnly;
 2877|      2|    sftk_setStringName(params->tokdes ? params->tokdes : sftk_getDefTokName(slot->slotID), slot->tokDescription,
  ------------------
  |  Branch (2877:24): [True: 0, False: 2]
  ------------------
 2878|      2|                       sizeof(slot->tokDescription), PR_TRUE);
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 2879|      2|    sftk_setStringName(params->updtokdes ? params->updtokdes : " ",
  ------------------
  |  Branch (2879:24): [True: 1, False: 1]
  ------------------
 2880|      2|                       slot->updateTokDescription,
 2881|      2|                       sizeof(slot->updateTokDescription), PR_TRUE);
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 2882|       |
 2883|      2|    if ((!params->noCertDB) || (!params->noKeyDB)) {
  ------------------
  |  Branch (2883:9): [True: 0, False: 2]
  |  Branch (2883:32): [True: 0, False: 2]
  ------------------
 2884|      0|        SFTKDBHandle *certHandle = NULL;
 2885|      0|        SFTKDBHandle *keyHandle = NULL;
 2886|      0|        crv = sftk_DBInit(params->configdir ? params->configdir : configdir,
  ------------------
  |  Branch (2886:27): [True: 0, False: 0]
  ------------------
 2887|      0|                          params->certPrefix, params->keyPrefix,
 2888|      0|                          params->updatedir ? params->updatedir : updatedir,
  ------------------
  |  Branch (2888:27): [True: 0, False: 0]
  ------------------
 2889|      0|                          params->updCertPrefix, params->updKeyPrefix,
 2890|      0|                          params->updateID ? params->updateID : updateID,
  ------------------
  |  Branch (2890:27): [True: 0, False: 0]
  ------------------
 2891|      0|                          params->readOnly, params->noCertDB, params->noKeyDB,
 2892|      0|                          params->forceOpen,
 2893|      0|                          moduleIndex == NSC_FIPS_MODULE,
  ------------------
  |  |   54|      0|#define NSC_FIPS_MODULE 1
  ------------------
 2894|      0|                          &certHandle, &keyHandle);
 2895|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2895:13): [True: 0, False: 0]
  ------------------
 2896|      0|            goto loser;
 2897|      0|        }
 2898|       |
 2899|      0|        slot->certDB = certHandle;
 2900|      0|        slot->keyDB = keyHandle;
 2901|      0|    }
 2902|      2|    if (needLogin) {
  ------------------
  |  Branch (2902:9): [True: 0, False: 2]
  ------------------
 2903|       |        /* if the data base is initialized with a null password,remember that */
 2904|      0|        slot->needLogin =
 2905|      0|            (PRBool)!sftk_hasNullPassword(slot, slot->keyDB);
 2906|      0|        if ((params->minPW >= 0) && (params->minPW <= SFTK_MAX_PIN)) {
  ------------------
  |  |  493|      0|#define SFTK_MAX_PIN 500
  ------------------
  |  Branch (2906:13): [True: 0, False: 0]
  |  Branch (2906:37): [True: 0, False: 0]
  ------------------
 2907|      0|            slot->minimumPinLen = params->minPW;
 2908|      0|        }
 2909|      0|        if ((slot->minimumPinLen == 0) && (params->pwRequired)) {
  ------------------
  |  Branch (2909:13): [True: 0, False: 0]
  |  Branch (2909:43): [True: 0, False: 0]
  ------------------
 2910|      0|            slot->minimumPinLen = 1;
 2911|      0|        }
 2912|       |        /* Make sure the pin len is set to the Minimum allowed value for fips
 2913|       |         * when in FIPS mode. NOTE: we don't set it if the database has not
 2914|       |         * been initialized yet so that we can init into level1 mode if needed
 2915|       |         */
 2916|      0|        if ((sftkdb_HasPasswordSet(slot->keyDB) == SECSuccess) &&
  ------------------
  |  Branch (2916:13): [True: 0, False: 0]
  ------------------
 2917|      0|            (moduleIndex == NSC_FIPS_MODULE) &&
  ------------------
  |  |   54|      0|#define NSC_FIPS_MODULE 1
  ------------------
  |  Branch (2917:13): [True: 0, False: 0]
  ------------------
 2918|      0|            (slot->minimumPinLen < FIPS_MIN_PIN)) {
  ------------------
  |  |  495|      0|#define FIPS_MIN_PIN 7
  ------------------
  |  Branch (2918:13): [True: 0, False: 0]
  ------------------
 2919|      0|            slot->minimumPinLen = FIPS_MIN_PIN;
  ------------------
  |  |  495|      0|#define FIPS_MIN_PIN 7
  ------------------
 2920|      0|        }
 2921|      0|    }
 2922|       |
 2923|      2|    slot->present = PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 2924|      2|    return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 2925|       |
 2926|      0|loser:
 2927|      0|    SFTK_ShutdownSlot(slot);
 2928|      0|    return crv;
 2929|      2|}
SFTK_SlotInit:
 2937|      2|{
 2938|      2|    unsigned int i;
 2939|      2|    CK_SLOT_ID slotID = params->slotID;
 2940|      2|    SFTKSlot *slot;
 2941|      2|    CK_RV crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      2|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2942|       |
 2943|       |    /*
 2944|       |     * first we initialize everything that is 'permanent' with this slot.
 2945|       |     * that is everything we aren't going to shutdown if we close this slot
 2946|       |     * and open it up again with different databases */
 2947|       |
 2948|      2|    slot = PORT_ZNew(SFTKSlot);
  ------------------
  |  |  148|      2|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|      2|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 2949|       |
 2950|      2|    if (slot == NULL) {
  ------------------
  |  Branch (2950:9): [True: 0, False: 2]
  ------------------
 2951|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2952|      0|    }
 2953|       |
 2954|      2|    slot->optimizeSpace = params->optimizeSpace;
 2955|      2|    if (slot->optimizeSpace) {
  ------------------
  |  Branch (2955:9): [True: 2, False: 0]
  ------------------
 2956|      2|        slot->sessObjHashSize = SPACE_SESSION_OBJECT_HASH_SIZE;
  ------------------
  |  |   66|      2|#define SPACE_SESSION_OBJECT_HASH_SIZE 32
  ------------------
 2957|      2|        slot->sessHashSize = SPACE_SESSION_HASH_SIZE;
  ------------------
  |  |   67|      2|#define SPACE_SESSION_HASH_SIZE 32
  ------------------
 2958|      2|        slot->numSessionLocks = 1;
 2959|      2|    } else {
 2960|      0|        slot->sessObjHashSize = TIME_SESSION_OBJECT_HASH_SIZE;
  ------------------
  |  |   69|      0|#define TIME_SESSION_OBJECT_HASH_SIZE 1024
  ------------------
 2961|      0|        slot->sessHashSize = TIME_SESSION_HASH_SIZE;
  ------------------
  |  |   70|      0|#define TIME_SESSION_HASH_SIZE 1024
  ------------------
 2962|      0|        slot->numSessionLocks = slot->sessHashSize / BUCKETS_PER_SESSION_LOCK;
  ------------------
  |  |   93|      0|#define BUCKETS_PER_SESSION_LOCK (1 << (LOG2_BUCKETS_PER_SESSION_LOCK))
  |  |  ------------------
  |  |  |  |   92|      0|#define LOG2_BUCKETS_PER_SESSION_LOCK 1
  |  |  ------------------
  ------------------
 2963|      0|    }
 2964|      2|    slot->sessionLockMask = slot->numSessionLocks - 1;
 2965|       |
 2966|      2|    slot->slotLock = PZ_NewLock(nssILockSession);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 2967|      2|    if (slot->slotLock == NULL)
  ------------------
  |  Branch (2967:9): [True: 0, False: 2]
  ------------------
 2968|      0|        goto mem_loser;
 2969|      2|    slot->sessionLock = PORT_ZNewArray(PZLock *, slot->numSessionLocks);
  ------------------
  |  |  159|      2|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|      2|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 2970|      2|    if (slot->sessionLock == NULL)
  ------------------
  |  Branch (2970:9): [True: 0, False: 2]
  ------------------
 2971|      0|        goto mem_loser;
 2972|      4|    for (i = 0; i < slot->numSessionLocks; i++) {
  ------------------
  |  Branch (2972:17): [True: 2, False: 2]
  ------------------
 2973|      2|        slot->sessionLock[i] = PZ_NewLock(nssILockSession);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 2974|      2|        if (slot->sessionLock[i] == NULL)
  ------------------
  |  Branch (2974:13): [True: 0, False: 2]
  ------------------
 2975|      0|            goto mem_loser;
 2976|      2|    }
 2977|      2|    slot->objectLock = PZ_NewLock(nssILockObject);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 2978|      2|    if (slot->objectLock == NULL)
  ------------------
  |  Branch (2978:9): [True: 0, False: 2]
  ------------------
 2979|      0|        goto mem_loser;
 2980|      2|    slot->pwCheckLock = PR_NewLock();
 2981|      2|    if (slot->pwCheckLock == NULL)
  ------------------
  |  Branch (2981:9): [True: 0, False: 2]
  ------------------
 2982|      0|        goto mem_loser;
 2983|      2|    slot->head = PORT_ZNewArray(SFTKSession *, slot->sessHashSize);
  ------------------
  |  |  159|      2|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|      2|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 2984|      2|    if (slot->head == NULL)
  ------------------
  |  Branch (2984:9): [True: 0, False: 2]
  ------------------
 2985|      0|        goto mem_loser;
 2986|      2|    slot->sessObjHashTable = PORT_ZNewArray(SFTKObject *, slot->sessObjHashSize);
  ------------------
  |  |  159|      2|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|      2|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 2987|      2|    if (slot->sessObjHashTable == NULL)
  ------------------
  |  Branch (2987:9): [True: 0, False: 2]
  ------------------
 2988|      0|        goto mem_loser;
 2989|      2|    slot->tokObjHashTable = PL_NewHashTable(64, sftk_HashNumber, PL_CompareValues,
 2990|      2|                                            SECITEM_HashCompare, NULL, 0);
 2991|      2|    if (slot->tokObjHashTable == NULL)
  ------------------
  |  Branch (2991:9): [True: 0, False: 2]
  ------------------
 2992|      0|        goto mem_loser;
 2993|       |
 2994|      2|    slot->sessionIDCount = 0;
 2995|      2|    slot->sessionObjectHandleCount = NSC_MIN_SESSION_OBJECT_HANDLE;
  ------------------
  |  |   52|      2|#define NSC_MIN_SESSION_OBJECT_HANDLE 1U
  ------------------
 2996|      2|    slot->slotID = slotID;
 2997|      2|    sftk_setStringName(params->slotdes ? params->slotdes : sftk_getDefSlotName(slotID), slot->slotDescription,
  ------------------
  |  Branch (2997:24): [True: 0, False: 2]
  ------------------
 2998|      2|                       sizeof(slot->slotDescription), PR_TRUE);
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 2999|      2|    crv = sftk_InitSession(&slot->moduleObjects, slot, slotID, NULL, NULL,
 3000|      2|                           CKF_SERIAL_SESSION);
  ------------------
  |  |  303|      2|#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */
  ------------------
 3001|      2|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3001:9): [True: 0, False: 2]
  ------------------
 3002|      0|        goto loser;
 3003|      0|    }
 3004|       |
 3005|       |    /* call the reinit code to set everything that changes between token
 3006|       |     * init calls */
 3007|      2|    crv = SFTK_SlotReInit(slot, configdir, updatedir, updateID,
 3008|      2|                          params, moduleIndex);
 3009|      2|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3009:9): [True: 0, False: 2]
  ------------------
 3010|      0|        goto loser;
 3011|      0|    }
 3012|      2|    if (sftk_isFIPS(slotID)) {
  ------------------
  |  |  506|      2|    (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  500|      2|#define FIPS_SLOT_ID 3
  |  |  ------------------
  |  |                   (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  567|      2|#define SFTK_MIN_FIPS_USER_SLOT_ID 101
  |  |  ------------------
  |  |  |  Branch (506:6): [True: 0, False: 2]
  |  |  |  Branch (506:32): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 3013|      0|        crv = sftk_CreateValidationObjects(slot);
 3014|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3014:13): [True: 0, False: 0]
  ------------------
 3015|      0|            goto loser;
 3016|      0|        }
 3017|      0|    }
 3018|      2|    crv = sftk_RegisterSlot(slot, moduleIndex);
 3019|      2|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3019:9): [True: 0, False: 2]
  ------------------
 3020|      0|        goto loser;
 3021|      0|    }
 3022|      2|    return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 3023|       |
 3024|      0|mem_loser:
 3025|      0|    crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 3026|      0|loser:
 3027|      0|    SFTK_DestroySlotData(slot);
 3028|      0|    return crv;
 3029|      0|}
sftk_CloseAllSessions:
 3033|      6|{
 3034|      6|    SFTKSession *session;
 3035|      6|    unsigned int i;
 3036|      6|    SFTKDBHandle *handle;
 3037|       |
 3038|       |    /* first log out the card */
 3039|       |    /* special case - if we are in a middle of upgrade, we want to close the
 3040|       |     * sessions to fake a token removal to tell the upper level code we have
 3041|       |     * switched from one database to another, but we don't want to
 3042|       |     * explicity logout in case we can continue the upgrade with the
 3043|       |     * existing password if possible.
 3044|       |     */
 3045|      6|    if (logout) {
  ------------------
  |  Branch (3045:9): [True: 6, False: 0]
  ------------------
 3046|      6|        handle = sftk_getKeyDB(slot);
 3047|      6|        SKIP_AFTER_FORK(PZ_Lock(slot->slotLock));
  ------------------
  |  |  256|      6|#define SKIP_AFTER_FORK(x) x
  ------------------
 3048|      6|        slot->isLoggedIn = PR_FALSE;
  ------------------
  |  |  438|      6|#define PR_FALSE 0
  ------------------
 3049|      6|        if (slot->needLogin && handle) {
  ------------------
  |  Branch (3049:13): [True: 0, False: 6]
  |  Branch (3049:32): [True: 0, False: 0]
  ------------------
 3050|      0|            sftkdb_ClearPassword(handle);
 3051|      0|        }
 3052|      6|        SKIP_AFTER_FORK(PZ_Unlock(slot->slotLock));
  ------------------
  |  |  256|      6|#define SKIP_AFTER_FORK(x) x
  ------------------
 3053|      6|        if (handle) {
  ------------------
  |  Branch (3053:13): [True: 0, False: 6]
  ------------------
 3054|      0|            sftk_freeDB(handle);
 3055|      0|        }
 3056|      6|    }
 3057|       |
 3058|       |    /* now close all the current sessions */
 3059|       |    /* NOTE: If you try to open new sessions before NSC_CloseAllSessions
 3060|       |     * completes, some of those new sessions may or may not be closed by
 3061|       |     * NSC_CloseAllSessions... but any session running when this code starts
 3062|       |     * will guarrenteed be close, and no session will be partially closed */
 3063|    198|    for (i = 0; i < slot->sessHashSize; i++) {
  ------------------
  |  Branch (3063:17): [True: 192, False: 6]
  ------------------
 3064|    192|        PZLock *lock = SFTK_SESSION_LOCK(slot, i);
  ------------------
  |  |  185|    192|#define PZLock PRLock
  ------------------
                      PZLock *lock = SFTK_SESSION_LOCK(slot, i);
  ------------------
  |  |  583|    192|    ((slot)->sessionLock[(handle) & (slot)->sessionLockMask])
  ------------------
 3065|    195|        do {
 3066|    195|            SKIP_AFTER_FORK(PZ_Lock(lock));
  ------------------
  |  |  256|    195|#define SKIP_AFTER_FORK(x) x
  ------------------
 3067|    195|            session = slot->head[i];
 3068|       |            /* hand deque */
 3069|       |            /* this duplicates function of NSC_close session functions, but
 3070|       |             * because we know that we are freeing all the sessions, we can
 3071|       |             * do more efficient processing */
 3072|    195|            if (session) {
  ------------------
  |  Branch (3072:17): [True: 3, False: 192]
  ------------------
 3073|      3|                slot->head[i] = session->next;
 3074|      3|                if (session->next)
  ------------------
  |  Branch (3074:21): [True: 0, False: 3]
  ------------------
 3075|      0|                    session->next->prev = NULL;
 3076|      3|                session->next = session->prev = NULL;
 3077|      3|                SKIP_AFTER_FORK(PZ_Unlock(lock));
  ------------------
  |  |  256|      3|#define SKIP_AFTER_FORK(x) x
  ------------------
 3078|      3|                SKIP_AFTER_FORK(PZ_Lock(slot->slotLock));
  ------------------
  |  |  256|      3|#define SKIP_AFTER_FORK(x) x
  ------------------
 3079|      3|                --slot->sessionCount;
 3080|      3|                SKIP_AFTER_FORK(PZ_Unlock(slot->slotLock));
  ------------------
  |  |  256|      3|#define SKIP_AFTER_FORK(x) x
  ------------------
 3081|      3|                if (session->info.flags & CKF_RW_SESSION) {
  ------------------
  |  |  302|      3|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (3081:21): [True: 0, False: 3]
  ------------------
 3082|      0|                    (void)PR_ATOMIC_DECREMENT(&slot->rwSessionCount);
  ------------------
  |  |  123|      0|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
 3083|      0|                }
 3084|    192|            } else {
 3085|    192|                SKIP_AFTER_FORK(PZ_Unlock(lock));
  ------------------
  |  |  256|    192|#define SKIP_AFTER_FORK(x) x
  ------------------
 3086|    192|            }
 3087|    195|            if (session) {
  ------------------
  |  Branch (3087:17): [True: 3, False: 192]
  ------------------
 3088|      3|                sftk_DestroySession(session);
 3089|      3|            }
 3090|    195|        } while (session != NULL);
  ------------------
  |  Branch (3090:18): [True: 3, False: 192]
  ------------------
 3091|    192|    }
 3092|      6|    return CKR_OK;
  ------------------
  |  | 1388|      6|#define CKR_OK 0x00000000UL
  ------------------
 3093|      6|}
SFTK_ShutdownSlot:
 3126|      2|{
 3127|       |    /* make sure no new PK11 calls work except C_GetSlotInfo */
 3128|      2|    slot->present = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 3129|       |
 3130|       |    /* close all outstanding sessions
 3131|       |     * the sessHashSize variable guarentees we have all the session
 3132|       |     * mechanism set up */
 3133|      2|    if (slot->head) {
  ------------------
  |  Branch (3133:9): [True: 2, False: 0]
  ------------------
 3134|      2|        sftk_CloseAllSessions(slot, PR_TRUE);
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 3135|      2|    }
 3136|       |
 3137|       |    /* clear all objects.. session objects are cleared as a result of
 3138|       |     * closing all the sessions. We just need to clear the token object
 3139|       |     * cache. slot->tokObjHashTable guarentees we have the token
 3140|       |     * infrastructure set up. */
 3141|      2|    if (slot->tokObjHashTable) {
  ------------------
  |  Branch (3141:9): [True: 2, False: 0]
  ------------------
 3142|      2|        SFTK_ClearTokenKeyHashTable(slot);
 3143|      2|    }
 3144|       |
 3145|       |    /* clear the slot description for the next guy */
 3146|      2|    PORT_Memset(slot->tokDescription, 0, sizeof(slot->tokDescription));
  ------------------
  |  |  182|      2|#define PORT_Memset memset
  ------------------
 3147|       |
 3148|       |    /* now shut down the databases. */
 3149|      2|    sftk_DBShutdown(slot);
 3150|      2|    return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 3151|      2|}
SFTK_DestroySlotData:
 3158|      2|{
 3159|      2|    unsigned int i;
 3160|       |
 3161|      2|    SFTK_ShutdownSlot(slot);
 3162|       |
 3163|      2|    sftk_ClearSession(&slot->moduleObjects);
 3164|       |
 3165|      2|    if (slot->tokObjHashTable) {
  ------------------
  |  Branch (3165:9): [True: 2, False: 0]
  ------------------
 3166|      2|        PL_HashTableDestroy(slot->tokObjHashTable);
 3167|      2|        slot->tokObjHashTable = NULL;
 3168|      2|    }
 3169|       |
 3170|      2|    if (slot->sessObjHashTable) {
  ------------------
  |  Branch (3170:9): [True: 2, False: 0]
  ------------------
 3171|      2|        PORT_Free(slot->sessObjHashTable);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 3172|      2|        slot->sessObjHashTable = NULL;
 3173|      2|    }
 3174|      2|    slot->sessObjHashSize = 0;
 3175|       |
 3176|      2|    if (slot->head) {
  ------------------
  |  Branch (3176:9): [True: 2, False: 0]
  ------------------
 3177|      2|        PORT_Free(slot->head);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 3178|      2|        slot->head = NULL;
 3179|      2|    }
 3180|      2|    slot->sessHashSize = 0;
 3181|       |
 3182|       |    /* OK everything has been disassembled, now we can finally get rid
 3183|       |     * of the locks */
 3184|      2|    SKIP_AFTER_FORK(PZ_DestroyLock(slot->slotLock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
 3185|      2|    slot->slotLock = NULL;
 3186|      2|    if (slot->sessionLock) {
  ------------------
  |  Branch (3186:9): [True: 2, False: 0]
  ------------------
 3187|      4|        for (i = 0; i < slot->numSessionLocks; i++) {
  ------------------
  |  Branch (3187:21): [True: 2, False: 2]
  ------------------
 3188|      2|            if (slot->sessionLock[i]) {
  ------------------
  |  Branch (3188:17): [True: 2, False: 0]
  ------------------
 3189|      2|                SKIP_AFTER_FORK(PZ_DestroyLock(slot->sessionLock[i]));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
 3190|      2|                slot->sessionLock[i] = NULL;
 3191|      2|            }
 3192|      2|        }
 3193|      2|        PORT_Free(slot->sessionLock);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 3194|      2|        slot->sessionLock = NULL;
 3195|      2|    }
 3196|      2|    if (slot->objectLock) {
  ------------------
  |  Branch (3196:9): [True: 2, False: 0]
  ------------------
 3197|      2|        SKIP_AFTER_FORK(PZ_DestroyLock(slot->objectLock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
 3198|      2|        slot->objectLock = NULL;
 3199|      2|    }
 3200|      2|    if (slot->pwCheckLock) {
  ------------------
  |  Branch (3200:9): [True: 2, False: 0]
  ------------------
 3201|      2|        SKIP_AFTER_FORK(PR_DestroyLock(slot->pwCheckLock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
 3202|      2|        slot->pwCheckLock = NULL;
 3203|      2|    }
 3204|      2|    PORT_Free(slot);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 3205|      2|    return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 3206|      2|}
NSC_ModuleDBFunc:
 3213|      2|{
 3214|      2|#ifdef NSS_DISABLE_DBM
 3215|      2|    return NSSUTIL_DoModuleDBFunction(function, parameters, args);
 3216|       |#else
 3217|       |    char *secmod = NULL;
 3218|       |    char *appName = NULL;
 3219|       |    char *filename = NULL;
 3220|       |    NSSDBType dbType = NSS_DB_TYPE_NONE;
 3221|       |    PRBool rw;
 3222|       |    static char *success = "Success";
 3223|       |    char **rvstr = NULL;
 3224|       |
 3225|       |    rvstr = NSSUTIL_DoModuleDBFunction(function, parameters, args);
 3226|       |    if (rvstr != NULL) {
 3227|       |        return rvstr;
 3228|       |    }
 3229|       |
 3230|       |    if (PORT_GetError() != SEC_ERROR_LEGACY_DATABASE) {
 3231|       |        return NULL;
 3232|       |    }
 3233|       |
 3234|       |    /* The legacy database uses the old dbm, which is only linked with the
 3235|       |     * legacy DB handler, which is only callable from softoken */
 3236|       |
 3237|       |    secmod = _NSSUTIL_GetSecmodName(parameters, &dbType, &appName,
 3238|       |                                    &filename, &rw);
 3239|       |
 3240|       |    switch (function) {
 3241|       |        case SECMOD_MODULE_DB_FUNCTION_FIND:
 3242|       |            if (secmod == NULL) {
 3243|       |                PORT_SetError(SEC_ERROR_INVALID_ARGS);
 3244|       |                goto loser;
 3245|       |            }
 3246|       |            if (rw && (dbType != NSS_DB_TYPE_LEGACY) &&
 3247|       |                (dbType != NSS_DB_TYPE_MULTIACCESS)) {
 3248|       |                /* if we get here, we are trying to update the local database */
 3249|       |                /* force data from the legacy DB */
 3250|       |                char *oldSecmod = NULL;
 3251|       |                char *oldAppName = NULL;
 3252|       |                char *oldFilename = NULL;
 3253|       |                PRBool oldrw;
 3254|       |                char **strings = NULL;
 3255|       |                int i;
 3256|       |
 3257|       |                dbType = NSS_DB_TYPE_LEGACY;
 3258|       |                oldSecmod = _NSSUTIL_GetSecmodName(parameters, &dbType, &oldAppName,
 3259|       |                                                   &oldFilename, &oldrw);
 3260|       |                strings = sftkdbCall_ReadSecmodDB(appName, oldFilename, oldSecmod,
 3261|       |                                                  (char *)parameters, oldrw);
 3262|       |                if (strings) {
 3263|       |                    /* write out the strings */
 3264|       |                    for (i = 0; strings[i]; i++) {
 3265|       |                        NSSUTIL_DoModuleDBFunction(SECMOD_MODULE_DB_FUNCTION_ADD,
 3266|       |                                                   parameters, strings[i]);
 3267|       |                    }
 3268|       |                    sftkdbCall_ReleaseSecmodDBData(oldAppName, oldFilename, oldSecmod,
 3269|       |                                                   (char **)strings, oldrw);
 3270|       |                } else {
 3271|       |                    /* write out a dummy record */
 3272|       |                    NSSUTIL_DoModuleDBFunction(SECMOD_MODULE_DB_FUNCTION_ADD,
 3273|       |                                               parameters, " ");
 3274|       |                }
 3275|       |                if (oldSecmod) {
 3276|       |                    PR_smprintf_free(oldSecmod);
 3277|       |                }
 3278|       |                if (oldAppName) {
 3279|       |                    PORT_Free(oldAppName);
 3280|       |                }
 3281|       |                if (oldFilename) {
 3282|       |                    PORT_Free(oldFilename);
 3283|       |                }
 3284|       |                rvstr = NSSUTIL_DoModuleDBFunction(function, parameters, args);
 3285|       |                break;
 3286|       |            }
 3287|       |            rvstr = sftkdbCall_ReadSecmodDB(appName, filename, secmod,
 3288|       |                                            (char *)parameters, rw);
 3289|       |            break;
 3290|       |        case SECMOD_MODULE_DB_FUNCTION_ADD:
 3291|       |            if (secmod == NULL) {
 3292|       |                PORT_SetError(SEC_ERROR_INVALID_ARGS);
 3293|       |                goto loser;
 3294|       |            }
 3295|       |            rvstr = (sftkdbCall_AddSecmodDB(appName, filename, secmod,
 3296|       |                                            (char *)args, rw) == SECSuccess)
 3297|       |                        ? &success
 3298|       |                        : NULL;
 3299|       |            break;
 3300|       |        case SECMOD_MODULE_DB_FUNCTION_DEL:
 3301|       |            if (secmod == NULL) {
 3302|       |                PORT_SetError(SEC_ERROR_INVALID_ARGS);
 3303|       |                goto loser;
 3304|       |            }
 3305|       |            rvstr = (sftkdbCall_DeleteSecmodDB(appName, filename, secmod,
 3306|       |                                               (char *)args, rw) == SECSuccess)
 3307|       |                        ? &success
 3308|       |                        : NULL;
 3309|       |            break;
 3310|       |        case SECMOD_MODULE_DB_FUNCTION_RELEASE:
 3311|       |            rvstr = (sftkdbCall_ReleaseSecmodDBData(appName, filename, secmod,
 3312|       |                                                    (char **)args, rw) == SECSuccess)
 3313|       |                        ? &success
 3314|       |                        : NULL;
 3315|       |            break;
 3316|       |    }
 3317|       |
 3318|       |loser:
 3319|       |    if (secmod)
 3320|       |        PR_smprintf_free(secmod);
 3321|       |    if (appName)
 3322|       |        PORT_Free(appName);
 3323|       |    if (filename)
 3324|       |        PORT_Free(filename);
 3325|       |    return rvstr;
 3326|       |#endif /* NSS_DISABLE_DBM */
 3327|      2|}
nsc_CommonInitialize:
 3467|      1|{
 3468|      1|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
 3469|      1|    SECStatus rv;
 3470|      1|    CK_C_INITIALIZE_ARGS *init_args = (CK_C_INITIALIZE_ARGS *)pReserved;
 3471|      1|    PRBool destroy_freelist_on_error = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 3472|      1|    int i;
 3473|      1|    unsigned int moduleIndex = isFIPS ? NSC_FIPS_MODULE : NSC_NON_FIPS_MODULE;
  ------------------
  |  |   54|      0|#define NSC_FIPS_MODULE 1
  ------------------
                  unsigned int moduleIndex = isFIPS ? NSC_FIPS_MODULE : NSC_NON_FIPS_MODULE;
  ------------------
  |  |   55|      2|#define NSC_NON_FIPS_MODULE 0
  ------------------
  |  Branch (3473:32): [True: 0, False: 1]
  ------------------
 3474|       |
 3475|      1|    if (isFIPS) {
  ------------------
  |  Branch (3475:9): [True: 0, False: 1]
  ------------------
 3476|      0|        loginWaitTime = PR_SecondsToInterval(1);
 3477|      0|    }
 3478|       |
 3479|      1|    ENABLE_FORK_CHECK();
 3480|       |
 3481|      1|    sftk_PBELockInit();
 3482|       |
 3483|      1|    rv = SECOID_Init();
 3484|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3484:9): [True: 0, False: 1]
  ------------------
 3485|      0|        crv = CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
 3486|      0|        return crv;
 3487|      0|    }
 3488|       |
 3489|      1|    rv = BL_Init(); /* initialize freebl engine */
 3490|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3490:9): [True: 0, False: 1]
  ------------------
 3491|      0|        crv = CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
 3492|      0|        return crv;
 3493|      0|    }
 3494|       |
 3495|      1|    rv = RNG_RNGInit(); /* initialize random number generator */
 3496|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3496:9): [True: 0, False: 1]
  ------------------
 3497|      0|        crv = CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
 3498|      0|        return crv;
 3499|      0|    }
 3500|       |
 3501|       |    /* NOTE:
 3502|       |     * we should be getting out mutexes from this list, not statically binding
 3503|       |     * them from NSPR. This should happen before we allow the internal to split
 3504|       |     * off from the rest on NSS.
 3505|       |     */
 3506|       |
 3507|       |    /* initialize the key and cert db's */
 3508|      1|    if (init_args && (!(init_args->flags & CKF_OS_LOCKING_OK))) {
  ------------------
  |  | 1627|      1|#define CKF_OS_LOCKING_OK 0x00000002UL
  ------------------
  |  Branch (3508:9): [True: 1, False: 0]
  |  Branch (3508:22): [True: 0, False: 1]
  ------------------
 3509|      0|        if (init_args->CreateMutex && init_args->DestroyMutex &&
  ------------------
  |  Branch (3509:13): [True: 0, False: 0]
  |  Branch (3509:39): [True: 0, False: 0]
  ------------------
 3510|      0|            init_args->LockMutex && init_args->UnlockMutex) {
  ------------------
  |  Branch (3510:13): [True: 0, False: 0]
  |  Branch (3510:37): [True: 0, False: 0]
  ------------------
 3511|       |            /* softoken always uses NSPR (ie. OS locking), and doesn't know how
 3512|       |             * to use the lock functions provided by the application.
 3513|       |             */
 3514|      0|            crv = CKR_CANT_LOCK;
  ------------------
  |  | 1404|      0|#define CKR_CANT_LOCK 0x0000000AUL
  ------------------
 3515|      0|            return crv;
 3516|      0|        }
 3517|      0|        if (init_args->CreateMutex || init_args->DestroyMutex ||
  ------------------
  |  Branch (3517:13): [True: 0, False: 0]
  |  Branch (3517:39): [True: 0, False: 0]
  ------------------
 3518|      0|            init_args->LockMutex || init_args->UnlockMutex) {
  ------------------
  |  Branch (3518:13): [True: 0, False: 0]
  |  Branch (3518:37): [True: 0, False: 0]
  ------------------
 3519|       |            /* only some of the lock functions were provided by the
 3520|       |             * application. This is invalid per PKCS#11 spec.
 3521|       |             */
 3522|      0|            crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 3523|      0|            return crv;
 3524|      0|        }
 3525|      0|    }
 3526|       |
 3527|      1|    sftk_parameters paramStrings;
 3528|       |
 3529|       |    /* load and parse the library parameters */
 3530|      1|    crv = sftk_getParameters(init_args, isFIPS, &paramStrings);
 3531|      1|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3531:9): [True: 0, False: 1]
  ------------------
 3532|      0|        goto loser;
 3533|      0|    }
 3534|       |
 3535|      1|    crv = sftk_configure(paramStrings.man, paramStrings.libdes);
 3536|      1|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3536:9): [True: 0, False: 1]
  ------------------
 3537|      0|        goto loser;
 3538|      0|    }
 3539|       |
 3540|       |    /* if we have a peer already open, have him close his DB's so we
 3541|       |     * don't clobber each other. */
 3542|      1|    if ((isFIPS && nsc_init) || (!isFIPS && nsf_init)) {
  ------------------
  |  Branch (3542:10): [True: 0, False: 1]
  |  Branch (3542:20): [True: 0, False: 0]
  |  Branch (3542:34): [True: 1, False: 0]
  |  Branch (3542:45): [True: 0, False: 1]
  ------------------
 3543|      0|        sftk_closePeer(isFIPS);
 3544|      0|        if (sftk_audit_enabled) {
  ------------------
  |  Branch (3544:13): [True: 0, False: 0]
  ------------------
 3545|      0|            if (isFIPS && nsc_init) {
  ------------------
  |  Branch (3545:17): [True: 0, False: 0]
  |  Branch (3545:27): [True: 0, False: 0]
  ------------------
 3546|      0|                sftk_LogAuditMessage(NSS_AUDIT_INFO, NSS_AUDIT_FIPS_STATE,
 3547|      0|                                     "enabled FIPS mode");
 3548|      0|            } else {
 3549|      0|                sftk_LogAuditMessage(NSS_AUDIT_INFO, NSS_AUDIT_FIPS_STATE,
 3550|      0|                                     "disabled FIPS mode");
 3551|      0|            }
 3552|      0|        }
 3553|       |        /* if we have a peer open, we don't want to destroy the freelist
 3554|       |         * from under the peer if we fail, the free list will be
 3555|       |         * destroyed in that case when the C_Finalize is called for
 3556|       |         * the peer */
 3557|      0|        destroy_freelist_on_error = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 3558|      0|    }
 3559|       |    /* allow us to create objects in SFTK_SlotInit */
 3560|      1|    sftk_InitFreeLists();
 3561|       |
 3562|      3|    for (i = 0; i < paramStrings.token_count; i++) {
  ------------------
  |  Branch (3562:17): [True: 2, False: 1]
  ------------------
 3563|      2|        crv = SFTK_SlotInit(paramStrings.configdir,
 3564|      2|                            paramStrings.updatedir, paramStrings.updateID,
 3565|      2|                            &paramStrings.tokens[i], moduleIndex);
 3566|      2|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3566:13): [True: 0, False: 2]
  ------------------
 3567|      0|            nscFreeAllSlots(moduleIndex);
 3568|      0|            break;
 3569|      0|        }
 3570|      2|    }
 3571|       |
 3572|      1|loser:
 3573|       |
 3574|      1|    sftk_freeParams(&paramStrings);
 3575|       |
 3576|      1|    if (destroy_freelist_on_error && (CKR_OK != crv)) {
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3576:9): [True: 1, False: 0]
  |  Branch (3576:38): [True: 0, False: 1]
  ------------------
 3577|       |        /* idempotent. If the list are already freed, this is a noop */
 3578|      0|        sftk_CleanupFreeLists();
 3579|      0|    }
 3580|       |
 3581|       |#ifndef NO_FORK_CHECK
 3582|       |    if (CKR_OK == crv) {
 3583|       |#if defined(CHECK_FORK_MIXED)
 3584|       |        /* Before Solaris 10, fork handlers are not unregistered at dlclose()
 3585|       |         * time. So, we only use pthread_atfork on Solaris 10 and later. For
 3586|       |         * earlier versions, we use PID checks.
 3587|       |         */
 3588|       |        char buf[200];
 3589|       |        int major = 0, minor = 0;
 3590|       |
 3591|       |        long rv = sysinfo(SI_RELEASE, buf, sizeof(buf));
 3592|       |        if (rv > 0 && rv < sizeof(buf)) {
 3593|       |            if (2 == sscanf(buf, "%d.%d", &major, &minor)) {
 3594|       |                /* Are we on Solaris 10 or greater ? */
 3595|       |                if (major > 5 || (5 == major && minor >= 10)) {
 3596|       |                    /* we are safe to use pthread_atfork */
 3597|       |                    usePthread_atfork = PR_TRUE;
 3598|       |                }
 3599|       |            }
 3600|       |        }
 3601|       |        if (usePthread_atfork) {
 3602|       |            pthread_atfork(NULL, NULL, ForkedChild);
 3603|       |        } else {
 3604|       |            myPid = getpid();
 3605|       |        }
 3606|       |
 3607|       |#elif defined(CHECK_FORK_PTHREAD)
 3608|       |        pthread_atfork(NULL, NULL, ForkedChild);
 3609|       |#elif defined(CHECK_FORK_GETPID)
 3610|       |        myPid = getpid();
 3611|       |#else
 3612|       |#error Incorrect fork check method.
 3613|       |#endif
 3614|       |    }
 3615|       |#endif
 3616|      1|    return crv;
 3617|      1|}
NSC_Initialize:
 3621|      1|{
 3622|      1|    CK_RV crv;
 3623|       |
 3624|      1|    sftk_ForkReset(pReserved, &crv);
 3625|       |
 3626|      1|    if (nsc_init) {
  ------------------
  |  Branch (3626:9): [True: 0, False: 1]
  ------------------
 3627|      0|        return CKR_CRYPTOKI_ALREADY_INITIALIZED;
  ------------------
  |  | 1521|      0|#define CKR_CRYPTOKI_ALREADY_INITIALIZED 0x00000191UL
  ------------------
 3628|      0|    }
 3629|      1|    crv = nsc_CommonInitialize(pReserved, PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 3630|      1|    nsc_init = (PRBool)(crv == CKR_OK);
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
 3631|      1|    return crv;
 3632|      1|}
nsc_CommonFinalize:
 3638|      1|{
 3639|       |    /* propagate the fork status to freebl and util */
 3640|      1|    BL_SetForkState(parentForkedAfterC_Initialize);
 3641|      1|    UTIL_SetForkState(parentForkedAfterC_Initialize);
 3642|       |
 3643|      1|    nscFreeAllSlots(isFIPS ? NSC_FIPS_MODULE : NSC_NON_FIPS_MODULE);
  ------------------
  |  |   54|      0|#define NSC_FIPS_MODULE 1
  ------------------
                  nscFreeAllSlots(isFIPS ? NSC_FIPS_MODULE : NSC_NON_FIPS_MODULE);
  ------------------
  |  |   55|      2|#define NSC_NON_FIPS_MODULE 0
  ------------------
  |  Branch (3643:21): [True: 0, False: 1]
  ------------------
 3644|       |
 3645|       |    /* don't muck with the globals if our peer is still initialized */
 3646|      1|    if (isFIPS && nsc_init) {
  ------------------
  |  Branch (3646:9): [True: 0, False: 1]
  |  Branch (3646:19): [True: 0, False: 0]
  ------------------
 3647|      0|        return CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
 3648|      0|    }
 3649|      1|    if (!isFIPS && nsf_init) {
  ------------------
  |  Branch (3649:9): [True: 1, False: 0]
  |  Branch (3649:20): [True: 0, False: 1]
  ------------------
 3650|      0|        return CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
 3651|      0|    }
 3652|       |
 3653|      1|    sftk_CleanupFreeLists();
 3654|      1|    sftkdb_Shutdown();
 3655|       |
 3656|       |    /* This function does not discard all our previously aquired entropy. */
 3657|      1|    RNG_RNGShutdown();
 3658|       |
 3659|       |    /* tell freeBL to clean up after itself */
 3660|      1|    BL_Cleanup();
 3661|       |
 3662|       |    /* reset fork status in freebl. We must do this before BL_Unload so that
 3663|       |     * this call doesn't force freebl to be reloaded. */
 3664|      1|    BL_SetForkState(PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 3665|       |
 3666|       |#ifndef NSS_STATIC_SOFTOKEN
 3667|       |    /* unload freeBL shared library from memory. This may only decrement the
 3668|       |     * OS refcount if it's been loaded multiple times, eg. by libssl */
 3669|       |    BL_Unload();
 3670|       |#endif
 3671|       |
 3672|       |    /* clean up the default OID table */
 3673|      1|    SECOID_Shutdown();
 3674|       |
 3675|      1|    sftk_PBELockShutdown();
 3676|       |
 3677|       |    /* reset fork status in util */
 3678|      1|    UTIL_SetForkState(PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 3679|       |
 3680|      1|    nsc_init = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 3681|       |
 3682|       |#ifndef NO_FORK_CHECK
 3683|       |#ifdef CHECK_FORK_MIXED
 3684|       |    if (!usePthread_atfork) {
 3685|       |        myPid = 0; /* allow CHECK_FORK in the next softoken initialization to
 3686|       |                    * succeed */
 3687|       |    } else {
 3688|       |        forked = PR_FALSE; /* allow reinitialization */
 3689|       |    }
 3690|       |#elif defined(CHECK_FORK_GETPID)
 3691|       |    myPid = 0; /* allow reinitialization */
 3692|       |#elif defined(CHECK_FORK_PTHREAD)
 3693|       |    forked = PR_FALSE; /* allow reinitialization */
 3694|       |#endif
 3695|       |#endif
 3696|      1|    return CKR_OK;
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
 3697|      1|}
sftk_ForkReset:
 3703|      2|{
 3704|       |#ifndef NO_FORK_CHECK
 3705|       |    if (PARENT_FORKED()) {
 3706|       |        parentForkedAfterC_Initialize = PR_TRUE;
 3707|       |        if (nsc_init) {
 3708|       |            /* finalize non-FIPS token */
 3709|       |            *crv = nsc_CommonFinalize(pReserved, PR_FALSE);
 3710|       |            PORT_Assert(CKR_OK == *crv);
 3711|       |            nsc_init = (PRBool) !(*crv == CKR_OK);
 3712|       |        }
 3713|       |        if (nsf_init) {
 3714|       |            /* finalize FIPS token */
 3715|       |            *crv = nsc_CommonFinalize(pReserved, PR_TRUE);
 3716|       |            PORT_Assert(CKR_OK == *crv);
 3717|       |            nsf_init = (PRBool) !(*crv == CKR_OK);
 3718|       |        }
 3719|       |        parentForkedAfterC_Initialize = PR_FALSE;
 3720|       |        return PR_TRUE;
 3721|       |    }
 3722|       |#endif
 3723|      2|    return PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 3724|      2|}
NSC_Finalize:
 3730|      1|{
 3731|      1|    CK_RV crv;
 3732|       |
 3733|       |    /* reset entire PKCS#11 module upon fork */
 3734|      1|    if (sftk_ForkReset(pReserved, &crv)) {
  ------------------
  |  Branch (3734:9): [True: 0, False: 1]
  ------------------
 3735|      0|        return crv;
 3736|      0|    }
 3737|       |
 3738|      1|    if (!nsc_init) {
  ------------------
  |  Branch (3738:9): [True: 0, False: 1]
  ------------------
 3739|      0|        return CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
 3740|      0|    }
 3741|       |
 3742|      1|    crv = nsc_CommonFinalize(pReserved, PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 3743|       |
 3744|      1|    nsc_init = (PRBool) !(crv == CKR_OK);
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
 3745|       |
 3746|      1|    return crv;
 3747|      1|}
NSC_GetInfo:
 3754|      1|{
 3755|      1|#define NSS_VERSION_VARIABLE __nss_softokn_version
 3756|      1|#include "verref.h"
  ------------------
  |  |    1|       |/* This Source Code Form is subject to the terms of the Mozilla Public
  |  |    2|       | * License, v. 2.0. If a copy of the MPL was not distributed with this
  |  |    3|       | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  |  |    4|       |
  |  |    5|       |/* This header is used inline in a function to ensure that a version string
  |  |    6|       | * symbol is linked in and not optimized out. A volatile reference is added to
  |  |    7|       | * the variable identified by NSS_VERSION_VARIABLE.
  |  |    8|       | *
  |  |    9|       | * Use this as follows:
  |  |   10|       | *
  |  |   11|       | * #define NSS_VERSION_VARIABLE __nss_ssl_version
  |  |   12|       | * #include "verref.h"
  |  |   13|       | */
  |  |   14|       |
  |  |   15|       |/* Suppress unused variable warnings. */
  |  |   16|       |#ifdef _MSC_VER
  |  |   17|       |#pragma warning(push)
  |  |   18|       |#pragma warning(disable : 4101)
  |  |   19|       |#endif
  |  |   20|       |/* This works for both gcc and clang */
  |  |   21|      1|#if defined(__GNUC__) && !defined(NSS_NO_GCC48)
  |  |   22|      1|#pragma GCC diagnostic push
  |  |   23|      1|#pragma GCC diagnostic ignored "-Wunused-variable"
  |  |   24|      1|#endif
  |  |   25|       |
  |  |   26|       |#ifndef NSS_VERSION_VARIABLE
  |  |   27|       |#error NSS_VERSION_VARIABLE must be set before including "verref.h"
  |  |   28|       |#endif
  |  |   29|      1|{
  |  |   30|      1|    extern const char NSS_VERSION_VARIABLE[];
  |  |   31|      1|#if defined(__GNUC__) || defined(__clang__)
  |  |   32|      1|    __attribute__((unused))
  |  |   33|      1|#endif
  |  |   34|      1|    volatile const char _nss_version_c = NSS_VERSION_VARIABLE[0];
  |  |  ------------------
  |  |  |  | 3755|      1|#define NSS_VERSION_VARIABLE __nss_softokn_version
  |  |  ------------------
  |  |   35|      1|}
  |  |   36|      1|#undef NSS_VERSION_VARIABLE
  |  |   37|       |
  |  |   38|       |#ifdef _MSC_VER
  |  |   39|       |#pragma warning(pop)
  |  |   40|       |#endif
  |  |   41|      1|#if defined(__GNUC__) && !defined(NSS_NO_GCC48)
  |  |   42|      1|#pragma GCC diagnostic pop
  |  |   43|      1|#endif
  ------------------
 3757|       |
 3758|      1|    CHECK_FORK();
 3759|       |
 3760|      1|    pInfo->cryptokiVersion.major = CRYPTOKI_VERSION_MAJOR;
  ------------------
  |  |   37|      1|#define CRYPTOKI_VERSION_MAJOR 3
  ------------------
 3761|      1|    pInfo->cryptokiVersion.minor = CRYPTOKI_VERSION_MINOR;
  ------------------
  |  |   38|      1|#define CRYPTOKI_VERSION_MINOR 1
  ------------------
 3762|      1|    PORT_Memcpy(pInfo->manufacturerID, manufacturerID, 32);
  ------------------
  |  |  180|      1|#define PORT_Memcpy memcpy
  ------------------
 3763|      1|    pInfo->libraryVersion.major = SOFTOKEN_VMAJOR;
  ------------------
  |  |   21|      1|#define SOFTOKEN_VMAJOR 3
  ------------------
 3764|      1|    pInfo->libraryVersion.minor = SOFTOKEN_VMINOR;
  ------------------
  |  |   22|      1|#define SOFTOKEN_VMINOR 111
  ------------------
 3765|      1|    PORT_Memcpy(pInfo->libraryDescription, libraryDescription, 32);
  ------------------
  |  |  180|      1|#define PORT_Memcpy memcpy
  ------------------
 3766|      1|    pInfo->flags = 0;
 3767|      1|    return CKR_OK;
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
 3768|      1|}
nsc_CommonGetSlotList:
 3791|      2|{
 3792|      2|    *pulCount = nscSlotCount[moduleIndex];
 3793|      2|    if (pSlotList != NULL) {
  ------------------
  |  Branch (3793:9): [True: 1, False: 1]
  ------------------
 3794|      1|        PORT_Memcpy(pSlotList, nscSlotList[moduleIndex],
  ------------------
  |  |  180|      1|#define PORT_Memcpy memcpy
  ------------------
 3795|      1|                    nscSlotCount[moduleIndex] * sizeof(CK_SLOT_ID));
 3796|      1|    }
 3797|      2|    return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 3798|      2|}
NSC_GetSlotList:
 3804|      2|{
 3805|      2|    CHECK_FORK();
 3806|      2|    return nsc_CommonGetSlotList(tokenPresent, pSlotList, pulCount,
 3807|      2|                                 NSC_NON_FIPS_MODULE);
  ------------------
  |  |   55|      2|#define NSC_NON_FIPS_MODULE 0
  ------------------
 3808|      2|}
NSC_GetSlotInfo:
 3813|      2|{
 3814|      2|    SFTKSlot *slot = sftk_SlotFromID(slotID, PR_TRUE);
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 3815|       |
 3816|      2|    CHECK_FORK();
 3817|       |
 3818|      2|    if (slot == NULL)
  ------------------
  |  Branch (3818:9): [True: 0, False: 2]
  ------------------
 3819|      0|        return CKR_SLOT_ID_INVALID;
  ------------------
  |  | 1391|      0|#define CKR_SLOT_ID_INVALID 0x00000003UL
  ------------------
 3820|       |
 3821|      2|    PORT_Memcpy(pInfo->manufacturerID, manufacturerID,
  ------------------
  |  |  180|      2|#define PORT_Memcpy memcpy
  ------------------
 3822|      2|                sizeof(pInfo->manufacturerID));
 3823|      2|    PORT_Memcpy(pInfo->slotDescription, slot->slotDescription,
  ------------------
  |  |  180|      2|#define PORT_Memcpy memcpy
  ------------------
 3824|      2|                sizeof(pInfo->slotDescription));
 3825|      2|    pInfo->flags = (slot->present) ? CKF_TOKEN_PRESENT : 0;
  ------------------
  |  |  131|      2|#define CKF_TOKEN_PRESENT 0x00000001UL    /* a token is there */
  ------------------
  |  Branch (3825:20): [True: 2, False: 0]
  ------------------
 3826|       |
 3827|       |    /* all user defined slots are defined as removable */
 3828|      2|    if (slotID >= SFTK_MIN_USER_SLOT_ID) {
  ------------------
  |  |  565|      2|#define SFTK_MIN_USER_SLOT_ID 4
  ------------------
  |  Branch (3828:9): [True: 0, False: 2]
  ------------------
 3829|      0|        pInfo->flags |= CKF_REMOVABLE_DEVICE;
  ------------------
  |  |  132|      0|#define CKF_REMOVABLE_DEVICE 0x00000002UL /* removable devices*/
  ------------------
 3830|      2|    } else {
 3831|       |        /* In the case where we are doing a merge update, we need
 3832|       |         * the DB slot to be removable so the token name can change
 3833|       |         * appropriately. */
 3834|      2|        SFTKDBHandle *handle = sftk_getKeyDB(slot);
 3835|      2|        if (handle) {
  ------------------
  |  Branch (3835:13): [True: 0, False: 2]
  ------------------
 3836|      0|            if (sftkdb_InUpdateMerge(handle)) {
  ------------------
  |  Branch (3836:17): [True: 0, False: 0]
  ------------------
 3837|      0|                pInfo->flags |= CKF_REMOVABLE_DEVICE;
  ------------------
  |  |  132|      0|#define CKF_REMOVABLE_DEVICE 0x00000002UL /* removable devices*/
  ------------------
 3838|      0|            }
 3839|      0|            sftk_freeDB(handle);
 3840|      0|        }
 3841|      2|    }
 3842|       |
 3843|       |    /* If there is no key database, this is for example the case when NSS was
 3844|       |     * initialized with NSS_NoDbInit(), then there won't be any point in
 3845|       |     * requesting a PIN. Set the CKF_USER_PIN_INITIALIZED bit so that
 3846|       |     * PK11_NeedUserInit() doesn't indicate that a PIN is needed.
 3847|       |     */
 3848|      2|    if (slot->keyDB == NULL) {
  ------------------
  |  Branch (3848:9): [True: 2, False: 0]
  ------------------
 3849|      2|        pInfo->flags |= CKF_USER_PIN_INITIALIZED;
  ------------------
  |  |  178|      2|#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's \
  ------------------
 3850|      2|    }
 3851|       |
 3852|       |    /* ok we really should read it out of the keydb file. */
 3853|       |    /* pInfo->hardwareVersion.major = NSSLOWKEY_DB_FILE_VERSION; */
 3854|      2|    pInfo->hardwareVersion.major = SOFTOKEN_VMAJOR;
  ------------------
  |  |   21|      2|#define SOFTOKEN_VMAJOR 3
  ------------------
 3855|      2|    pInfo->hardwareVersion.minor = SOFTOKEN_VMINOR;
  ------------------
  |  |   22|      2|#define SOFTOKEN_VMINOR 111
  ------------------
 3856|      2|    pInfo->firmwareVersion.major = SOFTOKEN_VPATCH;
  ------------------
  |  |   23|      2|#define SOFTOKEN_VPATCH 0
  ------------------
 3857|      2|    pInfo->firmwareVersion.minor = SOFTOKEN_VBUILD;
  ------------------
  |  |   24|      2|#define SOFTOKEN_VBUILD 0
  ------------------
 3858|      2|    return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 3859|      2|}
NSC_GetTokenInfo:
 3898|      2|{
 3899|      2|    SFTKSlot *slot;
 3900|      2|    SFTKDBHandle *handle;
 3901|       |
 3902|      2|    CHECK_FORK();
 3903|       |
 3904|      2|    if (!nsc_init && !nsf_init)
  ------------------
  |  Branch (3904:9): [True: 0, False: 2]
  |  Branch (3904:22): [True: 0, False: 0]
  ------------------
 3905|      0|        return CKR_CRYPTOKI_NOT_INITIALIZED;
  ------------------
  |  | 1520|      0|#define CKR_CRYPTOKI_NOT_INITIALIZED 0x00000190UL
  ------------------
 3906|      2|    slot = sftk_SlotFromID(slotID, PR_FALSE);
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 3907|      2|    if (slot == NULL)
  ------------------
  |  Branch (3907:9): [True: 0, False: 2]
  ------------------
 3908|      0|        return CKR_SLOT_ID_INVALID;
  ------------------
  |  | 1391|      0|#define CKR_SLOT_ID_INVALID 0x00000003UL
  ------------------
 3909|       |
 3910|      2|    PORT_Memcpy(pInfo->manufacturerID, manufacturerID, 32);
  ------------------
  |  |  180|      2|#define PORT_Memcpy memcpy
  ------------------
 3911|      2|    PORT_Memcpy(pInfo->model, "NSS 3           ", 16);
  ------------------
  |  |  180|      2|#define PORT_Memcpy memcpy
  ------------------
 3912|      2|    PORT_Memcpy(pInfo->serialNumber, "0000000000000000", 16);
  ------------------
  |  |  180|      2|#define PORT_Memcpy memcpy
  ------------------
 3913|      2|    PORT_Memcpy(pInfo->utcTime, "0000000000000000", 16);
  ------------------
  |  |  180|      2|#define PORT_Memcpy memcpy
  ------------------
 3914|      2|    pInfo->ulMaxSessionCount = 0;   /* arbitrarily large */
 3915|      2|    pInfo->ulMaxRwSessionCount = 0; /* arbitarily large */
 3916|      2|    PZ_Lock(slot->slotLock);        /* Protect sessionCount / rwSessioncount */
  ------------------
  |  |  245|      2|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 3917|      2|    pInfo->ulSessionCount = slot->sessionCount;
 3918|      2|    pInfo->ulRwSessionCount = slot->rwSessionCount;
 3919|      2|    PZ_Unlock(slot->slotLock); /* Unlock before sftk_getKeyDB */
  ------------------
  |  |  246|      2|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 3920|      2|    pInfo->firmwareVersion.major = 0;
 3921|      2|    pInfo->firmwareVersion.minor = 0;
 3922|      2|    PORT_Memcpy(pInfo->label, slot->tokDescription, sizeof(pInfo->label));
  ------------------
  |  |  180|      2|#define PORT_Memcpy memcpy
  ------------------
 3923|      2|    handle = sftk_getKeyDB(slot);
 3924|      2|    pInfo->flags = CKF_RNG | CKF_DUAL_CRYPTO_OPERATIONS;
  ------------------
  |  |  171|      2|#define CKF_RNG 0x00000001UL                  /* has random # \
  ------------------
                  pInfo->flags = CKF_RNG | CKF_DUAL_CRYPTO_OPERATIONS;
  ------------------
  |  |  202|      2|#define CKF_DUAL_CRYPTO_OPERATIONS 0x00000200UL
  ------------------
 3925|      2|    if (handle == NULL) {
  ------------------
  |  Branch (3925:9): [True: 2, False: 0]
  ------------------
 3926|      2|        pInfo->flags |= CKF_WRITE_PROTECTED;
  ------------------
  |  |  173|      2|#define CKF_WRITE_PROTECTED 0x00000002UL      /* token is \
  ------------------
 3927|      2|        pInfo->ulMaxPinLen = 0;
 3928|      2|        pInfo->ulMinPinLen = 0;
 3929|      2|        pInfo->ulTotalPublicMemory = 0;
 3930|      2|        pInfo->ulFreePublicMemory = 0;
 3931|      2|        pInfo->ulTotalPrivateMemory = 0;
 3932|      2|        pInfo->ulFreePrivateMemory = 0;
 3933|      2|        pInfo->hardwareVersion.major = 4;
 3934|      2|        pInfo->hardwareVersion.minor = 0;
 3935|      2|    } else {
 3936|       |        /*
 3937|       |         * we have three possible states which we may be in:
 3938|       |         *   (1) No DB password has been initialized. This also means we
 3939|       |         *   have no keys in the key db.
 3940|       |         *   (2) Password initialized to NULL. This means we have keys, but
 3941|       |         *   the user has chosen not use a password.
 3942|       |         *   (3) Finally we have an initialized password whicn is not NULL, and
 3943|       |         *   we will need to prompt for it.
 3944|       |         */
 3945|      0|        if (sftkdb_HasPasswordSet(handle) == SECFailure) {
  ------------------
  |  Branch (3945:13): [True: 0, False: 0]
  ------------------
 3946|      0|            pInfo->flags |= CKF_LOGIN_REQUIRED;
  ------------------
  |  |  176|      0|#define CKF_LOGIN_REQUIRED 0x00000004UL       /* user must \
  ------------------
 3947|      0|        } else if (!sftk_checkNeedLogin(slot, handle)) {
  ------------------
  |  Branch (3947:20): [True: 0, False: 0]
  ------------------
 3948|      0|            pInfo->flags |= CKF_USER_PIN_INITIALIZED;
  ------------------
  |  |  178|      0|#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's \
  ------------------
 3949|      0|        } else {
 3950|      0|            pInfo->flags |= CKF_LOGIN_REQUIRED | CKF_USER_PIN_INITIALIZED;
  ------------------
  |  |  176|      0|#define CKF_LOGIN_REQUIRED 0x00000004UL       /* user must \
  ------------------
                          pInfo->flags |= CKF_LOGIN_REQUIRED | CKF_USER_PIN_INITIALIZED;
  ------------------
  |  |  178|      0|#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's \
  ------------------
 3951|       |            /*
 3952|       |             * if we are doing a merge style update, and we need to get the password
 3953|       |             * of our source database (the database we are updating from), make sure we
 3954|       |             * return a token name that will match the database we are prompting for.
 3955|       |             */
 3956|      0|            if (sftkdb_NeedUpdateDBPassword(handle)) {
  ------------------
  |  Branch (3956:17): [True: 0, False: 0]
  ------------------
 3957|       |                /* if we have an update tok description, use it. otherwise
 3958|       |                 * use the updateID for this database */
 3959|      0|                if (!sftk_isBlank(slot->updateTokDescription,
  ------------------
  |  Branch (3959:21): [True: 0, False: 0]
  ------------------
 3960|      0|                                  sizeof(pInfo->label))) {
 3961|      0|                    PORT_Memcpy(pInfo->label, slot->updateTokDescription,
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 3962|      0|                                sizeof(pInfo->label));
 3963|      0|                } else {
 3964|       |                    /* build from updateID */
 3965|      0|                    const char *updateID = sftkdb_GetUpdateID(handle);
 3966|      0|                    if (updateID) {
  ------------------
  |  Branch (3966:25): [True: 0, False: 0]
  ------------------
 3967|      0|                        sftk_setStringName(updateID, (char *)pInfo->label,
 3968|      0|                                           sizeof(pInfo->label), PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 3969|      0|                    }
 3970|      0|                }
 3971|      0|            }
 3972|      0|        }
 3973|      0|        pInfo->ulMaxPinLen = SFTK_MAX_PIN;
  ------------------
  |  |  493|      0|#define SFTK_MAX_PIN 500
  ------------------
 3974|      0|        pInfo->ulMinPinLen = (CK_ULONG)slot->minimumPinLen;
 3975|      0|        pInfo->ulTotalPublicMemory = 1;
 3976|      0|        pInfo->ulFreePublicMemory = 1;
 3977|      0|        pInfo->ulTotalPrivateMemory = 1;
 3978|      0|        pInfo->ulFreePrivateMemory = 1;
 3979|       |#ifdef SHDB_FIXME
 3980|       |        pInfo->hardwareVersion.major = CERT_DB_FILE_VERSION;
 3981|       |        pInfo->hardwareVersion.minor = handle->version;
 3982|       |#else
 3983|      0|        pInfo->hardwareVersion.major = 0;
 3984|      0|        pInfo->hardwareVersion.minor = 0;
 3985|      0|#endif
 3986|      0|        sftk_freeDB(handle);
 3987|      0|    }
 3988|       |    /*
 3989|       |     * CKF_LOGIN_REQUIRED CKF_USER_PIN_INITIALIZED  how CKF_TOKEN_INITIALIZED
 3990|       |     *                                              should be set
 3991|       |     *         0                   0                           1
 3992|       |     *         1                   0                           0
 3993|       |     *         0                   1                           1
 3994|       |     *         1                   1                           1
 3995|       |     */
 3996|      2|    if (!(pInfo->flags & CKF_LOGIN_REQUIRED) ||
  ------------------
  |  |  176|      2|#define CKF_LOGIN_REQUIRED 0x00000004UL       /* user must \
  ------------------
  |  Branch (3996:9): [True: 2, False: 0]
  ------------------
 3997|      2|        (pInfo->flags & CKF_USER_PIN_INITIALIZED)) {
  ------------------
  |  |  178|      0|#define CKF_USER_PIN_INITIALIZED 0x00000008UL /* normal user's \
  ------------------
  |  Branch (3997:9): [True: 0, False: 0]
  ------------------
 3998|      2|        pInfo->flags |= CKF_TOKEN_INITIALIZED;
  ------------------
  |  |  209|      2|#define CKF_TOKEN_INITIALIZED 0x00000400UL
  ------------------
 3999|      2|    }
 4000|      2|    return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 4001|      2|}
NSC_GetMechanismList:
 4008|      4|{
 4009|      4|    CK_ULONG i;
 4010|       |
 4011|      4|    CHECK_FORK();
 4012|       |
 4013|      4|    switch (slotID) {
 4014|       |        /* default: */
 4015|      2|        case NETSCAPE_SLOT_ID:
  ------------------
  |  |  498|      2|#define NETSCAPE_SLOT_ID 1
  ------------------
  |  Branch (4015:9): [True: 2, False: 2]
  ------------------
 4016|      2|            *pulCount = mechanismCount;
 4017|      2|            if (pMechanismList != NULL) {
  ------------------
  |  Branch (4017:17): [True: 1, False: 1]
  ------------------
 4018|    231|                for (i = 0; i < mechanismCount; i++) {
  ------------------
  |  Branch (4018:29): [True: 230, False: 1]
  ------------------
 4019|    230|                    pMechanismList[i] = mechanisms[i].type;
 4020|    230|                }
 4021|      1|            }
 4022|      2|            break;
 4023|      2|        default:
  ------------------
  |  Branch (4023:9): [True: 2, False: 2]
  ------------------
 4024|      2|            *pulCount = 0;
 4025|    462|            for (i = 0; i < mechanismCount; i++) {
  ------------------
  |  Branch (4025:25): [True: 460, False: 2]
  ------------------
 4026|    460|                if (mechanisms[i].privkey) {
  ------------------
  |  Branch (4026:21): [True: 354, False: 106]
  ------------------
 4027|    354|                    (*pulCount)++;
 4028|    354|                    if (pMechanismList != NULL) {
  ------------------
  |  Branch (4028:25): [True: 177, False: 177]
  ------------------
 4029|    177|                        *pMechanismList++ = mechanisms[i].type;
 4030|    177|                    }
 4031|    354|                }
 4032|    460|            }
 4033|      2|            break;
 4034|      4|    }
 4035|      4|    return CKR_OK;
  ------------------
  |  | 1388|      4|#define CKR_OK 0x00000000UL
  ------------------
 4036|      4|}
NSC_GetMechanismInfo:
 4043|  14.0k|{
 4044|  14.0k|    PRBool isPrivateKey;
 4045|  14.0k|    CK_ULONG i;
 4046|       |
 4047|  14.0k|    CHECK_FORK();
 4048|       |
 4049|  14.0k|    switch (slotID) {
 4050|  11.3k|        case NETSCAPE_SLOT_ID:
  ------------------
  |  |  498|  11.3k|#define NETSCAPE_SLOT_ID 1
  ------------------
  |  Branch (4050:9): [True: 11.3k, False: 2.73k]
  ------------------
 4051|  11.3k|            isPrivateKey = PR_FALSE;
  ------------------
  |  |  438|  11.3k|#define PR_FALSE 0
  ------------------
 4052|  11.3k|            break;
 4053|  2.73k|        default:
  ------------------
  |  Branch (4053:9): [True: 2.73k, False: 11.3k]
  ------------------
 4054|  2.73k|            isPrivateKey = PR_TRUE;
  ------------------
  |  |  437|  2.73k|#define PR_TRUE 1
  ------------------
 4055|  2.73k|            break;
 4056|  14.0k|    }
 4057|   425k|    for (i = 0; i < mechanismCount; i++) {
  ------------------
  |  Branch (4057:17): [True: 425k, False: 0]
  ------------------
 4058|   425k|        if (type == mechanisms[i].type) {
  ------------------
  |  Branch (4058:13): [True: 14.0k, False: 411k]
  ------------------
 4059|  14.0k|            if (isPrivateKey && !mechanisms[i].privkey) {
  ------------------
  |  Branch (4059:17): [True: 2.73k, False: 11.3k]
  |  Branch (4059:33): [True: 0, False: 2.73k]
  ------------------
 4060|      0|                return CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 4061|      0|            }
 4062|  14.0k|            PORT_Memcpy(pInfo, &mechanisms[i].info, sizeof(CK_MECHANISM_INFO));
  ------------------
  |  |  180|  14.0k|#define PORT_Memcpy memcpy
  ------------------
 4063|  14.0k|            return CKR_OK;
  ------------------
  |  | 1388|  14.0k|#define CKR_OK 0x00000000UL
  ------------------
 4064|  14.0k|        }
 4065|   425k|    }
 4066|      0|    return CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 4067|  14.0k|}
sftk_MechAllowsOperation:
 4087|  4.84k|{
 4088|  4.84k|    CK_ULONG i;
 4089|  4.84k|    CK_FLAGS flags = sftk_AttributeToFlags(op);
 4090|       |
 4091|  4.84k|    if (flags == 0) {
  ------------------
  |  Branch (4091:9): [True: 0, False: 4.84k]
  ------------------
 4092|      0|        return CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 4093|      0|    }
 4094|   258k|    for (i = 0; i < mechanismCount; i++) {
  ------------------
  |  Branch (4094:17): [True: 258k, False: 8]
  ------------------
 4095|   258k|        if (type == mechanisms[i].type) {
  ------------------
  |  Branch (4095:13): [True: 4.84k, False: 253k]
  ------------------
 4096|  4.84k|            return (flags & mechanisms[i].info.flags) ? CKR_OK
  ------------------
  |  | 1388|  4.84k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4096:20): [True: 4.84k, False: 0]
  ------------------
 4097|  4.84k|                                                      : CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 4098|  4.84k|        }
 4099|   258k|    }
 4100|      8|    return CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      8|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 4101|  4.84k|}
NSC_OpenSession:
 4381|  50.4k|{
 4382|  50.4k|    SFTKSlot *slot;
 4383|  50.4k|    CK_SESSION_HANDLE sessionID;
 4384|  50.4k|    SFTKSession *session;
 4385|  50.4k|    SFTKSession *sameID;
 4386|       |
 4387|  50.4k|    CHECK_FORK();
 4388|       |
 4389|  50.4k|    slot = sftk_SlotFromID(slotID, PR_FALSE);
  ------------------
  |  |  438|  50.4k|#define PR_FALSE 0
  ------------------
 4390|  50.4k|    if (slot == NULL)
  ------------------
  |  Branch (4390:9): [True: 0, False: 50.4k]
  ------------------
 4391|      0|        return CKR_SLOT_ID_INVALID;
  ------------------
  |  | 1391|      0|#define CKR_SLOT_ID_INVALID 0x00000003UL
  ------------------
 4392|       |
 4393|       |    /* new session (we only have serial sessions) */
 4394|  50.4k|    session = sftk_NewSession(slotID, Notify, pApplication,
 4395|  50.4k|                              flags | CKF_SERIAL_SESSION);
  ------------------
  |  |  303|  50.4k|#define CKF_SERIAL_SESSION 0x00000004UL /* no parallel */
  ------------------
 4396|  50.4k|    if (session == NULL)
  ------------------
  |  Branch (4396:9): [True: 0, False: 50.4k]
  ------------------
 4397|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 4398|       |
 4399|  50.4k|    if (slot->readOnly && (flags & CKF_RW_SESSION)) {
  ------------------
  |  |  302|  2.41k|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (4399:9): [True: 2.41k, False: 48.0k]
  |  Branch (4399:27): [True: 0, False: 2.41k]
  ------------------
 4400|       |        /* NETSCAPE_SLOT_ID is Read ONLY */
 4401|      0|        session->info.flags &= ~CKF_RW_SESSION;
  ------------------
  |  |  302|      0|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
 4402|      0|    }
 4403|  50.4k|    PZ_Lock(slot->slotLock);
  ------------------
  |  |  245|  50.4k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 4404|  50.4k|    ++slot->sessionCount;
 4405|  50.4k|    PZ_Unlock(slot->slotLock);
  ------------------
  |  |  246|  50.4k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 4406|  50.4k|    if (session->info.flags & CKF_RW_SESSION) {
  ------------------
  |  |  302|  50.4k|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (4406:9): [True: 0, False: 50.4k]
  ------------------
 4407|      0|        (void)PR_ATOMIC_INCREMENT(&slot->rwSessionCount);
  ------------------
  |  |  122|      0|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
 4408|      0|    }
 4409|       |
 4410|  50.4k|    do {
 4411|  50.4k|        PZLock *lock;
  ------------------
  |  |  185|  50.4k|#define PZLock PRLock
  ------------------
 4412|  50.4k|        do {
 4413|  50.4k|            sessionID = (PR_ATOMIC_INCREMENT(&slot->sessionIDCount) & 0xffffff) | (slot->index << 24);
  ------------------
  |  |  122|  50.4k|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
 4414|  50.4k|        } while (sessionID == CK_INVALID_HANDLE);
  ------------------
  |  |   78|  50.4k|#define CK_INVALID_HANDLE 0
  ------------------
  |  Branch (4414:18): [True: 0, False: 50.4k]
  ------------------
 4415|  50.4k|        lock = SFTK_SESSION_LOCK(slot, sessionID);
  ------------------
  |  |  583|  50.4k|    ((slot)->sessionLock[(handle) & (slot)->sessionLockMask])
  ------------------
 4416|  50.4k|        PZ_Lock(lock);
  ------------------
  |  |  245|  50.4k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 4417|  50.4k|        sftkqueue_find(sameID, sessionID, slot->head, slot->sessHashSize);
  ------------------
  |  |  524|  67.6k|    for ((element) = (head)[sftk_hash(id, hash_size)]; (element) != NULL; \
  |  |  ------------------
  |  |  |  |  513|  50.4k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  50.4k|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (524:56): [True: 17.1k, False: 50.4k]
  |  |  ------------------
  |  |  525|  50.4k|         (element) = (element)->next) {                                   \
  |  |  526|  17.1k|        if ((element)->handle == (id)) {                                  \
  |  |  ------------------
  |  |  |  Branch (526:13): [True: 0, False: 17.1k]
  |  |  ------------------
  |  |  527|      0|            break;                                                        \
  |  |  528|      0|        }                                                                 \
  |  |  529|  17.1k|    }
  ------------------
 4418|  50.4k|        if (sameID == NULL) {
  ------------------
  |  Branch (4418:13): [True: 50.4k, False: 0]
  ------------------
 4419|  50.4k|            session->handle = sessionID;
 4420|  50.4k|            sftk_update_state(slot, session);
 4421|  50.4k|            sftkqueue_add(session, sessionID, slot->head, slot->sessHashSize);
  ------------------
  |  |  515|  50.4k|    {                                               \
  |  |  516|  50.4k|        int tmp = sftk_hash(id, hash_size);         \
  |  |  ------------------
  |  |  |  |  513|  50.4k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  50.4k|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|  50.4k|        (element)->next = (head)[tmp];              \
  |  |  518|  50.4k|        (element)->prev = NULL;                     \
  |  |  519|  50.4k|        if ((head)[tmp])                            \
  |  |  ------------------
  |  |  |  Branch (519:13): [True: 15.7k, False: 34.6k]
  |  |  ------------------
  |  |  520|  50.4k|            (head)[tmp]->prev = (element);          \
  |  |  521|  50.4k|        (head)[tmp] = (element);                    \
  |  |  522|  50.4k|    }
  ------------------
 4422|  50.4k|        } else {
 4423|      0|            slot->sessionIDConflict++; /* for debugging */
 4424|      0|        }
 4425|  50.4k|        PZ_Unlock(lock);
  ------------------
  |  |  246|  50.4k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 4426|  50.4k|    } while (sameID != NULL);
  ------------------
  |  Branch (4426:14): [True: 0, False: 50.4k]
  ------------------
 4427|       |
 4428|  50.4k|    *phSession = sessionID;
 4429|  50.4k|    return CKR_OK;
  ------------------
  |  | 1388|  50.4k|#define CKR_OK 0x00000000UL
  ------------------
 4430|  50.4k|}
NSC_CloseSession:
 4435|  50.4k|{
 4436|  50.4k|    SFTKSlot *slot;
 4437|  50.4k|    SFTKSession *session;
 4438|  50.4k|    PRBool sessionFound;
 4439|  50.4k|    PZLock *lock;
  ------------------
  |  |  185|  50.4k|#define PZLock PRLock
  ------------------
 4440|       |
 4441|  50.4k|    CHECK_FORK();
 4442|       |
 4443|  50.4k|    session = sftk_SessionFromHandle(hSession);
 4444|  50.4k|    if (session == NULL)
  ------------------
  |  Branch (4444:9): [True: 0, False: 50.4k]
  ------------------
 4445|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 4446|  50.4k|    slot = sftk_SlotFromSession(session);
  ------------------
  |  |  503|  50.4k|#define sftk_SlotFromSession(sp) ((sp)->slot)
  ------------------
 4447|  50.4k|    sessionFound = PR_FALSE;
  ------------------
  |  |  438|  50.4k|#define PR_FALSE 0
  ------------------
 4448|       |
 4449|       |    /* lock */
 4450|  50.4k|    lock = SFTK_SESSION_LOCK(slot, hSession);
  ------------------
  |  |  583|  50.4k|    ((slot)->sessionLock[(handle) & (slot)->sessionLockMask])
  ------------------
 4451|  50.4k|    PZ_Lock(lock);
  ------------------
  |  |  245|  50.4k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 4452|  50.4k|    if (sftkqueue_is_queued(session, hSession, slot->head, slot->sessHashSize)) {
  ------------------
  |  |  531|  50.4k|    (((element)->next) || ((element)->prev) ||            \
  |  |  ------------------
  |  |  |  Branch (531:6): [True: 15.7k, False: 34.6k]
  |  |  |  Branch (531:27): [True: 1, False: 34.6k]
  |  |  ------------------
  |  |  532|  50.4k|     ((head)[sftk_hash(id, hash_size)] == (element)))
  |  |  ------------------
  |  |  |  |  513|  34.6k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  34.6k|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (532:6): [True: 34.6k, False: 0]
  |  |  ------------------
  ------------------
 4453|  50.4k|        sessionFound = PR_TRUE;
  ------------------
  |  |  437|  50.4k|#define PR_TRUE 1
  ------------------
 4454|  50.4k|        sftkqueue_delete(session, hSession, slot->head, slot->sessHashSize);
  ------------------
  |  |  534|  50.4k|    if ((element)->next)                                      \
  |  |  ------------------
  |  |  |  Branch (534:9): [True: 15.7k, False: 34.6k]
  |  |  ------------------
  |  |  535|  50.4k|        (element)->next->prev = (element)->prev;              \
  |  |  536|  50.4k|    if ((element)->prev)                                      \
  |  |  ------------------
  |  |  |  Branch (536:9): [True: 1, False: 50.4k]
  |  |  ------------------
  |  |  537|  50.4k|        (element)->prev->next = (element)->next;              \
  |  |  538|  50.4k|    else                                                      \
  |  |  539|  50.4k|        (head)[sftk_hash(id, hash_size)] = ((element)->next); \
  |  |  ------------------
  |  |  |  |  513|  50.4k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  50.4k|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  540|  50.4k|    (element)->next = NULL;                                   \
  |  |  541|  50.4k|    (element)->prev = NULL;
  ------------------
 4455|  50.4k|    }
 4456|  50.4k|    PZ_Unlock(lock);
  ------------------
  |  |  246|  50.4k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 4457|       |
 4458|  50.4k|    if (sessionFound) {
  ------------------
  |  Branch (4458:9): [True: 50.4k, False: 0]
  ------------------
 4459|  50.4k|        SFTKDBHandle *handle;
 4460|  50.4k|        handle = sftk_getKeyDB(slot);
 4461|  50.4k|        PZ_Lock(slot->slotLock);
  ------------------
  |  |  245|  50.4k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 4462|  50.4k|        if (--slot->sessionCount == 0) {
  ------------------
  |  Branch (4462:13): [True: 0, False: 50.4k]
  ------------------
 4463|      0|            slot->isLoggedIn = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4464|      0|            if (slot->needLogin && handle) {
  ------------------
  |  Branch (4464:17): [True: 0, False: 0]
  |  Branch (4464:36): [True: 0, False: 0]
  ------------------
 4465|      0|                sftkdb_ClearPassword(handle);
 4466|      0|            }
 4467|      0|        }
 4468|  50.4k|        PZ_Unlock(slot->slotLock);
  ------------------
  |  |  246|  50.4k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 4469|  50.4k|        if (handle) {
  ------------------
  |  Branch (4469:13): [True: 0, False: 50.4k]
  ------------------
 4470|      0|            sftk_freeDB(handle);
 4471|      0|        }
 4472|  50.4k|        if (session->info.flags & CKF_RW_SESSION) {
  ------------------
  |  |  302|  50.4k|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (4472:13): [True: 0, False: 50.4k]
  ------------------
 4473|      0|            (void)PR_ATOMIC_DECREMENT(&slot->rwSessionCount);
  ------------------
  |  |  123|      0|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
 4474|      0|        }
 4475|  50.4k|        sftk_DestroySession(session);
 4476|  50.4k|        session = NULL;
 4477|  50.4k|    }
 4478|       |
 4479|  50.4k|    return CKR_OK;
  ------------------
  |  | 1388|  50.4k|#define CKR_OK 0x00000000UL
  ------------------
 4480|  50.4k|}
NSC_CloseAllSessions:
 4485|      4|{
 4486|      4|    SFTKSlot *slot;
 4487|       |
 4488|       |#ifndef NO_FORK_CHECK
 4489|       |    /* skip fork check if we are being called from C_Initialize or C_Finalize */
 4490|       |    if (!parentForkedAfterC_Initialize) {
 4491|       |        CHECK_FORK();
 4492|       |    }
 4493|       |#endif
 4494|       |
 4495|      4|    slot = sftk_SlotFromID(slotID, PR_FALSE);
  ------------------
  |  |  438|      4|#define PR_FALSE 0
  ------------------
 4496|      4|    if (slot == NULL)
  ------------------
  |  Branch (4496:9): [True: 0, False: 4]
  ------------------
 4497|      0|        return CKR_SLOT_ID_INVALID;
  ------------------
  |  | 1391|      0|#define CKR_SLOT_ID_INVALID 0x00000003UL
  ------------------
 4498|       |
 4499|      4|    return sftk_CloseAllSessions(slot, PR_TRUE);
  ------------------
  |  |  437|      4|#define PR_TRUE 1
  ------------------
 4500|      4|}
NSC_CreateObject:
 4815|  6.68k|{
 4816|  6.68k|    SFTKSlot *slot = sftk_SlotFromSessionHandle(hSession);
 4817|  6.68k|    SFTKSession *session;
 4818|  6.68k|    SFTKObject *object;
 4819|       |    /* make sure class isn't randomly CKO_NSS_NEWSLOT or
 4820|       |     * CKO_NETSCPE_DELSLOT. */
 4821|  6.68k|    CK_OBJECT_CLASS class = CKO_VENDOR_DEFINED;
  ------------------
  |  |  335|  6.68k|#define CKO_VENDOR_DEFINED 0x80000000UL
  ------------------
 4822|  6.68k|    CK_RV crv;
 4823|  6.68k|    int i;
 4824|       |
 4825|  6.68k|    CHECK_FORK();
 4826|       |
 4827|  6.68k|    *phObject = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  6.68k|#define CK_INVALID_HANDLE 0
  ------------------
 4828|       |
 4829|  6.68k|    if (slot == NULL) {
  ------------------
  |  Branch (4829:9): [True: 0, False: 6.68k]
  ------------------
 4830|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 4831|      0|    }
 4832|       |    /*
 4833|       |     * now lets create an object to hang the attributes off of
 4834|       |     */
 4835|  6.68k|    object = sftk_NewObject(slot); /* fill in the handle later */
 4836|  6.68k|    if (object == NULL) {
  ------------------
  |  Branch (4836:9): [True: 0, False: 6.68k]
  ------------------
 4837|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 4838|      0|    }
 4839|       |
 4840|       |    /*
 4841|       |     * sftk_NewObject will set object->isFIPS to PR_TRUE if the slot is FIPS.
 4842|       |     * We don't need to worry about that here, as FC_CreateObject will always
 4843|       |     * disallow the import of secret and private keys, regardless of isFIPS
 4844|       |     * approval status. Therefore, at this point we know that the key is a
 4845|       |     * public key, which is acceptable to be imported in plaintext.
 4846|       |     */
 4847|       |
 4848|       |    /*
 4849|       |     * load the template values into the object
 4850|       |     */
 4851|  46.4k|    for (i = 0; i < (int)ulCount; i++) {
  ------------------
  |  Branch (4851:17): [True: 39.7k, False: 6.68k]
  ------------------
 4852|  39.7k|        crv = sftk_AddAttributeType(object, sftk_attr_expand(&pTemplate[i]));
  ------------------
  |  |  587|  39.7k|#define sftk_attr_expand(ap) (ap)->type, (ap)->pValue, (ap)->ulValueLen
  ------------------
 4853|  39.7k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  39.7k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4853:13): [True: 0, False: 39.7k]
  ------------------
 4854|      0|            sftk_FreeObject(object);
 4855|      0|            return crv;
 4856|      0|        }
 4857|  39.7k|        if ((pTemplate[i].type == CKA_CLASS) && pTemplate[i].pValue) {
  ------------------
  |  |  511|  39.7k|#define CKA_CLASS 0x00000000UL
  ------------------
  |  Branch (4857:13): [True: 6.68k, False: 33.0k]
  |  Branch (4857:49): [True: 6.68k, False: 0]
  ------------------
 4858|  6.68k|            class = *(CK_OBJECT_CLASS *)pTemplate[i].pValue;
 4859|  6.68k|        }
 4860|  39.7k|    }
 4861|       |
 4862|       |    /* get the session */
 4863|  6.68k|    session = sftk_SessionFromHandle(hSession);
 4864|  6.68k|    if (session == NULL) {
  ------------------
  |  Branch (4864:9): [True: 0, False: 6.68k]
  ------------------
 4865|      0|        sftk_FreeObject(object);
 4866|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 4867|      0|    }
 4868|       |
 4869|       |    /*
 4870|       |     * handle pseudo objects (CKO_NEWSLOT)
 4871|       |     */
 4872|  6.68k|    if ((class == CKO_NSS_NEWSLOT) || (class == CKO_NSS_DELSLOT)) {
  ------------------
  |  |   39|  6.68k|#define CKO_NSS_NEWSLOT (CKO_NSS + 5)
  |  |  ------------------
  |  |  |  |   33|  6.68k|#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|  6.68k|#define CKO_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  6.68k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((class == CKO_NSS_NEWSLOT) || (class == CKO_NSS_DELSLOT)) {
  ------------------
  |  |   40|  6.68k|#define CKO_NSS_DELSLOT (CKO_NSS + 6)
  |  |  ------------------
  |  |  |  |   33|  6.68k|#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|  6.68k|#define CKO_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  6.68k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4872:9): [True: 0, False: 6.68k]
  |  Branch (4872:39): [True: 0, False: 6.68k]
  ------------------
 4873|      0|        crv = sftk_CreateNewSlot(slot, class, object);
 4874|      0|        goto done;
 4875|      0|    }
 4876|       |
 4877|       |    /*
 4878|       |     * handle the base object stuff
 4879|       |     */
 4880|  6.68k|    crv = sftk_handleObject(object, session);
 4881|  6.68k|    *phObject = object->handle;
 4882|  6.68k|done:
 4883|  6.68k|    sftk_FreeSession(session);
 4884|  6.68k|    sftk_FreeObject(object);
 4885|       |
 4886|  6.68k|    return crv;
 4887|  6.68k|}
NSC_GetAttributeValue:
 5033|  62.2k|{
 5034|  62.2k|    SFTKSlot *slot = sftk_SlotFromSessionHandle(hSession);
 5035|  62.2k|    SFTKSession *session;
 5036|  62.2k|    SFTKObject *object;
 5037|  62.2k|    SFTKAttribute *attribute;
 5038|  62.2k|    PRBool sensitive, isLoggedIn, needLogin;
 5039|  62.2k|    CK_RV crv;
 5040|  62.2k|    int i;
 5041|       |
 5042|  62.2k|    CHECK_FORK();
 5043|       |
 5044|  62.2k|    if (slot == NULL) {
  ------------------
  |  Branch (5044:9): [True: 0, False: 62.2k]
  ------------------
 5045|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5046|      0|    }
 5047|       |    /*
 5048|       |     * make sure we're allowed
 5049|       |     */
 5050|  62.2k|    session = sftk_SessionFromHandle(hSession);
 5051|  62.2k|    if (session == NULL) {
  ------------------
  |  Branch (5051:9): [True: 0, False: 62.2k]
  ------------------
 5052|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5053|      0|    }
 5054|       |
 5055|       |    /* short circuit everything for token objects */
 5056|  62.2k|    if (sftk_isToken(hObject)) {
  ------------------
  |  |  504|  62.2k|#define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  478|  62.2k|#define SFTK_TOKEN_MASK 0x80000000L
  |  |  ------------------
  |  |               #define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  479|  62.2k|#define SFTK_TOKEN_MAGIC 0x80000000L
  |  |  ------------------
  |  |  |  Branch (504:26): [True: 0, False: 62.2k]
  |  |  ------------------
  ------------------
 5057|      0|        crv = nsc_GetTokenAttributeValue(session, hObject, pTemplate, ulCount);
 5058|      0|        sftk_FreeSession(session);
 5059|      0|        return crv;
 5060|      0|    }
 5061|       |
 5062|       |    /* handle the session object */
 5063|  62.2k|    object = sftk_ObjectFromHandle(hObject, session);
 5064|  62.2k|    sftk_FreeSession(session);
 5065|  62.2k|    if (object == NULL) {
  ------------------
  |  Branch (5065:9): [True: 0, False: 62.2k]
  ------------------
 5066|      0|        return CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
 5067|      0|    }
 5068|       |
 5069|  62.2k|    PZ_Lock(slot->slotLock);
  ------------------
  |  |  245|  62.2k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 5070|  62.2k|    isLoggedIn = slot->isLoggedIn;
 5071|  62.2k|    needLogin = slot->needLogin;
 5072|  62.2k|    PZ_Unlock(slot->slotLock);
  ------------------
  |  |  246|  62.2k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 5073|       |
 5074|       |    /* don't read a private object if we aren't logged in */
 5075|  62.2k|    if (!isLoggedIn && needLogin && sftk_isTrue(object, CKA_PRIVATE)) {
  ------------------
  |  |  513|      0|#define CKA_PRIVATE 0x00000002UL
  ------------------
  |  Branch (5075:9): [True: 62.2k, False: 0]
  |  Branch (5075:24): [True: 0, False: 62.2k]
  |  Branch (5075:37): [True: 0, False: 0]
  ------------------
 5076|      0|        sftk_FreeObject(object);
 5077|      0|        return CKR_USER_NOT_LOGGED_IN;
  ------------------
  |  | 1486|      0|#define CKR_USER_NOT_LOGGED_IN 0x00000101UL
  ------------------
 5078|      0|    }
 5079|       |
 5080|  62.2k|    crv = CKR_OK;
  ------------------
  |  | 1388|  62.2k|#define CKR_OK 0x00000000UL
  ------------------
 5081|  62.2k|    sensitive = sftk_isTrue(object, CKA_SENSITIVE);
  ------------------
  |  |  546|  62.2k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
 5082|   182k|    for (i = 0; i < (int)ulCount; i++) {
  ------------------
  |  Branch (5082:17): [True: 119k, False: 62.2k]
  ------------------
 5083|       |        /* Make sure that this attribute is retrievable */
 5084|   119k|        if (sensitive && sftk_isSensitive(pTemplate[i].type, object->objclass)) {
  ------------------
  |  Branch (5084:13): [True: 0, False: 119k]
  |  Branch (5084:26): [True: 0, False: 0]
  ------------------
 5085|      0|            crv = CKR_ATTRIBUTE_SENSITIVE;
  ------------------
  |  | 1407|      0|#define CKR_ATTRIBUTE_SENSITIVE 0x00000011UL
  ------------------
 5086|      0|            pTemplate[i].ulValueLen = -1;
 5087|      0|            continue;
 5088|      0|        }
 5089|   119k|        attribute = sftk_FindAttribute(object, pTemplate[i].type);
 5090|   119k|        if (attribute == NULL) {
  ------------------
  |  Branch (5090:13): [True: 0, False: 119k]
  ------------------
 5091|      0|            crv = CKR_ATTRIBUTE_TYPE_INVALID;
  ------------------
  |  | 1408|      0|#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012UL
  ------------------
 5092|      0|            pTemplate[i].ulValueLen = -1;
 5093|      0|            continue;
 5094|      0|        }
 5095|   119k|        if (pTemplate[i].pValue != NULL) {
  ------------------
  |  Branch (5095:13): [True: 98.5k, False: 21.4k]
  ------------------
 5096|  98.5k|            PORT_Memcpy(pTemplate[i].pValue, attribute->attrib.pValue,
  ------------------
  |  |  180|  98.5k|#define PORT_Memcpy memcpy
  ------------------
 5097|  98.5k|                        attribute->attrib.ulValueLen);
 5098|  98.5k|        }
 5099|   119k|        pTemplate[i].ulValueLen = attribute->attrib.ulValueLen;
 5100|   119k|        sftk_FreeAttribute(attribute);
 5101|   119k|    }
 5102|       |
 5103|  62.2k|    sftk_FreeObject(object);
 5104|  62.2k|    return crv;
 5105|  62.2k|}
NSC_SetAttributeValue:
 5111|  9.19k|{
 5112|  9.19k|    SFTKSlot *slot = sftk_SlotFromSessionHandle(hSession);
 5113|  9.19k|    SFTKSession *session;
 5114|  9.19k|    SFTKAttribute *attribute;
 5115|  9.19k|    SFTKObject *object;
 5116|  9.19k|    PRBool isToken, isLoggedIn, needLogin;
 5117|  9.19k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  9.19k|#define CKR_OK 0x00000000UL
  ------------------
 5118|  9.19k|    CK_BBOOL legal;
 5119|  9.19k|    int i;
 5120|       |
 5121|  9.19k|    CHECK_FORK();
 5122|       |
 5123|  9.19k|    if (slot == NULL) {
  ------------------
  |  Branch (5123:9): [True: 0, False: 9.19k]
  ------------------
 5124|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5125|      0|    }
 5126|       |    /*
 5127|       |     * make sure we're allowed
 5128|       |     */
 5129|  9.19k|    session = sftk_SessionFromHandle(hSession);
 5130|  9.19k|    if (session == NULL) {
  ------------------
  |  Branch (5130:9): [True: 0, False: 9.19k]
  ------------------
 5131|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5132|      0|    }
 5133|       |
 5134|  9.19k|    object = sftk_ObjectFromHandle(hObject, session);
 5135|  9.19k|    if (object == NULL) {
  ------------------
  |  Branch (5135:9): [True: 0, False: 9.19k]
  ------------------
 5136|      0|        sftk_FreeSession(session);
 5137|      0|        return CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
 5138|      0|    }
 5139|       |
 5140|  9.19k|    PZ_Lock(slot->slotLock);
  ------------------
  |  |  245|  9.19k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 5141|  9.19k|    isLoggedIn = slot->isLoggedIn;
 5142|  9.19k|    needLogin = slot->needLogin;
 5143|  9.19k|    PZ_Unlock(slot->slotLock);
  ------------------
  |  |  246|  9.19k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 5144|       |
 5145|       |    /* don't modify a private object if we aren't logged in */
 5146|  9.19k|    if (!isLoggedIn && needLogin && sftk_isTrue(object, CKA_PRIVATE)) {
  ------------------
  |  |  513|      0|#define CKA_PRIVATE 0x00000002UL
  ------------------
  |  Branch (5146:9): [True: 9.19k, False: 0]
  |  Branch (5146:24): [True: 0, False: 9.19k]
  |  Branch (5146:37): [True: 0, False: 0]
  ------------------
 5147|      0|        sftk_FreeSession(session);
 5148|      0|        sftk_FreeObject(object);
 5149|      0|        return CKR_USER_NOT_LOGGED_IN;
  ------------------
  |  | 1486|      0|#define CKR_USER_NOT_LOGGED_IN 0x00000101UL
  ------------------
 5150|      0|    }
 5151|       |
 5152|       |    /* don't modify a token object if we aren't in a rw session */
 5153|  9.19k|    isToken = sftk_isTrue(object, CKA_TOKEN);
  ------------------
  |  |  512|  9.19k|#define CKA_TOKEN 0x00000001UL
  ------------------
 5154|  9.19k|    if (((session->info.flags & CKF_RW_SESSION) == 0) && isToken) {
  ------------------
  |  |  302|  9.19k|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (5154:9): [True: 9.19k, False: 0]
  |  Branch (5154:58): [True: 0, False: 9.19k]
  ------------------
 5155|      0|        sftk_FreeSession(session);
 5156|      0|        sftk_FreeObject(object);
 5157|      0|        return CKR_SESSION_READ_ONLY;
  ------------------
  |  | 1467|      0|#define CKR_SESSION_READ_ONLY 0x000000B5UL
  ------------------
 5158|      0|    }
 5159|  9.19k|    sftk_FreeSession(session);
 5160|       |
 5161|       |    /* only change modifiable objects */
 5162|  9.19k|    if (!sftk_isTrue(object, CKA_MODIFIABLE)) {
  ------------------
  |  |  593|  9.19k|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
  |  Branch (5162:9): [True: 0, False: 9.19k]
  ------------------
 5163|      0|        sftk_FreeObject(object);
 5164|      0|        return CKR_ATTRIBUTE_READ_ONLY;
  ------------------
  |  | 1406|      0|#define CKR_ATTRIBUTE_READ_ONLY 0x00000010UL
  ------------------
 5165|      0|    }
 5166|       |
 5167|  18.3k|    for (i = 0; i < (int)ulCount; i++) {
  ------------------
  |  Branch (5167:17): [True: 9.19k, False: 9.19k]
  ------------------
 5168|       |        /* Make sure that this attribute is changeable */
 5169|  9.19k|        switch (sftk_modifyType(pTemplate[i].type, object->objclass)) {
 5170|      0|            case SFTK_NEVER:
  ------------------
  |  Branch (5170:13): [True: 0, False: 9.19k]
  ------------------
 5171|      0|            case SFTK_ONCOPY:
  ------------------
  |  Branch (5171:13): [True: 0, False: 9.19k]
  ------------------
 5172|      0|            default:
  ------------------
  |  Branch (5172:13): [True: 0, False: 9.19k]
  ------------------
 5173|      0|                crv = CKR_ATTRIBUTE_READ_ONLY;
  ------------------
  |  | 1406|      0|#define CKR_ATTRIBUTE_READ_ONLY 0x00000010UL
  ------------------
 5174|      0|                break;
 5175|       |
 5176|      0|            case SFTK_SENSITIVE:
  ------------------
  |  Branch (5176:13): [True: 0, False: 9.19k]
  ------------------
 5177|      0|                legal = (pTemplate[i].type == CKA_EXTRACTABLE) ? CK_FALSE : CK_TRUE;
  ------------------
  |  |  585|      0|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
                              legal = (pTemplate[i].type == CKA_EXTRACTABLE) ? CK_FALSE : CK_TRUE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
                              legal = (pTemplate[i].type == CKA_EXTRACTABLE) ? CK_FALSE : CK_TRUE;
  ------------------
  |  |   22|      0|#define CK_TRUE 1
  ------------------
  |  Branch (5177:25): [True: 0, False: 0]
  ------------------
 5178|      0|                if ((*(CK_BBOOL *)pTemplate[i].pValue) != legal) {
  ------------------
  |  Branch (5178:21): [True: 0, False: 0]
  ------------------
 5179|      0|                    crv = CKR_ATTRIBUTE_READ_ONLY;
  ------------------
  |  | 1406|      0|#define CKR_ATTRIBUTE_READ_ONLY 0x00000010UL
  ------------------
 5180|      0|                }
 5181|      0|                break;
 5182|  9.19k|            case SFTK_ALWAYS:
  ------------------
  |  Branch (5182:13): [True: 9.19k, False: 0]
  ------------------
 5183|  9.19k|                break;
 5184|  9.19k|        }
 5185|  9.19k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.19k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5185:13): [True: 0, False: 9.19k]
  ------------------
 5186|      0|            break;
 5187|       |
 5188|       |        /* find the old attribute */
 5189|  9.19k|        attribute = sftk_FindAttribute(object, pTemplate[i].type);
 5190|  9.19k|        if (attribute == NULL) {
  ------------------
  |  Branch (5190:13): [True: 0, False: 9.19k]
  ------------------
 5191|      0|            crv = CKR_ATTRIBUTE_TYPE_INVALID;
  ------------------
  |  | 1408|      0|#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012UL
  ------------------
 5192|      0|            break;
 5193|      0|        }
 5194|  9.19k|        sftk_FreeAttribute(attribute);
 5195|  9.19k|        crv = sftk_forceAttribute(object, sftk_attr_expand(&pTemplate[i]));
  ------------------
  |  |  587|  9.19k|#define sftk_attr_expand(ap) (ap)->type, (ap)->pValue, (ap)->ulValueLen
  ------------------
 5196|  9.19k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.19k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5196:13): [True: 0, False: 9.19k]
  ------------------
 5197|      0|            break;
 5198|  9.19k|    }
 5199|       |
 5200|  9.19k|    sftk_FreeObject(object);
 5201|  9.19k|    return crv;
 5202|  9.19k|}
sftk_emailhack:
 5250|  31.3k|{
 5251|  31.3k|    PRBool isCert = PR_FALSE;
  ------------------
  |  |  438|  31.3k|#define PR_FALSE 0
  ------------------
 5252|  31.3k|    int emailIndex = -1;
 5253|  31.3k|    unsigned int i;
 5254|  31.3k|    SFTKSearchResults smime_search;
 5255|  31.3k|    CK_ATTRIBUTE smime_template[2];
 5256|  31.3k|    CK_OBJECT_CLASS smime_class = CKO_NSS_SMIME;
  ------------------
  |  |   36|  31.3k|#define CKO_NSS_SMIME (CKO_NSS + 2)
  |  |  ------------------
  |  |  |  |   33|  31.3k|#define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  335|  31.3k|#define CKO_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKO_NSS (CKO_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  31.3k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5257|  31.3k|    SFTKAttribute *attribute = NULL;
 5258|  31.3k|    SFTKObject *object = NULL;
 5259|  31.3k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 5260|       |
 5261|  31.3k|    smime_search.handles = NULL; /* paranoia, some one is bound to add a goto
 5262|       |                                  * loser before this gets initialized */
 5263|       |
 5264|       |    /* see if we are looking for email certs */
 5265|  94.1k|    for (i = 0; i < ulCount; i++) {
  ------------------
  |  Branch (5265:17): [True: 83.6k, False: 10.4k]
  ------------------
 5266|  83.6k|        if (pTemplate[i].type == CKA_CLASS) {
  ------------------
  |  |  511|  83.6k|#define CKA_CLASS 0x00000000UL
  ------------------
  |  Branch (5266:13): [True: 31.3k, False: 52.3k]
  ------------------
 5267|  31.3k|            if ((pTemplate[i].ulValueLen != sizeof(CK_OBJECT_CLASS) ||
  ------------------
  |  Branch (5267:18): [True: 0, False: 31.3k]
  ------------------
 5268|  31.3k|                 (*(CK_OBJECT_CLASS *)pTemplate[i].pValue) != CKO_CERTIFICATE)) {
  ------------------
  |  |  326|  31.3k|#define CKO_CERTIFICATE 0x00000001UL
  ------------------
  |  Branch (5268:18): [True: 20.8k, False: 10.4k]
  ------------------
 5269|       |                /* not a cert, skip out */
 5270|  20.8k|                break;
 5271|  20.8k|            }
 5272|  10.4k|            isCert = PR_TRUE;
  ------------------
  |  |  437|  10.4k|#define PR_TRUE 1
  ------------------
 5273|  52.3k|        } else if (pTemplate[i].type == CKA_NSS_EMAIL) {
  ------------------
  |  |   80|  52.3k|#define CKA_NSS_EMAIL (CKA_NSS + 2)
  |  |  ------------------
  |  |  |  |   77|  52.3k|#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  692|  52.3k|#define CKA_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  52.3k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5273:20): [True: 0, False: 52.3k]
  ------------------
 5274|      0|            emailIndex = i;
 5275|      0|        }
 5276|  62.7k|        if (isCert && (emailIndex != -1))
  ------------------
  |  Branch (5276:13): [True: 31.4k, False: 31.3k]
  |  Branch (5276:23): [True: 0, False: 31.4k]
  ------------------
 5277|      0|            break;
 5278|  62.7k|    }
 5279|       |
 5280|  31.3k|    if (!isCert || (emailIndex == -1)) {
  ------------------
  |  Branch (5280:9): [True: 20.8k, False: 10.4k]
  |  Branch (5280:20): [True: 10.4k, False: 0]
  ------------------
 5281|  31.3k|        return CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 5282|  31.3k|    }
 5283|       |
 5284|       |    /* we are doing a cert and email search, find the SMimeEntry */
 5285|      0|    smime_template[0].type = CKA_CLASS;
  ------------------
  |  |  511|      0|#define CKA_CLASS 0x00000000UL
  ------------------
 5286|      0|    smime_template[0].pValue = &smime_class;
 5287|      0|    smime_template[0].ulValueLen = sizeof(smime_class);
 5288|      0|    smime_template[1] = pTemplate[emailIndex];
 5289|       |
 5290|      0|    smime_search.handles = (CK_OBJECT_HANDLE *)
 5291|      0|        PORT_Alloc(sizeof(CK_OBJECT_HANDLE) * NSC_SEARCH_BLOCK_SIZE);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
                      PORT_Alloc(sizeof(CK_OBJECT_HANDLE) * NSC_SEARCH_BLOCK_SIZE);
  ------------------
  |  |   49|      0|#define NSC_SEARCH_BLOCK_SIZE 5
  ------------------
 5292|      0|    if (smime_search.handles == NULL) {
  ------------------
  |  Branch (5292:9): [True: 0, False: 0]
  ------------------
 5293|      0|        crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5294|      0|        goto loser;
 5295|      0|    }
 5296|      0|    smime_search.index = 0;
 5297|      0|    smime_search.size = 0;
 5298|      0|    smime_search.array_size = NSC_SEARCH_BLOCK_SIZE;
  ------------------
  |  |   49|      0|#define NSC_SEARCH_BLOCK_SIZE 5
  ------------------
 5299|       |
 5300|      0|    crv = sftk_searchDatabase(handle, &smime_search, smime_template, 2);
 5301|      0|    if (crv != CKR_OK || smime_search.size == 0) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5301:9): [True: 0, False: 0]
  |  Branch (5301:26): [True: 0, False: 0]
  ------------------
 5302|      0|        goto loser;
 5303|      0|    }
 5304|       |
 5305|       |    /* get the SMime subject */
 5306|      0|    object = sftk_NewTokenObject(slot, NULL, smime_search.handles[0]);
 5307|      0|    if (object == NULL) {
  ------------------
  |  Branch (5307:9): [True: 0, False: 0]
  ------------------
 5308|      0|        crv = CKR_HOST_MEMORY; /* is there any other reason for this failure? */
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5309|      0|        goto loser;
 5310|      0|    }
 5311|      0|    attribute = sftk_FindAttribute(object, CKA_SUBJECT);
  ------------------
  |  |  544|      0|#define CKA_SUBJECT 0x00000101UL
  ------------------
 5312|      0|    if (attribute == NULL) {
  ------------------
  |  Branch (5312:9): [True: 0, False: 0]
  ------------------
 5313|      0|        crv = CKR_ATTRIBUTE_TYPE_INVALID;
  ------------------
  |  | 1408|      0|#define CKR_ATTRIBUTE_TYPE_INVALID 0x00000012UL
  ------------------
 5314|      0|        goto loser;
 5315|      0|    }
 5316|       |
 5317|       |    /* now find the certs with that subject */
 5318|      0|    pTemplate[emailIndex] = attribute->attrib;
 5319|       |    /* now add the appropriate certs to the search list */
 5320|      0|    crv = sftk_searchDatabase(handle, search, pTemplate, ulCount);
 5321|      0|    pTemplate[emailIndex] = smime_template[1]; /* restore the user's template*/
 5322|       |
 5323|      0|loser:
 5324|      0|    if (attribute) {
  ------------------
  |  Branch (5324:9): [True: 0, False: 0]
  ------------------
 5325|      0|        sftk_FreeAttribute(attribute);
 5326|      0|    }
 5327|      0|    if (object) {
  ------------------
  |  Branch (5327:9): [True: 0, False: 0]
  ------------------
 5328|      0|        sftk_FreeObject(object);
 5329|      0|    }
 5330|      0|    if (smime_search.handles) {
  ------------------
  |  Branch (5330:9): [True: 0, False: 0]
  ------------------
 5331|      0|        PORT_Free(smime_search.handles);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5332|      0|    }
 5333|       |
 5334|      0|    return crv;
 5335|      0|}
NSC_FindObjectsInit:
 5392|  31.3k|{
 5393|  31.3k|    SFTKSearchResults *search = NULL, *freeSearch = NULL;
 5394|  31.3k|    SFTKSession *session = NULL;
 5395|  31.3k|    SFTKSlot *slot = sftk_SlotFromSessionHandle(hSession);
 5396|  31.3k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 5397|  31.3k|    PRBool isLoggedIn;
 5398|       |
 5399|  31.3k|    CHECK_FORK();
 5400|       |
 5401|  31.3k|    if (slot == NULL) {
  ------------------
  |  Branch (5401:9): [True: 0, False: 31.3k]
  ------------------
 5402|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5403|      0|    }
 5404|  31.3k|    session = sftk_SessionFromHandle(hSession);
 5405|  31.3k|    if (session == NULL) {
  ------------------
  |  Branch (5405:9): [True: 0, False: 31.3k]
  ------------------
 5406|      0|        crv = CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5407|      0|        goto loser;
 5408|      0|    }
 5409|       |
 5410|  31.3k|    search = (SFTKSearchResults *)PORT_Alloc(sizeof(SFTKSearchResults));
  ------------------
  |  |   52|  31.3k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 5411|  31.3k|    if (search == NULL) {
  ------------------
  |  Branch (5411:9): [True: 0, False: 31.3k]
  ------------------
 5412|      0|        crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5413|      0|        goto loser;
 5414|      0|    }
 5415|  31.3k|    search->handles = (CK_OBJECT_HANDLE *)
 5416|  31.3k|        PORT_Alloc(sizeof(CK_OBJECT_HANDLE) * NSC_SEARCH_BLOCK_SIZE);
  ------------------
  |  |   52|  31.3k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
                      PORT_Alloc(sizeof(CK_OBJECT_HANDLE) * NSC_SEARCH_BLOCK_SIZE);
  ------------------
  |  |   49|  31.3k|#define NSC_SEARCH_BLOCK_SIZE 5
  ------------------
 5417|  31.3k|    if (search->handles == NULL) {
  ------------------
  |  Branch (5417:9): [True: 0, False: 31.3k]
  ------------------
 5418|      0|        crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5419|      0|        goto loser;
 5420|      0|    }
 5421|  31.3k|    search->index = 0;
 5422|  31.3k|    search->size = 0;
 5423|  31.3k|    search->array_size = NSC_SEARCH_BLOCK_SIZE;
  ------------------
  |  |   49|  31.3k|#define NSC_SEARCH_BLOCK_SIZE 5
  ------------------
 5424|       |
 5425|  31.3k|    PZ_Lock(slot->slotLock);
  ------------------
  |  |  245|  31.3k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 5426|  31.3k|    isLoggedIn = (PRBool)((!slot->needLogin) || slot->isLoggedIn);
  ------------------
  |  Branch (5426:27): [True: 31.3k, False: 0]
  |  Branch (5426:49): [True: 0, False: 0]
  ------------------
 5427|  31.3k|    PZ_Unlock(slot->slotLock);
  ------------------
  |  |  246|  31.3k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 5428|       |
 5429|  31.3k|    PRBool validTokenAttribute = PR_FALSE;
  ------------------
  |  |  438|  31.3k|#define PR_FALSE 0
  ------------------
 5430|  31.3k|    PRBool tokenAttributeValue = PR_FALSE;
  ------------------
  |  |  438|  31.3k|#define PR_FALSE 0
  ------------------
 5431|  31.3k|    for (CK_ULONG i = 0; i < ulCount; i++) {
  ------------------
  |  Branch (5431:26): [True: 31.3k, False: 2]
  ------------------
 5432|  31.3k|        CK_ATTRIBUTE_PTR attr = &pTemplate[i];
 5433|  31.3k|        if (attr->type == CKA_TOKEN && attr->pValue && attr->ulValueLen == sizeof(CK_BBOOL)) {
  ------------------
  |  |  512|  62.6k|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (5433:13): [True: 31.3k, False: 2]
  |  Branch (5433:40): [True: 31.3k, False: 0]
  |  Branch (5433:56): [True: 31.3k, False: 0]
  ------------------
 5434|  31.3k|            if (*(CK_BBOOL *)attr->pValue == CK_TRUE) {
  ------------------
  |  |   22|  31.3k|#define CK_TRUE 1
  ------------------
  |  Branch (5434:17): [True: 31.3k, False: 0]
  ------------------
 5435|  31.3k|                validTokenAttribute = PR_TRUE;
  ------------------
  |  |  437|  31.3k|#define PR_TRUE 1
  ------------------
 5436|  31.3k|                tokenAttributeValue = PR_TRUE;
  ------------------
  |  |  437|  31.3k|#define PR_TRUE 1
  ------------------
 5437|  31.3k|            } else if (*(CK_BBOOL *)attr->pValue == CK_FALSE) {
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
  |  Branch (5437:24): [True: 0, False: 0]
  ------------------
 5438|      0|                validTokenAttribute = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5439|      0|                tokenAttributeValue = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5440|      0|            }
 5441|  31.3k|            break;
 5442|  31.3k|        }
 5443|  31.3k|    }
 5444|       |
 5445|       |    // Search over the token object list if the template's CKA_TOKEN attribute is set to
 5446|       |    // CK_TRUE or if it is not set.
 5447|  31.3k|    if (validTokenAttribute == PR_FALSE || tokenAttributeValue == PR_TRUE) {
  ------------------
  |  |  438|  62.6k|#define PR_FALSE 0
  ------------------
                  if (validTokenAttribute == PR_FALSE || tokenAttributeValue == PR_TRUE) {
  ------------------
  |  |  437|  31.3k|#define PR_TRUE 1
  ------------------
  |  Branch (5447:9): [True: 2, False: 31.3k]
  |  Branch (5447:44): [True: 31.3k, False: 0]
  ------------------
 5448|  31.3k|        crv = sftk_searchTokenList(slot, search, pTemplate, ulCount, isLoggedIn);
 5449|  31.3k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5449:13): [True: 0, False: 31.3k]
  ------------------
 5450|      0|            goto loser;
 5451|      0|        }
 5452|  31.3k|    }
 5453|       |
 5454|       |    // Search over the session object list if the template's CKA_TOKEN attribute is set to
 5455|       |    // CK_FALSE or if it is not set.
 5456|  31.3k|    if (validTokenAttribute == PR_FALSE || tokenAttributeValue == PR_FALSE) {
  ------------------
  |  |  438|  62.6k|#define PR_FALSE 0
  ------------------
                  if (validTokenAttribute == PR_FALSE || tokenAttributeValue == PR_FALSE) {
  ------------------
  |  |  438|  31.3k|#define PR_FALSE 0
  ------------------
  |  Branch (5456:9): [True: 2, False: 31.3k]
  |  Branch (5456:44): [True: 0, False: 31.3k]
  ------------------
 5457|      2|        crv = sftk_searchObjectList(search, slot->sessObjHashTable,
 5458|      2|                                    slot->sessObjHashSize, slot->objectLock,
 5459|      2|                                    pTemplate, ulCount, isLoggedIn);
 5460|      2|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5460:13): [True: 0, False: 2]
  ------------------
 5461|      0|            goto loser;
 5462|      0|        }
 5463|      2|    }
 5464|       |
 5465|  31.3k|    if ((freeSearch = session->search) != NULL) {
  ------------------
  |  Branch (5465:9): [True: 0, False: 31.3k]
  ------------------
 5466|      0|        session->search = NULL;
 5467|      0|        sftk_FreeSearch(freeSearch);
 5468|      0|    }
 5469|  31.3k|    session->search = search;
 5470|  31.3k|    sftk_FreeSession(session);
 5471|  31.3k|    return CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 5472|       |
 5473|      0|loser:
 5474|      0|    if (search) {
  ------------------
  |  Branch (5474:9): [True: 0, False: 0]
  ------------------
 5475|      0|        sftk_FreeSearch(search);
 5476|      0|    }
 5477|      0|    if (session) {
  ------------------
  |  Branch (5477:9): [True: 0, False: 0]
  ------------------
 5478|      0|        sftk_FreeSession(session);
 5479|      0|    }
 5480|      0|    return crv;
 5481|  31.3k|}
NSC_FindObjects:
 5489|  31.3k|{
 5490|  31.3k|    SFTKSession *session;
 5491|  31.3k|    SFTKSearchResults *search;
 5492|  31.3k|    int transfer;
 5493|  31.3k|    int left;
 5494|       |
 5495|  31.3k|    CHECK_FORK();
 5496|       |
 5497|  31.3k|    *pulObjectCount = 0;
 5498|  31.3k|    session = sftk_SessionFromHandle(hSession);
 5499|  31.3k|    if (session == NULL)
  ------------------
  |  Branch (5499:9): [True: 0, False: 31.3k]
  ------------------
 5500|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5501|  31.3k|    if (session->search == NULL) {
  ------------------
  |  Branch (5501:9): [True: 0, False: 31.3k]
  ------------------
 5502|      0|        sftk_FreeSession(session);
 5503|      0|        return CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
 5504|      0|    }
 5505|  31.3k|    search = session->search;
 5506|  31.3k|    left = session->search->size - session->search->index;
 5507|  31.3k|    transfer = ((int)ulMaxObjectCount > left) ? left : ulMaxObjectCount;
  ------------------
  |  Branch (5507:16): [True: 31.3k, False: 0]
  ------------------
 5508|  31.3k|    if (transfer > 0) {
  ------------------
  |  Branch (5508:9): [True: 0, False: 31.3k]
  ------------------
 5509|      0|        PORT_Memcpy(phObject, &search->handles[search->index],
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 5510|      0|                    transfer * sizeof(CK_OBJECT_HANDLE));
 5511|  31.3k|    } else {
 5512|  31.3k|        *phObject = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  31.3k|#define CK_INVALID_HANDLE 0
  ------------------
 5513|  31.3k|    }
 5514|       |
 5515|  31.3k|    search->index += transfer;
 5516|  31.3k|    if (search->index == search->size) {
  ------------------
  |  Branch (5516:9): [True: 31.3k, False: 0]
  ------------------
 5517|  31.3k|        session->search = NULL;
 5518|  31.3k|        sftk_FreeSearch(search);
 5519|  31.3k|    }
 5520|  31.3k|    *pulObjectCount = transfer;
 5521|  31.3k|    sftk_FreeSession(session);
 5522|  31.3k|    return CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 5523|  31.3k|}
NSC_FindObjectsFinal:
 5528|  31.3k|{
 5529|  31.3k|    SFTKSession *session;
 5530|  31.3k|    SFTKSearchResults *search;
 5531|       |
 5532|  31.3k|    CHECK_FORK();
 5533|       |
 5534|  31.3k|    session = sftk_SessionFromHandle(hSession);
 5535|  31.3k|    if (session == NULL)
  ------------------
  |  Branch (5535:9): [True: 0, False: 31.3k]
  ------------------
 5536|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5537|  31.3k|    search = session->search;
 5538|  31.3k|    session->search = NULL;
 5539|  31.3k|    sftk_FreeSession(session);
 5540|  31.3k|    if (search != NULL) {
  ------------------
  |  Branch (5540:9): [True: 0, False: 31.3k]
  ------------------
 5541|      0|        sftk_FreeSearch(search);
 5542|      0|    }
 5543|  31.3k|    return CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 5544|  31.3k|}
pkcs11.c:sftk_handleDataObject:
  805|  2.58k|{
  806|  2.58k|    CK_RV crv;
  807|       |
  808|       |    /* first reject private and token data objects */
  809|  2.58k|    if (sftk_isTrue(object, CKA_PRIVATE) || sftk_isTrue(object, CKA_TOKEN)) {
  ------------------
  |  |  513|  2.58k|#define CKA_PRIVATE 0x00000002UL
  ------------------
                  if (sftk_isTrue(object, CKA_PRIVATE) || sftk_isTrue(object, CKA_TOKEN)) {
  ------------------
  |  |  512|  2.58k|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (809:9): [True: 0, False: 2.58k]
  |  Branch (809:45): [True: 0, False: 2.58k]
  ------------------
  810|      0|        return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  811|      0|    }
  812|       |
  813|       |    /* now just verify the required date fields */
  814|  2.58k|    crv = sftk_defaultAttribute(object, CKA_APPLICATION, NULL, 0);
  ------------------
  |  |  515|  2.58k|#define CKA_APPLICATION 0x00000010UL
  ------------------
  815|  2.58k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  2.58k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (815:9): [True: 0, False: 2.58k]
  ------------------
  816|      0|        return crv;
  817|  2.58k|    crv = sftk_defaultAttribute(object, CKA_VALUE, NULL, 0);
  ------------------
  |  |  516|  2.58k|#define CKA_VALUE 0x00000011UL
  ------------------
  818|  2.58k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  2.58k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (818:9): [True: 0, False: 2.58k]
  ------------------
  819|      0|        return crv;
  820|       |
  821|  2.58k|    return CKR_OK;
  ------------------
  |  | 1388|  2.58k|#define CKR_OK 0x00000000UL
  ------------------
  822|  2.58k|}
pkcs11.c:sftk_handleKeyObject:
 1552|  59.9k|{
 1553|  59.9k|    SFTKAttribute *attribute;
 1554|  59.9k|    CK_KEY_TYPE key_type;
 1555|  59.9k|    CK_BBOOL ckfalse = CK_FALSE;
  ------------------
  |  |   23|  59.9k|#define CK_FALSE 0
  ------------------
 1556|  59.9k|    CK_RV crv;
 1557|       |
 1558|       |    /* verify the required fields */
 1559|  59.9k|    if (!sftk_hasAttribute(object, CKA_KEY_TYPE)) {
  ------------------
  |  |  543|  59.9k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
  |  Branch (1559:9): [True: 0, False: 59.9k]
  ------------------
 1560|      0|        return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1561|      0|    }
 1562|       |
 1563|       |    /* now verify the common fields */
 1564|  59.9k|    crv = sftk_defaultAttribute(object, CKA_ID, NULL, 0);
  ------------------
  |  |  545|  59.9k|#define CKA_ID 0x00000102UL
  ------------------
 1565|  59.9k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  59.9k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1565:9): [True: 0, False: 59.9k]
  ------------------
 1566|      0|        return crv;
 1567|  59.9k|    crv = sftk_defaultAttribute(object, CKA_START_DATE, NULL, 0);
  ------------------
  |  |  556|  59.9k|#define CKA_START_DATE 0x00000110UL
  ------------------
 1568|  59.9k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  59.9k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1568:9): [True: 0, False: 59.9k]
  ------------------
 1569|      0|        return crv;
 1570|  59.9k|    crv = sftk_defaultAttribute(object, CKA_END_DATE, NULL, 0);
  ------------------
  |  |  557|  59.9k|#define CKA_END_DATE 0x00000111UL
  ------------------
 1571|  59.9k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  59.9k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1571:9): [True: 0, False: 59.9k]
  ------------------
 1572|      0|        return crv;
 1573|       |    /* CKA_DERIVE is common to all keys, but it's default value is
 1574|       |     * key dependent */
 1575|  59.9k|    crv = sftk_defaultAttribute(object, CKA_LOCAL, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  586|  59.9k|#define CKA_LOCAL 0x00000163UL
  ------------------
 1576|  59.9k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  59.9k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1576:9): [True: 0, False: 59.9k]
  ------------------
 1577|      0|        return crv;
 1578|       |
 1579|       |    /* get the key type */
 1580|  59.9k|    attribute = sftk_FindAttribute(object, CKA_KEY_TYPE);
  ------------------
  |  |  543|  59.9k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 1581|  59.9k|    if (!attribute) {
  ------------------
  |  Branch (1581:9): [True: 0, False: 59.9k]
  ------------------
 1582|      0|        return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 1583|      0|    }
 1584|  59.9k|    key_type = *(CK_KEY_TYPE *)attribute->attrib.pValue;
 1585|  59.9k|    sftk_FreeAttribute(attribute);
 1586|       |
 1587|  59.9k|    switch (object->objclass) {
 1588|  13.9k|        case CKO_PUBLIC_KEY:
  ------------------
  |  |  327|  13.9k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
  |  Branch (1588:9): [True: 13.9k, False: 46.0k]
  ------------------
 1589|  13.9k|            return sftk_handlePublicKeyObject(session, object, key_type);
 1590|  9.81k|        case CKO_PRIVATE_KEY:
  ------------------
  |  |  328|  9.81k|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
  |  Branch (1590:9): [True: 9.81k, False: 50.1k]
  ------------------
 1591|  9.81k|            return sftk_handlePrivateKeyObject(session, object, key_type);
 1592|  36.2k|        case CKO_SECRET_KEY:
  ------------------
  |  |  329|  36.2k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
  |  Branch (1592:9): [True: 36.2k, False: 23.7k]
  ------------------
 1593|       |            /* make sure the required fields exist */
 1594|  36.2k|            return sftk_handleSecretKeyObject(session, object, key_type,
 1595|  36.2k|                                              (PRBool)(sftk_isFIPS(session->slot->slotID)));
  ------------------
  |  |  506|  36.2k|    (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  500|  36.2k|#define FIPS_SLOT_ID 3
  |  |  ------------------
  |  |                   (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  567|  36.2k|#define SFTK_MIN_FIPS_USER_SLOT_ID 101
  |  |  ------------------
  |  |  |  Branch (506:6): [True: 0, False: 36.2k]
  |  |  |  Branch (506:32): [True: 0, False: 36.2k]
  |  |  ------------------
  ------------------
 1596|      0|        default:
  ------------------
  |  Branch (1596:9): [True: 0, False: 59.9k]
  ------------------
 1597|      0|            break;
 1598|  59.9k|    }
 1599|      0|    return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 1600|  59.9k|}
pkcs11.c:sftk_handlePublicKeyObject:
 1031|  13.9k|{
 1032|  13.9k|    CK_BBOOL encrypt = CK_TRUE;
  ------------------
  |  |   22|  13.9k|#define CK_TRUE 1
  ------------------
 1033|  13.9k|    CK_BBOOL recover = CK_TRUE;
  ------------------
  |  |   22|  13.9k|#define CK_TRUE 1
  ------------------
 1034|  13.9k|    CK_BBOOL wrap = CK_TRUE;
  ------------------
  |  |   22|  13.9k|#define CK_TRUE 1
  ------------------
 1035|  13.9k|    CK_BBOOL derive = CK_FALSE;
  ------------------
  |  |   23|  13.9k|#define CK_FALSE 0
  ------------------
 1036|  13.9k|    CK_BBOOL verify = CK_TRUE;
  ------------------
  |  |   22|  13.9k|#define CK_TRUE 1
  ------------------
 1037|  13.9k|    CK_RV crv;
 1038|       |
 1039|  13.9k|    switch (key_type) {
 1040|  2.92k|        case CKK_RSA:
  ------------------
  |  |  372|  2.92k|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (1040:9): [True: 2.92k, False: 11.0k]
  ------------------
 1041|  2.92k|            crv = sftk_ConstrainAttribute(object, CKA_MODULUS,
  ------------------
  |  |  558|  2.92k|#define CKA_MODULUS 0x00000120UL
  ------------------
 1042|  2.92k|                                          RSA_MIN_MODULUS_BITS, 0, 0);
  ------------------
  |  |  151|  2.92k|#define RSA_MIN_MODULUS_BITS 128
  ------------------
 1043|  2.92k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  2.92k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1043:17): [True: 0, False: 2.92k]
  ------------------
 1044|      0|                return crv;
 1045|      0|            }
 1046|  2.92k|            crv = sftk_ConstrainAttribute(object, CKA_PUBLIC_EXPONENT, 2, 0, 0);
  ------------------
  |  |  560|  2.92k|#define CKA_PUBLIC_EXPONENT 0x00000122UL
  ------------------
 1047|  2.92k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  2.92k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1047:17): [True: 335, False: 2.58k]
  ------------------
 1048|    335|                return crv;
 1049|    335|            }
 1050|  2.58k|            break;
 1051|  2.58k|        case CKK_DSA:
  ------------------
  |  |  373|    918|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (1051:9): [True: 918, False: 13.0k]
  ------------------
 1052|    918|            crv = sftk_ConstrainAttribute(object, CKA_SUBPRIME,
  ------------------
  |  |  570|    918|#define CKA_SUBPRIME 0x00000131UL
  ------------------
 1053|    918|                                          DSA_MIN_Q_BITS, DSA_MAX_Q_BITS, 0);
  ------------------
  |  |  200|    918|#define DSA_MIN_Q_BITS 160
  ------------------
                                                        DSA_MIN_Q_BITS, DSA_MAX_Q_BITS, 0);
  ------------------
  |  |  199|    918|#define DSA_MAX_Q_BITS 256
  ------------------
 1054|    918|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|    918|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1054:17): [True: 0, False: 918]
  ------------------
 1055|      0|                return crv;
 1056|      0|            }
 1057|    918|            crv = sftk_ConstrainAttribute(object, CKA_PRIME,
  ------------------
  |  |  569|    918|#define CKA_PRIME 0x00000130UL
  ------------------
 1058|    918|                                          DSA_MIN_P_BITS, DSA_MAX_P_BITS, 64);
  ------------------
  |  |  198|    918|#define DSA_MIN_P_BITS 512
  ------------------
                                                        DSA_MIN_P_BITS, DSA_MAX_P_BITS, 64);
  ------------------
  |  |  197|    918|#define DSA_MAX_P_BITS 3072
  ------------------
 1059|    918|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|    918|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1059:17): [True: 4, False: 914]
  ------------------
 1060|      4|                return crv;
 1061|      4|            }
 1062|    914|            crv = sftk_ConstrainAttribute(object, CKA_BASE, 2, DSA_MAX_P_BITS, 0);
  ------------------
  |  |  571|    914|#define CKA_BASE 0x00000132UL
  ------------------
                          crv = sftk_ConstrainAttribute(object, CKA_BASE, 2, DSA_MAX_P_BITS, 0);
  ------------------
  |  |  197|    914|#define DSA_MAX_P_BITS 3072
  ------------------
 1063|    914|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|    914|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1063:17): [True: 0, False: 914]
  ------------------
 1064|      0|                return crv;
 1065|      0|            }
 1066|    914|            crv = sftk_ConstrainAttribute(object, CKA_VALUE, 2, DSA_MAX_P_BITS, 0);
  ------------------
  |  |  516|    914|#define CKA_VALUE 0x00000011UL
  ------------------
                          crv = sftk_ConstrainAttribute(object, CKA_VALUE, 2, DSA_MAX_P_BITS, 0);
  ------------------
  |  |  197|    914|#define DSA_MAX_P_BITS 3072
  ------------------
 1067|    914|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|    914|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1067:17): [True: 0, False: 914]
  ------------------
 1068|      0|                return crv;
 1069|      0|            }
 1070|    914|            encrypt = CK_FALSE;
  ------------------
  |  |   23|    914|#define CK_FALSE 0
  ------------------
 1071|    914|            recover = CK_FALSE;
  ------------------
  |  |   23|    914|#define CK_FALSE 0
  ------------------
 1072|    914|            wrap = CK_FALSE;
  ------------------
  |  |   23|    914|#define CK_FALSE 0
  ------------------
 1073|    914|            break;
 1074|  1.91k|        case CKK_DH:
  ------------------
  |  |  374|  1.91k|#define CKK_DH 0x00000002UL
  ------------------
  |  Branch (1074:9): [True: 1.91k, False: 12.0k]
  ------------------
 1075|  1.91k|            crv = sftk_ConstrainAttribute(object, CKA_PRIME,
  ------------------
  |  |  569|  1.91k|#define CKA_PRIME 0x00000130UL
  ------------------
 1076|  1.91k|                                          DH_MIN_P_BITS, DH_MAX_P_BITS, 0);
  ------------------
  |  |  154|  1.91k|#define DH_MIN_P_BITS 128
  ------------------
                                                        DH_MIN_P_BITS, DH_MAX_P_BITS, 0);
  ------------------
  |  |  155|  1.91k|#define DH_MAX_P_BITS 16384
  ------------------
 1077|  1.91k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1077:17): [True: 0, False: 1.91k]
  ------------------
 1078|      0|                return crv;
 1079|      0|            }
 1080|  1.91k|            crv = sftk_ConstrainAttribute(object, CKA_BASE, 2, DH_MAX_P_BITS, 0);
  ------------------
  |  |  571|  1.91k|#define CKA_BASE 0x00000132UL
  ------------------
                          crv = sftk_ConstrainAttribute(object, CKA_BASE, 2, DH_MAX_P_BITS, 0);
  ------------------
  |  |  155|  1.91k|#define DH_MAX_P_BITS 16384
  ------------------
 1081|  1.91k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1081:17): [True: 1, False: 1.91k]
  ------------------
 1082|      1|                return crv;
 1083|      1|            }
 1084|  1.91k|            crv = sftk_ConstrainAttribute(object, CKA_VALUE, 2, DH_MAX_P_BITS, 0);
  ------------------
  |  |  516|  1.91k|#define CKA_VALUE 0x00000011UL
  ------------------
                          crv = sftk_ConstrainAttribute(object, CKA_VALUE, 2, DH_MAX_P_BITS, 0);
  ------------------
  |  |  155|  1.91k|#define DH_MAX_P_BITS 16384
  ------------------
 1085|  1.91k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1085:17): [True: 0, False: 1.91k]
  ------------------
 1086|      0|                return crv;
 1087|      0|            }
 1088|  1.91k|            verify = CK_FALSE;
  ------------------
  |  |   23|  1.91k|#define CK_FALSE 0
  ------------------
 1089|  1.91k|            derive = CK_TRUE;
  ------------------
  |  |   22|  1.91k|#define CK_TRUE 1
  ------------------
 1090|  1.91k|            encrypt = CK_FALSE;
  ------------------
  |  |   23|  1.91k|#define CK_FALSE 0
  ------------------
 1091|  1.91k|            recover = CK_FALSE;
  ------------------
  |  |   23|  1.91k|#define CK_FALSE 0
  ------------------
 1092|  1.91k|            wrap = CK_FALSE;
  ------------------
  |  |   23|  1.91k|#define CK_FALSE 0
  ------------------
 1093|  1.91k|            break;
 1094|      0|        case CKK_EC_MONTGOMERY:
  ------------------
  |  |  449|      0|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (1094:9): [True: 0, False: 13.9k]
  ------------------
 1095|      0|        case CKK_EC_EDWARDS:
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (1095:9): [True: 0, False: 13.9k]
  ------------------
 1096|  8.22k|        case CKK_EC:
  ------------------
  |  |  379|  8.22k|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (1096:9): [True: 8.22k, False: 5.75k]
  ------------------
 1097|  8.22k|            if (!sftk_hasAttribute(object, CKA_EC_PARAMS)) {
  ------------------
  |  |  602|  8.22k|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
  |  Branch (1097:17): [True: 0, False: 8.22k]
  ------------------
 1098|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1099|      0|            }
 1100|  8.22k|            if (!sftk_hasAttribute(object, CKA_EC_POINT)) {
  ------------------
  |  |  604|  8.22k|#define CKA_EC_POINT 0x00000181UL
  ------------------
  |  Branch (1100:17): [True: 0, False: 8.22k]
  ------------------
 1101|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1102|      0|            }
 1103|       |            /* for ECDSA and EDDSA. Change if the structure of any of them is modified. */
 1104|  8.22k|            derive = (key_type == CKK_EC_EDWARDS) ? CK_FALSE : CK_TRUE;    /* CK_TRUE for ECDH */
  ------------------
  |  |  448|  8.22k|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
                          derive = (key_type == CKK_EC_EDWARDS) ? CK_FALSE : CK_TRUE;    /* CK_TRUE for ECDH */
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
                          derive = (key_type == CKK_EC_EDWARDS) ? CK_FALSE : CK_TRUE;    /* CK_TRUE for ECDH */
  ------------------
  |  |   22|  16.4k|#define CK_TRUE 1
  ------------------
  |  Branch (1104:22): [True: 0, False: 8.22k]
  ------------------
 1105|  8.22k|            verify = (key_type == CKK_EC_MONTGOMERY) ? CK_FALSE : CK_TRUE; /* for ECDSA and EDDSA */
  ------------------
  |  |  449|  8.22k|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
                          verify = (key_type == CKK_EC_MONTGOMERY) ? CK_FALSE : CK_TRUE; /* for ECDSA and EDDSA */
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
                          verify = (key_type == CKK_EC_MONTGOMERY) ? CK_FALSE : CK_TRUE; /* for ECDSA and EDDSA */
  ------------------
  |  |   22|  16.4k|#define CK_TRUE 1
  ------------------
  |  Branch (1105:22): [True: 0, False: 8.22k]
  ------------------
 1106|  8.22k|            encrypt = CK_FALSE;
  ------------------
  |  |   23|  8.22k|#define CK_FALSE 0
  ------------------
 1107|  8.22k|            recover = CK_FALSE;
  ------------------
  |  |   23|  8.22k|#define CK_FALSE 0
  ------------------
 1108|  8.22k|            wrap = CK_FALSE;
  ------------------
  |  |   23|  8.22k|#define CK_FALSE 0
  ------------------
 1109|  8.22k|            break;
 1110|      0|        case CKK_NSS_KYBER:
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1110:9): [True: 0, False: 13.9k]
  ------------------
 1111|      0|        case CKK_NSS_ML_KEM:
  ------------------
  |  |   59|      0|#define CKK_NSS_ML_KEM (CKK_NSS + 6)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1111:9): [True: 0, False: 13.9k]
  ------------------
 1112|      0|            if (!sftk_hasAttribute(object, CKA_NSS_PARAMETER_SET)) {
  ------------------
  |  |  113|      0|#define CKA_NSS_PARAMETER_SET (CKA_NSS + 40)
  |  |  ------------------
  |  |  |  |   77|      0|#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  692|      0|#define CKA_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1112:17): [True: 0, False: 0]
  ------------------
 1113|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1114|      0|            }
 1115|      0|            derive = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 1116|      0|            verify = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 1117|      0|            encrypt = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 1118|      0|            recover = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 1119|      0|            wrap = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 1120|      0|            break;
 1121|      0|        default:
  ------------------
  |  Branch (1121:9): [True: 0, False: 13.9k]
  ------------------
 1122|      0|            return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 1123|  13.9k|    }
 1124|       |
 1125|       |    /* make sure the required fields exist */
 1126|  13.6k|    crv = sftk_defaultAttribute(object, CKA_SUBJECT, NULL, 0);
  ------------------
  |  |  544|  13.6k|#define CKA_SUBJECT 0x00000101UL
  ------------------
 1127|  13.6k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  13.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1127:9): [True: 0, False: 13.6k]
  ------------------
 1128|      0|        return crv;
 1129|  13.6k|    crv = sftk_defaultAttribute(object, CKA_ENCRYPT, &encrypt, sizeof(CK_BBOOL));
  ------------------
  |  |  547|  13.6k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 1130|  13.6k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  13.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1130:9): [True: 0, False: 13.6k]
  ------------------
 1131|      0|        return crv;
 1132|  13.6k|    crv = sftk_defaultAttribute(object, CKA_VERIFY, &verify, sizeof(CK_BBOOL));
  ------------------
  |  |  553|  13.6k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 1133|  13.6k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  13.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1133:9): [True: 0, False: 13.6k]
  ------------------
 1134|      0|        return crv;
 1135|  13.6k|    crv = sftk_defaultAttribute(object, CKA_VERIFY_RECOVER,
  ------------------
  |  |  554|  13.6k|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
 1136|  13.6k|                                &recover, sizeof(CK_BBOOL));
 1137|  13.6k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  13.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1137:9): [True: 0, False: 13.6k]
  ------------------
 1138|      0|        return crv;
 1139|  13.6k|    crv = sftk_defaultAttribute(object, CKA_WRAP, &wrap, sizeof(CK_BBOOL));
  ------------------
  |  |  549|  13.6k|#define CKA_WRAP 0x00000106UL
  ------------------
 1140|  13.6k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  13.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1140:9): [True: 0, False: 13.6k]
  ------------------
 1141|      0|        return crv;
 1142|  13.6k|    crv = sftk_defaultAttribute(object, CKA_DERIVE, &derive, sizeof(CK_BBOOL));
  ------------------
  |  |  555|  13.6k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 1143|  13.6k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  13.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1143:9): [True: 0, False: 13.6k]
  ------------------
 1144|      0|        return crv;
 1145|       |
 1146|  13.6k|    object->objectInfo = sftk_GetPubKey(object, key_type, &crv);
 1147|  13.6k|    if (object->objectInfo == NULL) {
  ------------------
  |  Branch (1147:9): [True: 127, False: 13.5k]
  ------------------
 1148|    127|        return crv;
 1149|    127|    }
 1150|  13.5k|    object->infoFree = SFTKFree_nsslowkey_DestroyPublicKey;
 1151|       |
 1152|       |    /* Check that an imported EC key is valid */
 1153|  13.5k|    if (key_type == CKK_EC || key_type == CKK_EC_EDWARDS || key_type == CKK_EC_MONTGOMERY) {
  ------------------
  |  |  379|  27.0k|#define CKK_EC 0x00000003UL
  ------------------
                  if (key_type == CKK_EC || key_type == CKK_EC_EDWARDS || key_type == CKK_EC_MONTGOMERY) {
  ------------------
  |  |  448|  18.9k|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
                  if (key_type == CKK_EC || key_type == CKK_EC_EDWARDS || key_type == CKK_EC_MONTGOMERY) {
  ------------------
  |  |  449|  5.41k|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (1153:9): [True: 8.09k, False: 5.41k]
  |  Branch (1153:31): [True: 0, False: 5.41k]
  |  Branch (1153:61): [True: 0, False: 5.41k]
  ------------------
 1154|  8.09k|        NSSLOWKEYPublicKey *pubKey = (NSSLOWKEYPublicKey *)object->objectInfo;
 1155|  8.09k|        SECStatus rv = EC_ValidatePublicKey(&pubKey->u.ec.ecParams,
 1156|  8.09k|                                            &pubKey->u.ec.publicValue);
 1157|       |
 1158|  8.09k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1158:13): [True: 104, False: 7.99k]
  ------------------
 1159|    104|            return CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|    104|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 1160|    104|        }
 1161|  8.09k|    }
 1162|       |
 1163|  13.4k|    if (sftk_isTrue(object, CKA_TOKEN)) {
  ------------------
  |  |  512|  13.4k|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (1163:9): [True: 0, False: 13.4k]
  ------------------
 1164|      0|        SFTKSlot *slot = session->slot;
 1165|      0|        SFTKDBHandle *certHandle = sftk_getCertDB(slot);
 1166|       |
 1167|      0|        if (certHandle == NULL) {
  ------------------
  |  Branch (1167:13): [True: 0, False: 0]
  ------------------
 1168|      0|            return CKR_TOKEN_WRITE_PROTECTED;
  ------------------
  |  | 1481|      0|#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2UL
  ------------------
 1169|      0|        }
 1170|       |
 1171|      0|        crv = sftkdb_write(certHandle, object, &object->handle);
 1172|      0|        sftk_freeDB(certHandle);
 1173|      0|        return crv;
 1174|      0|    }
 1175|       |
 1176|  13.4k|    return CKR_OK;
  ------------------
  |  | 1388|  13.4k|#define CKR_OK 0x00000000UL
  ------------------
 1177|  13.4k|}
pkcs11.c:sftk_handlePrivateKeyObject:
 1190|  9.81k|{
 1191|  9.81k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  9.81k|#define CK_TRUE 1
  ------------------
 1192|  9.81k|    CK_BBOOL encrypt = CK_TRUE;
  ------------------
  |  |   22|  9.81k|#define CK_TRUE 1
  ------------------
 1193|  9.81k|    CK_BBOOL sign = CK_FALSE;
  ------------------
  |  |   23|  9.81k|#define CK_FALSE 0
  ------------------
 1194|  9.81k|    CK_BBOOL recover = CK_TRUE;
  ------------------
  |  |   22|  9.81k|#define CK_TRUE 1
  ------------------
 1195|  9.81k|    CK_BBOOL wrap = CK_TRUE;
  ------------------
  |  |   22|  9.81k|#define CK_TRUE 1
  ------------------
 1196|  9.81k|    CK_BBOOL derive = CK_TRUE;
  ------------------
  |  |   22|  9.81k|#define CK_TRUE 1
  ------------------
 1197|  9.81k|    CK_BBOOL ckfalse = CK_FALSE;
  ------------------
  |  |   23|  9.81k|#define CK_FALSE 0
  ------------------
 1198|  9.81k|    PRBool createObjectInfo = PR_TRUE;
  ------------------
  |  |  437|  9.81k|#define PR_TRUE 1
  ------------------
 1199|  9.81k|    PRBool fillPrivateKey = PR_FALSE;
  ------------------
  |  |  438|  9.81k|#define PR_FALSE 0
  ------------------
 1200|  9.81k|    int missing_rsa_mod_component = 0;
 1201|  9.81k|    int missing_rsa_exp_component = 0;
 1202|  9.81k|    int missing_rsa_crt_component = 0;
 1203|       |
 1204|  9.81k|    SECItem mod;
 1205|  9.81k|    CK_RV crv;
 1206|  9.81k|    SECStatus rv;
 1207|       |
 1208|  9.81k|    switch (key_type) {
 1209|      0|        case CKK_RSA:
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (1209:9): [True: 0, False: 9.81k]
  ------------------
 1210|      0|            if (!sftk_hasAttribute(object, CKA_MODULUS)) {
  ------------------
  |  |  558|      0|#define CKA_MODULUS 0x00000120UL
  ------------------
  |  Branch (1210:17): [True: 0, False: 0]
  ------------------
 1211|      0|                missing_rsa_mod_component++;
 1212|      0|            }
 1213|      0|            if (!sftk_hasAttribute(object, CKA_PUBLIC_EXPONENT)) {
  ------------------
  |  |  560|      0|#define CKA_PUBLIC_EXPONENT 0x00000122UL
  ------------------
  |  Branch (1213:17): [True: 0, False: 0]
  ------------------
 1214|      0|                missing_rsa_exp_component++;
 1215|      0|            }
 1216|      0|            if (!sftk_hasAttribute(object, CKA_PRIVATE_EXPONENT)) {
  ------------------
  |  |  561|      0|#define CKA_PRIVATE_EXPONENT 0x00000123UL
  ------------------
  |  Branch (1216:17): [True: 0, False: 0]
  ------------------
 1217|      0|                missing_rsa_exp_component++;
 1218|      0|            }
 1219|      0|            if (!sftk_hasAttribute(object, CKA_PRIME_1)) {
  ------------------
  |  |  562|      0|#define CKA_PRIME_1 0x00000124UL
  ------------------
  |  Branch (1219:17): [True: 0, False: 0]
  ------------------
 1220|      0|                missing_rsa_mod_component++;
 1221|      0|            }
 1222|      0|            if (!sftk_hasAttribute(object, CKA_PRIME_2)) {
  ------------------
  |  |  563|      0|#define CKA_PRIME_2 0x00000125UL
  ------------------
  |  Branch (1222:17): [True: 0, False: 0]
  ------------------
 1223|      0|                missing_rsa_mod_component++;
 1224|      0|            }
 1225|      0|            if (!sftk_hasAttribute(object, CKA_EXPONENT_1)) {
  ------------------
  |  |  564|      0|#define CKA_EXPONENT_1 0x00000126UL
  ------------------
  |  Branch (1225:17): [True: 0, False: 0]
  ------------------
 1226|      0|                missing_rsa_crt_component++;
 1227|      0|            }
 1228|      0|            if (!sftk_hasAttribute(object, CKA_EXPONENT_2)) {
  ------------------
  |  |  565|      0|#define CKA_EXPONENT_2 0x00000127UL
  ------------------
  |  Branch (1228:17): [True: 0, False: 0]
  ------------------
 1229|      0|                missing_rsa_crt_component++;
 1230|      0|            }
 1231|      0|            if (!sftk_hasAttribute(object, CKA_COEFFICIENT)) {
  ------------------
  |  |  566|      0|#define CKA_COEFFICIENT 0x00000128UL
  ------------------
  |  Branch (1231:17): [True: 0, False: 0]
  ------------------
 1232|      0|                missing_rsa_crt_component++;
 1233|      0|            }
 1234|      0|            if (missing_rsa_mod_component || missing_rsa_exp_component ||
  ------------------
  |  Branch (1234:17): [True: 0, False: 0]
  |  Branch (1234:46): [True: 0, False: 0]
  ------------------
 1235|      0|                missing_rsa_crt_component) {
  ------------------
  |  Branch (1235:17): [True: 0, False: 0]
  ------------------
 1236|       |                /* we are missing a component, see if we have enough to rebuild
 1237|       |                 * the rest */
 1238|      0|                int have_exp = 2 - missing_rsa_exp_component;
 1239|      0|                int have_component = 5 -
 1240|      0|                                     (missing_rsa_exp_component + missing_rsa_mod_component);
 1241|       |
 1242|      0|                if ((have_exp == 0) || (have_component < 3)) {
  ------------------
  |  Branch (1242:21): [True: 0, False: 0]
  |  Branch (1242:40): [True: 0, False: 0]
  ------------------
 1243|       |                    /* nope, not enough to reconstruct the private key */
 1244|      0|                    return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1245|      0|                }
 1246|      0|                fillPrivateKey = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1247|      0|            }
 1248|       |            /*verify the parameters for consistency*/
 1249|      0|            rv = sftk_verifyRSAPrivateKey(object, fillPrivateKey);
 1250|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (1250:17): [True: 0, False: 0]
  ------------------
 1251|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1252|      0|            }
 1253|       |
 1254|       |            /* make sure Netscape DB attribute is set correctly */
 1255|      0|            crv = sftk_Attribute2SSecItem(NULL, &mod, object, CKA_MODULUS);
  ------------------
  |  |  558|      0|#define CKA_MODULUS 0x00000120UL
  ------------------
 1256|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1256:17): [True: 0, False: 0]
  ------------------
 1257|      0|                return crv;
 1258|      0|            crv = sftk_forceAttribute(object, CKA_NSS_DB,
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 1259|      0|                                      sftk_item_expand(&mod));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 1260|      0|            if (mod.data)
  ------------------
  |  Branch (1260:17): [True: 0, False: 0]
  ------------------
 1261|      0|                SECITEM_ZfreeItem(&mod, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&mod, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1262|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1262:17): [True: 0, False: 0]
  ------------------
 1263|      0|                return crv;
 1264|       |
 1265|      0|            sign = CK_TRUE;
  ------------------
  |  |   22|      0|#define CK_TRUE 1
  ------------------
 1266|      0|            derive = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 1267|      0|            break;
 1268|      0|        case CKK_DSA:
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (1268:9): [True: 0, False: 9.81k]
  ------------------
 1269|      0|            if (!sftk_hasAttribute(object, CKA_SUBPRIME)) {
  ------------------
  |  |  570|      0|#define CKA_SUBPRIME 0x00000131UL
  ------------------
  |  Branch (1269:17): [True: 0, False: 0]
  ------------------
 1270|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1271|      0|            }
 1272|      0|            sign = CK_TRUE;
  ------------------
  |  |   22|      0|#define CK_TRUE 1
  ------------------
 1273|      0|            derive = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 1274|       |        /* fall through */
 1275|  1.91k|        case CKK_DH:
  ------------------
  |  |  374|  1.91k|#define CKK_DH 0x00000002UL
  ------------------
  |  Branch (1275:9): [True: 1.91k, False: 7.90k]
  ------------------
 1276|  1.91k|            if (!sftk_hasAttribute(object, CKA_PRIME)) {
  ------------------
  |  |  569|  1.91k|#define CKA_PRIME 0x00000130UL
  ------------------
  |  Branch (1276:17): [True: 0, False: 1.91k]
  ------------------
 1277|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1278|      0|            }
 1279|  1.91k|            if (!sftk_hasAttribute(object, CKA_BASE)) {
  ------------------
  |  |  571|  1.91k|#define CKA_BASE 0x00000132UL
  ------------------
  |  Branch (1279:17): [True: 0, False: 1.91k]
  ------------------
 1280|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1281|      0|            }
 1282|  1.91k|            if (!sftk_hasAttribute(object, CKA_VALUE)) {
  ------------------
  |  |  516|  1.91k|#define CKA_VALUE 0x00000011UL
  ------------------
  |  Branch (1282:17): [True: 0, False: 1.91k]
  ------------------
 1283|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1284|      0|            }
 1285|       |            /* allow subprime to be set after the fact */
 1286|  1.91k|            crv = sftk_defaultAttribute(object, CKA_SUBPRIME, NULL, 0);
  ------------------
  |  |  570|  1.91k|#define CKA_SUBPRIME 0x00000131UL
  ------------------
 1287|  1.91k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1287:17): [True: 0, False: 1.91k]
  ------------------
 1288|      0|                return crv;
 1289|      0|            }
 1290|  1.91k|            encrypt = CK_FALSE;
  ------------------
  |  |   23|  1.91k|#define CK_FALSE 0
  ------------------
 1291|  1.91k|            recover = CK_FALSE;
  ------------------
  |  |   23|  1.91k|#define CK_FALSE 0
  ------------------
 1292|  1.91k|            wrap = CK_FALSE;
  ------------------
  |  |   23|  1.91k|#define CK_FALSE 0
  ------------------
 1293|  1.91k|            break;
 1294|  7.90k|        case CKK_EC:
  ------------------
  |  |  379|  7.90k|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (1294:9): [True: 7.90k, False: 1.91k]
  ------------------
 1295|  7.90k|        case CKK_EC_EDWARDS:
  ------------------
  |  |  448|  7.90k|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (1295:9): [True: 0, False: 9.81k]
  ------------------
 1296|  7.90k|        case CKK_EC_MONTGOMERY:
  ------------------
  |  |  449|  7.90k|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (1296:9): [True: 0, False: 9.81k]
  ------------------
 1297|  7.90k|            if (!sftk_hasAttribute(object, CKA_EC_PARAMS)) {
  ------------------
  |  |  602|  7.90k|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
  |  Branch (1297:17): [True: 0, False: 7.90k]
  ------------------
 1298|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1299|      0|            }
 1300|  7.90k|            if (!sftk_hasAttribute(object, CKA_VALUE)) {
  ------------------
  |  |  516|  7.90k|#define CKA_VALUE 0x00000011UL
  ------------------
  |  Branch (1300:17): [True: 0, False: 7.90k]
  ------------------
 1301|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1302|      0|            }
 1303|       |            /* for ECDSA and EDDSA. Change if the structure of any of them is modified. */
 1304|  7.90k|            derive = (key_type == CKK_EC_EDWARDS) ? CK_FALSE : CK_TRUE;  /* CK_TRUE for ECDH */
  ------------------
  |  |  448|  7.90k|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
                          derive = (key_type == CKK_EC_EDWARDS) ? CK_FALSE : CK_TRUE;  /* CK_TRUE for ECDH */
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
                          derive = (key_type == CKK_EC_EDWARDS) ? CK_FALSE : CK_TRUE;  /* CK_TRUE for ECDH */
  ------------------
  |  |   22|  15.8k|#define CK_TRUE 1
  ------------------
  |  Branch (1304:22): [True: 0, False: 7.90k]
  ------------------
 1305|  7.90k|            sign = (key_type == CKK_EC_MONTGOMERY) ? CK_FALSE : CK_TRUE; /* for ECDSA and EDDSA */
  ------------------
  |  |  449|  7.90k|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
                          sign = (key_type == CKK_EC_MONTGOMERY) ? CK_FALSE : CK_TRUE; /* for ECDSA and EDDSA */
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
                          sign = (key_type == CKK_EC_MONTGOMERY) ? CK_FALSE : CK_TRUE; /* for ECDSA and EDDSA */
  ------------------
  |  |   22|  15.8k|#define CK_TRUE 1
  ------------------
  |  Branch (1305:20): [True: 0, False: 7.90k]
  ------------------
 1306|  7.90k|            encrypt = CK_FALSE;
  ------------------
  |  |   23|  7.90k|#define CK_FALSE 0
  ------------------
 1307|  7.90k|            recover = CK_FALSE;
  ------------------
  |  |   23|  7.90k|#define CK_FALSE 0
  ------------------
 1308|  7.90k|            wrap = CK_FALSE;
  ------------------
  |  |   23|  7.90k|#define CK_FALSE 0
  ------------------
 1309|  7.90k|            break;
 1310|      0|        case CKK_NSS_JPAKE_ROUND1:
  ------------------
  |  |   53|      0|#define CKK_NSS_JPAKE_ROUND1 (CKK_NSS + 2)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1310:9): [True: 0, False: 9.81k]
  ------------------
 1311|      0|            if (!sftk_hasAttribute(object, CKA_PRIME) ||
  ------------------
  |  |  569|      0|#define CKA_PRIME 0x00000130UL
  ------------------
  |  Branch (1311:17): [True: 0, False: 0]
  ------------------
 1312|      0|                !sftk_hasAttribute(object, CKA_SUBPRIME) ||
  ------------------
  |  |  570|      0|#define CKA_SUBPRIME 0x00000131UL
  ------------------
  |  Branch (1312:17): [True: 0, False: 0]
  ------------------
 1313|      0|                !sftk_hasAttribute(object, CKA_BASE)) {
  ------------------
  |  |  571|      0|#define CKA_BASE 0x00000132UL
  ------------------
  |  Branch (1313:17): [True: 0, False: 0]
  ------------------
 1314|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1315|      0|            }
 1316|       |        /* fall through */
 1317|      0|        case CKK_NSS_JPAKE_ROUND2:
  ------------------
  |  |   54|      0|#define CKK_NSS_JPAKE_ROUND2 (CKK_NSS + 3)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1317:9): [True: 0, False: 9.81k]
  ------------------
 1318|       |            /* CKA_NSS_JPAKE_SIGNERID and CKA_NSS_JPAKE_PEERID are checked in
 1319|       |               the J-PAKE code. */
 1320|      0|            encrypt = sign = recover = wrap = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 1321|      0|            derive = CK_TRUE;
  ------------------
  |  |   22|      0|#define CK_TRUE 1
  ------------------
 1322|      0|            createObjectInfo = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1323|      0|            break;
 1324|      0|        case CKK_NSS_KYBER:
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1324:9): [True: 0, False: 9.81k]
  ------------------
 1325|      0|        case CKK_NSS_ML_KEM:
  ------------------
  |  |   59|      0|#define CKK_NSS_ML_KEM (CKK_NSS + 6)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1325:9): [True: 0, False: 9.81k]
  ------------------
 1326|      0|            if (!sftk_hasAttribute(object, CKA_KEY_TYPE)) {
  ------------------
  |  |  543|      0|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
  |  Branch (1326:17): [True: 0, False: 0]
  ------------------
 1327|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1328|      0|            }
 1329|      0|            if (!sftk_hasAttribute(object, CKA_VALUE)) {
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
  |  Branch (1329:17): [True: 0, False: 0]
  ------------------
 1330|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1331|      0|            }
 1332|      0|            encrypt = sign = recover = wrap = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 1333|      0|            break;
 1334|      0|        default:
  ------------------
  |  Branch (1334:9): [True: 0, False: 9.81k]
  ------------------
 1335|      0|            return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 1336|  9.81k|    }
 1337|  9.81k|    crv = sftk_defaultAttribute(object, CKA_SUBJECT, NULL, 0);
  ------------------
  |  |  544|  9.81k|#define CKA_SUBJECT 0x00000101UL
  ------------------
 1338|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1338:9): [True: 0, False: 9.81k]
  ------------------
 1339|      0|        return crv;
 1340|  9.81k|    crv = sftk_defaultAttribute(object, CKA_SENSITIVE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  546|  9.81k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
 1341|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1341:9): [True: 0, False: 9.81k]
  ------------------
 1342|      0|        return crv;
 1343|  9.81k|    crv = sftk_defaultAttribute(object, CKA_EXTRACTABLE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  585|  9.81k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
 1344|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1344:9): [True: 0, False: 9.81k]
  ------------------
 1345|      0|        return crv;
 1346|  9.81k|    crv = sftk_defaultAttribute(object, CKA_DECRYPT, &encrypt, sizeof(CK_BBOOL));
  ------------------
  |  |  548|  9.81k|#define CKA_DECRYPT 0x00000105UL
  ------------------
 1347|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1347:9): [True: 0, False: 9.81k]
  ------------------
 1348|      0|        return crv;
 1349|  9.81k|    crv = sftk_defaultAttribute(object, CKA_SIGN, &sign, sizeof(CK_BBOOL));
  ------------------
  |  |  551|  9.81k|#define CKA_SIGN 0x00000108UL
  ------------------
 1350|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1350:9): [True: 0, False: 9.81k]
  ------------------
 1351|      0|        return crv;
 1352|  9.81k|    crv = sftk_defaultAttribute(object, CKA_SIGN_RECOVER, &recover,
  ------------------
  |  |  552|  9.81k|#define CKA_SIGN_RECOVER 0x00000109UL
  ------------------
 1353|  9.81k|                                sizeof(CK_BBOOL));
 1354|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1354:9): [True: 0, False: 9.81k]
  ------------------
 1355|      0|        return crv;
 1356|  9.81k|    crv = sftk_defaultAttribute(object, CKA_UNWRAP, &wrap, sizeof(CK_BBOOL));
  ------------------
  |  |  550|  9.81k|#define CKA_UNWRAP 0x00000107UL
  ------------------
 1357|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1357:9): [True: 0, False: 9.81k]
  ------------------
 1358|      0|        return crv;
 1359|  9.81k|    crv = sftk_defaultAttribute(object, CKA_DERIVE, &derive, sizeof(CK_BBOOL));
  ------------------
  |  |  555|  9.81k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 1360|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1360:9): [True: 0, False: 9.81k]
  ------------------
 1361|      0|        return crv;
 1362|       |    /* the next two bits get modified only in the key gen and token cases */
 1363|  9.81k|    crv = sftk_forceAttribute(object, CKA_ALWAYS_SENSITIVE,
  ------------------
  |  |  588|  9.81k|#define CKA_ALWAYS_SENSITIVE 0x00000165UL
  ------------------
 1364|  9.81k|                              &ckfalse, sizeof(CK_BBOOL));
 1365|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1365:9): [True: 0, False: 9.81k]
  ------------------
 1366|      0|        return crv;
 1367|  9.81k|    crv = sftk_forceAttribute(object, CKA_NEVER_EXTRACTABLE,
  ------------------
  |  |  587|  9.81k|#define CKA_NEVER_EXTRACTABLE 0x00000164UL
  ------------------
 1368|  9.81k|                              &ckfalse, sizeof(CK_BBOOL));
 1369|  9.81k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1369:9): [True: 0, False: 9.81k]
  ------------------
 1370|      0|        return crv;
 1371|       |
 1372|       |    /* should we check the non-token RSA private keys? */
 1373|       |
 1374|  9.81k|    if (sftk_isTrue(object, CKA_TOKEN)) {
  ------------------
  |  |  512|  9.81k|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (1374:9): [True: 0, False: 9.81k]
  ------------------
 1375|      0|        SFTKSlot *slot = session->slot;
 1376|      0|        SFTKDBHandle *keyHandle = sftk_getKeyDB(slot);
 1377|       |
 1378|      0|        if (keyHandle == NULL) {
  ------------------
  |  Branch (1378:13): [True: 0, False: 0]
  ------------------
 1379|      0|            return CKR_TOKEN_WRITE_PROTECTED;
  ------------------
  |  | 1481|      0|#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2UL
  ------------------
 1380|      0|        }
 1381|       |
 1382|      0|        crv = sftkdb_write(keyHandle, object, &object->handle);
 1383|      0|        sftk_freeDB(keyHandle);
 1384|      0|        return crv;
 1385|  9.81k|    } else if (createObjectInfo) {
  ------------------
  |  Branch (1385:16): [True: 9.81k, False: 0]
  ------------------
 1386|  9.81k|        object->objectInfo = sftk_mkPrivKey(object, key_type, &crv);
 1387|  9.81k|        if (object->objectInfo == NULL)
  ------------------
  |  Branch (1387:13): [True: 0, False: 9.81k]
  ------------------
 1388|      0|            return crv;
 1389|  9.81k|        object->infoFree = SFTKFree_nsslowkey_DestroyPrivateKey;
 1390|  9.81k|    }
 1391|  9.81k|    return CKR_OK;
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
 1392|  9.81k|}
pkcs11.c:sftk_handleSecretKeyObject:
 1520|  36.2k|{
 1521|  36.2k|    CK_RV crv;
 1522|       |
 1523|       |    /* First validate and set defaults */
 1524|  36.2k|    crv = validateSecretKey(session, object, key_type, isFIPS);
 1525|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1525:9): [True: 0, False: 36.2k]
  ------------------
 1526|      0|        goto loser;
 1527|       |
 1528|       |    /* If the object is a TOKEN object, store in the database */
 1529|  36.2k|    if (sftk_isTrue(object, CKA_TOKEN)) {
  ------------------
  |  |  512|  36.2k|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (1529:9): [True: 0, False: 36.2k]
  ------------------
 1530|      0|        SFTKSlot *slot = session->slot;
 1531|      0|        SFTKDBHandle *keyHandle = sftk_getKeyDB(slot);
 1532|       |
 1533|      0|        if (keyHandle == NULL) {
  ------------------
  |  Branch (1533:13): [True: 0, False: 0]
  ------------------
 1534|      0|            return CKR_TOKEN_WRITE_PROTECTED;
  ------------------
  |  | 1481|      0|#define CKR_TOKEN_WRITE_PROTECTED 0x000000E2UL
  ------------------
 1535|      0|        }
 1536|       |
 1537|      0|        crv = sftkdb_write(keyHandle, object, &object->handle);
 1538|      0|        sftk_freeDB(keyHandle);
 1539|      0|        return crv;
 1540|      0|    }
 1541|       |
 1542|  36.2k|loser:
 1543|       |
 1544|  36.2k|    return crv;
 1545|  36.2k|}
pkcs11.c:validateSecretKey:
 1401|  36.2k|{
 1402|  36.2k|    CK_RV crv;
 1403|  36.2k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  36.2k|#define CK_TRUE 1
  ------------------
 1404|  36.2k|    CK_BBOOL ckfalse = CK_FALSE;
  ------------------
  |  |   23|  36.2k|#define CK_FALSE 0
  ------------------
 1405|  36.2k|    SFTKAttribute *attribute = NULL;
 1406|  36.2k|    unsigned long requiredLen;
 1407|       |
 1408|  36.2k|    crv = sftk_defaultAttribute(object, CKA_SENSITIVE,
  ------------------
  |  |  546|  36.2k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
 1409|  36.2k|                                isFIPS ? &cktrue : &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  Branch (1409:33): [True: 0, False: 36.2k]
  ------------------
 1410|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1410:9): [True: 0, False: 36.2k]
  ------------------
 1411|      0|        return crv;
 1412|  36.2k|    crv = sftk_defaultAttribute(object, CKA_EXTRACTABLE,
  ------------------
  |  |  585|  36.2k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
 1413|  36.2k|                                &cktrue, sizeof(CK_BBOOL));
 1414|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1414:9): [True: 0, False: 36.2k]
  ------------------
 1415|      0|        return crv;
 1416|  36.2k|    crv = sftk_defaultAttribute(object, CKA_ENCRYPT, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  547|  36.2k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 1417|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1417:9): [True: 0, False: 36.2k]
  ------------------
 1418|      0|        return crv;
 1419|  36.2k|    crv = sftk_defaultAttribute(object, CKA_DECRYPT, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  548|  36.2k|#define CKA_DECRYPT 0x00000105UL
  ------------------
 1420|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1420:9): [True: 0, False: 36.2k]
  ------------------
 1421|      0|        return crv;
 1422|  36.2k|    crv = sftk_defaultAttribute(object, CKA_SIGN, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  551|  36.2k|#define CKA_SIGN 0x00000108UL
  ------------------
 1423|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1423:9): [True: 0, False: 36.2k]
  ------------------
 1424|      0|        return crv;
 1425|  36.2k|    crv = sftk_defaultAttribute(object, CKA_VERIFY, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  553|  36.2k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 1426|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1426:9): [True: 0, False: 36.2k]
  ------------------
 1427|      0|        return crv;
 1428|  36.2k|    crv = sftk_defaultAttribute(object, CKA_WRAP, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  549|  36.2k|#define CKA_WRAP 0x00000106UL
  ------------------
 1429|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1429:9): [True: 0, False: 36.2k]
  ------------------
 1430|      0|        return crv;
 1431|  36.2k|    crv = sftk_defaultAttribute(object, CKA_UNWRAP, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  550|  36.2k|#define CKA_UNWRAP 0x00000107UL
  ------------------
 1432|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1432:9): [True: 0, False: 36.2k]
  ------------------
 1433|      0|        return crv;
 1434|       |
 1435|  36.2k|    if (!sftk_hasAttribute(object, CKA_VALUE)) {
  ------------------
  |  |  516|  36.2k|#define CKA_VALUE 0x00000011UL
  ------------------
  |  Branch (1435:9): [True: 0, False: 36.2k]
  ------------------
 1436|      0|        return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1437|      0|    }
 1438|       |    /* the next two bits get modified only in the key gen and token cases */
 1439|  36.2k|    crv = sftk_forceAttribute(object, CKA_ALWAYS_SENSITIVE,
  ------------------
  |  |  588|  36.2k|#define CKA_ALWAYS_SENSITIVE 0x00000165UL
  ------------------
 1440|  36.2k|                              &ckfalse, sizeof(CK_BBOOL));
 1441|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1441:9): [True: 0, False: 36.2k]
  ------------------
 1442|      0|        return crv;
 1443|  36.2k|    crv = sftk_forceAttribute(object, CKA_NEVER_EXTRACTABLE,
  ------------------
  |  |  587|  36.2k|#define CKA_NEVER_EXTRACTABLE 0x00000164UL
  ------------------
 1444|  36.2k|                              &ckfalse, sizeof(CK_BBOOL));
 1445|  36.2k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1445:9): [True: 0, False: 36.2k]
  ------------------
 1446|      0|        return crv;
 1447|       |
 1448|       |    /* some types of keys have a value length */
 1449|  36.2k|    crv = CKR_OK;
  ------------------
  |  | 1388|  36.2k|#define CKR_OK 0x00000000UL
  ------------------
 1450|  36.2k|    switch (key_type) {
 1451|       |        /* force CKA_VALUE_LEN to be set */
 1452|  11.5k|        case CKK_GENERIC_SECRET:
  ------------------
  |  |  383|  11.5k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
  |  Branch (1452:9): [True: 11.5k, False: 24.6k]
  ------------------
 1453|  11.5k|        case CKK_RC2:
  ------------------
  |  |  384|  11.5k|#define CKK_RC2 0x00000011UL
  ------------------
  |  Branch (1453:9): [True: 0, False: 36.2k]
  ------------------
 1454|  11.5k|        case CKK_RC4:
  ------------------
  |  |  385|  11.5k|#define CKK_RC4 0x00000012UL
  ------------------
  |  Branch (1454:9): [True: 0, False: 36.2k]
  ------------------
 1455|       |#if NSS_SOFTOKEN_DOES_RC5
 1456|       |        case CKK_RC5:
 1457|       |#endif
 1458|       |#ifdef NSS_SOFTOKEN_DOES_CAST
 1459|       |        case CKK_CAST:
 1460|       |        case CKK_CAST3:
 1461|       |        case CKK_CAST5:
 1462|       |#endif
 1463|       |#if NSS_SOFTOKEN_DOES_IDEA
 1464|       |        case CKK_IDEA:
 1465|       |#endif
 1466|  11.5k|            attribute = sftk_FindAttribute(object, CKA_VALUE);
  ------------------
  |  |  516|  11.5k|#define CKA_VALUE 0x00000011UL
  ------------------
 1467|       |            /* shouldn't happen */
 1468|  11.5k|            if (attribute == NULL)
  ------------------
  |  Branch (1468:17): [True: 0, False: 11.5k]
  ------------------
 1469|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1470|  11.5k|            crv = sftk_forceAttribute(object, CKA_VALUE_LEN,
  ------------------
  |  |  580|  11.5k|#define CKA_VALUE_LEN 0x00000161UL
  ------------------
 1471|  11.5k|                                      &attribute->attrib.ulValueLen, sizeof(CK_ULONG));
 1472|  11.5k|            sftk_FreeAttribute(attribute);
 1473|  11.5k|            break;
 1474|       |        /* force the value to have the correct parity */
 1475|    302|        case CKK_DES:
  ------------------
  |  |  386|    302|#define CKK_DES 0x00000013UL
  ------------------
  |  Branch (1475:9): [True: 302, False: 35.9k]
  ------------------
 1476|    302|        case CKK_DES2:
  ------------------
  |  |  387|    302|#define CKK_DES2 0x00000014UL
  ------------------
  |  Branch (1476:9): [True: 0, False: 36.2k]
  ------------------
 1477|  1.51k|        case CKK_DES3:
  ------------------
  |  |  388|  1.51k|#define CKK_DES3 0x00000015UL
  ------------------
  |  Branch (1477:9): [True: 1.21k, False: 34.9k]
  ------------------
 1478|  1.51k|        case CKK_CDMF:
  ------------------
  |  |  401|  1.51k|#define CKK_CDMF 0x0000001EUL
  ------------------
  |  Branch (1478:9): [True: 0, False: 36.2k]
  ------------------
 1479|  1.51k|            attribute = sftk_FindAttribute(object, CKA_VALUE);
  ------------------
  |  |  516|  1.51k|#define CKA_VALUE 0x00000011UL
  ------------------
 1480|       |            /* shouldn't happen */
 1481|  1.51k|            if (attribute == NULL)
  ------------------
  |  Branch (1481:17): [True: 0, False: 1.51k]
  ------------------
 1482|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1483|  1.51k|            requiredLen = sftk_MapKeySize(key_type);
 1484|  1.51k|            if (attribute->attrib.ulValueLen != requiredLen) {
  ------------------
  |  Branch (1484:17): [True: 0, False: 1.51k]
  ------------------
 1485|      0|                sftk_FreeAttribute(attribute);
 1486|      0|                return CKR_KEY_SIZE_RANGE;
  ------------------
  |  | 1432|      0|#define CKR_KEY_SIZE_RANGE 0x00000062UL
  ------------------
 1487|      0|            }
 1488|  1.51k|            sftk_FormatDESKey((unsigned char *)attribute->attrib.pValue,
 1489|  1.51k|                              attribute->attrib.ulValueLen);
 1490|  1.51k|            sftk_FreeAttribute(attribute);
 1491|  1.51k|            break;
 1492|  2.64k|        case CKK_AES:
  ------------------
  |  |  402|  2.64k|#define CKK_AES 0x0000001FUL
  ------------------
  |  Branch (1492:9): [True: 2.64k, False: 33.5k]
  ------------------
 1493|  2.64k|            attribute = sftk_FindAttribute(object, CKA_VALUE);
  ------------------
  |  |  516|  2.64k|#define CKA_VALUE 0x00000011UL
  ------------------
 1494|       |            /* shouldn't happen */
 1495|  2.64k|            if (attribute == NULL)
  ------------------
  |  Branch (1495:17): [True: 0, False: 2.64k]
  ------------------
 1496|      0|                return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 1497|  2.64k|            if (attribute->attrib.ulValueLen != 16 &&
  ------------------
  |  Branch (1497:17): [True: 756, False: 1.88k]
  ------------------
 1498|  2.64k|                attribute->attrib.ulValueLen != 24 &&
  ------------------
  |  Branch (1498:17): [True: 756, False: 0]
  ------------------
 1499|  2.64k|                attribute->attrib.ulValueLen != 32) {
  ------------------
  |  Branch (1499:17): [True: 0, False: 756]
  ------------------
 1500|      0|                sftk_FreeAttribute(attribute);
 1501|      0|                return CKR_KEY_SIZE_RANGE;
  ------------------
  |  | 1432|      0|#define CKR_KEY_SIZE_RANGE 0x00000062UL
  ------------------
 1502|      0|            }
 1503|  2.64k|            crv = sftk_forceAttribute(object, CKA_VALUE_LEN,
  ------------------
  |  |  580|  2.64k|#define CKA_VALUE_LEN 0x00000161UL
  ------------------
 1504|  2.64k|                                      &attribute->attrib.ulValueLen, sizeof(CK_ULONG));
 1505|  2.64k|            sftk_FreeAttribute(attribute);
 1506|  2.64k|            break;
 1507|  20.4k|        default:
  ------------------
  |  Branch (1507:9): [True: 20.4k, False: 15.7k]
  ------------------
 1508|  20.4k|            break;
 1509|  36.2k|    }
 1510|       |
 1511|  36.2k|    return crv;
 1512|  36.2k|}
pkcs11.c:sftk_mkPrivKey:
 2040|  9.81k|{
 2041|  9.81k|    NSSLOWKEYPrivateKey *privKey;
 2042|  9.81k|    SFTKItemTemplate itemTemplate[SFTK_MAX_ITEM_TEMPLATE];
 2043|  9.81k|    int itemTemplateCount = 0;
 2044|  9.81k|    PLArenaPool *arena;
 2045|  9.81k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
 2046|  9.81k|    SECStatus rv;
 2047|       |
 2048|  9.81k|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  9.81k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  9.81k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 2049|  9.81k|    if (arena == NULL) {
  ------------------
  |  Branch (2049:9): [True: 0, False: 9.81k]
  ------------------
 2050|      0|        *crvp = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2051|      0|        return NULL;
 2052|      0|    }
 2053|       |
 2054|  9.81k|    privKey = (NSSLOWKEYPrivateKey *)
 2055|  9.81k|        PORT_ArenaZAlloc(arena, sizeof(NSSLOWKEYPrivateKey));
  ------------------
  |  |   59|  9.81k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
 2056|  9.81k|    if (privKey == NULL) {
  ------------------
  |  Branch (2056:9): [True: 0, False: 9.81k]
  ------------------
 2057|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 2058|      0|        *crvp = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2059|      0|        return NULL;
 2060|      0|    }
 2061|       |
 2062|       |    /* in future this would be a switch on key_type */
 2063|  9.81k|    privKey->arena = arena;
 2064|  9.81k|    switch (key_type) {
 2065|      0|        case CKK_RSA:
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (2065:9): [True: 0, False: 9.81k]
  ------------------
 2066|      0|            privKey->keyType = NSSLOWKEYRSAKey;
 2067|       |
 2068|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2069|      0|                                   &privKey->u.rsa.modulus, CKA_MODULUS);
 2070|      0|            itemTemplateCount++;
 2071|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2072|      0|                                   &privKey->u.rsa.publicExponent, CKA_PUBLIC_EXPONENT);
 2073|      0|            itemTemplateCount++;
 2074|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2075|      0|                                   &privKey->u.rsa.privateExponent, CKA_PRIVATE_EXPONENT);
 2076|      0|            itemTemplateCount++;
 2077|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2078|      0|                                   &privKey->u.rsa.prime1, CKA_PRIME_1);
 2079|      0|            itemTemplateCount++;
 2080|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2081|      0|                                   &privKey->u.rsa.prime2, CKA_PRIME_2);
 2082|      0|            itemTemplateCount++;
 2083|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2084|      0|                                   &privKey->u.rsa.exponent1, CKA_EXPONENT_1);
 2085|      0|            itemTemplateCount++;
 2086|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2087|      0|                                   &privKey->u.rsa.exponent2, CKA_EXPONENT_2);
 2088|      0|            itemTemplateCount++;
 2089|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2090|      0|                                   &privKey->u.rsa.coefficient, CKA_COEFFICIENT);
 2091|      0|            itemTemplateCount++;
 2092|      0|            rv = DER_SetUInteger(privKey->arena, &privKey->u.rsa.version,
 2093|      0|                                 NSSLOWKEY_PRIVATE_KEY_INFO_VERSION);
  ------------------
  |  |   51|      0|#define NSSLOWKEY_PRIVATE_KEY_INFO_VERSION 0 /* what we *create* */
  ------------------
 2094|      0|            if (rv != SECSuccess)
  ------------------
  |  Branch (2094:17): [True: 0, False: 0]
  ------------------
 2095|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2096|      0|            break;
 2097|       |
 2098|      0|        case CKK_DSA:
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (2098:9): [True: 0, False: 9.81k]
  ------------------
 2099|      0|            privKey->keyType = NSSLOWKEYDSAKey;
 2100|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2101|      0|                                   &privKey->u.dsa.params.prime, CKA_PRIME);
 2102|      0|            itemTemplateCount++;
 2103|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2104|      0|                                   &privKey->u.dsa.params.subPrime, CKA_SUBPRIME);
 2105|      0|            itemTemplateCount++;
 2106|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2107|      0|                                   &privKey->u.dsa.params.base, CKA_BASE);
 2108|      0|            itemTemplateCount++;
 2109|      0|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|      0|    templ[count].type = attr;                               \
  |  |  466|      0|    templ[count].item = itemPtr
  ------------------
 2110|      0|                                   &privKey->u.dsa.privateValue, CKA_VALUE);
 2111|      0|            itemTemplateCount++;
 2112|       |            /* privKey was zero'd so public value is already set to NULL, 0
 2113|       |             * if we don't set it explicitly */
 2114|      0|            break;
 2115|       |
 2116|  1.91k|        case CKK_DH:
  ------------------
  |  |  374|  1.91k|#define CKK_DH 0x00000002UL
  ------------------
  |  Branch (2116:9): [True: 1.91k, False: 7.90k]
  ------------------
 2117|  1.91k|            privKey->keyType = NSSLOWKEYDHKey;
 2118|  1.91k|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|  1.91k|    templ[count].type = attr;                               \
  |  |  466|  1.91k|    templ[count].item = itemPtr
  ------------------
 2119|  1.91k|                                   &privKey->u.dh.prime, CKA_PRIME);
 2120|  1.91k|            itemTemplateCount++;
 2121|  1.91k|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|  1.91k|    templ[count].type = attr;                               \
  |  |  466|  1.91k|    templ[count].item = itemPtr
  ------------------
 2122|  1.91k|                                   &privKey->u.dh.base, CKA_BASE);
 2123|  1.91k|            itemTemplateCount++;
 2124|  1.91k|            SFTK_SET_ITEM_TEMPLATE(itemTemplate, itemTemplateCount,
  ------------------
  |  |  465|  1.91k|    templ[count].type = attr;                               \
  |  |  466|  1.91k|    templ[count].item = itemPtr
  ------------------
 2125|  1.91k|                                   &privKey->u.dh.privateValue, CKA_VALUE);
 2126|  1.91k|            itemTemplateCount++;
 2127|       |            /* privKey was zero'd so public value is already set to NULL, 0
 2128|       |             * if we don't set it explicitly */
 2129|  1.91k|            break;
 2130|      0|        case CKK_EC_EDWARDS:
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (2130:9): [True: 0, False: 9.81k]
  ------------------
 2131|      0|        case CKK_EC_MONTGOMERY:
  ------------------
  |  |  449|      0|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (2131:9): [True: 0, False: 9.81k]
  ------------------
 2132|  7.90k|        case CKK_EC:
  ------------------
  |  |  379|  7.90k|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (2132:9): [True: 7.90k, False: 1.91k]
  ------------------
 2133|  7.90k|            privKey->keyType = NSSLOWKEYECKey;
 2134|  7.90k|            crv = sftk_Attribute2SSecItem(arena,
 2135|  7.90k|                                          &privKey->u.ec.ecParams.DEREncoding,
 2136|  7.90k|                                          object, CKA_EC_PARAMS);
  ------------------
  |  |  602|  7.90k|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
 2137|  7.90k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  7.90k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2137:17): [True: 0, False: 7.90k]
  ------------------
 2138|      0|                break;
 2139|       |
 2140|       |            /* Fill out the rest of the ecParams structure
 2141|       |             * based on the encoded params
 2142|       |             */
 2143|  7.90k|            if (EC_FillParams(arena, &privKey->u.ec.ecParams.DEREncoding,
  ------------------
  |  Branch (2143:17): [True: 0, False: 7.90k]
  ------------------
 2144|  7.90k|                              &privKey->u.ec.ecParams) != SECSuccess) {
 2145|      0|                crv = CKR_DOMAIN_PARAMS_INVALID;
  ------------------
  |  | 1508|      0|#define CKR_DOMAIN_PARAMS_INVALID 0x00000130UL
  ------------------
 2146|      0|                break;
 2147|      0|            }
 2148|  7.90k|            crv = sftk_Attribute2SSecItem(arena, &privKey->u.ec.privateValue,
 2149|  7.90k|                                          object, CKA_VALUE);
  ------------------
  |  |  516|  7.90k|#define CKA_VALUE 0x00000011UL
  ------------------
 2150|  7.90k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  7.90k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2150:17): [True: 0, False: 7.90k]
  ------------------
 2151|      0|                break;
 2152|       |
 2153|  7.90k|            if (sftk_hasAttribute(object, CKA_NSS_DB)) {
  ------------------
  |  |  150|  7.90k|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
  |  Branch (2153:17): [True: 7.90k, False: 0]
  ------------------
 2154|  7.90k|                crv = sftk_Attribute2SSecItem(arena, &privKey->u.ec.publicValue,
 2155|  7.90k|                                              object, CKA_NSS_DB);
  ------------------
  |  |  150|  7.90k|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 2156|  7.90k|                if (crv != CKR_OK) {
  ------------------
  |  | 1388|  7.90k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2156:21): [True: 0, False: 7.90k]
  ------------------
 2157|      0|                    break;
 2158|      0|                }
 2159|       |                /* privKey was zero'd so public value is already set to NULL, 0
 2160|       |                 * if we don't set it explicitly */
 2161|  7.90k|            } else if (key_type == CKK_EC) {
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (2161:24): [True: 0, False: 0]
  ------------------
 2162|       |                /* as no public key was provided during the import, we need to derive it here.
 2163|       |                 See: PK11_ImportAndReturnPrivateKey*/
 2164|      0|                (void)SECITEM_AllocItem(arena, &privKey->u.ec.publicValue, EC_GetPointSize(&privKey->u.ec.ecParams));
  ------------------
  |  |  103|      0|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
 2165|      0|                rv = EC_DerivePublicKey(&privKey->u.ec.privateValue, &privKey->u.ec.ecParams, &privKey->u.ec.publicValue);
 2166|      0|                if (rv != SECSuccess) {
  ------------------
  |  Branch (2166:21): [True: 0, False: 0]
  ------------------
 2167|      0|                    break;
 2168|      0|                }
 2169|      0|                sftk_forceAttribute(object, CKA_NSS_DB, privKey->u.ec.publicValue.data, privKey->u.ec.publicValue.len);
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 2170|      0|            }
 2171|       |
 2172|  7.90k|            rv = DER_SetUInteger(privKey->arena, &privKey->u.ec.version,
 2173|  7.90k|                                 NSSLOWKEY_EC_PRIVATE_KEY_VERSION);
  ------------------
  |  |   23|  7.90k|#define NSSLOWKEY_EC_PRIVATE_KEY_VERSION 1 /* as per SECG 1 C.4 */
  ------------------
 2174|  7.90k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (2174:17): [True: 0, False: 7.90k]
  ------------------
 2175|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2176|       |/* The following ifdef is needed for Linux arm distros and
 2177|       | * Android as gcc 4.6 has a bug when targeting arm (but not
 2178|       | * thumb). The bug has been fixed in gcc 4.7.
 2179|       | * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56561
 2180|       | */
 2181|       |#if defined(__arm__) && !defined(__thumb__) && defined(__GNUC__)
 2182|       |                *crvp = CKR_HOST_MEMORY;
 2183|       |                break;
 2184|       |#endif
 2185|      0|            }
 2186|  7.90k|            break;
 2187|       |
 2188|      0|        case CKK_NSS_KYBER:
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2188:9): [True: 0, False: 9.81k]
  ------------------
 2189|      0|        case CKK_NSS_ML_KEM:
  ------------------
  |  |   59|      0|#define CKK_NSS_ML_KEM (CKK_NSS + 6)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2189:9): [True: 0, False: 9.81k]
  ------------------
 2190|      0|            break;
 2191|       |
 2192|      0|        default:
  ------------------
  |  Branch (2192:9): [True: 0, False: 9.81k]
  ------------------
 2193|      0|            crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 2194|      0|            break;
 2195|  9.81k|    }
 2196|  9.81k|    if (crv == CKR_OK && itemTemplateCount != 0) {
  ------------------
  |  | 1388|  19.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2196:9): [True: 9.81k, False: 0]
  |  Branch (2196:26): [True: 1.91k, False: 7.90k]
  ------------------
 2197|  1.91k|        PORT_Assert(itemTemplateCount > 0);
  ------------------
  |  |  120|  1.91k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.91k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.91k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2198|  1.91k|        PORT_Assert(itemTemplateCount <= SFTK_MAX_ITEM_TEMPLATE);
  ------------------
  |  |  120|  1.91k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.91k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.91k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2199|  1.91k|        crv = sftk_MultipleAttribute2SecItem(arena, object, itemTemplate,
 2200|  1.91k|                                             itemTemplateCount);
 2201|  1.91k|    }
 2202|  9.81k|    *crvp = crv;
 2203|  9.81k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2203:9): [True: 0, False: 9.81k]
  ------------------
 2204|      0|        PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2205|      0|        return NULL;
 2206|      0|    }
 2207|  9.81k|    return privKey;
 2208|  9.81k|}
pkcs11.c:sftk_GetModuleIndex:
 2734|   827k|{
 2735|   827k|    if (sftk_isFIPS(slotID)) {
  ------------------
  |  |  506|   827k|    (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  500|   827k|#define FIPS_SLOT_ID 3
  |  |  ------------------
  |  |                   (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  567|   827k|#define SFTK_MIN_FIPS_USER_SLOT_ID 101
  |  |  ------------------
  |  |  |  Branch (506:6): [True: 0, False: 827k]
  |  |  |  Branch (506:32): [True: 0, False: 827k]
  |  |  ------------------
  ------------------
 2736|      0|        return NSC_FIPS_MODULE;
  ------------------
  |  |   54|      0|#define NSC_FIPS_MODULE 1
  ------------------
 2737|      0|    }
 2738|   827k|    return NSC_NON_FIPS_MODULE;
  ------------------
  |  |   55|   827k|#define NSC_NON_FIPS_MODULE 0
  ------------------
 2739|   827k|}
pkcs11.c:sftk_setStringName:
  688|      6|{
  689|      6|    int full_length, string_length;
  690|       |
  691|      6|    full_length = nullTerminate ? buffer_length - 1 : buffer_length;
  ------------------
  |  Branch (691:19): [True: 6, False: 0]
  ------------------
  692|      6|    string_length = PORT_Strlen(inString);
  ------------------
  |  |  190|      6|#define PORT_Strlen(s) strlen(s)
  ------------------
  693|       |    /*
  694|       |     *  shorten the string, respecting utf8 encoding
  695|       |     *  to do so, we work backward from the end
  696|       |     *  bytes looking from the end are either:
  697|       |     *    - ascii [0x00,0x7f]
  698|       |     *    - the [2-n]th byte of a multibyte sequence
  699|       |     *        [0x3F,0xBF], i.e, most significant 2 bits are '10'
  700|       |     *    - the first byte of a multibyte sequence [0xC0,0xFD],
  701|       |     *        i.e, most significant 2 bits are '11'
  702|       |     *
  703|       |     *    When the string is too long, we lop off any trailing '10' bytes,
  704|       |     *  if any. When these are all eliminated we lop off
  705|       |     *  one additional byte. Thus if we lopped any '10'
  706|       |     *  we'll be lopping a '11' byte (the first byte of the multibyte sequence),
  707|       |     *  otherwise we're lopping off an ascii character.
  708|       |     *
  709|       |     *    To test for '10' bytes, we first AND it with
  710|       |     *  11000000 (0xc0) so that we get 10000000 (0x80) if and only if
  711|       |     *  the byte starts with 10. We test for equality.
  712|       |     */
  713|      6|    while (string_length > full_length) {
  ------------------
  |  Branch (713:12): [True: 0, False: 6]
  ------------------
  714|       |        /* need to shorten */
  715|      0|        while (string_length > 0 &&
  ------------------
  |  Branch (715:16): [True: 0, False: 0]
  ------------------
  716|      0|               ((inString[string_length - 1] & (char)0xc0) == (char)0x80)) {
  ------------------
  |  Branch (716:16): [True: 0, False: 0]
  ------------------
  717|       |            /* lop off '10' byte */
  718|      0|            string_length--;
  719|      0|        }
  720|       |        /*
  721|       |         * test string_length in case bad data is received
  722|       |         * and string consisted of all '10' bytes,
  723|       |         * avoiding any infinite loop
  724|       |         */
  725|      0|        if (string_length) {
  ------------------
  |  Branch (725:13): [True: 0, False: 0]
  ------------------
  726|       |            /* remove either '11' byte or an asci byte */
  727|      0|            string_length--;
  728|      0|        }
  729|      0|    }
  730|      6|    PORT_Memset(buffer, ' ', full_length);
  ------------------
  |  |  182|      6|#define PORT_Memset memset
  ------------------
  731|      6|    if (nullTerminate) {
  ------------------
  |  Branch (731:9): [True: 6, False: 0]
  ------------------
  732|      6|        buffer[full_length] = 0;
  733|      6|    }
  734|      6|    PORT_Memcpy(buffer, inString, string_length);
  ------------------
  |  |  180|      6|#define PORT_Memcpy memcpy
  ------------------
  735|      6|    return buffer;
  736|      6|}
pkcs11.c:sftk_HashNumber:
 2678|   827k|{
 2679|   827k|    return (PLHashNumber)((char *)key - (char *)NULL);
 2680|   827k|}
pkcs11.c:sftk_RegisterSlot:
 2781|      2|{
 2782|      2|    PLHashEntry *entry;
 2783|      2|    unsigned int index;
 2784|       |
 2785|      2|    index = sftk_GetModuleIndex(slot->slotID);
 2786|       |
 2787|       |    /* make sure the slotID for this module is valid */
 2788|      2|    if (moduleIndex != index) {
  ------------------
  |  Branch (2788:9): [True: 0, False: 2]
  ------------------
 2789|      0|        return CKR_SLOT_ID_INVALID;
  ------------------
  |  | 1391|      0|#define CKR_SLOT_ID_INVALID 0x00000003UL
  ------------------
 2790|      0|    }
 2791|       |
 2792|      2|    if (nscSlotList[index] == NULL) {
  ------------------
  |  Branch (2792:9): [True: 1, False: 1]
  ------------------
 2793|      1|        nscSlotListSize[index] = NSC_SLOT_LIST_BLOCK_SIZE;
  ------------------
  |  |   50|      1|#define NSC_SLOT_LIST_BLOCK_SIZE 10
  ------------------
 2794|      1|        nscSlotList[index] = (CK_SLOT_ID *)
 2795|      1|            PORT_ZAlloc(nscSlotListSize[index] * sizeof(CK_SLOT_ID));
  ------------------
  |  |   72|      1|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
 2796|      1|        if (nscSlotList[index] == NULL) {
  ------------------
  |  Branch (2796:13): [True: 0, False: 1]
  ------------------
 2797|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2798|      0|        }
 2799|      1|    }
 2800|      2|    if (nscSlotCount[index] >= nscSlotListSize[index]) {
  ------------------
  |  Branch (2800:9): [True: 0, False: 2]
  ------------------
 2801|      0|        CK_SLOT_ID *oldNscSlotList = nscSlotList[index];
 2802|      0|        CK_ULONG oldNscSlotListSize = nscSlotListSize[index];
 2803|      0|        nscSlotListSize[index] += NSC_SLOT_LIST_BLOCK_SIZE;
  ------------------
  |  |   50|      0|#define NSC_SLOT_LIST_BLOCK_SIZE 10
  ------------------
 2804|      0|        nscSlotList[index] = (CK_SLOT_ID *)PORT_Realloc(oldNscSlotList,
  ------------------
  |  |   64|      0|#define PORT_Realloc PORT_Realloc_Util
  ------------------
 2805|      0|                                                        nscSlotListSize[index] * sizeof(CK_SLOT_ID));
 2806|      0|        if (nscSlotList[index] == NULL) {
  ------------------
  |  Branch (2806:13): [True: 0, False: 0]
  ------------------
 2807|       |            /* evidently coverity doesn't know realloc does not
 2808|       |             * free var if it fails ! */
 2809|       |            /* coverity [use_after_free : FALSE] */
 2810|      0|            nscSlotList[index] = oldNscSlotList;
 2811|      0|            nscSlotListSize[index] = oldNscSlotListSize;
 2812|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2813|      0|        }
 2814|      0|    }
 2815|       |
 2816|      2|    if (nscSlotHashTable[index] == NULL) {
  ------------------
  |  Branch (2816:9): [True: 1, False: 1]
  ------------------
 2817|      1|        nscSlotHashTable[index] = PL_NewHashTable(64, sftk_HashNumber,
 2818|      1|                                                  PL_CompareValues, PL_CompareValues, NULL, 0);
 2819|      1|        if (nscSlotHashTable[index] == NULL) {
  ------------------
  |  Branch (2819:13): [True: 0, False: 1]
  ------------------
 2820|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2821|      0|        }
 2822|      1|    }
 2823|       |
 2824|      2|    entry = PL_HashTableAdd(nscSlotHashTable[index], (void *)(uintptr_t)slot->slotID, slot);
 2825|      2|    if (entry == NULL) {
  ------------------
  |  Branch (2825:9): [True: 0, False: 2]
  ------------------
 2826|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2827|      0|    }
 2828|      2|    slot->index = (nscSlotCount[index] & 0x7f) | ((index << 7) & 0x80);
 2829|      2|    nscSlotList[index][nscSlotCount[index]++] = slot->slotID;
 2830|       |
 2831|      2|    return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 2832|      2|}
pkcs11.c:sftk_DBShutdown:
 3107|      2|{
 3108|      2|    SFTKDBHandle *certHandle;
 3109|      2|    SFTKDBHandle *keyHandle;
 3110|      2|    SKIP_AFTER_FORK(PZ_Lock(slot->slotLock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
 3111|      2|    certHandle = slot->certDB;
 3112|      2|    slot->certDB = NULL;
 3113|      2|    keyHandle = slot->keyDB;
 3114|      2|    slot->keyDB = NULL;
 3115|      2|    SKIP_AFTER_FORK(PZ_Unlock(slot->slotLock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
 3116|      2|    if (certHandle) {
  ------------------
  |  Branch (3116:9): [True: 0, False: 2]
  ------------------
 3117|      0|        sftk_freeDB(certHandle);
 3118|      0|    }
 3119|      2|    if (keyHandle) {
  ------------------
  |  Branch (3119:9): [True: 0, False: 2]
  ------------------
 3120|      0|        sftk_freeDB(keyHandle);
 3121|      0|    }
 3122|      2|}
pkcs11.c:sftk_getParameters:
 3399|      1|{
 3400|      1|    CK_RV crv;
 3401|      1|    char *libParams;
 3402|      1|    const char *filename;
 3403|      1|    PRFileDesc *file_dc;
 3404|      1|    PRBool free_mem = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 3405|       |
 3406|      1|    if (!init_args || !init_args->LibraryParameters) {
  ------------------
  |  Branch (3406:9): [True: 0, False: 1]
  |  Branch (3406:23): [True: 0, False: 1]
  ------------------
 3407|       |        /* Library parameters were not provided via C_Initialize_args*/
 3408|       |
 3409|       |        /* Enviromental value has precedence to configuration filename */
 3410|      0|        libParams = PR_GetEnvSecure("NSS_LIB_PARAMS");
 3411|       |
 3412|      0|        if (!libParams) {
  ------------------
  |  Branch (3412:13): [True: 0, False: 0]
  ------------------
 3413|       |            /* Load from config filename or use default */
 3414|      0|            filename = PR_GetEnvSecure("NSS_LIB_PARAMS_FILE");
 3415|      0|#ifdef XP_UNIX
 3416|       |            /* Use default configuration file for Linux only */
 3417|      0|            if (!filename)
  ------------------
  |  Branch (3417:17): [True: 0, False: 0]
  ------------------
 3418|      0|                filename = LIB_PARAM_DEFAULT_FILE_LOCATION;
  ------------------
  |  |   65|      0|#define LIB_PARAM_DEFAULT_FILE_LOCATION "/etc/nss/params.config"
  ------------------
 3419|      0|#endif
 3420|      0|            if (filename) {
  ------------------
  |  Branch (3420:17): [True: 0, False: 0]
  ------------------
 3421|      0|                file_dc = PR_OpenFile(filename, PR_RDONLY, 444);
  ------------------
  |  |  577|      0|#define PR_RDONLY       0x01
  ------------------
 3422|      0|                if (file_dc) {
  ------------------
  |  Branch (3422:21): [True: 0, False: 0]
  ------------------
 3423|       |                    /* file opened */
 3424|      0|                    PRInt32 len = PR_Available(file_dc);
 3425|      0|                    libParams = PORT_NewArray(char, len + 1);
  ------------------
  |  |  157|      0|    (type *)PORT_Alloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
 3426|      0|                    if (libParams) {
  ------------------
  |  Branch (3426:25): [True: 0, False: 0]
  ------------------
 3427|       |                        /* memory allocated */
 3428|      0|                        if (PR_Read(file_dc, libParams, len) == -1) {
  ------------------
  |  Branch (3428:29): [True: 0, False: 0]
  ------------------
 3429|      0|                            PORT_Free(libParams);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 3430|      0|                            libParams = NULL;
 3431|      0|                        } else {
 3432|      0|                            free_mem = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3433|      0|                            libParams[len] = '\0';
 3434|      0|                        }
 3435|      0|                    }
 3436|       |
 3437|      0|                    PR_Close(file_dc);
 3438|      0|                }
 3439|      0|            }
 3440|      0|        }
 3441|       |
 3442|      0|        if (libParams == NULL)
  ------------------
  |  Branch (3442:13): [True: 0, False: 0]
  ------------------
 3443|      0|            libParams = LIB_PARAM_DEFAULT;
  ------------------
  |  |   68|      0|#define LIB_PARAM_DEFAULT " configdir='' certPrefix='' keyPrefix='' secmod='' flags=noCertDB,noModDB "
  ------------------
 3444|       |
 3445|      1|    } else {
 3446|       |        /* Use parameters provided with C_Initialize_args */
 3447|      1|        libParams = (char *)init_args->LibraryParameters;
 3448|      1|    }
 3449|       |
 3450|      1|    crv = sftk_parseParameters(libParams, paramStrings, isFIPS);
 3451|      1|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3451:9): [True: 0, False: 1]
  ------------------
 3452|      0|        crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 3453|      0|        goto loser;
 3454|      0|    }
 3455|       |
 3456|      1|    crv = CKR_OK;
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
 3457|      1|loser:
 3458|      1|    if (free_mem)
  ------------------
  |  Branch (3458:9): [True: 0, False: 1]
  ------------------
 3459|      0|        PORT_Free(libParams);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 3460|       |
 3461|      1|    return crv;
 3462|      1|}
pkcs11.c:sftk_configure:
  742|      1|{
  743|       |
  744|       |    /* make sure the internationalization was done correctly... */
  745|      1|    if (man) {
  ------------------
  |  Branch (745:9): [True: 0, False: 1]
  ------------------
  746|      0|        manufacturerID = sftk_setStringName(man, manufacturerID_space,
  747|      0|                                            sizeof(manufacturerID_space), PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  748|      0|    }
  749|      1|    if (libdes) {
  ------------------
  |  Branch (749:9): [True: 0, False: 1]
  ------------------
  750|      0|        libraryDescription = sftk_setStringName(libdes,
  751|      0|                                                libraryDescription_space, sizeof(libraryDescription_space),
  752|      0|                                                PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  753|      0|    }
  754|       |
  755|      1|    return CKR_OK;
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  756|      1|}
pkcs11.c:nscFreeAllSlots:
 3331|      1|{
 3332|       |    /* free all the slots */
 3333|      1|    SFTKSlot *slot = NULL;
 3334|      1|    CK_SLOT_ID slotID;
 3335|      1|    int i;
 3336|       |
 3337|      1|    if (nscSlotList[moduleIndex]) {
  ------------------
  |  Branch (3337:9): [True: 1, False: 0]
  ------------------
 3338|      1|        CK_ULONG tmpSlotCount = nscSlotCount[moduleIndex];
 3339|      1|        CK_SLOT_ID_PTR tmpSlotList = nscSlotList[moduleIndex];
 3340|      1|        PLHashTable *tmpSlotHashTable = nscSlotHashTable[moduleIndex];
 3341|       |
 3342|       |        /* first close all the session */
 3343|      3|        for (i = 0; i < (int)tmpSlotCount; i++) {
  ------------------
  |  Branch (3343:21): [True: 2, False: 1]
  ------------------
 3344|      2|            slotID = tmpSlotList[i];
 3345|      2|            (void)NSC_CloseAllSessions(slotID);
 3346|      2|        }
 3347|       |
 3348|       |        /* now clear out the statics */
 3349|      1|        nscSlotList[moduleIndex] = NULL;
 3350|      1|        nscSlotCount[moduleIndex] = 0;
 3351|      1|        nscSlotHashTable[moduleIndex] = NULL;
 3352|      1|        nscSlotListSize[moduleIndex] = 0;
 3353|       |
 3354|      3|        for (i = 0; i < (int)tmpSlotCount; i++) {
  ------------------
  |  Branch (3354:21): [True: 2, False: 1]
  ------------------
 3355|      2|            slotID = tmpSlotList[i];
 3356|      2|            slot = (SFTKSlot *)
 3357|      2|                PL_HashTableLookup(tmpSlotHashTable, (void *)(uintptr_t)slotID);
 3358|      2|            PORT_Assert(slot);
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3359|      2|            if (!slot)
  ------------------
  |  Branch (3359:17): [True: 0, False: 2]
  ------------------
 3360|      0|                continue;
 3361|      2|            SFTK_DestroySlotData(slot);
 3362|      2|            PL_HashTableRemove(tmpSlotHashTable, (void *)(uintptr_t)slotID);
 3363|      2|        }
 3364|      1|        PORT_Free(tmpSlotList);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
 3365|      1|        PL_HashTableDestroy(tmpSlotHashTable);
 3366|      1|    }
 3367|      1|}
pkcs11.c:sftk_searchDatabase:
 5216|  31.3k|{
 5217|  31.3k|    CK_RV crv;
 5218|  31.3k|    int objectListSize = search->array_size - search->size;
 5219|  31.3k|    CK_OBJECT_HANDLE *array = &search->handles[search->size];
 5220|  31.3k|    SDBFind *find;
 5221|  31.3k|    CK_ULONG count;
 5222|       |
 5223|  31.3k|    crv = sftkdb_FindObjectsInit(handle, pTemplate, ulCount, &find);
 5224|  31.3k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5224:9): [True: 0, False: 31.3k]
  ------------------
 5225|      0|        return crv;
 5226|  31.3k|    do {
 5227|  31.3k|        crv = sftkdb_FindObjects(handle, find, array, objectListSize, &count);
 5228|  31.3k|        if ((crv != CKR_OK) || (count == 0))
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5228:13): [True: 0, False: 31.3k]
  |  Branch (5228:32): [True: 31.3k, False: 0]
  ------------------
 5229|  31.3k|            break;
 5230|      0|        search->size += count;
 5231|      0|        objectListSize -= count;
 5232|      0|        if (objectListSize > 0)
  ------------------
  |  Branch (5232:13): [True: 0, False: 0]
  ------------------
 5233|      0|            break;
 5234|      0|        crv = sftk_expandSearchList(search, NSC_SEARCH_BLOCK_SIZE);
  ------------------
  |  |   49|      0|#define NSC_SEARCH_BLOCK_SIZE 5
  ------------------
 5235|      0|        objectListSize = NSC_SEARCH_BLOCK_SIZE;
  ------------------
  |  |   49|      0|#define NSC_SEARCH_BLOCK_SIZE 5
  ------------------
 5236|      0|        array = &search->handles[search->size];
 5237|      0|    } while (crv == CKR_OK);
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5237:14): [True: 0, False: 0]
  ------------------
 5238|      0|    sftkdb_FindObjectsFinal(handle, find);
 5239|       |
 5240|  31.3k|    return crv;
 5241|  31.3k|}
pkcs11.c:sftk_searchTokenList:
 5362|  31.3k|{
 5363|  31.3k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 5364|  31.3k|    CK_RV crv2;
 5365|  31.3k|    PRBool searchCertDB;
 5366|  31.3k|    PRBool searchKeyDB;
 5367|       |
 5368|  31.3k|    sftk_pruneSearch(pTemplate, ulCount, &searchCertDB, &searchKeyDB);
 5369|       |
 5370|  31.3k|    if (searchCertDB) {
  ------------------
  |  Branch (5370:9): [True: 31.3k, False: 0]
  ------------------
 5371|  31.3k|        SFTKDBHandle *certHandle = sftk_getCertDB(slot);
 5372|  31.3k|        crv = sftk_searchDatabase(certHandle, search, pTemplate, ulCount);
 5373|  31.3k|        crv2 = sftk_emailhack(slot, certHandle, search, pTemplate, ulCount);
 5374|  31.3k|        if (crv == CKR_OK)
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5374:13): [True: 31.3k, False: 0]
  ------------------
 5375|  31.3k|            crv = crv2;
 5376|  31.3k|        sftk_freeDB(certHandle);
 5377|  31.3k|    }
 5378|       |
 5379|  31.3k|    if (crv == CKR_OK && isLoggedIn && searchKeyDB) {
  ------------------
  |  | 1388|  62.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5379:9): [True: 31.3k, False: 0]
  |  Branch (5379:26): [True: 31.3k, False: 0]
  |  Branch (5379:40): [True: 0, False: 31.3k]
  ------------------
 5380|      0|        SFTKDBHandle *keyHandle = sftk_getKeyDB(slot);
 5381|      0|        crv = sftk_searchDatabase(keyHandle, search, pTemplate, ulCount);
 5382|      0|        sftk_freeDB(keyHandle);
 5383|      0|    }
 5384|  31.3k|    return crv;
 5385|  31.3k|}
pkcs11.c:sftk_pruneSearch:
 5340|  31.3k|{
 5341|  31.3k|    CK_ULONG i;
 5342|       |
 5343|  31.3k|    *searchCertDB = PR_TRUE;
  ------------------
  |  |  437|  31.3k|#define PR_TRUE 1
  ------------------
 5344|  31.3k|    *searchKeyDB = PR_TRUE;
  ------------------
  |  |  437|  31.3k|#define PR_TRUE 1
  ------------------
 5345|  62.6k|    for (i = 0; i < ulCount; i++) {
  ------------------
  |  Branch (5345:17): [True: 62.6k, False: 0]
  ------------------
 5346|  62.6k|        if (pTemplate[i].type == CKA_CLASS && pTemplate[i].pValue != NULL) {
  ------------------
  |  |  511|   125k|#define CKA_CLASS 0x00000000UL
  ------------------
  |  Branch (5346:13): [True: 31.3k, False: 31.3k]
  |  Branch (5346:47): [True: 31.3k, False: 0]
  ------------------
 5347|  31.3k|            CK_OBJECT_CLASS class = *((CK_OBJECT_CLASS *)pTemplate[i].pValue);
 5348|  31.3k|            if (class == CKO_PRIVATE_KEY || class == CKO_SECRET_KEY) {
  ------------------
  |  |  328|  62.6k|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
                          if (class == CKO_PRIVATE_KEY || class == CKO_SECRET_KEY) {
  ------------------
  |  |  329|  31.3k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
  |  Branch (5348:17): [True: 0, False: 31.3k]
  |  Branch (5348:45): [True: 0, False: 31.3k]
  ------------------
 5349|      0|                *searchCertDB = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5350|  31.3k|            } else {
 5351|  31.3k|                *searchKeyDB = PR_FALSE;
  ------------------
  |  |  438|  31.3k|#define PR_FALSE 0
  ------------------
 5352|  31.3k|            }
 5353|  31.3k|            break;
 5354|  31.3k|        }
 5355|  62.6k|    }
 5356|  31.3k|}

NSC_DestroyObject:
  272|  62.0k|{
  273|  62.0k|    SFTKSlot *slot = sftk_SlotFromSessionHandle(hSession);
  274|  62.0k|    SFTKSession *session;
  275|  62.0k|    SFTKObject *object;
  276|  62.0k|    SFTKFreeStatus status;
  277|       |
  278|  62.0k|    CHECK_FORK();
  279|       |
  280|  62.0k|    if (slot == NULL) {
  ------------------
  |  Branch (280:9): [True: 0, False: 62.0k]
  ------------------
  281|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
  282|      0|    }
  283|       |    /*
  284|       |     * This whole block just makes sure we really can destroy the
  285|       |     * requested object.
  286|       |     */
  287|  62.0k|    session = sftk_SessionFromHandle(hSession);
  288|  62.0k|    if (session == NULL) {
  ------------------
  |  Branch (288:9): [True: 0, False: 62.0k]
  ------------------
  289|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
  290|      0|    }
  291|       |
  292|  62.0k|    object = sftk_ObjectFromHandle(hObject, session);
  293|  62.0k|    if (object == NULL) {
  ------------------
  |  Branch (293:9): [True: 0, False: 62.0k]
  ------------------
  294|      0|        sftk_FreeSession(session);
  295|      0|        return CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  296|      0|    }
  297|       |
  298|       |    /* don't destroy a private object if we aren't logged in */
  299|  62.0k|    if ((!slot->isLoggedIn) && (slot->needLogin) &&
  ------------------
  |  Branch (299:9): [True: 62.0k, False: 0]
  |  Branch (299:32): [True: 0, False: 62.0k]
  ------------------
  300|  62.0k|        (sftk_isTrue(object, CKA_PRIVATE))) {
  ------------------
  |  |  513|      0|#define CKA_PRIVATE 0x00000002UL
  ------------------
  |  Branch (300:9): [True: 0, False: 0]
  ------------------
  301|      0|        sftk_FreeSession(session);
  302|      0|        sftk_FreeObject(object);
  303|      0|        return CKR_USER_NOT_LOGGED_IN;
  ------------------
  |  | 1486|      0|#define CKR_USER_NOT_LOGGED_IN 0x00000101UL
  ------------------
  304|      0|    }
  305|       |
  306|       |    /* don't destroy a token object if we aren't in a rw session */
  307|       |
  308|  62.0k|    if (((session->info.flags & CKF_RW_SESSION) == 0) &&
  ------------------
  |  |  302|  62.0k|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (308:9): [True: 62.0k, False: 0]
  ------------------
  309|  62.0k|        (sftk_isTrue(object, CKA_TOKEN))) {
  ------------------
  |  |  512|  62.0k|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (309:9): [True: 0, False: 62.0k]
  ------------------
  310|      0|        sftk_FreeSession(session);
  311|      0|        sftk_FreeObject(object);
  312|      0|        return CKR_SESSION_READ_ONLY;
  ------------------
  |  | 1467|      0|#define CKR_SESSION_READ_ONLY 0x000000B5UL
  ------------------
  313|      0|    }
  314|       |
  315|  62.0k|    sftk_DeleteObject(session, object);
  316|       |
  317|  62.0k|    sftk_FreeSession(session);
  318|       |
  319|       |    /*
  320|       |     * get some indication if the object is destroyed. Note: this is not
  321|       |     * 100%. Someone may have an object reference outstanding (though that
  322|       |     * should not be the case by here. Also note that the object is "half"
  323|       |     * destroyed. Our internal representation is destroyed, but it may still
  324|       |     * be in the data base.
  325|       |     */
  326|  62.0k|    status = sftk_FreeObject(object);
  327|       |
  328|  62.0k|    return (status != SFTK_DestroyFailure) ? CKR_OK : CKR_DEVICE_ERROR;
  ------------------
  |  | 1388|  62.0k|#define CKR_OK 0x00000000UL
  ------------------
                  return (status != SFTK_DestroyFailure) ? CKR_OK : CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
  |  Branch (328:12): [True: 62.0k, False: 0]
  ------------------
  329|  62.0k|}
sftk_ReturnContextByType:
  376|   153k|{
  377|   153k|    switch (type) {
  ------------------
  |  Branch (377:13): [True: 0, False: 153k]
  ------------------
  378|  4.71k|        case SFTK_ENCRYPT:
  ------------------
  |  Branch (378:9): [True: 4.71k, False: 148k]
  ------------------
  379|  5.91k|        case SFTK_DECRYPT:
  ------------------
  |  Branch (379:9): [True: 1.20k, False: 152k]
  ------------------
  380|  6.15k|        case SFTK_MESSAGE_ENCRYPT:
  ------------------
  |  Branch (380:9): [True: 236, False: 153k]
  ------------------
  381|  7.18k|        case SFTK_MESSAGE_DECRYPT:
  ------------------
  |  Branch (381:9): [True: 1.03k, False: 152k]
  ------------------
  382|  7.18k|            return session->enc_context;
  383|   118k|        case SFTK_HASH:
  ------------------
  |  Branch (383:9): [True: 118k, False: 34.4k]
  ------------------
  384|   118k|            return session->hash_context;
  385|  22.2k|        case SFTK_SIGN:
  ------------------
  |  Branch (385:9): [True: 22.2k, False: 131k]
  ------------------
  386|  22.2k|        case SFTK_SIGN_RECOVER:
  ------------------
  |  Branch (386:9): [True: 0, False: 153k]
  ------------------
  387|  26.1k|        case SFTK_VERIFY:
  ------------------
  |  Branch (387:9): [True: 3.90k, False: 149k]
  ------------------
  388|  27.2k|        case SFTK_VERIFY_RECOVER:
  ------------------
  |  Branch (388:9): [True: 1.08k, False: 152k]
  ------------------
  389|  27.2k|        case SFTK_MESSAGE_SIGN:
  ------------------
  |  Branch (389:9): [True: 0, False: 153k]
  ------------------
  390|  27.2k|        case SFTK_MESSAGE_VERIFY:
  ------------------
  |  Branch (390:9): [True: 0, False: 153k]
  ------------------
  391|  27.2k|            return session->hash_context;
  392|   153k|    }
  393|      0|    return NULL;
  394|   153k|}
sftk_SetContextByType:
  402|  96.8k|{
  403|  96.8k|    switch (type) {
  ------------------
  |  Branch (403:13): [True: 0, False: 96.8k]
  ------------------
  404|  3.54k|        case SFTK_ENCRYPT:
  ------------------
  |  Branch (404:9): [True: 3.54k, False: 93.3k]
  ------------------
  405|  4.74k|        case SFTK_DECRYPT:
  ------------------
  |  Branch (405:9): [True: 1.20k, False: 95.6k]
  ------------------
  406|  4.98k|        case SFTK_MESSAGE_ENCRYPT:
  ------------------
  |  Branch (406:9): [True: 236, False: 96.6k]
  ------------------
  407|  6.01k|        case SFTK_MESSAGE_DECRYPT:
  ------------------
  |  Branch (407:9): [True: 1.03k, False: 95.8k]
  ------------------
  408|  6.01k|            session->enc_context = context;
  409|  6.01k|            break;
  410|  69.9k|        case SFTK_HASH:
  ------------------
  |  Branch (410:9): [True: 69.9k, False: 26.8k]
  ------------------
  411|  69.9k|            session->hash_context = context;
  412|  69.9k|            break;
  413|  15.8k|        case SFTK_SIGN:
  ------------------
  |  Branch (413:9): [True: 15.8k, False: 80.9k]
  ------------------
  414|  15.8k|        case SFTK_SIGN_RECOVER:
  ------------------
  |  Branch (414:9): [True: 0, False: 96.8k]
  ------------------
  415|  19.7k|        case SFTK_VERIFY:
  ------------------
  |  Branch (415:9): [True: 3.90k, False: 92.9k]
  ------------------
  416|  20.8k|        case SFTK_VERIFY_RECOVER:
  ------------------
  |  Branch (416:9): [True: 1.08k, False: 95.7k]
  ------------------
  417|  20.8k|        case SFTK_MESSAGE_SIGN:
  ------------------
  |  Branch (417:9): [True: 0, False: 96.8k]
  ------------------
  418|  20.8k|        case SFTK_MESSAGE_VERIFY:
  ------------------
  |  Branch (418:9): [True: 0, False: 96.8k]
  ------------------
  419|  20.8k|            session->hash_context = context;
  420|  20.8k|            break;
  421|  96.8k|    }
  422|  96.8k|    return;
  423|  96.8k|}
sftk_GetContext:
  435|  98.8k|{
  436|  98.8k|    SFTKSession *session;
  437|  98.8k|    SFTKSessionContext *context;
  438|       |
  439|  98.8k|    session = sftk_SessionFromHandle(handle);
  440|  98.8k|    if (session == NULL)
  ------------------
  |  Branch (440:9): [True: 0, False: 98.8k]
  ------------------
  441|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
  442|  98.8k|    context = sftk_ReturnContextByType(session, type);
  443|       |    /* make sure the context is valid */
  444|  98.8k|    if ((context == NULL) || (context->type != type) || (needMulti && !(context->multi))) {
  ------------------
  |  Branch (444:9): [True: 370, False: 98.4k]
  |  Branch (444:30): [True: 0, False: 98.4k]
  |  Branch (444:58): [True: 93.6k, False: 4.83k]
  |  Branch (444:71): [True: 0, False: 93.6k]
  ------------------
  445|    370|        sftk_FreeSession(session);
  446|    370|        return CKR_OPERATION_NOT_INITIALIZED;
  ------------------
  |  | 1454|    370|#define CKR_OPERATION_NOT_INITIALIZED 0x00000091UL
  ------------------
  447|    370|    }
  448|  98.4k|    *contextPtr = context;
  449|  98.4k|    if (sessionPtr != NULL) {
  ------------------
  |  Branch (449:9): [True: 52.4k, False: 46.0k]
  ------------------
  450|  52.4k|        *sessionPtr = session;
  451|  52.4k|    } else {
  452|  46.0k|        sftk_FreeSession(session);
  453|  46.0k|    }
  454|  98.4k|    return CKR_OK;
  ------------------
  |  | 1388|  98.4k|#define CKR_OK 0x00000000UL
  ------------------
  455|  98.8k|}
sftk_TerminateOp:
  463|  42.2k|{
  464|  42.2k|    session->lastOpWasFIPS = context->isFIPS;
  465|  42.2k|    sftk_FreeContext(context);
  466|  42.2k|    sftk_SetContextByType(session, ctype, NULL);
  467|  42.2k|}
sftk_InitGeneric:
  483|  52.5k|{
  484|  52.5k|    SFTKObject *key = NULL;
  485|  52.5k|    SFTKAttribute *att;
  486|  52.5k|    SFTKSessionContext *context;
  487|       |
  488|       |    /* We can only init if there is not current context active */
  489|  52.5k|    if (sftk_ReturnContextByType(session, ctype) != NULL) {
  ------------------
  |  Branch (489:9): [True: 0, False: 52.5k]
  ------------------
  490|      0|        return CKR_OPERATION_ACTIVE;
  ------------------
  |  | 1453|      0|#define CKR_OPERATION_ACTIVE 0x00000090UL
  ------------------
  491|      0|    }
  492|       |
  493|       |    /* find the key */
  494|  52.5k|    if (keyPtr) {
  ------------------
  |  Branch (494:9): [True: 16.8k, False: 35.6k]
  ------------------
  495|  16.8k|        key = sftk_ObjectFromHandle(hKey, session);
  496|  16.8k|        if (key == NULL) {
  ------------------
  |  Branch (496:13): [True: 0, False: 16.8k]
  ------------------
  497|      0|            return CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
  498|      0|        }
  499|       |
  500|       |        /* make sure it's a valid  key for this operation */
  501|  16.8k|        if (((key->objclass != CKO_SECRET_KEY) &&
  ------------------
  |  |  329|  16.8k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
  |  Branch (501:14): [True: 3.57k, False: 13.2k]
  ------------------
  502|  16.8k|             (key->objclass != pubKeyType)) ||
  ------------------
  |  Branch (502:14): [True: 0, False: 3.57k]
  ------------------
  503|  16.8k|            !sftk_isTrue(key, operation)) {
  ------------------
  |  Branch (503:13): [True: 0, False: 16.8k]
  ------------------
  504|      0|            sftk_FreeObject(key);
  505|      0|            return CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
  506|      0|        }
  507|       |        /* get the key type */
  508|  16.8k|        att = sftk_FindAttribute(key, CKA_KEY_TYPE);
  ------------------
  |  |  543|  16.8k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
  509|  16.8k|        if (att == NULL) {
  ------------------
  |  Branch (509:13): [True: 0, False: 16.8k]
  ------------------
  510|      0|            sftk_FreeObject(key);
  511|      0|            return CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
  512|      0|        }
  513|  16.8k|        PORT_Assert(att->attrib.ulValueLen == sizeof(CK_KEY_TYPE));
  ------------------
  |  |  120|  16.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  16.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 16.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  514|  16.8k|        if (att->attrib.ulValueLen != sizeof(CK_KEY_TYPE)) {
  ------------------
  |  Branch (514:13): [True: 0, False: 16.8k]
  ------------------
  515|      0|            sftk_FreeAttribute(att);
  516|      0|            sftk_FreeObject(key);
  517|      0|            return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  518|      0|        }
  519|  16.8k|        PORT_Memcpy(keyTypePtr, att->attrib.pValue, sizeof(CK_KEY_TYPE));
  ------------------
  |  |  180|  16.8k|#define PORT_Memcpy memcpy
  ------------------
  520|  16.8k|        sftk_FreeAttribute(att);
  521|  16.8k|        *keyPtr = key;
  522|  16.8k|    }
  523|       |
  524|       |    /* allocate the context structure */
  525|  52.5k|    context = (SFTKSessionContext *)PORT_Alloc(sizeof(SFTKSessionContext));
  ------------------
  |  |   52|  52.5k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  526|  52.5k|    if (context == NULL) {
  ------------------
  |  Branch (526:9): [True: 0, False: 52.5k]
  ------------------
  527|      0|        if (key)
  ------------------
  |  Branch (527:13): [True: 0, False: 0]
  ------------------
  528|      0|            sftk_FreeObject(key);
  529|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  530|      0|    }
  531|  52.5k|    context->type = ctype;
  532|  52.5k|    context->multi = PR_TRUE;
  ------------------
  |  |  437|  52.5k|#define PR_TRUE 1
  ------------------
  533|  52.5k|    context->rsa = PR_FALSE;
  ------------------
  |  |  438|  52.5k|#define PR_FALSE 0
  ------------------
  534|  52.5k|    context->cipherInfo = NULL;
  535|  52.5k|    context->hashInfo = NULL;
  536|  52.5k|    context->doPad = PR_FALSE;
  ------------------
  |  |  438|  52.5k|#define PR_FALSE 0
  ------------------
  537|  52.5k|    context->padDataLength = 0;
  538|  52.5k|    context->key = key;
  539|  52.5k|    context->blockSize = 0;
  540|  52.5k|    context->maxLen = 0;
  541|  52.5k|    context->isFIPS = sftk_operationIsFIPS(session->slot, pMechanism,
  542|  52.5k|                                           operation, key);
  543|  52.5k|    *contextPtr = context;
  544|  52.5k|    return CKR_OK;
  ------------------
  |  | 1388|  52.5k|#define CKR_OK 0x00000000UL
  ------------------
  545|  52.5k|}
sftk_CryptInit:
  859|  3.58k|{
  860|  3.58k|    SFTKSession *session;
  861|  3.58k|    SFTKObject *key;
  862|  3.58k|    SFTKSessionContext *context;
  863|  3.58k|    SFTKAttribute *att;
  864|  3.58k|#ifndef NSS_DISABLE_DEPRECATED_RC2
  865|  3.58k|    CK_RC2_CBC_PARAMS *rc2_param;
  866|  3.58k|    unsigned effectiveKeyLength;
  867|  3.58k|#endif
  868|       |#if NSS_SOFTOKEN_DOES_RC5
  869|       |    CK_RC5_CBC_PARAMS *rc5_param;
  870|       |    SECItem rc5Key;
  871|       |#endif
  872|  3.58k|    CK_NSS_GCM_PARAMS nss_gcm_param;
  873|  3.58k|    void *aes_param;
  874|  3.58k|    CK_NSS_AEAD_PARAMS nss_aead_params;
  875|  3.58k|    CK_NSS_AEAD_PARAMS *nss_aead_params_ptr = NULL;
  876|  3.58k|    CK_KEY_TYPE key_type;
  877|  3.58k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  3.58k|#define CKR_OK 0x00000000UL
  ------------------
  878|  3.58k|    unsigned char newdeskey[24];
  879|  3.58k|    PRBool useNewKey = PR_FALSE;
  ------------------
  |  |  438|  3.58k|#define PR_FALSE 0
  ------------------
  880|  3.58k|    int t;
  881|       |
  882|  3.58k|    if (!pMechanism) {
  ------------------
  |  Branch (882:9): [True: 0, False: 3.58k]
  ------------------
  883|      0|        return CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
  884|      0|    }
  885|       |
  886|  3.58k|    crv = sftk_MechAllowsOperation(pMechanism->mechanism, mechUsage);
  887|  3.58k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.58k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (887:9): [True: 8, False: 3.57k]
  ------------------
  888|      8|        return crv;
  889|       |
  890|  3.57k|    session = sftk_SessionFromHandle(hSession);
  891|  3.57k|    if (session == NULL)
  ------------------
  |  Branch (891:9): [True: 0, False: 3.57k]
  ------------------
  892|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
  893|       |
  894|  3.57k|    crv = sftk_InitGeneric(session, pMechanism, &context, contextType, &key,
  895|  3.57k|                           hKey, &key_type,
  896|  3.57k|                           isEncrypt ? CKO_PUBLIC_KEY : CKO_PRIVATE_KEY,
  ------------------
  |  |  327|  2.37k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
                                         isEncrypt ? CKO_PUBLIC_KEY : CKO_PRIVATE_KEY,
  ------------------
  |  |  328|  1.20k|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
  |  Branch (896:28): [True: 2.37k, False: 1.20k]
  ------------------
  897|  3.57k|                           keyUsage);
  898|       |
  899|  3.57k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  3.57k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (899:9): [True: 0, False: 3.57k]
  ------------------
  900|      0|        sftk_FreeSession(session);
  901|      0|        return crv;
  902|      0|    }
  903|       |
  904|  3.57k|    context->doPad = PR_FALSE;
  ------------------
  |  |  438|  3.57k|#define PR_FALSE 0
  ------------------
  905|  3.57k|    switch (pMechanism->mechanism) {
  906|  1.08k|        case CKM_RSA_PKCS:
  ------------------
  |  |  720|  1.08k|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (906:9): [True: 1.08k, False: 2.49k]
  ------------------
  907|  1.08k|        case CKM_RSA_X_509:
  ------------------
  |  |  722|  1.08k|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (907:9): [True: 0, False: 3.57k]
  ------------------
  908|  1.08k|            if (key_type != CKK_RSA) {
  ------------------
  |  |  372|  1.08k|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (908:17): [True: 0, False: 1.08k]
  ------------------
  909|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
  910|      0|                break;
  911|      0|            }
  912|  1.08k|            context->multi = PR_FALSE;
  ------------------
  |  |  438|  1.08k|#define PR_FALSE 0
  ------------------
  913|  1.08k|            context->rsa = PR_TRUE;
  ------------------
  |  |  437|  1.08k|#define PR_TRUE 1
  ------------------
  914|  1.08k|            if (isEncrypt) {
  ------------------
  |  Branch (914:17): [True: 1.08k, False: 0]
  ------------------
  915|  1.08k|                NSSLOWKEYPublicKey *pubKey = sftk_GetPubKey(key, CKK_RSA, &crv);
  ------------------
  |  |  372|  1.08k|#define CKK_RSA 0x00000000UL
  ------------------
  916|  1.08k|                if (pubKey == NULL) {
  ------------------
  |  Branch (916:21): [True: 0, False: 1.08k]
  ------------------
  917|      0|                    crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
  918|      0|                    break;
  919|      0|                }
  920|  1.08k|                context->maxLen = nsslowkey_PublicModulusLen(pubKey);
  921|  1.08k|                context->cipherInfo = (void *)pubKey;
  922|  1.08k|                context->update = pMechanism->mechanism == CKM_RSA_X_509
  ------------------
  |  |  722|  1.08k|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (922:35): [True: 0, False: 1.08k]
  ------------------
  923|  1.08k|                                      ? sftk_RSAEncryptRaw
  924|  1.08k|                                      : sftk_RSAEncrypt;
  925|  1.08k|            } else {
  926|      0|                NSSLOWKEYPrivateKey *privKey = sftk_GetPrivKey(key, CKK_RSA, &crv);
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  927|      0|                if (privKey == NULL) {
  ------------------
  |  Branch (927:21): [True: 0, False: 0]
  ------------------
  928|      0|                    crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
  929|      0|                    break;
  930|      0|                }
  931|      0|                context->maxLen = nsslowkey_PrivateModulusLen(privKey);
  932|      0|                context->cipherInfo = (void *)privKey;
  933|      0|                context->update = pMechanism->mechanism == CKM_RSA_X_509
  ------------------
  |  |  722|      0|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (933:35): [True: 0, False: 0]
  ------------------
  934|      0|                                      ? sftk_RSADecryptRaw
  935|      0|                                      : sftk_RSADecrypt;
  936|      0|            }
  937|  1.08k|            context->destroy = sftk_Null;
  938|  1.08k|            break;
  939|      0|        case CKM_RSA_PKCS_OAEP:
  ------------------
  |  |  734|      0|#define CKM_RSA_PKCS_OAEP 0x00000009UL
  ------------------
  |  Branch (939:9): [True: 0, False: 3.57k]
  ------------------
  940|      0|            if (key_type != CKK_RSA) {
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (940:17): [True: 0, False: 0]
  ------------------
  941|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
  942|      0|                break;
  943|      0|            }
  944|      0|            if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_OAEP_PARAMS) ||
  ------------------
  |  Branch (944:17): [True: 0, False: 0]
  ------------------
  945|      0|                !sftk_ValidateOaepParams((CK_RSA_PKCS_OAEP_PARAMS *)pMechanism->pParameter)) {
  ------------------
  |  Branch (945:17): [True: 0, False: 0]
  ------------------
  946|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
  947|      0|                break;
  948|      0|            }
  949|      0|            context->multi = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  950|      0|            context->rsa = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  951|      0|            {
  952|      0|                SFTKOAEPInfo *info;
  953|      0|                CK_RSA_PKCS_OAEP_PARAMS *params =
  954|      0|                    (CK_RSA_PKCS_OAEP_PARAMS *)pMechanism->pParameter;
  955|       |                /* make a copy of the source data value for future
  956|       |                 * use (once the user has reclaimed his data in pParameter)*/
  957|      0|                void *newSource = NULL;
  958|      0|                if (params->pSourceData) {
  ------------------
  |  Branch (958:21): [True: 0, False: 0]
  ------------------
  959|      0|                    newSource = PORT_Alloc(params->ulSourceDataLen);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  960|      0|                    if (newSource == NULL) {
  ------------------
  |  Branch (960:25): [True: 0, False: 0]
  ------------------
  961|      0|                        crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  962|      0|                        break;
  963|      0|                    }
  964|      0|                    PORT_Memcpy(newSource, params->pSourceData, params->ulSourceDataLen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  965|      0|                }
  966|      0|                info = PORT_New(SFTKOAEPInfo);
  ------------------
  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
  967|      0|                if (info == NULL) {
  ------------------
  |  Branch (967:21): [True: 0, False: 0]
  ------------------
  968|      0|                    PORT_ZFree(newSource, params->ulSourceDataLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  969|      0|                    crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  970|      0|                    break;
  971|      0|                }
  972|      0|                info->params = *params;
  973|      0|                info->params.pSourceData = newSource;
  974|      0|                info->isEncrypt = isEncrypt;
  975|       |
  976|       |                /* now setup encryption and decryption contexts */
  977|      0|                if (isEncrypt) {
  ------------------
  |  Branch (977:21): [True: 0, False: 0]
  ------------------
  978|      0|                    info->key.pub = sftk_GetPubKey(key, CKK_RSA, &crv);
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  979|      0|                    if (info->key.pub == NULL) {
  ------------------
  |  Branch (979:25): [True: 0, False: 0]
  ------------------
  980|      0|                        sftk_freeRSAOAEPInfo(info, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  981|      0|                        crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
  982|      0|                        break;
  983|      0|                    }
  984|      0|                    context->update = sftk_RSAEncryptOAEP;
  985|      0|                    context->maxLen = nsslowkey_PublicModulusLen(info->key.pub);
  986|      0|                } else {
  987|      0|                    info->key.priv = sftk_GetPrivKey(key, CKK_RSA, &crv);
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  988|      0|                    if (info->key.priv == NULL) {
  ------------------
  |  Branch (988:25): [True: 0, False: 0]
  ------------------
  989|      0|                        sftk_freeRSAOAEPInfo(info, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  990|      0|                        crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
  991|      0|                        break;
  992|      0|                    }
  993|      0|                    context->update = sftk_RSADecryptOAEP;
  994|      0|                    context->maxLen = nsslowkey_PrivateModulusLen(info->key.priv);
  995|      0|                }
  996|      0|                context->cipherInfo = info;
  997|      0|            }
  998|      0|            context->destroy = sftk_freeRSAOAEPInfo;
  999|      0|            break;
 1000|      0|#ifndef NSS_DISABLE_DEPRECATED_RC2
 1001|      0|        case CKM_RC2_CBC_PAD:
  ------------------
  |  |  810|      0|#define CKM_RC2_CBC_PAD 0x00000105UL
  ------------------
  |  Branch (1001:9): [True: 0, False: 3.57k]
  ------------------
 1002|      0|            context->doPad = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1003|       |        /* fall thru */
 1004|      0|        case CKM_RC2_ECB:
  ------------------
  |  |  804|      0|#define CKM_RC2_ECB 0x00000101UL
  ------------------
  |  Branch (1004:9): [True: 0, False: 3.57k]
  ------------------
 1005|      0|        case CKM_RC2_CBC:
  ------------------
  |  |  805|      0|#define CKM_RC2_CBC 0x00000102UL
  ------------------
  |  Branch (1005:9): [True: 0, False: 3.57k]
  ------------------
 1006|      0|            context->blockSize = 8;
 1007|      0|            if (key_type != CKK_RC2) {
  ------------------
  |  |  384|      0|#define CKK_RC2 0x00000011UL
  ------------------
  |  Branch (1007:17): [True: 0, False: 0]
  ------------------
 1008|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1009|      0|                break;
 1010|      0|            }
 1011|      0|            att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 1012|      0|            if (att == NULL) {
  ------------------
  |  Branch (1012:17): [True: 0, False: 0]
  ------------------
 1013|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1014|      0|                break;
 1015|      0|            }
 1016|       |
 1017|      0|            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_RC2_CBC_PARAMS))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1018|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1019|      0|                break;
 1020|      0|            }
 1021|      0|            rc2_param = (CK_RC2_CBC_PARAMS *)pMechanism->pParameter;
 1022|      0|            effectiveKeyLength = (rc2_param->ulEffectiveBits + 7) / 8;
 1023|      0|            context->cipherInfo =
 1024|      0|                RC2_CreateContext((unsigned char *)att->attrib.pValue,
 1025|      0|                                  att->attrib.ulValueLen, rc2_param->iv,
 1026|      0|                                  pMechanism->mechanism == CKM_RC2_ECB ? NSS_RC2 : NSS_RC2_CBC, effectiveKeyLength);
  ------------------
  |  |  804|      0|#define CKM_RC2_ECB 0x00000101UL
  ------------------
                                                pMechanism->mechanism == CKM_RC2_ECB ? NSS_RC2 : NSS_RC2_CBC, effectiveKeyLength);
  ------------------
  |  |   17|      0|#define NSS_RC2 0
  ------------------
                                                pMechanism->mechanism == CKM_RC2_ECB ? NSS_RC2 : NSS_RC2_CBC, effectiveKeyLength);
  ------------------
  |  |   18|      0|#define NSS_RC2_CBC 1
  ------------------
  |  Branch (1026:35): [True: 0, False: 0]
  ------------------
 1027|      0|            sftk_FreeAttribute(att);
 1028|      0|            if (context->cipherInfo == NULL) {
  ------------------
  |  Branch (1028:17): [True: 0, False: 0]
  ------------------
 1029|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1030|      0|                break;
 1031|      0|            }
 1032|      0|            context->update = isEncrypt ? SFTKCipher_RC2_Encrypt : SFTKCipher_RC2_Decrypt;
  ------------------
  |  Branch (1032:31): [True: 0, False: 0]
  ------------------
 1033|      0|            context->destroy = SFTKCipher_RC2_DestroyContext;
 1034|      0|            break;
 1035|      0|#endif /* NSS_DISABLE_DEPRECATED_RC2 */
 1036|       |
 1037|       |#if NSS_SOFTOKEN_DOES_RC5
 1038|       |        case CKM_RC5_CBC_PAD:
 1039|       |            context->doPad = PR_TRUE;
 1040|       |        /* fall thru */
 1041|       |        case CKM_RC5_ECB:
 1042|       |        case CKM_RC5_CBC:
 1043|       |            if (key_type != CKK_RC5) {
 1044|       |                crv = CKR_KEY_TYPE_INCONSISTENT;
 1045|       |                break;
 1046|       |            }
 1047|       |            att = sftk_FindAttribute(key, CKA_VALUE);
 1048|       |            if (att == NULL) {
 1049|       |                crv = CKR_KEY_HANDLE_INVALID;
 1050|       |                break;
 1051|       |            }
 1052|       |
 1053|       |            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_RC5_CBC_PARAMS))) {
 1054|       |                crv = CKR_MECHANISM_PARAM_INVALID;
 1055|       |                break;
 1056|       |            }
 1057|       |            rc5_param = (CK_RC5_CBC_PARAMS *)pMechanism->pParameter;
 1058|       |            context->blockSize = rc5_param->ulWordsize * 2;
 1059|       |            rc5Key.data = (unsigned char *)att->attrib.pValue;
 1060|       |            rc5Key.len = att->attrib.ulValueLen;
 1061|       |            context->cipherInfo = RC5_CreateContext(&rc5Key, rc5_param->ulRounds,
 1062|       |                                                    rc5_param->ulWordsize, rc5_param->pIv,
 1063|       |                                                    pMechanism->mechanism == CKM_RC5_ECB ? NSS_RC5 : NSS_RC5_CBC);
 1064|       |            sftk_FreeAttribute(att);
 1065|       |            if (context->cipherInfo == NULL) {
 1066|       |                crv = CKR_HOST_MEMORY;
 1067|       |                break;
 1068|       |            }
 1069|       |            context->update = isEncrypt ? SFTKCipher_RC5_Encrypt : SFTKCipher_RC5_Decrypt;
 1070|       |            context->destroy = SFTKCipher_RC5_DestroyContext;
 1071|       |            break;
 1072|       |#endif
 1073|      0|        case CKM_RC4:
  ------------------
  |  |  813|      0|#define CKM_RC4 0x00000111UL
  ------------------
  |  Branch (1073:9): [True: 0, False: 3.57k]
  ------------------
 1074|      0|            if (key_type != CKK_RC4) {
  ------------------
  |  |  385|      0|#define CKK_RC4 0x00000012UL
  ------------------
  |  Branch (1074:17): [True: 0, False: 0]
  ------------------
 1075|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1076|      0|                break;
 1077|      0|            }
 1078|      0|            att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 1079|      0|            if (att == NULL) {
  ------------------
  |  Branch (1079:17): [True: 0, False: 0]
  ------------------
 1080|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1081|      0|                break;
 1082|      0|            }
 1083|      0|            context->cipherInfo =
 1084|      0|                RC4_CreateContext((unsigned char *)att->attrib.pValue,
 1085|      0|                                  att->attrib.ulValueLen);
 1086|      0|            sftk_FreeAttribute(att);
 1087|      0|            if (context->cipherInfo == NULL) {
  ------------------
  |  Branch (1087:17): [True: 0, False: 0]
  ------------------
 1088|      0|                crv = CKR_HOST_MEMORY; /* WRONG !!! */
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1089|      0|                break;
 1090|      0|            }
 1091|      0|            context->update = isEncrypt ? SFTKCipher_RC4_Encrypt : SFTKCipher_RC4_Decrypt;
  ------------------
  |  Branch (1091:31): [True: 0, False: 0]
  ------------------
 1092|      0|            context->destroy = SFTKCipher_RC4_DestroyContext;
 1093|      0|            break;
 1094|      0|        case CKM_CDMF_CBC_PAD:
  ------------------
  |  |  839|      0|#define CKM_CDMF_CBC_PAD 0x00000145UL
  ------------------
  |  Branch (1094:9): [True: 0, False: 3.57k]
  ------------------
 1095|      0|            context->doPad = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1096|       |        /* fall thru */
 1097|      0|        case CKM_CDMF_ECB:
  ------------------
  |  |  835|      0|#define CKM_CDMF_ECB 0x00000141UL
  ------------------
  |  Branch (1097:9): [True: 0, False: 3.57k]
  ------------------
 1098|      0|        case CKM_CDMF_CBC:
  ------------------
  |  |  836|      0|#define CKM_CDMF_CBC 0x00000142UL
  ------------------
  |  Branch (1098:9): [True: 0, False: 3.57k]
  ------------------
 1099|      0|            if (key_type != CKK_CDMF) {
  ------------------
  |  |  401|      0|#define CKK_CDMF 0x0000001EUL
  ------------------
  |  Branch (1099:17): [True: 0, False: 0]
  ------------------
 1100|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1101|      0|                break;
 1102|      0|            }
 1103|      0|            t = (pMechanism->mechanism == CKM_CDMF_ECB) ? NSS_DES : NSS_DES_CBC;
  ------------------
  |  |  835|      0|#define CKM_CDMF_ECB 0x00000141UL
  ------------------
                          t = (pMechanism->mechanism == CKM_CDMF_ECB) ? NSS_DES : NSS_DES_CBC;
  ------------------
  |  |   25|      0|#define NSS_DES 0
  ------------------
                          t = (pMechanism->mechanism == CKM_CDMF_ECB) ? NSS_DES : NSS_DES_CBC;
  ------------------
  |  |   26|      0|#define NSS_DES_CBC 1
  ------------------
  |  Branch (1103:17): [True: 0, False: 0]
  ------------------
 1104|      0|            goto finish_des;
 1105|      0|        case CKM_DES_ECB:
  ------------------
  |  |  815|      0|#define CKM_DES_ECB 0x00000121UL
  ------------------
  |  Branch (1105:9): [True: 0, False: 3.57k]
  ------------------
 1106|      0|            if (key_type != CKK_DES) {
  ------------------
  |  |  386|      0|#define CKK_DES 0x00000013UL
  ------------------
  |  Branch (1106:17): [True: 0, False: 0]
  ------------------
 1107|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1108|      0|                break;
 1109|      0|            }
 1110|      0|            t = NSS_DES;
  ------------------
  |  |   25|      0|#define NSS_DES 0
  ------------------
 1111|      0|            goto finish_des;
 1112|      0|        case CKM_DES_CBC_PAD:
  ------------------
  |  |  821|      0|#define CKM_DES_CBC_PAD 0x00000125UL
  ------------------
  |  Branch (1112:9): [True: 0, False: 3.57k]
  ------------------
 1113|      0|            context->doPad = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1114|       |        /* fall thru */
 1115|    302|        case CKM_DES_CBC:
  ------------------
  |  |  816|    302|#define CKM_DES_CBC 0x00000122UL
  ------------------
  |  Branch (1115:9): [True: 302, False: 3.27k]
  ------------------
 1116|    302|            if (key_type != CKK_DES) {
  ------------------
  |  |  386|    302|#define CKK_DES 0x00000013UL
  ------------------
  |  Branch (1116:17): [True: 0, False: 302]
  ------------------
 1117|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1118|      0|                break;
 1119|      0|            }
 1120|    302|            t = NSS_DES_CBC;
  ------------------
  |  |   26|    302|#define NSS_DES_CBC 1
  ------------------
 1121|    302|            goto finish_des;
 1122|     89|        case CKM_DES3_ECB:
  ------------------
  |  |  825|     89|#define CKM_DES3_ECB 0x00000132UL
  ------------------
  |  Branch (1122:9): [True: 89, False: 3.48k]
  ------------------
 1123|     89|            if ((key_type != CKK_DES2) && (key_type != CKK_DES3)) {
  ------------------
  |  |  387|     89|#define CKK_DES2 0x00000014UL
  ------------------
                          if ((key_type != CKK_DES2) && (key_type != CKK_DES3)) {
  ------------------
  |  |  388|     89|#define CKK_DES3 0x00000015UL
  ------------------
  |  Branch (1123:17): [True: 89, False: 0]
  |  Branch (1123:43): [True: 0, False: 89]
  ------------------
 1124|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1125|      0|                break;
 1126|      0|            }
 1127|     89|            t = NSS_DES_EDE3;
  ------------------
  |  |   27|     89|#define NSS_DES_EDE3 2
  ------------------
 1128|     89|            goto finish_des;
 1129|      0|        case CKM_DES3_CBC_PAD:
  ------------------
  |  |  833|      0|#define CKM_DES3_CBC_PAD 0x00000136UL
  ------------------
  |  Branch (1129:9): [True: 0, False: 3.57k]
  ------------------
 1130|      0|            context->doPad = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1131|       |        /* fall thru */
 1132|  1.21k|        case CKM_DES3_CBC:
  ------------------
  |  |  826|  1.21k|#define CKM_DES3_CBC 0x00000133UL
  ------------------
  |  Branch (1132:9): [True: 1.21k, False: 2.35k]
  ------------------
 1133|  1.21k|            if ((key_type != CKK_DES2) && (key_type != CKK_DES3)) {
  ------------------
  |  |  387|  1.21k|#define CKK_DES2 0x00000014UL
  ------------------
                          if ((key_type != CKK_DES2) && (key_type != CKK_DES3)) {
  ------------------
  |  |  388|  1.21k|#define CKK_DES3 0x00000015UL
  ------------------
  |  Branch (1133:17): [True: 1.21k, False: 0]
  |  Branch (1133:43): [True: 0, False: 1.21k]
  ------------------
 1134|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1135|      0|                break;
 1136|      0|            }
 1137|  1.21k|            t = NSS_DES_EDE3_CBC;
  ------------------
  |  |   28|  1.21k|#define NSS_DES_EDE3_CBC 3
  ------------------
 1138|  1.60k|        finish_des:
 1139|  1.60k|            if ((t != NSS_DES && t != NSS_DES_EDE3) && (pMechanism->pParameter == NULL ||
  ------------------
  |  |   25|  3.21k|#define NSS_DES 0
  ------------------
                          if ((t != NSS_DES && t != NSS_DES_EDE3) && (pMechanism->pParameter == NULL ||
  ------------------
  |  |   27|  1.60k|#define NSS_DES_EDE3 2
  ------------------
  |  Branch (1139:18): [True: 1.60k, False: 0]
  |  Branch (1139:34): [True: 1.51k, False: 89]
  |  Branch (1139:57): [True: 0, False: 1.51k]
  ------------------
 1140|  1.51k|                                                        pMechanism->ulParameterLen < 8)) {
  ------------------
  |  Branch (1140:57): [True: 0, False: 1.51k]
  ------------------
 1141|      0|                crv = CKR_DOMAIN_PARAMS_INVALID;
  ------------------
  |  | 1508|      0|#define CKR_DOMAIN_PARAMS_INVALID 0x00000130UL
  ------------------
 1142|      0|                break;
 1143|      0|            }
 1144|  1.60k|            context->blockSize = 8;
 1145|  1.60k|            att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|  1.60k|#define CKA_VALUE 0x00000011UL
  ------------------
 1146|  1.60k|            if (att == NULL) {
  ------------------
  |  Branch (1146:17): [True: 0, False: 1.60k]
  ------------------
 1147|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1148|      0|                break;
 1149|      0|            }
 1150|  1.60k|            if (key_type == CKK_DES2 &&
  ------------------
  |  |  387|  3.21k|#define CKK_DES2 0x00000014UL
  ------------------
  |  Branch (1150:17): [True: 0, False: 1.60k]
  ------------------
 1151|  1.60k|                (t == NSS_DES_EDE3_CBC || t == NSS_DES_EDE3)) {
  ------------------
  |  |   28|      0|#define NSS_DES_EDE3_CBC 3
  ------------------
                              (t == NSS_DES_EDE3_CBC || t == NSS_DES_EDE3)) {
  ------------------
  |  |   27|      0|#define NSS_DES_EDE3 2
  ------------------
  |  Branch (1151:18): [True: 0, False: 0]
  |  Branch (1151:43): [True: 0, False: 0]
  ------------------
 1152|       |                /* extend DES2 key to DES3 key. */
 1153|      0|                memcpy(newdeskey, att->attrib.pValue, 16);
 1154|      0|                memcpy(newdeskey + 16, newdeskey, 8);
 1155|      0|                useNewKey = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1156|  1.60k|            } else if (key_type == CKK_CDMF) {
  ------------------
  |  |  401|  1.60k|#define CKK_CDMF 0x0000001EUL
  ------------------
  |  Branch (1156:24): [True: 0, False: 1.60k]
  ------------------
 1157|      0|                crv = sftk_cdmf2des((unsigned char *)att->attrib.pValue, newdeskey);
 1158|      0|                if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1158:21): [True: 0, False: 0]
  ------------------
 1159|      0|                    sftk_FreeAttribute(att);
 1160|      0|                    break;
 1161|      0|                }
 1162|      0|                useNewKey = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1163|      0|            }
 1164|  1.60k|            context->cipherInfo = DES_CreateContext(
 1165|  1.60k|                useNewKey ? newdeskey : (unsigned char *)att->attrib.pValue,
  ------------------
  |  Branch (1165:17): [True: 0, False: 1.60k]
  ------------------
 1166|  1.60k|                (unsigned char *)pMechanism->pParameter, t, isEncrypt);
 1167|  1.60k|            if (useNewKey)
  ------------------
  |  Branch (1167:17): [True: 0, False: 1.60k]
  ------------------
 1168|      0|                memset(newdeskey, 0, sizeof newdeskey);
 1169|  1.60k|            sftk_FreeAttribute(att);
 1170|  1.60k|            if (context->cipherInfo == NULL) {
  ------------------
  |  Branch (1170:17): [True: 0, False: 1.60k]
  ------------------
 1171|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1172|      0|                break;
 1173|      0|            }
 1174|  1.60k|            context->update = isEncrypt ? SFTKCipher_DES_Encrypt : SFTKCipher_DES_Decrypt;
  ------------------
  |  Branch (1174:31): [True: 848, False: 759]
  ------------------
 1175|  1.60k|            context->destroy = SFTKCipher_DES_DestroyContext;
 1176|  1.60k|            break;
 1177|      0|#ifndef NSS_DISABLE_DEPRECATED_SEED
 1178|      0|        case CKM_SEED_CBC_PAD:
  ------------------
  |  | 1160|      0|#define CKM_SEED_CBC_PAD 0x00000655UL
  ------------------
  |  Branch (1178:9): [True: 0, False: 3.57k]
  ------------------
 1179|      0|            context->doPad = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1180|       |        /* fall thru */
 1181|    270|        case CKM_SEED_CBC:
  ------------------
  |  | 1157|    270|#define CKM_SEED_CBC 0x00000652UL
  ------------------
  |  Branch (1181:9): [True: 270, False: 3.30k]
  ------------------
 1182|    270|            if (!pMechanism->pParameter ||
  ------------------
  |  Branch (1182:17): [True: 0, False: 270]
  ------------------
 1183|    270|                pMechanism->ulParameterLen != 16) {
  ------------------
  |  Branch (1183:17): [True: 0, False: 270]
  ------------------
 1184|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1185|      0|                break;
 1186|      0|            }
 1187|       |        /* fall thru */
 1188|    270|        case CKM_SEED_ECB:
  ------------------
  |  | 1156|    270|#define CKM_SEED_ECB 0x00000651UL
  ------------------
  |  Branch (1188:9): [True: 0, False: 3.57k]
  ------------------
 1189|    270|            context->blockSize = 16;
 1190|    270|            if (key_type != CKK_SEED) {
  ------------------
  |  |  416|    270|#define CKK_SEED 0x0000002FUL /* was 2A */
  ------------------
  |  Branch (1190:17): [True: 0, False: 270]
  ------------------
 1191|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1192|      0|                break;
 1193|      0|            }
 1194|    270|            att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|    270|#define CKA_VALUE 0x00000011UL
  ------------------
 1195|    270|            if (att == NULL) {
  ------------------
  |  Branch (1195:17): [True: 0, False: 270]
  ------------------
 1196|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1197|      0|                break;
 1198|      0|            }
 1199|    270|            context->cipherInfo = SEED_CreateContext(
 1200|    270|                (unsigned char *)att->attrib.pValue,
 1201|    270|                (unsigned char *)pMechanism->pParameter,
 1202|    270|                pMechanism->mechanism == CKM_SEED_ECB ? NSS_SEED : NSS_SEED_CBC,
  ------------------
  |  | 1156|    270|#define CKM_SEED_ECB 0x00000651UL
  ------------------
                              pMechanism->mechanism == CKM_SEED_ECB ? NSS_SEED : NSS_SEED_CBC,
  ------------------
  |  |   46|      0|#define NSS_SEED 0
  ------------------
                              pMechanism->mechanism == CKM_SEED_ECB ? NSS_SEED : NSS_SEED_CBC,
  ------------------
  |  |   47|    270|#define NSS_SEED_CBC 1
  ------------------
  |  Branch (1202:17): [True: 0, False: 270]
  ------------------
 1203|    270|                isEncrypt);
 1204|    270|            sftk_FreeAttribute(att);
 1205|    270|            if (context->cipherInfo == NULL) {
  ------------------
  |  Branch (1205:17): [True: 0, False: 270]
  ------------------
 1206|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1207|      0|                break;
 1208|      0|            }
 1209|    270|            context->update = isEncrypt ? SFTKCipher_SEED_Encrypt : SFTKCipher_SEED_Decrypt;
  ------------------
  |  Branch (1209:31): [True: 135, False: 135]
  ------------------
 1210|    270|            context->destroy = SFTKCipher_SEED_DestroyContext;
 1211|    270|            break;
 1212|      0|#endif /* NSS_DISABLE_DEPRECATED_SEED */
 1213|      0|        case CKM_CAMELLIA_CBC_PAD:
  ------------------
  |  | 1140|      0|#define CKM_CAMELLIA_CBC_PAD 0x00000555UL
  ------------------
  |  Branch (1213:9): [True: 0, False: 3.57k]
  ------------------
 1214|      0|            context->doPad = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1215|       |        /* fall thru */
 1216|     88|        case CKM_CAMELLIA_CBC:
  ------------------
  |  | 1137|     88|#define CKM_CAMELLIA_CBC 0x00000552UL
  ------------------
  |  Branch (1216:9): [True: 88, False: 3.48k]
  ------------------
 1217|     88|            if (!pMechanism->pParameter ||
  ------------------
  |  Branch (1217:17): [True: 0, False: 88]
  ------------------
 1218|     88|                pMechanism->ulParameterLen != 16) {
  ------------------
  |  Branch (1218:17): [True: 0, False: 88]
  ------------------
 1219|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1220|      0|                break;
 1221|      0|            }
 1222|       |        /* fall thru */
 1223|     88|        case CKM_CAMELLIA_ECB:
  ------------------
  |  | 1136|     88|#define CKM_CAMELLIA_ECB 0x00000551UL
  ------------------
  |  Branch (1223:9): [True: 0, False: 3.57k]
  ------------------
 1224|     88|            context->blockSize = 16;
 1225|     88|            if (key_type != CKK_CAMELLIA) {
  ------------------
  |  |  414|     88|#define CKK_CAMELLIA 0x00000025UL
  ------------------
  |  Branch (1225:17): [True: 0, False: 88]
  ------------------
 1226|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1227|      0|                break;
 1228|      0|            }
 1229|     88|            att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|     88|#define CKA_VALUE 0x00000011UL
  ------------------
 1230|     88|            if (att == NULL) {
  ------------------
  |  Branch (1230:17): [True: 0, False: 88]
  ------------------
 1231|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1232|      0|                break;
 1233|      0|            }
 1234|     88|            context->cipherInfo = Camellia_CreateContext(
 1235|     88|                (unsigned char *)att->attrib.pValue,
 1236|     88|                (unsigned char *)pMechanism->pParameter,
 1237|     88|                pMechanism->mechanism ==
  ------------------
  |  Branch (1237:17): [True: 0, False: 88]
  ------------------
 1238|     88|                        CKM_CAMELLIA_ECB
  ------------------
  |  | 1136|     88|#define CKM_CAMELLIA_ECB 0x00000551UL
  ------------------
 1239|     88|                    ? NSS_CAMELLIA
  ------------------
  |  |   42|      0|#define NSS_CAMELLIA 0
  ------------------
 1240|     88|                    : NSS_CAMELLIA_CBC,
  ------------------
  |  |   43|     88|#define NSS_CAMELLIA_CBC 1
  ------------------
 1241|     88|                isEncrypt, att->attrib.ulValueLen);
 1242|     88|            sftk_FreeAttribute(att);
 1243|     88|            if (context->cipherInfo == NULL) {
  ------------------
  |  Branch (1243:17): [True: 0, False: 88]
  ------------------
 1244|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1245|      0|                break;
 1246|      0|            }
 1247|     88|            context->update = isEncrypt ? SFTKCipher_Camellia_Encrypt : SFTKCipher_Camellia_Decrypt;
  ------------------
  |  Branch (1247:31): [True: 44, False: 44]
  ------------------
 1248|     88|            context->destroy = SFTKCipher_Camellia_DestroyContext;
 1249|     88|            break;
 1250|       |
 1251|      0|        case CKM_AES_CBC_PAD:
  ------------------
  |  | 1111|      0|#define CKM_AES_CBC_PAD 0x00001085UL
  ------------------
  |  Branch (1251:9): [True: 0, False: 3.57k]
  ------------------
 1252|      0|            context->doPad = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1253|       |        /* fall thru */
 1254|      0|        case CKM_AES_ECB:
  ------------------
  |  | 1107|      0|#define CKM_AES_ECB 0x00001081UL
  ------------------
  |  Branch (1254:9): [True: 0, False: 3.57k]
  ------------------
 1255|    526|        case CKM_AES_CBC:
  ------------------
  |  | 1108|    526|#define CKM_AES_CBC 0x00001082UL
  ------------------
  |  Branch (1255:9): [True: 526, False: 3.04k]
  ------------------
 1256|    526|            context->blockSize = 16;
 1257|    526|        case CKM_AES_CTS:
  ------------------
  |  | 1117|    526|#define CKM_AES_CTS 0x00001089UL
  ------------------
  |  Branch (1257:9): [True: 0, False: 3.57k]
  ------------------
 1258|    526|        case CKM_AES_CTR:
  ------------------
  |  | 1113|    526|#define CKM_AES_CTR 0x00001086UL
  ------------------
  |  Branch (1258:9): [True: 0, False: 3.57k]
  ------------------
 1259|    526|        case CKM_AES_GCM:
  ------------------
  |  | 1115|    526|#define CKM_AES_GCM 0x00001087UL
  ------------------
  |  Branch (1259:9): [True: 0, False: 3.57k]
  ------------------
 1260|    526|            aes_param = pMechanism->pParameter;
 1261|       |            /*
 1262|       |             *  Due to a mismatch between the documentation and the header
 1263|       |             *  file, two different definitions for CK_GCM_PARAMS exist.
 1264|       |             *  The header file is normative according to Oasis, but NSS used
 1265|       |             *  the documentation. In PKCS #11 v3.0, this was reconciled in
 1266|       |             *  favor of the header file definition. To maintain binary
 1267|       |             *  compatibility, NSS now defines CK_GCM_PARAMS_V3 as the official
 1268|       |             *  version v3 (V2.4 header file) and CK_NSS_GCM_PARAMS as the
 1269|       |             *  legacy (V2.4 documentation, NSS version). CK_GCM_PARAMS
 1270|       |             *  is defined as CK_GCM_PARAMS_V3 if NSS_PKCS11_2_0_COMPAT is not
 1271|       |             *  defined and CK_NSS_GCM_PARAMS if it is. Internally
 1272|       |             *  softoken continues to use the legacy version. The code below
 1273|       |             *  automatically detects which parameter was passed in and
 1274|       |             *  converts CK_GCM_PARAMS_V3 to the CK_NSS_GCM_PARAMS (legacy
 1275|       |             *  version) on the fly. NSS proper will eventually start
 1276|       |             *  using the CK_GCM_PARAMS_V3 version and fall back to the
 1277|       |             *  CK_NSS_GCM_PARAMS if the CK_GCM_PARAMS_V3 version fails with
 1278|       |             *  CKR_MECHANISM_PARAM_INVALID.
 1279|       |             */
 1280|    526|            if (pMechanism->mechanism == CKM_AES_GCM) {
  ------------------
  |  | 1115|    526|#define CKM_AES_GCM 0x00001087UL
  ------------------
  |  Branch (1280:17): [True: 0, False: 526]
  ------------------
 1281|      0|                if (!aes_param) {
  ------------------
  |  Branch (1281:21): [True: 0, False: 0]
  ------------------
 1282|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1283|      0|                    break;
 1284|      0|                }
 1285|      0|                if (pMechanism->ulParameterLen == sizeof(CK_GCM_PARAMS_V3)) {
  ------------------
  |  Branch (1285:21): [True: 0, False: 0]
  ------------------
 1286|       |                    /* convert the true V3 parameters into the old NSS parameters */
 1287|      0|                    CK_GCM_PARAMS_V3 *gcm_params = (CK_GCM_PARAMS_V3 *)aes_param;
 1288|      0|                    if (gcm_params->ulIvLen * 8 != gcm_params->ulIvBits) {
  ------------------
  |  Branch (1288:25): [True: 0, False: 0]
  ------------------
 1289|       |                        /* only support byte aligned IV lengths */
 1290|      0|                        crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1291|      0|                        break;
 1292|      0|                    }
 1293|      0|                    aes_param = (void *)&nss_gcm_param;
 1294|      0|                    nss_gcm_param.pIv = gcm_params->pIv;
 1295|      0|                    nss_gcm_param.ulIvLen = gcm_params->ulIvLen;
 1296|      0|                    nss_gcm_param.pAAD = gcm_params->pAAD;
 1297|      0|                    nss_gcm_param.ulAADLen = gcm_params->ulAADLen;
 1298|      0|                    nss_gcm_param.ulTagBits = gcm_params->ulTagBits;
 1299|      0|                } else if (pMechanism->ulParameterLen != sizeof(CK_NSS_GCM_PARAMS)) {
  ------------------
  |  Branch (1299:28): [True: 0, False: 0]
  ------------------
 1300|       |                    /* neither old nor new style params, must be invalid */
 1301|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1302|      0|                    break;
 1303|      0|                }
 1304|    526|            } else if ((pMechanism->mechanism == CKM_AES_CTR && BAD_PARAM_CAST(pMechanism, sizeof(CK_AES_CTR_PARAMS))) ||
  ------------------
  |  | 1113|  1.05k|#define CKM_AES_CTR 0x00001086UL
  ------------------
                          } else if ((pMechanism->mechanism == CKM_AES_CTR && BAD_PARAM_CAST(pMechanism, sizeof(CK_AES_CTR_PARAMS))) ||
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1304:25): [True: 0, False: 526]
  ------------------
 1305|    526|                       ((pMechanism->mechanism == CKM_AES_CBC || pMechanism->mechanism == CKM_AES_CTS) && BAD_PARAM_CAST(pMechanism, AES_BLOCK_SIZE))) {
  ------------------
  |  | 1108|  1.05k|#define CKM_AES_CBC 0x00001082UL
  ------------------
                                     ((pMechanism->mechanism == CKM_AES_CBC || pMechanism->mechanism == CKM_AES_CTS) && BAD_PARAM_CAST(pMechanism, AES_BLOCK_SIZE))) {
  ------------------
  |  | 1117|      0|#define CKM_AES_CTS 0x00001089UL
  ------------------
                                     ((pMechanism->mechanism == CKM_AES_CBC || pMechanism->mechanism == CKM_AES_CTS) && BAD_PARAM_CAST(pMechanism, AES_BLOCK_SIZE))) {
  ------------------
  |  |   50|    526|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 526]
  |  |  |  Branch (50:64): [True: 0, False: 526]
  |  |  ------------------
  ------------------
  |  Branch (1305:26): [True: 526, False: 0]
  |  Branch (1305:66): [True: 0, False: 0]
  ------------------
 1306|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1307|      0|                break;
 1308|      0|            }
 1309|       |
 1310|    526|            if (pMechanism->mechanism == CKM_AES_GCM) {
  ------------------
  |  | 1115|    526|#define CKM_AES_GCM 0x00001087UL
  ------------------
  |  Branch (1310:17): [True: 0, False: 526]
  ------------------
 1311|      0|                context->multi = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1312|      0|            }
 1313|    526|            if (key_type != CKK_AES) {
  ------------------
  |  |  402|    526|#define CKK_AES 0x0000001FUL
  ------------------
  |  Branch (1313:17): [True: 0, False: 526]
  ------------------
 1314|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1315|      0|                break;
 1316|      0|            }
 1317|    526|            att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|    526|#define CKA_VALUE 0x00000011UL
  ------------------
 1318|    526|            if (att == NULL) {
  ------------------
  |  Branch (1318:17): [True: 0, False: 526]
  ------------------
 1319|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1320|      0|                break;
 1321|      0|            }
 1322|    526|            context->cipherInfo = AES_CreateContext(
 1323|    526|                (unsigned char *)att->attrib.pValue,
 1324|    526|                (unsigned char *)aes_param,
 1325|    526|                sftk_aes_mode(pMechanism->mechanism),
 1326|    526|                isEncrypt, att->attrib.ulValueLen, 16);
 1327|    526|            sftk_FreeAttribute(att);
 1328|    526|            if (context->cipherInfo == NULL) {
  ------------------
  |  Branch (1328:17): [True: 0, False: 526]
  ------------------
 1329|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1330|      0|                break;
 1331|      0|            }
 1332|    526|            context->update = isEncrypt ? SFTKCipher_AES_Encrypt : SFTKCipher_AES_Decrypt;
  ------------------
  |  Branch (1332:31): [True: 263, False: 263]
  ------------------
 1333|    526|            context->destroy = SFTKCipher_AES_DestroyContext;
 1334|    526|            break;
 1335|       |
 1336|      0|        case CKM_NSS_CHACHA20_POLY1305:
  ------------------
  |  |  243|      0|#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 28)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1336:9): [True: 0, False: 3.57k]
  ------------------
 1337|      0|        case CKM_CHACHA20_POLY1305:
  ------------------
  |  | 1287|      0|#define CKM_CHACHA20_POLY1305 0x00004021UL
  ------------------
  |  Branch (1337:9): [True: 0, False: 3.57k]
  ------------------
 1338|      0|            if (pMechanism->mechanism == CKM_NSS_CHACHA20_POLY1305) {
  ------------------
  |  |  243|      0|#define CKM_NSS_CHACHA20_POLY1305 (CKM_NSS + 28)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1338:17): [True: 0, False: 0]
  ------------------
 1339|      0|                if (key_type != CKK_NSS_CHACHA20) {
  ------------------
  |  |   56|      0|#define CKK_NSS_CHACHA20 (CKK_NSS + 4)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1339:21): [True: 0, False: 0]
  ------------------
 1340|      0|                    crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1341|      0|                    break;
 1342|      0|                }
 1343|      0|                if ((pMechanism->pParameter == NULL) ||
  ------------------
  |  Branch (1343:21): [True: 0, False: 0]
  ------------------
 1344|      0|                    (pMechanism->ulParameterLen != sizeof(CK_NSS_AEAD_PARAMS))) {
  ------------------
  |  Branch (1344:21): [True: 0, False: 0]
  ------------------
 1345|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1346|      0|                    break;
 1347|      0|                }
 1348|      0|                nss_aead_params_ptr = (CK_NSS_AEAD_PARAMS *)pMechanism->pParameter;
 1349|      0|            } else {
 1350|      0|                CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR chacha_poly_params;
 1351|      0|                if (key_type != CKK_CHACHA20) {
  ------------------
  |  |  433|      0|#define CKK_CHACHA20 0x00000033UL
  ------------------
  |  Branch (1351:21): [True: 0, False: 0]
  ------------------
 1352|      0|                    crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1353|      0|                    break;
 1354|      0|                }
 1355|      0|                if ((pMechanism->pParameter == NULL) ||
  ------------------
  |  Branch (1355:21): [True: 0, False: 0]
  ------------------
 1356|      0|                    (pMechanism->ulParameterLen !=
  ------------------
  |  Branch (1356:21): [True: 0, False: 0]
  ------------------
 1357|      0|                     sizeof(CK_SALSA20_CHACHA20_POLY1305_PARAMS))) {
 1358|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1359|      0|                    break;
 1360|      0|                }
 1361|      0|                chacha_poly_params = (CK_SALSA20_CHACHA20_POLY1305_PARAMS_PTR)
 1362|      0|                                         pMechanism->pParameter;
 1363|      0|                nss_aead_params_ptr = &nss_aead_params;
 1364|      0|                nss_aead_params.pNonce = chacha_poly_params->pNonce;
 1365|      0|                nss_aead_params.ulNonceLen = chacha_poly_params->ulNonceLen;
 1366|      0|                nss_aead_params.pAAD = chacha_poly_params->pAAD;
 1367|      0|                nss_aead_params.ulAADLen = chacha_poly_params->ulAADLen;
 1368|      0|                nss_aead_params.ulTagLen = 16; /* Poly1305 is always 16 */
 1369|      0|            }
 1370|       |
 1371|      0|            context->multi = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1372|      0|            att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 1373|      0|            if (att == NULL) {
  ------------------
  |  Branch (1373:17): [True: 0, False: 0]
  ------------------
 1374|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1375|      0|                break;
 1376|      0|            }
 1377|      0|            context->cipherInfo = sftk_ChaCha20Poly1305_CreateContext(
 1378|      0|                (unsigned char *)att->attrib.pValue, att->attrib.ulValueLen,
 1379|      0|                nss_aead_params_ptr);
 1380|      0|            sftk_FreeAttribute(att);
 1381|      0|            if (context->cipherInfo == NULL) {
  ------------------
  |  Branch (1381:17): [True: 0, False: 0]
  ------------------
 1382|      0|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 1383|      0|                break;
 1384|      0|            }
 1385|      0|            context->update = isEncrypt ? sftk_ChaCha20Poly1305_Encrypt : sftk_ChaCha20Poly1305_Decrypt;
  ------------------
  |  Branch (1385:31): [True: 0, False: 0]
  ------------------
 1386|      0|            context->destroy = sftk_ChaCha20Poly1305_DestroyContext;
 1387|      0|            break;
 1388|       |
 1389|      0|        case CKM_NSS_CHACHA20_CTR: /* old NSS private version */
  ------------------
  |  |  251|      0|#define CKM_NSS_CHACHA20_CTR (CKM_NSS + 33)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1389:9): [True: 0, False: 3.57k]
  ------------------
 1390|      0|        case CKM_CHACHA20:         /* PKCS #11 v3 version */
  ------------------
  |  | 1204|      0|#define CKM_CHACHA20 0x00001226UL
  ------------------
  |  Branch (1390:9): [True: 0, False: 3.57k]
  ------------------
 1391|      0|        {
 1392|      0|            unsigned char *counter;
 1393|      0|            unsigned char *nonce;
 1394|      0|            unsigned long counter_len;
 1395|      0|            unsigned long nonce_len;
 1396|      0|            context->multi = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1397|      0|            if (pMechanism->mechanism == CKM_NSS_CHACHA20_CTR) {
  ------------------
  |  |  251|      0|#define CKM_NSS_CHACHA20_CTR (CKM_NSS + 33)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1397:17): [True: 0, False: 0]
  ------------------
 1398|      0|                if (key_type != CKK_NSS_CHACHA20) {
  ------------------
  |  |   56|      0|#define CKK_NSS_CHACHA20 (CKK_NSS + 4)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1398:21): [True: 0, False: 0]
  ------------------
 1399|      0|                    crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1400|      0|                    break;
 1401|      0|                }
 1402|      0|                if (pMechanism->pParameter == NULL || pMechanism->ulParameterLen != 16) {
  ------------------
  |  Branch (1402:21): [True: 0, False: 0]
  |  Branch (1402:55): [True: 0, False: 0]
  ------------------
 1403|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1404|      0|                    break;
 1405|      0|                }
 1406|      0|                counter_len = 4;
 1407|      0|                counter = pMechanism->pParameter;
 1408|      0|                nonce = counter + 4;
 1409|      0|                nonce_len = 12;
 1410|      0|            } else {
 1411|      0|                CK_CHACHA20_PARAMS_PTR chacha20_param_ptr;
 1412|      0|                if (key_type != CKK_CHACHA20) {
  ------------------
  |  |  433|      0|#define CKK_CHACHA20 0x00000033UL
  ------------------
  |  Branch (1412:21): [True: 0, False: 0]
  ------------------
 1413|      0|                    crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1414|      0|                    break;
 1415|      0|                }
 1416|      0|                if (pMechanism->pParameter == NULL || pMechanism->ulParameterLen != sizeof(CK_CHACHA20_PARAMS)) {
  ------------------
  |  Branch (1416:21): [True: 0, False: 0]
  |  Branch (1416:55): [True: 0, False: 0]
  ------------------
 1417|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1418|      0|                    break;
 1419|      0|                }
 1420|      0|                chacha20_param_ptr = (CK_CHACHA20_PARAMS_PTR)pMechanism->pParameter;
 1421|      0|                if ((chacha20_param_ptr->blockCounterBits != 32) &&
  ------------------
  |  Branch (1421:21): [True: 0, False: 0]
  ------------------
 1422|      0|                    (chacha20_param_ptr->blockCounterBits != 64)) {
  ------------------
  |  Branch (1422:21): [True: 0, False: 0]
  ------------------
 1423|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1424|      0|                    break;
 1425|      0|                }
 1426|      0|                counter_len = chacha20_param_ptr->blockCounterBits / PR_BITS_PER_BYTE;
  ------------------
  |  |  286|      0|#define PR_BITS_PER_BYTE    8
  ------------------
 1427|      0|                counter = chacha20_param_ptr->pBlockCounter;
 1428|      0|                nonce = chacha20_param_ptr->pNonce;
 1429|      0|                nonce_len = chacha20_param_ptr->ulNonceBits / PR_BITS_PER_BYTE;
  ------------------
  |  |  286|      0|#define PR_BITS_PER_BYTE    8
  ------------------
 1430|      0|            }
 1431|       |
 1432|      0|            att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 1433|      0|            if (att == NULL) {
  ------------------
  |  Branch (1433:17): [True: 0, False: 0]
  ------------------
 1434|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1435|      0|                break;
 1436|      0|            }
 1437|      0|            SFTKChaCha20CtrInfo *ctx = PORT_ZNew(SFTKChaCha20CtrInfo);
  ------------------
  |  |  148|      0|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 1438|      0|            if (!ctx) {
  ------------------
  |  Branch (1438:17): [True: 0, False: 0]
  ------------------
 1439|      0|                sftk_FreeAttribute(att);
 1440|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1441|      0|                break;
 1442|      0|            }
 1443|      0|            if (att->attrib.ulValueLen != sizeof(ctx->key)) {
  ------------------
  |  Branch (1443:17): [True: 0, False: 0]
  ------------------
 1444|      0|                sftk_FreeAttribute(att);
 1445|      0|                PORT_Free(ctx);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1446|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1447|      0|                break;
 1448|      0|            }
 1449|      0|            memcpy(ctx->key, att->attrib.pValue, att->attrib.ulValueLen);
 1450|      0|            sftk_FreeAttribute(att);
 1451|       |
 1452|       |            /* make sure we don't overflow our parameters */
 1453|      0|            if ((sizeof(ctx->counter) < counter_len) ||
  ------------------
  |  Branch (1453:17): [True: 0, False: 0]
  ------------------
 1454|      0|                (sizeof(ctx->nonce) < nonce_len)) {
  ------------------
  |  Branch (1454:17): [True: 0, False: 0]
  ------------------
 1455|      0|                PORT_Free(ctx);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1456|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 1457|      0|                break;
 1458|      0|            }
 1459|       |
 1460|       |            /* The counter is little endian. */
 1461|      0|            int i = 0;
 1462|      0|            for (; i < counter_len; ++i) {
  ------------------
  |  Branch (1462:20): [True: 0, False: 0]
  ------------------
 1463|      0|                ctx->counter |= (PRUint32)counter[i] << (i * 8);
 1464|      0|            }
 1465|      0|            memcpy(ctx->nonce, nonce, nonce_len);
 1466|      0|            context->cipherInfo = ctx;
 1467|      0|            context->update = sftk_ChaCha20Ctr;
 1468|      0|            context->destroy = sftk_ChaCha20Ctr_DestroyContext;
 1469|      0|            break;
 1470|      0|        }
 1471|       |
 1472|      0|        case CKM_NSS_AES_KEY_WRAP_PAD:
  ------------------
  |  |  165|      0|#define CKM_NSS_AES_KEY_WRAP_PAD (CKM_NSS + 2)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1472:9): [True: 0, False: 3.57k]
  ------------------
 1473|      0|        case CKM_AES_KEY_WRAP_PAD:
  ------------------
  |  | 1232|      0|#define CKM_AES_KEY_WRAP_PAD 0x0000210AUL
  ------------------
  |  Branch (1473:9): [True: 0, False: 3.57k]
  ------------------
 1474|      0|            context->doPad = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1475|       |        /* fall thru */
 1476|      0|        case CKM_NSS_AES_KEY_WRAP:
  ------------------
  |  |  164|      0|#define CKM_NSS_AES_KEY_WRAP (CKM_NSS + 1)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1476:9): [True: 0, False: 3.57k]
  ------------------
 1477|      0|        case CKM_AES_KEY_WRAP:
  ------------------
  |  | 1231|      0|#define CKM_AES_KEY_WRAP 0x00002109UL
  ------------------
  |  Branch (1477:9): [True: 0, False: 3.57k]
  ------------------
 1478|      0|            context->blockSize = 8;
 1479|      0|        case CKM_AES_KEY_WRAP_KWP:
  ------------------
  |  | 1233|      0|#define CKM_AES_KEY_WRAP_KWP 0x0000210BUL
  ------------------
  |  Branch (1479:9): [True: 0, False: 3.57k]
  ------------------
 1480|      0|            context->multi = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1481|      0|            if (key_type != CKK_AES) {
  ------------------
  |  |  402|      0|#define CKK_AES 0x0000001FUL
  ------------------
  |  Branch (1481:17): [True: 0, False: 0]
  ------------------
 1482|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 1483|      0|                break;
 1484|      0|            }
 1485|      0|            att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 1486|      0|            if (att == NULL) {
  ------------------
  |  Branch (1486:17): [True: 0, False: 0]
  ------------------
 1487|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 1488|      0|                break;
 1489|      0|            }
 1490|      0|            context->cipherInfo = AESKeyWrap_CreateContext(
 1491|      0|                (unsigned char *)att->attrib.pValue,
 1492|      0|                (unsigned char *)pMechanism->pParameter,
 1493|      0|                isEncrypt, att->attrib.ulValueLen);
 1494|      0|            sftk_FreeAttribute(att);
 1495|      0|            if (context->cipherInfo == NULL) {
  ------------------
  |  Branch (1495:17): [True: 0, False: 0]
  ------------------
 1496|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1497|      0|                break;
 1498|      0|            }
 1499|      0|            if (pMechanism->mechanism == CKM_AES_KEY_WRAP_KWP) {
  ------------------
  |  | 1233|      0|#define CKM_AES_KEY_WRAP_KWP 0x0000210BUL
  ------------------
  |  Branch (1499:17): [True: 0, False: 0]
  ------------------
 1500|      0|                context->update = isEncrypt ? SFTKCipher_AESKeyWrap_EncryptKWP
  ------------------
  |  Branch (1500:35): [True: 0, False: 0]
  ------------------
 1501|      0|                                            : SFTKCipher_AESKeyWrap_DecryptKWP;
 1502|      0|            } else {
 1503|      0|                context->update = isEncrypt ? SFTKCipher_AESKeyWrap_Encrypt
  ------------------
  |  Branch (1503:35): [True: 0, False: 0]
  ------------------
 1504|      0|                                            : SFTKCipher_AESKeyWrap_Decrypt;
 1505|      0|            }
 1506|      0|            context->destroy = SFTKCipher_AESKeyWrap_DestroyContext;
 1507|      0|            break;
 1508|       |
 1509|      0|        default:
  ------------------
  |  Branch (1509:9): [True: 0, False: 3.57k]
  ------------------
 1510|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 1511|      0|            break;
 1512|  3.57k|    }
 1513|       |
 1514|  3.57k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  3.57k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1514:9): [True: 0, False: 3.57k]
  ------------------
 1515|      0|        sftk_FreeContext(context);
 1516|      0|        sftk_FreeSession(session);
 1517|      0|        return crv;
 1518|      0|    }
 1519|  3.57k|    sftk_SetContextByType(session, contextType, context);
 1520|  3.57k|    sftk_FreeSession(session);
 1521|  3.57k|    return CKR_OK;
  ------------------
  |  | 1388|  3.57k|#define CKR_OK 0x00000000UL
  ------------------
 1522|  3.57k|}
NSC_EncryptInit:
 1528|  1.20k|{
 1529|  1.20k|    CHECK_FORK();
 1530|  1.20k|    return sftk_CryptInit(hSession, pMechanism, hKey, CKA_ENCRYPT, CKA_ENCRYPT,
  ------------------
  |  |  547|  1.20k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
                  return sftk_CryptInit(hSession, pMechanism, hKey, CKA_ENCRYPT, CKA_ENCRYPT,
  ------------------
  |  |  547|  1.20k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 1531|  1.20k|                          SFTK_ENCRYPT, PR_TRUE);
  ------------------
  |  |  437|  1.20k|#define PR_TRUE 1
  ------------------
 1532|  1.20k|}
NSC_Encrypt:
 1673|  1.17k|{
 1674|  1.17k|    SFTKSession *session;
 1675|  1.17k|    SFTKSessionContext *context;
 1676|  1.17k|    unsigned int outlen;
 1677|  1.17k|    unsigned int maxoutlen = *pulEncryptedDataLen;
 1678|  1.17k|    CK_RV crv;
 1679|  1.17k|    CK_RV crv2;
 1680|  1.17k|    SECStatus rv = SECSuccess;
 1681|  1.17k|    SECItem pText;
 1682|       |
 1683|  1.17k|    pText.type = siBuffer;
 1684|  1.17k|    pText.data = pData;
 1685|  1.17k|    pText.len = ulDataLen;
 1686|       |
 1687|  1.17k|    CHECK_FORK();
 1688|       |
 1689|       |    /* make sure we're legal */
 1690|  1.17k|    crv = sftk_GetContext(hSession, &context, SFTK_ENCRYPT, PR_FALSE, &session);
  ------------------
  |  |  438|  1.17k|#define PR_FALSE 0
  ------------------
 1691|  1.17k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.17k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1691:9): [True: 0, False: 1.17k]
  ------------------
 1692|      0|        return crv;
 1693|       |
 1694|  1.17k|    if (!pEncryptedData) {
  ------------------
  |  Branch (1694:9): [True: 0, False: 1.17k]
  ------------------
 1695|      0|        outlen = context->rsa ? context->maxLen : ulDataLen + 2 * context->blockSize;
  ------------------
  |  Branch (1695:18): [True: 0, False: 0]
  ------------------
 1696|      0|        goto done;
 1697|      0|    }
 1698|       |
 1699|  1.17k|    if (context->doPad) {
  ------------------
  |  Branch (1699:9): [True: 0, False: 1.17k]
  ------------------
 1700|      0|        if (context->multi) {
  ------------------
  |  Branch (1700:13): [True: 0, False: 0]
  ------------------
 1701|      0|            CK_ULONG updateLen = maxoutlen;
 1702|      0|            CK_ULONG finalLen;
 1703|       |            /* padding is fairly complicated, have the update and final
 1704|       |             * code deal with it */
 1705|      0|            sftk_FreeSession(session);
 1706|      0|            crv = NSC_EncryptUpdate(hSession, pData, ulDataLen, pEncryptedData,
 1707|      0|                                    &updateLen);
 1708|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1708:17): [True: 0, False: 0]
  ------------------
 1709|      0|                updateLen = 0;
 1710|      0|            }
 1711|      0|            maxoutlen -= updateLen;
 1712|      0|            pEncryptedData += updateLen;
 1713|      0|            finalLen = maxoutlen;
 1714|      0|            crv2 = NSC_EncryptFinal(hSession, pEncryptedData, &finalLen);
 1715|      0|            if (crv == CKR_OK && crv2 == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
                          if (crv == CKR_OK && crv2 == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1715:17): [True: 0, False: 0]
  |  Branch (1715:34): [True: 0, False: 0]
  ------------------
 1716|      0|                *pulEncryptedDataLen = updateLen + finalLen;
 1717|      0|            }
 1718|      0|            return crv == CKR_OK ? crv2 : crv;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1718:20): [True: 0, False: 0]
  ------------------
 1719|      0|        }
 1720|       |        /* doPad without multi means that padding must be done on the first
 1721|       |        ** and only update.  There will be no final.
 1722|       |        */
 1723|      0|        PORT_Assert(context->blockSize > 1);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1724|      0|        if (context->blockSize > 1) {
  ------------------
  |  Branch (1724:13): [True: 0, False: 0]
  ------------------
 1725|      0|            CK_ULONG remainder = ulDataLen % context->blockSize;
 1726|      0|            CK_ULONG padding = context->blockSize - remainder;
 1727|      0|            pText.len += padding;
 1728|      0|            pText.data = PORT_ZAlloc(pText.len);
  ------------------
  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
 1729|      0|            if (pText.data) {
  ------------------
  |  Branch (1729:17): [True: 0, False: 0]
  ------------------
 1730|      0|                memcpy(pText.data, pData, ulDataLen);
 1731|      0|                memset(pText.data + ulDataLen, padding, padding);
 1732|      0|            } else {
 1733|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1734|      0|                goto fail;
 1735|      0|            }
 1736|      0|        }
 1737|      0|    }
 1738|       |
 1739|       |    /* do it: NOTE: this assumes buf size is big enough. */
 1740|  1.17k|    rv = (*context->update)(context->cipherInfo, pEncryptedData,
 1741|  1.17k|                            &outlen, maxoutlen, pText.data, pText.len);
 1742|  1.17k|    crv = (rv == SECSuccess) ? CKR_OK : sftk_MapCryptError(PORT_GetError());
  ------------------
  |  | 1388|  1.17k|#define CKR_OK 0x00000000UL
  ------------------
                  crv = (rv == SECSuccess) ? CKR_OK : sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (1742:11): [True: 1.17k, False: 0]
  ------------------
 1743|  1.17k|    if (pText.data != pData)
  ------------------
  |  Branch (1743:9): [True: 0, False: 1.17k]
  ------------------
 1744|      0|        PORT_ZFree(pText.data, pText.len);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 1745|  1.17k|fail:
 1746|  1.17k|    sftk_TerminateOp(session, SFTK_ENCRYPT, context);
 1747|  1.17k|done:
 1748|  1.17k|    sftk_FreeSession(session);
 1749|  1.17k|    if (crv == CKR_OK) {
  ------------------
  |  | 1388|  1.17k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1749:9): [True: 1.17k, False: 0]
  ------------------
 1750|  1.17k|        *pulEncryptedDataLen = (CK_ULONG)outlen;
 1751|  1.17k|    }
 1752|  1.17k|    return crv;
 1753|  1.17k|}
NSC_DecryptInit:
 1763|  1.20k|{
 1764|  1.20k|    CHECK_FORK();
 1765|  1.20k|    return sftk_CryptInit(hSession, pMechanism, hKey, CKA_DECRYPT, CKA_DECRYPT,
  ------------------
  |  |  548|  1.20k|#define CKA_DECRYPT 0x00000105UL
  ------------------
                  return sftk_CryptInit(hSession, pMechanism, hKey, CKA_DECRYPT, CKA_DECRYPT,
  ------------------
  |  |  548|  1.20k|#define CKA_DECRYPT 0x00000105UL
  ------------------
 1766|  1.20k|                          SFTK_DECRYPT, PR_FALSE);
  ------------------
  |  |  438|  1.20k|#define PR_FALSE 0
  ------------------
 1767|  1.20k|}
NSC_DigestInit:
 1977|  35.6k|{
 1978|  35.6k|    SFTKSession *session;
 1979|  35.6k|    SFTKSessionContext *context;
 1980|  35.6k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  35.6k|#define CKR_OK 0x00000000UL
  ------------------
 1981|       |
 1982|  35.6k|    CHECK_FORK();
 1983|       |
 1984|  35.6k|    session = sftk_SessionFromHandle(hSession);
 1985|  35.6k|    if (session == NULL)
  ------------------
  |  Branch (1985:9): [True: 0, False: 35.6k]
  ------------------
 1986|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 1987|  35.6k|    crv = sftk_InitGeneric(session, pMechanism, &context, SFTK_HASH,
 1988|  35.6k|                           NULL, 0, NULL, 0, CKA_DIGEST);
  ------------------
  |  |   68|  35.6k|#define CKA_DIGEST 0x81000000L
  ------------------
 1989|  35.6k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  35.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1989:9): [True: 0, False: 35.6k]
  ------------------
 1990|      0|        sftk_FreeSession(session);
 1991|      0|        return crv;
 1992|      0|    }
 1993|       |
 1994|  35.6k|#define INIT_MECH(mmm)                                         \
 1995|  35.6k|    case CKM_##mmm: {                                          \
 1996|  35.6k|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
 1997|  35.6k|        context->cipherInfo = (void *)mmm##_ctx;               \
 1998|  35.6k|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
 1999|  35.6k|        context->currentMech = CKM_##mmm;                      \
 2000|  35.6k|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
 2001|  35.6k|        context->end = SFTKHash_##mmm##_End;                   \
 2002|  35.6k|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
 2003|  35.6k|        context->maxLen = mmm##_LENGTH;                        \
 2004|  35.6k|        if (mmm##_ctx)                                         \
 2005|  35.6k|            mmm##_Begin(mmm##_ctx);                            \
 2006|  35.6k|        else                                                   \
 2007|  35.6k|            crv = CKR_HOST_MEMORY;                             \
 2008|  35.6k|        break;                                                 \
 2009|  35.6k|    }
 2010|       |
 2011|  35.6k|    switch (pMechanism->mechanism) {
 2012|      0|        INIT_MECH(MD2)
  ------------------
  |  | 1995|      0|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 0, False: 35.6k]
  |  |  ------------------
  |  | 1996|      0|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|      0|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|      0|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|      0|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|      0|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|      0|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|      0|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|      0|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|      0|        if (mmm##_ctx)                                         \
  |  | 2005|      0|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|      0|        else                                                   \
  |  | 2007|      0|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|      0|        break;                                                 \
  |  | 2009|      0|    }
  ------------------
 2013|    673|        INIT_MECH(MD5)
  ------------------
  |  | 1995|    673|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 673, False: 34.9k]
  |  |  ------------------
  |  | 1996|    673|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|    673|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|    673|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|    673|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|    673|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|    673|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|    673|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|    673|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|    673|        if (mmm##_ctx)                                         \
  |  | 2005|    673|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|    673|        else                                                   \
  |  | 2007|    673|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|    673|        break;                                                 \
  |  | 2009|    673|    }
  ------------------
 2014|  15.3k|        INIT_MECH(SHA1)
  ------------------
  |  | 1995|  15.3k|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 15.3k, False: 20.3k]
  |  |  ------------------
  |  | 1996|  15.3k|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|  15.3k|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|  15.3k|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|  15.3k|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|  15.3k|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|  15.3k|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|  15.3k|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|  15.3k|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|  15.3k|        if (mmm##_ctx)                                         \
  |  | 2005|  15.3k|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|  15.3k|        else                                                   \
  |  | 2007|  15.3k|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|  15.3k|        break;                                                 \
  |  | 2009|  15.3k|    }
  ------------------
 2015|      0|        INIT_MECH(SHA224)
  ------------------
  |  | 1995|      0|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 0, False: 35.6k]
  |  |  ------------------
  |  | 1996|      0|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|      0|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|      0|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|      0|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|      0|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|      0|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|      0|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|      0|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|      0|        if (mmm##_ctx)                                         \
  |  | 2005|      0|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|      0|        else                                                   \
  |  | 2007|      0|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|      0|        break;                                                 \
  |  | 2009|      0|    }
  ------------------
 2016|  11.9k|        INIT_MECH(SHA256)
  ------------------
  |  | 1995|  11.9k|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 11.9k, False: 23.6k]
  |  |  ------------------
  |  | 1996|  11.9k|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|  11.9k|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|  11.9k|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|  11.9k|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|  11.9k|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|  11.9k|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|  11.9k|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|  11.9k|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|  11.9k|        if (mmm##_ctx)                                         \
  |  | 2005|  11.9k|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|  11.9k|        else                                                   \
  |  | 2007|  11.9k|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|  11.9k|        break;                                                 \
  |  | 2009|  11.9k|    }
  ------------------
 2017|  7.17k|        INIT_MECH(SHA384)
  ------------------
  |  | 1995|  7.17k|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 7.17k, False: 28.4k]
  |  |  ------------------
  |  | 1996|  7.17k|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|  7.17k|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|  7.17k|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|  7.17k|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|  7.17k|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|  7.17k|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|  7.17k|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|  7.17k|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|  7.17k|        if (mmm##_ctx)                                         \
  |  | 2005|  7.17k|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|  7.17k|        else                                                   \
  |  | 2007|  7.17k|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|  7.17k|        break;                                                 \
  |  | 2009|  7.17k|    }
  ------------------
 2018|    504|        INIT_MECH(SHA512)
  ------------------
  |  | 1995|    504|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 504, False: 35.1k]
  |  |  ------------------
  |  | 1996|    504|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|    504|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|    504|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|    504|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|    504|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|    504|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|    504|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|    504|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|    504|        if (mmm##_ctx)                                         \
  |  | 2005|    504|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|    504|        else                                                   \
  |  | 2007|    504|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|    504|        break;                                                 \
  |  | 2009|    504|    }
  ------------------
 2019|      0|        INIT_MECH(SHA3_224)
  ------------------
  |  | 1995|      0|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 0, False: 35.6k]
  |  |  ------------------
  |  | 1996|      0|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|      0|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|      0|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|      0|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|      0|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|      0|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|      0|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|      0|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|      0|        if (mmm##_ctx)                                         \
  |  | 2005|      0|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|      0|        else                                                   \
  |  | 2007|      0|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|      0|        break;                                                 \
  |  | 2009|      0|    }
  ------------------
 2020|      0|        INIT_MECH(SHA3_256)
  ------------------
  |  | 1995|      0|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 0, False: 35.6k]
  |  |  ------------------
  |  | 1996|      0|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|      0|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|      0|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|      0|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|      0|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|      0|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|      0|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|      0|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|      0|        if (mmm##_ctx)                                         \
  |  | 2005|      0|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|      0|        else                                                   \
  |  | 2007|      0|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|      0|        break;                                                 \
  |  | 2009|      0|    }
  ------------------
 2021|      0|        INIT_MECH(SHA3_384)
  ------------------
  |  | 1995|      0|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 0, False: 35.6k]
  |  |  ------------------
  |  | 1996|      0|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|      0|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|      0|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|      0|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|      0|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|      0|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|      0|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|      0|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|      0|        if (mmm##_ctx)                                         \
  |  | 2005|      0|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|      0|        else                                                   \
  |  | 2007|      0|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|      0|        break;                                                 \
  |  | 2009|      0|    }
  ------------------
 2022|      0|        INIT_MECH(SHA3_512)
  ------------------
  |  | 1995|      0|    case CKM_##mmm: {                                          \
  |  |  ------------------
  |  |  |  Branch (1995:5): [True: 0, False: 35.6k]
  |  |  ------------------
  |  | 1996|      0|        mmm##Context *mmm##_ctx = mmm##_NewContext();          \
  |  | 1997|      0|        context->cipherInfo = (void *)mmm##_ctx;               \
  |  | 1998|      0|        context->cipherInfoLen = mmm##_FlattenSize(mmm##_ctx); \
  |  | 1999|      0|        context->currentMech = CKM_##mmm;                      \
  |  | 2000|      0|        context->hashUpdate = SFTKHash_##mmm##_Update;         \
  |  | 2001|      0|        context->end = SFTKHash_##mmm##_End;                   \
  |  | 2002|      0|        context->destroy = SFTKHash_##mmm##_DestroyContext;    \
  |  | 2003|      0|        context->maxLen = mmm##_LENGTH;                        \
  |  | 2004|      0|        if (mmm##_ctx)                                         \
  |  | 2005|      0|            mmm##_Begin(mmm##_ctx);                            \
  |  | 2006|      0|        else                                                   \
  |  | 2007|      0|            crv = CKR_HOST_MEMORY;                             \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2008|      0|        break;                                                 \
  |  | 2009|      0|    }
  ------------------
 2023|       |
 2024|      0|        default:
  ------------------
  |  Branch (2024:9): [True: 0, False: 35.6k]
  ------------------
 2025|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 2026|      0|            break;
 2027|  35.6k|    }
 2028|       |
 2029|  35.6k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  35.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2029:9): [True: 0, False: 35.6k]
  ------------------
 2030|      0|        sftk_FreeContext(context);
 2031|      0|        sftk_FreeSession(session);
 2032|      0|        return crv;
 2033|      0|    }
 2034|  35.6k|    sftk_SetContextByType(session, SFTK_HASH, context);
 2035|  35.6k|    sftk_FreeSession(session);
 2036|  35.6k|    return CKR_OK;
  ------------------
  |  | 1388|  35.6k|#define CKR_OK 0x00000000UL
  ------------------
 2037|  35.6k|}
NSC_DigestUpdate:
 2088|  42.8k|{
 2089|  42.8k|    SFTKSessionContext *context;
 2090|  42.8k|    CK_RV crv;
 2091|       |
 2092|  42.8k|    CHECK_FORK();
 2093|       |
 2094|       |    /* make sure we're legal */
 2095|  42.8k|    crv = sftk_GetContext(hSession, &context, SFTK_HASH, PR_TRUE, NULL);
  ------------------
  |  |  437|  42.8k|#define PR_TRUE 1
  ------------------
 2096|  42.8k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  42.8k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2096:9): [True: 0, False: 42.8k]
  ------------------
 2097|      0|        return crv;
 2098|       |
 2099|  42.8k|#if (ULONG_MAX > UINT_MAX)
 2100|       |    /* The context->hashUpdate function takes an unsigned int for its data
 2101|       |     * length argument, but NSC_DigestUpdate takes an unsigned long. */
 2102|  42.8k|    while (ulPartLen > UINT_MAX) {
  ------------------
  |  Branch (2102:12): [True: 0, False: 42.8k]
  ------------------
 2103|      0|        (*context->hashUpdate)(context->cipherInfo, pPart, UINT_MAX);
 2104|      0|        pPart += UINT_MAX;
 2105|      0|        ulPartLen -= UINT_MAX;
 2106|      0|    }
 2107|  42.8k|#endif
 2108|  42.8k|    (*context->hashUpdate)(context->cipherInfo, pPart, ulPartLen);
 2109|       |
 2110|  42.8k|    return CKR_OK;
  ------------------
  |  | 1388|  42.8k|#define CKR_OK 0x00000000UL
  ------------------
 2111|  42.8k|}
NSC_DigestFinal:
 2117|  32.6k|{
 2118|  32.6k|    SFTKSession *session;
 2119|  32.6k|    SFTKSessionContext *context;
 2120|  32.6k|    unsigned int maxout = *pulDigestLen;
 2121|  32.6k|    unsigned int digestLen;
 2122|  32.6k|    CK_RV crv;
 2123|       |
 2124|  32.6k|    CHECK_FORK();
 2125|       |
 2126|       |    /* make sure we're legal */
 2127|  32.6k|    crv = sftk_GetContext(hSession, &context, SFTK_HASH, PR_TRUE, &session);
  ------------------
  |  |  437|  32.6k|#define PR_TRUE 1
  ------------------
 2128|  32.6k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  32.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2128:9): [True: 370, False: 32.2k]
  ------------------
 2129|    370|        return crv;
 2130|       |
 2131|  32.2k|    if (pDigest != NULL) {
  ------------------
  |  Branch (2131:9): [True: 32.2k, False: 0]
  ------------------
 2132|  32.2k|        (*context->end)(context->cipherInfo, pDigest, &digestLen, maxout);
 2133|  32.2k|        *pulDigestLen = digestLen;
 2134|  32.2k|        sftk_TerminateOp(session, SFTK_HASH, context);
 2135|  32.2k|    } else {
 2136|      0|        *pulDigestLen = context->maxLen;
 2137|      0|    }
 2138|       |
 2139|  32.2k|    sftk_FreeSession(session);
 2140|  32.2k|    return CKR_OK;
  ------------------
  |  | 1388|  32.2k|#define CKR_OK 0x00000000UL
  ------------------
 2141|  32.6k|}
NSC_SignInit:
 2877|  9.51k|{
 2878|  9.51k|    SFTKSession *session;
 2879|  9.51k|    SFTKObject *key;
 2880|  9.51k|    SFTKSessionContext *context;
 2881|  9.51k|    CK_KEY_TYPE key_type;
 2882|  9.51k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  9.51k|#define CKR_OK 0x00000000UL
  ------------------
 2883|  9.51k|    NSSLOWKEYPrivateKey *privKey;
 2884|  9.51k|    SFTKHashSignInfo *info = NULL;
 2885|  9.51k|    SFTKPSSSignInfo *pinfo = NULL;
 2886|       |
 2887|  9.51k|    CHECK_FORK();
 2888|       |
 2889|       |    /* Block Cipher MACing Algorithms use a different Context init method..*/
 2890|  9.51k|    crv = sftk_InitCBCMac(hSession, pMechanism, hKey, CKA_SIGN, SFTK_SIGN);
  ------------------
  |  |  551|  9.51k|#define CKA_SIGN 0x00000108UL
  ------------------
 2891|  9.51k|    if (crv != CKR_FUNCTION_NOT_SUPPORTED)
  ------------------
  |  | 1426|  9.51k|#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL
  ------------------
  |  Branch (2891:9): [True: 0, False: 9.51k]
  ------------------
 2892|      0|        return crv;
 2893|       |
 2894|       |    /* we're not using a block cipher mac */
 2895|  9.51k|    session = sftk_SessionFromHandle(hSession);
 2896|  9.51k|    if (session == NULL)
  ------------------
  |  Branch (2896:9): [True: 0, False: 9.51k]
  ------------------
 2897|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 2898|  9.51k|    crv = sftk_InitGeneric(session, pMechanism, &context, SFTK_SIGN, &key,
 2899|  9.51k|                           hKey, &key_type, CKO_PRIVATE_KEY, CKA_SIGN);
  ------------------
  |  |  328|  9.51k|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
                                         hKey, &key_type, CKO_PRIVATE_KEY, CKA_SIGN);
  ------------------
  |  |  551|  9.51k|#define CKA_SIGN 0x00000108UL
  ------------------
 2900|  9.51k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.51k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2900:9): [True: 0, False: 9.51k]
  ------------------
 2901|      0|        sftk_FreeSession(session);
 2902|      0|        return crv;
 2903|      0|    }
 2904|       |
 2905|  9.51k|    context->multi = PR_FALSE;
  ------------------
  |  |  438|  9.51k|#define PR_FALSE 0
  ------------------
 2906|       |
 2907|  9.51k|#define INIT_RSA_SIGN_MECH(mmm)             \
 2908|  9.51k|    case CKM_##mmm##_RSA_PKCS:              \
 2909|  9.51k|        context->multi = PR_TRUE;           \
 2910|  9.51k|        crv = sftk_doSub##mmm(context);     \
 2911|  9.51k|        if (crv != CKR_OK)                  \
 2912|  9.51k|            break;                          \
 2913|  9.51k|        context->update = sftk_RSAHashSign; \
 2914|  9.51k|        info = PORT_New(SFTKHashSignInfo);  \
 2915|  9.51k|        if (info == NULL) {                 \
 2916|  9.51k|            crv = CKR_HOST_MEMORY;          \
 2917|  9.51k|            break;                          \
 2918|  9.51k|        }                                   \
 2919|  9.51k|        info->hashOid = SEC_OID_##mmm;      \
 2920|  9.51k|        goto finish_rsa;
 2921|       |
 2922|  9.51k|    switch (pMechanism->mechanism) {
 2923|      0|        INIT_RSA_SIGN_MECH(MD5)
  ------------------
  |  | 2908|      0|    case CKM_##mmm##_RSA_PKCS:              \
  |  |  ------------------
  |  |  |  Branch (2908:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2909|      0|        context->multi = PR_TRUE;           \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2910|      0|        crv = sftk_doSub##mmm(context);     \
  |  | 2911|      0|        if (crv != CKR_OK)                  \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2911:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2912|      0|            break;                          \
  |  | 2913|      0|        context->update = sftk_RSAHashSign; \
  |  | 2914|      0|        info = PORT_New(SFTKHashSignInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2915|      0|        if (info == NULL) {                 \
  |  |  ------------------
  |  |  |  Branch (2915:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2916|      0|            crv = CKR_HOST_MEMORY;          \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2917|      0|            break;                          \
  |  | 2918|      0|        }                                   \
  |  | 2919|      0|        info->hashOid = SEC_OID_##mmm;      \
  |  | 2920|      0|        goto finish_rsa;
  ------------------
 2924|      0|        INIT_RSA_SIGN_MECH(MD2)
  ------------------
  |  | 2908|      0|    case CKM_##mmm##_RSA_PKCS:              \
  |  |  ------------------
  |  |  |  Branch (2908:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2909|      0|        context->multi = PR_TRUE;           \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2910|      0|        crv = sftk_doSub##mmm(context);     \
  |  | 2911|      0|        if (crv != CKR_OK)                  \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2911:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2912|      0|            break;                          \
  |  | 2913|      0|        context->update = sftk_RSAHashSign; \
  |  | 2914|      0|        info = PORT_New(SFTKHashSignInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2915|      0|        if (info == NULL) {                 \
  |  |  ------------------
  |  |  |  Branch (2915:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2916|      0|            crv = CKR_HOST_MEMORY;          \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2917|      0|            break;                          \
  |  | 2918|      0|        }                                   \
  |  | 2919|      0|        info->hashOid = SEC_OID_##mmm;      \
  |  | 2920|      0|        goto finish_rsa;
  ------------------
 2925|      0|        INIT_RSA_SIGN_MECH(SHA1)
  ------------------
  |  | 2908|      0|    case CKM_##mmm##_RSA_PKCS:              \
  |  |  ------------------
  |  |  |  Branch (2908:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2909|      0|        context->multi = PR_TRUE;           \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2910|      0|        crv = sftk_doSub##mmm(context);     \
  |  | 2911|      0|        if (crv != CKR_OK)                  \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2911:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2912|      0|            break;                          \
  |  | 2913|      0|        context->update = sftk_RSAHashSign; \
  |  | 2914|      0|        info = PORT_New(SFTKHashSignInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2915|      0|        if (info == NULL) {                 \
  |  |  ------------------
  |  |  |  Branch (2915:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2916|      0|            crv = CKR_HOST_MEMORY;          \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2917|      0|            break;                          \
  |  | 2918|      0|        }                                   \
  |  | 2919|      0|        info->hashOid = SEC_OID_##mmm;      \
  |  | 2920|      0|        goto finish_rsa;
  ------------------
 2926|      0|        INIT_RSA_SIGN_MECH(SHA224)
  ------------------
  |  | 2908|      0|    case CKM_##mmm##_RSA_PKCS:              \
  |  |  ------------------
  |  |  |  Branch (2908:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2909|      0|        context->multi = PR_TRUE;           \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2910|      0|        crv = sftk_doSub##mmm(context);     \
  |  | 2911|      0|        if (crv != CKR_OK)                  \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2911:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2912|      0|            break;                          \
  |  | 2913|      0|        context->update = sftk_RSAHashSign; \
  |  | 2914|      0|        info = PORT_New(SFTKHashSignInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2915|      0|        if (info == NULL) {                 \
  |  |  ------------------
  |  |  |  Branch (2915:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2916|      0|            crv = CKR_HOST_MEMORY;          \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2917|      0|            break;                          \
  |  | 2918|      0|        }                                   \
  |  | 2919|      0|        info->hashOid = SEC_OID_##mmm;      \
  |  | 2920|      0|        goto finish_rsa;
  ------------------
 2927|      0|        INIT_RSA_SIGN_MECH(SHA256)
  ------------------
  |  | 2908|      0|    case CKM_##mmm##_RSA_PKCS:              \
  |  |  ------------------
  |  |  |  Branch (2908:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2909|      0|        context->multi = PR_TRUE;           \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2910|      0|        crv = sftk_doSub##mmm(context);     \
  |  | 2911|      0|        if (crv != CKR_OK)                  \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2911:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2912|      0|            break;                          \
  |  | 2913|      0|        context->update = sftk_RSAHashSign; \
  |  | 2914|      0|        info = PORT_New(SFTKHashSignInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2915|      0|        if (info == NULL) {                 \
  |  |  ------------------
  |  |  |  Branch (2915:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2916|      0|            crv = CKR_HOST_MEMORY;          \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2917|      0|            break;                          \
  |  | 2918|      0|        }                                   \
  |  | 2919|      0|        info->hashOid = SEC_OID_##mmm;      \
  |  | 2920|      0|        goto finish_rsa;
  ------------------
 2928|      0|        INIT_RSA_SIGN_MECH(SHA384)
  ------------------
  |  | 2908|      0|    case CKM_##mmm##_RSA_PKCS:              \
  |  |  ------------------
  |  |  |  Branch (2908:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2909|      0|        context->multi = PR_TRUE;           \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2910|      0|        crv = sftk_doSub##mmm(context);     \
  |  | 2911|      0|        if (crv != CKR_OK)                  \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2911:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2912|      0|            break;                          \
  |  | 2913|      0|        context->update = sftk_RSAHashSign; \
  |  | 2914|      0|        info = PORT_New(SFTKHashSignInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2915|      0|        if (info == NULL) {                 \
  |  |  ------------------
  |  |  |  Branch (2915:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2916|      0|            crv = CKR_HOST_MEMORY;          \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2917|      0|            break;                          \
  |  | 2918|      0|        }                                   \
  |  | 2919|      0|        info->hashOid = SEC_OID_##mmm;      \
  |  | 2920|      0|        goto finish_rsa;
  ------------------
 2929|      0|        INIT_RSA_SIGN_MECH(SHA512)
  ------------------
  |  | 2908|      0|    case CKM_##mmm##_RSA_PKCS:              \
  |  |  ------------------
  |  |  |  Branch (2908:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2909|      0|        context->multi = PR_TRUE;           \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2910|      0|        crv = sftk_doSub##mmm(context);     \
  |  | 2911|      0|        if (crv != CKR_OK)                  \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2911:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2912|      0|            break;                          \
  |  | 2913|      0|        context->update = sftk_RSAHashSign; \
  |  | 2914|      0|        info = PORT_New(SFTKHashSignInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2915|      0|        if (info == NULL) {                 \
  |  |  ------------------
  |  |  |  Branch (2915:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2916|      0|            crv = CKR_HOST_MEMORY;          \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 2917|      0|            break;                          \
  |  | 2918|      0|        }                                   \
  |  | 2919|      0|        info->hashOid = SEC_OID_##mmm;      \
  |  | 2920|      0|        goto finish_rsa;
  ------------------
 2930|       |
 2931|      0|        case CKM_RSA_PKCS:
  ------------------
  |  |  720|      0|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (2931:9): [True: 0, False: 9.51k]
  ------------------
 2932|      0|            context->update = sftk_RSASign;
 2933|      0|            goto finish_rsa;
 2934|      0|        case CKM_RSA_X_509:
  ------------------
  |  |  722|      0|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (2934:9): [True: 0, False: 9.51k]
  ------------------
 2935|      0|            context->update = sftk_RSASignRaw;
 2936|      0|        finish_rsa:
 2937|      0|            if (key_type != CKK_RSA) {
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (2937:17): [True: 0, False: 0]
  ------------------
 2938|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 2939|      0|                break;
 2940|      0|            }
 2941|      0|            context->rsa = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2942|      0|            privKey = sftk_GetPrivKey(key, CKK_RSA, &crv);
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
 2943|      0|            if (privKey == NULL) {
  ------------------
  |  Branch (2943:17): [True: 0, False: 0]
  ------------------
 2944|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 2945|      0|                break;
 2946|      0|            }
 2947|       |            /* OK, info is allocated only if we're doing hash and sign mechanism.
 2948|       |             * It's necessary to be able to set the correct OID in the final
 2949|       |             * signature.
 2950|       |             */
 2951|      0|            if (info) {
  ------------------
  |  Branch (2951:17): [True: 0, False: 0]
  ------------------
 2952|      0|                info->key = privKey;
 2953|      0|                context->cipherInfo = info;
 2954|      0|                context->destroy = sftk_Space;
 2955|      0|            } else {
 2956|      0|                context->cipherInfo = privKey;
 2957|      0|                context->destroy = sftk_Null;
 2958|      0|            }
 2959|      0|            context->maxLen = nsslowkey_PrivateModulusLen(privKey);
 2960|      0|            break;
 2961|       |
 2962|      0|#define INIT_RSA_PSS_SIG_MECH(mmm)                                                            \
 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
 2964|      0|        context->multi = PR_TRUE;                                                             \
 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
 2966|      0|        if (crv != CKR_OK)                                                                    \
 2967|      0|            break;                                                                            \
 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
 2970|      0|            break;                                                                            \
 2971|      0|        }                                                                                     \
 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
 2974|      0|            break;                                                                            \
 2975|      0|        }                                                                                     \
 2976|      0|        goto finish_rsa_pss;
 2977|      0|            INIT_RSA_PSS_SIG_MECH(SHA1)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 2978|      0|            INIT_RSA_PSS_SIG_MECH(SHA224)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 2979|      0|            INIT_RSA_PSS_SIG_MECH(SHA256)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 2980|      0|            INIT_RSA_PSS_SIG_MECH(SHA384)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 2981|      0|            INIT_RSA_PSS_SIG_MECH(SHA512)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 2982|      0|        case CKM_RSA_PKCS_PSS:
  ------------------
  |  |  741|      0|#define CKM_RSA_PKCS_PSS 0x0000000DUL
  ------------------
  |  Branch (2982:9): [True: 0, False: 9.51k]
  ------------------
 2983|      0|        finish_rsa_pss:
 2984|      0|            if (key_type != CKK_RSA) {
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (2984:17): [True: 0, False: 0]
  ------------------
 2985|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 2986|      0|                break;
 2987|      0|            }
 2988|      0|            context->rsa = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2989|      0|            if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS) ||
  ------------------
  |  Branch (2989:17): [True: 0, False: 0]
  ------------------
 2990|      0|                !sftk_ValidatePssParams((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)) {
  ------------------
  |  Branch (2990:17): [True: 0, False: 0]
  ------------------
 2991|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 2992|      0|                break;
 2993|      0|            }
 2994|      0|            pinfo = PORT_New(SFTKPSSSignInfo);
  ------------------
  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
 2995|      0|            if (pinfo == NULL) {
  ------------------
  |  Branch (2995:17): [True: 0, False: 0]
  ------------------
 2996|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2997|      0|                break;
 2998|      0|            }
 2999|      0|            pinfo->size = sizeof(SFTKPSSSignInfo);
 3000|      0|            pinfo->params = *(CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter;
 3001|      0|            pinfo->key = sftk_GetPrivKey(key, CKK_RSA, &crv);
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
 3002|      0|            if (pinfo->key == NULL) {
  ------------------
  |  Branch (3002:17): [True: 0, False: 0]
  ------------------
 3003|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3004|      0|                break;
 3005|      0|            }
 3006|      0|            context->cipherInfo = pinfo;
 3007|      0|            context->destroy = sftk_ZSpace;
 3008|      0|            context->update = sftk_RSASignPSS;
 3009|      0|            context->maxLen = nsslowkey_PrivateModulusLen(pinfo->key);
 3010|      0|            break;
 3011|       |
 3012|      0|#define INIT_DSA_SIG_MECH(mmm)          \
 3013|      0|    case CKM_DSA_##mmm:                 \
 3014|      0|        context->multi = PR_TRUE;       \
 3015|      0|        crv = sftk_doSub##mmm(context); \
 3016|      0|        if (crv != CKR_OK)              \
 3017|      0|            break;                      \
 3018|      0|        goto finish_dsa;
 3019|      0|            INIT_DSA_SIG_MECH(SHA1)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3020|      0|            INIT_DSA_SIG_MECH(SHA224)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3021|      0|            INIT_DSA_SIG_MECH(SHA256)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3022|      0|            INIT_DSA_SIG_MECH(SHA384)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3023|      0|            INIT_DSA_SIG_MECH(SHA512)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3024|      0|        case CKM_DSA:
  ------------------
  |  |  745|      0|#define CKM_DSA 0x00000011UL
  ------------------
  |  Branch (3024:9): [True: 0, False: 9.51k]
  ------------------
 3025|      0|        finish_dsa:
 3026|      0|            if (key_type != CKK_DSA) {
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (3026:17): [True: 0, False: 0]
  ------------------
 3027|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3028|      0|                break;
 3029|      0|            }
 3030|      0|            privKey = sftk_GetPrivKey(key, CKK_DSA, &crv);
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
 3031|      0|            if (privKey == NULL) {
  ------------------
  |  Branch (3031:17): [True: 0, False: 0]
  ------------------
 3032|      0|                break;
 3033|      0|            }
 3034|      0|            context->cipherInfo = privKey;
 3035|      0|            context->update = nsc_DSA_Sign_Stub;
 3036|      0|            context->destroy = (privKey == key->objectInfo) ? sftk_Null : sftk_FreePrivKey;
  ------------------
  |  Branch (3036:32): [True: 0, False: 0]
  ------------------
 3037|      0|            context->maxLen = DSA_MAX_SIGNATURE_LEN;
  ------------------
  |  |   52|      0|#define DSA_MAX_SIGNATURE_LEN (DSA_MAX_SUBPRIME_LEN * 2) /* Bytes */
  |  |  ------------------
  |  |  |  |   51|      0|#define DSA_MAX_SUBPRIME_LEN 32                          /* Bytes */
  |  |  ------------------
  ------------------
 3038|       |
 3039|      0|            break;
 3040|       |
 3041|      0|#define INIT_ECDSA_SIG_MECH(mmm)        \
 3042|      0|    case CKM_ECDSA_##mmm:               \
 3043|      0|        context->multi = PR_TRUE;       \
 3044|      0|        crv = sftk_doSub##mmm(context); \
 3045|      0|        if (crv != CKR_OK)              \
 3046|      0|            break;                      \
 3047|      0|        goto finish_ecdsa;
 3048|      0|            INIT_ECDSA_SIG_MECH(SHA1)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3049|      0|            INIT_ECDSA_SIG_MECH(SHA224)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3050|      0|            INIT_ECDSA_SIG_MECH(SHA256)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3051|      0|            INIT_ECDSA_SIG_MECH(SHA384)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3052|      0|            INIT_ECDSA_SIG_MECH(SHA512)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3053|      0|        case CKM_ECDSA:
  ------------------
  |  | 1074|      0|#define CKM_ECDSA 0x00001041UL
  ------------------
  |  Branch (3053:9): [True: 0, False: 9.51k]
  ------------------
 3054|      0|        finish_ecdsa:
 3055|      0|            if (key_type != CKK_EC) {
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (3055:17): [True: 0, False: 0]
  ------------------
 3056|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3057|      0|                break;
 3058|      0|            }
 3059|      0|            privKey = sftk_GetPrivKey(key, CKK_EC, &crv);
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
 3060|      0|            if (privKey == NULL) {
  ------------------
  |  Branch (3060:17): [True: 0, False: 0]
  ------------------
 3061|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 3062|      0|                break;
 3063|      0|            }
 3064|      0|            context->cipherInfo = privKey;
 3065|      0|            context->update = nsc_ECDSASignStub;
 3066|      0|            context->destroy = (privKey == key->objectInfo) ? sftk_Null : sftk_FreePrivKey;
  ------------------
  |  Branch (3066:32): [True: 0, False: 0]
  ------------------
 3067|      0|            context->maxLen = MAX_ECKEY_LEN * 2;
  ------------------
  |  |   81|      0|#define MAX_ECKEY_LEN 72 /* Bytes */
  ------------------
 3068|       |
 3069|      0|            break;
 3070|       |
 3071|      0|        case CKM_EDDSA:
  ------------------
  |  | 1174|      0|#define CKM_EDDSA 0x00001057UL
  ------------------
  |  Branch (3071:9): [True: 0, False: 9.51k]
  ------------------
 3072|      0|            if (key_type != CKK_EC_EDWARDS) {
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (3072:17): [True: 0, False: 0]
  ------------------
 3073|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3074|      0|                break;
 3075|      0|            }
 3076|       |
 3077|      0|            if (pMechanism->pParameter) {
  ------------------
  |  Branch (3077:17): [True: 0, False: 0]
  ------------------
 3078|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3079|      0|                break;
 3080|      0|            }
 3081|       |
 3082|      0|            privKey = sftk_GetPrivKey(key, CKK_EC_EDWARDS, &crv);
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
 3083|      0|            if (privKey == NULL) {
  ------------------
  |  Branch (3083:17): [True: 0, False: 0]
  ------------------
 3084|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 3085|      0|                break;
 3086|      0|            }
 3087|      0|            context->cipherInfo = privKey;
 3088|      0|            context->update = nsc_EDDSASignStub;
 3089|      0|            context->destroy = (privKey == key->objectInfo) ? sftk_Null : sftk_FreePrivKey;
  ------------------
  |  Branch (3089:32): [True: 0, False: 0]
  ------------------
 3090|      0|            context->maxLen = MAX_ECKEY_LEN * 2;
  ------------------
  |  |   81|      0|#define MAX_ECKEY_LEN 72 /* Bytes */
  ------------------
 3091|       |
 3092|      0|            break;
 3093|       |
 3094|      0|#define INIT_HMAC_MECH(mmm)                                        \
 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
 3097|      0|        if (!pMechanism->pParameter) {                             \
 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
 3099|      0|            break;                                                 \
 3100|      0|        }                                                          \
 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
 3103|      0|        break;                                                     \
 3104|      0|    case CKM_##mmm##_HMAC:                                         \
 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
 3106|      0|                             mmm##_LENGTH);                        \
 3107|      0|        break;
 3108|       |
 3109|      0|            INIT_HMAC_MECH(MD2)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3110|      0|            INIT_HMAC_MECH(MD5)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|    196|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 196, False: 9.31k]
  |  |  ------------------
  |  | 3105|    196|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|    196|                             mmm##_LENGTH);                        \
  |  | 3107|    196|        break;
  ------------------
 3111|      0|            INIT_HMAC_MECH(SHA1)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|  2.59k|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 2.59k, False: 6.91k]
  |  |  ------------------
  |  | 3105|  2.59k|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|  2.59k|                             mmm##_LENGTH);                        \
  |  | 3107|  2.59k|        break;
  ------------------
 3112|      0|            INIT_HMAC_MECH(SHA224)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3113|      0|            INIT_HMAC_MECH(SHA256)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|  1.73k|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 1.73k, False: 7.77k]
  |  |  ------------------
  |  | 3105|  1.73k|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|  1.73k|                             mmm##_LENGTH);                        \
  |  | 3107|  1.73k|        break;
  ------------------
 3114|      0|            INIT_HMAC_MECH(SHA384)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|  3.08k|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 3.08k, False: 6.42k]
  |  |  ------------------
  |  | 3105|  3.08k|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|  3.08k|                             mmm##_LENGTH);                        \
  |  | 3107|  3.08k|        break;
  ------------------
 3115|      0|            INIT_HMAC_MECH(SHA512)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3116|      0|            INIT_HMAC_MECH(SHA3_224)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3117|      0|            INIT_HMAC_MECH(SHA3_256)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3118|      0|            INIT_HMAC_MECH(SHA3_384)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3119|      0|            INIT_HMAC_MECH(SHA3_512)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 9.51k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3120|       |
 3121|      0|        case CKM_AES_CMAC_GENERAL:
  ------------------
  |  | 1120|      0|#define CKM_AES_CMAC_GENERAL 0x0000108BUL
  ------------------
  |  Branch (3121:9): [True: 0, False: 9.51k]
  ------------------
 3122|      0|            PORT_Assert(pMechanism->pParameter);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3123|      0|            if (!pMechanism->pParameter || pMechanism->ulParameterLen != sizeof(CK_MAC_GENERAL_PARAMS)) {
  ------------------
  |  Branch (3123:17): [True: 0, False: 0]
  |  Branch (3123:44): [True: 0, False: 0]
  ------------------
 3124|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3125|      0|                break;
 3126|      0|            }
 3127|      0|            crv = sftk_doMACInit(pMechanism->mechanism, context, key, *(CK_ULONG *)pMechanism->pParameter);
 3128|      0|            break;
 3129|      0|        case CKM_AES_CMAC:
  ------------------
  |  | 1119|      0|#define CKM_AES_CMAC 0x0000108AUL
  ------------------
  |  Branch (3129:9): [True: 0, False: 9.51k]
  ------------------
 3130|      0|            crv = sftk_doMACInit(pMechanism->mechanism, context, key, AES_BLOCK_SIZE);
  ------------------
  |  |  130|      0|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
 3131|      0|            break;
 3132|      0|        case CKM_SSL3_MD5_MAC:
  ------------------
  |  |  975|      0|#define CKM_SSL3_MD5_MAC 0x00000380UL
  ------------------
  |  Branch (3132:9): [True: 0, False: 9.51k]
  ------------------
 3133|      0|            PORT_Assert(pMechanism->pParameter);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3134|      0|            if (!pMechanism->pParameter) {
  ------------------
  |  Branch (3134:17): [True: 0, False: 0]
  ------------------
 3135|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3136|      0|                break;
 3137|      0|            }
 3138|      0|            crv = sftk_doSSLMACInit(context, SEC_OID_MD5, key,
 3139|      0|                                    *(CK_ULONG *)pMechanism->pParameter);
 3140|      0|            break;
 3141|      0|        case CKM_SSL3_SHA1_MAC:
  ------------------
  |  |  976|      0|#define CKM_SSL3_SHA1_MAC 0x00000381UL
  ------------------
  |  Branch (3141:9): [True: 0, False: 9.51k]
  ------------------
 3142|      0|            PORT_Assert(pMechanism->pParameter);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3143|      0|            if (!pMechanism->pParameter) {
  ------------------
  |  Branch (3143:17): [True: 0, False: 0]
  ------------------
 3144|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3145|      0|                break;
 3146|      0|            }
 3147|      0|            crv = sftk_doSSLMACInit(context, SEC_OID_SHA1, key,
 3148|      0|                                    *(CK_ULONG *)pMechanism->pParameter);
 3149|      0|            break;
 3150|      0|        case CKM_TLS_PRF_GENERAL:
  ------------------
  |  |  297|      0|#define CKM_TLS_PRF_GENERAL 0x80000373UL
  ------------------
  |  Branch (3150:9): [True: 0, False: 9.51k]
  ------------------
 3151|      0|            crv = sftk_TLSPRFInit(context, key, key_type, HASH_AlgNULL, 0);
 3152|      0|            break;
 3153|  1.89k|        case CKM_TLS_MAC: {
  ------------------
  |  | 1032|  1.89k|#define CKM_TLS_MAC 0x000003E4UL
  ------------------
  |  Branch (3153:9): [True: 1.89k, False: 7.61k]
  ------------------
 3154|  1.89k|            CK_TLS_MAC_PARAMS *tls12_mac_params;
 3155|  1.89k|            HASH_HashType tlsPrfHash;
 3156|  1.89k|            const char *label;
 3157|       |
 3158|  1.89k|            if (pMechanism->ulParameterLen != sizeof(CK_TLS_MAC_PARAMS)) {
  ------------------
  |  Branch (3158:17): [True: 0, False: 1.89k]
  ------------------
 3159|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3160|      0|                break;
 3161|      0|            }
 3162|  1.89k|            tls12_mac_params = (CK_TLS_MAC_PARAMS *)pMechanism->pParameter;
 3163|  1.89k|            if (tls12_mac_params->prfHashMechanism == CKM_TLS_PRF) {
  ------------------
  |  |  973|  1.89k|#define CKM_TLS_PRF 0x00000378UL
  ------------------
  |  Branch (3163:17): [True: 171, False: 1.72k]
  ------------------
 3164|       |                /* The TLS 1.0 and 1.1 PRF */
 3165|    171|                tlsPrfHash = HASH_AlgNULL;
 3166|    171|                if (tls12_mac_params->ulMacLength != 12) {
  ------------------
  |  Branch (3166:21): [True: 0, False: 171]
  ------------------
 3167|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3168|      0|                    break;
 3169|      0|                }
 3170|  1.72k|            } else {
 3171|       |                /* The hash function for the TLS 1.2 PRF */
 3172|  1.72k|                tlsPrfHash =
 3173|  1.72k|                    sftk_GetHashTypeFromMechanism(tls12_mac_params->prfHashMechanism);
 3174|  1.72k|                if (tlsPrfHash == HASH_AlgNULL ||
  ------------------
  |  Branch (3174:21): [True: 0, False: 1.72k]
  ------------------
 3175|  1.72k|                    tls12_mac_params->ulMacLength < 12) {
  ------------------
  |  Branch (3175:21): [True: 0, False: 1.72k]
  ------------------
 3176|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3177|      0|                    break;
 3178|      0|                }
 3179|  1.72k|            }
 3180|  1.89k|            if (tls12_mac_params->ulServerOrClient == 1) {
  ------------------
  |  Branch (3180:17): [True: 137, False: 1.76k]
  ------------------
 3181|    137|                label = "server finished";
 3182|  1.76k|            } else if (tls12_mac_params->ulServerOrClient == 2) {
  ------------------
  |  Branch (3182:24): [True: 1.76k, False: 0]
  ------------------
 3183|  1.76k|                label = "client finished";
 3184|  1.76k|            } else {
 3185|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3186|      0|                break;
 3187|      0|            }
 3188|  1.89k|            crv = sftk_TLSPRFInit(context, key, key_type, tlsPrfHash,
 3189|  1.89k|                                  tls12_mac_params->ulMacLength);
 3190|  1.89k|            if (crv == CKR_OK) {
  ------------------
  |  | 1388|  1.89k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3190:17): [True: 1.89k, False: 0]
  ------------------
 3191|  1.89k|                context->hashUpdate(context->hashInfo, (unsigned char *)label, 15);
 3192|  1.89k|            }
 3193|  1.89k|            break;
 3194|  1.89k|        }
 3195|      0|        case CKM_NSS_TLS_PRF_GENERAL_SHA256:
  ------------------
  |  |  233|      0|#define CKM_NSS_TLS_PRF_GENERAL_SHA256 (CKM_NSS + 21)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3195:9): [True: 0, False: 9.51k]
  ------------------
 3196|      0|            crv = sftk_TLSPRFInit(context, key, key_type, HASH_AlgSHA256, 0);
 3197|      0|            break;
 3198|       |
 3199|      0|        case CKM_NSS_HMAC_CONSTANT_TIME: {
  ------------------
  |  |  229|      0|#define CKM_NSS_HMAC_CONSTANT_TIME (CKM_NSS + 19)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3199:9): [True: 0, False: 9.51k]
  ------------------
 3200|      0|            sftk_MACConstantTimeCtx *ctx =
 3201|      0|                sftk_HMACConstantTime_New(pMechanism, key);
 3202|      0|            CK_ULONG *intpointer;
 3203|       |
 3204|      0|            if (ctx == NULL) {
  ------------------
  |  Branch (3204:17): [True: 0, False: 0]
  ------------------
 3205|      0|                crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 3206|      0|                break;
 3207|      0|            }
 3208|      0|            intpointer = PORT_New(CK_ULONG);
  ------------------
  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
 3209|      0|            if (intpointer == NULL) {
  ------------------
  |  Branch (3209:17): [True: 0, False: 0]
  ------------------
 3210|      0|                PORT_Free(ctx);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 3211|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 3212|      0|                break;
 3213|      0|            }
 3214|      0|            *intpointer = ctx->hash->length;
 3215|       |
 3216|      0|            context->cipherInfo = intpointer;
 3217|      0|            context->hashInfo = ctx;
 3218|      0|            context->currentMech = pMechanism->mechanism;
 3219|      0|            context->hashUpdate = sftk_HMACConstantTime_Update;
 3220|      0|            context->hashdestroy = sftk_MACConstantTime_DestroyContext;
 3221|      0|            context->end = sftk_MACConstantTime_EndHash;
 3222|      0|            context->update = sftk_SignCopy;
 3223|      0|            context->destroy = sftk_Space;
 3224|      0|            context->maxLen = 64;
 3225|      0|            context->multi = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3226|      0|            break;
 3227|      0|        }
 3228|       |
 3229|      0|        case CKM_NSS_SSL3_MAC_CONSTANT_TIME: {
  ------------------
  |  |  230|      0|#define CKM_NSS_SSL3_MAC_CONSTANT_TIME (CKM_NSS + 20)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3229:9): [True: 0, False: 9.51k]
  ------------------
 3230|      0|            sftk_MACConstantTimeCtx *ctx =
 3231|      0|                sftk_SSLv3MACConstantTime_New(pMechanism, key);
 3232|      0|            CK_ULONG *intpointer;
 3233|       |
 3234|      0|            if (ctx == NULL) {
  ------------------
  |  Branch (3234:17): [True: 0, False: 0]
  ------------------
 3235|      0|                crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 3236|      0|                break;
 3237|      0|            }
 3238|      0|            intpointer = PORT_New(CK_ULONG);
  ------------------
  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
 3239|      0|            if (intpointer == NULL) {
  ------------------
  |  Branch (3239:17): [True: 0, False: 0]
  ------------------
 3240|      0|                PORT_Free(ctx);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 3241|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 3242|      0|                break;
 3243|      0|            }
 3244|      0|            *intpointer = ctx->hash->length;
 3245|       |
 3246|      0|            context->cipherInfo = intpointer;
 3247|      0|            context->hashInfo = ctx;
 3248|      0|            context->currentMech = pMechanism->mechanism;
 3249|      0|            context->hashUpdate = sftk_SSLv3MACConstantTime_Update;
 3250|      0|            context->hashdestroy = sftk_MACConstantTime_DestroyContext;
 3251|      0|            context->end = sftk_MACConstantTime_EndHash;
 3252|      0|            context->update = sftk_SignCopy;
 3253|      0|            context->destroy = sftk_Space;
 3254|      0|            context->maxLen = 64;
 3255|      0|            context->multi = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3256|      0|            break;
 3257|      0|        }
 3258|       |
 3259|      0|        default:
  ------------------
  |  Branch (3259:9): [True: 0, False: 9.51k]
  ------------------
 3260|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 3261|      0|            break;
 3262|  9.51k|    }
 3263|       |
 3264|  9.51k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.51k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3264:9): [True: 0, False: 9.51k]
  ------------------
 3265|      0|        if (info)
  ------------------
  |  Branch (3265:13): [True: 0, False: 0]
  ------------------
 3266|      0|            PORT_Free(info);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 3267|      0|        if (pinfo)
  ------------------
  |  Branch (3267:13): [True: 0, False: 0]
  ------------------
 3268|      0|            PORT_ZFree(pinfo, pinfo->size);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 3269|      0|        sftk_FreeContext(context);
 3270|      0|        sftk_FreeSession(session);
 3271|      0|        return crv;
 3272|      0|    }
 3273|  9.51k|    sftk_SetContextByType(session, SFTK_SIGN, context);
 3274|  9.51k|    sftk_FreeSession(session);
 3275|  9.51k|    return CKR_OK;
  ------------------
  |  | 1388|  9.51k|#define CKR_OK 0x00000000UL
  ------------------
 3276|  9.51k|}
NSC_SignUpdate:
 3394|  6.36k|{
 3395|  6.36k|    CHECK_FORK();
 3396|  6.36k|    return sftk_MACUpdate(hSession, pPart, ulPartLen, SFTK_SIGN);
 3397|  6.36k|}
NSC_SignFinal:
 3460|  6.36k|{
 3461|  6.36k|    SFTKSession *session;
 3462|  6.36k|    SFTKSessionContext *context;
 3463|  6.36k|    unsigned int outlen;
 3464|  6.36k|    unsigned int maxoutlen = *pulSignatureLen;
 3465|  6.36k|    CK_RV crv;
 3466|       |
 3467|  6.36k|    CHECK_FORK();
 3468|       |
 3469|       |    /* make sure we're legal */
 3470|  6.36k|    crv = sftk_GetContext(hSession, &context, SFTK_SIGN, PR_TRUE, &session);
  ------------------
  |  |  437|  6.36k|#define PR_TRUE 1
  ------------------
 3471|  6.36k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  6.36k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3471:9): [True: 0, False: 6.36k]
  ------------------
 3472|      0|        return crv;
 3473|       |
 3474|  6.36k|    if (context->hashInfo) {
  ------------------
  |  Branch (3474:9): [True: 6.36k, False: 0]
  ------------------
 3475|  6.36k|        unsigned int digestLen;
 3476|  6.36k|        unsigned char tmpbuf[SFTK_MAX_MAC_LENGTH];
 3477|       |
 3478|  6.36k|        if (!pSignature) {
  ------------------
  |  Branch (3478:13): [True: 0, False: 6.36k]
  ------------------
 3479|      0|            outlen = context->maxLen;
 3480|      0|            goto finish;
 3481|      0|        }
 3482|  6.36k|        (*context->end)(context->hashInfo, tmpbuf, &digestLen, sizeof(tmpbuf));
 3483|  6.36k|        if (SECSuccess != (context->update)(context->cipherInfo, pSignature,
  ------------------
  |  Branch (3483:13): [True: 0, False: 6.36k]
  ------------------
 3484|  6.36k|                                            &outlen, maxoutlen, tmpbuf, digestLen))
 3485|      0|            crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 3486|       |        /* CKR_BUFFER_TOO_SMALL here isn't continuable, let operation terminate.
 3487|       |         * Keeping "too small" CK_RV intact is a standard violation, but allows
 3488|       |         * application read EXACT signature length */
 3489|  6.36k|        PORT_Memset(tmpbuf, 0, sizeof tmpbuf);
  ------------------
  |  |  182|  6.36k|#define PORT_Memset memset
  ------------------
 3490|  6.36k|    } else {
 3491|       |        /* must be block cipher MACing */
 3492|      0|        outlen = context->macSize;
 3493|       |        /* null or "too small" buf doesn't terminate operation [PKCS#11,v2.11]*/
 3494|      0|        if (!pSignature || maxoutlen < outlen) {
  ------------------
  |  Branch (3494:13): [True: 0, False: 0]
  |  Branch (3494:28): [True: 0, False: 0]
  ------------------
 3495|      0|            if (pSignature)
  ------------------
  |  Branch (3495:17): [True: 0, False: 0]
  ------------------
 3496|      0|                crv = CKR_BUFFER_TOO_SMALL;
  ------------------
  |  | 1514|      0|#define CKR_BUFFER_TOO_SMALL 0x00000150UL
  ------------------
 3497|      0|            goto finish;
 3498|      0|        }
 3499|      0|        if (CKR_OK == (crv = sftk_MACFinal(context)))
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3499:13): [True: 0, False: 0]
  ------------------
 3500|      0|            PORT_Memcpy(pSignature, context->macBuf, outlen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 3501|      0|    }
 3502|       |
 3503|  6.36k|    sftk_TerminateOp(session, SFTK_SIGN, context);
 3504|  6.36k|finish:
 3505|  6.36k|    *pulSignatureLen = outlen;
 3506|  6.36k|    sftk_FreeSession(session);
 3507|  6.36k|    return crv;
 3508|  6.36k|}
NSC_VerifyInit:
 3715|  1.95k|{
 3716|  1.95k|    SFTKSession *session;
 3717|  1.95k|    SFTKObject *key;
 3718|  1.95k|    SFTKSessionContext *context;
 3719|  1.95k|    CK_KEY_TYPE key_type;
 3720|  1.95k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  1.95k|#define CKR_OK 0x00000000UL
  ------------------
 3721|  1.95k|    NSSLOWKEYPublicKey *pubKey;
 3722|  1.95k|    SFTKHashVerifyInfo *info = NULL;
 3723|  1.95k|    SFTKPSSVerifyInfo *pinfo = NULL;
 3724|       |
 3725|  1.95k|    CHECK_FORK();
 3726|       |
 3727|       |    /* Block Cipher MACing Algorithms use a different Context init method..*/
 3728|  1.95k|    crv = sftk_InitCBCMac(hSession, pMechanism, hKey, CKA_VERIFY, SFTK_VERIFY);
  ------------------
  |  |  553|  1.95k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 3729|  1.95k|    if (crv != CKR_FUNCTION_NOT_SUPPORTED)
  ------------------
  |  | 1426|  1.95k|#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL
  ------------------
  |  Branch (3729:9): [True: 0, False: 1.95k]
  ------------------
 3730|      0|        return crv;
 3731|       |
 3732|  1.95k|    session = sftk_SessionFromHandle(hSession);
 3733|  1.95k|    if (session == NULL)
  ------------------
  |  Branch (3733:9): [True: 0, False: 1.95k]
  ------------------
 3734|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 3735|  1.95k|    crv = sftk_InitGeneric(session, pMechanism, &context, SFTK_VERIFY, &key,
 3736|  1.95k|                           hKey, &key_type, CKO_PUBLIC_KEY, CKA_VERIFY);
  ------------------
  |  |  327|  1.95k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
                                         hKey, &key_type, CKO_PUBLIC_KEY, CKA_VERIFY);
  ------------------
  |  |  553|  1.95k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 3737|  1.95k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.95k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3737:9): [True: 0, False: 1.95k]
  ------------------
 3738|      0|        sftk_FreeSession(session);
 3739|      0|        return crv;
 3740|      0|    }
 3741|       |
 3742|  1.95k|    context->multi = PR_FALSE;
  ------------------
  |  |  438|  1.95k|#define PR_FALSE 0
  ------------------
 3743|       |
 3744|  1.95k|#define INIT_RSA_VFY_MECH(mmm)                \
 3745|  1.95k|    case CKM_##mmm##_RSA_PKCS:                \
 3746|  1.95k|        context->multi = PR_TRUE;             \
 3747|  1.95k|        crv = sftk_doSub##mmm(context);       \
 3748|  1.95k|        if (crv != CKR_OK)                    \
 3749|  1.95k|            break;                            \
 3750|  1.95k|        context->verify = sftk_hashCheckSign; \
 3751|  1.95k|        info = PORT_New(SFTKHashVerifyInfo);  \
 3752|  1.95k|        if (info == NULL) {                   \
 3753|  1.95k|            crv = CKR_HOST_MEMORY;            \
 3754|  1.95k|            break;                            \
 3755|  1.95k|        }                                     \
 3756|  1.95k|        info->hashOid = SEC_OID_##mmm;        \
 3757|  1.95k|        goto finish_rsa;
 3758|       |
 3759|  1.95k|    switch (pMechanism->mechanism) {
 3760|      0|        INIT_RSA_VFY_MECH(MD5)
  ------------------
  |  | 3745|      0|    case CKM_##mmm##_RSA_PKCS:                \
  |  |  ------------------
  |  |  |  Branch (3745:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3746|      0|        context->multi = PR_TRUE;             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3747|      0|        crv = sftk_doSub##mmm(context);       \
  |  | 3748|      0|        if (crv != CKR_OK)                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3748:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3749|      0|            break;                            \
  |  | 3750|      0|        context->verify = sftk_hashCheckSign; \
  |  | 3751|      0|        info = PORT_New(SFTKHashVerifyInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3752|      0|        if (info == NULL) {                   \
  |  |  ------------------
  |  |  |  Branch (3752:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3753|      0|            crv = CKR_HOST_MEMORY;            \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 3754|      0|            break;                            \
  |  | 3755|      0|        }                                     \
  |  | 3756|      0|        info->hashOid = SEC_OID_##mmm;        \
  |  | 3757|      0|        goto finish_rsa;
  ------------------
 3761|      0|        INIT_RSA_VFY_MECH(MD2)
  ------------------
  |  | 3745|      0|    case CKM_##mmm##_RSA_PKCS:                \
  |  |  ------------------
  |  |  |  Branch (3745:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3746|      0|        context->multi = PR_TRUE;             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3747|      0|        crv = sftk_doSub##mmm(context);       \
  |  | 3748|      0|        if (crv != CKR_OK)                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3748:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3749|      0|            break;                            \
  |  | 3750|      0|        context->verify = sftk_hashCheckSign; \
  |  | 3751|      0|        info = PORT_New(SFTKHashVerifyInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3752|      0|        if (info == NULL) {                   \
  |  |  ------------------
  |  |  |  Branch (3752:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3753|      0|            crv = CKR_HOST_MEMORY;            \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 3754|      0|            break;                            \
  |  | 3755|      0|        }                                     \
  |  | 3756|      0|        info->hashOid = SEC_OID_##mmm;        \
  |  | 3757|      0|        goto finish_rsa;
  ------------------
 3762|      0|        INIT_RSA_VFY_MECH(SHA1)
  ------------------
  |  | 3745|      0|    case CKM_##mmm##_RSA_PKCS:                \
  |  |  ------------------
  |  |  |  Branch (3745:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3746|      0|        context->multi = PR_TRUE;             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3747|      0|        crv = sftk_doSub##mmm(context);       \
  |  | 3748|      0|        if (crv != CKR_OK)                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3748:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3749|      0|            break;                            \
  |  | 3750|      0|        context->verify = sftk_hashCheckSign; \
  |  | 3751|      0|        info = PORT_New(SFTKHashVerifyInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3752|      0|        if (info == NULL) {                   \
  |  |  ------------------
  |  |  |  Branch (3752:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3753|      0|            crv = CKR_HOST_MEMORY;            \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 3754|      0|            break;                            \
  |  | 3755|      0|        }                                     \
  |  | 3756|      0|        info->hashOid = SEC_OID_##mmm;        \
  |  | 3757|      0|        goto finish_rsa;
  ------------------
 3763|      0|        INIT_RSA_VFY_MECH(SHA224)
  ------------------
  |  | 3745|      0|    case CKM_##mmm##_RSA_PKCS:                \
  |  |  ------------------
  |  |  |  Branch (3745:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3746|      0|        context->multi = PR_TRUE;             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3747|      0|        crv = sftk_doSub##mmm(context);       \
  |  | 3748|      0|        if (crv != CKR_OK)                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3748:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3749|      0|            break;                            \
  |  | 3750|      0|        context->verify = sftk_hashCheckSign; \
  |  | 3751|      0|        info = PORT_New(SFTKHashVerifyInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3752|      0|        if (info == NULL) {                   \
  |  |  ------------------
  |  |  |  Branch (3752:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3753|      0|            crv = CKR_HOST_MEMORY;            \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 3754|      0|            break;                            \
  |  | 3755|      0|        }                                     \
  |  | 3756|      0|        info->hashOid = SEC_OID_##mmm;        \
  |  | 3757|      0|        goto finish_rsa;
  ------------------
 3764|      0|        INIT_RSA_VFY_MECH(SHA256)
  ------------------
  |  | 3745|      0|    case CKM_##mmm##_RSA_PKCS:                \
  |  |  ------------------
  |  |  |  Branch (3745:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3746|      0|        context->multi = PR_TRUE;             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3747|      0|        crv = sftk_doSub##mmm(context);       \
  |  | 3748|      0|        if (crv != CKR_OK)                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3748:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3749|      0|            break;                            \
  |  | 3750|      0|        context->verify = sftk_hashCheckSign; \
  |  | 3751|      0|        info = PORT_New(SFTKHashVerifyInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3752|      0|        if (info == NULL) {                   \
  |  |  ------------------
  |  |  |  Branch (3752:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3753|      0|            crv = CKR_HOST_MEMORY;            \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 3754|      0|            break;                            \
  |  | 3755|      0|        }                                     \
  |  | 3756|      0|        info->hashOid = SEC_OID_##mmm;        \
  |  | 3757|      0|        goto finish_rsa;
  ------------------
 3765|      0|        INIT_RSA_VFY_MECH(SHA384)
  ------------------
  |  | 3745|      0|    case CKM_##mmm##_RSA_PKCS:                \
  |  |  ------------------
  |  |  |  Branch (3745:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3746|      0|        context->multi = PR_TRUE;             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3747|      0|        crv = sftk_doSub##mmm(context);       \
  |  | 3748|      0|        if (crv != CKR_OK)                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3748:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3749|      0|            break;                            \
  |  | 3750|      0|        context->verify = sftk_hashCheckSign; \
  |  | 3751|      0|        info = PORT_New(SFTKHashVerifyInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3752|      0|        if (info == NULL) {                   \
  |  |  ------------------
  |  |  |  Branch (3752:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3753|      0|            crv = CKR_HOST_MEMORY;            \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 3754|      0|            break;                            \
  |  | 3755|      0|        }                                     \
  |  | 3756|      0|        info->hashOid = SEC_OID_##mmm;        \
  |  | 3757|      0|        goto finish_rsa;
  ------------------
 3766|      0|        INIT_RSA_VFY_MECH(SHA512)
  ------------------
  |  | 3745|      0|    case CKM_##mmm##_RSA_PKCS:                \
  |  |  ------------------
  |  |  |  Branch (3745:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3746|      0|        context->multi = PR_TRUE;             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3747|      0|        crv = sftk_doSub##mmm(context);       \
  |  | 3748|      0|        if (crv != CKR_OK)                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3748:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3749|      0|            break;                            \
  |  | 3750|      0|        context->verify = sftk_hashCheckSign; \
  |  | 3751|      0|        info = PORT_New(SFTKHashVerifyInfo);  \
  |  |  ------------------
  |  |  |  |  151|      0|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  |  |  ------------------
  |  |  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3752|      0|        if (info == NULL) {                   \
  |  |  ------------------
  |  |  |  Branch (3752:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3753|      0|            crv = CKR_HOST_MEMORY;            \
  |  |  ------------------
  |  |  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  |  |  ------------------
  |  | 3754|      0|            break;                            \
  |  | 3755|      0|        }                                     \
  |  | 3756|      0|        info->hashOid = SEC_OID_##mmm;        \
  |  | 3757|      0|        goto finish_rsa;
  ------------------
 3767|       |
 3768|     47|        case CKM_RSA_PKCS:
  ------------------
  |  |  720|     47|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (3768:9): [True: 47, False: 1.90k]
  ------------------
 3769|     47|            context->verify = sftk_RSACheckSign;
 3770|     47|            goto finish_rsa;
 3771|      0|        case CKM_RSA_X_509:
  ------------------
  |  |  722|      0|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (3771:9): [True: 0, False: 1.95k]
  ------------------
 3772|      0|            context->verify = sftk_RSACheckSignRaw;
 3773|     47|        finish_rsa:
 3774|     47|            if (key_type != CKK_RSA) {
  ------------------
  |  |  372|     47|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (3774:17): [True: 0, False: 47]
  ------------------
 3775|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3776|      0|                break;
 3777|      0|            }
 3778|     47|            context->rsa = PR_TRUE;
  ------------------
  |  |  437|     47|#define PR_TRUE 1
  ------------------
 3779|     47|            pubKey = sftk_GetPubKey(key, CKK_RSA, &crv);
  ------------------
  |  |  372|     47|#define CKK_RSA 0x00000000UL
  ------------------
 3780|     47|            if (pubKey == NULL) {
  ------------------
  |  Branch (3780:17): [True: 0, False: 47]
  ------------------
 3781|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3782|      0|                break;
 3783|      0|            }
 3784|     47|            if (info) {
  ------------------
  |  Branch (3784:17): [True: 0, False: 47]
  ------------------
 3785|      0|                info->key = pubKey;
 3786|      0|                context->cipherInfo = info;
 3787|      0|                context->destroy = sftk_Space;
 3788|     47|            } else {
 3789|     47|                context->cipherInfo = pubKey;
 3790|     47|                context->destroy = sftk_Null;
 3791|     47|            }
 3792|     47|            break;
 3793|       |
 3794|      0|            INIT_RSA_PSS_SIG_MECH(SHA1)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 3795|      0|            INIT_RSA_PSS_SIG_MECH(SHA224)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 3796|      0|            INIT_RSA_PSS_SIG_MECH(SHA256)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 3797|      0|            INIT_RSA_PSS_SIG_MECH(SHA384)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 3798|      0|            INIT_RSA_PSS_SIG_MECH(SHA512)
  ------------------
  |  | 2963|      0|    case CKM_##mmm##_RSA_PKCS_PSS:                                                            \
  |  |  ------------------
  |  |  |  Branch (2963:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 2964|      0|        context->multi = PR_TRUE;                                                             \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 2965|      0|        crv = sftk_doSub##mmm(context);                                                       \
  |  | 2966|      0|        if (crv != CKR_OK)                                                                    \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (2966:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2967|      0|            break;                                                                            \
  |  | 2968|      0|        if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS)) {                   \
  |  |  ------------------
  |  |  |  Branch (2968:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2969|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2970|      0|            break;                                                                            \
  |  | 2971|      0|        }                                                                                     \
  |  | 2972|      0|        if (((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)->hashAlg != CKM_##mmm) { \
  |  |  ------------------
  |  |  |  Branch (2972:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                                                \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 2974|      0|            break;                                                                            \
  |  | 2975|      0|        }                                                                                     \
  |  | 2976|      0|        goto finish_rsa_pss;
  ------------------
 3799|    913|        case CKM_RSA_PKCS_PSS:
  ------------------
  |  |  741|    913|#define CKM_RSA_PKCS_PSS 0x0000000DUL
  ------------------
  |  Branch (3799:9): [True: 913, False: 1.03k]
  ------------------
 3800|    913|        finish_rsa_pss:
 3801|    913|            if (key_type != CKK_RSA) {
  ------------------
  |  |  372|    913|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (3801:17): [True: 0, False: 913]
  ------------------
 3802|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3803|      0|                break;
 3804|      0|            }
 3805|    913|            context->rsa = PR_TRUE;
  ------------------
  |  |  437|    913|#define PR_TRUE 1
  ------------------
 3806|    913|            if (pMechanism->ulParameterLen != sizeof(CK_RSA_PKCS_PSS_PARAMS) ||
  ------------------
  |  Branch (3806:17): [True: 0, False: 913]
  ------------------
 3807|    913|                !sftk_ValidatePssParams((const CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter)) {
  ------------------
  |  Branch (3807:17): [True: 0, False: 913]
  ------------------
 3808|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3809|      0|                break;
 3810|      0|            }
 3811|    913|            pinfo = PORT_New(SFTKPSSVerifyInfo);
  ------------------
  |  |  151|    913|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|    913|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
 3812|    913|            if (pinfo == NULL) {
  ------------------
  |  Branch (3812:17): [True: 0, False: 913]
  ------------------
 3813|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 3814|      0|                break;
 3815|      0|            }
 3816|    913|            pinfo->size = sizeof(SFTKPSSVerifyInfo);
 3817|    913|            pinfo->params = *(CK_RSA_PKCS_PSS_PARAMS *)pMechanism->pParameter;
 3818|    913|            pinfo->key = sftk_GetPubKey(key, CKK_RSA, &crv);
  ------------------
  |  |  372|    913|#define CKK_RSA 0x00000000UL
  ------------------
 3819|    913|            if (pinfo->key == NULL) {
  ------------------
  |  Branch (3819:17): [True: 0, False: 913]
  ------------------
 3820|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3821|      0|                break;
 3822|      0|            }
 3823|    913|            context->cipherInfo = pinfo;
 3824|    913|            context->destroy = sftk_ZSpace;
 3825|    913|            context->verify = sftk_RSACheckSignPSS;
 3826|    913|            break;
 3827|       |
 3828|      0|            INIT_DSA_SIG_MECH(SHA1)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3829|      0|            INIT_DSA_SIG_MECH(SHA224)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3830|      0|            INIT_DSA_SIG_MECH(SHA256)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3831|      0|            INIT_DSA_SIG_MECH(SHA384)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3832|      0|            INIT_DSA_SIG_MECH(SHA512)
  ------------------
  |  | 3013|      0|    case CKM_DSA_##mmm:                 \
  |  |  ------------------
  |  |  |  Branch (3013:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3014|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3015|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3016|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3016:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3017|      0|            break;                      \
  |  | 3018|      0|        goto finish_dsa;
  ------------------
 3833|    913|        case CKM_DSA:
  ------------------
  |  |  745|    913|#define CKM_DSA 0x00000011UL
  ------------------
  |  Branch (3833:9): [True: 913, False: 1.03k]
  ------------------
 3834|    913|        finish_dsa:
 3835|    913|            if (key_type != CKK_DSA) {
  ------------------
  |  |  373|    913|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (3835:17): [True: 0, False: 913]
  ------------------
 3836|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3837|      0|                break;
 3838|      0|            }
 3839|    913|            pubKey = sftk_GetPubKey(key, CKK_DSA, &crv);
  ------------------
  |  |  373|    913|#define CKK_DSA 0x00000001UL
  ------------------
 3840|    913|            if (pubKey == NULL) {
  ------------------
  |  Branch (3840:17): [True: 0, False: 913]
  ------------------
 3841|      0|                break;
 3842|      0|            }
 3843|    913|            context->cipherInfo = pubKey;
 3844|    913|            context->verify = nsc_DSA_Verify_Stub;
 3845|    913|            context->destroy = sftk_Null;
 3846|    913|            break;
 3847|       |
 3848|      0|            INIT_ECDSA_SIG_MECH(SHA1)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3849|      0|            INIT_ECDSA_SIG_MECH(SHA224)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3850|      0|            INIT_ECDSA_SIG_MECH(SHA256)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3851|      0|            INIT_ECDSA_SIG_MECH(SHA384)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3852|      0|            INIT_ECDSA_SIG_MECH(SHA512)
  ------------------
  |  | 3042|      0|    case CKM_ECDSA_##mmm:               \
  |  |  ------------------
  |  |  |  Branch (3042:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3043|      0|        context->multi = PR_TRUE;       \
  |  |  ------------------
  |  |  |  |  437|      0|#define PR_TRUE 1
  |  |  ------------------
  |  | 3044|      0|        crv = sftk_doSub##mmm(context); \
  |  | 3045|      0|        if (crv != CKR_OK)              \
  |  |  ------------------
  |  |  |  | 1388|      0|#define CKR_OK 0x00000000UL
  |  |  ------------------
  |  |  |  Branch (3045:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3046|      0|            break;                      \
  |  | 3047|      0|        goto finish_ecdsa;
  ------------------
 3853|     79|        case CKM_ECDSA:
  ------------------
  |  | 1074|     79|#define CKM_ECDSA 0x00001041UL
  ------------------
  |  Branch (3853:9): [True: 79, False: 1.87k]
  ------------------
 3854|     79|        finish_ecdsa:
 3855|     79|            if (key_type != CKK_EC) {
  ------------------
  |  |  379|     79|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (3855:17): [True: 0, False: 79]
  ------------------
 3856|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3857|      0|                break;
 3858|      0|            }
 3859|     79|            pubKey = sftk_GetPubKey(key, CKK_EC, &crv);
  ------------------
  |  |  379|     79|#define CKK_EC 0x00000003UL
  ------------------
 3860|     79|            if (pubKey == NULL) {
  ------------------
  |  Branch (3860:17): [True: 0, False: 79]
  ------------------
 3861|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 3862|      0|                break;
 3863|      0|            }
 3864|     79|            context->cipherInfo = pubKey;
 3865|     79|            context->verify = nsc_ECDSAVerifyStub;
 3866|     79|            context->destroy = sftk_Null;
 3867|     79|            break;
 3868|       |
 3869|      0|            INIT_HMAC_MECH(MD2)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3870|      0|            INIT_HMAC_MECH(MD5)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3871|      0|            INIT_HMAC_MECH(SHA1)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3872|      0|            INIT_HMAC_MECH(SHA224)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3873|      0|            INIT_HMAC_MECH(SHA256)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3874|      0|            INIT_HMAC_MECH(SHA384)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3875|      0|            INIT_HMAC_MECH(SHA512)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3876|      0|            INIT_HMAC_MECH(SHA3_224)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3877|      0|            INIT_HMAC_MECH(SHA3_256)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3878|      0|            INIT_HMAC_MECH(SHA3_384)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3879|      0|            INIT_HMAC_MECH(SHA3_512)
  ------------------
  |  | 3095|      0|    case CKM_##mmm##_HMAC_GENERAL:                                 \
  |  |  ------------------
  |  |  |  Branch (3095:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3096|      0|        PORT_Assert(pMechanism->pParameter);                       \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 3097|      0|        if (!pMechanism->pParameter) {                             \
  |  |  ------------------
  |  |  |  Branch (3097:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 3098|      0|            crv = CKR_MECHANISM_PARAM_INVALID;                     \
  |  |  ------------------
  |  |  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  |  |  ------------------
  |  | 3099|      0|            break;                                                 \
  |  | 3100|      0|        }                                                          \
  |  | 3101|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3102|      0|                             *(CK_ULONG *)pMechanism->pParameter); \
  |  | 3103|      0|        break;                                                     \
  |  | 3104|      0|    case CKM_##mmm##_HMAC:                                         \
  |  |  ------------------
  |  |  |  Branch (3104:5): [True: 0, False: 1.95k]
  |  |  ------------------
  |  | 3105|      0|        crv = sftk_doMACInit(pMechanism->mechanism, context, key,  \
  |  | 3106|      0|                             mmm##_LENGTH);                        \
  |  | 3107|      0|        break;
  ------------------
 3880|       |
 3881|      0|        case CKM_EDDSA:
  ------------------
  |  | 1174|      0|#define CKM_EDDSA 0x00001057UL
  ------------------
  |  Branch (3881:9): [True: 0, False: 1.95k]
  ------------------
 3882|      0|            if (key_type != CKK_EC_EDWARDS) {
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (3882:17): [True: 0, False: 0]
  ------------------
 3883|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 3884|      0|                break;
 3885|      0|            }
 3886|      0|            pubKey = sftk_GetPubKey(key, CKK_EC_EDWARDS, &crv);
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
 3887|      0|            if (pubKey == NULL) {
  ------------------
  |  Branch (3887:17): [True: 0, False: 0]
  ------------------
 3888|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 3889|      0|                break;
 3890|      0|            }
 3891|       |
 3892|      0|            if (pMechanism->pParameter) {
  ------------------
  |  Branch (3892:17): [True: 0, False: 0]
  ------------------
 3893|      0|                crv = CKR_FUNCTION_NOT_SUPPORTED;
  ------------------
  |  | 1426|      0|#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL
  ------------------
 3894|      0|                break;
 3895|      0|            }
 3896|       |
 3897|      0|            context->cipherInfo = pubKey;
 3898|      0|            context->verify = nsc_EDDSAVerifyStub;
 3899|      0|            context->destroy = sftk_Null;
 3900|      0|            break;
 3901|       |
 3902|      0|        case CKM_SSL3_MD5_MAC:
  ------------------
  |  |  975|      0|#define CKM_SSL3_MD5_MAC 0x00000380UL
  ------------------
  |  Branch (3902:9): [True: 0, False: 1.95k]
  ------------------
 3903|      0|            PORT_Assert(pMechanism->pParameter);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3904|      0|            if (!pMechanism->pParameter) {
  ------------------
  |  Branch (3904:17): [True: 0, False: 0]
  ------------------
 3905|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3906|      0|                break;
 3907|      0|            }
 3908|      0|            crv = sftk_doSSLMACInit(context, SEC_OID_MD5, key,
 3909|      0|                                    *(CK_ULONG *)pMechanism->pParameter);
 3910|      0|            break;
 3911|      0|        case CKM_SSL3_SHA1_MAC:
  ------------------
  |  |  976|      0|#define CKM_SSL3_SHA1_MAC 0x00000381UL
  ------------------
  |  Branch (3911:9): [True: 0, False: 1.95k]
  ------------------
 3912|      0|            PORT_Assert(pMechanism->pParameter);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3913|      0|            if (!pMechanism->pParameter) {
  ------------------
  |  Branch (3913:17): [True: 0, False: 0]
  ------------------
 3914|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 3915|      0|                break;
 3916|      0|            }
 3917|      0|            crv = sftk_doSSLMACInit(context, SEC_OID_SHA1, key,
 3918|      0|                                    *(CK_ULONG *)pMechanism->pParameter);
 3919|      0|            break;
 3920|      0|        case CKM_TLS_PRF_GENERAL:
  ------------------
  |  |  297|      0|#define CKM_TLS_PRF_GENERAL 0x80000373UL
  ------------------
  |  Branch (3920:9): [True: 0, False: 1.95k]
  ------------------
 3921|      0|            crv = sftk_TLSPRFInit(context, key, key_type, HASH_AlgNULL, 0);
 3922|      0|            break;
 3923|      0|        case CKM_NSS_TLS_PRF_GENERAL_SHA256:
  ------------------
  |  |  233|      0|#define CKM_NSS_TLS_PRF_GENERAL_SHA256 (CKM_NSS + 21)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3923:9): [True: 0, False: 1.95k]
  ------------------
 3924|      0|            crv = sftk_TLSPRFInit(context, key, key_type, HASH_AlgSHA256, 0);
 3925|      0|            break;
 3926|       |
 3927|      0|        default:
  ------------------
  |  Branch (3927:9): [True: 0, False: 1.95k]
  ------------------
 3928|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 3929|      0|            break;
 3930|  1.95k|    }
 3931|       |
 3932|  1.95k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.95k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3932:9): [True: 0, False: 1.95k]
  ------------------
 3933|      0|        if (info)
  ------------------
  |  Branch (3933:13): [True: 0, False: 0]
  ------------------
 3934|      0|            PORT_Free(info);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 3935|      0|        if (pinfo)
  ------------------
  |  Branch (3935:13): [True: 0, False: 0]
  ------------------
 3936|      0|            PORT_ZFree(pinfo, pinfo->size);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 3937|      0|        sftk_FreeContext(context);
 3938|      0|        sftk_FreeSession(session);
 3939|      0|        return crv;
 3940|      0|    }
 3941|  1.95k|    sftk_SetContextByType(session, SFTK_VERIFY, context);
 3942|  1.95k|    sftk_FreeSession(session);
 3943|  1.95k|    return CKR_OK;
  ------------------
  |  | 1388|  1.95k|#define CKR_OK 0x00000000UL
  ------------------
 3944|  1.95k|}
NSC_Verify:
 3952|  1.95k|{
 3953|  1.95k|    SFTKSession *session;
 3954|  1.95k|    SFTKSessionContext *context;
 3955|  1.95k|    CK_RV crv;
 3956|       |
 3957|  1.95k|    CHECK_FORK();
 3958|       |
 3959|       |    /* make sure we're legal */
 3960|  1.95k|    crv = sftk_GetContext(hSession, &context, SFTK_VERIFY, PR_FALSE, &session);
  ------------------
  |  |  438|  1.95k|#define PR_FALSE 0
  ------------------
 3961|  1.95k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.95k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3961:9): [True: 0, False: 1.95k]
  ------------------
 3962|      0|        return crv;
 3963|       |
 3964|       |    /* multi part Verifying are completely implemented by VerifyUpdate and
 3965|       |     * VerifyFinal */
 3966|  1.95k|    if (context->multi) {
  ------------------
  |  Branch (3966:9): [True: 0, False: 1.95k]
  ------------------
 3967|       |        /* VerifyFinal can't follow failed VerifyUpdate */
 3968|      0|        if (CKR_OK == (crv = NSC_VerifyUpdate(hSession, pData, ulDataLen)))
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3968:13): [True: 0, False: 0]
  ------------------
 3969|      0|            crv = NSC_VerifyFinal(hSession, pSignature, ulSignatureLen);
 3970|  1.95k|    } else {
 3971|  1.95k|        if (SECSuccess != (*context->verify)(context->cipherInfo, pSignature,
  ------------------
  |  Branch (3971:13): [True: 1.95k, False: 0]
  ------------------
 3972|  1.95k|                                             ulSignatureLen, pData, ulDataLen))
 3973|  1.95k|            crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|  1.95k|#define PORT_GetError PORT_GetError_Util
  ------------------
 3974|       |
 3975|  1.95k|        sftk_TerminateOp(session, SFTK_VERIFY, context);
 3976|  1.95k|    }
 3977|  1.95k|    sftk_FreeSession(session);
 3978|  1.95k|    return crv;
 3979|  1.95k|}
NSC_VerifyRecoverInit:
 4078|    543|{
 4079|    543|    SFTKSession *session;
 4080|    543|    SFTKObject *key;
 4081|    543|    SFTKSessionContext *context;
 4082|    543|    CK_KEY_TYPE key_type;
 4083|    543|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|    543|#define CKR_OK 0x00000000UL
  ------------------
 4084|    543|    NSSLOWKEYPublicKey *pubKey;
 4085|       |
 4086|    543|    CHECK_FORK();
 4087|       |
 4088|    543|    session = sftk_SessionFromHandle(hSession);
 4089|    543|    if (session == NULL)
  ------------------
  |  Branch (4089:9): [True: 0, False: 543]
  ------------------
 4090|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 4091|    543|    crv = sftk_InitGeneric(session, pMechanism, &context, SFTK_VERIFY_RECOVER,
 4092|    543|                           &key, hKey, &key_type, CKO_PUBLIC_KEY, CKA_VERIFY_RECOVER);
  ------------------
  |  |  327|    543|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
                                         &key, hKey, &key_type, CKO_PUBLIC_KEY, CKA_VERIFY_RECOVER);
  ------------------
  |  |  554|    543|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
 4093|    543|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|    543|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4093:9): [True: 0, False: 543]
  ------------------
 4094|      0|        sftk_FreeSession(session);
 4095|      0|        return crv;
 4096|      0|    }
 4097|       |
 4098|    543|    context->multi = PR_TRUE;
  ------------------
  |  |  437|    543|#define PR_TRUE 1
  ------------------
 4099|       |
 4100|    543|    switch (pMechanism->mechanism) {
 4101|    543|        case CKM_RSA_PKCS:
  ------------------
  |  |  720|    543|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
  |  Branch (4101:9): [True: 543, False: 0]
  ------------------
 4102|    543|        case CKM_RSA_X_509:
  ------------------
  |  |  722|    543|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (4102:9): [True: 0, False: 543]
  ------------------
 4103|    543|            if (key_type != CKK_RSA) {
  ------------------
  |  |  372|    543|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (4103:17): [True: 0, False: 543]
  ------------------
 4104|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 4105|      0|                break;
 4106|      0|            }
 4107|    543|            context->multi = PR_FALSE;
  ------------------
  |  |  438|    543|#define PR_FALSE 0
  ------------------
 4108|    543|            context->rsa = PR_TRUE;
  ------------------
  |  |  437|    543|#define PR_TRUE 1
  ------------------
 4109|    543|            pubKey = sftk_GetPubKey(key, CKK_RSA, &crv);
  ------------------
  |  |  372|    543|#define CKK_RSA 0x00000000UL
  ------------------
 4110|    543|            if (pubKey == NULL) {
  ------------------
  |  Branch (4110:17): [True: 0, False: 543]
  ------------------
 4111|      0|                break;
 4112|      0|            }
 4113|    543|            context->cipherInfo = pubKey;
 4114|    543|            context->update = pMechanism->mechanism == CKM_RSA_X_509
  ------------------
  |  |  722|    543|#define CKM_RSA_X_509 0x00000003UL
  ------------------
  |  Branch (4114:31): [True: 0, False: 543]
  ------------------
 4115|    543|                                  ? sftk_RSACheckSignRecoverRaw
 4116|    543|                                  : sftk_RSACheckSignRecover;
 4117|    543|            context->destroy = sftk_Null;
 4118|    543|            break;
 4119|      0|        default:
  ------------------
  |  Branch (4119:9): [True: 0, False: 543]
  ------------------
 4120|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 4121|      0|            break;
 4122|    543|    }
 4123|       |
 4124|    543|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|    543|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4124:9): [True: 0, False: 543]
  ------------------
 4125|      0|        PORT_Free(context);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 4126|      0|        sftk_FreeSession(session);
 4127|      0|        return crv;
 4128|      0|    }
 4129|    543|    sftk_SetContextByType(session, SFTK_VERIFY_RECOVER, context);
 4130|    543|    sftk_FreeSession(session);
 4131|    543|    return CKR_OK;
  ------------------
  |  | 1388|    543|#define CKR_OK 0x00000000UL
  ------------------
 4132|    543|}
NSC_VerifyRecover:
 4141|    543|{
 4142|    543|    SFTKSession *session;
 4143|    543|    SFTKSessionContext *context;
 4144|    543|    unsigned int outlen;
 4145|    543|    unsigned int maxoutlen = *pulDataLen;
 4146|    543|    CK_RV crv;
 4147|    543|    SECStatus rv;
 4148|       |
 4149|    543|    CHECK_FORK();
 4150|       |
 4151|       |    /* make sure we're legal */
 4152|    543|    crv = sftk_GetContext(hSession, &context, SFTK_VERIFY_RECOVER,
 4153|    543|                          PR_FALSE, &session);
  ------------------
  |  |  438|    543|#define PR_FALSE 0
  ------------------
 4154|    543|    if (crv != CKR_OK)
  ------------------
  |  | 1388|    543|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4154:9): [True: 0, False: 543]
  ------------------
 4155|      0|        return crv;
 4156|    543|    if (pData == NULL) {
  ------------------
  |  Branch (4156:9): [True: 0, False: 543]
  ------------------
 4157|       |        /* to return the actual size, we need  to do the decrypt, just return
 4158|       |         * the max size, which is the size of the input signature. */
 4159|      0|        *pulDataLen = ulSignatureLen;
 4160|      0|        rv = SECSuccess;
 4161|      0|        goto finish;
 4162|      0|    }
 4163|       |
 4164|    543|    rv = (*context->update)(context->cipherInfo, pData, &outlen, maxoutlen,
 4165|    543|                            pSignature, ulSignatureLen);
 4166|    543|    *pulDataLen = (CK_ULONG)outlen;
 4167|       |
 4168|    543|    sftk_TerminateOp(session, SFTK_VERIFY_RECOVER, context);
 4169|    543|finish:
 4170|    543|    sftk_FreeSession(session);
 4171|    543|    return (rv == SECSuccess) ? CKR_OK : sftk_MapVerifyError(PORT_GetError());
  ------------------
  |  | 1388|      9|#define CKR_OK 0x00000000UL
  ------------------
                  return (rv == SECSuccess) ? CKR_OK : sftk_MapVerifyError(PORT_GetError());
  ------------------
  |  |   62|    534|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (4171:12): [True: 9, False: 534]
  ------------------
 4172|    543|}
NSC_GenerateRandom:
 4196|  22.8k|{
 4197|  22.8k|    SECStatus rv;
 4198|       |
 4199|  22.8k|    CHECK_FORK();
 4200|       |
 4201|  22.8k|    rv = RNG_GenerateGlobalRandomBytes(pRandomData, ulRandomLen);
 4202|       |    /*
 4203|       |     * This may fail with SEC_ERROR_NEED_RANDOM, which means the RNG isn't
 4204|       |     * seeded with enough entropy.
 4205|       |     */
 4206|  22.8k|    return (rv == SECSuccess) ? CKR_OK : sftk_MapCryptError(PORT_GetError());
  ------------------
  |  | 1388|  22.8k|#define CKR_OK 0x00000000UL
  ------------------
                  return (rv == SECSuccess) ? CKR_OK : sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (4206:12): [True: 22.8k, False: 0]
  ------------------
 4207|  22.8k|}
NSC_GenerateKey:
 4761|  5.75k|{
 4762|  5.75k|    SFTKObject *key;
 4763|  5.75k|    SFTKSession *session;
 4764|  5.75k|    PRBool checkWeak = PR_FALSE;
  ------------------
  |  |  438|  5.75k|#define PR_FALSE 0
  ------------------
 4765|  5.75k|    CK_ULONG key_length = 0;
 4766|  5.75k|    CK_KEY_TYPE key_type = CKK_INVALID_KEY_TYPE;
  ------------------
  |  | 2759|  5.75k|#define CKK_INVALID_KEY_TYPE 0xffffffffUL
  ------------------
 4767|  5.75k|    CK_OBJECT_CLASS objclass = CKO_SECRET_KEY;
  ------------------
  |  |  329|  5.75k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
 4768|  5.75k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  5.75k|#define CKR_OK 0x00000000UL
  ------------------
 4769|  5.75k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  5.75k|#define CK_TRUE 1
  ------------------
 4770|  5.75k|    NSSPKCS5PBEParameter *pbe_param = NULL;
 4771|  5.75k|    int i;
 4772|  5.75k|    SFTKSlot *slot = sftk_SlotFromSessionHandle(hSession);
 4773|  5.75k|    unsigned char buf[MAX_KEY_LEN];
 4774|  5.75k|    enum { nsc_pbe,
 4775|  5.75k|           nsc_ssl,
 4776|  5.75k|           nsc_bulk,
 4777|  5.75k|           nsc_param,
 4778|  5.75k|           nsc_jpake } key_gen_type;
 4779|  5.75k|    SSL3RSAPreMasterSecret *rsa_pms;
 4780|  5.75k|    CK_VERSION *version;
 4781|       |    /* in very old versions of NSS, there were implementation errors with key
 4782|       |     * generation methods.  We want to beable to read these, but not
 4783|       |     * produce them any more.  The affected algorithm was 3DES.
 4784|       |     */
 4785|  5.75k|    PRBool faultyPBE3DES = PR_FALSE;
  ------------------
  |  |  438|  5.75k|#define PR_FALSE 0
  ------------------
 4786|  5.75k|    HASH_HashType hashType = HASH_AlgNULL;
 4787|       |
 4788|  5.75k|    CHECK_FORK();
 4789|       |
 4790|  5.75k|    if (!slot) {
  ------------------
  |  Branch (4790:9): [True: 0, False: 5.75k]
  ------------------
 4791|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 4792|      0|    }
 4793|       |    /*
 4794|       |     * now lets create an object to hang the attributes off of
 4795|       |     */
 4796|  5.75k|    key = sftk_NewObject(slot); /* fill in the handle later */
 4797|  5.75k|    if (key == NULL) {
  ------------------
  |  Branch (4797:9): [True: 0, False: 5.75k]
  ------------------
 4798|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 4799|      0|    }
 4800|       |
 4801|       |    /*
 4802|       |     * load the template values into the object
 4803|       |     */
 4804|  21.9k|    for (i = 0; i < (int)ulCount; i++) {
  ------------------
  |  Branch (4804:17): [True: 16.1k, False: 5.75k]
  ------------------
 4805|  16.1k|        if (pTemplate[i].type == CKA_VALUE_LEN) {
  ------------------
  |  |  580|  16.1k|#define CKA_VALUE_LEN 0x00000161UL
  ------------------
  |  Branch (4805:13): [True: 4.62k, False: 11.5k]
  ------------------
 4806|  4.62k|            key_length = *(CK_ULONG *)pTemplate[i].pValue;
 4807|  4.62k|            continue;
 4808|  4.62k|        }
 4809|       |        /* some algorithms need keytype specified */
 4810|  11.5k|        if (pTemplate[i].type == CKA_KEY_TYPE) {
  ------------------
  |  |  543|  11.5k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
  |  Branch (4810:13): [True: 0, False: 11.5k]
  ------------------
 4811|      0|            key_type = *(CK_ULONG *)pTemplate[i].pValue;
 4812|      0|            continue;
 4813|      0|        }
 4814|       |
 4815|  11.5k|        crv = sftk_AddAttributeType(key, sftk_attr_expand(&pTemplate[i]));
  ------------------
  |  |  587|  11.5k|#define sftk_attr_expand(ap) (ap)->type, (ap)->pValue, (ap)->ulValueLen
  ------------------
 4816|  11.5k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  11.5k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4816:13): [True: 0, False: 11.5k]
  ------------------
 4817|      0|            break;
 4818|      0|        }
 4819|  11.5k|    }
 4820|  5.75k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  5.75k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4820:9): [True: 0, False: 5.75k]
  ------------------
 4821|      0|        goto loser;
 4822|      0|    }
 4823|       |
 4824|       |    /* make sure we don't have any class, key_type, or value fields */
 4825|  5.75k|    sftk_DeleteAttributeType(key, CKA_CLASS);
  ------------------
  |  |  511|  5.75k|#define CKA_CLASS 0x00000000UL
  ------------------
 4826|  5.75k|    sftk_DeleteAttributeType(key, CKA_KEY_TYPE);
  ------------------
  |  |  543|  5.75k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 4827|  5.75k|    sftk_DeleteAttributeType(key, CKA_VALUE);
  ------------------
  |  |  516|  5.75k|#define CKA_VALUE 0x00000011UL
  ------------------
 4828|       |
 4829|       |    /* Now Set up the parameters to generate the key (based on mechanism) */
 4830|  5.75k|    key_gen_type = nsc_bulk; /* bulk key by default */
 4831|  5.75k|    switch (pMechanism->mechanism) {
 4832|      0|        case CKM_CDMF_KEY_GEN:
  ------------------
  |  |  834|      0|#define CKM_CDMF_KEY_GEN 0x00000140UL
  ------------------
  |  Branch (4832:9): [True: 0, False: 5.75k]
  ------------------
 4833|      0|        case CKM_DES_KEY_GEN:
  ------------------
  |  |  814|      0|#define CKM_DES_KEY_GEN 0x00000120UL
  ------------------
  |  Branch (4833:9): [True: 0, False: 5.75k]
  ------------------
 4834|      0|        case CKM_DES2_KEY_GEN:
  ------------------
  |  |  823|      0|#define CKM_DES2_KEY_GEN 0x00000130UL
  ------------------
  |  Branch (4834:9): [True: 0, False: 5.75k]
  ------------------
 4835|      1|        case CKM_DES3_KEY_GEN:
  ------------------
  |  |  824|      1|#define CKM_DES3_KEY_GEN 0x00000131UL
  ------------------
  |  Branch (4835:9): [True: 1, False: 5.75k]
  ------------------
 4836|      1|            checkWeak = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 4837|       |/* fall through */
 4838|      1|#ifndef NSS_DISABLE_DEPRECATED_RC2
 4839|      1|        case CKM_RC2_KEY_GEN:
  ------------------
  |  |  803|      1|#define CKM_RC2_KEY_GEN 0x00000100UL
  ------------------
  |  Branch (4839:9): [True: 0, False: 5.75k]
  ------------------
 4840|      1|#endif
 4841|      1|        case CKM_RC4_KEY_GEN:
  ------------------
  |  |  812|      1|#define CKM_RC4_KEY_GEN 0x00000110UL
  ------------------
  |  Branch (4841:9): [True: 0, False: 5.75k]
  ------------------
 4842|      1|        case CKM_GENERIC_SECRET_KEY_GEN:
  ------------------
  |  |  953|      1|#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL
  ------------------
  |  Branch (4842:9): [True: 0, False: 5.75k]
  ------------------
 4843|      1|#ifndef NSS_DISABLE_DEPRECATED_SEED
 4844|      1|        case CKM_SEED_KEY_GEN:
  ------------------
  |  | 1155|      1|#define CKM_SEED_KEY_GEN 0x00000650UL
  ------------------
  |  Branch (4844:9): [True: 0, False: 5.75k]
  ------------------
 4845|      1|#endif
 4846|      1|        case CKM_CAMELLIA_KEY_GEN:
  ------------------
  |  | 1135|      1|#define CKM_CAMELLIA_KEY_GEN 0x00000550UL
  ------------------
  |  Branch (4846:9): [True: 0, False: 5.75k]
  ------------------
 4847|      1|        case CKM_AES_KEY_GEN:
  ------------------
  |  | 1106|      1|#define CKM_AES_KEY_GEN 0x00001080UL
  ------------------
  |  Branch (4847:9): [True: 0, False: 5.75k]
  ------------------
 4848|  4.62k|        case CKM_NSS_CHACHA20_KEY_GEN:
  ------------------
  |  |  242|  4.62k|#define CKM_NSS_CHACHA20_KEY_GEN (CKM_NSS + 27)
  |  |  ------------------
  |  |  |  |  162|  4.62k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  4.62k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  4.62k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4848:9): [True: 4.62k, False: 1.13k]
  ------------------
 4849|  4.62k|        case CKM_CHACHA20_KEY_GEN:
  ------------------
  |  | 1203|  4.62k|#define CKM_CHACHA20_KEY_GEN 0x00001225UL
  ------------------
  |  Branch (4849:9): [True: 0, False: 5.75k]
  ------------------
 4850|       |#if NSS_SOFTOKEN_DOES_RC5
 4851|       |        case CKM_RC5_KEY_GEN:
 4852|       |#endif
 4853|  4.62k|            crv = nsc_SetupBulkKeyGen(pMechanism->mechanism, &key_type, &key_length);
 4854|  4.62k|            break;
 4855|  1.13k|        case CKM_SSL3_PRE_MASTER_KEY_GEN:
  ------------------
  |  |  959|  1.13k|#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL
  ------------------
  |  Branch (4855:9): [True: 1.13k, False: 4.62k]
  ------------------
 4856|  1.13k|            key_type = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|  1.13k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 4857|  1.13k|            key_length = 48;
 4858|  1.13k|            key_gen_type = nsc_ssl;
 4859|  1.13k|            break;
 4860|      0|        case CKM_PBA_SHA1_WITH_SHA1_HMAC:
  ------------------
  |  | 1015|      0|#define CKM_PBA_SHA1_WITH_SHA1_HMAC 0x000003C0UL
  ------------------
  |  Branch (4860:9): [True: 0, False: 5.75k]
  ------------------
 4861|      0|        case CKM_NSS_PBE_SHA1_HMAC_KEY_GEN:
  ------------------
  |  |  293|      0|#define CKM_NSS_PBE_SHA1_HMAC_KEY_GEN 0x80000009UL
  ------------------
  |  Branch (4861:9): [True: 0, False: 5.75k]
  ------------------
 4862|      0|        case CKM_NSS_PBE_MD5_HMAC_KEY_GEN:
  ------------------
  |  |  294|      0|#define CKM_NSS_PBE_MD5_HMAC_KEY_GEN 0x8000000aUL
  ------------------
  |  Branch (4862:9): [True: 0, False: 5.75k]
  ------------------
 4863|      0|        case CKM_NSS_PBE_MD2_HMAC_KEY_GEN:
  ------------------
  |  |  295|      0|#define CKM_NSS_PBE_MD2_HMAC_KEY_GEN 0x8000000bUL
  ------------------
  |  Branch (4863:9): [True: 0, False: 5.75k]
  ------------------
 4864|      0|        case CKM_NSS_PKCS12_PBE_SHA224_HMAC_KEY_GEN:
  ------------------
  |  |  246|      0|#define CKM_NSS_PKCS12_PBE_SHA224_HMAC_KEY_GEN (CKM_NSS + 29)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4864:9): [True: 0, False: 5.75k]
  ------------------
 4865|      0|        case CKM_NSS_PKCS12_PBE_SHA256_HMAC_KEY_GEN:
  ------------------
  |  |  247|      0|#define CKM_NSS_PKCS12_PBE_SHA256_HMAC_KEY_GEN (CKM_NSS + 30)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4865:9): [True: 0, False: 5.75k]
  ------------------
 4866|      0|        case CKM_NSS_PKCS12_PBE_SHA384_HMAC_KEY_GEN:
  ------------------
  |  |  248|      0|#define CKM_NSS_PKCS12_PBE_SHA384_HMAC_KEY_GEN (CKM_NSS + 31)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4866:9): [True: 0, False: 5.75k]
  ------------------
 4867|      0|        case CKM_NSS_PKCS12_PBE_SHA512_HMAC_KEY_GEN:
  ------------------
  |  |  249|      0|#define CKM_NSS_PKCS12_PBE_SHA512_HMAC_KEY_GEN (CKM_NSS + 32)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4867:9): [True: 0, False: 5.75k]
  ------------------
 4868|      0|            key_gen_type = nsc_pbe;
 4869|      0|            key_type = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|      0|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 4870|      0|            crv = nsc_SetupHMACKeyGen(pMechanism, &pbe_param);
 4871|      0|            break;
 4872|      0|        case CKM_NSS_PBE_SHA1_FAULTY_3DES_CBC:
  ------------------
  |  |  292|      0|#define CKM_NSS_PBE_SHA1_FAULTY_3DES_CBC 0x80000008UL
  ------------------
  |  Branch (4872:9): [True: 0, False: 5.75k]
  ------------------
 4873|      0|            faultyPBE3DES = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 4874|       |        /* fall through */
 4875|      0|        case CKM_NSS_PBE_SHA1_TRIPLE_DES_CBC:
  ------------------
  |  |  287|      0|#define CKM_NSS_PBE_SHA1_TRIPLE_DES_CBC 0x80000003UL
  ------------------
  |  Branch (4875:9): [True: 0, False: 5.75k]
  ------------------
 4876|      0|#ifndef NSS_DISABLE_DEPRECATED_RC2
 4877|      0|        case CKM_NSS_PBE_SHA1_40_BIT_RC2_CBC:
  ------------------
  |  |  288|      0|#define CKM_NSS_PBE_SHA1_40_BIT_RC2_CBC 0x80000004UL
  ------------------
  |  Branch (4877:9): [True: 0, False: 5.75k]
  ------------------
 4878|      0|        case CKM_NSS_PBE_SHA1_128_BIT_RC2_CBC:
  ------------------
  |  |  289|      0|#define CKM_NSS_PBE_SHA1_128_BIT_RC2_CBC 0x80000005UL
  ------------------
  |  Branch (4878:9): [True: 0, False: 5.75k]
  ------------------
 4879|      0|        case CKM_PBE_SHA1_RC2_128_CBC:
  ------------------
  |  | 1009|      0|#define CKM_PBE_SHA1_RC2_128_CBC 0x000003AAUL
  ------------------
  |  Branch (4879:9): [True: 0, False: 5.75k]
  ------------------
 4880|      0|        case CKM_PBE_SHA1_RC2_40_CBC:
  ------------------
  |  | 1010|      0|#define CKM_PBE_SHA1_RC2_40_CBC 0x000003ABUL
  ------------------
  |  Branch (4880:9): [True: 0, False: 5.75k]
  ------------------
 4881|      0|#endif
 4882|      0|        case CKM_NSS_PBE_SHA1_DES_CBC:
  ------------------
  |  |  286|      0|#define CKM_NSS_PBE_SHA1_DES_CBC 0x80000002UL
  ------------------
  |  Branch (4882:9): [True: 0, False: 5.75k]
  ------------------
 4883|      0|        case CKM_NSS_PBE_SHA1_40_BIT_RC4:
  ------------------
  |  |  290|      0|#define CKM_NSS_PBE_SHA1_40_BIT_RC4 0x80000006UL
  ------------------
  |  Branch (4883:9): [True: 0, False: 5.75k]
  ------------------
 4884|      0|        case CKM_NSS_PBE_SHA1_128_BIT_RC4:
  ------------------
  |  |  291|      0|#define CKM_NSS_PBE_SHA1_128_BIT_RC4 0x80000007UL
  ------------------
  |  Branch (4884:9): [True: 0, False: 5.75k]
  ------------------
 4885|      0|        case CKM_PBE_SHA1_DES3_EDE_CBC:
  ------------------
  |  | 1007|      0|#define CKM_PBE_SHA1_DES3_EDE_CBC 0x000003A8UL
  ------------------
  |  Branch (4885:9): [True: 0, False: 5.75k]
  ------------------
 4886|      0|        case CKM_PBE_SHA1_DES2_EDE_CBC:
  ------------------
  |  | 1008|      0|#define CKM_PBE_SHA1_DES2_EDE_CBC 0x000003A9UL
  ------------------
  |  Branch (4886:9): [True: 0, False: 5.75k]
  ------------------
 4887|      0|        case CKM_PBE_SHA1_RC4_128:
  ------------------
  |  | 1005|      0|#define CKM_PBE_SHA1_RC4_128 0x000003A6UL
  ------------------
  |  Branch (4887:9): [True: 0, False: 5.75k]
  ------------------
 4888|      0|        case CKM_PBE_SHA1_RC4_40:
  ------------------
  |  | 1006|      0|#define CKM_PBE_SHA1_RC4_40 0x000003A7UL
  ------------------
  |  Branch (4888:9): [True: 0, False: 5.75k]
  ------------------
 4889|      0|        case CKM_PBE_MD5_DES_CBC:
  ------------------
  |  |  998|      0|#define CKM_PBE_MD5_DES_CBC 0x000003A1UL
  ------------------
  |  Branch (4889:9): [True: 0, False: 5.75k]
  ------------------
 4890|      0|        case CKM_PBE_MD2_DES_CBC:
  ------------------
  |  |  997|      0|#define CKM_PBE_MD2_DES_CBC 0x000003A0UL
  ------------------
  |  Branch (4890:9): [True: 0, False: 5.75k]
  ------------------
 4891|      0|        case CKM_PKCS5_PBKD2:
  ------------------
  |  | 1013|      0|#define CKM_PKCS5_PBKD2 0x000003B0UL
  ------------------
  |  Branch (4891:9): [True: 0, False: 5.75k]
  ------------------
 4892|      0|            key_gen_type = nsc_pbe;
 4893|      0|            crv = nsc_SetupPBEKeyGen(pMechanism, &pbe_param, &key_type, &key_length);
 4894|      0|            break;
 4895|      0|        case CKM_DSA_PARAMETER_GEN:
  ------------------
  |  | 1212|      0|#define CKM_DSA_PARAMETER_GEN 0x00002000UL
  ------------------
  |  Branch (4895:9): [True: 0, False: 5.75k]
  ------------------
 4896|      0|            key_gen_type = nsc_param;
 4897|      0|            key_type = CKK_DSA;
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
 4898|      0|            objclass = CKO_DOMAIN_PARAMETERS;
  ------------------
  |  |  331|      0|#define CKO_DOMAIN_PARAMETERS 0x00000006UL
  ------------------
 4899|      0|            crv = CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
 4900|      0|            break;
 4901|      0|        case CKM_NSS_JPAKE_ROUND1_SHA1:
  ------------------
  |  |  182|      0|#define CKM_NSS_JPAKE_ROUND1_SHA1 (CKM_NSS + 7)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4901:9): [True: 0, False: 5.75k]
  ------------------
 4902|      0|            hashType = HASH_AlgSHA1;
 4903|      0|            goto jpake1;
 4904|      0|        case CKM_NSS_JPAKE_ROUND1_SHA256:
  ------------------
  |  |  183|      0|#define CKM_NSS_JPAKE_ROUND1_SHA256 (CKM_NSS + 8)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4904:9): [True: 0, False: 5.75k]
  ------------------
 4905|      0|            hashType = HASH_AlgSHA256;
 4906|      0|            goto jpake1;
 4907|      0|        case CKM_NSS_JPAKE_ROUND1_SHA384:
  ------------------
  |  |  184|      0|#define CKM_NSS_JPAKE_ROUND1_SHA384 (CKM_NSS + 9)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4907:9): [True: 0, False: 5.75k]
  ------------------
 4908|      0|            hashType = HASH_AlgSHA384;
 4909|      0|            goto jpake1;
 4910|      0|        case CKM_NSS_JPAKE_ROUND1_SHA512:
  ------------------
  |  |  185|      0|#define CKM_NSS_JPAKE_ROUND1_SHA512 (CKM_NSS + 10)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4910:9): [True: 0, False: 5.75k]
  ------------------
 4911|      0|            hashType = HASH_AlgSHA512;
 4912|      0|            goto jpake1;
 4913|      0|        jpake1:
 4914|      0|            key_gen_type = nsc_jpake;
 4915|      0|            key_type = CKK_NSS_JPAKE_ROUND1;
  ------------------
  |  |   53|      0|#define CKK_NSS_JPAKE_ROUND1 (CKK_NSS + 2)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4916|      0|            objclass = CKO_PRIVATE_KEY;
  ------------------
  |  |  328|      0|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
 4917|      0|            if (pMechanism->pParameter == NULL ||
  ------------------
  |  Branch (4917:17): [True: 0, False: 0]
  ------------------
 4918|      0|                pMechanism->ulParameterLen != sizeof(CK_NSS_JPAKERound1Params)) {
  ------------------
  |  Branch (4918:17): [True: 0, False: 0]
  ------------------
 4919|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 4920|      0|                break;
 4921|      0|            }
 4922|      0|            if (sftk_isTrue(key, CKA_TOKEN)) {
  ------------------
  |  |  512|      0|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (4922:17): [True: 0, False: 0]
  ------------------
 4923|      0|                crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 4924|      0|                break;
 4925|      0|            }
 4926|      0|            crv = CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
 4927|      0|            break;
 4928|      0|        default:
  ------------------
  |  Branch (4928:9): [True: 0, False: 5.75k]
  ------------------
 4929|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 4930|      0|            break;
 4931|  5.75k|    }
 4932|       |
 4933|       |    /* make sure we aren't going to overflow the buffer */
 4934|  5.75k|    if (sizeof(buf) < key_length) {
  ------------------
  |  Branch (4934:9): [True: 0, False: 5.75k]
  ------------------
 4935|       |        /* someone is getting pretty optimistic about how big their key can
 4936|       |         * be... */
 4937|      0|        crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 4938|      0|    }
 4939|       |
 4940|  5.75k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  5.75k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4940:9): [True: 0, False: 5.75k]
  ------------------
 4941|      0|        if (pbe_param) {
  ------------------
  |  Branch (4941:13): [True: 0, False: 0]
  ------------------
 4942|      0|            nsspkcs5_DestroyPBEParameter(pbe_param);
 4943|      0|        }
 4944|      0|        goto loser;
 4945|      0|    }
 4946|       |
 4947|       |    /* if there was no error,
 4948|       |     * key_type *MUST* be set in the switch statement above */
 4949|  5.75k|    PORT_Assert(key_type != CKK_INVALID_KEY_TYPE);
  ------------------
  |  |  120|  5.75k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.75k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.75k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4950|       |
 4951|       |    /*
 4952|       |     * now to the actual key gen.
 4953|       |     */
 4954|  5.75k|    switch (key_gen_type) {
  ------------------
  |  Branch (4954:13): [True: 0, False: 5.75k]
  ------------------
 4955|      0|        case nsc_pbe:
  ------------------
  |  Branch (4955:9): [True: 0, False: 5.75k]
  ------------------
 4956|      0|            crv = nsc_pbe_key_gen(pbe_param, pMechanism, buf, &key_length,
 4957|      0|                                  faultyPBE3DES);
 4958|      0|            nsspkcs5_DestroyPBEParameter(pbe_param);
 4959|      0|            break;
 4960|  1.13k|        case nsc_ssl:
  ------------------
  |  Branch (4960:9): [True: 1.13k, False: 4.62k]
  ------------------
 4961|  1.13k|            rsa_pms = (SSL3RSAPreMasterSecret *)buf;
 4962|  1.13k|            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_VERSION))) {
  ------------------
  |  |   50|  1.13k|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 1.13k]
  |  |  |  Branch (50:64): [True: 0, False: 1.13k]
  |  |  ------------------
  ------------------
 4963|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 4964|      0|                goto loser;
 4965|      0|            }
 4966|  1.13k|            version = (CK_VERSION *)pMechanism->pParameter;
 4967|  1.13k|            rsa_pms->client_version[0] = version->major;
 4968|  1.13k|            rsa_pms->client_version[1] = version->minor;
 4969|  1.13k|            crv =
 4970|  1.13k|                NSC_GenerateRandom(0, &rsa_pms->random[0], sizeof(rsa_pms->random));
 4971|  1.13k|            break;
 4972|  4.62k|        case nsc_bulk:
  ------------------
  |  Branch (4972:9): [True: 4.62k, False: 1.13k]
  ------------------
 4973|       |            /* get the key, check for weak keys and repeat if found */
 4974|  4.62k|            do {
 4975|  4.62k|                crv = NSC_GenerateRandom(0, buf, key_length);
 4976|  4.62k|            } while (crv == CKR_OK && checkWeak && sftk_IsWeakKey(buf, key_type));
  ------------------
  |  | 1388|  9.25k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4976:22): [True: 4.62k, False: 0]
  |  Branch (4976:39): [True: 1, False: 4.62k]
  |  Branch (4976:52): [True: 0, False: 1]
  ------------------
 4977|  4.62k|            break;
 4978|      0|        case nsc_param:
  ------------------
  |  Branch (4978:9): [True: 0, False: 5.75k]
  ------------------
 4979|       |            /* generate parameters */
 4980|      0|            *buf = 0;
 4981|      0|            crv = nsc_parameter_gen(key_type, key);
 4982|      0|            break;
 4983|      0|        case nsc_jpake:
  ------------------
  |  Branch (4983:9): [True: 0, False: 5.75k]
  ------------------
 4984|      0|            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_NSS_JPAKERound1Params))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4985|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 4986|      0|                goto loser;
 4987|      0|            }
 4988|      0|            crv = jpake_Round1(hashType,
 4989|      0|                               (CK_NSS_JPAKERound1Params *)pMechanism->pParameter,
 4990|      0|                               key);
 4991|      0|            break;
 4992|  5.75k|    }
 4993|       |
 4994|  5.75k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  5.75k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (4994:9): [True: 0, False: 5.75k]
  ------------------
 4995|      0|        goto loser;
 4996|      0|    }
 4997|       |
 4998|       |    /* Add the class, key_type, and value */
 4999|  5.75k|    crv = sftk_AddAttributeType(key, CKA_CLASS, &objclass, sizeof(CK_OBJECT_CLASS));
  ------------------
  |  |  511|  5.75k|#define CKA_CLASS 0x00000000UL
  ------------------
 5000|  5.75k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  5.75k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5000:9): [True: 0, False: 5.75k]
  ------------------
 5001|      0|        goto loser;
 5002|      0|    }
 5003|  5.75k|    crv = sftk_AddAttributeType(key, CKA_KEY_TYPE, &key_type, sizeof(CK_KEY_TYPE));
  ------------------
  |  |  543|  5.75k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 5004|  5.75k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  5.75k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5004:9): [True: 0, False: 5.75k]
  ------------------
 5005|      0|        goto loser;
 5006|      0|    }
 5007|  5.75k|    if (key_length != 0) {
  ------------------
  |  Branch (5007:9): [True: 5.75k, False: 0]
  ------------------
 5008|  5.75k|        crv = sftk_AddAttributeType(key, CKA_VALUE, buf, key_length);
  ------------------
  |  |  516|  5.75k|#define CKA_VALUE 0x00000011UL
  ------------------
 5009|  5.75k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  5.75k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5009:13): [True: 0, False: 5.75k]
  ------------------
 5010|      0|            goto loser;
 5011|      0|        }
 5012|  5.75k|    }
 5013|       |
 5014|       |    /* get the session */
 5015|  5.75k|    session = sftk_SessionFromHandle(hSession);
 5016|  5.75k|    if (session == NULL) {
  ------------------
  |  Branch (5016:9): [True: 0, False: 5.75k]
  ------------------
 5017|      0|        crv = CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5018|      0|        goto loser;
 5019|      0|    }
 5020|       |
 5021|       |    /*
 5022|       |     * handle the base object stuff
 5023|       |     */
 5024|  5.75k|    crv = sftk_handleObject(key, session);
 5025|  5.75k|    sftk_FreeSession(session);
 5026|  5.75k|    if (crv == CKR_OK && sftk_isTrue(key, CKA_SENSITIVE)) {
  ------------------
  |  | 1388|  11.5k|#define CKR_OK 0x00000000UL
  ------------------
                  if (crv == CKR_OK && sftk_isTrue(key, CKA_SENSITIVE)) {
  ------------------
  |  |  546|  5.75k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
  |  Branch (5026:9): [True: 5.75k, False: 0]
  |  Branch (5026:26): [True: 0, False: 5.75k]
  ------------------
 5027|      0|        crv = sftk_forceAttribute(key, CKA_ALWAYS_SENSITIVE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  588|      0|#define CKA_ALWAYS_SENSITIVE 0x00000165UL
  ------------------
 5028|      0|    }
 5029|  5.75k|    if (crv == CKR_OK && !sftk_isTrue(key, CKA_EXTRACTABLE)) {
  ------------------
  |  | 1388|  11.5k|#define CKR_OK 0x00000000UL
  ------------------
                  if (crv == CKR_OK && !sftk_isTrue(key, CKA_EXTRACTABLE)) {
  ------------------
  |  |  585|  5.75k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
  |  Branch (5029:9): [True: 5.75k, False: 0]
  |  Branch (5029:26): [True: 0, False: 5.75k]
  ------------------
 5030|      0|        crv = sftk_forceAttribute(key, CKA_NEVER_EXTRACTABLE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  587|      0|#define CKA_NEVER_EXTRACTABLE 0x00000164UL
  ------------------
 5031|      0|    }
 5032|  5.75k|    if (crv == CKR_OK) {
  ------------------
  |  | 1388|  5.75k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5032:9): [True: 5.75k, False: 0]
  ------------------
 5033|  5.75k|        *phKey = key->handle;
 5034|  5.75k|    }
 5035|  5.75k|loser:
 5036|  5.75k|    PORT_Memset(buf, 0, sizeof buf);
  ------------------
  |  |  182|  5.75k|#define PORT_Memset memset
  ------------------
 5037|  5.75k|    sftk_FreeObject(key);
 5038|  5.75k|    return crv;
 5039|  5.75k|}
NSC_GenerateKeyPair:
 5495|  9.87k|{
 5496|  9.87k|    SFTKObject *publicKey, *privateKey;
 5497|  9.87k|    SFTKSession *session;
 5498|  9.87k|    CK_KEY_TYPE key_type;
 5499|  9.87k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  9.87k|#define CKR_OK 0x00000000UL
  ------------------
 5500|  9.87k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  9.87k|#define CK_TRUE 1
  ------------------
 5501|  9.87k|    SECStatus rv;
 5502|  9.87k|    CK_OBJECT_CLASS pubClass = CKO_PUBLIC_KEY;
  ------------------
  |  |  327|  9.87k|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
 5503|  9.87k|    CK_OBJECT_CLASS privClass = CKO_PRIVATE_KEY;
  ------------------
  |  |  328|  9.87k|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
 5504|  9.87k|    int i;
 5505|  9.87k|    SFTKSlot *slot = sftk_SlotFromSessionHandle(hSession);
 5506|  9.87k|    unsigned int bitSize;
 5507|       |
 5508|       |    /* RSA */
 5509|  9.87k|    int public_modulus_bits = 0;
 5510|  9.87k|    SECItem pubExp;
 5511|  9.87k|    RSAPrivateKey *rsaPriv;
 5512|       |
 5513|       |    /* DSA */
 5514|  9.87k|    PQGParams pqgParam;
 5515|  9.87k|    DHParams dhParam;
 5516|  9.87k|    DSAPrivateKey *dsaPriv;
 5517|       |
 5518|       |    /* Diffie Hellman */
 5519|  9.87k|    DHPrivateKey *dhPriv;
 5520|       |
 5521|       |    /* Elliptic Curve Cryptography */
 5522|  9.87k|    SECItem ecEncodedParams; /* DER Encoded parameters */
 5523|  9.87k|    ECPrivateKey *ecPriv;
 5524|  9.87k|    ECParams *ecParams;
 5525|       |
 5526|       |    /* Kyber */
 5527|  9.87k|    CK_NSS_KEM_PARAMETER_SET_TYPE ckKyberParamSet;
 5528|       |
 5529|  9.87k|    CHECK_FORK();
 5530|       |
 5531|  9.87k|    if (!slot) {
  ------------------
  |  Branch (5531:9): [True: 0, False: 9.87k]
  ------------------
 5532|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 5533|      0|    }
 5534|       |    /*
 5535|       |     * now lets create an object to hang the attributes off of
 5536|       |     */
 5537|  9.87k|    publicKey = sftk_NewObject(slot); /* fill in the handle later */
 5538|  9.87k|    if (publicKey == NULL) {
  ------------------
  |  Branch (5538:9): [True: 0, False: 9.87k]
  ------------------
 5539|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5540|      0|    }
 5541|       |
 5542|       |    /*
 5543|       |     * load the template values into the publicKey
 5544|       |     */
 5545|  80.9k|    for (i = 0; i < (int)ulPublicKeyAttributeCount; i++) {
  ------------------
  |  Branch (5545:17): [True: 71.0k, False: 9.87k]
  ------------------
 5546|  71.0k|        if (pPublicKeyTemplate[i].type == CKA_MODULUS_BITS) {
  ------------------
  |  |  559|  71.0k|#define CKA_MODULUS_BITS 0x00000121UL
  ------------------
  |  Branch (5546:13): [True: 0, False: 71.0k]
  ------------------
 5547|      0|            public_modulus_bits = *(CK_ULONG *)pPublicKeyTemplate[i].pValue;
 5548|      0|            continue;
 5549|      0|        }
 5550|       |
 5551|  71.0k|        if (pPublicKeyTemplate[i].type == CKA_NSS_PARAMETER_SET) {
  ------------------
  |  |  113|  71.0k|#define CKA_NSS_PARAMETER_SET (CKA_NSS + 40)
  |  |  ------------------
  |  |  |  |   77|  71.0k|#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  692|  71.0k|#define CKA_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  71.0k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5551:13): [True: 0, False: 71.0k]
  ------------------
 5552|      0|            ckKyberParamSet = *(CK_NSS_KEM_PARAMETER_SET_TYPE *)pPublicKeyTemplate[i].pValue;
 5553|      0|            continue;
 5554|      0|        }
 5555|       |
 5556|  71.0k|        crv = sftk_AddAttributeType(publicKey,
 5557|  71.0k|                                    sftk_attr_expand(&pPublicKeyTemplate[i]));
  ------------------
  |  |  587|  71.0k|#define sftk_attr_expand(ap) (ap)->type, (ap)->pValue, (ap)->ulValueLen
  ------------------
 5558|  71.0k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  71.0k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5558:13): [True: 0, False: 71.0k]
  ------------------
 5559|      0|            break;
 5560|  71.0k|    }
 5561|       |
 5562|  9.87k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.87k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5562:9): [True: 0, False: 9.87k]
  ------------------
 5563|      0|        sftk_FreeObject(publicKey);
 5564|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5565|      0|    }
 5566|       |
 5567|  9.87k|    privateKey = sftk_NewObject(slot); /* fill in the handle later */
 5568|  9.87k|    if (privateKey == NULL) {
  ------------------
  |  Branch (5568:9): [True: 0, False: 9.87k]
  ------------------
 5569|      0|        sftk_FreeObject(publicKey);
 5570|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5571|      0|    }
 5572|       |    /*
 5573|       |     * now load the private key template
 5574|       |     */
 5575|  79.0k|    for (i = 0; i < (int)ulPrivateKeyAttributeCount; i++) {
  ------------------
  |  Branch (5575:17): [True: 69.1k, False: 9.87k]
  ------------------
 5576|  69.1k|        if (pPrivateKeyTemplate[i].type == CKA_VALUE_BITS) {
  ------------------
  |  |  579|  69.1k|#define CKA_VALUE_BITS 0x00000160UL
  ------------------
  |  Branch (5576:13): [True: 0, False: 69.1k]
  ------------------
 5577|      0|            continue;
 5578|      0|        }
 5579|       |
 5580|  69.1k|        crv = sftk_AddAttributeType(privateKey,
 5581|  69.1k|                                    sftk_attr_expand(&pPrivateKeyTemplate[i]));
  ------------------
  |  |  587|  69.1k|#define sftk_attr_expand(ap) (ap)->type, (ap)->pValue, (ap)->ulValueLen
  ------------------
 5582|  69.1k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  69.1k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5582:13): [True: 0, False: 69.1k]
  ------------------
 5583|      0|            break;
 5584|  69.1k|    }
 5585|       |
 5586|  9.87k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.87k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5586:9): [True: 0, False: 9.87k]
  ------------------
 5587|      0|        sftk_FreeObject(publicKey);
 5588|      0|        sftk_FreeObject(privateKey);
 5589|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5590|      0|    }
 5591|  9.87k|    sftk_DeleteAttributeType(privateKey, CKA_CLASS);
  ------------------
  |  |  511|  9.87k|#define CKA_CLASS 0x00000000UL
  ------------------
 5592|  9.87k|    sftk_DeleteAttributeType(privateKey, CKA_KEY_TYPE);
  ------------------
  |  |  543|  9.87k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 5593|  9.87k|    sftk_DeleteAttributeType(privateKey, CKA_VALUE);
  ------------------
  |  |  516|  9.87k|#define CKA_VALUE 0x00000011UL
  ------------------
 5594|  9.87k|    sftk_DeleteAttributeType(publicKey, CKA_CLASS);
  ------------------
  |  |  511|  9.87k|#define CKA_CLASS 0x00000000UL
  ------------------
 5595|  9.87k|    sftk_DeleteAttributeType(publicKey, CKA_KEY_TYPE);
  ------------------
  |  |  543|  9.87k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 5596|  9.87k|    sftk_DeleteAttributeType(publicKey, CKA_VALUE);
  ------------------
  |  |  516|  9.87k|#define CKA_VALUE 0x00000011UL
  ------------------
 5597|       |
 5598|       |    /* Now Set up the parameters to generate the key (based on mechanism) */
 5599|  9.87k|    switch (pMechanism->mechanism) {
 5600|      0|        case CKM_RSA_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  719|      0|#define CKM_RSA_PKCS_KEY_PAIR_GEN 0x00000000UL
  ------------------
  |  Branch (5600:9): [True: 0, False: 9.87k]
  ------------------
 5601|       |            /* format the keys */
 5602|      0|            sftk_DeleteAttributeType(publicKey, CKA_MODULUS);
  ------------------
  |  |  558|      0|#define CKA_MODULUS 0x00000120UL
  ------------------
 5603|      0|            sftk_DeleteAttributeType(privateKey, CKA_NSS_DB);
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5604|      0|            sftk_DeleteAttributeType(privateKey, CKA_MODULUS);
  ------------------
  |  |  558|      0|#define CKA_MODULUS 0x00000120UL
  ------------------
 5605|      0|            sftk_DeleteAttributeType(privateKey, CKA_PRIVATE_EXPONENT);
  ------------------
  |  |  561|      0|#define CKA_PRIVATE_EXPONENT 0x00000123UL
  ------------------
 5606|      0|            sftk_DeleteAttributeType(privateKey, CKA_PUBLIC_EXPONENT);
  ------------------
  |  |  560|      0|#define CKA_PUBLIC_EXPONENT 0x00000122UL
  ------------------
 5607|      0|            sftk_DeleteAttributeType(privateKey, CKA_PRIME_1);
  ------------------
  |  |  562|      0|#define CKA_PRIME_1 0x00000124UL
  ------------------
 5608|      0|            sftk_DeleteAttributeType(privateKey, CKA_PRIME_2);
  ------------------
  |  |  563|      0|#define CKA_PRIME_2 0x00000125UL
  ------------------
 5609|      0|            sftk_DeleteAttributeType(privateKey, CKA_EXPONENT_1);
  ------------------
  |  |  564|      0|#define CKA_EXPONENT_1 0x00000126UL
  ------------------
 5610|      0|            sftk_DeleteAttributeType(privateKey, CKA_EXPONENT_2);
  ------------------
  |  |  565|      0|#define CKA_EXPONENT_2 0x00000127UL
  ------------------
 5611|      0|            sftk_DeleteAttributeType(privateKey, CKA_COEFFICIENT);
  ------------------
  |  |  566|      0|#define CKA_COEFFICIENT 0x00000128UL
  ------------------
 5612|      0|            key_type = CKK_RSA;
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
 5613|      0|            if (public_modulus_bits == 0) {
  ------------------
  |  Branch (5613:17): [True: 0, False: 0]
  ------------------
 5614|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 5615|      0|                break;
 5616|      0|            }
 5617|      0|            if (public_modulus_bits < RSA_MIN_MODULUS_BITS) {
  ------------------
  |  |  151|      0|#define RSA_MIN_MODULUS_BITS 128
  ------------------
  |  Branch (5617:17): [True: 0, False: 0]
  ------------------
 5618|      0|                crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5619|      0|                break;
 5620|      0|            }
 5621|      0|            if (public_modulus_bits % 2 != 0) {
  ------------------
  |  Branch (5621:17): [True: 0, False: 0]
  ------------------
 5622|      0|                crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5623|      0|                break;
 5624|      0|            }
 5625|       |
 5626|       |            /* extract the exponent */
 5627|      0|            crv = sftk_Attribute2SSecItem(NULL, &pubExp, publicKey, CKA_PUBLIC_EXPONENT);
  ------------------
  |  |  560|      0|#define CKA_PUBLIC_EXPONENT 0x00000122UL
  ------------------
 5628|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5628:17): [True: 0, False: 0]
  ------------------
 5629|      0|                break;
 5630|      0|            bitSize = sftk_GetLengthInBits(pubExp.data, pubExp.len);
 5631|      0|            if (bitSize < 2) {
  ------------------
  |  Branch (5631:17): [True: 0, False: 0]
  ------------------
 5632|      0|                crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5633|      0|                SECITEM_ZfreeItem(&pubExp, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pubExp, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5634|      0|                break;
 5635|      0|            }
 5636|      0|            crv = sftk_AddAttributeType(privateKey, CKA_PUBLIC_EXPONENT,
  ------------------
  |  |  560|      0|#define CKA_PUBLIC_EXPONENT 0x00000122UL
  ------------------
 5637|      0|                                        sftk_item_expand(&pubExp));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5638|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5638:17): [True: 0, False: 0]
  ------------------
 5639|      0|                SECITEM_ZfreeItem(&pubExp, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pubExp, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5640|      0|                break;
 5641|      0|            }
 5642|       |
 5643|      0|            rsaPriv = RSA_NewKey(public_modulus_bits, &pubExp);
 5644|      0|            SECITEM_ZfreeItem(&pubExp, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&pubExp, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5645|      0|            if (rsaPriv == NULL) {
  ------------------
  |  Branch (5645:17): [True: 0, False: 0]
  ------------------
 5646|      0|                if (PORT_GetError() == SEC_ERROR_LIBRARY_FAILURE) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (5646:21): [True: 0, False: 0]
  ------------------
 5647|      0|                    sftk_fatalError = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5648|      0|                }
 5649|      0|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 5650|      0|                break;
 5651|      0|            }
 5652|       |            /* now fill in the RSA dependent paramenters in the public key */
 5653|      0|            crv = sftk_AddAttributeType(publicKey, CKA_MODULUS,
  ------------------
  |  |  558|      0|#define CKA_MODULUS 0x00000120UL
  ------------------
 5654|      0|                                        sftk_item_expand(&rsaPriv->modulus));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5655|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5655:17): [True: 0, False: 0]
  ------------------
 5656|      0|                goto kpg_done;
 5657|       |            /* now fill in the RSA dependent paramenters in the private key */
 5658|      0|            crv = sftk_AddAttributeType(privateKey, CKA_NSS_DB,
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5659|      0|                                        sftk_item_expand(&rsaPriv->modulus));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5660|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5660:17): [True: 0, False: 0]
  ------------------
 5661|      0|                goto kpg_done;
 5662|      0|            crv = sftk_AddAttributeType(privateKey, CKA_MODULUS,
  ------------------
  |  |  558|      0|#define CKA_MODULUS 0x00000120UL
  ------------------
 5663|      0|                                        sftk_item_expand(&rsaPriv->modulus));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5664|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5664:17): [True: 0, False: 0]
  ------------------
 5665|      0|                goto kpg_done;
 5666|      0|            crv = sftk_AddAttributeType(privateKey, CKA_PRIVATE_EXPONENT,
  ------------------
  |  |  561|      0|#define CKA_PRIVATE_EXPONENT 0x00000123UL
  ------------------
 5667|      0|                                        sftk_item_expand(&rsaPriv->privateExponent));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5668|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5668:17): [True: 0, False: 0]
  ------------------
 5669|      0|                goto kpg_done;
 5670|      0|            crv = sftk_AddAttributeType(privateKey, CKA_PRIME_1,
  ------------------
  |  |  562|      0|#define CKA_PRIME_1 0x00000124UL
  ------------------
 5671|      0|                                        sftk_item_expand(&rsaPriv->prime1));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5672|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5672:17): [True: 0, False: 0]
  ------------------
 5673|      0|                goto kpg_done;
 5674|      0|            crv = sftk_AddAttributeType(privateKey, CKA_PRIME_2,
  ------------------
  |  |  563|      0|#define CKA_PRIME_2 0x00000125UL
  ------------------
 5675|      0|                                        sftk_item_expand(&rsaPriv->prime2));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5676|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5676:17): [True: 0, False: 0]
  ------------------
 5677|      0|                goto kpg_done;
 5678|      0|            crv = sftk_AddAttributeType(privateKey, CKA_EXPONENT_1,
  ------------------
  |  |  564|      0|#define CKA_EXPONENT_1 0x00000126UL
  ------------------
 5679|      0|                                        sftk_item_expand(&rsaPriv->exponent1));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5680|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5680:17): [True: 0, False: 0]
  ------------------
 5681|      0|                goto kpg_done;
 5682|      0|            crv = sftk_AddAttributeType(privateKey, CKA_EXPONENT_2,
  ------------------
  |  |  565|      0|#define CKA_EXPONENT_2 0x00000127UL
  ------------------
 5683|      0|                                        sftk_item_expand(&rsaPriv->exponent2));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5684|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5684:17): [True: 0, False: 0]
  ------------------
 5685|      0|                goto kpg_done;
 5686|      0|            crv = sftk_AddAttributeType(privateKey, CKA_COEFFICIENT,
  ------------------
  |  |  566|      0|#define CKA_COEFFICIENT 0x00000128UL
  ------------------
 5687|      0|                                        sftk_item_expand(&rsaPriv->coefficient));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5688|      0|        kpg_done:
 5689|       |            /* Should zeroize the contents first, since this func doesn't. */
 5690|      0|            PORT_FreeArena(rsaPriv->arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(rsaPriv->arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5691|      0|            break;
 5692|      0|        case CKM_DSA_KEY_PAIR_GEN:
  ------------------
  |  |  744|      0|#define CKM_DSA_KEY_PAIR_GEN 0x00000010UL
  ------------------
  |  Branch (5692:9): [True: 0, False: 9.87k]
  ------------------
 5693|      0|            sftk_DeleteAttributeType(publicKey, CKA_VALUE);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 5694|      0|            sftk_DeleteAttributeType(privateKey, CKA_NSS_DB);
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5695|      0|            sftk_DeleteAttributeType(privateKey, CKA_PRIME);
  ------------------
  |  |  569|      0|#define CKA_PRIME 0x00000130UL
  ------------------
 5696|      0|            sftk_DeleteAttributeType(privateKey, CKA_SUBPRIME);
  ------------------
  |  |  570|      0|#define CKA_SUBPRIME 0x00000131UL
  ------------------
 5697|      0|            sftk_DeleteAttributeType(privateKey, CKA_BASE);
  ------------------
  |  |  571|      0|#define CKA_BASE 0x00000132UL
  ------------------
 5698|      0|            key_type = CKK_DSA;
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
 5699|       |
 5700|       |            /* extract the necessary parameters and copy them to the private key */
 5701|      0|            crv = sftk_Attribute2SSecItem(NULL, &pqgParam.prime, publicKey, CKA_PRIME);
  ------------------
  |  |  569|      0|#define CKA_PRIME 0x00000130UL
  ------------------
 5702|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5702:17): [True: 0, False: 0]
  ------------------
 5703|      0|                break;
 5704|      0|            crv = sftk_Attribute2SSecItem(NULL, &pqgParam.subPrime, publicKey,
 5705|      0|                                          CKA_SUBPRIME);
  ------------------
  |  |  570|      0|#define CKA_SUBPRIME 0x00000131UL
  ------------------
 5706|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5706:17): [True: 0, False: 0]
  ------------------
 5707|      0|                SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5708|      0|                break;
 5709|      0|            }
 5710|      0|            crv = sftk_Attribute2SSecItem(NULL, &pqgParam.base, publicKey, CKA_BASE);
  ------------------
  |  |  571|      0|#define CKA_BASE 0x00000132UL
  ------------------
 5711|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5711:17): [True: 0, False: 0]
  ------------------
 5712|      0|                SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5713|      0|                SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5714|      0|                break;
 5715|      0|            }
 5716|      0|            crv = sftk_AddAttributeType(privateKey, CKA_PRIME,
  ------------------
  |  |  569|      0|#define CKA_PRIME 0x00000130UL
  ------------------
 5717|      0|                                        sftk_item_expand(&pqgParam.prime));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5718|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5718:17): [True: 0, False: 0]
  ------------------
 5719|      0|                SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5720|      0|                SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5721|      0|                SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5722|      0|                break;
 5723|      0|            }
 5724|      0|            crv = sftk_AddAttributeType(privateKey, CKA_SUBPRIME,
  ------------------
  |  |  570|      0|#define CKA_SUBPRIME 0x00000131UL
  ------------------
 5725|      0|                                        sftk_item_expand(&pqgParam.subPrime));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5726|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5726:17): [True: 0, False: 0]
  ------------------
 5727|      0|                SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5728|      0|                SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5729|      0|                SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5730|      0|                break;
 5731|      0|            }
 5732|      0|            crv = sftk_AddAttributeType(privateKey, CKA_BASE,
  ------------------
  |  |  571|      0|#define CKA_BASE 0x00000132UL
  ------------------
 5733|      0|                                        sftk_item_expand(&pqgParam.base));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5734|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5734:17): [True: 0, False: 0]
  ------------------
 5735|      0|                SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5736|      0|                SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5737|      0|                SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5738|      0|                break;
 5739|      0|            }
 5740|       |
 5741|       |            /*
 5742|       |             * these are checked by DSA_NewKey
 5743|       |             */
 5744|      0|            bitSize = sftk_GetLengthInBits(pqgParam.subPrime.data,
 5745|      0|                                           pqgParam.subPrime.len);
 5746|      0|            if ((bitSize < DSA_MIN_Q_BITS) || (bitSize > DSA_MAX_Q_BITS)) {
  ------------------
  |  |  200|      0|#define DSA_MIN_Q_BITS 160
  ------------------
                          if ((bitSize < DSA_MIN_Q_BITS) || (bitSize > DSA_MAX_Q_BITS)) {
  ------------------
  |  |  199|      0|#define DSA_MAX_Q_BITS 256
  ------------------
  |  Branch (5746:17): [True: 0, False: 0]
  |  Branch (5746:47): [True: 0, False: 0]
  ------------------
 5747|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 5748|      0|                SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5749|      0|                SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5750|      0|                SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5751|      0|                break;
 5752|      0|            }
 5753|      0|            bitSize = sftk_GetLengthInBits(pqgParam.prime.data, pqgParam.prime.len);
 5754|      0|            if ((bitSize < DSA_MIN_P_BITS) || (bitSize > DSA_MAX_P_BITS)) {
  ------------------
  |  |  198|      0|#define DSA_MIN_P_BITS 512
  ------------------
                          if ((bitSize < DSA_MIN_P_BITS) || (bitSize > DSA_MAX_P_BITS)) {
  ------------------
  |  |  197|      0|#define DSA_MAX_P_BITS 3072
  ------------------
  |  Branch (5754:17): [True: 0, False: 0]
  |  Branch (5754:47): [True: 0, False: 0]
  ------------------
 5755|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 5756|      0|                SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5757|      0|                SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5758|      0|                SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5759|      0|                break;
 5760|      0|            }
 5761|      0|            bitSize = sftk_GetLengthInBits(pqgParam.base.data, pqgParam.base.len);
 5762|      0|            if ((bitSize < 2) || (bitSize > DSA_MAX_P_BITS)) {
  ------------------
  |  |  197|      0|#define DSA_MAX_P_BITS 3072
  ------------------
  |  Branch (5762:17): [True: 0, False: 0]
  |  Branch (5762:34): [True: 0, False: 0]
  ------------------
 5763|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 5764|      0|                SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5765|      0|                SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5766|      0|                SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5767|      0|                break;
 5768|      0|            }
 5769|       |
 5770|       |            /* Generate the key */
 5771|      0|            rv = DSA_NewKey(&pqgParam, &dsaPriv);
 5772|       |
 5773|      0|            SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&pqgParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5774|      0|            SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&pqgParam.subPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5775|      0|            SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&pqgParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5776|       |
 5777|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5777:17): [True: 0, False: 0]
  ------------------
 5778|      0|                if (PORT_GetError() == SEC_ERROR_LIBRARY_FAILURE) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (5778:21): [True: 0, False: 0]
  ------------------
 5779|      0|                    sftk_fatalError = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5780|      0|                }
 5781|      0|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 5782|      0|                break;
 5783|      0|            }
 5784|       |
 5785|       |            /* store the generated key into the attributes */
 5786|      0|            crv = sftk_AddAttributeType(publicKey, CKA_VALUE,
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 5787|      0|                                        sftk_item_expand(&dsaPriv->publicValue));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5788|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5788:17): [True: 0, False: 0]
  ------------------
 5789|      0|                goto dsagn_done;
 5790|       |
 5791|       |            /* now fill in the RSA dependent paramenters in the private key */
 5792|      0|            crv = sftk_AddAttributeType(privateKey, CKA_NSS_DB,
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5793|      0|                                        sftk_item_expand(&dsaPriv->publicValue));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5794|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5794:17): [True: 0, False: 0]
  ------------------
 5795|      0|                goto dsagn_done;
 5796|      0|            crv = sftk_AddAttributeType(privateKey, CKA_VALUE,
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 5797|      0|                                        sftk_item_expand(&dsaPriv->privateValue));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5798|       |
 5799|      0|        dsagn_done:
 5800|       |            /* should zeroize, since this function doesn't. */
 5801|      0|            PORT_FreeArena(dsaPriv->params.arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(dsaPriv->params.arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5802|      0|            break;
 5803|       |
 5804|  1.91k|        case CKM_DH_PKCS_KEY_PAIR_GEN:
  ------------------
  |  |  758|  1.91k|#define CKM_DH_PKCS_KEY_PAIR_GEN 0x00000020UL
  ------------------
  |  Branch (5804:9): [True: 1.91k, False: 7.96k]
  ------------------
 5805|  1.91k|            sftk_DeleteAttributeType(privateKey, CKA_PRIME);
  ------------------
  |  |  569|  1.91k|#define CKA_PRIME 0x00000130UL
  ------------------
 5806|  1.91k|            sftk_DeleteAttributeType(privateKey, CKA_BASE);
  ------------------
  |  |  571|  1.91k|#define CKA_BASE 0x00000132UL
  ------------------
 5807|  1.91k|            sftk_DeleteAttributeType(privateKey, CKA_VALUE);
  ------------------
  |  |  516|  1.91k|#define CKA_VALUE 0x00000011UL
  ------------------
 5808|  1.91k|            sftk_DeleteAttributeType(privateKey, CKA_NSS_DB);
  ------------------
  |  |  150|  1.91k|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5809|  1.91k|            key_type = CKK_DH;
  ------------------
  |  |  374|  1.91k|#define CKK_DH 0x00000002UL
  ------------------
 5810|       |
 5811|       |            /* extract the necessary parameters and copy them to private keys */
 5812|  1.91k|            crv = sftk_Attribute2SSecItem(NULL, &dhParam.prime, publicKey,
 5813|  1.91k|                                          CKA_PRIME);
  ------------------
  |  |  569|  1.91k|#define CKA_PRIME 0x00000130UL
  ------------------
 5814|  1.91k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5814:17): [True: 0, False: 1.91k]
  ------------------
 5815|      0|                break;
 5816|  1.91k|            crv = sftk_Attribute2SSecItem(NULL, &dhParam.base, publicKey, CKA_BASE);
  ------------------
  |  |  571|  1.91k|#define CKA_BASE 0x00000132UL
  ------------------
 5817|  1.91k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5817:17): [True: 0, False: 1.91k]
  ------------------
 5818|      0|                SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5819|      0|                break;
 5820|      0|            }
 5821|  1.91k|            crv = sftk_AddAttributeType(privateKey, CKA_PRIME,
  ------------------
  |  |  569|  1.91k|#define CKA_PRIME 0x00000130UL
  ------------------
 5822|  1.91k|                                        sftk_item_expand(&dhParam.prime));
  ------------------
  |  |  588|  1.91k|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5823|  1.91k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5823:17): [True: 0, False: 1.91k]
  ------------------
 5824|      0|                SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5825|      0|                SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5826|      0|                break;
 5827|      0|            }
 5828|  1.91k|            crv = sftk_AddAttributeType(privateKey, CKA_BASE,
  ------------------
  |  |  571|  1.91k|#define CKA_BASE 0x00000132UL
  ------------------
 5829|  1.91k|                                        sftk_item_expand(&dhParam.base));
  ------------------
  |  |  588|  1.91k|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5830|  1.91k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5830:17): [True: 0, False: 1.91k]
  ------------------
 5831|      0|                SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5832|      0|                SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5833|      0|                break;
 5834|      0|            }
 5835|  1.91k|            bitSize = sftk_GetLengthInBits(dhParam.prime.data, dhParam.prime.len);
 5836|  1.91k|            if ((bitSize < DH_MIN_P_BITS) || (bitSize > DH_MAX_P_BITS)) {
  ------------------
  |  |  154|  1.91k|#define DH_MIN_P_BITS 128
  ------------------
                          if ((bitSize < DH_MIN_P_BITS) || (bitSize > DH_MAX_P_BITS)) {
  ------------------
  |  |  155|  1.91k|#define DH_MAX_P_BITS 16384
  ------------------
  |  Branch (5836:17): [True: 0, False: 1.91k]
  |  Branch (5836:46): [True: 0, False: 1.91k]
  ------------------
 5837|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 5838|      0|                SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5839|      0|                SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5840|      0|                break;
 5841|      0|            }
 5842|  1.91k|            bitSize = sftk_GetLengthInBits(dhParam.base.data, dhParam.base.len);
 5843|  1.91k|            if ((bitSize < 1) || (bitSize > DH_MAX_P_BITS)) {
  ------------------
  |  |  155|  1.91k|#define DH_MAX_P_BITS 16384
  ------------------
  |  Branch (5843:17): [True: 0, False: 1.91k]
  |  Branch (5843:34): [True: 0, False: 1.91k]
  ------------------
 5844|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 5845|      0|                SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5846|      0|                SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5847|      0|                break;
 5848|      0|            }
 5849|       |
 5850|  1.91k|            rv = DH_NewKey(&dhParam, &dhPriv);
 5851|  1.91k|            SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  110|  1.91k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&dhParam.prime, PR_FALSE);
  ------------------
  |  |  438|  1.91k|#define PR_FALSE 0
  ------------------
 5852|  1.91k|            SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  110|  1.91k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&dhParam.base, PR_FALSE);
  ------------------
  |  |  438|  1.91k|#define PR_FALSE 0
  ------------------
 5853|  1.91k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5853:17): [True: 0, False: 1.91k]
  ------------------
 5854|      0|                if (PORT_GetError() == SEC_ERROR_LIBRARY_FAILURE) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (5854:21): [True: 0, False: 0]
  ------------------
 5855|      0|                    sftk_fatalError = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5856|      0|                }
 5857|      0|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 5858|      0|                break;
 5859|      0|            }
 5860|       |
 5861|  1.91k|            crv = sftk_AddAttributeType(publicKey, CKA_VALUE,
  ------------------
  |  |  516|  1.91k|#define CKA_VALUE 0x00000011UL
  ------------------
 5862|  1.91k|                                        sftk_item_expand(&dhPriv->publicValue));
  ------------------
  |  |  588|  1.91k|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5863|  1.91k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5863:17): [True: 0, False: 1.91k]
  ------------------
 5864|      0|                goto dhgn_done;
 5865|       |
 5866|  1.91k|            crv = sftk_AddAttributeType(privateKey, CKA_NSS_DB,
  ------------------
  |  |  150|  1.91k|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5867|  1.91k|                                        sftk_item_expand(&dhPriv->publicValue));
  ------------------
  |  |  588|  1.91k|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5868|  1.91k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5868:17): [True: 0, False: 1.91k]
  ------------------
 5869|      0|                goto dhgn_done;
 5870|       |
 5871|  1.91k|            crv = sftk_AddAttributeType(privateKey, CKA_VALUE,
  ------------------
  |  |  516|  1.91k|#define CKA_VALUE 0x00000011UL
  ------------------
 5872|  1.91k|                                        sftk_item_expand(&dhPriv->privateValue));
  ------------------
  |  |  588|  1.91k|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5873|       |
 5874|  1.91k|        dhgn_done:
 5875|       |            /* should zeroize, since this function doesn't. */
 5876|  1.91k|            PORT_FreeArena(dhPriv->arena, PR_TRUE);
  ------------------
  |  |   61|  1.91k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(dhPriv->arena, PR_TRUE);
  ------------------
  |  |  437|  1.91k|#define PR_TRUE 1
  ------------------
 5877|  1.91k|            break;
 5878|       |
 5879|      0|        case CKM_EC_KEY_PAIR_GEN:
  ------------------
  |  | 1072|      0|#define CKM_EC_KEY_PAIR_GEN 0x00001040UL
  ------------------
  |  Branch (5879:9): [True: 0, False: 9.87k]
  ------------------
 5880|  7.96k|        case CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN:
  ------------------
  |  |  274|  7.96k|#define CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN (CKM_NSS + 47)
  |  |  ------------------
  |  |  |  |  162|  7.96k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  7.96k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  7.96k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5880:9): [True: 7.96k, False: 1.91k]
  ------------------
 5881|  7.96k|            sftk_DeleteAttributeType(privateKey, CKA_EC_PARAMS);
  ------------------
  |  |  602|  7.96k|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
 5882|  7.96k|            sftk_DeleteAttributeType(privateKey, CKA_VALUE);
  ------------------
  |  |  516|  7.96k|#define CKA_VALUE 0x00000011UL
  ------------------
 5883|  7.96k|            sftk_DeleteAttributeType(privateKey, CKA_NSS_DB);
  ------------------
  |  |  150|  7.96k|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5884|  7.96k|            key_type = CKK_EC;
  ------------------
  |  |  379|  7.96k|#define CKK_EC 0x00000003UL
  ------------------
 5885|       |
 5886|       |            /* extract the necessary parameters and copy them to private keys */
 5887|  7.96k|            crv = sftk_Attribute2SSecItem(NULL, &ecEncodedParams, publicKey,
 5888|  7.96k|                                          CKA_EC_PARAMS);
  ------------------
  |  |  602|  7.96k|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
 5889|  7.96k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  7.96k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5889:17): [True: 0, False: 7.96k]
  ------------------
 5890|      0|                break;
 5891|       |
 5892|  7.96k|            crv = sftk_AddAttributeType(privateKey, CKA_EC_PARAMS,
  ------------------
  |  |  602|  7.96k|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
 5893|  7.96k|                                        sftk_item_expand(&ecEncodedParams));
  ------------------
  |  |  588|  7.96k|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5894|  7.96k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  7.96k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5894:17): [True: 0, False: 7.96k]
  ------------------
 5895|      0|                SECITEM_ZfreeItem(&ecEncodedParams, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&ecEncodedParams, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5896|      0|                break;
 5897|      0|            }
 5898|       |
 5899|       |            /* Decode ec params before calling EC_NewKey */
 5900|  7.96k|            rv = EC_DecodeParams(&ecEncodedParams, &ecParams);
 5901|  7.96k|            SECITEM_ZfreeItem(&ecEncodedParams, PR_FALSE);
  ------------------
  |  |  110|  7.96k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&ecEncodedParams, PR_FALSE);
  ------------------
  |  |  438|  7.96k|#define PR_FALSE 0
  ------------------
 5902|  7.96k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5902:17): [True: 64, False: 7.90k]
  ------------------
 5903|     64|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|     64|#define PORT_GetError PORT_GetError_Util
  ------------------
 5904|     64|                break;
 5905|     64|            }
 5906|  7.90k|            rv = EC_NewKey(ecParams, &ecPriv);
 5907|  7.90k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5907:17): [True: 0, False: 7.90k]
  ------------------
 5908|      0|                if (PORT_GetError() == SEC_ERROR_LIBRARY_FAILURE) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (5908:21): [True: 0, False: 0]
  ------------------
 5909|      0|                    sftk_fatalError = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5910|      0|                }
 5911|      0|                PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                              PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5912|      0|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 5913|      0|                break;
 5914|      0|            }
 5915|       |
 5916|  7.90k|            if (PR_GetEnvSecure("NSS_USE_DECODED_CKA_EC_POINT") ||
  ------------------
  |  Branch (5916:17): [True: 0, False: 7.90k]
  ------------------
 5917|  7.90k|                ecParams->type != ec_params_named) {
  ------------------
  |  Branch (5917:17): [True: 7.55k, False: 346]
  ------------------
 5918|  7.55k|                PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |   61|  7.55k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                              PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |  437|  7.55k|#define PR_TRUE 1
  ------------------
 5919|  7.55k|                crv = sftk_AddAttributeType(publicKey, CKA_EC_POINT,
  ------------------
  |  |  604|  7.55k|#define CKA_EC_POINT 0x00000181UL
  ------------------
 5920|  7.55k|                                            sftk_item_expand(&ecPriv->publicValue));
  ------------------
  |  |  588|  7.55k|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5921|  7.55k|            } else {
 5922|    346|                PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |   61|    346|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                              PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |  437|    346|#define PR_TRUE 1
  ------------------
 5923|    346|                SECItem *pubValue = SEC_ASN1EncodeItem(NULL, NULL,
  ------------------
  |  |   89|    346|#define SEC_ASN1EncodeItem SEC_ASN1EncodeItem_Util
  ------------------
 5924|    346|                                                       &ecPriv->publicValue,
 5925|    346|                                                       SEC_ASN1_GET(SEC_OctetStringTemplate));
  ------------------
  |  |  188|    346|#define SEC_ASN1_GET(x) x
  ------------------
 5926|    346|                if (!pubValue) {
  ------------------
  |  Branch (5926:21): [True: 0, False: 346]
  ------------------
 5927|      0|                    crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 5928|      0|                    goto ecgn_done;
 5929|      0|                }
 5930|    346|                crv = sftk_AddAttributeType(publicKey, CKA_EC_POINT,
  ------------------
  |  |  604|    346|#define CKA_EC_POINT 0x00000181UL
  ------------------
 5931|    346|                                            sftk_item_expand(pubValue));
  ------------------
  |  |  588|    346|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5932|    346|                SECITEM_ZfreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  110|    346|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(pubValue, PR_TRUE);
  ------------------
  |  |  437|    346|#define PR_TRUE 1
  ------------------
 5933|    346|            }
 5934|  7.90k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  7.90k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5934:17): [True: 0, False: 7.90k]
  ------------------
 5935|      0|                goto ecgn_done;
 5936|       |
 5937|  7.90k|            crv = sftk_AddAttributeType(privateKey, CKA_VALUE,
  ------------------
  |  |  516|  7.90k|#define CKA_VALUE 0x00000011UL
  ------------------
 5938|  7.90k|                                        sftk_item_expand(&ecPriv->privateValue));
  ------------------
  |  |  588|  7.90k|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5939|  7.90k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  7.90k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5939:17): [True: 0, False: 7.90k]
  ------------------
 5940|      0|                goto ecgn_done;
 5941|       |
 5942|  7.90k|            crv = sftk_AddAttributeType(privateKey, CKA_NSS_DB,
  ------------------
  |  |  150|  7.90k|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5943|  7.90k|                                        sftk_item_expand(&ecPriv->publicValue));
  ------------------
  |  |  588|  7.90k|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5944|  7.90k|        ecgn_done:
 5945|       |            /* should zeroize, since this function doesn't. */
 5946|  7.90k|            PORT_FreeArena(ecPriv->ecParams.arena, PR_TRUE);
  ------------------
  |  |   61|  7.90k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(ecPriv->ecParams.arena, PR_TRUE);
  ------------------
  |  |  437|  7.90k|#define PR_TRUE 1
  ------------------
 5947|  7.90k|            break;
 5948|       |
 5949|      0|        case CKM_NSS_KYBER_KEY_PAIR_GEN:
  ------------------
  |  |  267|      0|#define CKM_NSS_KYBER_KEY_PAIR_GEN (CKM_NSS + 45)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5949:9): [True: 0, False: 9.87k]
  ------------------
 5950|      0|        case CKM_NSS_ML_KEM_KEY_PAIR_GEN:
  ------------------
  |  |  277|      0|#define CKM_NSS_ML_KEM_KEY_PAIR_GEN (CKM_NSS + 48)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5950:9): [True: 0, False: 9.87k]
  ------------------
 5951|      0|            sftk_DeleteAttributeType(privateKey, CKA_NSS_DB);
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5952|      0|            key_type = CKK_NSS_KYBER;
  ------------------
  |  |   58|      0|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|      0|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|      0|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5953|       |
 5954|      0|            SECItem privKey = { siBuffer, NULL, 0 };
 5955|      0|            SECItem pubKey = { siBuffer, NULL, 0 };
 5956|      0|            KyberParams kyberParams = sftk_kyber_PK11ParamToInternal(ckKyberParamSet);
 5957|      0|            if (!sftk_kyber_AllocPrivKeyItem(kyberParams, &privKey)) {
  ------------------
  |  Branch (5957:17): [True: 0, False: 0]
  ------------------
 5958|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5959|      0|                goto kyber_done;
 5960|      0|            }
 5961|      0|            if (!sftk_kyber_AllocPubKeyItem(kyberParams, &pubKey)) {
  ------------------
  |  Branch (5961:17): [True: 0, False: 0]
  ------------------
 5962|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5963|      0|                goto kyber_done;
 5964|      0|            }
 5965|      0|            rv = Kyber_NewKey(kyberParams, NULL, &privKey, &pubKey);
 5966|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5966:17): [True: 0, False: 0]
  ------------------
 5967|      0|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 5968|      0|                goto kyber_done;
 5969|      0|            }
 5970|       |
 5971|      0|            crv = sftk_AddAttributeType(publicKey, CKA_VALUE, sftk_item_expand(&pubKey));
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
                          crv = sftk_AddAttributeType(publicKey, CKA_VALUE, sftk_item_expand(&pubKey));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5972|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5972:17): [True: 0, False: 0]
  ------------------
 5973|      0|                goto kyber_done;
 5974|      0|            }
 5975|      0|            crv = sftk_AddAttributeType(publicKey, CKA_NSS_PARAMETER_SET,
  ------------------
  |  |  113|      0|#define CKA_NSS_PARAMETER_SET (CKA_NSS + 40)
  |  |  ------------------
  |  |  |  |   77|      0|#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  692|      0|#define CKA_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5976|      0|                                        &ckKyberParamSet, sizeof(CK_NSS_KEM_PARAMETER_SET_TYPE));
 5977|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5977:17): [True: 0, False: 0]
  ------------------
 5978|      0|                goto kyber_done;
 5979|      0|            }
 5980|      0|            crv = sftk_AddAttributeType(privateKey, CKA_VALUE,
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 5981|      0|                                        sftk_item_expand(&privKey));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5982|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5982:17): [True: 0, False: 0]
  ------------------
 5983|      0|                goto kyber_done;
 5984|      0|            }
 5985|      0|            crv = sftk_AddAttributeType(privateKey, CKA_NSS_PARAMETER_SET,
  ------------------
  |  |  113|      0|#define CKA_NSS_PARAMETER_SET (CKA_NSS + 40)
  |  |  ------------------
  |  |  |  |   77|      0|#define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  692|      0|#define CKA_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKA_NSS (CKA_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5986|      0|                                        &ckKyberParamSet, sizeof(CK_NSS_KEM_PARAMETER_SET_TYPE));
 5987|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5987:17): [True: 0, False: 0]
  ------------------
 5988|      0|                goto kyber_done;
 5989|      0|            }
 5990|      0|            crv = sftk_AddAttributeType(privateKey, CKA_NSS_DB,
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 5991|      0|                                        sftk_item_expand(&pubKey));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 5992|      0|        kyber_done:
 5993|      0|            SECITEM_ZfreeItem(&privKey, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&privKey, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5994|      0|            SECITEM_FreeItem(&pubKey, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                          SECITEM_FreeItem(&pubKey, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5995|      0|            break;
 5996|       |
 5997|      0|        case CKM_EC_MONTGOMERY_KEY_PAIR_GEN:
  ------------------
  |  | 1173|      0|#define CKM_EC_MONTGOMERY_KEY_PAIR_GEN 0x00001056UL
  ------------------
  |  Branch (5997:9): [True: 0, False: 9.87k]
  ------------------
 5998|      0|        case CKM_EC_EDWARDS_KEY_PAIR_GEN:
  ------------------
  |  | 1172|      0|#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL
  ------------------
  |  Branch (5998:9): [True: 0, False: 9.87k]
  ------------------
 5999|      0|            sftk_DeleteAttributeType(privateKey, CKA_EC_PARAMS);
  ------------------
  |  |  602|      0|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
 6000|      0|            sftk_DeleteAttributeType(privateKey, CKA_VALUE);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 6001|      0|            sftk_DeleteAttributeType(privateKey, CKA_NSS_DB);
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 6002|      0|            key_type = (pMechanism->mechanism == CKM_EC_EDWARDS_KEY_PAIR_GEN) ? CKK_EC_EDWARDS : CKK_EC_MONTGOMERY;
  ------------------
  |  | 1172|      0|#define CKM_EC_EDWARDS_KEY_PAIR_GEN 0x00001055UL
  ------------------
                          key_type = (pMechanism->mechanism == CKM_EC_EDWARDS_KEY_PAIR_GEN) ? CKK_EC_EDWARDS : CKK_EC_MONTGOMERY;
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
                          key_type = (pMechanism->mechanism == CKM_EC_EDWARDS_KEY_PAIR_GEN) ? CKK_EC_EDWARDS : CKK_EC_MONTGOMERY;
  ------------------
  |  |  449|      0|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (6002:24): [True: 0, False: 0]
  ------------------
 6003|       |
 6004|       |            /* extract the necessary parameters and copy them to private keys */
 6005|      0|            crv = sftk_Attribute2SSecItem(NULL, &ecEncodedParams, publicKey,
 6006|      0|                                          CKA_EC_PARAMS);
  ------------------
  |  |  602|      0|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
 6007|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6007:17): [True: 0, False: 0]
  ------------------
 6008|      0|                break;
 6009|      0|            }
 6010|       |
 6011|      0|            crv = sftk_AddAttributeType(privateKey, CKA_EC_PARAMS,
  ------------------
  |  |  602|      0|#define CKA_EC_PARAMS 0x00000180UL
  ------------------
 6012|      0|                                        sftk_item_expand(&ecEncodedParams));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 6013|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6013:17): [True: 0, False: 0]
  ------------------
 6014|      0|                SECITEM_ZfreeItem(&ecEncodedParams, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&ecEncodedParams, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 6015|      0|                break;
 6016|      0|            }
 6017|       |
 6018|       |            /* Decode ec params before calling EC_NewKey */
 6019|      0|            rv = EC_DecodeParams(&ecEncodedParams, &ecParams);
 6020|      0|            SECITEM_ZfreeItem(&ecEncodedParams, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&ecEncodedParams, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 6021|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (6021:17): [True: 0, False: 0]
  ------------------
 6022|      0|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 6023|      0|                break;
 6024|      0|            }
 6025|       |
 6026|      0|            rv = EC_NewKey(ecParams, &ecPriv);
 6027|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (6027:17): [True: 0, False: 0]
  ------------------
 6028|      0|                if (PORT_GetError() == SEC_ERROR_LIBRARY_FAILURE) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (6028:21): [True: 0, False: 0]
  ------------------
 6029|      0|                    sftk_fatalError = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 6030|      0|                }
 6031|      0|                PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                              PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 6032|      0|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 6033|      0|                break;
 6034|      0|            }
 6035|      0|            PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(ecParams->arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 6036|      0|            crv = sftk_AddAttributeType(publicKey, CKA_EC_POINT,
  ------------------
  |  |  604|      0|#define CKA_EC_POINT 0x00000181UL
  ------------------
 6037|      0|                                        sftk_item_expand(&ecPriv->publicValue));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 6038|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6038:17): [True: 0, False: 0]
  ------------------
 6039|      0|                goto edgn_done;
 6040|       |
 6041|      0|            crv = sftk_AddAttributeType(privateKey, CKA_VALUE,
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 6042|      0|                                        sftk_item_expand(&ecPriv->privateValue));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 6043|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6043:17): [True: 0, False: 0]
  ------------------
 6044|      0|                goto edgn_done;
 6045|       |
 6046|      0|            crv = sftk_AddAttributeType(privateKey, CKA_NSS_DB,
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
 6047|      0|                                        sftk_item_expand(&ecPriv->publicValue));
  ------------------
  |  |  588|      0|#define sftk_item_expand(ip) (ip)->data, (ip)->len
  ------------------
 6048|      0|        edgn_done:
 6049|       |            /* should zeroize, since this function doesn't. */
 6050|      0|            PORT_FreeArena(ecPriv->ecParams.arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(ecPriv->ecParams.arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 6051|      0|            break;
 6052|       |
 6053|      0|        default:
  ------------------
  |  Branch (6053:9): [True: 0, False: 9.87k]
  ------------------
 6054|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 6055|  9.87k|    }
 6056|       |
 6057|  9.87k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.87k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6057:9): [True: 64, False: 9.81k]
  ------------------
 6058|     64|        sftk_FreeObject(privateKey);
 6059|     64|        sftk_FreeObject(publicKey);
 6060|     64|        return crv;
 6061|     64|    }
 6062|       |
 6063|       |    /* Add the class, key_type The loop lets us check errors blow out
 6064|       |     *  on errors and clean up at the bottom */
 6065|  9.81k|    session = NULL; /* make pedtantic happy... session cannot leave the*/
 6066|       |                    /* loop below NULL unless an error is set... */
 6067|  9.81k|    do {
 6068|  9.81k|        crv = sftk_AddAttributeType(privateKey, CKA_CLASS, &privClass,
  ------------------
  |  |  511|  9.81k|#define CKA_CLASS 0x00000000UL
  ------------------
 6069|  9.81k|                                    sizeof(CK_OBJECT_CLASS));
 6070|  9.81k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6070:13): [True: 0, False: 9.81k]
  ------------------
 6071|      0|            break;
 6072|  9.81k|        crv = sftk_AddAttributeType(publicKey, CKA_CLASS, &pubClass,
  ------------------
  |  |  511|  9.81k|#define CKA_CLASS 0x00000000UL
  ------------------
 6073|  9.81k|                                    sizeof(CK_OBJECT_CLASS));
 6074|  9.81k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6074:13): [True: 0, False: 9.81k]
  ------------------
 6075|      0|            break;
 6076|  9.81k|        crv = sftk_AddAttributeType(privateKey, CKA_KEY_TYPE, &key_type,
  ------------------
  |  |  543|  9.81k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 6077|  9.81k|                                    sizeof(CK_KEY_TYPE));
 6078|  9.81k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6078:13): [True: 0, False: 9.81k]
  ------------------
 6079|      0|            break;
 6080|  9.81k|        crv = sftk_AddAttributeType(publicKey, CKA_KEY_TYPE, &key_type,
  ------------------
  |  |  543|  9.81k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 6081|  9.81k|                                    sizeof(CK_KEY_TYPE));
 6082|  9.81k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6082:13): [True: 0, False: 9.81k]
  ------------------
 6083|      0|            break;
 6084|  9.81k|        session = sftk_SessionFromHandle(hSession);
 6085|  9.81k|        if (session == NULL)
  ------------------
  |  Branch (6085:13): [True: 0, False: 9.81k]
  ------------------
 6086|      0|            crv = CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 6087|  9.81k|    } while (0);
  ------------------
  |  Branch (6087:14): [Folded - Ignored]
  ------------------
 6088|       |
 6089|  9.81k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6089:9): [True: 0, False: 9.81k]
  ------------------
 6090|      0|        sftk_FreeObject(privateKey);
 6091|      0|        sftk_FreeObject(publicKey);
 6092|      0|        return crv;
 6093|      0|    }
 6094|       |
 6095|       |    /*
 6096|       |     * handle the base object cleanup for the public Key
 6097|       |     */
 6098|  9.81k|    crv = sftk_handleObject(privateKey, session);
 6099|  9.81k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6099:9): [True: 0, False: 9.81k]
  ------------------
 6100|      0|        sftk_FreeSession(session);
 6101|      0|        sftk_FreeObject(privateKey);
 6102|      0|        sftk_FreeObject(publicKey);
 6103|      0|        return crv;
 6104|      0|    }
 6105|       |
 6106|       |    /*
 6107|       |     * handle the base object cleanup for the private Key
 6108|       |     * If we have any problems, we destroy the public Key we've
 6109|       |     * created and linked.
 6110|       |     */
 6111|  9.81k|    crv = sftk_handleObject(publicKey, session);
 6112|  9.81k|    sftk_FreeSession(session);
 6113|  9.81k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6113:9): [True: 0, False: 9.81k]
  ------------------
 6114|      0|        sftk_FreeObject(publicKey);
 6115|      0|        NSC_DestroyObject(hSession, privateKey->handle);
 6116|      0|        sftk_FreeObject(privateKey);
 6117|      0|        return crv;
 6118|      0|    }
 6119|  9.81k|    if (sftk_isTrue(privateKey, CKA_SENSITIVE)) {
  ------------------
  |  |  546|  9.81k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
  |  Branch (6119:9): [True: 308, False: 9.50k]
  ------------------
 6120|    308|        crv = sftk_forceAttribute(privateKey, CKA_ALWAYS_SENSITIVE,
  ------------------
  |  |  588|    308|#define CKA_ALWAYS_SENSITIVE 0x00000165UL
  ------------------
 6121|    308|                                  &cktrue, sizeof(CK_BBOOL));
 6122|    308|    }
 6123|  9.81k|    if (crv == CKR_OK && sftk_isTrue(publicKey, CKA_SENSITIVE)) {
  ------------------
  |  | 1388|  19.6k|#define CKR_OK 0x00000000UL
  ------------------
                  if (crv == CKR_OK && sftk_isTrue(publicKey, CKA_SENSITIVE)) {
  ------------------
  |  |  546|  9.81k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
  |  Branch (6123:9): [True: 9.81k, False: 0]
  |  Branch (6123:26): [True: 0, False: 9.81k]
  ------------------
 6124|      0|        crv = sftk_forceAttribute(publicKey, CKA_ALWAYS_SENSITIVE,
  ------------------
  |  |  588|      0|#define CKA_ALWAYS_SENSITIVE 0x00000165UL
  ------------------
 6125|      0|                                  &cktrue, sizeof(CK_BBOOL));
 6126|      0|    }
 6127|  9.81k|    if (crv == CKR_OK && !sftk_isTrue(privateKey, CKA_EXTRACTABLE)) {
  ------------------
  |  | 1388|  19.6k|#define CKR_OK 0x00000000UL
  ------------------
                  if (crv == CKR_OK && !sftk_isTrue(privateKey, CKA_EXTRACTABLE)) {
  ------------------
  |  |  585|  9.81k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
  |  Branch (6127:9): [True: 9.81k, False: 0]
  |  Branch (6127:26): [True: 0, False: 9.81k]
  ------------------
 6128|      0|        crv = sftk_forceAttribute(privateKey, CKA_NEVER_EXTRACTABLE,
  ------------------
  |  |  587|      0|#define CKA_NEVER_EXTRACTABLE 0x00000164UL
  ------------------
 6129|      0|                                  &cktrue, sizeof(CK_BBOOL));
 6130|      0|    }
 6131|  9.81k|    if (crv == CKR_OK && !sftk_isTrue(publicKey, CKA_EXTRACTABLE)) {
  ------------------
  |  | 1388|  19.6k|#define CKR_OK 0x00000000UL
  ------------------
                  if (crv == CKR_OK && !sftk_isTrue(publicKey, CKA_EXTRACTABLE)) {
  ------------------
  |  |  585|  9.81k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
  |  Branch (6131:9): [True: 9.81k, False: 0]
  |  Branch (6131:26): [True: 9.81k, False: 0]
  ------------------
 6132|  9.81k|        crv = sftk_forceAttribute(publicKey, CKA_NEVER_EXTRACTABLE,
  ------------------
  |  |  587|  9.81k|#define CKA_NEVER_EXTRACTABLE 0x00000164UL
  ------------------
 6133|  9.81k|                                  &cktrue, sizeof(CK_BBOOL));
 6134|  9.81k|    }
 6135|       |
 6136|  9.81k|    if (crv == CKR_OK && pMechanism->mechanism != CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN && key_type != CKK_NSS_KYBER) {
  ------------------
  |  | 1388|  19.6k|#define CKR_OK 0x00000000UL
  ------------------
                  if (crv == CKR_OK && pMechanism->mechanism != CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN && key_type != CKK_NSS_KYBER) {
  ------------------
  |  |  274|  19.6k|#define CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN (CKM_NSS + 47)
  |  |  ------------------
  |  |  |  |  162|  9.81k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  9.81k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  9.81k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (crv == CKR_OK && pMechanism->mechanism != CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN && key_type != CKK_NSS_KYBER) {
  ------------------
  |  |   58|  1.91k|#define CKK_NSS_KYBER (CKK_NSS + 5)
  |  |  ------------------
  |  |  |  |   49|  1.91k|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|  1.91k|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.91k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6136:9): [True: 9.81k, False: 0]
  |  Branch (6136:26): [True: 1.91k, False: 7.90k]
  |  Branch (6136:99): [True: 1.91k, False: 0]
  ------------------
 6137|       |        /* Perform FIPS 140-2 pairwise consistency check. */
 6138|  1.91k|        crv = sftk_PairwiseConsistencyCheck(hSession, slot,
 6139|  1.91k|                                            publicKey, privateKey, key_type);
 6140|  1.91k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6140:13): [True: 616, False: 1.29k]
  ------------------
 6141|    616|            if (sftk_audit_enabled) {
  ------------------
  |  Branch (6141:17): [True: 0, False: 616]
  ------------------
 6142|      0|                char msg[128];
 6143|      0|                PR_snprintf(msg, sizeof msg,
 6144|      0|                            "C_GenerateKeyPair(hSession=0x%08lX, "
 6145|      0|                            "pMechanism->mechanism=0x%08lX)=0x%08lX "
 6146|      0|                            "self-test: pair-wise consistency test failed",
 6147|      0|                            (PRUint32)hSession, (PRUint32)pMechanism->mechanism,
 6148|      0|                            (PRUint32)crv);
 6149|      0|                sftk_LogAuditMessage(NSS_AUDIT_ERROR, NSS_AUDIT_SELF_TEST, msg);
 6150|      0|            }
 6151|    616|        }
 6152|  1.91k|    }
 6153|       |
 6154|  9.81k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  9.81k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6154:9): [True: 616, False: 9.19k]
  ------------------
 6155|    616|        NSC_DestroyObject(hSession, publicKey->handle);
 6156|    616|        sftk_FreeObject(publicKey);
 6157|    616|        NSC_DestroyObject(hSession, privateKey->handle);
 6158|    616|        sftk_FreeObject(privateKey);
 6159|    616|        return crv;
 6160|    616|    }
 6161|  9.19k|    *phPrivateKey = privateKey->handle;
 6162|  9.19k|    *phPublicKey = publicKey->handle;
 6163|  9.19k|    sftk_FreeObject(publicKey);
 6164|  9.19k|    sftk_FreeObject(privateKey);
 6165|       |
 6166|  9.19k|    return CKR_OK;
  ------------------
  |  | 1388|  9.19k|#define CKR_OK 0x00000000UL
  ------------------
 6167|  9.81k|}
NSC_WrapKey:
 6384|  1.17k|{
 6385|  1.17k|    SFTKSession *session;
 6386|  1.17k|    SFTKAttribute *attribute;
 6387|  1.17k|    SFTKObject *key;
 6388|  1.17k|    CK_RV crv;
 6389|       |
 6390|  1.17k|    CHECK_FORK();
 6391|       |
 6392|  1.17k|    session = sftk_SessionFromHandle(hSession);
 6393|  1.17k|    if (session == NULL) {
  ------------------
  |  Branch (6393:9): [True: 0, False: 1.17k]
  ------------------
 6394|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 6395|      0|    }
 6396|       |
 6397|  1.17k|    key = sftk_ObjectFromHandle(hKey, session);
 6398|  1.17k|    if (key == NULL) {
  ------------------
  |  Branch (6398:9): [True: 0, False: 1.17k]
  ------------------
 6399|      0|        sftk_FreeSession(session);
 6400|      0|        return CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 6401|      0|    }
 6402|       |
 6403|  1.17k|    switch (key->objclass) {
 6404|  1.17k|        case CKO_SECRET_KEY: {
  ------------------
  |  |  329|  1.17k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
  |  Branch (6404:9): [True: 1.17k, False: 0]
  ------------------
 6405|  1.17k|            SFTKSessionContext *context = NULL;
 6406|  1.17k|            SECItem pText;
 6407|       |
 6408|  1.17k|            attribute = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|  1.17k|#define CKA_VALUE 0x00000011UL
  ------------------
 6409|       |
 6410|  1.17k|            if (attribute == NULL) {
  ------------------
  |  Branch (6410:17): [True: 0, False: 1.17k]
  ------------------
 6411|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 6412|      0|                break;
 6413|      0|            }
 6414|  1.17k|            crv = sftk_CryptInit(hSession, pMechanism, hWrappingKey,
 6415|  1.17k|                                 CKA_WRAP, CKA_WRAP, SFTK_ENCRYPT, PR_TRUE);
  ------------------
  |  |  549|  1.17k|#define CKA_WRAP 0x00000106UL
  ------------------
                                               CKA_WRAP, CKA_WRAP, SFTK_ENCRYPT, PR_TRUE);
  ------------------
  |  |  549|  1.17k|#define CKA_WRAP 0x00000106UL
  ------------------
                                               CKA_WRAP, CKA_WRAP, SFTK_ENCRYPT, PR_TRUE);
  ------------------
  |  |  437|  1.17k|#define PR_TRUE 1
  ------------------
 6416|  1.17k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.17k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6416:17): [True: 8, False: 1.17k]
  ------------------
 6417|      8|                sftk_FreeAttribute(attribute);
 6418|      8|                break;
 6419|      8|            }
 6420|       |
 6421|  1.17k|            pText.type = siBuffer;
 6422|  1.17k|            pText.data = (unsigned char *)attribute->attrib.pValue;
 6423|  1.17k|            pText.len = attribute->attrib.ulValueLen;
 6424|       |
 6425|       |            /* Find out if this is a block cipher. */
 6426|  1.17k|            crv = sftk_GetContext(hSession, &context, SFTK_ENCRYPT, PR_FALSE, NULL);
  ------------------
  |  |  438|  1.17k|#define PR_FALSE 0
  ------------------
 6427|  1.17k|            if (crv != CKR_OK || !context)
  ------------------
  |  | 1388|  2.34k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6427:17): [True: 0, False: 1.17k]
  |  Branch (6427:34): [True: 0, False: 1.17k]
  ------------------
 6428|      0|                break;
 6429|  1.17k|            if (context->blockSize > 1) {
  ------------------
  |  Branch (6429:17): [True: 89, False: 1.08k]
  ------------------
 6430|     89|                unsigned int remainder = pText.len % context->blockSize;
 6431|     89|                if (!context->doPad && remainder) {
  ------------------
  |  Branch (6431:21): [True: 89, False: 0]
  |  Branch (6431:40): [True: 0, False: 89]
  ------------------
 6432|       |                    /* When wrapping secret keys with unpadded block ciphers,
 6433|       |                    ** the keys are zero padded, if necessary, to fill out
 6434|       |                    ** a full block.
 6435|       |                    */
 6436|      0|                    pText.len += context->blockSize - remainder;
 6437|      0|                    pText.data = PORT_ZAlloc(pText.len);
  ------------------
  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
 6438|      0|                    if (pText.data)
  ------------------
  |  Branch (6438:25): [True: 0, False: 0]
  ------------------
 6439|      0|                        memcpy(pText.data, attribute->attrib.pValue,
 6440|      0|                               attribute->attrib.ulValueLen);
 6441|      0|                    else {
 6442|      0|                        crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 6443|      0|                        break;
 6444|      0|                    }
 6445|      0|                }
 6446|     89|            }
 6447|       |
 6448|  1.17k|            crv = NSC_Encrypt(hSession, (CK_BYTE_PTR)pText.data,
 6449|  1.17k|                              pText.len, pWrappedKey, pulWrappedKeyLen);
 6450|       |            /* always force a finalize, both on errors and when
 6451|       |             * we are just getting the size */
 6452|  1.17k|            if (crv != CKR_OK || pWrappedKey == NULL) {
  ------------------
  |  | 1388|  2.34k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6452:17): [True: 0, False: 1.17k]
  |  Branch (6452:34): [True: 0, False: 1.17k]
  ------------------
 6453|      0|                CK_RV lcrv;
 6454|      0|                lcrv = sftk_GetContext(hSession, &context,
 6455|      0|                                       SFTK_ENCRYPT, PR_FALSE, NULL);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 6456|      0|                sftk_SetContextByType(session, SFTK_ENCRYPT, NULL);
 6457|      0|                if (lcrv == CKR_OK && context) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6457:21): [True: 0, False: 0]
  |  Branch (6457:39): [True: 0, False: 0]
  ------------------
 6458|      0|                    sftk_FreeContext(context);
 6459|      0|                }
 6460|      0|            }
 6461|       |
 6462|  1.17k|            if (pText.data != (unsigned char *)attribute->attrib.pValue)
  ------------------
  |  Branch (6462:17): [True: 0, False: 1.17k]
  ------------------
 6463|      0|                PORT_ZFree(pText.data, pText.len);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 6464|  1.17k|            sftk_FreeAttribute(attribute);
 6465|  1.17k|            break;
 6466|  1.17k|        }
 6467|       |
 6468|      0|        case CKO_PRIVATE_KEY: {
  ------------------
  |  |  328|      0|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
  |  Branch (6468:9): [True: 0, False: 1.17k]
  ------------------
 6469|      0|            SECItem *bpki = sftk_PackagePrivateKey(key, &crv);
 6470|      0|            SFTKSessionContext *context = NULL;
 6471|       |
 6472|      0|            if (!bpki) {
  ------------------
  |  Branch (6472:17): [True: 0, False: 0]
  ------------------
 6473|      0|                break;
 6474|      0|            }
 6475|       |
 6476|      0|            crv = sftk_CryptInit(hSession, pMechanism, hWrappingKey,
 6477|      0|                                 CKA_WRAP, CKA_WRAP, SFTK_ENCRYPT, PR_TRUE);
  ------------------
  |  |  549|      0|#define CKA_WRAP 0x00000106UL
  ------------------
                                               CKA_WRAP, CKA_WRAP, SFTK_ENCRYPT, PR_TRUE);
  ------------------
  |  |  549|      0|#define CKA_WRAP 0x00000106UL
  ------------------
                                               CKA_WRAP, CKA_WRAP, SFTK_ENCRYPT, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 6478|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6478:17): [True: 0, False: 0]
  ------------------
 6479|      0|                SECITEM_ZfreeItem(bpki, PR_TRUE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(bpki, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 6480|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 6481|      0|                break;
 6482|      0|            }
 6483|       |
 6484|      0|            crv = NSC_Encrypt(hSession, bpki->data, bpki->len,
 6485|      0|                              pWrappedKey, pulWrappedKeyLen);
 6486|       |            /* always force a finalize */
 6487|      0|            if (crv != CKR_OK || pWrappedKey == NULL) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6487:17): [True: 0, False: 0]
  |  Branch (6487:34): [True: 0, False: 0]
  ------------------
 6488|      0|                CK_RV lcrv;
 6489|      0|                lcrv = sftk_GetContext(hSession, &context,
 6490|      0|                                       SFTK_ENCRYPT, PR_FALSE, NULL);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 6491|      0|                sftk_SetContextByType(session, SFTK_ENCRYPT, NULL);
 6492|      0|                if (lcrv == CKR_OK && context) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6492:21): [True: 0, False: 0]
  |  Branch (6492:39): [True: 0, False: 0]
  ------------------
 6493|      0|                    sftk_FreeContext(context);
 6494|      0|                }
 6495|      0|            }
 6496|      0|            SECITEM_ZfreeItem(bpki, PR_TRUE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(bpki, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 6497|      0|            break;
 6498|      0|        }
 6499|       |
 6500|      0|        default:
  ------------------
  |  Branch (6500:9): [True: 0, False: 1.17k]
  ------------------
 6501|      0|            crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 6502|      0|            break;
 6503|  1.17k|    }
 6504|  1.17k|    sftk_FreeObject(key);
 6505|  1.17k|    sftk_FreeSession(session);
 6506|  1.17k|    return sftk_mapWrap(crv);
 6507|  1.17k|}
sftk_MapKeySize:
 7145|  10.5k|{
 7146|  10.5k|    switch (keyType) {
 7147|      0|        case CKK_CDMF:
  ------------------
  |  |  401|      0|#define CKK_CDMF 0x0000001EUL
  ------------------
  |  Branch (7147:9): [True: 0, False: 10.5k]
  ------------------
 7148|      0|            return 8;
 7149|    302|        case CKK_DES:
  ------------------
  |  |  386|    302|#define CKK_DES 0x00000013UL
  ------------------
  |  Branch (7149:9): [True: 302, False: 10.2k]
  ------------------
 7150|    302|            return 8;
 7151|      0|        case CKK_DES2:
  ------------------
  |  |  387|      0|#define CKK_DES2 0x00000014UL
  ------------------
  |  Branch (7151:9): [True: 0, False: 10.5k]
  ------------------
 7152|      0|            return 16;
 7153|  1.21k|        case CKK_DES3:
  ------------------
  |  |  388|  1.21k|#define CKK_DES3 0x00000015UL
  ------------------
  |  Branch (7153:9): [True: 1.21k, False: 9.31k]
  ------------------
 7154|  1.21k|            return 24;
 7155|       |        /* IDEA and CAST need to be added */
 7156|  9.00k|        default:
  ------------------
  |  Branch (7156:9): [True: 9.00k, False: 1.51k]
  ------------------
 7157|  9.00k|            break;
 7158|  10.5k|    }
 7159|  9.00k|    return 0;
 7160|  10.5k|}
sftk_HKDF:
 7318|  20.9k|{
 7319|  20.9k|    SFTKSession *session;
 7320|  20.9k|    SFTKAttribute *saltKey_att = NULL;
 7321|  20.9k|    const SECHashObject *rawHash;
 7322|  20.9k|    unsigned hashLen;
 7323|  20.9k|    unsigned genLen = 0;
 7324|  20.9k|    unsigned char hashbuf[HASH_LENGTH_MAX];
 7325|  20.9k|    unsigned char keyBlock[9 * SFTK_MAX_MAC_LENGTH];
 7326|  20.9k|    unsigned char *keyBlockAlloc = NULL;    /* allocated keyBlock */
 7327|  20.9k|    unsigned char *keyBlockData = keyBlock; /* pointer to current keyBlock */
 7328|  20.9k|    const unsigned char *prk;               /* psuedo-random key */
 7329|  20.9k|    CK_ULONG prkLen;
 7330|  20.9k|    const unsigned char *okm; /* output keying material */
 7331|  20.9k|    HASH_HashType hashType = sftk_GetHashTypeFromMechanism(params->prfHashMechanism);
 7332|  20.9k|    SFTKObject *saltKey = NULL;
 7333|  20.9k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  20.9k|#define CKR_OK 0x00000000UL
  ------------------
 7334|       |
 7335|       |    /* Spec says it should be the base hash, but also accept the HMAC */
 7336|  20.9k|    if (hashType == HASH_AlgNULL) {
  ------------------
  |  Branch (7336:9): [True: 0, False: 20.9k]
  ------------------
 7337|      0|        hashType = sftk_HMACMechanismToHash(params->prfHashMechanism);
 7338|      0|    }
 7339|  20.9k|    rawHash = HASH_GetRawHashObject(hashType);
 7340|  20.9k|    if (rawHash == NULL || rawHash->length > sizeof(hashbuf)) {
  ------------------
  |  Branch (7340:9): [True: 0, False: 20.9k]
  |  Branch (7340:28): [True: 0, False: 20.9k]
  ------------------
 7341|      0|        return CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 7342|      0|    }
 7343|  20.9k|    hashLen = rawHash->length;
 7344|       |
 7345|  20.9k|    if ((!params->bExpand && !params->bExtract) ||
  ------------------
  |  Branch (7345:10): [True: 6.46k, False: 14.4k]
  |  Branch (7345:30): [True: 0, False: 6.46k]
  ------------------
 7346|  20.9k|        (params->bExtract && params->ulSaltLen > 0 && !params->pSalt) ||
  ------------------
  |  Branch (7346:10): [True: 6.46k, False: 14.4k]
  |  Branch (7346:30): [True: 0, False: 6.46k]
  |  Branch (7346:55): [True: 0, False: 0]
  ------------------
 7347|  20.9k|        (params->bExpand && params->ulInfoLen > 0 && !params->pInfo)) {
  ------------------
  |  Branch (7347:10): [True: 14.4k, False: 6.46k]
  |  Branch (7347:29): [True: 14.4k, False: 0]
  |  Branch (7347:54): [True: 0, False: 14.4k]
  ------------------
 7348|      0|        return CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7349|      0|    }
 7350|  20.9k|    if ((params->bExpand && keySize == 0) ||
  ------------------
  |  Branch (7350:10): [True: 14.4k, False: 6.46k]
  |  Branch (7350:29): [True: 0, False: 14.4k]
  ------------------
 7351|  20.9k|        (!params->bExpand && keySize > hashLen) ||
  ------------------
  |  Branch (7351:10): [True: 6.46k, False: 14.4k]
  |  Branch (7351:30): [True: 0, False: 6.46k]
  ------------------
 7352|  20.9k|        (params->bExpand && keySize > 255 * hashLen)) {
  ------------------
  |  Branch (7352:10): [True: 14.4k, False: 6.46k]
  |  Branch (7352:29): [True: 0, False: 14.4k]
  ------------------
 7353|      0|        return CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 7354|      0|    }
 7355|       |
 7356|       |    /* sourceKey is NULL if we are called from the POST, skip the
 7357|       |     * sensitiveCheck */
 7358|  20.9k|    if (sourceKey != NULL) {
  ------------------
  |  Branch (7358:9): [True: 20.9k, False: 0]
  ------------------
 7359|  20.9k|        crv = sftk_DeriveSensitiveCheck(sourceKey, key, canBeData);
 7360|  20.9k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  20.9k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7360:13): [True: 0, False: 20.9k]
  ------------------
 7361|      0|            return crv;
 7362|  20.9k|    }
 7363|       |
 7364|       |    /* HKDF-Extract(salt, base key value) */
 7365|  20.9k|    if (params->bExtract) {
  ------------------
  |  Branch (7365:9): [True: 6.46k, False: 14.4k]
  ------------------
 7366|  6.46k|        CK_BYTE *salt;
 7367|  6.46k|        CK_ULONG saltLen;
 7368|  6.46k|        HMACContext *hmac;
 7369|  6.46k|        unsigned int bufLen;
 7370|       |
 7371|  6.46k|        switch (params->ulSaltType) {
 7372|  4.76k|            case CKF_HKDF_SALT_NULL:
  ------------------
  |  | 2252|  4.76k|#define CKF_HKDF_SALT_NULL 0x00000001UL
  ------------------
  |  Branch (7372:13): [True: 4.76k, False: 1.69k]
  ------------------
 7373|  4.76k|                saltLen = hashLen;
 7374|  4.76k|                salt = hashbuf;
 7375|  4.76k|                memset(salt, 0, saltLen);
 7376|  4.76k|                break;
 7377|      0|            case CKF_HKDF_SALT_DATA:
  ------------------
  |  | 2253|      0|#define CKF_HKDF_SALT_DATA 0x00000002UL
  ------------------
  |  Branch (7377:13): [True: 0, False: 6.46k]
  ------------------
 7378|      0|                salt = params->pSalt;
 7379|      0|                saltLen = params->ulSaltLen;
 7380|      0|                if ((salt == NULL) || (params->ulSaltLen == 0)) {
  ------------------
  |  Branch (7380:21): [True: 0, False: 0]
  |  Branch (7380:39): [True: 0, False: 0]
  ------------------
 7381|      0|                    return CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7382|      0|                }
 7383|      0|                break;
 7384|  1.69k|            case CKF_HKDF_SALT_KEY:
  ------------------
  |  | 2254|  1.69k|#define CKF_HKDF_SALT_KEY 0x00000004UL
  ------------------
  |  Branch (7384:13): [True: 1.69k, False: 4.76k]
  ------------------
 7385|       |                /* lookup key */
 7386|  1.69k|                session = sftk_SessionFromHandle(hSession);
 7387|  1.69k|                if (session == NULL) {
  ------------------
  |  Branch (7387:21): [True: 0, False: 1.69k]
  ------------------
 7388|      0|                    return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 7389|      0|                }
 7390|       |
 7391|  1.69k|                saltKey = sftk_ObjectFromHandle(params->hSaltKey, session);
 7392|  1.69k|                sftk_FreeSession(session);
 7393|  1.69k|                if (saltKey == NULL) {
  ------------------
  |  Branch (7393:21): [True: 0, False: 1.69k]
  ------------------
 7394|      0|                    return CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 7395|      0|                }
 7396|       |                /* if the base key is not fips, but the salt key is, the
 7397|       |                 * resulting key can be fips */
 7398|  1.69k|                if (isFIPS && (key->isFIPS == 0) && (saltKey->isFIPS == 1)) {
  ------------------
  |  Branch (7398:21): [True: 0, False: 1.69k]
  |  Branch (7398:31): [True: 0, False: 0]
  |  Branch (7398:53): [True: 0, False: 0]
  ------------------
 7399|      0|                    CK_MECHANISM mech;
 7400|      0|                    mech.mechanism = CKM_HKDF_DERIVE;
  ------------------
  |  | 1296|      0|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
 7401|      0|                    mech.pParameter = params;
 7402|      0|                    mech.ulParameterLen = sizeof(*params);
 7403|      0|                    key->isFIPS = sftk_operationIsFIPS(saltKey->slot, &mech,
 7404|      0|                                                       CKA_DERIVE, saltKey);
  ------------------
  |  |  555|      0|#define CKA_DERIVE 0x0000010CUL
  ------------------
 7405|      0|                }
 7406|  1.69k|                saltKey_att = sftk_FindAttribute(saltKey, CKA_VALUE);
  ------------------
  |  |  516|  1.69k|#define CKA_VALUE 0x00000011UL
  ------------------
 7407|  1.69k|                if (saltKey_att == NULL) {
  ------------------
  |  Branch (7407:21): [True: 0, False: 1.69k]
  ------------------
 7408|      0|                    sftk_FreeObject(saltKey);
 7409|      0|                    return CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 7410|      0|                }
 7411|       |                /* save the resulting salt */
 7412|  1.69k|                salt = saltKey_att->attrib.pValue;
 7413|  1.69k|                saltLen = saltKey_att->attrib.ulValueLen;
 7414|  1.69k|                break;
 7415|      0|            default:
  ------------------
  |  Branch (7415:13): [True: 0, False: 6.46k]
  ------------------
 7416|      0|                return CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7417|      0|                break;
 7418|  6.46k|        }
 7419|       |
 7420|  6.46k|        hmac = HMAC_Create(rawHash, salt, saltLen, isFIPS);
 7421|  6.46k|        if (saltKey_att) {
  ------------------
  |  Branch (7421:13): [True: 1.69k, False: 4.76k]
  ------------------
 7422|  1.69k|            sftk_FreeAttribute(saltKey_att);
 7423|  1.69k|        }
 7424|  6.46k|        if (saltKey) {
  ------------------
  |  Branch (7424:13): [True: 1.69k, False: 4.76k]
  ------------------
 7425|  1.69k|            sftk_FreeObject(saltKey);
 7426|  1.69k|        }
 7427|  6.46k|        if (!hmac) {
  ------------------
  |  Branch (7427:13): [True: 0, False: 6.46k]
  ------------------
 7428|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 7429|      0|        }
 7430|  6.46k|        HMAC_Begin(hmac);
 7431|  6.46k|        HMAC_Update(hmac, sourceKeyBytes, sourceKeyLen);
 7432|  6.46k|        HMAC_Finish(hmac, hashbuf, &bufLen, sizeof(hashbuf));
 7433|  6.46k|        HMAC_Destroy(hmac, PR_TRUE);
  ------------------
  |  |  437|  6.46k|#define PR_TRUE 1
  ------------------
 7434|  6.46k|        PORT_Assert(bufLen == rawHash->length);
  ------------------
  |  |  120|  6.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  6.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7435|  6.46k|        prk = hashbuf;
 7436|  6.46k|        prkLen = bufLen;
 7437|  14.4k|    } else {
 7438|       |        /* PRK = base key value */
 7439|  14.4k|        prk = sourceKeyBytes;
 7440|  14.4k|        prkLen = sourceKeyLen;
 7441|  14.4k|    }
 7442|       |
 7443|       |    /* HKDF-Expand */
 7444|  20.9k|    if (!params->bExpand) {
  ------------------
  |  Branch (7444:9): [True: 6.46k, False: 14.4k]
  ------------------
 7445|  6.46k|        okm = prk;
 7446|  6.46k|        keySize = genLen = hashLen;
 7447|  14.4k|    } else {
 7448|       |        /* T(1) = HMAC-Hash(prk, "" | info | 0x01)
 7449|       |         * T(n) = HMAC-Hash(prk, T(n-1) | info | n
 7450|       |         * key material = T(1) | ... | T(n)
 7451|       |         */
 7452|  14.4k|        HMACContext *hmac;
 7453|  14.4k|        CK_BYTE bi;
 7454|  14.4k|        unsigned iterations;
 7455|       |
 7456|  14.4k|        genLen = PR_ROUNDUP(keySize, hashLen);
  ------------------
  |  |  157|  14.4k|#define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
  ------------------
 7457|  14.4k|        iterations = genLen / hashLen;
 7458|       |
 7459|  14.4k|        if (genLen > sizeof(keyBlock)) {
  ------------------
  |  Branch (7459:13): [True: 0, False: 14.4k]
  ------------------
 7460|      0|            keyBlockAlloc = PORT_Alloc(genLen);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 7461|      0|            if (keyBlockAlloc == NULL) {
  ------------------
  |  Branch (7461:17): [True: 0, False: 0]
  ------------------
 7462|      0|                return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 7463|      0|            }
 7464|      0|            keyBlockData = keyBlockAlloc;
 7465|      0|        }
 7466|  14.4k|        hmac = HMAC_Create(rawHash, prk, prkLen, isFIPS);
 7467|  14.4k|        if (hmac == NULL) {
  ------------------
  |  Branch (7467:13): [True: 0, False: 14.4k]
  ------------------
 7468|      0|            PORT_Free(keyBlockAlloc);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 7469|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 7470|      0|        }
 7471|  28.9k|        for (bi = 1; bi <= iterations && bi > 0; ++bi) {
  ------------------
  |  Branch (7471:22): [True: 14.4k, False: 14.4k]
  |  Branch (7471:42): [True: 14.4k, False: 0]
  ------------------
 7472|  14.4k|            unsigned len;
 7473|  14.4k|            HMAC_Begin(hmac);
 7474|  14.4k|            if (bi > 1) {
  ------------------
  |  Branch (7474:17): [True: 0, False: 14.4k]
  ------------------
 7475|      0|                HMAC_Update(hmac, &keyBlockData[(bi - 2) * hashLen], hashLen);
 7476|      0|            }
 7477|  14.4k|            if (params->ulInfoLen != 0) {
  ------------------
  |  Branch (7477:17): [True: 14.4k, False: 0]
  ------------------
 7478|  14.4k|                HMAC_Update(hmac, params->pInfo, params->ulInfoLen);
 7479|  14.4k|            }
 7480|  14.4k|            HMAC_Update(hmac, &bi, 1);
 7481|  14.4k|            HMAC_Finish(hmac, &keyBlockData[(bi - 1) * hashLen], &len,
 7482|  14.4k|                        hashLen);
 7483|  14.4k|            PORT_Assert(len == hashLen);
  ------------------
  |  |  120|  14.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7484|  14.4k|        }
 7485|  14.4k|        HMAC_Destroy(hmac, PR_TRUE);
  ------------------
  |  |  437|  14.4k|#define PR_TRUE 1
  ------------------
 7486|  14.4k|        okm = &keyBlockData[0];
 7487|  14.4k|    }
 7488|       |    /* key material = okm */
 7489|  20.9k|    crv = CKR_OK;
  ------------------
  |  | 1388|  20.9k|#define CKR_OK 0x00000000UL
  ------------------
 7490|  20.9k|    if (key) {
  ------------------
  |  Branch (7490:9): [True: 20.9k, False: 0]
  ------------------
 7491|  20.9k|        crv = sftk_forceAttribute(key, CKA_VALUE, okm, keySize);
  ------------------
  |  |  516|  20.9k|#define CKA_VALUE 0x00000011UL
  ------------------
 7492|  20.9k|    } else {
 7493|      0|        PORT_Assert(outKeyBytes != NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7494|      0|        PORT_Memcpy(outKeyBytes, okm, keySize);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 7495|      0|    }
 7496|  20.9k|    PORT_Memset(keyBlockData, 0, genLen);
  ------------------
  |  |  182|  20.9k|#define PORT_Memset memset
  ------------------
 7497|  20.9k|    PORT_Memset(hashbuf, 0, sizeof(hashbuf));
  ------------------
  |  |  182|  20.9k|#define PORT_Memset memset
  ------------------
 7498|  20.9k|    PORT_Free(keyBlockAlloc);
  ------------------
  |  |   60|  20.9k|#define PORT_Free PORT_Free_Util
  ------------------
 7499|  20.9k|    return crv;
 7500|  20.9k|}
NSC_DeriveKey:
 7527|  26.1k|{
 7528|  26.1k|    SFTKSession *session;
 7529|  26.1k|    SFTKSlot *slot = sftk_SlotFromSessionHandle(hSession);
 7530|  26.1k|    SFTKObject *key;
 7531|  26.1k|    SFTKObject *sourceKey;
 7532|  26.1k|    SFTKAttribute *att = NULL;
 7533|  26.1k|    SFTKAttribute *att2 = NULL;
 7534|  26.1k|    unsigned char *buf;
 7535|  26.1k|    SHA1Context *sha;
 7536|  26.1k|    MD5Context *md5;
 7537|  26.1k|    MD2Context *md2;
 7538|  26.1k|    CK_ULONG macSize;
 7539|  26.1k|    CK_ULONG tmpKeySize;
 7540|  26.1k|    CK_ULONG IVSize;
 7541|  26.1k|    CK_ULONG keySize = 0;
 7542|  26.1k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  26.1k|#define CKR_OK 0x00000000UL
  ------------------
 7543|  26.1k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  26.1k|#define CK_TRUE 1
  ------------------
 7544|  26.1k|    CK_BBOOL ckfalse = CK_FALSE;
  ------------------
  |  |   23|  26.1k|#define CK_FALSE 0
  ------------------
 7545|  26.1k|    CK_KEY_TYPE keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|  26.1k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 7546|  26.1k|    CK_OBJECT_CLASS classType = CKO_SECRET_KEY;
  ------------------
  |  |  329|  26.1k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
 7547|  26.1k|    CK_KEY_DERIVATION_STRING_DATA *stringPtr;
 7548|  26.1k|    PRBool isTLS = PR_FALSE;
  ------------------
  |  |  438|  26.1k|#define PR_FALSE 0
  ------------------
 7549|  26.1k|    PRBool isDH = PR_FALSE;
  ------------------
  |  |  438|  26.1k|#define PR_FALSE 0
  ------------------
 7550|  26.1k|    HASH_HashType tlsPrfHash = HASH_AlgNULL;
 7551|  26.1k|    SECStatus rv;
 7552|  26.1k|    int i;
 7553|  26.1k|    unsigned int outLen;
 7554|  26.1k|    unsigned char sha_out[SHA1_LENGTH];
 7555|  26.1k|    unsigned char key_block[NUM_MIXERS * SFTK_MAX_MAC_LENGTH];
 7556|  26.1k|    PRBool isFIPS;
 7557|  26.1k|    HASH_HashType hashType;
 7558|  26.1k|    CK_MECHANISM_TYPE hashMech;
 7559|  26.1k|    PRBool extractValue = PR_TRUE;
  ------------------
  |  |  437|  26.1k|#define PR_TRUE 1
  ------------------
 7560|  26.1k|    CK_NSS_IKE1_APP_B_PRF_DERIVE_PARAMS ikeAppB;
 7561|  26.1k|    CK_NSS_IKE1_APP_B_PRF_DERIVE_PARAMS *pIkeAppB;
 7562|       |
 7563|  26.1k|    CHECK_FORK();
 7564|       |
 7565|  26.1k|    if (!slot) {
  ------------------
  |  Branch (7565:9): [True: 0, False: 26.1k]
  ------------------
 7566|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 7567|      0|    }
 7568|  26.1k|    if (!pMechanism) {
  ------------------
  |  Branch (7568:9): [True: 0, False: 26.1k]
  ------------------
 7569|      0|        return CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7570|      0|    }
 7571|  26.1k|    CK_MECHANISM_TYPE mechanism = pMechanism->mechanism;
 7572|       |
 7573|       |    /*
 7574|       |     * now lets create an object to hang the attributes off of
 7575|       |     */
 7576|  26.1k|    if (phKey) {
  ------------------
  |  Branch (7576:9): [True: 26.1k, False: 0]
  ------------------
 7577|  26.1k|        *phKey = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  26.1k|#define CK_INVALID_HANDLE 0
  ------------------
 7578|  26.1k|    }
 7579|       |
 7580|  26.1k|    key = sftk_NewObject(slot); /* fill in the handle later */
 7581|  26.1k|    if (key == NULL) {
  ------------------
  |  Branch (7581:9): [True: 0, False: 26.1k]
  ------------------
 7582|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 7583|      0|    }
 7584|  26.1k|    isFIPS = sftk_isFIPS(slot->slotID);
  ------------------
  |  |  506|  26.1k|    (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  500|  26.1k|#define FIPS_SLOT_ID 3
  |  |  ------------------
  |  |                   (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  567|  26.1k|#define SFTK_MIN_FIPS_USER_SLOT_ID 101
  |  |  ------------------
  |  |  |  Branch (506:6): [True: 0, False: 26.1k]
  |  |  |  Branch (506:32): [True: 0, False: 26.1k]
  |  |  ------------------
  ------------------
 7585|       |
 7586|       |    /*
 7587|       |     * load the template values into the object
 7588|       |     */
 7589|   154k|    for (i = 0; i < (int)ulAttributeCount; i++) {
  ------------------
  |  Branch (7589:17): [True: 127k, False: 26.1k]
  ------------------
 7590|   127k|        crv = sftk_AddAttributeType(key, sftk_attr_expand(&pTemplate[i]));
  ------------------
  |  |  587|   127k|#define sftk_attr_expand(ap) (ap)->type, (ap)->pValue, (ap)->ulValueLen
  ------------------
 7591|   127k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|   127k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7591:13): [True: 0, False: 127k]
  ------------------
 7592|      0|            break;
 7593|       |
 7594|   127k|        if (pTemplate[i].type == CKA_KEY_TYPE) {
  ------------------
  |  |  543|   127k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
  |  Branch (7594:13): [True: 26.1k, False: 101k]
  ------------------
 7595|  26.1k|            keyType = *(CK_KEY_TYPE *)pTemplate[i].pValue;
 7596|  26.1k|        }
 7597|   127k|        if (pTemplate[i].type == CKA_VALUE_LEN) {
  ------------------
  |  |  580|   127k|#define CKA_VALUE_LEN 0x00000161UL
  ------------------
  |  Branch (7597:13): [True: 17.1k, False: 110k]
  ------------------
 7598|  17.1k|            keySize = *(CK_ULONG *)pTemplate[i].pValue;
 7599|  17.1k|        }
 7600|   127k|    }
 7601|  26.1k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  26.1k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7601:9): [True: 0, False: 26.1k]
  ------------------
 7602|      0|        sftk_FreeObject(key);
 7603|      0|        return crv;
 7604|      0|    }
 7605|       |
 7606|  26.1k|    if (keySize == 0) {
  ------------------
  |  Branch (7606:9): [True: 9.00k, False: 17.1k]
  ------------------
 7607|  9.00k|        keySize = sftk_MapKeySize(keyType);
 7608|  9.00k|    }
 7609|       |
 7610|  26.1k|    switch (mechanism) {
 7611|      0|        case CKM_NSS_JPAKE_ROUND2_SHA1:   /* fall through */
  ------------------
  |  |  195|      0|#define CKM_NSS_JPAKE_ROUND2_SHA1 (CKM_NSS + 11)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7611:9): [True: 0, False: 26.1k]
  ------------------
 7612|      0|        case CKM_NSS_JPAKE_ROUND2_SHA256: /* fall through */
  ------------------
  |  |  196|      0|#define CKM_NSS_JPAKE_ROUND2_SHA256 (CKM_NSS + 12)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7612:9): [True: 0, False: 26.1k]
  ------------------
 7613|      0|        case CKM_NSS_JPAKE_ROUND2_SHA384: /* fall through */
  ------------------
  |  |  197|      0|#define CKM_NSS_JPAKE_ROUND2_SHA384 (CKM_NSS + 13)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7613:9): [True: 0, False: 26.1k]
  ------------------
 7614|      0|        case CKM_NSS_JPAKE_ROUND2_SHA512:
  ------------------
  |  |  198|      0|#define CKM_NSS_JPAKE_ROUND2_SHA512 (CKM_NSS + 14)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7614:9): [True: 0, False: 26.1k]
  ------------------
 7615|      0|            extractValue = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 7616|      0|            classType = CKO_PRIVATE_KEY;
  ------------------
  |  |  328|      0|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
 7617|      0|            break;
 7618|      0|        case CKM_NSS_PUB_FROM_PRIV:
  ------------------
  |  |  259|      0|#define CKM_NSS_PUB_FROM_PRIV (CKM_NSS + 40)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7618:9): [True: 0, False: 26.1k]
  ------------------
 7619|      0|            extractValue = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 7620|      0|            classType = CKO_PUBLIC_KEY;
  ------------------
  |  |  327|      0|#define CKO_PUBLIC_KEY 0x00000002UL
  ------------------
 7621|      0|            break;
 7622|    897|        case CKM_HKDF_DATA:                              /* fall through */
  ------------------
  |  | 1297|    897|#define CKM_HKDF_DATA 0x0000402bUL
  ------------------
  |  Branch (7622:9): [True: 897, False: 25.2k]
  ------------------
 7623|    897|        case CKM_NSS_SP800_108_COUNTER_KDF_DERIVE_DATA:  /* fall through */
  ------------------
  |  |  262|    897|#define CKM_NSS_SP800_108_COUNTER_KDF_DERIVE_DATA (CKM_NSS + 42)
  |  |  ------------------
  |  |  |  |  162|    897|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    897|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    897|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7623:9): [True: 0, False: 26.1k]
  ------------------
 7624|    897|        case CKM_NSS_SP800_108_FEEDBACK_KDF_DERIVE_DATA: /* fall through */
  ------------------
  |  |  263|    897|#define CKM_NSS_SP800_108_FEEDBACK_KDF_DERIVE_DATA (CKM_NSS + 43)
  |  |  ------------------
  |  |  |  |  162|    897|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    897|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    897|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7624:9): [True: 0, False: 26.1k]
  ------------------
 7625|    897|        case CKM_NSS_SP800_108_DOUBLE_PIPELINE_KDF_DERIVE_DATA:
  ------------------
  |  |  264|    897|#define CKM_NSS_SP800_108_DOUBLE_PIPELINE_KDF_DERIVE_DATA (CKM_NSS + 44)
  |  |  ------------------
  |  |  |  |  162|    897|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    897|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    897|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7625:9): [True: 0, False: 26.1k]
  ------------------
 7626|    897|            classType = CKO_DATA;
  ------------------
  |  |  325|    897|#define CKO_DATA 0x00000000UL
  ------------------
 7627|    897|            break;
 7628|      0|        case CKM_NSS_JPAKE_FINAL_SHA1:   /* fall through */
  ------------------
  |  |  210|      0|#define CKM_NSS_JPAKE_FINAL_SHA1 (CKM_NSS + 15)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7628:9): [True: 0, False: 26.1k]
  ------------------
 7629|      0|        case CKM_NSS_JPAKE_FINAL_SHA256: /* fall through */
  ------------------
  |  |  211|      0|#define CKM_NSS_JPAKE_FINAL_SHA256 (CKM_NSS + 16)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7629:9): [True: 0, False: 26.1k]
  ------------------
 7630|      0|        case CKM_NSS_JPAKE_FINAL_SHA384: /* fall through */
  ------------------
  |  |  212|      0|#define CKM_NSS_JPAKE_FINAL_SHA384 (CKM_NSS + 17)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7630:9): [True: 0, False: 26.1k]
  ------------------
 7631|      0|        case CKM_NSS_JPAKE_FINAL_SHA512:
  ------------------
  |  |  213|      0|#define CKM_NSS_JPAKE_FINAL_SHA512 (CKM_NSS + 18)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7631:9): [True: 0, False: 26.1k]
  ------------------
 7632|      0|            extractValue = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 7633|       |        /* fall through */
 7634|  25.2k|        default:
  ------------------
  |  Branch (7634:9): [True: 25.2k, False: 897]
  ------------------
 7635|  25.2k|            classType = CKO_SECRET_KEY;
  ------------------
  |  |  329|  25.2k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
 7636|  26.1k|    }
 7637|       |
 7638|  26.1k|    crv = sftk_forceAttribute(key, CKA_CLASS, &classType, sizeof(classType));
  ------------------
  |  |  511|  26.1k|#define CKA_CLASS 0x00000000UL
  ------------------
 7639|  26.1k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  26.1k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7639:9): [True: 0, False: 26.1k]
  ------------------
 7640|      0|        sftk_FreeObject(key);
 7641|      0|        return crv;
 7642|      0|    }
 7643|       |
 7644|       |    /* look up the base key we're deriving with */
 7645|  26.1k|    session = sftk_SessionFromHandle(hSession);
 7646|  26.1k|    if (session == NULL) {
  ------------------
  |  Branch (7646:9): [True: 0, False: 26.1k]
  ------------------
 7647|      0|        sftk_FreeObject(key);
 7648|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 7649|      0|    }
 7650|       |
 7651|  26.1k|    sourceKey = sftk_ObjectFromHandle(hBaseKey, session);
 7652|  26.1k|    sftk_FreeSession(session);
 7653|       |    /* is this eventually succeeds, lastOpWasFIPS will be set the resulting key's
 7654|       |     * FIPS state below. */
 7655|  26.1k|    session->lastOpWasFIPS = PR_FALSE;
  ------------------
  |  |  438|  26.1k|#define PR_FALSE 0
  ------------------
 7656|  26.1k|    if (sourceKey == NULL) {
  ------------------
  |  Branch (7656:9): [True: 0, False: 26.1k]
  ------------------
 7657|      0|        sftk_FreeObject(key);
 7658|      0|        return CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 7659|      0|    }
 7660|       |
 7661|  26.1k|    if (extractValue) {
  ------------------
  |  Branch (7661:9): [True: 26.1k, False: 0]
  ------------------
 7662|       |        /* get the value of the base key */
 7663|  26.1k|        att = sftk_FindAttribute(sourceKey, CKA_VALUE);
  ------------------
  |  |  516|  26.1k|#define CKA_VALUE 0x00000011UL
  ------------------
 7664|  26.1k|        if (att == NULL) {
  ------------------
  |  Branch (7664:13): [True: 0, False: 26.1k]
  ------------------
 7665|      0|            sftk_FreeObject(key);
 7666|      0|            sftk_FreeObject(sourceKey);
 7667|      0|            return CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 7668|      0|        }
 7669|  26.1k|    }
 7670|  26.1k|    key->isFIPS = sftk_operationIsFIPS(slot, pMechanism, CKA_DERIVE, sourceKey);
  ------------------
  |  |  555|  26.1k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 7671|       |
 7672|  26.1k|    switch (mechanism) {
 7673|       |        /* get a public key from a private key. nsslowkey_ConvertToPublickey()
 7674|       |         * will generate the public portion if it doesn't already exist. */
 7675|      0|        case CKM_NSS_PUB_FROM_PRIV: {
  ------------------
  |  |  259|      0|#define CKM_NSS_PUB_FROM_PRIV (CKM_NSS + 40)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7675:9): [True: 0, False: 26.1k]
  ------------------
 7676|      0|            NSSLOWKEYPrivateKey *privKey;
 7677|      0|            NSSLOWKEYPublicKey *pubKey;
 7678|      0|            int error;
 7679|       |
 7680|      0|            crv = sftk_GetULongAttribute(sourceKey, CKA_KEY_TYPE, &keyType);
  ------------------
  |  |  543|      0|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 7681|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7681:17): [True: 0, False: 0]
  ------------------
 7682|      0|                break;
 7683|      0|            }
 7684|       |
 7685|       |            /* privKey is stored in sourceKey and will be destroyed when
 7686|       |             * the sourceKey is freed. */
 7687|      0|            privKey = sftk_GetPrivKey(sourceKey, keyType, &crv);
 7688|      0|            if (privKey == NULL) {
  ------------------
  |  Branch (7688:17): [True: 0, False: 0]
  ------------------
 7689|      0|                break;
 7690|      0|            }
 7691|      0|            pubKey = nsslowkey_ConvertToPublicKey(privKey);
 7692|      0|            if (pubKey == NULL) {
  ------------------
  |  Branch (7692:17): [True: 0, False: 0]
  ------------------
 7693|      0|                error = PORT_GetError();
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 7694|      0|                crv = sftk_MapCryptError(error);
 7695|      0|                break;
 7696|      0|            }
 7697|      0|            crv = sftk_PutPubKey(key, sourceKey, keyType, pubKey);
 7698|      0|            nsslowkey_DestroyPublicKey(pubKey);
 7699|      0|            break;
 7700|      0|        }
 7701|      0|        case CKM_NSS_IKE_PRF_DERIVE:
  ------------------
  |  |  255|      0|#define CKM_NSS_IKE_PRF_DERIVE (CKM_NSS + 35)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7701:9): [True: 0, False: 26.1k]
  ------------------
 7702|      0|            if (pMechanism->ulParameterLen !=
  ------------------
  |  Branch (7702:17): [True: 0, False: 0]
  ------------------
 7703|      0|                sizeof(CK_NSS_IKE_PRF_DERIVE_PARAMS)) {
 7704|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7705|      0|                break;
 7706|      0|            }
 7707|      0|            crv = sftk_ike_prf(hSession, att,
 7708|      0|                               (CK_NSS_IKE_PRF_DERIVE_PARAMS *)pMechanism->pParameter, key);
 7709|      0|            break;
 7710|      0|        case CKM_NSS_IKE1_PRF_DERIVE:
  ------------------
  |  |  256|      0|#define CKM_NSS_IKE1_PRF_DERIVE (CKM_NSS + 36)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7710:9): [True: 0, False: 26.1k]
  ------------------
 7711|      0|            if (pMechanism->ulParameterLen !=
  ------------------
  |  Branch (7711:17): [True: 0, False: 0]
  ------------------
 7712|      0|                sizeof(CK_NSS_IKE1_PRF_DERIVE_PARAMS)) {
 7713|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7714|      0|                break;
 7715|      0|            }
 7716|      0|            crv = sftk_ike1_prf(hSession, att,
 7717|      0|                                (CK_NSS_IKE1_PRF_DERIVE_PARAMS *)pMechanism->pParameter,
 7718|      0|                                key, keySize);
 7719|      0|            break;
 7720|      0|        case CKM_NSS_IKE1_APP_B_PRF_DERIVE:
  ------------------
  |  |  257|      0|#define CKM_NSS_IKE1_APP_B_PRF_DERIVE (CKM_NSS + 37)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7720:9): [True: 0, False: 26.1k]
  ------------------
 7721|      0|            pIkeAppB = (CK_NSS_IKE1_APP_B_PRF_DERIVE_PARAMS *)pMechanism->pParameter;
 7722|      0|            if (pMechanism->ulParameterLen ==
  ------------------
  |  Branch (7722:17): [True: 0, False: 0]
  ------------------
 7723|      0|                sizeof(CK_MECHANISM_TYPE)) {
 7724|      0|                ikeAppB.prfMechanism = *(CK_MECHANISM_TYPE *)pMechanism->pParameter;
 7725|      0|                ikeAppB.bHasKeygxy = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 7726|      0|                ikeAppB.hKeygxy = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
 7727|      0|                ikeAppB.pExtraData = NULL;
 7728|      0|                ikeAppB.ulExtraDataLen = 0;
 7729|      0|                pIkeAppB = &ikeAppB;
 7730|      0|            } else if (pMechanism->ulParameterLen !=
  ------------------
  |  Branch (7730:24): [True: 0, False: 0]
  ------------------
 7731|      0|                       sizeof(CK_NSS_IKE1_APP_B_PRF_DERIVE_PARAMS)) {
 7732|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7733|      0|                break;
 7734|      0|            }
 7735|      0|            crv = sftk_ike1_appendix_b_prf(hSession, att, pIkeAppB, key,
 7736|      0|                                           keySize);
 7737|      0|            break;
 7738|      0|        case CKM_NSS_IKE_PRF_PLUS_DERIVE:
  ------------------
  |  |  254|      0|#define CKM_NSS_IKE_PRF_PLUS_DERIVE (CKM_NSS + 34)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7738:9): [True: 0, False: 26.1k]
  ------------------
 7739|      0|            if (pMechanism->ulParameterLen !=
  ------------------
  |  Branch (7739:17): [True: 0, False: 0]
  ------------------
 7740|      0|                sizeof(CK_NSS_IKE_PRF_PLUS_DERIVE_PARAMS)) {
 7741|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7742|      0|                break;
 7743|      0|            }
 7744|      0|            crv = sftk_ike_prf_plus(hSession, att,
 7745|      0|                                    (CK_NSS_IKE_PRF_PLUS_DERIVE_PARAMS *)pMechanism->pParameter,
 7746|      0|                                    key, keySize);
 7747|      0|            break;
 7748|       |        /*
 7749|       |         * generate the master secret
 7750|       |         */
 7751|  1.04k|        case CKM_TLS12_MASTER_KEY_DERIVE:
  ------------------
  |  | 1026|  1.04k|#define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL
  ------------------
  |  Branch (7751:9): [True: 1.04k, False: 25.0k]
  ------------------
 7752|  1.58k|        case CKM_TLS12_MASTER_KEY_DERIVE_DH:
  ------------------
  |  | 1028|  1.58k|#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2UL
  ------------------
  |  Branch (7752:9): [True: 541, False: 25.5k]
  ------------------
 7753|  1.58k|        case CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256:
  ------------------
  |  |  234|  1.58k|#define CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256 (CKM_NSS + 22)
  |  |  ------------------
  |  |  |  |  162|  1.58k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  1.58k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.58k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7753:9): [True: 0, False: 26.1k]
  ------------------
 7754|  1.58k|        case CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256:
  ------------------
  |  |  236|  1.58k|#define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24)
  |  |  ------------------
  |  |  |  |  162|  1.58k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  1.58k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.58k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7754:9): [True: 0, False: 26.1k]
  ------------------
 7755|  1.62k|        case CKM_TLS_MASTER_KEY_DERIVE:
  ------------------
  |  |  968|  1.62k|#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375UL
  ------------------
  |  Branch (7755:9): [True: 35, False: 26.0k]
  ------------------
 7756|  1.72k|        case CKM_TLS_MASTER_KEY_DERIVE_DH:
  ------------------
  |  |  970|  1.72k|#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL
  ------------------
  |  Branch (7756:9): [True: 108, False: 26.0k]
  ------------------
 7757|  1.72k|        case CKM_SSL3_MASTER_KEY_DERIVE:
  ------------------
  |  |  960|  1.72k|#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL
  ------------------
  |  Branch (7757:9): [True: 0, False: 26.1k]
  ------------------
 7758|  1.72k|        case CKM_SSL3_MASTER_KEY_DERIVE_DH: {
  ------------------
  |  |  966|  1.72k|#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL
  ------------------
  |  Branch (7758:9): [True: 0, False: 26.1k]
  ------------------
 7759|  1.72k|            CK_SSL3_MASTER_KEY_DERIVE_PARAMS *ssl3_master;
 7760|  1.72k|            SSL3RSAPreMasterSecret *rsa_pms;
 7761|  1.72k|            unsigned char crsrdata[SSL3_RANDOM_LENGTH * 2];
 7762|       |
 7763|  1.72k|            if ((mechanism == CKM_TLS12_MASTER_KEY_DERIVE) ||
  ------------------
  |  | 1026|  1.72k|#define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL
  ------------------
  |  Branch (7763:17): [True: 1.04k, False: 684]
  ------------------
 7764|  1.72k|                (mechanism == CKM_TLS12_MASTER_KEY_DERIVE_DH)) {
  ------------------
  |  | 1028|    684|#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2UL
  ------------------
  |  Branch (7764:17): [True: 541, False: 143]
  ------------------
 7765|  1.58k|                if (BAD_PARAM_CAST(pMechanism, sizeof(CK_TLS12_MASTER_KEY_DERIVE_PARAMS))) {
  ------------------
  |  |   50|  1.58k|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 1.58k]
  |  |  |  Branch (50:64): [True: 0, False: 1.58k]
  |  |  ------------------
  ------------------
 7766|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7767|      0|                    break;
 7768|      0|                }
 7769|  1.58k|                CK_TLS12_MASTER_KEY_DERIVE_PARAMS *tls12_master =
 7770|  1.58k|                    (CK_TLS12_MASTER_KEY_DERIVE_PARAMS *)pMechanism->pParameter;
 7771|  1.58k|                tlsPrfHash = sftk_GetHashTypeFromMechanism(tls12_master->prfHashMechanism);
 7772|  1.58k|                if (tlsPrfHash == HASH_AlgNULL) {
  ------------------
  |  Branch (7772:21): [True: 0, False: 1.58k]
  ------------------
 7773|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7774|      0|                    break;
 7775|      0|                }
 7776|  1.58k|            } else if ((mechanism == CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256) ||
  ------------------
  |  |  234|    143|#define CKM_NSS_TLS_MASTER_KEY_DERIVE_SHA256 (CKM_NSS + 22)
  |  |  ------------------
  |  |  |  |  162|    143|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    143|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    143|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7776:24): [True: 0, False: 143]
  ------------------
 7777|    143|                       (mechanism == CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256)) {
  ------------------
  |  |  236|    143|#define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24)
  |  |  ------------------
  |  |  |  |  162|    143|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    143|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    143|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7777:24): [True: 0, False: 143]
  ------------------
 7778|      0|                tlsPrfHash = HASH_AlgSHA256;
 7779|      0|            }
 7780|       |
 7781|  1.72k|            if ((mechanism != CKM_SSL3_MASTER_KEY_DERIVE) &&
  ------------------
  |  |  960|  1.72k|#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL
  ------------------
  |  Branch (7781:17): [True: 1.72k, False: 0]
  ------------------
 7782|  1.72k|                (mechanism != CKM_SSL3_MASTER_KEY_DERIVE_DH)) {
  ------------------
  |  |  966|  1.72k|#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL
  ------------------
  |  Branch (7782:17): [True: 1.72k, False: 0]
  ------------------
 7783|  1.72k|                isTLS = PR_TRUE;
  ------------------
  |  |  437|  1.72k|#define PR_TRUE 1
  ------------------
 7784|  1.72k|            }
 7785|  1.72k|            if ((mechanism == CKM_SSL3_MASTER_KEY_DERIVE_DH) ||
  ------------------
  |  |  966|  1.72k|#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL
  ------------------
  |  Branch (7785:17): [True: 0, False: 1.72k]
  ------------------
 7786|  1.72k|                (mechanism == CKM_TLS_MASTER_KEY_DERIVE_DH) ||
  ------------------
  |  |  970|  1.72k|#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL
  ------------------
  |  Branch (7786:17): [True: 108, False: 1.62k]
  ------------------
 7787|  1.72k|                (mechanism == CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256) ||
  ------------------
  |  |  236|  1.62k|#define CKM_NSS_TLS_MASTER_KEY_DERIVE_DH_SHA256 (CKM_NSS + 24)
  |  |  ------------------
  |  |  |  |  162|  1.62k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  1.62k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.62k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7787:17): [True: 0, False: 1.62k]
  ------------------
 7788|  1.72k|                (mechanism == CKM_TLS12_MASTER_KEY_DERIVE_DH)) {
  ------------------
  |  | 1028|  1.62k|#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2UL
  ------------------
  |  Branch (7788:17): [True: 541, False: 1.08k]
  ------------------
 7789|    649|                isDH = PR_TRUE;
  ------------------
  |  |  437|    649|#define PR_TRUE 1
  ------------------
 7790|    649|            }
 7791|       |
 7792|       |            /* first do the consistency checks */
 7793|  1.72k|            if (!isDH && (att->attrib.ulValueLen != SSL3_PMS_LENGTH)) {
  ------------------
  |  | 7517|  1.08k|#define SSL3_PMS_LENGTH 48
  ------------------
  |  Branch (7793:17): [True: 1.08k, False: 649]
  |  Branch (7793:26): [True: 0, False: 1.08k]
  ------------------
 7794|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 7795|      0|                break;
 7796|      0|            }
 7797|  1.72k|            att2 = sftk_FindAttribute(sourceKey, CKA_KEY_TYPE);
  ------------------
  |  |  543|  1.72k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 7798|  1.72k|            if ((att2 == NULL) || (*(CK_KEY_TYPE *)att2->attrib.pValue !=
  ------------------
  |  Branch (7798:17): [True: 0, False: 1.72k]
  |  Branch (7798:35): [True: 0, False: 1.72k]
  ------------------
 7799|  1.72k|                                   CKK_GENERIC_SECRET)) {
  ------------------
  |  |  383|  1.72k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 7800|      0|                if (att2)
  ------------------
  |  Branch (7800:21): [True: 0, False: 0]
  ------------------
 7801|      0|                    sftk_FreeAttribute(att2);
 7802|      0|                crv = CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 7803|      0|                break;
 7804|      0|            }
 7805|  1.72k|            sftk_FreeAttribute(att2);
 7806|  1.72k|            if (keyType != CKK_GENERIC_SECRET) {
  ------------------
  |  |  383|  1.72k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
  |  Branch (7806:17): [True: 0, False: 1.72k]
  ------------------
 7807|      0|                crv = CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 7808|      0|                break;
 7809|      0|            }
 7810|  1.72k|            if ((keySize != 0) && (keySize != SSL3_MASTER_SECRET_LENGTH)) {
  ------------------
  |  | 7518|      0|#define SSL3_MASTER_SECRET_LENGTH 48
  ------------------
  |  Branch (7810:17): [True: 0, False: 1.72k]
  |  Branch (7810:35): [True: 0, False: 0]
  ------------------
 7811|      0|                crv = CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 7812|      0|                break;
 7813|      0|            }
 7814|       |
 7815|       |            /* finally do the key gen */
 7816|  1.72k|            ssl3_master = (CK_SSL3_MASTER_KEY_DERIVE_PARAMS *)
 7817|  1.72k|                              pMechanism->pParameter;
 7818|       |
 7819|  1.72k|            if (ssl3_master->pVersion) {
  ------------------
  |  Branch (7819:17): [True: 1.08k, False: 649]
  ------------------
 7820|  1.08k|                SFTKSessionObject *sessKey = sftk_narrowToSessionObject(key);
 7821|  1.08k|                rsa_pms = (SSL3RSAPreMasterSecret *)att->attrib.pValue;
 7822|       |                /* don't leak more key material then necessary for SSL to work */
 7823|  1.08k|                if ((sessKey == NULL) || sessKey->wasDerived) {
  ------------------
  |  Branch (7823:21): [True: 0, False: 1.08k]
  |  Branch (7823:42): [True: 0, False: 1.08k]
  ------------------
 7824|      0|                    ssl3_master->pVersion->major = 0xff;
 7825|      0|                    ssl3_master->pVersion->minor = 0xff;
 7826|  1.08k|                } else {
 7827|  1.08k|                    ssl3_master->pVersion->major = rsa_pms->client_version[0];
 7828|  1.08k|                    ssl3_master->pVersion->minor = rsa_pms->client_version[1];
 7829|  1.08k|                }
 7830|  1.08k|            }
 7831|  1.72k|            if (ssl3_master->RandomInfo.ulClientRandomLen != SSL3_RANDOM_LENGTH) {
  ------------------
  |  | 7519|  1.72k|#define SSL3_RANDOM_LENGTH 32
  ------------------
  |  Branch (7831:17): [True: 0, False: 1.72k]
  ------------------
 7832|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7833|      0|                break;
 7834|      0|            }
 7835|  1.72k|            if (ssl3_master->RandomInfo.ulServerRandomLen != SSL3_RANDOM_LENGTH) {
  ------------------
  |  | 7519|  1.72k|#define SSL3_RANDOM_LENGTH 32
  ------------------
  |  Branch (7835:17): [True: 0, False: 1.72k]
  ------------------
 7836|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7837|      0|                break;
 7838|      0|            }
 7839|  1.72k|            PORT_Memcpy(crsrdata,
  ------------------
  |  |  180|  1.72k|#define PORT_Memcpy memcpy
  ------------------
 7840|  1.72k|                        ssl3_master->RandomInfo.pClientRandom, SSL3_RANDOM_LENGTH);
  ------------------
  |  | 7519|  1.72k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 7841|  1.72k|            PORT_Memcpy(crsrdata + SSL3_RANDOM_LENGTH,
  ------------------
  |  |  180|  1.72k|#define PORT_Memcpy memcpy
  ------------------
                          PORT_Memcpy(crsrdata + SSL3_RANDOM_LENGTH,
  ------------------
  |  | 7519|  1.72k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 7842|  1.72k|                        ssl3_master->RandomInfo.pServerRandom, SSL3_RANDOM_LENGTH);
  ------------------
  |  | 7519|  1.72k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 7843|       |
 7844|  1.72k|            if (isTLS) {
  ------------------
  |  Branch (7844:17): [True: 1.72k, False: 0]
  ------------------
 7845|  1.72k|                SECStatus status;
 7846|  1.72k|                SECItem crsr = { siBuffer, NULL, 0 };
 7847|  1.72k|                SECItem master = { siBuffer, NULL, 0 };
 7848|  1.72k|                SECItem pms = { siBuffer, NULL, 0 };
 7849|       |
 7850|  1.72k|                crsr.data = crsrdata;
 7851|  1.72k|                crsr.len = sizeof crsrdata;
 7852|  1.72k|                master.data = key_block;
 7853|  1.72k|                master.len = SSL3_MASTER_SECRET_LENGTH;
  ------------------
  |  | 7518|  1.72k|#define SSL3_MASTER_SECRET_LENGTH 48
  ------------------
 7854|  1.72k|                pms.data = (unsigned char *)att->attrib.pValue;
 7855|  1.72k|                pms.len = att->attrib.ulValueLen;
 7856|       |
 7857|  1.72k|                if (tlsPrfHash != HASH_AlgNULL) {
  ------------------
  |  Branch (7857:21): [True: 1.58k, False: 143]
  ------------------
 7858|  1.58k|                    status = TLS_P_hash(tlsPrfHash, &pms, "master secret",
 7859|  1.58k|                                        &crsr, &master, isFIPS);
 7860|  1.58k|                } else {
 7861|    143|                    status = TLS_PRF(&pms, "master secret", &crsr, &master, isFIPS);
 7862|    143|                }
 7863|  1.72k|                if (status != SECSuccess) {
  ------------------
  |  Branch (7863:21): [True: 0, False: 1.72k]
  ------------------
 7864|      0|                    PORT_Memset(crsrdata, 0, sizeof crsrdata);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 7865|      0|                    crv = CKR_FUNCTION_FAILED;
  ------------------
  |  | 1397|      0|#define CKR_FUNCTION_FAILED 0x00000006UL
  ------------------
 7866|      0|                    break;
 7867|      0|                }
 7868|  1.72k|            } else {
 7869|       |                /* now allocate the hash contexts */
 7870|      0|                md5 = MD5_NewContext();
 7871|      0|                if (md5 == NULL) {
  ------------------
  |  Branch (7871:21): [True: 0, False: 0]
  ------------------
 7872|      0|                    PORT_Memset(crsrdata, 0, sizeof crsrdata);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 7873|      0|                    crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 7874|      0|                    break;
 7875|      0|                }
 7876|      0|                sha = SHA1_NewContext();
 7877|      0|                if (sha == NULL) {
  ------------------
  |  Branch (7877:21): [True: 0, False: 0]
  ------------------
 7878|      0|                    PORT_Memset(crsrdata, 0, sizeof crsrdata);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 7879|      0|                    PORT_Free(md5);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 7880|      0|                    crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 7881|      0|                    break;
 7882|      0|                }
 7883|      0|                for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (7883:29): [True: 0, False: 0]
  ------------------
 7884|      0|                    SHA1_Begin(sha);
 7885|      0|                    SHA1_Update(sha, (unsigned char *)mixers[i], strlen(mixers[i]));
 7886|      0|                    SHA1_Update(sha, (const unsigned char *)att->attrib.pValue,
 7887|      0|                                att->attrib.ulValueLen);
 7888|      0|                    SHA1_Update(sha, crsrdata, sizeof crsrdata);
 7889|      0|                    SHA1_End(sha, sha_out, &outLen, SHA1_LENGTH);
  ------------------
  |  |   39|      0|#define SHA1_LENGTH 20
  ------------------
 7890|      0|                    PORT_Assert(outLen == SHA1_LENGTH);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7891|       |
 7892|      0|                    MD5_Begin(md5);
 7893|      0|                    MD5_Update(md5, (const unsigned char *)att->attrib.pValue,
 7894|      0|                               att->attrib.ulValueLen);
 7895|      0|                    MD5_Update(md5, sha_out, outLen);
 7896|      0|                    MD5_End(md5, &key_block[i * MD5_LENGTH], &outLen, MD5_LENGTH);
  ------------------
  |  |   38|      0|#define MD5_LENGTH 16
  ------------------
                                  MD5_End(md5, &key_block[i * MD5_LENGTH], &outLen, MD5_LENGTH);
  ------------------
  |  |   38|      0|#define MD5_LENGTH 16
  ------------------
 7897|      0|                    PORT_Assert(outLen == MD5_LENGTH);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7898|      0|                }
 7899|      0|                PORT_Free(md5);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 7900|      0|                PORT_Free(sha);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 7901|      0|                PORT_Memset(crsrdata, 0, sizeof crsrdata);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 7902|      0|                PORT_Memset(sha_out, 0, sizeof sha_out);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 7903|      0|            }
 7904|       |
 7905|       |            /* store the results */
 7906|  1.72k|            crv = sftk_forceAttribute(key, CKA_VALUE, key_block, SSL3_MASTER_SECRET_LENGTH);
  ------------------
  |  |  516|  1.72k|#define CKA_VALUE 0x00000011UL
  ------------------
                          crv = sftk_forceAttribute(key, CKA_VALUE, key_block, SSL3_MASTER_SECRET_LENGTH);
  ------------------
  |  | 7518|  1.72k|#define SSL3_MASTER_SECRET_LENGTH 48
  ------------------
 7907|  1.72k|            PORT_Memset(key_block, 0, sizeof key_block);
  ------------------
  |  |  182|  1.72k|#define PORT_Memset memset
  ------------------
 7908|  1.72k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.72k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7908:17): [True: 0, False: 1.72k]
  ------------------
 7909|      0|                break;
 7910|  1.72k|            keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|  1.72k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 7911|  1.72k|            crv = sftk_forceAttribute(key, CKA_KEY_TYPE, &keyType, sizeof(keyType));
  ------------------
  |  |  543|  1.72k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 7912|  1.72k|            if (isTLS) {
  ------------------
  |  Branch (7912:17): [True: 1.72k, False: 0]
  ------------------
 7913|       |                /* TLS's master secret is used to "sign" finished msgs with PRF. */
 7914|       |                /* XXX This seems like a hack.   But SFTK_Derive only accepts
 7915|       |                 * one "operation" argument. */
 7916|  1.72k|                crv = sftk_forceAttribute(key, CKA_SIGN, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  551|  1.72k|#define CKA_SIGN 0x00000108UL
  ------------------
 7917|  1.72k|                if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.72k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7917:21): [True: 0, False: 1.72k]
  ------------------
 7918|      0|                    break;
 7919|  1.72k|                crv = sftk_forceAttribute(key, CKA_VERIFY, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  553|  1.72k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 7920|  1.72k|                if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.72k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7920:21): [True: 0, False: 1.72k]
  ------------------
 7921|      0|                    break;
 7922|       |                /* While we're here, we might as well force this, too. */
 7923|  1.72k|                crv = sftk_forceAttribute(key, CKA_DERIVE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  555|  1.72k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 7924|  1.72k|                if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.72k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7924:21): [True: 0, False: 1.72k]
  ------------------
 7925|      0|                    break;
 7926|  1.72k|            }
 7927|  1.72k|            break;
 7928|  1.72k|        }
 7929|       |
 7930|       |        /* Extended master key derivation [draft-ietf-tls-session-hash] */
 7931|  1.72k|        case CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE:
  ------------------
  |  |  239|      2|#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE (CKM_NSS + 25)
  |  |  ------------------
  |  |  |  |  162|      2|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      2|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      2|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7931:9): [True: 2, False: 26.1k]
  ------------------
 7932|     31|        case CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH: {
  ------------------
  |  |  240|     31|#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH (CKM_NSS + 26)
  |  |  ------------------
  |  |  |  |  162|     31|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|     31|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     31|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7932:9): [True: 29, False: 26.0k]
  ------------------
 7933|     31|            CK_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_PARAMS *ems_params;
 7934|     31|            SSL3RSAPreMasterSecret *rsa_pms;
 7935|     31|            SECStatus status;
 7936|     31|            SECItem pms = { siBuffer, NULL, 0 };
 7937|     31|            SECItem seed = { siBuffer, NULL, 0 };
 7938|     31|            SECItem master = { siBuffer, NULL, 0 };
 7939|       |
 7940|     31|            ems_params = (CK_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_PARAMS *)
 7941|     31|                             pMechanism->pParameter;
 7942|       |
 7943|       |            /* First do the consistency checks */
 7944|     31|            if ((mechanism == CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE) &&
  ------------------
  |  |  239|     31|#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE (CKM_NSS + 25)
  |  |  ------------------
  |  |  |  |  162|     31|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|     31|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     31|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7944:17): [True: 2, False: 29]
  ------------------
 7945|     31|                (att->attrib.ulValueLen != SSL3_PMS_LENGTH)) {
  ------------------
  |  | 7517|      2|#define SSL3_PMS_LENGTH 48
  ------------------
  |  Branch (7945:17): [True: 0, False: 2]
  ------------------
 7946|      0|                crv = CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 7947|      0|                break;
 7948|      0|            }
 7949|     31|            att2 = sftk_FindAttribute(sourceKey, CKA_KEY_TYPE);
  ------------------
  |  |  543|     31|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 7950|     31|            if ((att2 == NULL) ||
  ------------------
  |  Branch (7950:17): [True: 0, False: 31]
  ------------------
 7951|     31|                (*(CK_KEY_TYPE *)att2->attrib.pValue != CKK_GENERIC_SECRET)) {
  ------------------
  |  |  383|     31|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
  |  Branch (7951:17): [True: 0, False: 31]
  ------------------
 7952|      0|                if (att2)
  ------------------
  |  Branch (7952:21): [True: 0, False: 0]
  ------------------
 7953|      0|                    sftk_FreeAttribute(att2);
 7954|      0|                crv = CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 7955|      0|                break;
 7956|      0|            }
 7957|     31|            sftk_FreeAttribute(att2);
 7958|     31|            if (keyType != CKK_GENERIC_SECRET) {
  ------------------
  |  |  383|     31|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
  |  Branch (7958:17): [True: 0, False: 31]
  ------------------
 7959|      0|                crv = CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 7960|      0|                break;
 7961|      0|            }
 7962|     31|            if ((keySize != 0) && (keySize != SSL3_MASTER_SECRET_LENGTH)) {
  ------------------
  |  | 7518|      0|#define SSL3_MASTER_SECRET_LENGTH 48
  ------------------
  |  Branch (7962:17): [True: 0, False: 31]
  |  Branch (7962:35): [True: 0, False: 0]
  ------------------
 7963|      0|                crv = CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 7964|      0|                break;
 7965|      0|            }
 7966|       |
 7967|       |            /* Do the key derivation */
 7968|     31|            pms.data = (unsigned char *)att->attrib.pValue;
 7969|     31|            pms.len = att->attrib.ulValueLen;
 7970|     31|            seed.data = ems_params->pSessionHash;
 7971|     31|            seed.len = ems_params->ulSessionHashLen;
 7972|     31|            master.data = key_block;
 7973|     31|            master.len = SSL3_MASTER_SECRET_LENGTH;
  ------------------
  |  | 7518|     31|#define SSL3_MASTER_SECRET_LENGTH 48
  ------------------
 7974|     31|            if (ems_params->prfHashMechanism == CKM_TLS_PRF) {
  ------------------
  |  |  973|     31|#define CKM_TLS_PRF 0x00000378UL
  ------------------
  |  Branch (7974:17): [True: 14, False: 17]
  ------------------
 7975|       |                /*
 7976|       |                 * In this case, the session hash is the concatenation of SHA-1
 7977|       |                 * and MD5, so it should be 36 bytes long.
 7978|       |                 */
 7979|     14|                if (seed.len != MD5_LENGTH + SHA1_LENGTH) {
  ------------------
  |  |   38|     14|#define MD5_LENGTH 16
  ------------------
                              if (seed.len != MD5_LENGTH + SHA1_LENGTH) {
  ------------------
  |  |   39|     14|#define SHA1_LENGTH 20
  ------------------
  |  Branch (7979:21): [True: 0, False: 14]
  ------------------
 7980|      0|                    crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 7981|      0|                    break;
 7982|      0|                }
 7983|       |
 7984|     14|                status = TLS_PRF(&pms, "extended master secret",
 7985|     14|                                 &seed, &master, isFIPS);
 7986|     17|            } else {
 7987|     17|                const SECHashObject *hashObj;
 7988|       |
 7989|     17|                tlsPrfHash = sftk_GetHashTypeFromMechanism(ems_params->prfHashMechanism);
 7990|     17|                if (tlsPrfHash == HASH_AlgNULL) {
  ------------------
  |  Branch (7990:21): [True: 0, False: 17]
  ------------------
 7991|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 7992|      0|                    break;
 7993|      0|                }
 7994|       |
 7995|     17|                hashObj = HASH_GetRawHashObject(tlsPrfHash);
 7996|     17|                if (seed.len != hashObj->length) {
  ------------------
  |  Branch (7996:21): [True: 0, False: 17]
  ------------------
 7997|      0|                    crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 7998|      0|                    break;
 7999|      0|                }
 8000|       |
 8001|     17|                status = TLS_P_hash(tlsPrfHash, &pms, "extended master secret",
 8002|     17|                                    &seed, &master, isFIPS);
 8003|     17|            }
 8004|     31|            if (status != SECSuccess) {
  ------------------
  |  Branch (8004:17): [True: 0, False: 31]
  ------------------
 8005|      0|                crv = CKR_FUNCTION_FAILED;
  ------------------
  |  | 1397|      0|#define CKR_FUNCTION_FAILED 0x00000006UL
  ------------------
 8006|      0|                break;
 8007|      0|            }
 8008|       |
 8009|       |            /* Reflect the version if required */
 8010|     31|            if (ems_params->pVersion) {
  ------------------
  |  Branch (8010:17): [True: 2, False: 29]
  ------------------
 8011|      2|                SFTKSessionObject *sessKey = sftk_narrowToSessionObject(key);
 8012|      2|                rsa_pms = (SSL3RSAPreMasterSecret *)att->attrib.pValue;
 8013|       |                /* don't leak more key material than necessary for SSL to work */
 8014|      2|                if ((sessKey == NULL) || sessKey->wasDerived) {
  ------------------
  |  Branch (8014:21): [True: 0, False: 2]
  |  Branch (8014:42): [True: 0, False: 2]
  ------------------
 8015|      0|                    ems_params->pVersion->major = 0xff;
 8016|      0|                    ems_params->pVersion->minor = 0xff;
 8017|      2|                } else {
 8018|      2|                    ems_params->pVersion->major = rsa_pms->client_version[0];
 8019|      2|                    ems_params->pVersion->minor = rsa_pms->client_version[1];
 8020|      2|                }
 8021|      2|            }
 8022|       |
 8023|       |            /* Store the results */
 8024|     31|            crv = sftk_forceAttribute(key, CKA_VALUE, key_block,
  ------------------
  |  |  516|     31|#define CKA_VALUE 0x00000011UL
  ------------------
 8025|     31|                                      SSL3_MASTER_SECRET_LENGTH);
  ------------------
  |  | 7518|     31|#define SSL3_MASTER_SECRET_LENGTH 48
  ------------------
 8026|     31|            PORT_Memset(key_block, 0, sizeof key_block);
  ------------------
  |  |  182|     31|#define PORT_Memset memset
  ------------------
 8027|     31|            break;
 8028|     31|        }
 8029|       |
 8030|  1.60k|        case CKM_TLS12_KEY_AND_MAC_DERIVE:
  ------------------
  |  | 1027|  1.60k|#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1UL
  ------------------
  |  Branch (8030:9): [True: 1.60k, False: 24.5k]
  ------------------
 8031|  1.60k|        case CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256:
  ------------------
  |  |  235|  1.60k|#define CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256 (CKM_NSS + 23)
  |  |  ------------------
  |  |  |  |  162|  1.60k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  1.60k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  1.60k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8031:9): [True: 0, False: 26.1k]
  ------------------
 8032|  1.76k|        case CKM_TLS_KEY_AND_MAC_DERIVE:
  ------------------
  |  |  969|  1.76k|#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL
  ------------------
  |  Branch (8032:9): [True: 157, False: 25.9k]
  ------------------
 8033|  1.76k|        case CKM_SSL3_KEY_AND_MAC_DERIVE: {
  ------------------
  |  |  961|  1.76k|#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL
  ------------------
  |  Branch (8033:9): [True: 0, False: 26.1k]
  ------------------
 8034|  1.76k|            CK_SSL3_KEY_MAT_PARAMS *ssl3_keys;
 8035|  1.76k|            CK_SSL3_KEY_MAT_OUT *ssl3_keys_out;
 8036|  1.76k|            CK_ULONG effKeySize;
 8037|  1.76k|            unsigned int block_needed;
 8038|  1.76k|            unsigned char srcrdata[SSL3_RANDOM_LENGTH * 2];
 8039|       |
 8040|  1.76k|            if (mechanism == CKM_TLS12_KEY_AND_MAC_DERIVE) {
  ------------------
  |  | 1027|  1.76k|#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1UL
  ------------------
  |  Branch (8040:17): [True: 1.60k, False: 157]
  ------------------
 8041|  1.60k|                if (BAD_PARAM_CAST(pMechanism, sizeof(CK_TLS12_KEY_MAT_PARAMS))) {
  ------------------
  |  |   50|  1.60k|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 1.60k]
  |  |  |  Branch (50:64): [True: 0, False: 1.60k]
  |  |  ------------------
  ------------------
 8042|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8043|      0|                    break;
 8044|      0|                }
 8045|  1.60k|                CK_TLS12_KEY_MAT_PARAMS *tls12_keys =
 8046|  1.60k|                    (CK_TLS12_KEY_MAT_PARAMS *)pMechanism->pParameter;
 8047|  1.60k|                tlsPrfHash = sftk_GetHashTypeFromMechanism(tls12_keys->prfHashMechanism);
 8048|  1.60k|                if (tlsPrfHash == HASH_AlgNULL) {
  ------------------
  |  Branch (8048:21): [True: 0, False: 1.60k]
  ------------------
 8049|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8050|      0|                    break;
 8051|      0|                }
 8052|  1.60k|            } else if (mechanism == CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256) {
  ------------------
  |  |  235|    157|#define CKM_NSS_TLS_KEY_AND_MAC_DERIVE_SHA256 (CKM_NSS + 23)
  |  |  ------------------
  |  |  |  |  162|    157|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|    157|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|    157|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8052:24): [True: 0, False: 157]
  ------------------
 8053|      0|                tlsPrfHash = HASH_AlgSHA256;
 8054|      0|            }
 8055|       |
 8056|  1.76k|            if (mechanism != CKM_SSL3_KEY_AND_MAC_DERIVE) {
  ------------------
  |  |  961|  1.76k|#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL
  ------------------
  |  Branch (8056:17): [True: 1.76k, False: 0]
  ------------------
 8057|  1.76k|                isTLS = PR_TRUE;
  ------------------
  |  |  437|  1.76k|#define PR_TRUE 1
  ------------------
 8058|  1.76k|            }
 8059|       |
 8060|  1.76k|            crv = sftk_DeriveSensitiveCheck(sourceKey, key, PR_FALSE);
  ------------------
  |  |  438|  1.76k|#define PR_FALSE 0
  ------------------
 8061|  1.76k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.76k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8061:17): [True: 0, False: 1.76k]
  ------------------
 8062|      0|                break;
 8063|       |
 8064|  1.76k|            if (att->attrib.ulValueLen != SSL3_MASTER_SECRET_LENGTH) {
  ------------------
  |  | 7518|  1.76k|#define SSL3_MASTER_SECRET_LENGTH 48
  ------------------
  |  Branch (8064:17): [True: 0, False: 1.76k]
  ------------------
 8065|      0|                crv = CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 8066|      0|                break;
 8067|      0|            }
 8068|  1.76k|            att2 = sftk_FindAttribute(sourceKey, CKA_KEY_TYPE);
  ------------------
  |  |  543|  1.76k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 8069|  1.76k|            if ((att2 == NULL) || (*(CK_KEY_TYPE *)att2->attrib.pValue !=
  ------------------
  |  Branch (8069:17): [True: 0, False: 1.76k]
  |  Branch (8069:35): [True: 0, False: 1.76k]
  ------------------
 8070|  1.76k|                                   CKK_GENERIC_SECRET)) {
  ------------------
  |  |  383|  1.76k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 8071|      0|                if (att2)
  ------------------
  |  Branch (8071:21): [True: 0, False: 0]
  ------------------
 8072|      0|                    sftk_FreeAttribute(att2);
 8073|      0|                crv = CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 8074|      0|                break;
 8075|      0|            }
 8076|  1.76k|            sftk_FreeAttribute(att2);
 8077|  1.76k|            md5 = MD5_NewContext();
 8078|  1.76k|            if (md5 == NULL) {
  ------------------
  |  Branch (8078:17): [True: 0, False: 1.76k]
  ------------------
 8079|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8080|      0|                break;
 8081|      0|            }
 8082|  1.76k|            sha = SHA1_NewContext();
 8083|  1.76k|            if (sha == NULL) {
  ------------------
  |  Branch (8083:17): [True: 0, False: 1.76k]
  ------------------
 8084|      0|                MD5_DestroyContext(md5, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8085|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8086|      0|                break;
 8087|      0|            }
 8088|       |
 8089|  1.76k|            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_SSL3_KEY_MAT_PARAMS))) {
  ------------------
  |  |   50|  1.76k|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 1.76k]
  |  |  |  Branch (50:64): [True: 0, False: 1.76k]
  |  |  ------------------
  ------------------
 8090|      0|                MD5_DestroyContext(md5, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8091|      0|                SHA1_DestroyContext(sha, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8092|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8093|      0|                break;
 8094|      0|            }
 8095|  1.76k|            ssl3_keys = (CK_SSL3_KEY_MAT_PARAMS *)pMechanism->pParameter;
 8096|       |
 8097|  1.76k|            PORT_Memcpy(srcrdata,
  ------------------
  |  |  180|  1.76k|#define PORT_Memcpy memcpy
  ------------------
 8098|  1.76k|                        ssl3_keys->RandomInfo.pServerRandom, SSL3_RANDOM_LENGTH);
  ------------------
  |  | 7519|  1.76k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 8099|  1.76k|            PORT_Memcpy(srcrdata + SSL3_RANDOM_LENGTH,
  ------------------
  |  |  180|  1.76k|#define PORT_Memcpy memcpy
  ------------------
                          PORT_Memcpy(srcrdata + SSL3_RANDOM_LENGTH,
  ------------------
  |  | 7519|  1.76k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 8100|  1.76k|                        ssl3_keys->RandomInfo.pClientRandom, SSL3_RANDOM_LENGTH);
  ------------------
  |  | 7519|  1.76k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 8101|       |
 8102|       |            /*
 8103|       |             * clear out our returned keys so we can recover on failure
 8104|       |             */
 8105|  1.76k|            ssl3_keys_out = ssl3_keys->pReturnedKeyMaterial;
 8106|  1.76k|            ssl3_keys_out->hClientMacSecret = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  1.76k|#define CK_INVALID_HANDLE 0
  ------------------
 8107|  1.76k|            ssl3_keys_out->hServerMacSecret = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  1.76k|#define CK_INVALID_HANDLE 0
  ------------------
 8108|  1.76k|            ssl3_keys_out->hClientKey = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  1.76k|#define CK_INVALID_HANDLE 0
  ------------------
 8109|  1.76k|            ssl3_keys_out->hServerKey = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  1.76k|#define CK_INVALID_HANDLE 0
  ------------------
 8110|       |
 8111|       |            /*
 8112|       |             * How much key material do we need?
 8113|       |             */
 8114|  1.76k|            macSize = ssl3_keys->ulMacSizeInBits / 8;
 8115|  1.76k|            effKeySize = ssl3_keys->ulKeySizeInBits / 8;
 8116|  1.76k|            IVSize = ssl3_keys->ulIVSizeInBits / 8;
 8117|  1.76k|            if (keySize == 0) {
  ------------------
  |  Branch (8117:17): [True: 374, False: 1.38k]
  ------------------
 8118|    374|                effKeySize = keySize;
 8119|    374|            }
 8120|       |
 8121|       |            /* bIsExport must be false. */
 8122|  1.76k|            if (ssl3_keys->bIsExport) {
  ------------------
  |  Branch (8122:17): [True: 0, False: 1.76k]
  ------------------
 8123|      0|                MD5_DestroyContext(md5, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8124|      0|                SHA1_DestroyContext(sha, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8125|      0|                PORT_Memset(srcrdata, 0, sizeof srcrdata);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 8126|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8127|      0|                break;
 8128|      0|            }
 8129|       |
 8130|  1.76k|            block_needed = 2 * (macSize + effKeySize + IVSize);
 8131|  1.76k|            PORT_Assert(block_needed <= sizeof key_block);
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8132|  1.76k|            if (block_needed > sizeof key_block)
  ------------------
  |  Branch (8132:17): [True: 0, False: 1.76k]
  ------------------
 8133|      0|                block_needed = sizeof key_block;
 8134|       |
 8135|       |            /*
 8136|       |             * generate the key material: This looks amazingly similar to the
 8137|       |             * PMS code, and is clearly crying out for a function to provide it.
 8138|       |             */
 8139|  1.76k|            if (isTLS) {
  ------------------
  |  Branch (8139:17): [True: 1.76k, False: 0]
  ------------------
 8140|  1.76k|                SECStatus status;
 8141|  1.76k|                SECItem srcr = { siBuffer, NULL, 0 };
 8142|  1.76k|                SECItem keyblk = { siBuffer, NULL, 0 };
 8143|  1.76k|                SECItem master = { siBuffer, NULL, 0 };
 8144|       |
 8145|  1.76k|                srcr.data = srcrdata;
 8146|  1.76k|                srcr.len = sizeof srcrdata;
 8147|  1.76k|                keyblk.data = key_block;
 8148|  1.76k|                keyblk.len = block_needed;
 8149|  1.76k|                master.data = (unsigned char *)att->attrib.pValue;
 8150|  1.76k|                master.len = att->attrib.ulValueLen;
 8151|       |
 8152|  1.76k|                if (tlsPrfHash != HASH_AlgNULL) {
  ------------------
  |  Branch (8152:21): [True: 1.60k, False: 157]
  ------------------
 8153|  1.60k|                    status = TLS_P_hash(tlsPrfHash, &master, "key expansion",
 8154|  1.60k|                                        &srcr, &keyblk, isFIPS);
 8155|  1.60k|                } else {
 8156|    157|                    status = TLS_PRF(&master, "key expansion", &srcr, &keyblk,
 8157|    157|                                     isFIPS);
 8158|    157|                }
 8159|  1.76k|                if (status != SECSuccess) {
  ------------------
  |  Branch (8159:21): [True: 0, False: 1.76k]
  ------------------
 8160|      0|                    goto key_and_mac_derive_fail;
 8161|      0|                }
 8162|  1.76k|            } else {
 8163|      0|                unsigned int block_bytes = 0;
 8164|       |                /* key_block =
 8165|       |                 *     MD5(master_secret + SHA('A' + master_secret +
 8166|       |                 *                      ServerHello.random + ClientHello.random)) +
 8167|       |                 *     MD5(master_secret + SHA('BB' + master_secret +
 8168|       |                 *                      ServerHello.random + ClientHello.random)) +
 8169|       |                 *     MD5(master_secret + SHA('CCC' + master_secret +
 8170|       |                 *                      ServerHello.random + ClientHello.random)) +
 8171|       |                 *     [...];
 8172|       |                 */
 8173|      0|                for (i = 0; i < NUM_MIXERS && block_bytes < block_needed; i++) {
  ------------------
  |  | 7505|      0|#define NUM_MIXERS 9
  ------------------
  |  Branch (8173:29): [True: 0, False: 0]
  |  Branch (8173:47): [True: 0, False: 0]
  ------------------
 8174|      0|                    SHA1_Begin(sha);
 8175|      0|                    SHA1_Update(sha, (unsigned char *)mixers[i], strlen(mixers[i]));
 8176|      0|                    SHA1_Update(sha, (const unsigned char *)att->attrib.pValue,
 8177|      0|                                att->attrib.ulValueLen);
 8178|      0|                    SHA1_Update(sha, srcrdata, sizeof srcrdata);
 8179|      0|                    SHA1_End(sha, sha_out, &outLen, SHA1_LENGTH);
  ------------------
  |  |   39|      0|#define SHA1_LENGTH 20
  ------------------
 8180|      0|                    PORT_Assert(outLen == SHA1_LENGTH);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8181|      0|                    MD5_Begin(md5);
 8182|      0|                    MD5_Update(md5, (const unsigned char *)att->attrib.pValue,
 8183|      0|                               att->attrib.ulValueLen);
 8184|      0|                    MD5_Update(md5, sha_out, outLen);
 8185|      0|                    MD5_End(md5, &key_block[i * MD5_LENGTH], &outLen, MD5_LENGTH);
  ------------------
  |  |   38|      0|#define MD5_LENGTH 16
  ------------------
                                  MD5_End(md5, &key_block[i * MD5_LENGTH], &outLen, MD5_LENGTH);
  ------------------
  |  |   38|      0|#define MD5_LENGTH 16
  ------------------
 8186|      0|                    PORT_Assert(outLen == MD5_LENGTH);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8187|      0|                    block_bytes += outLen;
 8188|      0|                }
 8189|      0|                PORT_Memset(sha_out, 0, sizeof sha_out);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 8190|      0|            }
 8191|       |
 8192|       |            /*
 8193|       |             * Put the key material where it goes.
 8194|       |             */
 8195|  1.76k|            i = 0; /* now shows how much consumed */
 8196|       |
 8197|       |            /*
 8198|       |             * The key_block is partitioned as follows:
 8199|       |             * client_write_MAC_secret[CipherSpec.hash_size]
 8200|       |             */
 8201|  1.76k|            crv = sftk_buildSSLKey(hSession, key, PR_TRUE, &key_block[i], macSize,
  ------------------
  |  |  437|  1.76k|#define PR_TRUE 1
  ------------------
 8202|  1.76k|                                   &ssl3_keys_out->hClientMacSecret);
 8203|  1.76k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.76k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8203:17): [True: 0, False: 1.76k]
  ------------------
 8204|      0|                goto key_and_mac_derive_fail;
 8205|       |
 8206|  1.76k|            i += macSize;
 8207|       |
 8208|       |            /*
 8209|       |             * server_write_MAC_secret[CipherSpec.hash_size]
 8210|       |             */
 8211|  1.76k|            crv = sftk_buildSSLKey(hSession, key, PR_TRUE, &key_block[i], macSize,
  ------------------
  |  |  437|  1.76k|#define PR_TRUE 1
  ------------------
 8212|  1.76k|                                   &ssl3_keys_out->hServerMacSecret);
 8213|  1.76k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.76k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8213:17): [True: 0, False: 1.76k]
  ------------------
 8214|      0|                goto key_and_mac_derive_fail;
 8215|      0|            }
 8216|  1.76k|            i += macSize;
 8217|       |
 8218|  1.76k|            if (keySize) {
  ------------------
  |  Branch (8218:17): [True: 1.38k, False: 374]
  ------------------
 8219|       |                /*
 8220|       |                ** Generate Domestic write keys and IVs.
 8221|       |                ** client_write_key[CipherSpec.key_material]
 8222|       |                */
 8223|  1.38k|                crv = sftk_buildSSLKey(hSession, key, PR_FALSE, &key_block[i],
  ------------------
  |  |  438|  1.38k|#define PR_FALSE 0
  ------------------
 8224|  1.38k|                                       keySize, &ssl3_keys_out->hClientKey);
 8225|  1.38k|                if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.38k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8225:21): [True: 0, False: 1.38k]
  ------------------
 8226|      0|                    goto key_and_mac_derive_fail;
 8227|      0|                }
 8228|  1.38k|                i += keySize;
 8229|       |
 8230|       |                /*
 8231|       |                ** server_write_key[CipherSpec.key_material]
 8232|       |                */
 8233|  1.38k|                crv = sftk_buildSSLKey(hSession, key, PR_FALSE, &key_block[i],
  ------------------
  |  |  438|  1.38k|#define PR_FALSE 0
  ------------------
 8234|  1.38k|                                       keySize, &ssl3_keys_out->hServerKey);
 8235|  1.38k|                if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.38k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8235:21): [True: 0, False: 1.38k]
  ------------------
 8236|      0|                    goto key_and_mac_derive_fail;
 8237|      0|                }
 8238|  1.38k|                i += keySize;
 8239|       |
 8240|       |                /*
 8241|       |                ** client_write_IV[CipherSpec.IV_size]
 8242|       |                */
 8243|  1.38k|                if (IVSize > 0) {
  ------------------
  |  Branch (8243:21): [True: 1.38k, False: 0]
  ------------------
 8244|  1.38k|                    PORT_Memcpy(ssl3_keys_out->pIVClient,
  ------------------
  |  |  180|  1.38k|#define PORT_Memcpy memcpy
  ------------------
 8245|  1.38k|                                &key_block[i], IVSize);
 8246|  1.38k|                    i += IVSize;
 8247|  1.38k|                }
 8248|       |
 8249|       |                /*
 8250|       |                ** server_write_IV[CipherSpec.IV_size]
 8251|       |                */
 8252|  1.38k|                if (IVSize > 0) {
  ------------------
  |  Branch (8252:21): [True: 1.38k, False: 0]
  ------------------
 8253|  1.38k|                    PORT_Memcpy(ssl3_keys_out->pIVServer,
  ------------------
  |  |  180|  1.38k|#define PORT_Memcpy memcpy
  ------------------
 8254|  1.38k|                                &key_block[i], IVSize);
 8255|  1.38k|                    i += IVSize;
 8256|  1.38k|                }
 8257|  1.38k|                PORT_Assert(i <= sizeof key_block);
  ------------------
  |  |  120|  1.38k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.38k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.38k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8258|  1.38k|            }
 8259|       |
 8260|  1.76k|            crv = CKR_OK;
  ------------------
  |  | 1388|  1.76k|#define CKR_OK 0x00000000UL
  ------------------
 8261|       |
 8262|  1.76k|            if (0) {
  ------------------
  |  Branch (8262:17): [Folded - Ignored]
  ------------------
 8263|      0|            key_and_mac_derive_fail:
 8264|      0|                if (crv == CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8264:21): [True: 0, False: 0]
  ------------------
 8265|      0|                    crv = CKR_FUNCTION_FAILED;
  ------------------
  |  | 1397|      0|#define CKR_FUNCTION_FAILED 0x00000006UL
  ------------------
 8266|      0|                sftk_freeSSLKeys(hSession, ssl3_keys_out);
 8267|      0|            }
 8268|  1.76k|            PORT_Memset(srcrdata, 0, sizeof srcrdata);
  ------------------
  |  |  182|  1.76k|#define PORT_Memset memset
  ------------------
 8269|  1.76k|            PORT_Memset(key_block, 0, sizeof key_block);
  ------------------
  |  |  182|  1.76k|#define PORT_Memset memset
  ------------------
 8270|  1.76k|            MD5_DestroyContext(md5, PR_TRUE);
  ------------------
  |  |  437|  1.76k|#define PR_TRUE 1
  ------------------
 8271|  1.76k|            SHA1_DestroyContext(sha, PR_TRUE);
  ------------------
  |  |  437|  1.76k|#define PR_TRUE 1
  ------------------
 8272|  1.76k|            sftk_FreeObject(key);
 8273|  1.76k|            key = NULL;
 8274|  1.76k|            break;
 8275|  1.76k|        }
 8276|       |
 8277|      0|        case CKM_DES3_ECB_ENCRYPT_DATA:
  ------------------
  |  | 1184|      0|#define CKM_DES3_ECB_ENCRYPT_DATA 0x00001102UL
  ------------------
  |  Branch (8277:9): [True: 0, False: 26.1k]
  ------------------
 8278|      0|        case CKM_DES3_CBC_ENCRYPT_DATA: {
  ------------------
  |  | 1185|      0|#define CKM_DES3_CBC_ENCRYPT_DATA 0x00001103UL
  ------------------
  |  Branch (8278:9): [True: 0, False: 26.1k]
  ------------------
 8279|      0|            void *cipherInfo;
 8280|      0|            unsigned char des3key[MAX_DES3_KEY_SIZE];
 8281|      0|            CK_DES_CBC_ENCRYPT_DATA_PARAMS *desEncryptPtr;
 8282|      0|            int mode;
 8283|      0|            unsigned char *iv;
 8284|      0|            unsigned char *data;
 8285|      0|            CK_ULONG len;
 8286|       |
 8287|      0|            if (mechanism == CKM_DES3_ECB_ENCRYPT_DATA) {
  ------------------
  |  | 1184|      0|#define CKM_DES3_ECB_ENCRYPT_DATA 0x00001102UL
  ------------------
  |  Branch (8287:17): [True: 0, False: 0]
  ------------------
 8288|      0|                if (BAD_PARAM_CAST(pMechanism, sizeof(CK_KEY_DERIVATION_STRING_DATA))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8289|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8290|      0|                    break;
 8291|      0|                }
 8292|      0|                stringPtr = (CK_KEY_DERIVATION_STRING_DATA *)
 8293|      0|                                pMechanism->pParameter;
 8294|      0|                mode = NSS_DES_EDE3;
  ------------------
  |  |   27|      0|#define NSS_DES_EDE3 2
  ------------------
 8295|      0|                iv = NULL;
 8296|      0|                data = stringPtr->pData;
 8297|      0|                len = stringPtr->ulLen;
 8298|      0|            } else {
 8299|      0|                mode = NSS_DES_EDE3_CBC;
  ------------------
  |  |   28|      0|#define NSS_DES_EDE3_CBC 3
  ------------------
 8300|      0|                desEncryptPtr =
 8301|      0|                    (CK_DES_CBC_ENCRYPT_DATA_PARAMS *)
 8302|      0|                        pMechanism->pParameter;
 8303|      0|                iv = desEncryptPtr->iv;
 8304|      0|                data = desEncryptPtr->pData;
 8305|      0|                len = desEncryptPtr->length;
 8306|      0|            }
 8307|      0|            if (att->attrib.ulValueLen == 16) {
  ------------------
  |  Branch (8307:17): [True: 0, False: 0]
  ------------------
 8308|      0|                PORT_Memcpy(des3key, att->attrib.pValue, 16);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8309|      0|                PORT_Memcpy(des3key + 16, des3key, 8);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8310|      0|            } else if (att->attrib.ulValueLen == 24) {
  ------------------
  |  Branch (8310:24): [True: 0, False: 0]
  ------------------
 8311|      0|                PORT_Memcpy(des3key, att->attrib.pValue, 24);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8312|      0|            } else {
 8313|      0|                crv = CKR_KEY_SIZE_RANGE;
  ------------------
  |  | 1432|      0|#define CKR_KEY_SIZE_RANGE 0x00000062UL
  ------------------
 8314|      0|                break;
 8315|      0|            }
 8316|      0|            cipherInfo = DES_CreateContext(des3key, iv, mode, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8317|      0|            PORT_Memset(des3key, 0, 24);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 8318|      0|            if (cipherInfo == NULL) {
  ------------------
  |  Branch (8318:17): [True: 0, False: 0]
  ------------------
 8319|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8320|      0|                break;
 8321|      0|            }
 8322|      0|            crv = sftk_DeriveEncrypt(SFTKCipher_DES_Encrypt,
 8323|      0|                                     cipherInfo, 8, key, keySize,
 8324|      0|                                     data, len);
 8325|      0|            DES_DestroyContext(cipherInfo, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8326|      0|            break;
 8327|      0|        }
 8328|       |
 8329|      0|        case CKM_AES_ECB_ENCRYPT_DATA:
  ------------------
  |  | 1186|      0|#define CKM_AES_ECB_ENCRYPT_DATA 0x00001104UL
  ------------------
  |  Branch (8329:9): [True: 0, False: 26.1k]
  ------------------
 8330|      0|        case CKM_AES_CBC_ENCRYPT_DATA: {
  ------------------
  |  | 1187|      0|#define CKM_AES_CBC_ENCRYPT_DATA 0x00001105UL
  ------------------
  |  Branch (8330:9): [True: 0, False: 26.1k]
  ------------------
 8331|      0|            void *cipherInfo;
 8332|      0|            CK_AES_CBC_ENCRYPT_DATA_PARAMS *aesEncryptPtr;
 8333|      0|            int mode;
 8334|      0|            unsigned char *iv;
 8335|      0|            unsigned char *data;
 8336|      0|            CK_ULONG len;
 8337|       |
 8338|      0|            if (mechanism == CKM_AES_ECB_ENCRYPT_DATA) {
  ------------------
  |  | 1186|      0|#define CKM_AES_ECB_ENCRYPT_DATA 0x00001104UL
  ------------------
  |  Branch (8338:17): [True: 0, False: 0]
  ------------------
 8339|      0|                mode = NSS_AES;
  ------------------
  |  |   35|      0|#define NSS_AES 0
  ------------------
 8340|      0|                iv = NULL;
 8341|      0|                if (BAD_PARAM_CAST(pMechanism, sizeof(CK_KEY_DERIVATION_STRING_DATA))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8342|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8343|      0|                    break;
 8344|      0|                }
 8345|      0|                stringPtr = (CK_KEY_DERIVATION_STRING_DATA *)pMechanism->pParameter;
 8346|      0|                data = stringPtr->pData;
 8347|      0|                len = stringPtr->ulLen;
 8348|      0|            } else {
 8349|      0|                if (BAD_PARAM_CAST(pMechanism, sizeof(CK_AES_CBC_ENCRYPT_DATA_PARAMS))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8350|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8351|      0|                    break;
 8352|      0|                }
 8353|      0|                aesEncryptPtr =
 8354|      0|                    (CK_AES_CBC_ENCRYPT_DATA_PARAMS *)pMechanism->pParameter;
 8355|      0|                mode = NSS_AES_CBC;
  ------------------
  |  |   36|      0|#define NSS_AES_CBC 1
  ------------------
 8356|      0|                iv = aesEncryptPtr->iv;
 8357|      0|                data = aesEncryptPtr->pData;
 8358|      0|                len = aesEncryptPtr->length;
 8359|      0|            }
 8360|       |
 8361|      0|            cipherInfo = AES_CreateContext((unsigned char *)att->attrib.pValue,
 8362|      0|                                           iv, mode, PR_TRUE,
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8363|      0|                                           att->attrib.ulValueLen, 16);
 8364|      0|            if (cipherInfo == NULL) {
  ------------------
  |  Branch (8364:17): [True: 0, False: 0]
  ------------------
 8365|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8366|      0|                break;
 8367|      0|            }
 8368|      0|            crv = sftk_DeriveEncrypt(SFTKCipher_AES_Encrypt,
 8369|      0|                                     cipherInfo, 16, key, keySize,
 8370|      0|                                     data, len);
 8371|      0|            AES_DestroyContext(cipherInfo, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8372|      0|            break;
 8373|      0|        }
 8374|       |
 8375|      0|        case CKM_CAMELLIA_ECB_ENCRYPT_DATA:
  ------------------
  |  | 1141|      0|#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556UL
  ------------------
  |  Branch (8375:9): [True: 0, False: 26.1k]
  ------------------
 8376|      0|        case CKM_CAMELLIA_CBC_ENCRYPT_DATA: {
  ------------------
  |  | 1142|      0|#define CKM_CAMELLIA_CBC_ENCRYPT_DATA 0x00000557UL
  ------------------
  |  Branch (8376:9): [True: 0, False: 26.1k]
  ------------------
 8377|      0|            void *cipherInfo;
 8378|      0|            CK_AES_CBC_ENCRYPT_DATA_PARAMS *aesEncryptPtr;
 8379|      0|            int mode;
 8380|      0|            unsigned char *iv;
 8381|      0|            unsigned char *data;
 8382|      0|            CK_ULONG len;
 8383|       |
 8384|      0|            if (mechanism == CKM_CAMELLIA_ECB_ENCRYPT_DATA) {
  ------------------
  |  | 1141|      0|#define CKM_CAMELLIA_ECB_ENCRYPT_DATA 0x00000556UL
  ------------------
  |  Branch (8384:17): [True: 0, False: 0]
  ------------------
 8385|      0|                if (BAD_PARAM_CAST(pMechanism, sizeof(CK_KEY_DERIVATION_STRING_DATA))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8386|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8387|      0|                    break;
 8388|      0|                }
 8389|      0|                stringPtr = (CK_KEY_DERIVATION_STRING_DATA *)
 8390|      0|                                pMechanism->pParameter;
 8391|      0|                aesEncryptPtr = NULL;
 8392|      0|                mode = NSS_CAMELLIA;
  ------------------
  |  |   42|      0|#define NSS_CAMELLIA 0
  ------------------
 8393|      0|                data = stringPtr->pData;
 8394|      0|                len = stringPtr->ulLen;
 8395|      0|                iv = NULL;
 8396|      0|            } else {
 8397|      0|                if (BAD_PARAM_CAST(pMechanism, sizeof(CK_AES_CBC_ENCRYPT_DATA_PARAMS))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8398|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8399|      0|                    break;
 8400|      0|                }
 8401|      0|                stringPtr = NULL;
 8402|      0|                aesEncryptPtr = (CK_AES_CBC_ENCRYPT_DATA_PARAMS *)
 8403|      0|                                    pMechanism->pParameter;
 8404|      0|                mode = NSS_CAMELLIA_CBC;
  ------------------
  |  |   43|      0|#define NSS_CAMELLIA_CBC 1
  ------------------
 8405|      0|                iv = aesEncryptPtr->iv;
 8406|      0|                data = aesEncryptPtr->pData;
 8407|      0|                len = aesEncryptPtr->length;
 8408|      0|            }
 8409|       |
 8410|      0|            cipherInfo = Camellia_CreateContext((unsigned char *)att->attrib.pValue,
 8411|      0|                                                iv, mode, PR_TRUE,
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8412|      0|                                                att->attrib.ulValueLen);
 8413|      0|            if (cipherInfo == NULL) {
  ------------------
  |  Branch (8413:17): [True: 0, False: 0]
  ------------------
 8414|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8415|      0|                break;
 8416|      0|            }
 8417|      0|            crv = sftk_DeriveEncrypt(SFTKCipher_Camellia_Encrypt,
 8418|      0|                                     cipherInfo, 16, key, keySize,
 8419|      0|                                     data, len);
 8420|      0|            Camellia_DestroyContext(cipherInfo, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8421|      0|            break;
 8422|      0|        }
 8423|       |
 8424|      0|#ifndef NSS_DISABLE_DEPRECATED_SEED
 8425|      0|        case CKM_SEED_ECB_ENCRYPT_DATA:
  ------------------
  |  | 1161|      0|#define CKM_SEED_ECB_ENCRYPT_DATA 0x00000656UL
  ------------------
  |  Branch (8425:9): [True: 0, False: 26.1k]
  ------------------
 8426|      0|        case CKM_SEED_CBC_ENCRYPT_DATA: {
  ------------------
  |  | 1162|      0|#define CKM_SEED_CBC_ENCRYPT_DATA 0x00000657UL
  ------------------
  |  Branch (8426:9): [True: 0, False: 26.1k]
  ------------------
 8427|      0|            void *cipherInfo;
 8428|      0|            CK_AES_CBC_ENCRYPT_DATA_PARAMS *aesEncryptPtr;
 8429|      0|            int mode;
 8430|      0|            unsigned char *iv;
 8431|      0|            unsigned char *data;
 8432|      0|            CK_ULONG len;
 8433|       |
 8434|      0|            if (mechanism == CKM_SEED_ECB_ENCRYPT_DATA) {
  ------------------
  |  | 1161|      0|#define CKM_SEED_ECB_ENCRYPT_DATA 0x00000656UL
  ------------------
  |  Branch (8434:17): [True: 0, False: 0]
  ------------------
 8435|      0|                if (BAD_PARAM_CAST(pMechanism, sizeof(CK_KEY_DERIVATION_STRING_DATA))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8436|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8437|      0|                    break;
 8438|      0|                }
 8439|      0|                mode = NSS_SEED;
  ------------------
  |  |   46|      0|#define NSS_SEED 0
  ------------------
 8440|      0|                stringPtr = (CK_KEY_DERIVATION_STRING_DATA *)
 8441|      0|                                pMechanism->pParameter;
 8442|      0|                aesEncryptPtr = NULL;
 8443|      0|                data = stringPtr->pData;
 8444|      0|                len = stringPtr->ulLen;
 8445|      0|                iv = NULL;
 8446|      0|            } else {
 8447|      0|                if (BAD_PARAM_CAST(pMechanism, sizeof(CK_AES_CBC_ENCRYPT_DATA_PARAMS))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8448|      0|                    crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8449|      0|                    break;
 8450|      0|                }
 8451|      0|                mode = NSS_SEED_CBC;
  ------------------
  |  |   47|      0|#define NSS_SEED_CBC 1
  ------------------
 8452|      0|                aesEncryptPtr = (CK_AES_CBC_ENCRYPT_DATA_PARAMS *)
 8453|      0|                                    pMechanism->pParameter;
 8454|      0|                iv = aesEncryptPtr->iv;
 8455|      0|                data = aesEncryptPtr->pData;
 8456|      0|                len = aesEncryptPtr->length;
 8457|      0|            }
 8458|       |
 8459|      0|            cipherInfo = SEED_CreateContext((unsigned char *)att->attrib.pValue,
 8460|      0|                                            iv, mode, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8461|      0|            if (cipherInfo == NULL) {
  ------------------
  |  Branch (8461:17): [True: 0, False: 0]
  ------------------
 8462|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8463|      0|                break;
 8464|      0|            }
 8465|      0|            crv = sftk_DeriveEncrypt(SFTKCipher_SEED_Encrypt,
 8466|      0|                                     cipherInfo, 16, key, keySize,
 8467|      0|                                     data, len);
 8468|      0|            SEED_DestroyContext(cipherInfo, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8469|      0|            break;
 8470|      0|        }
 8471|      0|#endif /* NSS_DISABLE_DEPRECATED_SEED */
 8472|       |
 8473|      0|        case CKM_CONCATENATE_BASE_AND_KEY: {
  ------------------
  |  |  954|      0|#define CKM_CONCATENATE_BASE_AND_KEY 0x00000360UL
  ------------------
  |  Branch (8473:9): [True: 0, False: 26.1k]
  ------------------
 8474|      0|            SFTKObject *paramKey;
 8475|       |
 8476|      0|            crv = sftk_DeriveSensitiveCheck(sourceKey, key, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8477|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8477:17): [True: 0, False: 0]
  ------------------
 8478|      0|                break;
 8479|       |
 8480|      0|            session = sftk_SessionFromHandle(hSession);
 8481|      0|            if (session == NULL) {
  ------------------
  |  Branch (8481:17): [True: 0, False: 0]
  ------------------
 8482|      0|                crv = CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 8483|      0|                break;
 8484|      0|            }
 8485|       |
 8486|      0|            paramKey = sftk_ObjectFromHandle(*(CK_OBJECT_HANDLE *)
 8487|      0|                                                  pMechanism->pParameter,
 8488|      0|                                             session);
 8489|      0|            sftk_FreeSession(session);
 8490|      0|            if (paramKey == NULL) {
  ------------------
  |  Branch (8490:17): [True: 0, False: 0]
  ------------------
 8491|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 8492|      0|                break;
 8493|      0|            }
 8494|       |
 8495|      0|            if (sftk_isTrue(paramKey, CKA_SENSITIVE)) {
  ------------------
  |  |  546|      0|#define CKA_SENSITIVE 0x00000103UL
  ------------------
  |  Branch (8495:17): [True: 0, False: 0]
  ------------------
 8496|      0|                crv = sftk_forceAttribute(key, CKA_SENSITIVE, &cktrue,
  ------------------
  |  |  546|      0|#define CKA_SENSITIVE 0x00000103UL
  ------------------
 8497|      0|                                          sizeof(CK_BBOOL));
 8498|      0|                if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8498:21): [True: 0, False: 0]
  ------------------
 8499|      0|                    sftk_FreeObject(paramKey);
 8500|      0|                    break;
 8501|      0|                }
 8502|      0|            }
 8503|       |
 8504|      0|            if (sftk_hasAttribute(paramKey, CKA_EXTRACTABLE) && !sftk_isTrue(paramKey, CKA_EXTRACTABLE)) {
  ------------------
  |  |  585|      0|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
                          if (sftk_hasAttribute(paramKey, CKA_EXTRACTABLE) && !sftk_isTrue(paramKey, CKA_EXTRACTABLE)) {
  ------------------
  |  |  585|      0|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
  |  Branch (8504:17): [True: 0, False: 0]
  |  Branch (8504:65): [True: 0, False: 0]
  ------------------
 8505|      0|                crv = sftk_forceAttribute(key, CKA_EXTRACTABLE, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  585|      0|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
 8506|      0|                if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8506:21): [True: 0, False: 0]
  ------------------
 8507|      0|                    sftk_FreeObject(paramKey);
 8508|      0|                    break;
 8509|      0|                }
 8510|      0|            }
 8511|       |
 8512|      0|            att2 = sftk_FindAttribute(paramKey, CKA_VALUE);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 8513|      0|            if (att2 == NULL) {
  ------------------
  |  Branch (8513:17): [True: 0, False: 0]
  ------------------
 8514|      0|                sftk_FreeObject(paramKey);
 8515|      0|                crv = CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
 8516|      0|                break;
 8517|      0|            }
 8518|      0|            tmpKeySize = att->attrib.ulValueLen + att2->attrib.ulValueLen;
 8519|      0|            if (keySize == 0)
  ------------------
  |  Branch (8519:17): [True: 0, False: 0]
  ------------------
 8520|      0|                keySize = tmpKeySize;
 8521|      0|            if (keySize > tmpKeySize) {
  ------------------
  |  Branch (8521:17): [True: 0, False: 0]
  ------------------
 8522|      0|                sftk_FreeObject(paramKey);
 8523|      0|                sftk_FreeAttribute(att2);
 8524|      0|                crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 8525|      0|                break;
 8526|      0|            }
 8527|      0|            buf = (unsigned char *)PORT_Alloc(tmpKeySize);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 8528|      0|            if (buf == NULL) {
  ------------------
  |  Branch (8528:17): [True: 0, False: 0]
  ------------------
 8529|      0|                sftk_FreeAttribute(att2);
 8530|      0|                sftk_FreeObject(paramKey);
 8531|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8532|      0|                break;
 8533|      0|            }
 8534|       |
 8535|      0|            PORT_Memcpy(buf, att->attrib.pValue, att->attrib.ulValueLen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8536|      0|            PORT_Memcpy(buf + att->attrib.ulValueLen,
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8537|      0|                        att2->attrib.pValue, att2->attrib.ulValueLen);
 8538|       |
 8539|      0|            crv = sftk_forceAttribute(key, CKA_VALUE, buf, keySize);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 8540|      0|            PORT_ZFree(buf, tmpKeySize);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 8541|      0|            sftk_FreeAttribute(att2);
 8542|      0|            sftk_FreeObject(paramKey);
 8543|      0|            break;
 8544|      0|        }
 8545|       |
 8546|      0|        case CKM_CONCATENATE_BASE_AND_DATA:
  ------------------
  |  |  955|      0|#define CKM_CONCATENATE_BASE_AND_DATA 0x00000362UL
  ------------------
  |  Branch (8546:9): [True: 0, False: 26.1k]
  ------------------
 8547|      0|            crv = sftk_DeriveSensitiveCheck(sourceKey, key, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8548|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8548:17): [True: 0, False: 0]
  ------------------
 8549|      0|                break;
 8550|       |
 8551|      0|            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_KEY_DERIVATION_STRING_DATA))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8552|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8553|      0|                break;
 8554|      0|            }
 8555|      0|            stringPtr = (CK_KEY_DERIVATION_STRING_DATA *)pMechanism->pParameter;
 8556|      0|            tmpKeySize = att->attrib.ulValueLen + stringPtr->ulLen;
 8557|      0|            if (keySize == 0)
  ------------------
  |  Branch (8557:17): [True: 0, False: 0]
  ------------------
 8558|      0|                keySize = tmpKeySize;
 8559|      0|            if (keySize > tmpKeySize) {
  ------------------
  |  Branch (8559:17): [True: 0, False: 0]
  ------------------
 8560|      0|                crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 8561|      0|                break;
 8562|      0|            }
 8563|      0|            buf = (unsigned char *)PORT_Alloc(tmpKeySize);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 8564|      0|            if (buf == NULL) {
  ------------------
  |  Branch (8564:17): [True: 0, False: 0]
  ------------------
 8565|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8566|      0|                break;
 8567|      0|            }
 8568|       |
 8569|      0|            PORT_Memcpy(buf, att->attrib.pValue, att->attrib.ulValueLen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8570|      0|            PORT_Memcpy(buf + att->attrib.ulValueLen, stringPtr->pData,
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8571|      0|                        stringPtr->ulLen);
 8572|       |
 8573|      0|            crv = sftk_forceAttribute(key, CKA_VALUE, buf, keySize);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 8574|      0|            PORT_ZFree(buf, tmpKeySize);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 8575|      0|            break;
 8576|      0|        case CKM_CONCATENATE_DATA_AND_BASE:
  ------------------
  |  |  956|      0|#define CKM_CONCATENATE_DATA_AND_BASE 0x00000363UL
  ------------------
  |  Branch (8576:9): [True: 0, False: 26.1k]
  ------------------
 8577|      0|            crv = sftk_DeriveSensitiveCheck(sourceKey, key, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8578|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8578:17): [True: 0, False: 0]
  ------------------
 8579|      0|                break;
 8580|       |
 8581|      0|            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_KEY_DERIVATION_STRING_DATA))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8582|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8583|      0|                break;
 8584|      0|            }
 8585|      0|            stringPtr = (CK_KEY_DERIVATION_STRING_DATA *)pMechanism->pParameter;
 8586|      0|            tmpKeySize = att->attrib.ulValueLen + stringPtr->ulLen;
 8587|      0|            if (keySize == 0)
  ------------------
  |  Branch (8587:17): [True: 0, False: 0]
  ------------------
 8588|      0|                keySize = tmpKeySize;
 8589|      0|            if (keySize > tmpKeySize) {
  ------------------
  |  Branch (8589:17): [True: 0, False: 0]
  ------------------
 8590|      0|                crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 8591|      0|                break;
 8592|      0|            }
 8593|      0|            buf = (unsigned char *)PORT_Alloc(tmpKeySize);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 8594|      0|            if (buf == NULL) {
  ------------------
  |  Branch (8594:17): [True: 0, False: 0]
  ------------------
 8595|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8596|      0|                break;
 8597|      0|            }
 8598|       |
 8599|      0|            PORT_Memcpy(buf, stringPtr->pData, stringPtr->ulLen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8600|      0|            PORT_Memcpy(buf + stringPtr->ulLen, att->attrib.pValue,
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8601|      0|                        att->attrib.ulValueLen);
 8602|       |
 8603|      0|            crv = sftk_forceAttribute(key, CKA_VALUE, buf, keySize);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 8604|      0|            PORT_ZFree(buf, tmpKeySize);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 8605|      0|            break;
 8606|      0|        case CKM_XOR_BASE_AND_DATA:
  ------------------
  |  |  957|      0|#define CKM_XOR_BASE_AND_DATA 0x00000364UL
  ------------------
  |  Branch (8606:9): [True: 0, False: 26.1k]
  ------------------
 8607|      0|            crv = sftk_DeriveSensitiveCheck(sourceKey, key, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8608|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8608:17): [True: 0, False: 0]
  ------------------
 8609|      0|                break;
 8610|       |
 8611|      0|            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_KEY_DERIVATION_STRING_DATA))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8612|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8613|      0|                break;
 8614|      0|            }
 8615|      0|            stringPtr = (CK_KEY_DERIVATION_STRING_DATA *)pMechanism->pParameter;
 8616|      0|            tmpKeySize = PR_MIN(att->attrib.ulValueLen, stringPtr->ulLen);
  ------------------
  |  |  158|      0|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8617|      0|            if (keySize == 0)
  ------------------
  |  Branch (8617:17): [True: 0, False: 0]
  ------------------
 8618|      0|                keySize = tmpKeySize;
 8619|      0|            if (keySize > tmpKeySize) {
  ------------------
  |  Branch (8619:17): [True: 0, False: 0]
  ------------------
 8620|      0|                crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 8621|      0|                break;
 8622|      0|            }
 8623|      0|            buf = (unsigned char *)PORT_Alloc(keySize);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 8624|      0|            if (buf == NULL) {
  ------------------
  |  Branch (8624:17): [True: 0, False: 0]
  ------------------
 8625|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8626|      0|                break;
 8627|      0|            }
 8628|       |
 8629|      0|            PORT_Memcpy(buf, att->attrib.pValue, keySize);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8630|      0|            for (i = 0; i < (int)keySize; i++) {
  ------------------
  |  Branch (8630:25): [True: 0, False: 0]
  ------------------
 8631|      0|                buf[i] ^= stringPtr->pData[i];
 8632|      0|            }
 8633|       |
 8634|      0|            crv = sftk_forceAttribute(key, CKA_VALUE, buf, keySize);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 8635|      0|            PORT_ZFree(buf, keySize);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 8636|      0|            break;
 8637|       |
 8638|      0|        case CKM_EXTRACT_KEY_FROM_KEY: {
  ------------------
  |  |  958|      0|#define CKM_EXTRACT_KEY_FROM_KEY 0x00000365UL
  ------------------
  |  Branch (8638:9): [True: 0, False: 26.1k]
  ------------------
 8639|      0|            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_EXTRACT_PARAMS))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8640|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8641|      0|                break;
 8642|      0|            }
 8643|       |            /* the following assumes 8 bits per byte */
 8644|      0|            CK_ULONG extract = *(CK_EXTRACT_PARAMS *)pMechanism->pParameter;
 8645|      0|            CK_ULONG shift = extract & 0x7; /* extract mod 8 the fast way */
 8646|      0|            CK_ULONG offset = extract >> 3; /* extract div 8 the fast way */
 8647|       |
 8648|      0|            crv = sftk_DeriveSensitiveCheck(sourceKey, key, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8649|      0|            if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8649:17): [True: 0, False: 0]
  ------------------
 8650|      0|                break;
 8651|       |
 8652|      0|            if (keySize == 0) {
  ------------------
  |  Branch (8652:17): [True: 0, False: 0]
  ------------------
 8653|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 8654|      0|                break;
 8655|      0|            }
 8656|       |            /* make sure we have enough bits in the original key */
 8657|      0|            if (att->attrib.ulValueLen <
  ------------------
  |  Branch (8657:17): [True: 0, False: 0]
  ------------------
 8658|      0|                (offset + keySize + ((shift != 0) ? 1 : 0))) {
  ------------------
  |  Branch (8658:38): [True: 0, False: 0]
  ------------------
 8659|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8660|      0|                break;
 8661|      0|            }
 8662|      0|            buf = (unsigned char *)PORT_Alloc(keySize);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 8663|      0|            if (buf == NULL) {
  ------------------
  |  Branch (8663:17): [True: 0, False: 0]
  ------------------
 8664|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8665|      0|                break;
 8666|      0|            }
 8667|       |
 8668|       |            /* copy the bits we need into the new key */
 8669|      0|            for (i = 0; i < (int)keySize; i++) {
  ------------------
  |  Branch (8669:25): [True: 0, False: 0]
  ------------------
 8670|      0|                unsigned char *value =
 8671|      0|                    ((unsigned char *)att->attrib.pValue) + offset + i;
 8672|      0|                if (shift) {
  ------------------
  |  Branch (8672:21): [True: 0, False: 0]
  ------------------
 8673|      0|                    buf[i] = (value[0] << (shift)) | (value[1] >> (8 - shift));
 8674|      0|                } else {
 8675|      0|                    buf[i] = value[0];
 8676|      0|                }
 8677|      0|            }
 8678|       |
 8679|      0|            crv = sftk_forceAttribute(key, CKA_VALUE, buf, keySize);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 8680|      0|            PORT_ZFree(buf, keySize);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 8681|      0|            break;
 8682|      0|        }
 8683|      0|        case CKM_MD2_KEY_DERIVATION:
  ------------------
  |  |  978|      0|#define CKM_MD2_KEY_DERIVATION 0x00000391UL
  ------------------
  |  Branch (8683:9): [True: 0, False: 26.1k]
  ------------------
 8684|      0|            if (keySize == 0)
  ------------------
  |  Branch (8684:17): [True: 0, False: 0]
  ------------------
 8685|      0|                keySize = MD2_LENGTH;
  ------------------
  |  |   37|      0|#define MD2_LENGTH 16
  ------------------
 8686|      0|            if (keySize > MD2_LENGTH) {
  ------------------
  |  |   37|      0|#define MD2_LENGTH 16
  ------------------
  |  Branch (8686:17): [True: 0, False: 0]
  ------------------
 8687|      0|                crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 8688|      0|                break;
 8689|      0|            }
 8690|       |            /* now allocate the hash contexts */
 8691|      0|            md2 = MD2_NewContext();
 8692|      0|            if (md2 == NULL) {
  ------------------
  |  Branch (8692:17): [True: 0, False: 0]
  ------------------
 8693|      0|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8694|      0|                break;
 8695|      0|            }
 8696|      0|            MD2_Begin(md2);
 8697|      0|            MD2_Update(md2, (const unsigned char *)att->attrib.pValue,
 8698|      0|                       att->attrib.ulValueLen);
 8699|      0|            MD2_End(md2, key_block, &outLen, MD2_LENGTH);
  ------------------
  |  |   37|      0|#define MD2_LENGTH 16
  ------------------
 8700|      0|            MD2_DestroyContext(md2, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8701|       |
 8702|      0|            crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
 8703|      0|            PORT_Memset(key_block, 0, MD2_LENGTH);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
                          PORT_Memset(key_block, 0, MD2_LENGTH);
  ------------------
  |  |   37|      0|#define MD2_LENGTH 16
  ------------------
 8704|      0|            break;
 8705|      0|#define DERIVE_KEY_HASH(hash)                                                \
 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
 8707|      0|        if (keySize == 0)                                                    \
 8708|      0|            keySize = hash##_LENGTH;                                         \
 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
 8711|      0|            break;                                                           \
 8712|      0|        }                                                                    \
 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
 8714|      0|                       att->attrib.ulValueLen);                              \
 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
 8717|      0|        break;
 8718|      0|            DERIVE_KEY_HASH(MD5)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8719|      0|            DERIVE_KEY_HASH(SHA1)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8720|      0|            DERIVE_KEY_HASH(SHA224)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8721|      0|            DERIVE_KEY_HASH(SHA256)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8722|      0|            DERIVE_KEY_HASH(SHA384)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8723|      0|            DERIVE_KEY_HASH(SHA512)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8724|      0|            DERIVE_KEY_HASH(SHA3_224)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8725|      0|            DERIVE_KEY_HASH(SHA3_256)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8726|      0|            DERIVE_KEY_HASH(SHA3_384)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8727|      0|            DERIVE_KEY_HASH(SHA3_512)
  ------------------
  |  | 8706|      0|    case CKM_##hash##_KEY_DERIVATION:                                        \
  |  |  ------------------
  |  |  |  Branch (8706:5): [True: 0, False: 26.1k]
  |  |  ------------------
  |  | 8707|      0|        if (keySize == 0)                                                    \
  |  |  ------------------
  |  |  |  Branch (8707:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8708|      0|            keySize = hash##_LENGTH;                                         \
  |  | 8709|      0|        if (keySize > hash##_LENGTH) {                                       \
  |  |  ------------------
  |  |  |  Branch (8709:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 8710|      0|            crv = CKR_TEMPLATE_INCONSISTENT;                                 \
  |  |  ------------------
  |  |  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  |  |  ------------------
  |  | 8711|      0|            break;                                                           \
  |  | 8712|      0|        }                                                                    \
  |  | 8713|      0|        hash##_HashBuf(key_block, (const unsigned char *)att->attrib.pValue, \
  |  | 8714|      0|                       att->attrib.ulValueLen);                              \
  |  | 8715|      0|        crv = sftk_forceAttribute(key, CKA_VALUE, key_block, keySize);       \
  |  |  ------------------
  |  |  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  |  |  ------------------
  |  | 8716|      0|        PORT_Memset(key_block, 0, hash##_LENGTH);                            \
  |  |  ------------------
  |  |  |  |  182|      0|#define PORT_Memset memset
  |  |  ------------------
  |  | 8717|      0|        break;
  ------------------
 8728|       |
 8729|  1.11k|        case CKM_DH_PKCS_DERIVE: {
  ------------------
  |  |  759|  1.11k|#define CKM_DH_PKCS_DERIVE 0x00000021UL
  ------------------
  |  Branch (8729:9): [True: 1.11k, False: 25.0k]
  ------------------
 8730|  1.11k|            SECItem derived, dhPublic;
 8731|  1.11k|            SECItem dhPrime, dhValue;
 8732|  1.11k|            const SECItem *subPrime;
 8733|       |            /* sourceKey - values for the local existing low key */
 8734|       |            /* get prime and value attributes */
 8735|  1.11k|            crv = sftk_Attribute2SecItem(NULL, &dhPrime, sourceKey, CKA_PRIME);
  ------------------
  |  |  569|  1.11k|#define CKA_PRIME 0x00000130UL
  ------------------
 8736|  1.11k|            if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.11k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8736:17): [True: 0, False: 1.11k]
  ------------------
 8737|      0|                break;
 8738|       |
 8739|  1.11k|            dhPublic.data = pMechanism->pParameter;
 8740|  1.11k|            dhPublic.len = pMechanism->ulParameterLen;
 8741|       |
 8742|       |            /* if the prime is an approved prime, we can skip all the other
 8743|       |             * checks. */
 8744|  1.11k|            subPrime = sftk_VerifyDH_Prime(&dhPrime, NULL, isFIPS);
 8745|  1.11k|            if (subPrime == NULL) {
  ------------------
  |  Branch (8745:17): [True: 408, False: 708]
  ------------------
 8746|    408|                SECItem dhSubPrime;
 8747|       |                /* If the caller set the subprime value, it means that
 8748|       |                 * either the caller knows the subprime value and wants us
 8749|       |                 * to validate the key against the subprime, or that the
 8750|       |                 * caller wants us to verify that the prime is a safe prime
 8751|       |                 * by passing in subprime = (prime-1)/2 */
 8752|    408|                dhSubPrime.data = NULL;
 8753|    408|                dhSubPrime.len = 0;
 8754|    408|                crv = sftk_Attribute2SecItem(NULL, &dhSubPrime,
 8755|    408|                                             sourceKey, CKA_SUBPRIME);
  ------------------
  |  |  570|    408|#define CKA_SUBPRIME 0x00000131UL
  ------------------
 8756|       |                /* we ignore the value of crv here, We treat a valid
 8757|       |                 * return of len = 0 and a failure to find a subrime the same
 8758|       |                 * NOTE: we free the subprime in both cases depending on
 8759|       |                 * PORT_Free of NULL to be a noop */
 8760|    408|                if (dhSubPrime.len != 0) {
  ------------------
  |  Branch (8760:21): [True: 0, False: 408]
  ------------------
 8761|      0|                    PRBool isSafe = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8762|       |
 8763|       |                    /* Callers can set dhSubPrime to q=(p-1)/2 to force
 8764|       |                     * checks for safe primes. If so we only need to check
 8765|       |                     * q and p for primality and skip the group test.  */
 8766|      0|                    rv = sftk_IsSafePrime(&dhPrime, &dhSubPrime, &isSafe);
 8767|      0|                    if (rv != SECSuccess) {
  ------------------
  |  Branch (8767:25): [True: 0, False: 0]
  ------------------
 8768|       |                        /* either p or q was even and therefore not prime,
 8769|       |                         * we can stop processing here and fail now */
 8770|      0|                        crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 8771|      0|                        SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                                      SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8772|      0|                        SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                                      SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8773|      0|                        break;
 8774|      0|                    }
 8775|       |
 8776|       |                    /* first make sure the primes are really prime */
 8777|      0|                    if (!KEA_PrimeCheck(&dhPrime)) {
  ------------------
  |  Branch (8777:25): [True: 0, False: 0]
  ------------------
 8778|      0|                        crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 8779|      0|                        SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                                      SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8780|      0|                        SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                                      SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8781|      0|                        break;
 8782|      0|                    }
 8783|      0|                    if (!KEA_PrimeCheck(&dhSubPrime)) {
  ------------------
  |  Branch (8783:25): [True: 0, False: 0]
  ------------------
 8784|      0|                        crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 8785|      0|                        SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                                      SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8786|      0|                        SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                                      SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8787|      0|                        break;
 8788|      0|                    }
 8789|      0|                    if (isFIPS || !isSafe) {
  ------------------
  |  Branch (8789:25): [True: 0, False: 0]
  |  Branch (8789:35): [True: 0, False: 0]
  ------------------
 8790|       |                        /* With safe primes, there is only one other small
 8791|       |                         * subgroup. As long as y isn't 0, 1, or -1 mod p,
 8792|       |                         * any other y is safe. Only do the full check for
 8793|       |                         * non-safe primes, except in FIPS mode we need
 8794|       |                         * to do this check on all primes in which
 8795|       |                         * we receive the subprime value */
 8796|      0|                        if (!KEA_Verify(&dhPublic, &dhPrime, &dhSubPrime)) {
  ------------------
  |  Branch (8796:29): [True: 0, False: 0]
  ------------------
 8797|      0|                            crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 8798|      0|                            SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                                          SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8799|      0|                            SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                                          SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8800|      0|                            break;
 8801|      0|                        }
 8802|      0|                    }
 8803|    408|                } else if (isFIPS) {
  ------------------
  |  Branch (8803:28): [True: 0, False: 408]
  ------------------
 8804|       |                    /* In FIPS mode we only accept approved primes, or
 8805|       |                     * primes with the full subprime value */
 8806|      0|                    crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 8807|      0|                    SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                                  SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8808|      0|                    break;
 8809|      0|                }
 8810|       |                /* checks are complete, no need for the subPrime any longer */
 8811|    408|                SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  110|    408|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhSubPrime, PR_FALSE);
  ------------------
  |  |  438|    408|#define PR_FALSE 0
  ------------------
 8812|    408|            }
 8813|       |
 8814|       |            /* now that the prime is validated, get the private value */
 8815|  1.11k|            crv = sftk_Attribute2SecItem(NULL, &dhValue, sourceKey, CKA_VALUE);
  ------------------
  |  |  516|  1.11k|#define CKA_VALUE 0x00000011UL
  ------------------
 8816|  1.11k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.11k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8816:17): [True: 0, False: 1.11k]
  ------------------
 8817|      0|                SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8818|      0|                break;
 8819|      0|            }
 8820|       |
 8821|       |            /* calculate private value - oct */
 8822|  1.11k|            rv = DH_Derive(&dhPublic, &dhPrime, &dhValue, &derived, keySize);
 8823|       |
 8824|  1.11k|            SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  110|  1.11k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&dhPrime, PR_FALSE);
  ------------------
  |  |  438|  1.11k|#define PR_FALSE 0
  ------------------
 8825|  1.11k|            SECITEM_ZfreeItem(&dhValue, PR_FALSE);
  ------------------
  |  |  110|  1.11k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&dhValue, PR_FALSE);
  ------------------
  |  |  438|  1.11k|#define PR_FALSE 0
  ------------------
 8826|       |
 8827|  1.11k|            if (rv == SECSuccess) {
  ------------------
  |  Branch (8827:17): [True: 1.11k, False: 2]
  ------------------
 8828|  1.11k|                sftk_forceAttribute(key, CKA_VALUE, derived.data, derived.len);
  ------------------
  |  |  516|  1.11k|#define CKA_VALUE 0x00000011UL
  ------------------
 8829|  1.11k|                SECITEM_ZfreeItem(&derived, PR_FALSE);
  ------------------
  |  |  110|  1.11k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&derived, PR_FALSE);
  ------------------
  |  |  438|  1.11k|#define PR_FALSE 0
  ------------------
 8830|  1.11k|                crv = CKR_OK;
  ------------------
  |  | 1388|  1.11k|#define CKR_OK 0x00000000UL
  ------------------
 8831|  1.11k|            } else
 8832|      2|                crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      2|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8833|       |
 8834|  1.11k|            break;
 8835|  1.11k|        }
 8836|       |
 8837|    558|        case CKM_ECDH1_DERIVE:
  ------------------
  |  | 1086|    558|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
  |  Branch (8837:9): [True: 558, False: 25.5k]
  ------------------
 8838|    558|        case CKM_ECDH1_COFACTOR_DERIVE: {
  ------------------
  |  | 1087|    558|#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL
  ------------------
  |  Branch (8838:9): [True: 0, False: 26.1k]
  ------------------
 8839|    558|            SECItem ecScalar, ecPoint;
 8840|    558|            SECItem tmp;
 8841|    558|            PRBool withCofactor = PR_FALSE;
  ------------------
  |  |  438|    558|#define PR_FALSE 0
  ------------------
 8842|    558|            unsigned char *secret;
 8843|    558|            unsigned char *keyData = NULL;
 8844|    558|            unsigned int secretlen, pubKeyLen;
 8845|    558|            CK_ECDH1_DERIVE_PARAMS *mechParams;
 8846|    558|            NSSLOWKEYPrivateKey *privKey;
 8847|    558|            PLArenaPool *arena = NULL;
 8848|       |
 8849|       |            /* Check mechanism parameters */
 8850|    558|            mechParams = (CK_ECDH1_DERIVE_PARAMS *)pMechanism->pParameter;
 8851|    558|            if ((pMechanism->ulParameterLen != sizeof(CK_ECDH1_DERIVE_PARAMS)) ||
  ------------------
  |  Branch (8851:17): [True: 0, False: 558]
  ------------------
 8852|    558|                ((mechParams->kdf == CKD_NULL) &&
  ------------------
  |  | 1702|    558|#define CKD_NULL 0x00000001UL
  ------------------
  |  Branch (8852:18): [True: 558, False: 0]
  ------------------
 8853|    558|                 ((mechParams->ulSharedDataLen != 0) ||
  ------------------
  |  Branch (8853:19): [True: 0, False: 558]
  ------------------
 8854|    558|                  (mechParams->pSharedData != NULL)))) {
  ------------------
  |  Branch (8854:19): [True: 0, False: 558]
  ------------------
 8855|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8856|      0|                break;
 8857|      0|            }
 8858|       |
 8859|    558|            privKey = sftk_GetPrivKey(sourceKey, CKK_EC, &crv);
  ------------------
  |  |  379|    558|#define CKK_EC 0x00000003UL
  ------------------
 8860|    558|            if (privKey == NULL) {
  ------------------
  |  Branch (8860:17): [True: 0, False: 558]
  ------------------
 8861|      0|                break;
 8862|      0|            }
 8863|       |
 8864|       |            /* Now we are working with a non-NULL private key */
 8865|    558|            SECITEM_CopyItem(NULL, &ecScalar, &privKey->u.ec.privateValue);
  ------------------
  |  |  106|    558|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 8866|       |
 8867|    558|            ecPoint.data = mechParams->pPublicData;
 8868|    558|            ecPoint.len = mechParams->ulPublicDataLen;
 8869|       |
 8870|    558|            pubKeyLen = EC_GetPointSize(&privKey->u.ec.ecParams);
 8871|       |
 8872|       |            /* if the len is too large, might be an encoded point */
 8873|    558|            if (ecPoint.len > pubKeyLen) {
  ------------------
  |  Branch (8873:17): [True: 78, False: 480]
  ------------------
 8874|     78|                SECItem newPoint;
 8875|       |
 8876|     78|                arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|     78|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                              arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|     78|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 8877|     78|                if (arena == NULL) {
  ------------------
  |  Branch (8877:21): [True: 0, False: 78]
  ------------------
 8878|      0|                    goto ec_loser;
 8879|      0|                }
 8880|       |
 8881|     78|                rv = SEC_QuickDERDecodeItem(arena, &newPoint,
  ------------------
  |  |  102|     78|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
 8882|     78|                                            SEC_ASN1_GET(SEC_OctetStringTemplate),
  ------------------
  |  |  188|     78|#define SEC_ASN1_GET(x) x
  ------------------
 8883|     78|                                            &ecPoint);
 8884|     78|                if (rv != SECSuccess) {
  ------------------
  |  Branch (8884:21): [True: 16, False: 62]
  ------------------
 8885|     16|                    goto ec_loser;
 8886|     16|                }
 8887|     62|                ecPoint = newPoint;
 8888|     62|            }
 8889|       |
 8890|    542|            if (mechanism == CKM_ECDH1_COFACTOR_DERIVE) {
  ------------------
  |  | 1087|    542|#define CKM_ECDH1_COFACTOR_DERIVE 0x00001051UL
  ------------------
  |  Branch (8890:17): [True: 0, False: 542]
  ------------------
 8891|      0|                withCofactor = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8892|      0|            }
 8893|       |
 8894|    542|            rv = ECDH_Derive(&ecPoint, &privKey->u.ec.ecParams, &ecScalar,
 8895|    542|                             withCofactor, &tmp);
 8896|    542|            SECITEM_ZfreeItem(&ecScalar, PR_FALSE);
  ------------------
  |  |  110|    542|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&ecScalar, PR_FALSE);
  ------------------
  |  |  438|    542|#define PR_FALSE 0
  ------------------
 8897|    542|            ecScalar.data = NULL;
 8898|    542|            if (privKey != sourceKey->objectInfo) {
  ------------------
  |  Branch (8898:17): [True: 0, False: 542]
  ------------------
 8899|      0|                nsslowkey_DestroyPrivateKey(privKey);
 8900|      0|                privKey = NULL;
 8901|      0|            }
 8902|    542|            if (arena) {
  ------------------
  |  Branch (8902:17): [True: 62, False: 480]
  ------------------
 8903|     62|                PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|     62|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                              PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|     62|#define PR_FALSE 0
  ------------------
 8904|     62|                arena = NULL;
 8905|     62|            }
 8906|       |
 8907|    542|            if (rv != SECSuccess) {
  ------------------
  |  Branch (8907:17): [True: 132, False: 410]
  ------------------
 8908|    132|                crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|    132|#define PORT_GetError PORT_GetError_Util
  ------------------
 8909|    132|                break;
 8910|    132|            }
 8911|       |
 8912|       |            /*
 8913|       |             * apply the kdf function.
 8914|       |             */
 8915|    410|            if (mechParams->kdf == CKD_NULL) {
  ------------------
  |  | 1702|    410|#define CKD_NULL 0x00000001UL
  ------------------
  |  Branch (8915:17): [True: 410, False: 0]
  ------------------
 8916|       |                /*
 8917|       |                 * tmp is the raw data created by ECDH_Derive,
 8918|       |                 * secret and secretlen are the values we will
 8919|       |                 * eventually pass as our generated key.
 8920|       |                 */
 8921|    410|                secret = tmp.data;
 8922|    410|                secretlen = tmp.len;
 8923|    410|            } else {
 8924|      0|                secretlen = keySize;
 8925|      0|                crv = sftk_ANSI_X9_63_kdf(&secret, keySize,
 8926|      0|                                          &tmp, mechParams->pSharedData,
 8927|      0|                                          mechParams->ulSharedDataLen, mechParams->kdf);
 8928|      0|                PORT_ZFree(tmp.data, tmp.len);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 8929|      0|                if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (8929:21): [True: 0, False: 0]
  ------------------
 8930|      0|                    break;
 8931|      0|                }
 8932|      0|                tmp.data = secret;
 8933|      0|                tmp.len = secretlen;
 8934|      0|            }
 8935|       |
 8936|       |            /*
 8937|       |             * if keySize is supplied, then we are generating a key of a specific
 8938|       |             * length. This is done by taking the least significant 'keySize'
 8939|       |             * bytes from the unsigned value calculated by ECDH. Note: this may
 8940|       |             * mean padding temp with extra leading zeros from what ECDH_Derive
 8941|       |             * already returned (which itself may contain leading zeros).
 8942|       |             */
 8943|    410|            if (keySize) {
  ------------------
  |  Branch (8943:17): [True: 410, False: 0]
  ------------------
 8944|    410|                if (secretlen < keySize) {
  ------------------
  |  Branch (8944:21): [True: 0, False: 410]
  ------------------
 8945|      0|                    keyData = PORT_ZAlloc(keySize);
  ------------------
  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
 8946|      0|                    if (!keyData) {
  ------------------
  |  Branch (8946:25): [True: 0, False: 0]
  ------------------
 8947|      0|                        PORT_ZFree(tmp.data, tmp.len);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 8948|      0|                        crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 8949|      0|                        break;
 8950|      0|                    }
 8951|      0|                    PORT_Memcpy(&keyData[keySize - secretlen], secret, secretlen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8952|      0|                    secret = keyData;
 8953|    410|                } else {
 8954|    410|                    secret += (secretlen - keySize);
 8955|    410|                }
 8956|    410|                secretlen = keySize;
 8957|    410|            }
 8958|       |
 8959|    410|            sftk_forceAttribute(key, CKA_VALUE, secret, secretlen);
  ------------------
  |  |  516|    410|#define CKA_VALUE 0x00000011UL
  ------------------
 8960|    410|            PORT_ZFree(tmp.data, tmp.len);
  ------------------
  |  |   75|    410|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 8961|    410|            if (keyData) {
  ------------------
  |  Branch (8961:17): [True: 0, False: 410]
  ------------------
 8962|      0|                PORT_ZFree(keyData, keySize);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 8963|      0|            }
 8964|    410|            break;
 8965|       |
 8966|     16|        ec_loser:
 8967|     16|            crv = CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|     16|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
 8968|     16|            SECITEM_ZfreeItem(&ecScalar, PR_FALSE);
  ------------------
  |  |  110|     16|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&ecScalar, PR_FALSE);
  ------------------
  |  |  438|     16|#define PR_FALSE 0
  ------------------
 8969|     16|            if (privKey != sourceKey->objectInfo)
  ------------------
  |  Branch (8969:17): [True: 0, False: 16]
  ------------------
 8970|      0|                nsslowkey_DestroyPrivateKey(privKey);
 8971|     16|            if (arena) {
  ------------------
  |  Branch (8971:17): [True: 16, False: 0]
  ------------------
 8972|     16|                PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |   61|     16|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                              PORT_FreeArena(arena, PR_TRUE);
  ------------------
  |  |  437|     16|#define PR_TRUE 1
  ------------------
 8973|     16|            }
 8974|     16|            break;
 8975|    410|        }
 8976|       |        /* See RFC 5869 and CK_NSS_HKDFParams for documentation. */
 8977|      0|        case CKM_NSS_HKDF_SHA1:
  ------------------
  |  |  168|      0|#define CKM_NSS_HKDF_SHA1 (CKM_NSS + 3)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8977:9): [True: 0, False: 26.1k]
  ------------------
 8978|      0|            hashMech = CKM_SHA_1;
  ------------------
  |  |  859|      0|#define CKM_SHA_1 0x00000220UL
  ------------------
 8979|      0|            goto hkdf;
 8980|      0|        case CKM_NSS_HKDF_SHA256:
  ------------------
  |  |  169|      0|#define CKM_NSS_HKDF_SHA256 (CKM_NSS + 4)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8980:9): [True: 0, False: 26.1k]
  ------------------
 8981|      0|            hashMech = CKM_SHA256;
  ------------------
  |  |  876|      0|#define CKM_SHA256 0x00000250UL
  ------------------
 8982|      0|            goto hkdf;
 8983|      0|        case CKM_NSS_HKDF_SHA384:
  ------------------
  |  |  170|      0|#define CKM_NSS_HKDF_SHA384 (CKM_NSS + 5)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8983:9): [True: 0, False: 26.1k]
  ------------------
 8984|      0|            hashMech = CKM_SHA384;
  ------------------
  |  |  879|      0|#define CKM_SHA384 0x00000260UL
  ------------------
 8985|      0|            goto hkdf;
 8986|      0|        case CKM_NSS_HKDF_SHA512:
  ------------------
  |  |  171|      0|#define CKM_NSS_HKDF_SHA512 (CKM_NSS + 6)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8986:9): [True: 0, False: 26.1k]
  ------------------
 8987|      0|            hashMech = CKM_SHA512;
  ------------------
  |  |  882|      0|#define CKM_SHA512 0x00000270UL
  ------------------
 8988|      0|            goto hkdf;
 8989|      0|        hkdf : {
 8990|      0|            const CK_NSS_HKDFParams *params =
 8991|      0|                (const CK_NSS_HKDFParams *)pMechanism->pParameter;
 8992|      0|            CK_HKDF_PARAMS hkdfParams;
 8993|       |
 8994|      0|            if (pMechanism->ulParameterLen != sizeof(CK_NSS_HKDFParams)) {
  ------------------
  |  Branch (8994:17): [True: 0, False: 0]
  ------------------
 8995|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 8996|      0|                break;
 8997|      0|            }
 8998|      0|            hkdfParams.bExtract = params->bExtract;
 8999|      0|            hkdfParams.bExpand = params->bExpand;
 9000|      0|            if (params->pSalt) {
  ------------------
  |  Branch (9000:17): [True: 0, False: 0]
  ------------------
 9001|      0|                hkdfParams.ulSaltType = CKF_HKDF_SALT_DATA;
  ------------------
  |  | 2253|      0|#define CKF_HKDF_SALT_DATA 0x00000002UL
  ------------------
 9002|      0|            } else {
 9003|      0|                hkdfParams.ulSaltType = CKF_HKDF_SALT_NULL;
  ------------------
  |  | 2252|      0|#define CKF_HKDF_SALT_NULL 0x00000001UL
  ------------------
 9004|      0|            }
 9005|      0|            hkdfParams.pSalt = params->pSalt;
 9006|      0|            hkdfParams.ulSaltLen = params->ulSaltLen;
 9007|      0|            hkdfParams.hSaltKey = CK_INVALID_HANDLE;
  ------------------
  |  |   78|      0|#define CK_INVALID_HANDLE 0
  ------------------
 9008|      0|            hkdfParams.pInfo = params->pInfo;
 9009|      0|            hkdfParams.ulInfoLen = params->ulInfoLen;
 9010|      0|            hkdfParams.prfHashMechanism = hashMech;
 9011|       |
 9012|      0|            crv = sftk_HKDF(&hkdfParams, hSession, sourceKey,
 9013|      0|                            att->attrib.pValue, att->attrib.ulValueLen,
 9014|      0|                            key, NULL, keySize, PR_FALSE, isFIPS);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 9015|      0|        } break;
 9016|  20.0k|        case CKM_HKDF_DERIVE:
  ------------------
  |  | 1296|  20.0k|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
  |  Branch (9016:9): [True: 20.0k, False: 6.09k]
  ------------------
 9017|  20.9k|        case CKM_HKDF_DATA: /* only difference is the class of key */
  ------------------
  |  | 1297|  20.9k|#define CKM_HKDF_DATA 0x0000402bUL
  ------------------
  |  Branch (9017:9): [True: 897, False: 25.2k]
  ------------------
 9018|  20.9k|            if ((pMechanism->pParameter == NULL) ||
  ------------------
  |  Branch (9018:17): [True: 0, False: 20.9k]
  ------------------
 9019|  20.9k|                (pMechanism->ulParameterLen != sizeof(CK_HKDF_PARAMS))) {
  ------------------
  |  Branch (9019:17): [True: 0, False: 20.9k]
  ------------------
 9020|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 9021|      0|                break;
 9022|      0|            }
 9023|  20.9k|            crv = sftk_HKDF((CK_HKDF_PARAMS_PTR)pMechanism->pParameter,
 9024|  20.9k|                            hSession, sourceKey, att->attrib.pValue,
 9025|  20.9k|                            att->attrib.ulValueLen, key, NULL, keySize, PR_TRUE,
  ------------------
  |  |  437|  20.9k|#define PR_TRUE 1
  ------------------
 9026|  20.9k|                            isFIPS);
 9027|  20.9k|            break;
 9028|      0|        case CKM_NSS_JPAKE_ROUND2_SHA1:
  ------------------
  |  |  195|      0|#define CKM_NSS_JPAKE_ROUND2_SHA1 (CKM_NSS + 11)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9028:9): [True: 0, False: 26.1k]
  ------------------
 9029|      0|            hashType = HASH_AlgSHA1;
 9030|      0|            goto jpake2;
 9031|      0|        case CKM_NSS_JPAKE_ROUND2_SHA256:
  ------------------
  |  |  196|      0|#define CKM_NSS_JPAKE_ROUND2_SHA256 (CKM_NSS + 12)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9031:9): [True: 0, False: 26.1k]
  ------------------
 9032|      0|            hashType = HASH_AlgSHA256;
 9033|      0|            goto jpake2;
 9034|      0|        case CKM_NSS_JPAKE_ROUND2_SHA384:
  ------------------
  |  |  197|      0|#define CKM_NSS_JPAKE_ROUND2_SHA384 (CKM_NSS + 13)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9034:9): [True: 0, False: 26.1k]
  ------------------
 9035|      0|            hashType = HASH_AlgSHA384;
 9036|      0|            goto jpake2;
 9037|      0|        case CKM_NSS_JPAKE_ROUND2_SHA512:
  ------------------
  |  |  198|      0|#define CKM_NSS_JPAKE_ROUND2_SHA512 (CKM_NSS + 14)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9037:9): [True: 0, False: 26.1k]
  ------------------
 9038|      0|            hashType = HASH_AlgSHA512;
 9039|      0|            goto jpake2;
 9040|      0|        jpake2:
 9041|      0|            if (pMechanism->pParameter == NULL ||
  ------------------
  |  Branch (9041:17): [True: 0, False: 0]
  ------------------
 9042|      0|                pMechanism->ulParameterLen != sizeof(CK_NSS_JPAKERound2Params))
  ------------------
  |  Branch (9042:17): [True: 0, False: 0]
  ------------------
 9043|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 9044|      0|            if (crv == CKR_OK && sftk_isTrue(key, CKA_TOKEN))
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
                          if (crv == CKR_OK && sftk_isTrue(key, CKA_TOKEN))
  ------------------
  |  |  512|      0|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (9044:17): [True: 0, False: 0]
  |  Branch (9044:34): [True: 0, False: 0]
  ------------------
 9045|      0|                crv = CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
 9046|      0|            if (crv == CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (9046:17): [True: 0, False: 0]
  ------------------
 9047|      0|                crv = sftk_DeriveSensitiveCheck(sourceKey, key, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 9048|      0|            if (crv == CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (9048:17): [True: 0, False: 0]
  ------------------
 9049|      0|                crv = jpake_Round2(hashType,
 9050|      0|                                   (CK_NSS_JPAKERound2Params *)pMechanism->pParameter,
 9051|      0|                                   sourceKey, key);
 9052|      0|            break;
 9053|       |
 9054|      0|        case CKM_NSS_JPAKE_FINAL_SHA1:
  ------------------
  |  |  210|      0|#define CKM_NSS_JPAKE_FINAL_SHA1 (CKM_NSS + 15)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9054:9): [True: 0, False: 26.1k]
  ------------------
 9055|      0|            hashType = HASH_AlgSHA1;
 9056|      0|            goto jpakeFinal;
 9057|      0|        case CKM_NSS_JPAKE_FINAL_SHA256:
  ------------------
  |  |  211|      0|#define CKM_NSS_JPAKE_FINAL_SHA256 (CKM_NSS + 16)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9057:9): [True: 0, False: 26.1k]
  ------------------
 9058|      0|            hashType = HASH_AlgSHA256;
 9059|      0|            goto jpakeFinal;
 9060|      0|        case CKM_NSS_JPAKE_FINAL_SHA384:
  ------------------
  |  |  212|      0|#define CKM_NSS_JPAKE_FINAL_SHA384 (CKM_NSS + 17)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9060:9): [True: 0, False: 26.1k]
  ------------------
 9061|      0|            hashType = HASH_AlgSHA384;
 9062|      0|            goto jpakeFinal;
 9063|      0|        case CKM_NSS_JPAKE_FINAL_SHA512:
  ------------------
  |  |  213|      0|#define CKM_NSS_JPAKE_FINAL_SHA512 (CKM_NSS + 18)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9063:9): [True: 0, False: 26.1k]
  ------------------
 9064|      0|            hashType = HASH_AlgSHA512;
 9065|      0|            goto jpakeFinal;
 9066|      0|        jpakeFinal:
 9067|      0|            if (pMechanism->pParameter == NULL ||
  ------------------
  |  Branch (9067:17): [True: 0, False: 0]
  ------------------
 9068|      0|                pMechanism->ulParameterLen != sizeof(CK_NSS_JPAKEFinalParams))
  ------------------
  |  Branch (9068:17): [True: 0, False: 0]
  ------------------
 9069|      0|                crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 9070|       |            /* We purposely do not do the derive sensitivity check; we want to be
 9071|       |               able to derive non-sensitive keys while allowing the ROUND1 and
 9072|       |               ROUND2 keys to be sensitive (which they always are, since they are
 9073|       |               in the CKO_PRIVATE_KEY class). The caller must include CKA_SENSITIVE
 9074|       |               in the template in order for the resultant keyblock key to be
 9075|       |               sensitive.
 9076|       |             */
 9077|      0|            if (crv == CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (9077:17): [True: 0, False: 0]
  ------------------
 9078|      0|                crv = jpake_Final(hashType,
 9079|      0|                                  (CK_NSS_JPAKEFinalParams *)pMechanism->pParameter,
 9080|      0|                                  sourceKey, key);
 9081|      0|            break;
 9082|       |
 9083|      0|        case CKM_NSS_SP800_108_COUNTER_KDF_DERIVE_DATA:         /* fall through */
  ------------------
  |  |  262|      0|#define CKM_NSS_SP800_108_COUNTER_KDF_DERIVE_DATA (CKM_NSS + 42)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9083:9): [True: 0, False: 26.1k]
  ------------------
 9084|      0|        case CKM_NSS_SP800_108_FEEDBACK_KDF_DERIVE_DATA:        /* fall through */
  ------------------
  |  |  263|      0|#define CKM_NSS_SP800_108_FEEDBACK_KDF_DERIVE_DATA (CKM_NSS + 43)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9084:9): [True: 0, False: 26.1k]
  ------------------
 9085|      0|        case CKM_NSS_SP800_108_DOUBLE_PIPELINE_KDF_DERIVE_DATA: /* fall through */
  ------------------
  |  |  264|      0|#define CKM_NSS_SP800_108_DOUBLE_PIPELINE_KDF_DERIVE_DATA (CKM_NSS + 44)
  |  |  ------------------
  |  |  |  |  162|      0|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      0|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9085:9): [True: 0, False: 26.1k]
  ------------------
 9086|      0|        case CKM_SP800_108_COUNTER_KDF:                         /* fall through */
  ------------------
  |  | 1244|      0|#define CKM_SP800_108_COUNTER_KDF 0x000003acUL
  ------------------
  |  Branch (9086:9): [True: 0, False: 26.1k]
  ------------------
 9087|      0|        case CKM_SP800_108_FEEDBACK_KDF:                        /* fall through */
  ------------------
  |  | 1245|      0|#define CKM_SP800_108_FEEDBACK_KDF 0x000003adUL
  ------------------
  |  Branch (9087:9): [True: 0, False: 26.1k]
  ------------------
 9088|      0|        case CKM_SP800_108_DOUBLE_PIPELINE_KDF:
  ------------------
  |  | 1246|      0|#define CKM_SP800_108_DOUBLE_PIPELINE_KDF 0x000003aeUL
  ------------------
  |  Branch (9088:9): [True: 0, False: 26.1k]
  ------------------
 9089|      0|            crv = sftk_DeriveSensitiveCheck(sourceKey, key, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 9090|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (9090:17): [True: 0, False: 0]
  ------------------
 9091|      0|                break;
 9092|      0|            }
 9093|       |
 9094|      0|            crv = kbkdf_Dispatch(mechanism, hSession, pMechanism, sourceKey, key, keySize);
 9095|      0|            break;
 9096|      0|        default:
  ------------------
  |  Branch (9096:9): [True: 0, False: 26.1k]
  ------------------
 9097|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 9098|  26.1k|    }
 9099|  26.1k|    if (att) {
  ------------------
  |  Branch (9099:9): [True: 26.1k, False: 0]
  ------------------
 9100|  26.1k|        sftk_FreeAttribute(att);
 9101|  26.1k|    }
 9102|  26.1k|    sftk_FreeObject(sourceKey);
 9103|  26.1k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  26.1k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (9103:9): [True: 150, False: 25.9k]
  ------------------
 9104|    150|        if (key)
  ------------------
  |  Branch (9104:13): [True: 150, False: 0]
  ------------------
 9105|    150|            sftk_FreeObject(key);
 9106|    150|        return crv;
 9107|    150|    }
 9108|       |
 9109|       |    /* link the key object into the list */
 9110|  25.9k|    if (key) {
  ------------------
  |  Branch (9110:9): [True: 24.2k, False: 1.76k]
  ------------------
 9111|  24.2k|        SFTKSessionObject *sessKey = sftk_narrowToSessionObject(key);
 9112|  24.2k|        PORT_Assert(sessKey);
  ------------------
  |  |  120|  24.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  24.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 24.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9113|       |        /* get the session */
 9114|  24.2k|        sessKey->wasDerived = PR_TRUE;
  ------------------
  |  |  437|  24.2k|#define PR_TRUE 1
  ------------------
 9115|  24.2k|        session = sftk_SessionFromHandle(hSession);
 9116|  24.2k|        if (session == NULL) {
  ------------------
  |  Branch (9116:13): [True: 0, False: 24.2k]
  ------------------
 9117|      0|            sftk_FreeObject(key);
 9118|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 9119|      0|        }
 9120|       |
 9121|  24.2k|        crv = sftk_handleObject(key, session);
 9122|  24.2k|        session->lastOpWasFIPS = key->isFIPS;
 9123|  24.2k|        sftk_FreeSession(session);
 9124|  24.2k|        if (phKey) {
  ------------------
  |  Branch (9124:13): [True: 24.2k, False: 0]
  ------------------
 9125|  24.2k|            *phKey = key->handle;
 9126|  24.2k|        }
 9127|  24.2k|        sftk_FreeObject(key);
 9128|  24.2k|    }
 9129|  25.9k|    return crv;
 9130|  25.9k|}
NSC_GetOperationState:
 9159|  3.75k|{
 9160|  3.75k|    SFTKSessionContext *context;
 9161|  3.75k|    SFTKSession *session;
 9162|  3.75k|    CK_RV crv;
 9163|  3.75k|    CK_ULONG pOSLen = *pulOperationStateLen;
 9164|       |
 9165|  3.75k|    CHECK_FORK();
 9166|       |
 9167|       |    /* make sure we're legal */
 9168|  3.75k|    crv = sftk_GetContext(hSession, &context, SFTK_HASH, PR_TRUE, &session);
  ------------------
  |  |  437|  3.75k|#define PR_TRUE 1
  ------------------
 9169|  3.75k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.75k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (9169:9): [True: 0, False: 3.75k]
  ------------------
 9170|      0|        return crv;
 9171|       |
 9172|       |    /* a zero cipherInfoLen signals that this context cannot be serialized */
 9173|  3.75k|    if (context->cipherInfoLen == 0) {
  ------------------
  |  Branch (9173:9): [True: 0, False: 3.75k]
  ------------------
 9174|      0|        return CKR_STATE_UNSAVEABLE;
  ------------------
  |  | 1517|      0|#define CKR_STATE_UNSAVEABLE 0x00000180UL
  ------------------
 9175|      0|    }
 9176|       |
 9177|  3.75k|    *pulOperationStateLen = context->cipherInfoLen + sizeof(CK_MECHANISM_TYPE) + sizeof(SFTKContextType);
 9178|  3.75k|    if (pOperationState == NULL) {
  ------------------
  |  Branch (9178:9): [True: 1.69k, False: 2.06k]
  ------------------
 9179|  1.69k|        sftk_FreeSession(session);
 9180|  1.69k|        return CKR_OK;
  ------------------
  |  | 1388|  1.69k|#define CKR_OK 0x00000000UL
  ------------------
 9181|  2.06k|    } else {
 9182|  2.06k|        if (pOSLen < *pulOperationStateLen) {
  ------------------
  |  Branch (9182:13): [True: 0, False: 2.06k]
  ------------------
 9183|      0|            return CKR_BUFFER_TOO_SMALL;
  ------------------
  |  | 1514|      0|#define CKR_BUFFER_TOO_SMALL 0x00000150UL
  ------------------
 9184|      0|        }
 9185|  2.06k|    }
 9186|  2.06k|    PORT_Memcpy(pOperationState, &context->type, sizeof(SFTKContextType));
  ------------------
  |  |  180|  2.06k|#define PORT_Memcpy memcpy
  ------------------
 9187|  2.06k|    pOperationState += sizeof(SFTKContextType);
 9188|  2.06k|    PORT_Memcpy(pOperationState, &context->currentMech,
  ------------------
  |  |  180|  2.06k|#define PORT_Memcpy memcpy
  ------------------
 9189|  2.06k|                sizeof(CK_MECHANISM_TYPE));
 9190|  2.06k|    pOperationState += sizeof(CK_MECHANISM_TYPE);
 9191|  2.06k|    PORT_Memcpy(pOperationState, context->cipherInfo, context->cipherInfoLen);
  ------------------
  |  |  180|  2.06k|#define PORT_Memcpy memcpy
  ------------------
 9192|  2.06k|    sftk_FreeSession(session);
 9193|  2.06k|    return CKR_OK;
  ------------------
  |  | 1388|  2.06k|#define CKR_OK 0x00000000UL
  ------------------
 9194|  3.75k|}
NSC_SetOperationState:
 9206|  2.06k|{
 9207|  2.06k|    SFTKSessionContext *context;
 9208|  2.06k|    SFTKSession *session;
 9209|  2.06k|    SFTKContextType type;
 9210|  2.06k|    CK_MECHANISM mech;
 9211|  2.06k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  2.06k|#define CKR_OK 0x00000000UL
  ------------------
 9212|       |
 9213|  2.06k|    CHECK_FORK();
 9214|       |
 9215|  4.12k|    while (ulOperationStateLen != 0) {
  ------------------
  |  Branch (9215:12): [True: 2.06k, False: 2.06k]
  ------------------
 9216|       |        /* get what type of state we're dealing with... */
 9217|  2.06k|        PORT_Memcpy(&type, pOperationState, sizeof(SFTKContextType));
  ------------------
  |  |  180|  2.06k|#define PORT_Memcpy memcpy
  ------------------
 9218|       |
 9219|       |        /* fix up session contexts based on type */
 9220|  2.06k|        session = sftk_SessionFromHandle(hSession);
 9221|  2.06k|        if (session == NULL)
  ------------------
  |  Branch (9221:13): [True: 0, False: 2.06k]
  ------------------
 9222|      0|            return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
 9223|  2.06k|        context = sftk_ReturnContextByType(session, type);
 9224|  2.06k|        sftk_SetContextByType(session, type, NULL);
 9225|  2.06k|        if (context) {
  ------------------
  |  Branch (9225:13): [True: 1.69k, False: 370]
  ------------------
 9226|  1.69k|            sftk_FreeContext(context);
 9227|  1.69k|        }
 9228|  2.06k|        pOperationState += sizeof(SFTKContextType);
 9229|  2.06k|        sftk_Decrement(ulOperationStateLen, sizeof(SFTKContextType));
  ------------------
  |  | 9197|  2.06k|    stateSize = ((stateSize) > (CK_ULONG)(len)) ? ((stateSize) - (CK_ULONG)(len)) : 0;
  |  |  ------------------
  |  |  |  Branch (9197:17): [True: 2.06k, False: 0]
  |  |  ------------------
  ------------------
 9230|       |
 9231|       |        /* get the mechanism structure */
 9232|  2.06k|        PORT_Memcpy(&mech.mechanism, pOperationState, sizeof(CK_MECHANISM_TYPE));
  ------------------
  |  |  180|  2.06k|#define PORT_Memcpy memcpy
  ------------------
 9233|  2.06k|        pOperationState += sizeof(CK_MECHANISM_TYPE);
 9234|  2.06k|        sftk_Decrement(ulOperationStateLen, sizeof(CK_MECHANISM_TYPE));
  ------------------
  |  | 9197|  2.06k|    stateSize = ((stateSize) > (CK_ULONG)(len)) ? ((stateSize) - (CK_ULONG)(len)) : 0;
  |  |  ------------------
  |  |  |  Branch (9197:17): [True: 2.06k, False: 0]
  |  |  ------------------
  ------------------
 9235|       |        /* should be filled in... but not necessary for hash */
 9236|  2.06k|        mech.pParameter = NULL;
 9237|  2.06k|        mech.ulParameterLen = 0;
 9238|  2.06k|        switch (type) {
 9239|  2.06k|            case SFTK_HASH:
  ------------------
  |  Branch (9239:13): [True: 2.06k, False: 0]
  ------------------
 9240|  2.06k|                crv = NSC_DigestInit(hSession, &mech);
 9241|  2.06k|                if (crv != CKR_OK)
  ------------------
  |  | 1388|  2.06k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (9241:21): [True: 0, False: 2.06k]
  ------------------
 9242|      0|                    break;
 9243|  2.06k|                crv = sftk_GetContext(hSession, &context, SFTK_HASH, PR_TRUE,
  ------------------
  |  |  437|  2.06k|#define PR_TRUE 1
  ------------------
 9244|  2.06k|                                      NULL);
 9245|  2.06k|                if (crv != CKR_OK)
  ------------------
  |  | 1388|  2.06k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (9245:21): [True: 0, False: 2.06k]
  ------------------
 9246|      0|                    break;
 9247|  2.06k|                if (context->cipherInfoLen == 0) {
  ------------------
  |  Branch (9247:21): [True: 0, False: 2.06k]
  ------------------
 9248|      0|                    crv = CKR_SAVED_STATE_INVALID;
  ------------------
  |  | 1515|      0|#define CKR_SAVED_STATE_INVALID 0x00000160UL
  ------------------
 9249|      0|                    break;
 9250|      0|                }
 9251|  2.06k|                PORT_Memcpy(context->cipherInfo, pOperationState,
  ------------------
  |  |  180|  2.06k|#define PORT_Memcpy memcpy
  ------------------
 9252|  2.06k|                            context->cipherInfoLen);
 9253|  2.06k|                pOperationState += context->cipherInfoLen;
 9254|  2.06k|                sftk_Decrement(ulOperationStateLen, context->cipherInfoLen);
  ------------------
  |  | 9197|  2.06k|    stateSize = ((stateSize) > (CK_ULONG)(len)) ? ((stateSize) - (CK_ULONG)(len)) : 0;
  |  |  ------------------
  |  |  |  Branch (9197:17): [True: 0, False: 2.06k]
  |  |  ------------------
  ------------------
 9255|  2.06k|                break;
 9256|      0|            default:
  ------------------
  |  Branch (9256:13): [True: 0, False: 2.06k]
  ------------------
 9257|       |                /* do sign/encrypt/decrypt later */
 9258|      0|                crv = CKR_SAVED_STATE_INVALID;
  ------------------
  |  | 1515|      0|#define CKR_SAVED_STATE_INVALID 0x00000160UL
  ------------------
 9259|  2.06k|        }
 9260|  2.06k|        sftk_FreeSession(session);
 9261|  2.06k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  2.06k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (9261:13): [True: 0, False: 2.06k]
  ------------------
 9262|      0|            break;
 9263|  2.06k|    }
 9264|  2.06k|    return crv;
 9265|  2.06k|}
pkcs11c.c:sftk_RSAEncrypt:
  616|  1.08k|{
  617|  1.08k|    NSSLOWKEYPublicKey *key = ctx;
  618|  1.08k|    SECStatus rv = SECFailure;
  619|       |
  620|  1.08k|    PORT_Assert(key->keyType == NSSLOWKEYRSAKey);
  ------------------
  |  |  120|  1.08k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.08k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.08k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  621|  1.08k|    if (key->keyType != NSSLOWKEYRSAKey) {
  ------------------
  |  Branch (621:9): [True: 0, False: 1.08k]
  ------------------
  622|      0|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  623|      0|        return SECFailure;
  624|      0|    }
  625|       |
  626|  1.08k|    rv = RSA_EncryptBlock(&key->u.rsa, output, outputLen, maxLen, input,
  627|  1.08k|                          inputLen);
  628|  1.08k|    if (rv != SECSuccess && PORT_GetError() == SEC_ERROR_LIBRARY_FAILURE) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (628:9): [True: 0, False: 1.08k]
  |  Branch (628:29): [True: 0, False: 0]
  ------------------
  629|      0|        sftk_fatalError = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  630|      0|    }
  631|       |
  632|  1.08k|    return rv;
  633|  1.08k|}
pkcs11c.c:sftk_Null:
   80|  2.66k|{
   81|  2.66k|    return;
   82|  2.66k|}
pkcs11c.c:SFTKCipher_DES_Encrypt:
  151|     89|    {                                                                        \
  152|     89|        ctxtype *ctx = vctx;                                                 \
  153|     89|        return mmm(ctx, output, outputLen, maxOutputLen,                     \
  154|     89|                   input, inputLen);                                         \
  155|     89|    }
pkcs11c.c:SFTKCipher_DES_DestroyContext:
  164|  1.60k|    {                                                                        \
  165|  1.60k|        ctxtype *ctx = vctx;                                                 \
  166|  1.60k|        mmm##_DestroyContext(ctx, freeit);                                   \
  167|  1.60k|    }
pkcs11c.c:SFTKCipher_SEED_DestroyContext:
  164|    270|    {                                                                        \
  165|    270|        ctxtype *ctx = vctx;                                                 \
  166|    270|        mmm##_DestroyContext(ctx, freeit);                                   \
  167|    270|    }
pkcs11c.c:SFTKCipher_Camellia_DestroyContext:
  164|     88|    {                                                                        \
  165|     88|        ctxtype *ctx = vctx;                                                 \
  166|     88|        mmm##_DestroyContext(ctx, freeit);                                   \
  167|     88|    }
pkcs11c.c:sftk_aes_mode:
  549|    526|{
  550|    526|    switch (mechanism) {
  ------------------
  |  Branch (550:13): [True: 0, False: 526]
  ------------------
  551|      0|        case CKM_AES_CBC_PAD:
  ------------------
  |  | 1111|      0|#define CKM_AES_CBC_PAD 0x00001085UL
  ------------------
  |  Branch (551:9): [True: 0, False: 526]
  ------------------
  552|    526|        case CKM_AES_CBC:
  ------------------
  |  | 1108|    526|#define CKM_AES_CBC 0x00001082UL
  ------------------
  |  Branch (552:9): [True: 526, False: 0]
  ------------------
  553|    526|            return NSS_AES_CBC;
  ------------------
  |  |   36|    526|#define NSS_AES_CBC 1
  ------------------
  554|      0|        case CKM_AES_ECB:
  ------------------
  |  | 1107|      0|#define CKM_AES_ECB 0x00001081UL
  ------------------
  |  Branch (554:9): [True: 0, False: 526]
  ------------------
  555|      0|            return NSS_AES;
  ------------------
  |  |   35|      0|#define NSS_AES 0
  ------------------
  556|      0|        case CKM_AES_CTS:
  ------------------
  |  | 1117|      0|#define CKM_AES_CTS 0x00001089UL
  ------------------
  |  Branch (556:9): [True: 0, False: 526]
  ------------------
  557|      0|            return NSS_AES_CTS;
  ------------------
  |  |   37|      0|#define NSS_AES_CTS 2
  ------------------
  558|      0|        case CKM_AES_CTR:
  ------------------
  |  | 1113|      0|#define CKM_AES_CTR 0x00001086UL
  ------------------
  |  Branch (558:9): [True: 0, False: 526]
  ------------------
  559|      0|            return NSS_AES_CTR;
  ------------------
  |  |   38|      0|#define NSS_AES_CTR 3
  ------------------
  560|      0|        case CKM_AES_GCM:
  ------------------
  |  | 1115|      0|#define CKM_AES_GCM 0x00001087UL
  ------------------
  |  Branch (560:9): [True: 0, False: 526]
  ------------------
  561|      0|            return NSS_AES_GCM;
  ------------------
  |  |   39|      0|#define NSS_AES_GCM 4
  ------------------
  562|    526|    }
  563|      0|    return -1;
  564|    526|}
pkcs11c.c:SFTKCipher_AES_DestroyContext:
  164|    526|    {                                                                        \
  165|    526|        ctxtype *ctx = vctx;                                                 \
  166|    526|        mmm##_DestroyContext(ctx, freeit);                                   \
  167|    526|    }
pkcs11c.c:SFTKHash_MD5_Update:
  101|  5.43k|    {                                                                                     \
  102|  5.43k|        ctxtype *ctx = vctx;                                                              \
  103|  5.43k|        mmm##_Update(ctx, input, len);                                                    \
  104|  5.43k|    }                                                                                     \
pkcs11c.c:SFTKHash_MD5_End:
  108|    316|    {                                                                                     \
  109|    316|        ctxtype *ctx = vctx;                                                              \
  110|    316|        mmm##_End(ctx, digest, len, maxLen);                                              \
  111|    316|    }                                                                                     \
pkcs11c.c:SFTKHash_MD5_DestroyContext:
  114|    673|    {                                                                                     \
  115|    673|        ctxtype *ctx = vctx;                                                              \
  116|    673|        mmm##_DestroyContext(ctx, freeit);                                                \
  117|    673|    }
pkcs11c.c:SFTKHash_SHA1_Update:
  101|  20.0k|    {                                                                                     \
  102|  20.0k|        ctxtype *ctx = vctx;                                                              \
  103|  20.0k|        mmm##_Update(ctx, input, len);                                                    \
  104|  20.0k|    }                                                                                     \
pkcs11c.c:SFTKHash_SHA1_End:
  108|  14.9k|    {                                                                                     \
  109|  14.9k|        ctxtype *ctx = vctx;                                                              \
  110|  14.9k|        mmm##_End(ctx, digest, len, maxLen);                                              \
  111|  14.9k|    }                                                                                     \
pkcs11c.c:SFTKHash_SHA1_DestroyContext:
  114|  15.3k|    {                                                                                     \
  115|  15.3k|        ctxtype *ctx = vctx;                                                              \
  116|  15.3k|        mmm##_DestroyContext(ctx, freeit);                                                \
  117|  15.3k|    }
pkcs11c.c:SFTKHash_SHA256_Update:
  101|  9.77k|    {                                                                                     \
  102|  9.77k|        ctxtype *ctx = vctx;                                                              \
  103|  9.77k|        mmm##_Update(ctx, input, len);                                                    \
  104|  9.77k|    }                                                                                     \
pkcs11c.c:SFTKHash_SHA256_End:
  108|  9.60k|    {                                                                                     \
  109|  9.60k|        ctxtype *ctx = vctx;                                                              \
  110|  9.60k|        mmm##_End(ctx, digest, len, maxLen);                                              \
  111|  9.60k|    }                                                                                     \
pkcs11c.c:SFTKHash_SHA256_DestroyContext:
  114|  11.9k|    {                                                                                     \
  115|  11.9k|        ctxtype *ctx = vctx;                                                              \
  116|  11.9k|        mmm##_DestroyContext(ctx, freeit);                                                \
  117|  11.9k|    }
pkcs11c.c:SFTKHash_SHA384_Update:
  101|  7.05k|    {                                                                                     \
  102|  7.05k|        ctxtype *ctx = vctx;                                                              \
  103|  7.05k|        mmm##_Update(ctx, input, len);                                                    \
  104|  7.05k|    }                                                                                     \
pkcs11c.c:SFTKHash_SHA384_End:
  108|  6.87k|    {                                                                                     \
  109|  6.87k|        ctxtype *ctx = vctx;                                                              \
  110|  6.87k|        mmm##_End(ctx, digest, len, maxLen);                                              \
  111|  6.87k|    }                                                                                     \
pkcs11c.c:SFTKHash_SHA384_DestroyContext:
  114|  7.17k|    {                                                                                     \
  115|  7.17k|        ctxtype *ctx = vctx;                                                              \
  116|  7.17k|        mmm##_DestroyContext(ctx, freeit);                                                \
  117|  7.17k|    }
pkcs11c.c:SFTKHash_SHA512_Update:
  101|    504|    {                                                                                     \
  102|    504|        ctxtype *ctx = vctx;                                                              \
  103|    504|        mmm##_Update(ctx, input, len);                                                    \
  104|    504|    }                                                                                     \
pkcs11c.c:SFTKHash_SHA512_End:
  108|    504|    {                                                                                     \
  109|    504|        ctxtype *ctx = vctx;                                                              \
  110|    504|        mmm##_End(ctx, digest, len, maxLen);                                              \
  111|    504|    }                                                                                     \
pkcs11c.c:SFTKHash_SHA512_DestroyContext:
  114|    504|    {                                                                                     \
  115|    504|        ctxtype *ctx = vctx;                                                              \
  116|    504|        mmm##_DestroyContext(ctx, freeit);                                                \
  117|    504|    }
pkcs11c.c:sftk_InitCBCMac:
 2402|  11.4k|{
 2403|  11.4k|    CK_MECHANISM cbc_mechanism;
 2404|  11.4k|    CK_ULONG mac_bytes = SFTK_INVALID_MAC_SIZE;
  ------------------
  |  |  256|  11.4k|#define SFTK_INVALID_MAC_SIZE 0xffffffff
  ------------------
 2405|  11.4k|#ifndef NSS_DISABLE_DEPRECATED_RC2
 2406|  11.4k|    CK_RC2_CBC_PARAMS rc2_params;
 2407|  11.4k|#endif
 2408|       |#if NSS_SOFTOKEN_DOES_RC5
 2409|       |    CK_RC5_CBC_PARAMS rc5_params;
 2410|       |    CK_RC5_MAC_GENERAL_PARAMS *rc5_mac;
 2411|       |#endif
 2412|  11.4k|    unsigned char ivBlock[SFTK_MAX_BLOCK_SIZE];
 2413|  11.4k|    unsigned char k2[SFTK_MAX_BLOCK_SIZE];
 2414|  11.4k|    unsigned char k3[SFTK_MAX_BLOCK_SIZE];
 2415|  11.4k|    SFTKSessionContext *context;
 2416|  11.4k|    CK_RV crv;
 2417|  11.4k|    unsigned int blockSize;
 2418|  11.4k|    PRBool isXCBC = PR_FALSE;
  ------------------
  |  |  438|  11.4k|#define PR_FALSE 0
  ------------------
 2419|       |
 2420|  11.4k|    if (!pMechanism) {
  ------------------
  |  Branch (2420:9): [True: 0, False: 11.4k]
  ------------------
 2421|      0|        return CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 2422|      0|    }
 2423|       |
 2424|  11.4k|    switch (pMechanism->mechanism) {
 2425|      0|#ifndef NSS_DISABLE_DEPRECATED_RC2
 2426|      0|        case CKM_RC2_MAC_GENERAL:
  ------------------
  |  |  809|      0|#define CKM_RC2_MAC_GENERAL 0x00000104UL
  ------------------
  |  Branch (2426:9): [True: 0, False: 11.4k]
  ------------------
 2427|      0|            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_RC2_MAC_GENERAL_PARAMS))) {
  ------------------
  |  |   50|      0|#define BAD_PARAM_CAST(pMech, typeSize) (!pMech->pParameter || pMech->ulParameterLen < typeSize)
  |  |  ------------------
  |  |  |  Branch (50:42): [True: 0, False: 0]
  |  |  |  Branch (50:64): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2428|      0|                return CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 2429|      0|            }
 2430|      0|            mac_bytes =
 2431|      0|                ((CK_RC2_MAC_GENERAL_PARAMS *)pMechanism->pParameter)->ulMacLength;
 2432|       |        /* fall through */
 2433|      0|        case CKM_RC2_MAC:
  ------------------
  |  |  806|      0|#define CKM_RC2_MAC 0x00000103UL
  ------------------
  |  Branch (2433:9): [True: 0, False: 11.4k]
  ------------------
 2434|       |            /* this works because ulEffectiveBits is in the same place in both the
 2435|       |             * CK_RC2_MAC_GENERAL_PARAMS and CK_RC2_CBC_PARAMS */
 2436|      0|            rc2_params.ulEffectiveBits = ((CK_RC2_MAC_GENERAL_PARAMS *)
 2437|      0|                                              pMechanism->pParameter)
 2438|      0|                                             ->ulEffectiveBits;
 2439|      0|            PORT_Memset(rc2_params.iv, 0, sizeof(rc2_params.iv));
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2440|      0|            cbc_mechanism.mechanism = CKM_RC2_CBC;
  ------------------
  |  |  805|      0|#define CKM_RC2_CBC 0x00000102UL
  ------------------
 2441|      0|            cbc_mechanism.pParameter = &rc2_params;
 2442|      0|            cbc_mechanism.ulParameterLen = sizeof(rc2_params);
 2443|      0|            blockSize = 8;
 2444|      0|            break;
 2445|      0|#endif /* NSS_DISABLE_DEPRECATED_RC2 */
 2446|       |
 2447|       |#if NSS_SOFTOKEN_DOES_RC5
 2448|       |        case CKM_RC5_MAC_GENERAL:
 2449|       |            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_RC5_MAC_GENERAL_PARAMS))) {
 2450|       |                return CKR_MECHANISM_PARAM_INVALID;
 2451|       |            }
 2452|       |            mac_bytes =
 2453|       |                ((CK_RC5_MAC_GENERAL_PARAMS *)pMechanism->pParameter)->ulMacLength;
 2454|       |        /* fall through */
 2455|       |        case CKM_RC5_MAC:
 2456|       |            /* this works because ulEffectiveBits is in the same place in both the
 2457|       |             * CK_RC5_MAC_GENERAL_PARAMS and CK_RC5_CBC_PARAMS */
 2458|       |            if (BAD_PARAM_CAST(pMechanism, sizeof(CK_RC5_MAC_GENERAL_PARAMS))) {
 2459|       |                return CKR_MECHANISM_PARAM_INVALID;
 2460|       |            }
 2461|       |            rc5_mac = (CK_RC5_MAC_GENERAL_PARAMS *)pMechanism->pParameter;
 2462|       |            rc5_params.ulWordsize = rc5_mac->ulWordsize;
 2463|       |            rc5_params.ulRounds = rc5_mac->ulRounds;
 2464|       |            rc5_params.pIv = ivBlock;
 2465|       |            if ((blockSize = rc5_mac->ulWordsize * 2) > SFTK_MAX_BLOCK_SIZE)
 2466|       |                return CKR_MECHANISM_PARAM_INVALID;
 2467|       |            rc5_params.ulIvLen = blockSize;
 2468|       |            PORT_Memset(ivBlock, 0, blockSize);
 2469|       |            cbc_mechanism.mechanism = CKM_RC5_CBC;
 2470|       |            cbc_mechanism.pParameter = &rc5_params;
 2471|       |            cbc_mechanism.ulParameterLen = sizeof(rc5_params);
 2472|       |            break;
 2473|       |#endif
 2474|       |        /* add cast and idea later */
 2475|      0|        case CKM_DES_MAC_GENERAL:
  ------------------
  |  |  820|      0|#define CKM_DES_MAC_GENERAL 0x00000124UL
  ------------------
  |  Branch (2475:9): [True: 0, False: 11.4k]
  ------------------
 2476|      0|            mac_bytes = *(CK_ULONG *)pMechanism->pParameter;
 2477|       |        /* fall through */
 2478|      0|        case CKM_DES_MAC:
  ------------------
  |  |  817|      0|#define CKM_DES_MAC 0x00000123UL
  ------------------
  |  Branch (2478:9): [True: 0, False: 11.4k]
  ------------------
 2479|      0|            blockSize = 8;
 2480|      0|            PORT_Memset(ivBlock, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2481|      0|            cbc_mechanism.mechanism = CKM_DES_CBC;
  ------------------
  |  |  816|      0|#define CKM_DES_CBC 0x00000122UL
  ------------------
 2482|      0|            cbc_mechanism.pParameter = &ivBlock;
 2483|      0|            cbc_mechanism.ulParameterLen = blockSize;
 2484|      0|            break;
 2485|      0|        case CKM_DES3_MAC_GENERAL:
  ------------------
  |  |  832|      0|#define CKM_DES3_MAC_GENERAL 0x00000135UL
  ------------------
  |  Branch (2485:9): [True: 0, False: 11.4k]
  ------------------
 2486|      0|            mac_bytes = *(CK_ULONG *)pMechanism->pParameter;
 2487|       |        /* fall through */
 2488|      0|        case CKM_DES3_MAC:
  ------------------
  |  |  827|      0|#define CKM_DES3_MAC 0x00000134UL
  ------------------
  |  Branch (2488:9): [True: 0, False: 11.4k]
  ------------------
 2489|      0|            blockSize = 8;
 2490|      0|            PORT_Memset(ivBlock, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2491|      0|            cbc_mechanism.mechanism = CKM_DES3_CBC;
  ------------------
  |  |  826|      0|#define CKM_DES3_CBC 0x00000133UL
  ------------------
 2492|      0|            cbc_mechanism.pParameter = &ivBlock;
 2493|      0|            cbc_mechanism.ulParameterLen = blockSize;
 2494|      0|            break;
 2495|      0|        case CKM_CDMF_MAC_GENERAL:
  ------------------
  |  |  838|      0|#define CKM_CDMF_MAC_GENERAL 0x00000144UL
  ------------------
  |  Branch (2495:9): [True: 0, False: 11.4k]
  ------------------
 2496|      0|            mac_bytes = *(CK_ULONG *)pMechanism->pParameter;
 2497|       |        /* fall through */
 2498|      0|        case CKM_CDMF_MAC:
  ------------------
  |  |  837|      0|#define CKM_CDMF_MAC 0x00000143UL
  ------------------
  |  Branch (2498:9): [True: 0, False: 11.4k]
  ------------------
 2499|      0|            blockSize = 8;
 2500|      0|            PORT_Memset(ivBlock, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2501|      0|            cbc_mechanism.mechanism = CKM_CDMF_CBC;
  ------------------
  |  |  836|      0|#define CKM_CDMF_CBC 0x00000142UL
  ------------------
 2502|      0|            cbc_mechanism.pParameter = &ivBlock;
 2503|      0|            cbc_mechanism.ulParameterLen = blockSize;
 2504|      0|            break;
 2505|      0|#ifndef NSS_DISABLE_DEPRECATED_SEED
 2506|      0|        case CKM_SEED_MAC_GENERAL:
  ------------------
  |  | 1159|      0|#define CKM_SEED_MAC_GENERAL 0x00000654UL
  ------------------
  |  Branch (2506:9): [True: 0, False: 11.4k]
  ------------------
 2507|      0|            mac_bytes = *(CK_ULONG *)pMechanism->pParameter;
 2508|       |        /* fall through */
 2509|      0|        case CKM_SEED_MAC:
  ------------------
  |  | 1158|      0|#define CKM_SEED_MAC 0x00000653UL
  ------------------
  |  Branch (2509:9): [True: 0, False: 11.4k]
  ------------------
 2510|      0|            blockSize = 16;
 2511|      0|            PORT_Memset(ivBlock, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2512|      0|            cbc_mechanism.mechanism = CKM_SEED_CBC;
  ------------------
  |  | 1157|      0|#define CKM_SEED_CBC 0x00000652UL
  ------------------
 2513|      0|            cbc_mechanism.pParameter = &ivBlock;
 2514|      0|            cbc_mechanism.ulParameterLen = blockSize;
 2515|      0|            break;
 2516|      0|#endif /* NSS_DISABLE_DEPRECATED_SEED */
 2517|      0|        case CKM_CAMELLIA_MAC_GENERAL:
  ------------------
  |  | 1139|      0|#define CKM_CAMELLIA_MAC_GENERAL 0x00000554UL
  ------------------
  |  Branch (2517:9): [True: 0, False: 11.4k]
  ------------------
 2518|      0|            mac_bytes = *(CK_ULONG *)pMechanism->pParameter;
 2519|       |        /* fall through */
 2520|      0|        case CKM_CAMELLIA_MAC:
  ------------------
  |  | 1138|      0|#define CKM_CAMELLIA_MAC 0x00000553UL
  ------------------
  |  Branch (2520:9): [True: 0, False: 11.4k]
  ------------------
 2521|      0|            blockSize = 16;
 2522|      0|            PORT_Memset(ivBlock, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2523|      0|            cbc_mechanism.mechanism = CKM_CAMELLIA_CBC;
  ------------------
  |  | 1137|      0|#define CKM_CAMELLIA_CBC 0x00000552UL
  ------------------
 2524|      0|            cbc_mechanism.pParameter = &ivBlock;
 2525|      0|            cbc_mechanism.ulParameterLen = blockSize;
 2526|      0|            break;
 2527|      0|        case CKM_AES_MAC_GENERAL:
  ------------------
  |  | 1110|      0|#define CKM_AES_MAC_GENERAL 0x00001084UL
  ------------------
  |  Branch (2527:9): [True: 0, False: 11.4k]
  ------------------
 2528|      0|            mac_bytes = *(CK_ULONG *)pMechanism->pParameter;
 2529|       |        /* fall through */
 2530|      0|        case CKM_AES_MAC:
  ------------------
  |  | 1109|      0|#define CKM_AES_MAC 0x00001083UL
  ------------------
  |  Branch (2530:9): [True: 0, False: 11.4k]
  ------------------
 2531|      0|            blockSize = 16;
 2532|      0|            PORT_Memset(ivBlock, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2533|      0|            cbc_mechanism.mechanism = CKM_AES_CBC;
  ------------------
  |  | 1108|      0|#define CKM_AES_CBC 0x00001082UL
  ------------------
 2534|      0|            cbc_mechanism.pParameter = &ivBlock;
 2535|      0|            cbc_mechanism.ulParameterLen = blockSize;
 2536|      0|            break;
 2537|      0|        case CKM_AES_XCBC_MAC_96:
  ------------------
  |  | 1122|      0|#define CKM_AES_XCBC_MAC_96 0x0000108DUL
  ------------------
  |  Branch (2537:9): [True: 0, False: 11.4k]
  ------------------
 2538|      0|        case CKM_AES_XCBC_MAC:
  ------------------
  |  | 1121|      0|#define CKM_AES_XCBC_MAC 0x0000108CUL
  ------------------
  |  Branch (2538:9): [True: 0, False: 11.4k]
  ------------------
 2539|       |            /* The only difference between CKM_AES_XCBC_MAC
 2540|       |             * and CKM_AES_XCBC_MAC_96 is the size of the returned mac. */
 2541|      0|            mac_bytes = pMechanism->mechanism == CKM_AES_XCBC_MAC_96 ? 12 : 16;
  ------------------
  |  | 1122|      0|#define CKM_AES_XCBC_MAC_96 0x0000108DUL
  ------------------
  |  Branch (2541:25): [True: 0, False: 0]
  ------------------
 2542|      0|            blockSize = 16;
 2543|      0|            PORT_Memset(ivBlock, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2544|      0|            cbc_mechanism.mechanism = CKM_AES_CBC;
  ------------------
  |  | 1108|      0|#define CKM_AES_CBC 0x00001082UL
  ------------------
 2545|      0|            cbc_mechanism.pParameter = &ivBlock;
 2546|      0|            cbc_mechanism.ulParameterLen = blockSize;
 2547|       |            /* is XCBC requires extra processing at the end of the operation */
 2548|      0|            isXCBC = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2549|       |            /* The input key is used to generate k1, k2, and k3. k2 and k3
 2550|       |             * are used at the end in the pad step. k1 replaces the input
 2551|       |             * key in the aes cbc mac */
 2552|      0|            crv = sftk_aes_xcbc_new_keys(hSession, hKey, &hKey, k2, k3);
 2553|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2553:17): [True: 0, False: 0]
  ------------------
 2554|      0|                return crv;
 2555|      0|            }
 2556|      0|            break;
 2557|  11.4k|        default:
  ------------------
  |  Branch (2557:9): [True: 11.4k, False: 0]
  ------------------
 2558|  11.4k|            return CKR_FUNCTION_NOT_SUPPORTED;
  ------------------
  |  | 1426|  11.4k|#define CKR_FUNCTION_NOT_SUPPORTED 0x00000054UL
  ------------------
 2559|  11.4k|    }
 2560|       |
 2561|       |    /* if MAC size is externally supplied, it should be checked.
 2562|       |     */
 2563|      0|    if (mac_bytes == SFTK_INVALID_MAC_SIZE)
  ------------------
  |  |  256|      0|#define SFTK_INVALID_MAC_SIZE 0xffffffff
  ------------------
  |  Branch (2563:9): [True: 0, False: 0]
  ------------------
 2564|      0|        mac_bytes = blockSize >> 1;
 2565|      0|    else {
 2566|      0|        if (mac_bytes > blockSize) {
  ------------------
  |  Branch (2566:13): [True: 0, False: 0]
  ------------------
 2567|      0|            crv = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
 2568|      0|            goto fail;
 2569|      0|        }
 2570|      0|    }
 2571|       |
 2572|      0|    crv = sftk_CryptInit(hSession, &cbc_mechanism, hKey,
 2573|      0|                         CKA_ENCRYPT, /* CBC mech is able to ENCRYPT, not SIGN/VERIFY */
  ------------------
  |  |  547|      0|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 2574|      0|                         keyUsage, contextType, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2575|      0|    if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2575:9): [True: 0, False: 0]
  ------------------
 2576|      0|        goto fail;
 2577|      0|    crv = sftk_GetContext(hSession, &context, contextType, PR_TRUE, NULL);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2578|       |
 2579|       |    /* this shouldn't happen! */
 2580|      0|    PORT_Assert(crv == CKR_OK);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2581|      0|    if (crv != CKR_OK)
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2581:9): [True: 0, False: 0]
  ------------------
 2582|      0|        goto fail;
 2583|      0|    context->blockSize = blockSize;
 2584|      0|    context->macSize = mac_bytes;
 2585|      0|    context->isXCBC = isXCBC;
 2586|      0|    if (isXCBC) {
  ------------------
  |  Branch (2586:9): [True: 0, False: 0]
  ------------------
 2587|       |        /* save the xcbc specific parameters */
 2588|      0|        PORT_Memcpy(context->k2, k2, blockSize);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 2589|      0|        PORT_Memcpy(context->k3, k3, blockSize);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 2590|      0|        PORT_Memset(k2, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2591|      0|        PORT_Memset(k3, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2592|       |        /* get rid of the temp key now that the context has been created */
 2593|      0|        NSC_DestroyObject(hSession, hKey);
 2594|      0|    }
 2595|      0|    return CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
 2596|      0|fail:
 2597|      0|    if (isXCBC) {
  ------------------
  |  Branch (2597:9): [True: 0, False: 0]
  ------------------
 2598|      0|        PORT_Memset(k2, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2599|      0|        PORT_Memset(k3, 0, blockSize);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
 2600|      0|        NSC_DestroyObject(hSession, hKey); /* get rid of our temp key */
 2601|      0|    }
 2602|      0|    return crv;
 2603|      0|}
pkcs11c.c:sftk_Space:
  194|  7.61k|{
  195|  7.61k|    PORT_Free(data);
  ------------------
  |  |   60|  7.61k|#define PORT_Free PORT_Free_Util
  ------------------
  196|  7.61k|}
pkcs11c.c:sftk_ValidatePssParams:
  336|    913|{
  337|    913|    if (!params) {
  ------------------
  |  Branch (337:9): [True: 0, False: 913]
  ------------------
  338|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  339|      0|    }
  340|    913|    if (sftk_GetHashTypeFromMechanism(params->hashAlg) == HASH_AlgNULL ||
  ------------------
  |  Branch (340:9): [True: 0, False: 913]
  ------------------
  341|    913|        sftk_GetHashTypeFromMechanism(params->mgf) == HASH_AlgNULL) {
  ------------------
  |  Branch (341:9): [True: 0, False: 913]
  ------------------
  342|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  343|      0|    }
  344|    913|    return PR_TRUE;
  ------------------
  |  |  437|    913|#define PR_TRUE 1
  ------------------
  345|    913|}
pkcs11c.c:sftk_ZSpace:
  200|    913|{
  201|    913|    size_t len = *(size_t *)data;
  202|    913|    PORT_ZFree(data, len);
  ------------------
  |  |   75|    913|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  203|    913|}
pkcs11c.c:sftk_doMACInit:
 2212|  7.61k|{
 2213|  7.61k|    CK_RV crv;
 2214|  7.61k|    sftk_MACCtx *context;
 2215|  7.61k|    CK_ULONG *intpointer;
 2216|  7.61k|    PRBool isFIPS = sftk_isFIPS(key->slot->slotID);
  ------------------
  |  |  506|  7.61k|    (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  500|  7.61k|#define FIPS_SLOT_ID 3
  |  |  ------------------
  |  |                   (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  567|  7.61k|#define SFTK_MIN_FIPS_USER_SLOT_ID 101
  |  |  ------------------
  |  |  |  Branch (506:6): [True: 0, False: 7.61k]
  |  |  |  Branch (506:32): [True: 0, False: 7.61k]
  |  |  ------------------
  ------------------
 2217|       |
 2218|       |    /* Set up the initial context. */
 2219|  7.61k|    crv = sftk_MAC_Create(mech, key, &context);
 2220|  7.61k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  7.61k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (2220:9): [True: 0, False: 7.61k]
  ------------------
 2221|      0|        return crv;
 2222|      0|    }
 2223|       |
 2224|  7.61k|    session->hashInfo = context;
 2225|  7.61k|    session->multi = PR_TRUE;
  ------------------
  |  |  437|  7.61k|#define PR_TRUE 1
  ------------------
 2226|       |
 2227|       |    /* Required by FIPS 198 Section 4. Delay this check until after the MAC
 2228|       |     * has been initialized to steal the output size of the MAC. */
 2229|  7.61k|    if (isFIPS && (mac_size < 4 || mac_size < context->mac_size / 2)) {
  ------------------
  |  Branch (2229:9): [True: 0, False: 7.61k]
  |  Branch (2229:20): [True: 0, False: 0]
  |  Branch (2229:36): [True: 0, False: 0]
  ------------------
 2230|      0|        sftk_MAC_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2231|      0|        return CKR_BUFFER_TOO_SMALL;
  ------------------
  |  | 1514|      0|#define CKR_BUFFER_TOO_SMALL 0x00000150UL
  ------------------
 2232|      0|    }
 2233|       |
 2234|       |    /* Configure our helper functions appropriately. Note that these casts
 2235|       |     * ignore the return values. */
 2236|  7.61k|    session->hashUpdate = SFTKHash_sftk_MAC_Update;
 2237|  7.61k|    session->end = SFTKHash_sftk_MAC_End;
 2238|  7.61k|    session->hashdestroy = SFTKHash_sftk_MAC_DestroyContext;
 2239|       |
 2240|  7.61k|    intpointer = PORT_New(CK_ULONG);
  ------------------
  |  |  151|  7.61k|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|  7.61k|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
 2241|  7.61k|    if (intpointer == NULL) {
  ------------------
  |  Branch (2241:9): [True: 0, False: 7.61k]
  ------------------
 2242|      0|        sftk_MAC_DestroyContext(context, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2243|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 2244|      0|    }
 2245|  7.61k|    *intpointer = mac_size;
 2246|  7.61k|    session->cipherInfo = intpointer;
 2247|       |
 2248|       |    /* Since we're only "hashing", copy the result from session->end to the
 2249|       |     * caller using sftk_SignCopy. */
 2250|  7.61k|    session->update = sftk_SignCopy;
 2251|  7.61k|    session->verify = sftk_HMACCmp;
 2252|  7.61k|    session->destroy = sftk_Space;
 2253|       |
 2254|  7.61k|    session->maxLen = context->mac_size;
 2255|       |
 2256|  7.61k|    return CKR_OK;
  ------------------
  |  | 1388|  7.61k|#define CKR_OK 0x00000000UL
  ------------------
 2257|  7.61k|}
pkcs11c.c:SFTKHash_sftk_MAC_Update:
  101|  4.46k|    {                                                                                     \
  102|  4.46k|        ctxtype *ctx = vctx;                                                              \
  103|  4.46k|        mmm##_Update(ctx, input, len);                                                    \
  104|  4.46k|    }                                                                                     \
pkcs11c.c:SFTKHash_sftk_MAC_End:
  108|  4.46k|    {                                                                                     \
  109|  4.46k|        ctxtype *ctx = vctx;                                                              \
  110|  4.46k|        mmm##_End(ctx, digest, len, maxLen);                                              \
  111|  4.46k|    }                                                                                     \
pkcs11c.c:SFTKHash_sftk_MAC_DestroyContext:
  114|  7.61k|    {                                                                                     \
  115|  7.61k|        ctxtype *ctx = vctx;                                                              \
  116|  7.61k|        mmm##_DestroyContext(ctx, freeit);                                                \
  117|  7.61k|    }
pkcs11c.c:sftk_SignCopy:
 2178|  4.46k|{
 2179|  4.46k|    unsigned int toCopy = *(CK_ULONG *)copyLen;
 2180|  4.46k|    if (toCopy > maxLength) {
  ------------------
  |  Branch (2180:9): [True: 0, False: 4.46k]
  ------------------
 2181|      0|        toCopy = maxLength;
 2182|      0|    }
 2183|  4.46k|    if (toCopy > hashResultLength) {
  ------------------
  |  Branch (2183:9): [True: 0, False: 4.46k]
  ------------------
 2184|      0|        toCopy = hashResultLength;
 2185|      0|    }
 2186|  4.46k|    memcpy(out, hashResult, toCopy);
 2187|  4.46k|    if (outLength) {
  ------------------
  |  Branch (2187:9): [True: 4.46k, False: 0]
  ------------------
 2188|  4.46k|        *outLength = toCopy;
 2189|  4.46k|    }
 2190|  4.46k|    return SECSuccess;
 2191|  4.46k|}
pkcs11c.c:sftk_MACUpdate:
 3322|  6.36k|{
 3323|  6.36k|    SFTKSession *session;
 3324|  6.36k|    SFTKSessionContext *context;
 3325|  6.36k|    CK_RV crv;
 3326|       |
 3327|       |    /* make sure we're legal */
 3328|  6.36k|    crv = sftk_GetContext(hSession, &context, type, PR_TRUE, &session);
  ------------------
  |  |  437|  6.36k|#define PR_TRUE 1
  ------------------
 3329|  6.36k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  6.36k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3329:9): [True: 0, False: 6.36k]
  ------------------
 3330|      0|        return crv;
 3331|       |
 3332|  6.36k|    if (context->hashInfo) {
  ------------------
  |  Branch (3332:9): [True: 6.36k, False: 0]
  ------------------
 3333|  6.36k|#if (ULONG_MAX > UINT_MAX)
 3334|  6.36k|        while (ulPartLen > UINT_MAX) {
  ------------------
  |  Branch (3334:16): [True: 0, False: 6.36k]
  ------------------
 3335|      0|            (*context->hashUpdate)(context->cipherInfo, pPart, UINT_MAX);
 3336|      0|            pPart += UINT_MAX;
 3337|      0|            ulPartLen -= UINT_MAX;
 3338|      0|        }
 3339|  6.36k|#endif
 3340|  6.36k|        (*context->hashUpdate)(context->hashInfo, pPart, ulPartLen);
 3341|  6.36k|    } else {
 3342|       |        /* must be block cipher MACing */
 3343|       |
 3344|      0|        unsigned int blkSize = context->blockSize;
 3345|      0|        unsigned char *residual = /* free room in context->padBuf */
 3346|      0|            context->padBuf + context->padDataLength;
 3347|      0|        unsigned int minInput = /* min input for MACing at least one block */
 3348|      0|            blkSize - context->padDataLength;
 3349|       |
 3350|       |        /* not enough data even for one block */
 3351|      0|        if (ulPartLen <= minInput) {
  ------------------
  |  Branch (3351:13): [True: 0, False: 0]
  ------------------
 3352|      0|            PORT_Memcpy(residual, pPart, ulPartLen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 3353|      0|            context->padDataLength += ulPartLen;
 3354|      0|            goto cleanup;
 3355|      0|        }
 3356|       |        /* MACing residual */
 3357|      0|        if (context->padDataLength) {
  ------------------
  |  Branch (3357:13): [True: 0, False: 0]
  ------------------
 3358|      0|            PORT_Memcpy(residual, pPart, minInput);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 3359|      0|            ulPartLen -= minInput;
 3360|      0|            pPart += minInput;
 3361|      0|            if (CKR_OK != (crv = sftk_MACBlock(context, context->padBuf)))
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3361:17): [True: 0, False: 0]
  ------------------
 3362|      0|                goto terminate;
 3363|      0|        }
 3364|       |        /* MACing full blocks */
 3365|      0|        while (ulPartLen > blkSize) {
  ------------------
  |  Branch (3365:16): [True: 0, False: 0]
  ------------------
 3366|      0|            if (CKR_OK != (crv = sftk_MACBlock(context, pPart)))
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (3366:17): [True: 0, False: 0]
  ------------------
 3367|      0|                goto terminate;
 3368|      0|            ulPartLen -= blkSize;
 3369|      0|            pPart += blkSize;
 3370|      0|        }
 3371|       |        /* save the residual */
 3372|      0|        if ((context->padDataLength = ulPartLen))
  ------------------
  |  Branch (3372:13): [True: 0, False: 0]
  ------------------
 3373|      0|            PORT_Memcpy(context->padBuf, pPart, ulPartLen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 3374|      0|    } /* blk cipher MACing */
 3375|       |
 3376|  6.36k|    goto cleanup;
 3377|       |
 3378|  6.36k|terminate:
 3379|      0|    sftk_TerminateOp(session, type, context);
 3380|  6.36k|cleanup:
 3381|  6.36k|    sftk_FreeSession(session);
 3382|  6.36k|    return crv;
 3383|      0|}
pkcs11c.c:sftk_RSACheckSign:
 3660|     47|{
 3661|     47|    NSSLOWKEYPublicKey *key = ctx;
 3662|     47|    PORT_Assert(key->keyType == NSSLOWKEYRSAKey);
  ------------------
  |  |  120|     47|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     47|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 47, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3663|     47|    if (key->keyType != NSSLOWKEYRSAKey) {
  ------------------
  |  Branch (3663:9): [True: 0, False: 47]
  ------------------
 3664|      0|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3665|      0|        return SECFailure;
 3666|      0|    }
 3667|       |
 3668|     47|    return RSA_CheckSign(&key->u.rsa, sig, sigLen, digest, digestLen);
 3669|     47|}
pkcs11c.c:sftk_RSACheckSignPSS:
 3690|    913|{
 3691|    913|    SFTKPSSVerifyInfo *info = ctx;
 3692|    913|    HASH_HashType hashAlg;
 3693|    913|    HASH_HashType maskHashAlg;
 3694|    913|    CK_RSA_PKCS_PSS_PARAMS *params = &info->params;
 3695|       |
 3696|    913|    PORT_Assert(info->key->keyType == NSSLOWKEYRSAKey);
  ------------------
  |  |  120|    913|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    913|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 913, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3697|    913|    if (info->key->keyType != NSSLOWKEYRSAKey) {
  ------------------
  |  Branch (3697:9): [True: 0, False: 913]
  ------------------
 3698|      0|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3699|      0|        return SECFailure;
 3700|      0|    }
 3701|       |
 3702|    913|    hashAlg = sftk_GetHashTypeFromMechanism(params->hashAlg);
 3703|    913|    maskHashAlg = sftk_GetHashTypeFromMechanism(params->mgf);
 3704|       |
 3705|    913|    return RSA_CheckSignPSS(&info->key->u.rsa, hashAlg, maskHashAlg,
 3706|    913|                            params->sLen, sig, sigLen, digest, digestLen);
 3707|    913|}
pkcs11c.c:nsc_DSA_Verify_Stub:
 2775|    913|{
 2776|    913|    NSSLOWKEYPublicKey *key = ctx;
 2777|    913|    SECItem signature = { siBuffer, (unsigned char *)sigBuf, sigLen };
 2778|    913|    SECItem digest = { siBuffer, (unsigned char *)dataBuf, dataLen };
 2779|    913|    return DSA_VerifyDigest(&(key->u.dsa), &signature, &digest);
 2780|    913|}
pkcs11c.c:nsc_ECDSAVerifyStub:
 2801|     79|{
 2802|     79|    NSSLOWKEYPublicKey *key = ctx;
 2803|     79|    SECItem signature = { siBuffer, (unsigned char *)sigBuf, sigLen };
 2804|     79|    SECItem digest = { siBuffer, (unsigned char *)dataBuf, dataLen };
 2805|     79|    return ECDSA_VerifyDigest(&(key->u.ec), &signature, &digest);
 2806|     79|}
pkcs11c.c:sftk_RSACheckSignRecover:
 4044|    543|{
 4045|    543|    NSSLOWKEYPublicKey *key = ctx;
 4046|    543|    PORT_Assert(key->keyType == NSSLOWKEYRSAKey);
  ------------------
  |  |  120|    543|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    543|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 543, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4047|    543|    if (key->keyType != NSSLOWKEYRSAKey) {
  ------------------
  |  Branch (4047:9): [True: 0, False: 543]
  ------------------
 4048|      0|        PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4049|      0|        return SECFailure;
 4050|      0|    }
 4051|       |
 4052|    543|    return RSA_CheckSignRecover(&key->u.rsa, data, dataLen, maxDataLen,
 4053|    543|                                sig, sigLen);
 4054|    543|}
pkcs11c.c:nsc_SetupBulkKeyGen:
 4477|  4.62k|{
 4478|  4.62k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  4.62k|#define CKR_OK 0x00000000UL
  ------------------
 4479|       |
 4480|  4.62k|    switch (mechanism) {
 4481|      0|#ifndef NSS_DISABLE_DEPRECATED_RC2
 4482|      0|        case CKM_RC2_KEY_GEN:
  ------------------
  |  |  803|      0|#define CKM_RC2_KEY_GEN 0x00000100UL
  ------------------
  |  Branch (4482:9): [True: 0, False: 4.62k]
  ------------------
 4483|      0|            *key_type = CKK_RC2;
  ------------------
  |  |  384|      0|#define CKK_RC2 0x00000011UL
  ------------------
 4484|      0|            if (*key_length == 0)
  ------------------
  |  Branch (4484:17): [True: 0, False: 0]
  ------------------
 4485|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 4486|      0|            break;
 4487|      0|#endif /* NSS_DISABLE_DEPRECATED_RC2 */
 4488|       |#if NSS_SOFTOKEN_DOES_RC5
 4489|       |        case CKM_RC5_KEY_GEN:
 4490|       |            *key_type = CKK_RC5;
 4491|       |            if (*key_length == 0)
 4492|       |                crv = CKR_TEMPLATE_INCOMPLETE;
 4493|       |            break;
 4494|       |#endif
 4495|      0|        case CKM_RC4_KEY_GEN:
  ------------------
  |  |  812|      0|#define CKM_RC4_KEY_GEN 0x00000110UL
  ------------------
  |  Branch (4495:9): [True: 0, False: 4.62k]
  ------------------
 4496|      0|            *key_type = CKK_RC4;
  ------------------
  |  |  385|      0|#define CKK_RC4 0x00000012UL
  ------------------
 4497|      0|            if (*key_length == 0)
  ------------------
  |  Branch (4497:17): [True: 0, False: 0]
  ------------------
 4498|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 4499|      0|            break;
 4500|      0|        case CKM_GENERIC_SECRET_KEY_GEN:
  ------------------
  |  |  953|      0|#define CKM_GENERIC_SECRET_KEY_GEN 0x00000350UL
  ------------------
  |  Branch (4500:9): [True: 0, False: 4.62k]
  ------------------
 4501|      0|            *key_type = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|      0|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 4502|      0|            if (*key_length == 0)
  ------------------
  |  Branch (4502:17): [True: 0, False: 0]
  ------------------
 4503|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 4504|      0|            break;
 4505|      0|        case CKM_CDMF_KEY_GEN:
  ------------------
  |  |  834|      0|#define CKM_CDMF_KEY_GEN 0x00000140UL
  ------------------
  |  Branch (4505:9): [True: 0, False: 4.62k]
  ------------------
 4506|      0|            *key_type = CKK_CDMF;
  ------------------
  |  |  401|      0|#define CKK_CDMF 0x0000001EUL
  ------------------
 4507|      0|            *key_length = 8;
 4508|      0|            break;
 4509|      0|        case CKM_DES_KEY_GEN:
  ------------------
  |  |  814|      0|#define CKM_DES_KEY_GEN 0x00000120UL
  ------------------
  |  Branch (4509:9): [True: 0, False: 4.62k]
  ------------------
 4510|      0|            *key_type = CKK_DES;
  ------------------
  |  |  386|      0|#define CKK_DES 0x00000013UL
  ------------------
 4511|      0|            *key_length = 8;
 4512|      0|            break;
 4513|      0|        case CKM_DES2_KEY_GEN:
  ------------------
  |  |  823|      0|#define CKM_DES2_KEY_GEN 0x00000130UL
  ------------------
  |  Branch (4513:9): [True: 0, False: 4.62k]
  ------------------
 4514|      0|            *key_type = CKK_DES2;
  ------------------
  |  |  387|      0|#define CKK_DES2 0x00000014UL
  ------------------
 4515|      0|            *key_length = 16;
 4516|      0|            break;
 4517|      1|        case CKM_DES3_KEY_GEN:
  ------------------
  |  |  824|      1|#define CKM_DES3_KEY_GEN 0x00000131UL
  ------------------
  |  Branch (4517:9): [True: 1, False: 4.62k]
  ------------------
 4518|      1|            *key_type = CKK_DES3;
  ------------------
  |  |  388|      1|#define CKK_DES3 0x00000015UL
  ------------------
 4519|      1|            *key_length = 24;
 4520|      1|            break;
 4521|      0|#ifndef NSS_DISABLE_DEPRECATED_SEED
 4522|      0|        case CKM_SEED_KEY_GEN:
  ------------------
  |  | 1155|      0|#define CKM_SEED_KEY_GEN 0x00000650UL
  ------------------
  |  Branch (4522:9): [True: 0, False: 4.62k]
  ------------------
 4523|      0|            *key_type = CKK_SEED;
  ------------------
  |  |  416|      0|#define CKK_SEED 0x0000002FUL /* was 2A */
  ------------------
 4524|      0|            *key_length = 16;
 4525|      0|            break;
 4526|      0|#endif /* NSS_DISABLE_DEPRECATED_SEED */
 4527|      0|        case CKM_CAMELLIA_KEY_GEN:
  ------------------
  |  | 1135|      0|#define CKM_CAMELLIA_KEY_GEN 0x00000550UL
  ------------------
  |  Branch (4527:9): [True: 0, False: 4.62k]
  ------------------
 4528|      0|            *key_type = CKK_CAMELLIA;
  ------------------
  |  |  414|      0|#define CKK_CAMELLIA 0x00000025UL
  ------------------
 4529|      0|            if (*key_length == 0)
  ------------------
  |  Branch (4529:17): [True: 0, False: 0]
  ------------------
 4530|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 4531|      0|            break;
 4532|      0|        case CKM_AES_KEY_GEN:
  ------------------
  |  | 1106|      0|#define CKM_AES_KEY_GEN 0x00001080UL
  ------------------
  |  Branch (4532:9): [True: 0, False: 4.62k]
  ------------------
 4533|      0|            *key_type = CKK_AES;
  ------------------
  |  |  402|      0|#define CKK_AES 0x0000001FUL
  ------------------
 4534|      0|            if (*key_length == 0)
  ------------------
  |  Branch (4534:17): [True: 0, False: 0]
  ------------------
 4535|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 4536|      0|            break;
 4537|  4.62k|        case CKM_NSS_CHACHA20_KEY_GEN:
  ------------------
  |  |  242|  4.62k|#define CKM_NSS_CHACHA20_KEY_GEN (CKM_NSS + 27)
  |  |  ------------------
  |  |  |  |  162|  4.62k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  4.62k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  4.62k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4537:9): [True: 4.62k, False: 1]
  ------------------
 4538|  4.62k|            *key_type = CKK_NSS_CHACHA20;
  ------------------
  |  |   56|  4.62k|#define CKK_NSS_CHACHA20 (CKK_NSS + 4)
  |  |  ------------------
  |  |  |  |   49|  4.62k|#define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |  458|  4.62k|#define CKK_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKK_NSS (CKK_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  4.62k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4539|  4.62k|            *key_length = 32;
 4540|  4.62k|            break;
 4541|      0|        case CKM_CHACHA20_KEY_GEN:
  ------------------
  |  | 1203|      0|#define CKM_CHACHA20_KEY_GEN 0x00001225UL
  ------------------
  |  Branch (4541:9): [True: 0, False: 4.62k]
  ------------------
 4542|      0|            *key_type = CKK_CHACHA20;
  ------------------
  |  |  433|      0|#define CKK_CHACHA20 0x00000033UL
  ------------------
 4543|      0|            *key_length = 32;
 4544|      0|            break;
 4545|      0|        case CKM_HKDF_KEY_GEN:
  ------------------
  |  | 1298|      0|#define CKM_HKDF_KEY_GEN 0x0000402cUL
  ------------------
  |  Branch (4545:9): [True: 0, False: 4.62k]
  ------------------
 4546|      0|            *key_type = CKK_HKDF;
  ------------------
  |  |  450|      0|#define CKK_HKDF 0x00000042UL
  ------------------
 4547|      0|            if (*key_length == 0)
  ------------------
  |  Branch (4547:17): [True: 0, False: 0]
  ------------------
 4548|      0|                crv = CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
 4549|      0|            break;
 4550|      0|        default:
  ------------------
  |  Branch (4550:9): [True: 0, False: 4.62k]
  ------------------
 4551|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4552|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
 4553|      0|            break;
 4554|  4.62k|    }
 4555|       |
 4556|  4.62k|    return crv;
 4557|  4.62k|}
pkcs11c.c:sftk_PairwiseConsistencyCheck:
 5056|  1.91k|{
 5057|       |    /*
 5058|       |     *                      Key type    Mechanism type
 5059|       |     *                      --------------------------------
 5060|       |     * For encrypt/decrypt: CKK_RSA  => CKM_RSA_PKCS
 5061|       |     *                      others   => CKM_INVALID_MECHANISM
 5062|       |     *
 5063|       |     * For sign/verify:     CKK_RSA  => CKM_RSA_PKCS
 5064|       |     *                      CKK_DSA  => CKM_DSA
 5065|       |     *                      CKK_EC   => CKM_ECDSA
 5066|       |     *                      others   => CKM_INVALID_MECHANISM
 5067|       |     *
 5068|       |     * None of these mechanisms has a parameter.
 5069|       |     *
 5070|       |     * For derive           CKK_DH   => CKM_DH_PKCS_DERIVE
 5071|       |     *                      CKK_EC   => CKM_ECDH1_DERIVE
 5072|       |     *                      CKK_EC_MONTGOMERY   => CKM_ECDH1_DERIVE
 5073|       |     *                      others   => CKM_INVALID_MECHANISM
 5074|       |     *
 5075|       |     * The parameters for these mechanisms is the public key.
 5076|       |     */
 5077|  1.91k|    CK_MECHANISM mech = { 0, NULL, 0 };
 5078|       |
 5079|  1.91k|    CK_ULONG modulusLen = 0;
 5080|  1.91k|    CK_ULONG subPrimeLen = 0;
 5081|  1.91k|    PRBool isEncryptable = PR_FALSE;
  ------------------
  |  |  438|  1.91k|#define PR_FALSE 0
  ------------------
 5082|  1.91k|    PRBool canSignVerify = PR_FALSE;
  ------------------
  |  |  438|  1.91k|#define PR_FALSE 0
  ------------------
 5083|  1.91k|    PRBool isDerivable = PR_FALSE;
  ------------------
  |  |  438|  1.91k|#define PR_FALSE 0
  ------------------
 5084|  1.91k|    CK_RV crv;
 5085|       |
 5086|       |    /* Variables used for Encrypt/Decrypt functions. */
 5087|  1.91k|    unsigned char *known_message = (unsigned char *)"Known Crypto Message";
 5088|  1.91k|    unsigned char plaintext[PAIRWISE_MESSAGE_LENGTH];
 5089|  1.91k|    CK_ULONG bytes_decrypted;
 5090|  1.91k|    unsigned char *ciphertext;
 5091|  1.91k|    unsigned char *text_compared;
 5092|  1.91k|    CK_ULONG bytes_encrypted;
 5093|  1.91k|    CK_ULONG bytes_compared;
 5094|  1.91k|    CK_ULONG pairwise_digest_length = PAIRWISE_DIGEST_LENGTH;
  ------------------
  |  | 5041|  1.91k|#define PAIRWISE_DIGEST_LENGTH SHA1_LENGTH /* 160-bits */
  |  |  ------------------
  |  |  |  |   39|  1.91k|#define SHA1_LENGTH 20
  |  |  ------------------
  ------------------
 5095|       |
 5096|       |    /* Variables used for Signature/Verification functions. */
 5097|       |    /* Must be at least 256 bits for DSA2 digest */
 5098|  1.91k|    unsigned char *known_digest = (unsigned char *)"Mozilla Rules the World through NSS!";
 5099|  1.91k|    unsigned char *signature;
 5100|  1.91k|    CK_ULONG signature_length;
 5101|       |
 5102|  1.91k|    if (keyType == CKK_RSA) {
  ------------------
  |  |  372|  1.91k|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (5102:9): [True: 0, False: 1.91k]
  ------------------
 5103|      0|        SFTKAttribute *attribute;
 5104|       |
 5105|       |        /* Get modulus length of private key. */
 5106|      0|        attribute = sftk_FindAttribute(privateKey, CKA_MODULUS);
  ------------------
  |  |  558|      0|#define CKA_MODULUS 0x00000120UL
  ------------------
 5107|      0|        if (attribute == NULL) {
  ------------------
  |  Branch (5107:13): [True: 0, False: 0]
  ------------------
 5108|      0|            return CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
 5109|      0|        }
 5110|      0|        modulusLen = attribute->attrib.ulValueLen;
 5111|      0|        if (*(unsigned char *)attribute->attrib.pValue == 0) {
  ------------------
  |  Branch (5111:13): [True: 0, False: 0]
  ------------------
 5112|      0|            modulusLen--;
 5113|      0|        }
 5114|      0|        sftk_FreeAttribute(attribute);
 5115|  1.91k|    } else if (keyType == CKK_DSA) {
  ------------------
  |  |  373|  1.91k|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (5115:16): [True: 0, False: 1.91k]
  ------------------
 5116|      0|        SFTKAttribute *attribute;
 5117|       |
 5118|       |        /* Get subprime length of private key. */
 5119|      0|        attribute = sftk_FindAttribute(privateKey, CKA_SUBPRIME);
  ------------------
  |  |  570|      0|#define CKA_SUBPRIME 0x00000131UL
  ------------------
 5120|      0|        if (attribute == NULL) {
  ------------------
  |  Branch (5120:13): [True: 0, False: 0]
  ------------------
 5121|      0|            return CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
 5122|      0|        }
 5123|      0|        subPrimeLen = attribute->attrib.ulValueLen;
 5124|      0|        if (subPrimeLen > 1 && *(unsigned char *)attribute->attrib.pValue == 0) {
  ------------------
  |  Branch (5124:13): [True: 0, False: 0]
  |  Branch (5124:32): [True: 0, False: 0]
  ------------------
 5125|      0|            subPrimeLen--;
 5126|      0|        }
 5127|      0|        sftk_FreeAttribute(attribute);
 5128|      0|    }
 5129|       |
 5130|       |    /**************************************************/
 5131|       |    /* Pairwise Consistency Check of Encrypt/Decrypt. */
 5132|       |    /**************************************************/
 5133|       |
 5134|  1.91k|    isEncryptable = sftk_isTrue(privateKey, CKA_DECRYPT);
  ------------------
  |  |  548|  1.91k|#define CKA_DECRYPT 0x00000105UL
  ------------------
 5135|       |
 5136|       |    /*
 5137|       |     * If the decryption attribute is set, attempt to encrypt
 5138|       |     * with the public key and decrypt with the private key.
 5139|       |     */
 5140|  1.91k|    if (isEncryptable) {
  ------------------
  |  Branch (5140:9): [True: 0, False: 1.91k]
  ------------------
 5141|      0|        if (keyType != CKK_RSA) {
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (5141:13): [True: 0, False: 0]
  ------------------
 5142|      0|            return CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
 5143|      0|        }
 5144|      0|        bytes_encrypted = modulusLen;
 5145|      0|        mech.mechanism = CKM_RSA_PKCS;
  ------------------
  |  |  720|      0|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
 5146|       |
 5147|       |        /* Allocate space for ciphertext. */
 5148|      0|        ciphertext = (unsigned char *)PORT_ZAlloc(bytes_encrypted);
  ------------------
  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
 5149|      0|        if (ciphertext == NULL) {
  ------------------
  |  Branch (5149:13): [True: 0, False: 0]
  ------------------
 5150|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5151|      0|        }
 5152|       |
 5153|       |        /* Prepare for encryption using the public key. */
 5154|      0|        crv = NSC_EncryptInit(hSession, &mech, publicKey->handle);
 5155|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5155:13): [True: 0, False: 0]
  ------------------
 5156|      0|            PORT_Free(ciphertext);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5157|      0|            return crv;
 5158|      0|        }
 5159|       |
 5160|       |        /* Encrypt using the public key. */
 5161|      0|        crv = NSC_Encrypt(hSession,
 5162|      0|                          known_message,
 5163|      0|                          PAIRWISE_MESSAGE_LENGTH,
  ------------------
  |  | 5042|      0|#define PAIRWISE_MESSAGE_LENGTH 20         /* 160-bits */
  ------------------
 5164|      0|                          ciphertext,
 5165|      0|                          &bytes_encrypted);
 5166|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5166:13): [True: 0, False: 0]
  ------------------
 5167|      0|            PORT_Free(ciphertext);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5168|      0|            return crv;
 5169|      0|        }
 5170|       |
 5171|       |        /* Always use the smaller of these two values . . . */
 5172|      0|        bytes_compared = PR_MIN(bytes_encrypted, PAIRWISE_MESSAGE_LENGTH);
  ------------------
  |  |  158|      0|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5173|       |
 5174|       |        /*
 5175|       |         * If there was a failure, the plaintext
 5176|       |         * goes at the end, therefore . . .
 5177|       |         */
 5178|      0|        text_compared = ciphertext + bytes_encrypted - bytes_compared;
 5179|       |
 5180|       |        /*
 5181|       |         * Check to ensure that ciphertext does
 5182|       |         * NOT EQUAL known input message text
 5183|       |         * per FIPS PUB 140-2 directive.
 5184|       |         */
 5185|      0|        if (PORT_Memcmp(text_compared, known_message,
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (5185:13): [True: 0, False: 0]
  ------------------
 5186|      0|                        bytes_compared) == 0) {
 5187|       |            /* Set error to Invalid PRIVATE Key. */
 5188|      0|            PORT_SetError(SEC_ERROR_INVALID_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5189|      0|            PORT_Free(ciphertext);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5190|      0|            return CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|      0|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
 5191|      0|        }
 5192|       |
 5193|       |        /* Prepare for decryption using the private key. */
 5194|      0|        crv = NSC_DecryptInit(hSession, &mech, privateKey->handle);
 5195|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5195:13): [True: 0, False: 0]
  ------------------
 5196|      0|            PORT_Free(ciphertext);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5197|      0|            return crv;
 5198|      0|        }
 5199|       |
 5200|      0|        memset(plaintext, 0, PAIRWISE_MESSAGE_LENGTH);
  ------------------
  |  | 5042|      0|#define PAIRWISE_MESSAGE_LENGTH 20         /* 160-bits */
  ------------------
 5201|       |
 5202|       |        /*
 5203|       |         * Initialize bytes decrypted to be the
 5204|       |         * expected PAIRWISE_MESSAGE_LENGTH.
 5205|       |         */
 5206|      0|        bytes_decrypted = PAIRWISE_MESSAGE_LENGTH;
  ------------------
  |  | 5042|      0|#define PAIRWISE_MESSAGE_LENGTH 20         /* 160-bits */
  ------------------
 5207|       |
 5208|       |        /*
 5209|       |         * Decrypt using the private key.
 5210|       |         * NOTE:  No need to reset the
 5211|       |         *        value of bytes_encrypted.
 5212|       |         */
 5213|      0|        crv = NSC_Decrypt(hSession,
 5214|      0|                          ciphertext,
 5215|      0|                          bytes_encrypted,
 5216|      0|                          plaintext,
 5217|      0|                          &bytes_decrypted);
 5218|       |
 5219|       |        /* Finished with ciphertext; free it. */
 5220|      0|        PORT_Free(ciphertext);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5221|       |
 5222|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5222:13): [True: 0, False: 0]
  ------------------
 5223|      0|            return crv;
 5224|      0|        }
 5225|       |
 5226|       |        /*
 5227|       |         * Check to ensure that the output plaintext
 5228|       |         * does EQUAL known input message text.
 5229|       |         */
 5230|      0|        if ((bytes_decrypted != PAIRWISE_MESSAGE_LENGTH) ||
  ------------------
  |  | 5042|      0|#define PAIRWISE_MESSAGE_LENGTH 20         /* 160-bits */
  ------------------
  |  Branch (5230:13): [True: 0, False: 0]
  ------------------
 5231|      0|            (PORT_Memcmp(plaintext, known_message,
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (5231:13): [True: 0, False: 0]
  ------------------
 5232|      0|                         PAIRWISE_MESSAGE_LENGTH) != 0)) {
  ------------------
  |  | 5042|      0|#define PAIRWISE_MESSAGE_LENGTH 20         /* 160-bits */
  ------------------
 5233|       |            /* Set error to Bad PUBLIC Key. */
 5234|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5235|      0|            return CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|      0|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
 5236|      0|        }
 5237|      0|    }
 5238|       |
 5239|       |    /**********************************************/
 5240|       |    /* Pairwise Consistency Check of Sign/Verify. */
 5241|       |    /**********************************************/
 5242|       |
 5243|  1.91k|    canSignVerify = sftk_isTrue(privateKey, CKA_SIGN);
  ------------------
  |  |  551|  1.91k|#define CKA_SIGN 0x00000108UL
  ------------------
 5244|       |    /* Unfortunately CKA_SIGN is always true in lg dbs. We have to check the
 5245|       |     * actual curve to determine if we can do sign/verify. */
 5246|  1.91k|    if (canSignVerify && keyType == CKK_EC) {
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (5246:9): [True: 0, False: 1.91k]
  |  Branch (5246:26): [True: 0, False: 0]
  ------------------
 5247|      0|        NSSLOWKEYPrivateKey *privKey = sftk_GetPrivKey(privateKey, CKK_EC, &crv);
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
 5248|      0|        if (privKey && privKey->u.ec.ecParams.name == ECCurve25519) {
  ------------------
  |  Branch (5248:13): [True: 0, False: 0]
  |  Branch (5248:24): [True: 0, False: 0]
  ------------------
 5249|      0|            canSignVerify = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5250|      0|        }
 5251|      0|    }
 5252|       |
 5253|  1.91k|    if (canSignVerify) {
  ------------------
  |  Branch (5253:9): [True: 0, False: 1.91k]
  ------------------
 5254|       |        /* Determine length of signature. */
 5255|      0|        switch (keyType) {
 5256|      0|            case CKK_RSA:
  ------------------
  |  |  372|      0|#define CKK_RSA 0x00000000UL
  ------------------
  |  Branch (5256:13): [True: 0, False: 0]
  ------------------
 5257|      0|                signature_length = modulusLen;
 5258|      0|                mech.mechanism = CKM_RSA_PKCS;
  ------------------
  |  |  720|      0|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
 5259|      0|                break;
 5260|      0|            case CKK_DSA:
  ------------------
  |  |  373|      0|#define CKK_DSA 0x00000001UL
  ------------------
  |  Branch (5260:13): [True: 0, False: 0]
  ------------------
 5261|      0|                signature_length = DSA_MAX_SIGNATURE_LEN;
  ------------------
  |  |   52|      0|#define DSA_MAX_SIGNATURE_LEN (DSA_MAX_SUBPRIME_LEN * 2) /* Bytes */
  |  |  ------------------
  |  |  |  |   51|      0|#define DSA_MAX_SUBPRIME_LEN 32                          /* Bytes */
  |  |  ------------------
  ------------------
 5262|      0|                pairwise_digest_length = subPrimeLen;
 5263|      0|                mech.mechanism = CKM_DSA;
  ------------------
  |  |  745|      0|#define CKM_DSA 0x00000011UL
  ------------------
 5264|      0|                break;
 5265|      0|            case CKK_EC:
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (5265:13): [True: 0, False: 0]
  ------------------
 5266|      0|                signature_length = MAX_ECKEY_LEN * 2;
  ------------------
  |  |   81|      0|#define MAX_ECKEY_LEN 72 /* Bytes */
  ------------------
 5267|      0|                mech.mechanism = CKM_ECDSA;
  ------------------
  |  | 1074|      0|#define CKM_ECDSA 0x00001041UL
  ------------------
 5268|      0|                break;
 5269|      0|            case CKK_EC_EDWARDS:
  ------------------
  |  |  448|      0|#define CKK_EC_EDWARDS 0x00000040UL
  ------------------
  |  Branch (5269:13): [True: 0, False: 0]
  ------------------
 5270|      0|                signature_length = ED25519_SIGN_LEN;
  ------------------
  |  |   32|      0|#define ED25519_SIGN_LEN 64U /* Bytes */
  ------------------
 5271|      0|                mech.mechanism = CKM_EDDSA;
  ------------------
  |  | 1174|      0|#define CKM_EDDSA 0x00001057UL
  ------------------
 5272|      0|                break;
 5273|      0|            default:
  ------------------
  |  Branch (5273:13): [True: 0, False: 0]
  ------------------
 5274|      0|                return CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
 5275|      0|        }
 5276|       |
 5277|       |        /* Allocate space for signature data. */
 5278|      0|        signature = (unsigned char *)PORT_ZAlloc(signature_length);
  ------------------
  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
 5279|      0|        if (signature == NULL) {
  ------------------
  |  Branch (5279:13): [True: 0, False: 0]
  ------------------
 5280|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 5281|      0|        }
 5282|       |
 5283|       |        /* Sign the known hash using the private key. */
 5284|      0|        crv = NSC_SignInit(hSession, &mech, privateKey->handle);
 5285|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5285:13): [True: 0, False: 0]
  ------------------
 5286|      0|            PORT_Free(signature);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5287|      0|            return crv;
 5288|      0|        }
 5289|       |
 5290|      0|        crv = NSC_Sign(hSession,
 5291|      0|                       known_digest,
 5292|      0|                       pairwise_digest_length,
 5293|      0|                       signature,
 5294|      0|                       &signature_length);
 5295|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5295:13): [True: 0, False: 0]
  ------------------
 5296|      0|            PORT_Free(signature);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5297|      0|            return crv;
 5298|      0|        }
 5299|       |
 5300|       |        /* detect trivial signing transforms */
 5301|      0|        if ((signature_length >= pairwise_digest_length) &&
  ------------------
  |  Branch (5301:13): [True: 0, False: 0]
  ------------------
 5302|      0|            (PORT_Memcmp(known_digest, signature + (signature_length - pairwise_digest_length), pairwise_digest_length) == 0)) {
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (5302:13): [True: 0, False: 0]
  ------------------
 5303|      0|            PORT_Free(signature);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5304|      0|            return CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|      0|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
 5305|      0|        }
 5306|       |
 5307|       |        /* Verify the known hash using the public key. */
 5308|      0|        crv = NSC_VerifyInit(hSession, &mech, publicKey->handle);
 5309|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5309:13): [True: 0, False: 0]
  ------------------
 5310|      0|            PORT_Free(signature);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5311|      0|            return crv;
 5312|      0|        }
 5313|       |
 5314|      0|        crv = NSC_Verify(hSession,
 5315|      0|                         known_digest,
 5316|      0|                         pairwise_digest_length,
 5317|      0|                         signature,
 5318|      0|                         signature_length);
 5319|       |
 5320|       |        /* Free signature data. */
 5321|      0|        PORT_Free(signature);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 5322|       |
 5323|      0|        if ((crv == CKR_SIGNATURE_LEN_RANGE) ||
  ------------------
  |  | 1476|      0|#define CKR_SIGNATURE_LEN_RANGE 0x000000C1UL
  ------------------
  |  Branch (5323:13): [True: 0, False: 0]
  ------------------
 5324|      0|            (crv == CKR_SIGNATURE_INVALID)) {
  ------------------
  |  | 1475|      0|#define CKR_SIGNATURE_INVALID 0x000000C0UL
  ------------------
  |  Branch (5324:13): [True: 0, False: 0]
  ------------------
 5325|      0|            return CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|      0|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
 5326|      0|        }
 5327|      0|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5327:13): [True: 0, False: 0]
  ------------------
 5328|      0|            return crv;
 5329|      0|        }
 5330|      0|    }
 5331|       |
 5332|       |    /**********************************************/
 5333|       |    /* Pairwise Consistency Check for Derivation  */
 5334|       |    /**********************************************/
 5335|       |
 5336|  1.91k|    isDerivable = sftk_isTrue(privateKey, CKA_DERIVE);
  ------------------
  |  |  555|  1.91k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 5337|       |
 5338|  1.91k|    if (isDerivable) {
  ------------------
  |  Branch (5338:9): [True: 1.91k, False: 0]
  ------------------
 5339|  1.91k|        SFTKAttribute *pubAttribute = NULL;
 5340|  1.91k|        PRBool isFIPS = sftk_isFIPS(slot->slotID);
  ------------------
  |  |  506|  1.91k|    (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  500|  1.91k|#define FIPS_SLOT_ID 3
  |  |  ------------------
  |  |                   (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  567|  1.91k|#define SFTK_MIN_FIPS_USER_SLOT_ID 101
  |  |  ------------------
  |  |  |  Branch (506:6): [True: 0, False: 1.91k]
  |  |  |  Branch (506:32): [True: 0, False: 1.91k]
  |  |  ------------------
  ------------------
 5341|  1.91k|        NSSLOWKEYPrivateKey *lowPrivKey = NULL;
 5342|  1.91k|        ECPrivateKey *ecPriv = NULL;
 5343|  1.91k|        SECItem *lowPubValue = NULL;
 5344|  1.91k|        SECItem item = { siBuffer, NULL, 0 };
 5345|  1.91k|        SECStatus rv;
 5346|       |
 5347|  1.91k|        crv = CKR_OK; /*paranoia, already get's set before we drop to the end */
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
 5348|       |
 5349|       |        /* FIPS 140-3 requires we verify that the resulting key is a valid key
 5350|       |         * by recalculating the public can an compare it to our own public
 5351|       |         * key. */
 5352|  1.91k|        lowPrivKey = sftk_GetPrivKey(privateKey, keyType, &crv);
 5353|  1.91k|        if (lowPrivKey == NULL) {
  ------------------
  |  Branch (5353:13): [True: 0, False: 1.91k]
  ------------------
 5354|      0|            return sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 5355|      0|        }
 5356|       |        /* recalculate the public key from the private key */
 5357|  1.91k|        switch (keyType) {
 5358|  1.91k|            case CKK_DH:
  ------------------
  |  |  374|  1.91k|#define CKK_DH 0x00000002UL
  ------------------
  |  Branch (5358:13): [True: 1.91k, False: 0]
  ------------------
 5359|  1.91k|                rv = DH_Derive(&lowPrivKey->u.dh.base, &lowPrivKey->u.dh.prime,
 5360|  1.91k|                               &lowPrivKey->u.dh.privateValue, &item, 0);
 5361|  1.91k|                if (rv != SECSuccess) {
  ------------------
  |  Branch (5361:21): [True: 616, False: 1.29k]
  ------------------
 5362|    616|                    return CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|    616|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
 5363|    616|                }
 5364|  1.29k|                lowPubValue = SECITEM_DupItem(&item);
  ------------------
  |  |  107|  1.29k|#define SECITEM_DupItem SECITEM_DupItem_Util
  ------------------
 5365|  1.29k|                SECITEM_ZfreeItem(&item, PR_FALSE);
  ------------------
  |  |  110|  1.29k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(&item, PR_FALSE);
  ------------------
  |  |  438|  1.29k|#define PR_FALSE 0
  ------------------
 5366|  1.29k|                pubAttribute = sftk_FindAttribute(publicKey, CKA_VALUE);
  ------------------
  |  |  516|  1.29k|#define CKA_VALUE 0x00000011UL
  ------------------
 5367|  1.29k|                break;
 5368|      0|            case CKK_EC_MONTGOMERY:
  ------------------
  |  |  449|      0|#define CKK_EC_MONTGOMERY 0x00000041UL
  ------------------
  |  Branch (5368:13): [True: 0, False: 1.91k]
  ------------------
 5369|      0|            case CKK_EC:
  ------------------
  |  |  379|      0|#define CKK_EC 0x00000003UL
  ------------------
  |  Branch (5369:13): [True: 0, False: 1.91k]
  ------------------
 5370|      0|                rv = EC_NewKeyFromSeed(&lowPrivKey->u.ec.ecParams, &ecPriv,
 5371|      0|                                       lowPrivKey->u.ec.privateValue.data,
 5372|      0|                                       lowPrivKey->u.ec.privateValue.len);
 5373|      0|                if (rv != SECSuccess) {
  ------------------
  |  Branch (5373:21): [True: 0, False: 0]
  ------------------
 5374|      0|                    return CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|      0|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
 5375|      0|                }
 5376|       |                /* make sure it has the same encoding */
 5377|      0|                if (PR_GetEnvSecure("NSS_USE_DECODED_CKA_EC_POINT") ||
  ------------------
  |  Branch (5377:21): [True: 0, False: 0]
  ------------------
 5378|      0|                    lowPrivKey->u.ec.ecParams.type != ec_params_named) {
  ------------------
  |  Branch (5378:21): [True: 0, False: 0]
  ------------------
 5379|      0|                    lowPubValue = SECITEM_DupItem(&ecPriv->publicValue);
  ------------------
  |  |  107|      0|#define SECITEM_DupItem SECITEM_DupItem_Util
  ------------------
 5380|      0|                } else {
 5381|      0|                    lowPubValue = SEC_ASN1EncodeItem(NULL, NULL, &ecPriv->publicValue,
  ------------------
  |  |   89|      0|#define SEC_ASN1EncodeItem SEC_ASN1EncodeItem_Util
  ------------------
 5382|      0|                                                     SEC_ASN1_GET(SEC_OctetStringTemplate));
  ------------------
  |  |  188|      0|#define SEC_ASN1_GET(x) x
  ------------------
 5383|      0|                }
 5384|      0|                pubAttribute = sftk_FindAttribute(publicKey, CKA_EC_POINT);
  ------------------
  |  |  604|      0|#define CKA_EC_POINT 0x00000181UL
  ------------------
 5385|       |                /* clear out our generated private key */
 5386|      0|                PORT_FreeArena(ecPriv->ecParams.arena, PR_TRUE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                              PORT_FreeArena(ecPriv->ecParams.arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5387|      0|                break;
 5388|      0|            default:
  ------------------
  |  Branch (5388:13): [True: 0, False: 1.91k]
  ------------------
 5389|      0|                return CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
 5390|  1.91k|        }
 5391|       |
 5392|       |        /* now compare new public key with our already generated key */
 5393|  1.29k|        if ((pubAttribute == NULL) || (lowPubValue == NULL) ||
  ------------------
  |  Branch (5393:13): [True: 0, False: 1.29k]
  |  Branch (5393:39): [True: 0, False: 1.29k]
  ------------------
 5394|  1.29k|            (pubAttribute->attrib.ulValueLen != lowPubValue->len) ||
  ------------------
  |  Branch (5394:13): [True: 0, False: 1.29k]
  ------------------
 5395|  1.29k|            (PORT_Memcmp(pubAttribute->attrib.pValue, lowPubValue->data,
  ------------------
  |  |  179|  1.29k|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (5395:13): [True: 0, False: 1.29k]
  ------------------
 5396|  1.29k|                         lowPubValue->len) != 0)) {
 5397|      0|            if (pubAttribute)
  ------------------
  |  Branch (5397:17): [True: 0, False: 0]
  ------------------
 5398|      0|                sftk_FreeAttribute(pubAttribute);
 5399|      0|            if (lowPubValue)
  ------------------
  |  Branch (5399:17): [True: 0, False: 0]
  ------------------
 5400|      0|                SECITEM_ZfreeItem(lowPubValue, PR_TRUE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(lowPubValue, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5401|      0|            PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5402|      0|            return CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|      0|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
 5403|      0|        }
 5404|  1.29k|        SECITEM_ZfreeItem(lowPubValue, PR_TRUE);
  ------------------
  |  |  110|  1.29k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                      SECITEM_ZfreeItem(lowPubValue, PR_TRUE);
  ------------------
  |  |  437|  1.29k|#define PR_TRUE 1
  ------------------
 5405|       |
 5406|       |        /* FIPS requires full validation, but in fipx mode NSC_Derive
 5407|       |         * only does partial validation with approved primes, now handle
 5408|       |         * full validation */
 5409|  1.29k|        if (isFIPS && keyType == CKK_DH) {
  ------------------
  |  |  374|      0|#define CKK_DH 0x00000002UL
  ------------------
  |  Branch (5409:13): [True: 0, False: 1.29k]
  |  Branch (5409:23): [True: 0, False: 0]
  ------------------
 5410|      0|            SECItem pubKey = { siBuffer, pubAttribute->attrib.pValue,
 5411|      0|                               pubAttribute->attrib.ulValueLen };
 5412|      0|            SECItem base = { siBuffer, NULL, 0 };
 5413|      0|            SECItem prime = { siBuffer, NULL, 0 };
 5414|      0|            SECItem subPrime = { siBuffer, NULL, 0 };
 5415|      0|            SECItem generator = { siBuffer, NULL, 0 };
 5416|      0|            const SECItem *subPrimePtr = &subPrime;
 5417|       |
 5418|      0|            crv = sftk_Attribute2SecItem(NULL, &prime, privateKey, CKA_PRIME);
  ------------------
  |  |  569|      0|#define CKA_PRIME 0x00000130UL
  ------------------
 5419|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5419:17): [True: 0, False: 0]
  ------------------
 5420|      0|                goto done;
 5421|      0|            }
 5422|      0|            crv = sftk_Attribute2SecItem(NULL, &base, privateKey, CKA_BASE);
  ------------------
  |  |  571|      0|#define CKA_BASE 0x00000132UL
  ------------------
 5423|      0|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5423:17): [True: 0, False: 0]
  ------------------
 5424|      0|                goto done;
 5425|      0|            }
 5426|       |            /* we ignore the return code an only look at the length */
 5427|       |            /* do we have a known prime ? */
 5428|      0|            subPrimePtr = sftk_VerifyDH_Prime(&prime, &generator, isFIPS);
 5429|      0|            if (subPrimePtr == NULL) {
  ------------------
  |  Branch (5429:17): [True: 0, False: 0]
  ------------------
 5430|      0|                if (subPrime.len == 0) {
  ------------------
  |  Branch (5430:21): [True: 0, False: 0]
  ------------------
 5431|       |                    /* if not a known prime, subprime must be supplied */
 5432|      0|                    crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5433|      0|                    goto done;
 5434|      0|                } else {
 5435|       |                    /* not a known prime, check for primality of prime
 5436|       |                     * and subPrime */
 5437|      0|                    if (!KEA_PrimeCheck(&prime)) {
  ------------------
  |  Branch (5437:25): [True: 0, False: 0]
  ------------------
 5438|      0|                        crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5439|      0|                        goto done;
 5440|      0|                    }
 5441|      0|                    if (!KEA_PrimeCheck(&subPrime)) {
  ------------------
  |  Branch (5441:25): [True: 0, False: 0]
  ------------------
 5442|      0|                        crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5443|      0|                        goto done;
 5444|      0|                    }
 5445|       |                    /* if we aren't using a defined group, make sure base is in the
 5446|       |                     * subgroup. If it's not, then our key could fail or succeed sometimes.
 5447|       |                     * This makes the failure reliable */
 5448|      0|                    if (!KEA_Verify(&base, &prime, &subPrime)) {
  ------------------
  |  Branch (5448:25): [True: 0, False: 0]
  ------------------
 5449|      0|                        crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5450|      0|                    }
 5451|      0|                }
 5452|      0|                subPrimePtr = &subPrime;
 5453|      0|            } else {
 5454|       |                /* we're using a known group, make sure we are using the known generator for that group */
 5455|      0|                if (SECITEM_CompareItem(&generator, &base) != 0) {
  ------------------
  |  |  105|      0|#define SECITEM_CompareItem SECITEM_CompareItem_Util
  ------------------
  |  Branch (5455:21): [True: 0, False: 0]
  ------------------
 5456|      0|                    crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5457|      0|                    goto done;
 5458|      0|                }
 5459|      0|                if (subPrime.len != 0) {
  ------------------
  |  Branch (5459:21): [True: 0, False: 0]
  ------------------
 5460|       |                    /* we have a known prime and a supplied subPrime,
 5461|       |                     * make sure the subPrime matches the subPrime for
 5462|       |                     * the known Prime */
 5463|      0|                    if (SECITEM_CompareItem(subPrimePtr, &subPrime) != 0) {
  ------------------
  |  |  105|      0|#define SECITEM_CompareItem SECITEM_CompareItem_Util
  ------------------
  |  Branch (5463:25): [True: 0, False: 0]
  ------------------
 5464|      0|                        crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5465|      0|                        goto done;
 5466|      0|                    }
 5467|      0|                }
 5468|      0|            }
 5469|      0|            if (!KEA_Verify(&pubKey, &prime, (SECItem *)subPrimePtr)) {
  ------------------
  |  Branch (5469:17): [True: 0, False: 0]
  ------------------
 5470|      0|                crv = CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
 5471|      0|            }
 5472|      0|        done:
 5473|      0|            SECITEM_ZfreeItem(&base, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&base, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5474|      0|            SECITEM_ZfreeItem(&subPrime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&subPrime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5475|      0|            SECITEM_ZfreeItem(&prime, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                          SECITEM_ZfreeItem(&prime, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5476|      0|        }
 5477|       |        /* clean up before we return */
 5478|  1.29k|        sftk_FreeAttribute(pubAttribute);
 5479|  1.29k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.29k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (5479:13): [True: 0, False: 1.29k]
  ------------------
 5480|      0|            return crv;
 5481|      0|        }
 5482|  1.29k|    }
 5483|       |
 5484|  1.29k|    return CKR_OK;
  ------------------
  |  | 1388|  1.29k|#define CKR_OK 0x00000000UL
  ------------------
 5485|  1.91k|}
pkcs11c.c:sftk_mapWrap:
 6369|  1.17k|{
 6370|  1.17k|    switch (crv) {
  ------------------
  |  Branch (6370:13): [True: 1.17k, False: 0]
  ------------------
 6371|      0|        case CKR_ENCRYPTED_DATA_INVALID:
  ------------------
  |  | 1419|      0|#define CKR_ENCRYPTED_DATA_INVALID 0x00000040UL
  ------------------
  |  Branch (6371:9): [True: 0, False: 1.17k]
  ------------------
 6372|      0|            crv = CKR_WRAPPED_KEY_INVALID;
  ------------------
  |  | 1497|      0|#define CKR_WRAPPED_KEY_INVALID 0x00000110UL
  ------------------
 6373|      0|            break;
 6374|  1.17k|    }
 6375|  1.17k|    return crv;
 6376|  1.17k|}
pkcs11c.c:sftk_DeriveSensitiveCheck:
 7041|  22.6k|{
 7042|  22.6k|    PRBool hasSensitive;
 7043|  22.6k|    PRBool sensitive = PR_FALSE;
  ------------------
  |  |  438|  22.6k|#define PR_FALSE 0
  ------------------
 7044|  22.6k|    CK_BBOOL bFalse = CK_FALSE;
  ------------------
  |  |   23|  22.6k|#define CK_FALSE 0
  ------------------
 7045|  22.6k|    PRBool hasExtractable;
 7046|  22.6k|    PRBool extractable = PR_TRUE;
  ------------------
  |  |  437|  22.6k|#define PR_TRUE 1
  ------------------
 7047|  22.6k|    CK_BBOOL bTrue = CK_TRUE;
  ------------------
  |  |   22|  22.6k|#define CK_TRUE 1
  ------------------
 7048|  22.6k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  22.6k|#define CKR_OK 0x00000000UL
  ------------------
 7049|  22.6k|    SFTKAttribute *att;
 7050|  22.6k|    PRBool isData = PR_TRUE;
  ------------------
  |  |  437|  22.6k|#define PR_TRUE 1
  ------------------
 7051|       |
 7052|  22.6k|    if (canBeData) {
  ------------------
  |  Branch (7052:9): [True: 20.9k, False: 1.76k]
  ------------------
 7053|  20.9k|        CK_OBJECT_CLASS objClass;
 7054|       |
 7055|       |        /* if the target key is actually data, don't set the unexpected
 7056|       |         * attributes */
 7057|  20.9k|        crv = sftk_GetULongAttribute(destKey, CKA_CLASS, &objClass);
  ------------------
  |  |  511|  20.9k|#define CKA_CLASS 0x00000000UL
  ------------------
 7058|  20.9k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  20.9k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7058:13): [True: 0, False: 20.9k]
  ------------------
 7059|      0|            return crv;
 7060|      0|        }
 7061|  20.9k|        if (objClass == CKO_DATA) {
  ------------------
  |  |  325|  20.9k|#define CKO_DATA 0x00000000UL
  ------------------
  |  Branch (7061:13): [True: 897, False: 20.0k]
  ------------------
 7062|    897|            return CKR_OK;
  ------------------
  |  | 1388|    897|#define CKR_OK 0x00000000UL
  ------------------
 7063|    897|        }
 7064|       |
 7065|       |        /* if the base key is data, it doesn't have sensitive attributes,
 7066|       |         * allow the destKey to get it's own */
 7067|  20.0k|        crv = sftk_GetULongAttribute(baseKey, CKA_CLASS, &objClass);
  ------------------
  |  |  511|  20.0k|#define CKA_CLASS 0x00000000UL
  ------------------
 7068|  20.0k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  20.0k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7068:13): [True: 0, False: 20.0k]
  ------------------
 7069|      0|            return crv;
 7070|      0|        }
 7071|  20.0k|        if (objClass == CKO_DATA) {
  ------------------
  |  |  325|  20.0k|#define CKO_DATA 0x00000000UL
  ------------------
  |  Branch (7071:13): [True: 1.68k, False: 18.3k]
  ------------------
 7072|  1.68k|            isData = PR_TRUE;
  ------------------
  |  |  437|  1.68k|#define PR_TRUE 1
  ------------------
 7073|  1.68k|        }
 7074|  20.0k|    }
 7075|       |
 7076|  21.7k|    hasSensitive = PR_FALSE;
  ------------------
  |  |  438|  21.7k|#define PR_FALSE 0
  ------------------
 7077|  21.7k|    att = sftk_FindAttribute(destKey, CKA_SENSITIVE);
  ------------------
  |  |  546|  21.7k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
 7078|  21.7k|    if (att) {
  ------------------
  |  Branch (7078:9): [True: 0, False: 21.7k]
  ------------------
 7079|      0|        hasSensitive = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 7080|      0|        sensitive = (PRBool) * (CK_BBOOL *)att->attrib.pValue;
 7081|      0|        sftk_FreeAttribute(att);
 7082|      0|    }
 7083|       |
 7084|  21.7k|    hasExtractable = PR_FALSE;
  ------------------
  |  |  438|  21.7k|#define PR_FALSE 0
  ------------------
 7085|  21.7k|    att = sftk_FindAttribute(destKey, CKA_EXTRACTABLE);
  ------------------
  |  |  585|  21.7k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
 7086|  21.7k|    if (att) {
  ------------------
  |  Branch (7086:9): [True: 0, False: 21.7k]
  ------------------
 7087|      0|        hasExtractable = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 7088|      0|        extractable = (PRBool) * (CK_BBOOL *)att->attrib.pValue;
 7089|      0|        sftk_FreeAttribute(att);
 7090|      0|    }
 7091|       |
 7092|       |    /* don't make a key more accessible */
 7093|  21.7k|    if (sftk_isTrue(baseKey, CKA_SENSITIVE) && hasSensitive &&
  ------------------
  |  |  546|  21.7k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
  |  Branch (7093:9): [True: 0, False: 21.7k]
  |  Branch (7093:48): [True: 0, False: 0]
  ------------------
 7094|  21.7k|        (sensitive == PR_FALSE)) {
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (7094:9): [True: 0, False: 0]
  ------------------
 7095|      0|        return CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 7096|      0|    }
 7097|  21.7k|    if (!sftk_isTrue(baseKey, CKA_EXTRACTABLE) && hasExtractable &&
  ------------------
  |  |  585|  21.7k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
  |  Branch (7097:9): [True: 1.68k, False: 20.1k]
  |  Branch (7097:51): [True: 0, False: 1.68k]
  ------------------
 7098|  21.7k|        (extractable == PR_TRUE)) {
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  |  Branch (7098:9): [True: 0, False: 0]
  ------------------
 7099|      0|        return CKR_KEY_FUNCTION_NOT_PERMITTED;
  ------------------
  |  | 1443|      0|#define CKR_KEY_FUNCTION_NOT_PERMITTED 0x00000068UL
  ------------------
 7100|      0|    }
 7101|       |
 7102|       |    /* inherit parent's sensitivity */
 7103|  21.7k|    if (!hasSensitive) {
  ------------------
  |  Branch (7103:9): [True: 21.7k, False: 0]
  ------------------
 7104|  21.7k|        att = sftk_FindAttribute(baseKey, CKA_SENSITIVE);
  ------------------
  |  |  546|  21.7k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
 7105|  21.7k|        if (att != NULL) {
  ------------------
  |  Branch (7105:13): [True: 20.1k, False: 1.68k]
  ------------------
 7106|  20.1k|            crv = sftk_defaultAttribute(destKey,
 7107|  20.1k|                                        sftk_attr_expand(&att->attrib));
  ------------------
  |  |  587|  20.1k|#define sftk_attr_expand(ap) (ap)->type, (ap)->pValue, (ap)->ulValueLen
  ------------------
 7108|  20.1k|            sftk_FreeAttribute(att);
 7109|  20.1k|        } else if (isData) {
  ------------------
  |  Branch (7109:20): [True: 1.68k, False: 0]
  ------------------
 7110|  1.68k|            crv = sftk_defaultAttribute(destKey, CKA_SENSITIVE,
  ------------------
  |  |  546|  1.68k|#define CKA_SENSITIVE 0x00000103UL
  ------------------
 7111|  1.68k|                                        &bFalse, sizeof(bFalse));
 7112|  1.68k|        } else {
 7113|      0|            return CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 7114|      0|        }
 7115|  21.7k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  21.7k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7115:13): [True: 0, False: 21.7k]
  ------------------
 7116|      0|            return crv;
 7117|  21.7k|    }
 7118|  21.7k|    if (!hasExtractable) {
  ------------------
  |  Branch (7118:9): [True: 21.7k, False: 0]
  ------------------
 7119|  21.7k|        att = sftk_FindAttribute(baseKey, CKA_EXTRACTABLE);
  ------------------
  |  |  585|  21.7k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
 7120|  21.7k|        if (att != NULL) {
  ------------------
  |  Branch (7120:13): [True: 20.1k, False: 1.68k]
  ------------------
 7121|  20.1k|            crv = sftk_defaultAttribute(destKey,
 7122|  20.1k|                                        sftk_attr_expand(&att->attrib));
  ------------------
  |  |  587|  20.1k|#define sftk_attr_expand(ap) (ap)->type, (ap)->pValue, (ap)->ulValueLen
  ------------------
 7123|  20.1k|            sftk_FreeAttribute(att);
 7124|  20.1k|        } else if (isData) {
  ------------------
  |  Branch (7124:20): [True: 1.68k, False: 0]
  ------------------
 7125|  1.68k|            crv = sftk_defaultAttribute(destKey, CKA_EXTRACTABLE,
  ------------------
  |  |  585|  1.68k|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
 7126|  1.68k|                                        &bTrue, sizeof(bTrue));
 7127|  1.68k|        } else {
 7128|      0|            return CKR_KEY_TYPE_INCONSISTENT;
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
 7129|      0|        }
 7130|  21.7k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  21.7k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (7130:13): [True: 0, False: 21.7k]
  ------------------
 7131|      0|            return crv;
 7132|  21.7k|    }
 7133|       |
 7134|       |    /* we should inherit the parent's always extractable/ never sensitive info,
 7135|       |     * but handleObject always forces this attributes, so we would need to do
 7136|       |     * something special. */
 7137|  21.7k|    return CKR_OK;
  ------------------
  |  | 1388|  21.7k|#define CKR_OK 0x00000000UL
  ------------------
 7138|  21.7k|}
pkcs11c.c:sftk_buildSSLKey:
 6945|  6.29k|{
 6946|  6.29k|    SFTKObject *key;
 6947|  6.29k|    SFTKSession *session;
 6948|  6.29k|    CK_KEY_TYPE keyType = CKK_GENERIC_SECRET;
  ------------------
  |  |  383|  6.29k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
 6949|  6.29k|    CK_BBOOL cktrue = CK_TRUE;
  ------------------
  |  |   22|  6.29k|#define CK_TRUE 1
  ------------------
 6950|  6.29k|    CK_BBOOL ckfalse = CK_FALSE;
  ------------------
  |  |   23|  6.29k|#define CK_FALSE 0
  ------------------
 6951|  6.29k|    CK_RV crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|  6.29k|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 6952|       |
 6953|       |    /*
 6954|       |     * now lets create an object to hang the attributes off of
 6955|       |     */
 6956|  6.29k|    *keyHandle = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  6.29k|#define CK_INVALID_HANDLE 0
  ------------------
 6957|  6.29k|    key = sftk_NewObject(baseKey->slot);
 6958|  6.29k|    if (key == NULL)
  ------------------
  |  Branch (6958:9): [True: 0, False: 6.29k]
  ------------------
 6959|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 6960|  6.29k|    sftk_narrowToSessionObject(key)->wasDerived = PR_TRUE;
  ------------------
  |  |  437|  6.29k|#define PR_TRUE 1
  ------------------
 6961|       |
 6962|  6.29k|    crv = sftk_CopyObject(key, baseKey);
 6963|  6.29k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  6.29k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6963:9): [True: 0, False: 6.29k]
  ------------------
 6964|      0|        goto loser;
 6965|  6.29k|    if (isMacKey) {
  ------------------
  |  Branch (6965:9): [True: 3.52k, False: 2.77k]
  ------------------
 6966|  3.52k|        crv = sftk_forceAttribute(key, CKA_KEY_TYPE, &keyType, sizeof(keyType));
  ------------------
  |  |  543|  3.52k|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
 6967|  3.52k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.52k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6967:13): [True: 0, False: 3.52k]
  ------------------
 6968|      0|            goto loser;
 6969|  3.52k|        crv = sftk_forceAttribute(key, CKA_DERIVE, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  555|  3.52k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 6970|  3.52k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.52k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6970:13): [True: 0, False: 3.52k]
  ------------------
 6971|      0|            goto loser;
 6972|  3.52k|        crv = sftk_forceAttribute(key, CKA_ENCRYPT, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  547|  3.52k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 6973|  3.52k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.52k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6973:13): [True: 0, False: 3.52k]
  ------------------
 6974|      0|            goto loser;
 6975|  3.52k|        crv = sftk_forceAttribute(key, CKA_DECRYPT, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  548|  3.52k|#define CKA_DECRYPT 0x00000105UL
  ------------------
 6976|  3.52k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.52k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6976:13): [True: 0, False: 3.52k]
  ------------------
 6977|      0|            goto loser;
 6978|  3.52k|        crv = sftk_forceAttribute(key, CKA_SIGN, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  551|  3.52k|#define CKA_SIGN 0x00000108UL
  ------------------
 6979|  3.52k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.52k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6979:13): [True: 0, False: 3.52k]
  ------------------
 6980|      0|            goto loser;
 6981|  3.52k|        crv = sftk_forceAttribute(key, CKA_VERIFY, &cktrue, sizeof(CK_BBOOL));
  ------------------
  |  |  553|  3.52k|#define CKA_VERIFY 0x0000010AUL
  ------------------
 6982|  3.52k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.52k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6982:13): [True: 0, False: 3.52k]
  ------------------
 6983|      0|            goto loser;
 6984|  3.52k|        crv = sftk_forceAttribute(key, CKA_WRAP, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  549|  3.52k|#define CKA_WRAP 0x00000106UL
  ------------------
 6985|  3.52k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.52k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6985:13): [True: 0, False: 3.52k]
  ------------------
 6986|      0|            goto loser;
 6987|  3.52k|        crv = sftk_forceAttribute(key, CKA_UNWRAP, &ckfalse, sizeof(CK_BBOOL));
  ------------------
  |  |  550|  3.52k|#define CKA_UNWRAP 0x00000107UL
  ------------------
 6988|  3.52k|        if (crv != CKR_OK)
  ------------------
  |  | 1388|  3.52k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6988:13): [True: 0, False: 3.52k]
  ------------------
 6989|      0|            goto loser;
 6990|  3.52k|    }
 6991|  6.29k|    crv = sftk_forceAttribute(key, CKA_VALUE, keyBlock, keySize);
  ------------------
  |  |  516|  6.29k|#define CKA_VALUE 0x00000011UL
  ------------------
 6992|  6.29k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  6.29k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (6992:9): [True: 0, False: 6.29k]
  ------------------
 6993|      0|        goto loser;
 6994|       |
 6995|       |    /* get the session */
 6996|  6.29k|    crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|  6.29k|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 6997|  6.29k|    session = sftk_SessionFromHandle(hSession);
 6998|  6.29k|    if (session == NULL) {
  ------------------
  |  Branch (6998:9): [True: 0, False: 6.29k]
  ------------------
 6999|      0|        goto loser;
 7000|      0|    }
 7001|       |
 7002|  6.29k|    crv = sftk_handleObject(key, session);
 7003|  6.29k|    sftk_FreeSession(session);
 7004|  6.29k|    *keyHandle = key->handle;
 7005|  6.29k|loser:
 7006|  6.29k|    if (key)
  ------------------
  |  Branch (7006:9): [True: 6.29k, False: 0]
  ------------------
 7007|  6.29k|        sftk_FreeObject(key);
 7008|  6.29k|    return crv;
 7009|  6.29k|}

sftk_MapCryptError:
   40|  2.68k|{
   41|  2.68k|    switch (error) {
  ------------------
  |  Branch (41:13): [True: 12, False: 2.67k]
  ------------------
   42|      0|        case SEC_ERROR_INVALID_ARGS:
  ------------------
  |  Branch (42:9): [True: 0, False: 2.68k]
  ------------------
   43|      0|        case SEC_ERROR_BAD_DATA: /* MP_RANGE gets mapped to this */
  ------------------
  |  Branch (43:9): [True: 0, False: 2.68k]
  ------------------
   44|      0|            return CKR_ARGUMENTS_BAD;
  ------------------
  |  | 1401|      0|#define CKR_ARGUMENTS_BAD 0x00000007UL
  ------------------
   45|      0|        case SEC_ERROR_INPUT_LEN:
  ------------------
  |  Branch (45:9): [True: 0, False: 2.68k]
  ------------------
   46|      0|            return CKR_DATA_LEN_RANGE;
  ------------------
  |  | 1415|      0|#define CKR_DATA_LEN_RANGE 0x00000021UL
  ------------------
   47|      0|        case SEC_ERROR_OUTPUT_LEN:
  ------------------
  |  Branch (47:9): [True: 0, False: 2.68k]
  ------------------
   48|      0|            return CKR_BUFFER_TOO_SMALL;
  ------------------
  |  | 1514|      0|#define CKR_BUFFER_TOO_SMALL 0x00000150UL
  ------------------
   49|     51|        case SEC_ERROR_LIBRARY_FAILURE:
  ------------------
  |  Branch (49:9): [True: 51, False: 2.63k]
  ------------------
   50|     51|            return CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|     51|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
   51|      0|        case SEC_ERROR_NO_MEMORY:
  ------------------
  |  Branch (51:9): [True: 0, False: 2.68k]
  ------------------
   52|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
   53|  2.42k|        case SEC_ERROR_BAD_SIGNATURE:
  ------------------
  |  Branch (53:9): [True: 2.42k, False: 259]
  ------------------
   54|  2.42k|            return CKR_SIGNATURE_INVALID;
  ------------------
  |  | 1475|  2.42k|#define CKR_SIGNATURE_INVALID 0x000000C0UL
  ------------------
   55|      0|        case SEC_ERROR_INVALID_KEY:
  ------------------
  |  Branch (55:9): [True: 0, False: 2.68k]
  ------------------
   56|      0|            return CKR_KEY_SIZE_RANGE;
  ------------------
  |  | 1432|      0|#define CKR_KEY_SIZE_RANGE 0x00000062UL
  ------------------
   57|    132|        case SEC_ERROR_BAD_KEY:        /* an EC public key that fails validation */
  ------------------
  |  Branch (57:9): [True: 132, False: 2.55k]
  ------------------
   58|    132|            return CKR_KEY_SIZE_RANGE; /* the closest error code */
  ------------------
  |  | 1432|    132|#define CKR_KEY_SIZE_RANGE 0x00000062UL
  ------------------
   59|      0|        case SEC_ERROR_UNSUPPORTED_EC_POINT_FORM:
  ------------------
  |  Branch (59:9): [True: 0, False: 2.68k]
  ------------------
   60|      0|            return CKR_TEMPLATE_INCONSISTENT;
  ------------------
  |  | 1478|      0|#define CKR_TEMPLATE_INCONSISTENT 0x000000D1UL
  ------------------
   61|      0|        case SEC_ERROR_UNSUPPORTED_KEYALG:
  ------------------
  |  Branch (61:9): [True: 0, False: 2.68k]
  ------------------
   62|      0|            return CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
   63|     64|        case SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE:
  ------------------
  |  Branch (63:9): [True: 64, False: 2.61k]
  ------------------
   64|     64|            return CKR_DOMAIN_PARAMS_INVALID;
  ------------------
  |  | 1508|     64|#define CKR_DOMAIN_PARAMS_INVALID 0x00000130UL
  ------------------
   65|       |        /* key pair generation failed after max number of attempts */
   66|      0|        case SEC_ERROR_NEED_RANDOM:
  ------------------
  |  Branch (66:9): [True: 0, False: 2.68k]
  ------------------
   67|      0|            return CKR_FUNCTION_FAILED;
  ------------------
  |  | 1397|      0|#define CKR_FUNCTION_FAILED 0x00000006UL
  ------------------
   68|  2.68k|    }
   69|     12|    return CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|     12|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
   70|  2.68k|}
sftk_MapVerifyError:
   96|    534|{
   97|    534|    CK_RV crv = sftk_MapCryptError(error);
   98|    534|    if (crv == CKR_DEVICE_ERROR)
  ------------------
  |  | 1416|    534|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
  |  Branch (98:9): [True: 0, False: 534]
  ------------------
   99|      0|        crv = CKR_SIGNATURE_INVALID;
  ------------------
  |  | 1475|      0|#define CKR_SIGNATURE_INVALID 0x000000C0UL
  ------------------
  100|    534|    return crv;
  101|    534|}
sftk_FreeAttribute:
  191|   873k|{
  192|   873k|    if (attribute && attribute->freeAttr) {
  ------------------
  |  Branch (192:9): [True: 873k, False: 0]
  |  Branch (192:22): [True: 0, False: 873k]
  ------------------
  193|      0|        sftk_DestroyAttribute(attribute);
  194|      0|        return;
  195|      0|    }
  196|   873k|}
sftk_FindAttribute:
  261|  1.26M|{
  262|  1.26M|    SFTKAttribute *attribute;
  263|  1.26M|    SFTKSessionObject *sessObject = sftk_narrowToSessionObject(object);
  264|       |
  265|  1.26M|    if (sessObject == NULL) {
  ------------------
  |  Branch (265:9): [True: 0, False: 1.26M]
  ------------------
  266|      0|        return sftk_FindTokenAttribute(sftk_narrowToTokenObject(object), type);
  267|      0|    }
  268|       |
  269|  1.26M|    PZ_Lock(sessObject->attributeLock);
  ------------------
  |  |  245|  1.26M|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  270|  1.26M|    sftkqueue_find(attribute, type, sessObject->head, sessObject->hashSize);
  ------------------
  |  |  524|  2.26M|    for ((element) = (head)[sftk_hash(id, hash_size)]; (element) != NULL; \
  |  |  ------------------
  |  |  |  |  513|  1.26M|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  1.26M|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (524:56): [True: 1.87M, False: 386k]
  |  |  ------------------
  |  |  525|  1.87M|         (element) = (element)->next) {                                   \
  |  |  526|  1.87M|        if ((element)->handle == (id)) {                                  \
  |  |  ------------------
  |  |  |  Branch (526:13): [True: 874k, False: 999k]
  |  |  ------------------
  |  |  527|   874k|            break;                                                        \
  |  |  528|   874k|        }                                                                 \
  |  |  529|  1.87M|    }
  ------------------
  271|  1.26M|    PZ_Unlock(sessObject->attributeLock);
  ------------------
  |  |  246|  1.26M|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  272|       |
  273|  1.26M|    return (attribute);
  274|  1.26M|}
sftk_GetLengthInBits:
  281|  19.0k|{
  282|  19.0k|    unsigned int size = bufLen * 8;
  283|  19.0k|    unsigned int i;
  284|       |
  285|       |    /* Get the real length in bytes */
  286|  58.8k|    for (i = 0; i < bufLen; i++) {
  ------------------
  |  Branch (286:17): [True: 58.4k, False: 336]
  ------------------
  287|  58.4k|        unsigned char c = *buf++;
  288|  58.4k|        if (c != 0) {
  ------------------
  |  Branch (288:13): [True: 18.7k, False: 39.7k]
  ------------------
  289|  18.7k|            unsigned char m;
  290|  54.6k|            for (m = 0x80; m > 0; m = m >> 1) {
  ------------------
  |  Branch (290:28): [True: 54.6k, False: 0]
  ------------------
  291|  54.6k|                if ((c & m) != 0) {
  ------------------
  |  Branch (291:21): [True: 18.7k, False: 35.9k]
  ------------------
  292|  18.7k|                    break;
  293|  18.7k|                }
  294|  35.9k|                size--;
  295|  35.9k|            }
  296|  18.7k|            break;
  297|  18.7k|        }
  298|  39.7k|        size -= 8;
  299|  39.7k|    }
  300|  19.0k|    return size;
  301|  19.0k|}
sftk_ConstrainAttribute:
  314|  15.2k|{
  315|  15.2k|    SFTKAttribute *attribute;
  316|  15.2k|    int size;
  317|  15.2k|    unsigned char *ptr;
  318|       |
  319|  15.2k|    attribute = sftk_FindAttribute(object, type);
  320|  15.2k|    if (!attribute) {
  ------------------
  |  Branch (320:9): [True: 0, False: 15.2k]
  ------------------
  321|      0|        return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
  322|      0|    }
  323|  15.2k|    ptr = (unsigned char *)attribute->attrib.pValue;
  324|  15.2k|    if (ptr == NULL) {
  ------------------
  |  Branch (324:9): [True: 0, False: 15.2k]
  ------------------
  325|      0|        sftk_FreeAttribute(attribute);
  326|      0|        return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  327|      0|    }
  328|  15.2k|    size = sftk_GetLengthInBits(ptr, attribute->attrib.ulValueLen);
  329|  15.2k|    sftk_FreeAttribute(attribute);
  330|       |
  331|  15.2k|    if ((minLength != 0) && (size < minLength)) {
  ------------------
  |  Branch (331:9): [True: 15.2k, False: 0]
  |  Branch (331:29): [True: 336, False: 14.9k]
  ------------------
  332|    336|        return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|    336|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  333|    336|    }
  334|  14.9k|    if ((maxLength != 0) && (size > maxLength)) {
  ------------------
  |  Branch (334:9): [True: 9.40k, False: 5.50k]
  |  Branch (334:29): [True: 0, False: 9.40k]
  ------------------
  335|      0|        return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  336|      0|    }
  337|  14.9k|    if ((minMultiple != 0) && ((size % minMultiple) != 0)) {
  ------------------
  |  Branch (337:9): [True: 918, False: 13.9k]
  |  Branch (337:31): [True: 4, False: 914]
  ------------------
  338|      4|        return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      4|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  339|      4|    }
  340|  14.9k|    return CKR_OK;
  ------------------
  |  | 1388|  14.9k|#define CKR_OK 0x00000000UL
  ------------------
  341|  14.9k|}
sftk_hasAttribute:
  367|  1.16M|{
  368|  1.16M|    SFTKAttribute *attribute;
  369|  1.16M|    SFTKSessionObject *sessObject = sftk_narrowToSessionObject(object);
  370|       |
  371|  1.16M|    if (sessObject == NULL) {
  ------------------
  |  Branch (371:9): [True: 0, False: 1.16M]
  ------------------
  372|      0|        return sftk_hasAttributeToken(sftk_narrowToTokenObject(object), type);
  373|      0|    }
  374|       |
  375|  1.16M|    PZ_Lock(sessObject->attributeLock);
  ------------------
  |  |  245|  1.16M|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  376|  1.16M|    sftkqueue_find(attribute, type, sessObject->head, sessObject->hashSize);
  ------------------
  |  |  524|  1.91M|    for ((element) = (head)[sftk_hash(id, hash_size)]; (element) != NULL; \
  |  |  ------------------
  |  |  |  |  513|  1.16M|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  1.16M|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (524:56): [True: 1.14M, False: 765k]
  |  |  ------------------
  |  |  525|  1.16M|         (element) = (element)->next) {                                   \
  |  |  526|  1.14M|        if ((element)->handle == (id)) {                                  \
  |  |  ------------------
  |  |  |  Branch (526:13): [True: 404k, False: 742k]
  |  |  ------------------
  |  |  527|   404k|            break;                                                        \
  |  |  528|   404k|        }                                                                 \
  |  |  529|  1.14M|    }
  ------------------
  377|  1.16M|    PZ_Unlock(sessObject->attributeLock);
  ------------------
  |  |  246|  1.16M|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  378|       |
  379|  1.16M|    return (PRBool)(attribute != NULL);
  380|  1.16M|}
sftk_Attribute2SSecItem:
  405|  66.3k|{
  406|  66.3k|    SFTKAttribute *attribute;
  407|       |
  408|  66.3k|    item->data = NULL;
  409|       |
  410|  66.3k|    attribute = sftk_FindAttribute(object, type);
  411|  66.3k|    if (attribute == NULL)
  ------------------
  |  Branch (411:9): [True: 0, False: 66.3k]
  ------------------
  412|      0|        return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
  413|       |
  414|  66.3k|    (void)SECITEM_AllocItem(arena, item, attribute->attrib.ulValueLen);
  ------------------
  |  |  103|  66.3k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  415|  66.3k|    if (item->data == NULL) {
  ------------------
  |  Branch (415:9): [True: 0, False: 66.3k]
  ------------------
  416|      0|        sftk_FreeAttribute(attribute);
  417|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  418|      0|    }
  419|  66.3k|    PORT_Memcpy(item->data, attribute->attrib.pValue, item->len);
  ------------------
  |  |  180|  66.3k|#define PORT_Memcpy memcpy
  ------------------
  420|  66.3k|    sftk_FreeAttribute(attribute);
  421|  66.3k|    return CKR_OK;
  ------------------
  |  | 1388|  66.3k|#define CKR_OK 0x00000000UL
  ------------------
  422|  66.3k|}
sftk_MultipleAttribute2SecItem:
  431|  1.91k|{
  432|       |
  433|  1.91k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  434|  1.91k|    CK_ATTRIBUTE templateSpace[SFTK_MAX_ITEM_TEMPLATE];
  435|  1.91k|    CK_ATTRIBUTE *template;
  436|  1.91k|    SFTKTokenObject *tokObject;
  437|  1.91k|    SFTKDBHandle *dbHandle = NULL;
  438|  1.91k|    int i;
  439|       |
  440|  1.91k|    tokObject = sftk_narrowToTokenObject(object);
  441|       |
  442|       |    /* session objects, just loop through the list */
  443|  1.91k|    if (tokObject == NULL) {
  ------------------
  |  Branch (443:9): [True: 1.91k, False: 0]
  ------------------
  444|  7.64k|        for (i = 0; i < itemTemplateCount; i++) {
  ------------------
  |  Branch (444:21): [True: 5.73k, False: 1.91k]
  ------------------
  445|  5.73k|            crv = sftk_Attribute2SecItem(arena, itemTemplate[i].item, object,
  446|  5.73k|                                         itemTemplate[i].type);
  447|  5.73k|            if (crv != CKR_OK) {
  ------------------
  |  | 1388|  5.73k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (447:17): [True: 0, False: 5.73k]
  ------------------
  448|      0|                return crv;
  449|      0|            }
  450|  5.73k|        }
  451|  1.91k|        return CKR_OK;
  ------------------
  |  | 1388|  1.91k|#define CKR_OK 0x00000000UL
  ------------------
  452|  1.91k|    }
  453|       |
  454|       |    /* don't do any work if none is required */
  455|      0|    if (itemTemplateCount == 0) {
  ------------------
  |  Branch (455:9): [True: 0, False: 0]
  ------------------
  456|      0|        return CKR_OK;
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  457|      0|    }
  458|       |
  459|       |    /* don't allocate the template unless we need it */
  460|      0|    if (itemTemplateCount > SFTK_MAX_ITEM_TEMPLATE) {
  ------------------
  |  |  468|      0|#define SFTK_MAX_ITEM_TEMPLATE 10
  ------------------
  |  Branch (460:9): [True: 0, False: 0]
  ------------------
  461|      0|        template = PORT_NewArray(CK_ATTRIBUTE, itemTemplateCount);
  ------------------
  |  |  157|      0|    (type *)PORT_Alloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
  462|      0|    } else {
  463|      0|        template = templateSpace;
  464|      0|    }
  465|       |
  466|      0|    if (template == NULL) {
  ------------------
  |  Branch (466:9): [True: 0, False: 0]
  ------------------
  467|      0|        crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  468|      0|        goto loser;
  469|      0|    }
  470|       |
  471|      0|    dbHandle = sftk_getDBForTokenObject(object->slot, object->handle);
  472|      0|    if (dbHandle == NULL) {
  ------------------
  |  Branch (472:9): [True: 0, False: 0]
  ------------------
  473|      0|        crv = CKR_OBJECT_HANDLE_INVALID;
  ------------------
  |  | 1452|      0|#define CKR_OBJECT_HANDLE_INVALID 0x00000082UL
  ------------------
  474|      0|        goto loser;
  475|      0|    }
  476|       |
  477|       |    /* set up the PKCS #11 template */
  478|      0|    for (i = 0; i < itemTemplateCount; i++) {
  ------------------
  |  Branch (478:17): [True: 0, False: 0]
  ------------------
  479|      0|        template[i].type = itemTemplate[i].type;
  480|      0|        template[i].pValue = NULL;
  481|      0|        template[i].ulValueLen = 0;
  482|      0|    }
  483|       |
  484|       |    /* fetch the attribute lengths */
  485|      0|    crv = sftkdb_GetAttributeValue(dbHandle, object->handle,
  486|      0|                                   template, itemTemplateCount);
  487|      0|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (487:9): [True: 0, False: 0]
  ------------------
  488|      0|        goto loser;
  489|      0|    }
  490|       |
  491|       |    /* allocate space for the attributes */
  492|      0|    for (i = 0; i < itemTemplateCount; i++) {
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|        template[i].pValue = PORT_ArenaAlloc(arena, template[i].ulValueLen);
  ------------------
  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  494|      0|        if (template[i].pValue == NULL) {
  ------------------
  |  Branch (494:13): [True: 0, False: 0]
  ------------------
  495|      0|            crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  496|      0|            goto loser;
  497|      0|        }
  498|      0|    }
  499|       |
  500|       |    /* fetch the attributes */
  501|      0|    crv = sftkdb_GetAttributeValue(dbHandle, object->handle,
  502|      0|                                   template, itemTemplateCount);
  503|      0|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (503:9): [True: 0, False: 0]
  ------------------
  504|      0|        goto loser;
  505|      0|    }
  506|       |
  507|       |    /* Fill in the items */
  508|      0|    for (i = 0; i < itemTemplateCount; i++) {
  ------------------
  |  Branch (508:17): [True: 0, False: 0]
  ------------------
  509|      0|        itemTemplate[i].item->data = template[i].pValue;
  510|      0|        itemTemplate[i].item->len = template[i].ulValueLen;
  511|      0|    }
  512|       |
  513|      0|loser:
  514|      0|    if (template != templateSpace) {
  ------------------
  |  Branch (514:9): [True: 0, False: 0]
  ------------------
  515|      0|        PORT_Free(template);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  516|      0|    }
  517|      0|    if (dbHandle) {
  ------------------
  |  Branch (517:9): [True: 0, False: 0]
  ------------------
  518|      0|        sftk_freeDB(dbHandle);
  519|      0|    }
  520|       |
  521|      0|    return crv;
  522|      0|}
sftk_isTrue:
  550|   386k|{
  551|   386k|    SFTKAttribute *attribute;
  552|   386k|    PRBool tok = PR_FALSE;
  ------------------
  |  |  438|   386k|#define PR_FALSE 0
  ------------------
  553|       |
  554|   386k|    attribute = sftk_FindAttribute(object, type);
  555|   386k|    if (attribute == NULL) {
  ------------------
  |  Branch (555:9): [True: 74.3k, False: 312k]
  ------------------
  556|  74.3k|        return PR_FALSE;
  ------------------
  |  |  438|  74.3k|#define PR_FALSE 0
  ------------------
  557|  74.3k|    }
  558|   312k|    tok = (PRBool)(*(CK_BBOOL *)attribute->attrib.pValue);
  559|   312k|    sftk_FreeAttribute(attribute);
  560|       |
  561|   312k|    return tok;
  562|   386k|}
sftk_forceAttribute:
  621|   217k|{
  622|   217k|    SFTKAttribute *attribute;
  623|   217k|    void *att_val = NULL;
  624|   217k|    PRBool freeData = PR_FALSE;
  ------------------
  |  |  438|   217k|#define PR_FALSE 0
  ------------------
  625|       |
  626|   217k|    PORT_Assert(object);
  ------------------
  |  |  120|   217k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   217k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 217k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  627|   217k|    PORT_Assert(object->refCount);
  ------------------
  |  |  120|   217k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   217k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 217k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  628|   217k|    PORT_Assert(object->slot);
  ------------------
  |  |  120|   217k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   217k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 217k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|   217k|    if (!object ||
  ------------------
  |  Branch (629:9): [True: 0, False: 217k]
  ------------------
  630|   217k|        !object->refCount ||
  ------------------
  |  Branch (630:9): [True: 0, False: 217k]
  ------------------
  631|   217k|        !object->slot) {
  ------------------
  |  Branch (631:9): [True: 0, False: 217k]
  ------------------
  632|      0|        return CKR_DEVICE_ERROR;
  ------------------
  |  | 1416|      0|#define CKR_DEVICE_ERROR 0x00000030UL
  ------------------
  633|      0|    }
  634|   217k|    if (sftk_isToken(object->handle)) {
  ------------------
  |  |  504|   217k|#define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  478|   217k|#define SFTK_TOKEN_MASK 0x80000000L
  |  |  ------------------
  |  |               #define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  479|   217k|#define SFTK_TOKEN_MAGIC 0x80000000L
  |  |  ------------------
  |  |  |  Branch (504:26): [True: 0, False: 217k]
  |  |  ------------------
  ------------------
  635|      0|        return sftk_forceTokenAttribute(object, type, value, len);
  636|      0|    }
  637|   217k|    attribute = sftk_FindAttribute(object, type);
  638|   217k|    if (attribute == NULL)
  ------------------
  |  Branch (638:9): [True: 157k, False: 59.7k]
  ------------------
  639|   157k|        return sftk_AddAttributeType(object, type, value, len);
  640|       |
  641|  59.7k|    if (value) {
  ------------------
  |  Branch (641:9): [True: 59.7k, False: 0]
  ------------------
  642|  59.7k|        if (len <= ATTR_SPACE) {
  ------------------
  |  |   39|  59.7k|#define ATTR_SPACE 50     /* Maximum size of attribute data before extra \
  ------------------
  |  Branch (642:13): [True: 59.7k, False: 0]
  ------------------
  643|  59.7k|            att_val = attribute->space;
  644|  59.7k|        } else {
  645|      0|            att_val = PORT_Alloc(len);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  646|      0|            freeData = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  647|      0|        }
  648|  59.7k|        if (att_val == NULL) {
  ------------------
  |  Branch (648:13): [True: 0, False: 59.7k]
  ------------------
  649|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  650|      0|        }
  651|  59.7k|        if (attribute->attrib.pValue == att_val) {
  ------------------
  |  Branch (651:13): [True: 50.5k, False: 9.19k]
  ------------------
  652|  50.5k|            PORT_Memset(attribute->attrib.pValue, 0,
  ------------------
  |  |  182|  50.5k|#define PORT_Memset memset
  ------------------
  653|  50.5k|                        attribute->attrib.ulValueLen);
  654|  50.5k|        }
  655|  59.7k|        PORT_Memcpy(att_val, value, len);
  ------------------
  |  |  180|  59.7k|#define PORT_Memcpy memcpy
  ------------------
  656|  59.7k|    }
  657|  59.7k|    if (attribute->attrib.pValue != NULL) {
  ------------------
  |  Branch (657:9): [True: 50.5k, False: 9.19k]
  ------------------
  658|  50.5k|        if (attribute->attrib.pValue != att_val) {
  ------------------
  |  Branch (658:13): [True: 0, False: 50.5k]
  ------------------
  659|      0|            PORT_Memset(attribute->attrib.pValue, 0,
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
  660|      0|                        attribute->attrib.ulValueLen);
  661|      0|        }
  662|  50.5k|        if (attribute->freeData) {
  ------------------
  |  Branch (662:13): [True: 0, False: 50.5k]
  ------------------
  663|      0|            PORT_Free(attribute->attrib.pValue);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  664|      0|        }
  665|  50.5k|        attribute->freeData = PR_FALSE;
  ------------------
  |  |  438|  50.5k|#define PR_FALSE 0
  ------------------
  666|  50.5k|        attribute->attrib.pValue = NULL;
  667|  50.5k|        attribute->attrib.ulValueLen = 0;
  668|  50.5k|    }
  669|  59.7k|    if (att_val) {
  ------------------
  |  Branch (669:9): [True: 59.7k, False: 0]
  ------------------
  670|  59.7k|        attribute->attrib.pValue = att_val;
  671|  59.7k|        attribute->attrib.ulValueLen = len;
  672|  59.7k|        attribute->freeData = freeData;
  673|  59.7k|    }
  674|  59.7k|    sftk_FreeAttribute(attribute);
  675|  59.7k|    return CKR_OK;
  ------------------
  |  | 1388|  59.7k|#define CKR_OK 0x00000000UL
  ------------------
  676|  59.7k|}
sftk_modifyType:
  721|  9.19k|{
  722|       |    /* if we don't know about it, user user defined, always allow modify */
  723|  9.19k|    SFTKModifyType mtype = SFTK_ALWAYS;
  724|       |
  725|  9.19k|    switch (type) {
  726|       |        /* NEVER */
  727|      0|        case CKA_CLASS:
  ------------------
  |  |  511|      0|#define CKA_CLASS 0x00000000UL
  ------------------
  |  Branch (727:9): [True: 0, False: 9.19k]
  ------------------
  728|      0|        case CKA_CERTIFICATE_TYPE:
  ------------------
  |  |  521|      0|#define CKA_CERTIFICATE_TYPE 0x00000080UL
  ------------------
  |  Branch (728:9): [True: 0, False: 9.19k]
  ------------------
  729|      0|        case CKA_KEY_TYPE:
  ------------------
  |  |  543|      0|#define CKA_KEY_TYPE 0x00000100UL
  ------------------
  |  Branch (729:9): [True: 0, False: 9.19k]
  ------------------
  730|      0|        case CKA_MODULUS:
  ------------------
  |  |  558|      0|#define CKA_MODULUS 0x00000120UL
  ------------------
  |  Branch (730:9): [True: 0, False: 9.19k]
  ------------------
  731|      0|        case CKA_MODULUS_BITS:
  ------------------
  |  |  559|      0|#define CKA_MODULUS_BITS 0x00000121UL
  ------------------
  |  Branch (731:9): [True: 0, False: 9.19k]
  ------------------
  732|      0|        case CKA_PUBLIC_EXPONENT:
  ------------------
  |  |  560|      0|#define CKA_PUBLIC_EXPONENT 0x00000122UL
  ------------------
  |  Branch (732:9): [True: 0, False: 9.19k]
  ------------------
  733|      0|        case CKA_PRIVATE_EXPONENT:
  ------------------
  |  |  561|      0|#define CKA_PRIVATE_EXPONENT 0x00000123UL
  ------------------
  |  Branch (733:9): [True: 0, False: 9.19k]
  ------------------
  734|      0|        case CKA_PRIME:
  ------------------
  |  |  569|      0|#define CKA_PRIME 0x00000130UL
  ------------------
  |  Branch (734:9): [True: 0, False: 9.19k]
  ------------------
  735|      0|        case CKA_BASE:
  ------------------
  |  |  571|      0|#define CKA_BASE 0x00000132UL
  ------------------
  |  Branch (735:9): [True: 0, False: 9.19k]
  ------------------
  736|      0|        case CKA_PRIME_1:
  ------------------
  |  |  562|      0|#define CKA_PRIME_1 0x00000124UL
  ------------------
  |  Branch (736:9): [True: 0, False: 9.19k]
  ------------------
  737|      0|        case CKA_PRIME_2:
  ------------------
  |  |  563|      0|#define CKA_PRIME_2 0x00000125UL
  ------------------
  |  Branch (737:9): [True: 0, False: 9.19k]
  ------------------
  738|      0|        case CKA_EXPONENT_1:
  ------------------
  |  |  564|      0|#define CKA_EXPONENT_1 0x00000126UL
  ------------------
  |  Branch (738:9): [True: 0, False: 9.19k]
  ------------------
  739|      0|        case CKA_EXPONENT_2:
  ------------------
  |  |  565|      0|#define CKA_EXPONENT_2 0x00000127UL
  ------------------
  |  Branch (739:9): [True: 0, False: 9.19k]
  ------------------
  740|      0|        case CKA_COEFFICIENT:
  ------------------
  |  |  566|      0|#define CKA_COEFFICIENT 0x00000128UL
  ------------------
  |  Branch (740:9): [True: 0, False: 9.19k]
  ------------------
  741|      0|        case CKA_VALUE_LEN:
  ------------------
  |  |  580|      0|#define CKA_VALUE_LEN 0x00000161UL
  ------------------
  |  Branch (741:9): [True: 0, False: 9.19k]
  ------------------
  742|      0|        case CKA_ALWAYS_SENSITIVE:
  ------------------
  |  |  588|      0|#define CKA_ALWAYS_SENSITIVE 0x00000165UL
  ------------------
  |  Branch (742:9): [True: 0, False: 9.19k]
  ------------------
  743|      0|        case CKA_NEVER_EXTRACTABLE:
  ------------------
  |  |  587|      0|#define CKA_NEVER_EXTRACTABLE 0x00000164UL
  ------------------
  |  Branch (743:9): [True: 0, False: 9.19k]
  ------------------
  744|      0|        case CKA_NSS_DB:
  ------------------
  |  |  150|      0|#define CKA_NSS_DB 0xD5A0DB00L
  ------------------
  |  Branch (744:9): [True: 0, False: 9.19k]
  ------------------
  745|      0|            mtype = SFTK_NEVER;
  746|      0|            break;
  747|       |
  748|       |        /* ONCOPY */
  749|      0|        case CKA_TOKEN:
  ------------------
  |  |  512|      0|#define CKA_TOKEN 0x00000001UL
  ------------------
  |  Branch (749:9): [True: 0, False: 9.19k]
  ------------------
  750|      0|        case CKA_PRIVATE:
  ------------------
  |  |  513|      0|#define CKA_PRIVATE 0x00000002UL
  ------------------
  |  Branch (750:9): [True: 0, False: 9.19k]
  ------------------
  751|      0|        case CKA_MODIFIABLE:
  ------------------
  |  |  593|      0|#define CKA_MODIFIABLE 0x00000170UL
  ------------------
  |  Branch (751:9): [True: 0, False: 9.19k]
  ------------------
  752|      0|            mtype = SFTK_ONCOPY;
  753|      0|            break;
  754|       |
  755|       |        /* SENSITIVE */
  756|      0|        case CKA_SENSITIVE:
  ------------------
  |  |  546|      0|#define CKA_SENSITIVE 0x00000103UL
  ------------------
  |  Branch (756:9): [True: 0, False: 9.19k]
  ------------------
  757|      0|        case CKA_EXTRACTABLE:
  ------------------
  |  |  585|      0|#define CKA_EXTRACTABLE 0x00000162UL
  ------------------
  |  Branch (757:9): [True: 0, False: 9.19k]
  ------------------
  758|      0|            mtype = SFTK_SENSITIVE;
  759|      0|            break;
  760|       |
  761|       |        /* ALWAYS */
  762|      0|        case CKA_LABEL:
  ------------------
  |  |  514|      0|#define CKA_LABEL 0x00000003UL
  ------------------
  |  Branch (762:9): [True: 0, False: 9.19k]
  ------------------
  763|      0|        case CKA_APPLICATION:
  ------------------
  |  |  515|      0|#define CKA_APPLICATION 0x00000010UL
  ------------------
  |  Branch (763:9): [True: 0, False: 9.19k]
  ------------------
  764|  9.19k|        case CKA_ID:
  ------------------
  |  |  545|  9.19k|#define CKA_ID 0x00000102UL
  ------------------
  |  Branch (764:9): [True: 9.19k, False: 0]
  ------------------
  765|  9.19k|        case CKA_SERIAL_NUMBER:
  ------------------
  |  |  523|  9.19k|#define CKA_SERIAL_NUMBER 0x00000082UL
  ------------------
  |  Branch (765:9): [True: 0, False: 9.19k]
  ------------------
  766|  9.19k|        case CKA_START_DATE:
  ------------------
  |  |  556|  9.19k|#define CKA_START_DATE 0x00000110UL
  ------------------
  |  Branch (766:9): [True: 0, False: 9.19k]
  ------------------
  767|  9.19k|        case CKA_END_DATE:
  ------------------
  |  |  557|  9.19k|#define CKA_END_DATE 0x00000111UL
  ------------------
  |  Branch (767:9): [True: 0, False: 9.19k]
  ------------------
  768|  9.19k|        case CKA_DERIVE:
  ------------------
  |  |  555|  9.19k|#define CKA_DERIVE 0x0000010CUL
  ------------------
  |  Branch (768:9): [True: 0, False: 9.19k]
  ------------------
  769|  9.19k|        case CKA_ENCRYPT:
  ------------------
  |  |  547|  9.19k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
  |  Branch (769:9): [True: 0, False: 9.19k]
  ------------------
  770|  9.19k|        case CKA_DECRYPT:
  ------------------
  |  |  548|  9.19k|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (770:9): [True: 0, False: 9.19k]
  ------------------
  771|  9.19k|        case CKA_SIGN:
  ------------------
  |  |  551|  9.19k|#define CKA_SIGN 0x00000108UL
  ------------------
  |  Branch (771:9): [True: 0, False: 9.19k]
  ------------------
  772|  9.19k|        case CKA_VERIFY:
  ------------------
  |  |  553|  9.19k|#define CKA_VERIFY 0x0000010AUL
  ------------------
  |  Branch (772:9): [True: 0, False: 9.19k]
  ------------------
  773|  9.19k|        case CKA_SIGN_RECOVER:
  ------------------
  |  |  552|  9.19k|#define CKA_SIGN_RECOVER 0x00000109UL
  ------------------
  |  Branch (773:9): [True: 0, False: 9.19k]
  ------------------
  774|  9.19k|        case CKA_VERIFY_RECOVER:
  ------------------
  |  |  554|  9.19k|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
  |  Branch (774:9): [True: 0, False: 9.19k]
  ------------------
  775|  9.19k|        case CKA_WRAP:
  ------------------
  |  |  549|  9.19k|#define CKA_WRAP 0x00000106UL
  ------------------
  |  Branch (775:9): [True: 0, False: 9.19k]
  ------------------
  776|  9.19k|        case CKA_UNWRAP:
  ------------------
  |  |  550|  9.19k|#define CKA_UNWRAP 0x00000107UL
  ------------------
  |  Branch (776:9): [True: 0, False: 9.19k]
  ------------------
  777|  9.19k|            mtype = SFTK_ALWAYS;
  778|  9.19k|            break;
  779|       |
  780|       |        /* DEPENDS ON CLASS */
  781|      0|        case CKA_VALUE:
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
  |  Branch (781:9): [True: 0, False: 9.19k]
  ------------------
  782|      0|            mtype = (inClass == CKO_DATA) ? SFTK_ALWAYS : SFTK_NEVER;
  ------------------
  |  |  325|      0|#define CKO_DATA 0x00000000UL
  ------------------
  |  Branch (782:21): [True: 0, False: 0]
  ------------------
  783|      0|            break;
  784|       |
  785|      0|        case CKA_SUBPRIME:
  ------------------
  |  |  570|      0|#define CKA_SUBPRIME 0x00000131UL
  ------------------
  |  Branch (785:9): [True: 0, False: 9.19k]
  ------------------
  786|       |            /* allow the CKA_SUBPRIME to be added to dh private keys */
  787|      0|            mtype = (inClass == CKO_PRIVATE_KEY) ? SFTK_ALWAYS : SFTK_NEVER;
  ------------------
  |  |  328|      0|#define CKO_PRIVATE_KEY 0x00000003UL
  ------------------
  |  Branch (787:21): [True: 0, False: 0]
  ------------------
  788|      0|            break;
  789|       |
  790|      0|        case CKA_SUBJECT:
  ------------------
  |  |  544|      0|#define CKA_SUBJECT 0x00000101UL
  ------------------
  |  Branch (790:9): [True: 0, False: 9.19k]
  ------------------
  791|      0|            mtype = (inClass == CKO_CERTIFICATE) ? SFTK_NEVER : SFTK_ALWAYS;
  ------------------
  |  |  326|      0|#define CKO_CERTIFICATE 0x00000001UL
  ------------------
  |  Branch (791:21): [True: 0, False: 0]
  ------------------
  792|      0|            break;
  793|      0|        default:
  ------------------
  |  Branch (793:9): [True: 0, False: 9.19k]
  ------------------
  794|      0|            break;
  795|  9.19k|    }
  796|  9.19k|    return mtype;
  797|  9.19k|}
sftk_Attribute2SecItem:
  832|  8.37k|{
  833|  8.37k|    int len;
  834|  8.37k|    SFTKAttribute *attribute;
  835|       |
  836|  8.37k|    attribute = sftk_FindAttribute(object, type);
  837|  8.37k|    if (attribute == NULL)
  ------------------
  |  Branch (837:9): [True: 0, False: 8.37k]
  ------------------
  838|      0|        return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
  839|  8.37k|    len = attribute->attrib.ulValueLen;
  840|       |
  841|  8.37k|    if (arena) {
  ------------------
  |  Branch (841:9): [True: 5.73k, False: 2.64k]
  ------------------
  842|  5.73k|        item->data = (unsigned char *)PORT_ArenaAlloc(arena, len);
  ------------------
  |  |   53|  5.73k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  843|  5.73k|    } else {
  844|  2.64k|        item->data = (unsigned char *)PORT_Alloc(len);
  ------------------
  |  |   52|  2.64k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  845|  2.64k|    }
  846|  8.37k|    if (item->data == NULL) {
  ------------------
  |  Branch (846:9): [True: 0, False: 8.37k]
  ------------------
  847|      0|        sftk_FreeAttribute(attribute);
  848|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  849|      0|    }
  850|  8.37k|    item->len = len;
  851|  8.37k|    PORT_Memcpy(item->data, attribute->attrib.pValue, len);
  ------------------
  |  |  180|  8.37k|#define PORT_Memcpy memcpy
  ------------------
  852|  8.37k|    sftk_FreeAttribute(attribute);
  853|  8.37k|    return CKR_OK;
  ------------------
  |  | 1388|  8.37k|#define CKR_OK 0x00000000UL
  ------------------
  854|  8.37k|}
sftk_GetULongAttribute:
  859|  40.9k|{
  860|  40.9k|    SFTKAttribute *attribute;
  861|       |
  862|  40.9k|    attribute = sftk_FindAttribute(object, type);
  863|  40.9k|    if (attribute == NULL)
  ------------------
  |  Branch (863:9): [True: 0, False: 40.9k]
  ------------------
  864|      0|        return CKR_TEMPLATE_INCOMPLETE;
  ------------------
  |  | 1477|      0|#define CKR_TEMPLATE_INCOMPLETE 0x000000D0UL
  ------------------
  865|       |
  866|  40.9k|    if (attribute->attrib.ulValueLen != sizeof(CK_ULONG)) {
  ------------------
  |  Branch (866:9): [True: 0, False: 40.9k]
  ------------------
  867|      0|        return CKR_ATTRIBUTE_VALUE_INVALID;
  ------------------
  |  | 1409|      0|#define CKR_ATTRIBUTE_VALUE_INVALID 0x00000013UL
  ------------------
  868|      0|    }
  869|       |
  870|  40.9k|    *longData = *(CK_ULONG *)attribute->attrib.pValue;
  871|  40.9k|    sftk_FreeAttribute(attribute);
  872|  40.9k|    return CKR_OK;
  ------------------
  |  | 1388|  40.9k|#define CKR_OK 0x00000000UL
  ------------------
  873|  40.9k|}
sftk_DeleteAttributeType:
  877|   108k|{
  878|   108k|    SFTKAttribute *attribute;
  879|   108k|    attribute = sftk_FindAttribute(object, type);
  880|   108k|    if (attribute == NULL)
  ------------------
  |  Branch (880:9): [True: 108k, False: 0]
  ------------------
  881|   108k|        return;
  882|      0|    sftk_DeleteAttribute(object, attribute);
  883|      0|    sftk_DestroyAttribute(attribute);
  884|      0|}
sftk_AddAttributeType:
  889|  1.30M|{
  890|  1.30M|    SFTKAttribute *attribute;
  891|  1.30M|    attribute = sftk_NewAttribute(object, type, valPtr, length);
  892|  1.30M|    if (attribute == NULL) {
  ------------------
  |  Branch (892:9): [True: 0, False: 1.30M]
  ------------------
  893|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  894|      0|    }
  895|  1.30M|    sftk_AddAttribute(object, attribute);
  896|  1.30M|    return CKR_OK;
  ------------------
  |  | 1388|  1.30M|#define CKR_OK 0x00000000UL
  ------------------
  897|  1.30M|}
SFTK_ClearTokenKeyHashTable:
  938|      2|{
  939|      2|    sftk_tokenKeyLock(slot);
  940|      2|    PORT_Assert(!slot->present);
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      2|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  941|      2|    PL_HashTableEnumerateEntries(slot->tokObjHashTable, sftk_freeHashItem, NULL);
  942|      2|    sftk_tokenKeyUnlock(slot);
  943|      2|    return CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
  944|      2|}
sftk_GetObjectFromList:
  953|  64.6k|{
  954|  64.6k|    SFTKObject *object;
  955|  64.6k|    int size = 0;
  956|       |
  957|  64.6k|    if (!optimizeSpace) {
  ------------------
  |  Branch (957:9): [True: 0, False: 64.6k]
  ------------------
  958|      0|        PZ_Lock(list->lock);
  ------------------
  |  |  245|      0|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  959|      0|        object = list->head;
  960|      0|        if (object) {
  ------------------
  |  Branch (960:13): [True: 0, False: 0]
  ------------------
  961|      0|            list->head = object->next;
  962|      0|            list->count--;
  963|      0|        }
  964|      0|        PZ_Unlock(list->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  965|      0|        if (object) {
  ------------------
  |  Branch (965:13): [True: 0, False: 0]
  ------------------
  966|       |            // As a safeguard against misuse of the library, ensure we don't
  967|       |            // hand out live objects that somehow land in the free list.
  968|      0|            PORT_Assert(object->refCount == 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  969|      0|            if (object->refCount == 0) {
  ------------------
  |  Branch (969:17): [True: 0, False: 0]
  ------------------
  970|      0|                object->next = object->prev = NULL;
  971|      0|                *hasLocks = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  972|      0|                return object;
  973|      0|            }
  974|      0|        }
  975|      0|    }
  976|  64.6k|    size = isSessionObject ? sizeof(SFTKSessionObject) + hashSize * sizeof(SFTKAttribute *) : sizeof(SFTKTokenObject);
  ------------------
  |  Branch (976:12): [True: 64.6k, False: 0]
  ------------------
  977|       |
  978|  64.6k|    object = (SFTKObject *)PORT_ZAlloc(size);
  ------------------
  |  |   72|  64.6k|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  979|  64.6k|    if (isSessionObject && object) {
  ------------------
  |  Branch (979:9): [True: 64.6k, False: 0]
  |  Branch (979:28): [True: 64.6k, False: 0]
  ------------------
  980|  64.6k|        ((SFTKSessionObject *)object)->hashSize = hashSize;
  981|  64.6k|    }
  982|  64.6k|    *hasLocks = PR_FALSE;
  ------------------
  |  |  438|  64.6k|#define PR_FALSE 0
  ------------------
  983|  64.6k|    return object;
  984|  64.6k|}
sftk_InitFreeLists:
 1039|      1|{
 1040|      1|    sftk_InitFreeList(&sessionObjectList);
 1041|      1|    sftk_InitFreeList(&tokenObjectList);
 1042|      1|}
sftk_CleanupFreeLists:
 1069|      1|{
 1070|      1|    sftk_CleanupFreeList(&sessionObjectList, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 1071|      1|    sftk_CleanupFreeList(&tokenObjectList, PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 1072|      1|}
sftk_NewObject:
 1079|  64.6k|{
 1080|  64.6k|    SFTKObject *object;
 1081|  64.6k|    SFTKSessionObject *sessObject;
 1082|  64.6k|    PRBool hasLocks = PR_FALSE;
  ------------------
  |  |  438|  64.6k|#define PR_FALSE 0
  ------------------
 1083|  64.6k|    unsigned int i;
 1084|  64.6k|    unsigned int hashSize = 0;
 1085|       |
 1086|  64.6k|    hashSize = (slot->optimizeSpace) ? SPACE_ATTRIBUTE_HASH_SIZE : TIME_ATTRIBUTE_HASH_SIZE;
  ------------------
  |  |   65|  64.6k|#define SPACE_ATTRIBUTE_HASH_SIZE 32
  ------------------
                  hashSize = (slot->optimizeSpace) ? SPACE_ATTRIBUTE_HASH_SIZE : TIME_ATTRIBUTE_HASH_SIZE;
  ------------------
  |  |   68|  64.6k|#define TIME_ATTRIBUTE_HASH_SIZE 32
  ------------------
  |  Branch (1086:16): [True: 64.6k, False: 0]
  ------------------
 1087|       |
 1088|  64.6k|    object = sftk_GetObjectFromList(&hasLocks, slot->optimizeSpace,
 1089|  64.6k|                                    &sessionObjectList, hashSize, PR_TRUE);
  ------------------
  |  |  437|  64.6k|#define PR_TRUE 1
  ------------------
 1090|  64.6k|    if (object == NULL) {
  ------------------
  |  Branch (1090:9): [True: 0, False: 64.6k]
  ------------------
 1091|      0|        return NULL;
 1092|      0|    }
 1093|  64.6k|    sessObject = (SFTKSessionObject *)object;
 1094|  64.6k|    sessObject->nextAttr = 0;
 1095|       |
 1096|  2.97M|    for (i = 0; i < MAX_OBJS_ATTRS; i++) {
  ------------------
  |  |   37|  2.97M|#define MAX_OBJS_ATTRS 45 /* number of attributes to preallocate in \
  ------------------
  |  Branch (1096:17): [True: 2.90M, False: 64.6k]
  ------------------
 1097|  2.90M|        sessObject->attrList[i].attrib.pValue = NULL;
 1098|  2.90M|        sessObject->attrList[i].freeData = PR_FALSE;
  ------------------
  |  |  438|  2.90M|#define PR_FALSE 0
  ------------------
 1099|  2.90M|    }
 1100|  64.6k|    sessObject->optimizeSpace = slot->optimizeSpace;
 1101|       |
 1102|  64.6k|    object->handle = 0;
 1103|  64.6k|    object->next = object->prev = NULL;
 1104|  64.6k|    object->slot = slot;
 1105|  64.6k|    object->isFIPS = sftk_isFIPS(slot->slotID);
  ------------------
  |  |  506|  64.6k|    (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  500|  64.6k|#define FIPS_SLOT_ID 3
  |  |  ------------------
  |  |                   (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  567|  64.6k|#define SFTK_MIN_FIPS_USER_SLOT_ID 101
  |  |  ------------------
  |  |  |  Branch (506:6): [True: 0, False: 64.6k]
  |  |  |  Branch (506:32): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 1106|       |
 1107|  64.6k|    object->refCount = 1;
 1108|  64.6k|    sessObject->sessionList.next = NULL;
 1109|  64.6k|    sessObject->sessionList.prev = NULL;
 1110|  64.6k|    sessObject->sessionList.parent = object;
 1111|  64.6k|    sessObject->session = NULL;
 1112|  64.6k|    sessObject->wasDerived = PR_FALSE;
  ------------------
  |  |  438|  64.6k|#define PR_FALSE 0
  ------------------
 1113|  64.6k|    if (!hasLocks)
  ------------------
  |  Branch (1113:9): [True: 64.6k, False: 0]
  ------------------
 1114|  64.6k|        object->refLock = PZ_NewLock(nssILockRefLock);
  ------------------
  |  |  243|  64.6k|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 1115|  64.6k|    if (object->refLock == NULL) {
  ------------------
  |  Branch (1115:9): [True: 0, False: 64.6k]
  ------------------
 1116|      0|        PORT_Free(object);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1117|      0|        return NULL;
 1118|      0|    }
 1119|  64.6k|    if (!hasLocks)
  ------------------
  |  Branch (1119:9): [True: 64.6k, False: 0]
  ------------------
 1120|  64.6k|        sessObject->attributeLock = PZ_NewLock(nssILockAttribute);
  ------------------
  |  |  243|  64.6k|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 1121|  64.6k|    if (sessObject->attributeLock == NULL) {
  ------------------
  |  Branch (1121:9): [True: 0, False: 64.6k]
  ------------------
 1122|      0|        PZ_DestroyLock(object->refLock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 1123|      0|        PORT_Free(object);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1124|      0|        return NULL;
 1125|      0|    }
 1126|  2.13M|    for (i = 0; i < sessObject->hashSize; i++) {
  ------------------
  |  Branch (1126:17): [True: 2.06M, False: 64.6k]
  ------------------
 1127|  2.06M|        sessObject->head[i] = NULL;
 1128|  2.06M|    }
 1129|  64.6k|    object->objectInfo = NULL;
 1130|  64.6k|    object->infoFree = NULL;
 1131|  64.6k|    return object;
 1132|  64.6k|}
sftk_ReferenceObject:
 1192|   241k|{
 1193|   241k|    PZ_Lock(object->refLock);
  ------------------
  |  |  245|   241k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1194|   241k|    PORT_Assert(object->refCount > 0);
  ------------------
  |  |  120|   241k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   241k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 241k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1195|   241k|    object->refCount++;
 1196|   241k|    PZ_Unlock(object->refLock);
  ------------------
  |  |  246|   241k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1197|   241k|}
sftk_ObjectFromHandle:
 1225|   179k|{
 1226|   179k|    SFTKSlot *slot = sftk_SlotFromSession(session);
  ------------------
  |  |  503|   179k|#define sftk_SlotFromSession(sp) ((sp)->slot)
  ------------------
 1227|       |
 1228|   179k|    return sftk_ObjectFromHandleOnSlot(handle, slot);
 1229|   179k|}
sftk_FreeObject:
 1236|   305k|{
 1237|   305k|    PRBool destroy = PR_FALSE;
  ------------------
  |  |  438|   305k|#define PR_FALSE 0
  ------------------
 1238|   305k|    CK_RV crv;
 1239|       |
 1240|   305k|    PZ_Lock(object->refLock);
  ------------------
  |  |  245|   305k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1241|   305k|    if (object->refCount == 1)
  ------------------
  |  Branch (1241:9): [True: 64.6k, False: 241k]
  ------------------
 1242|  64.6k|        destroy = PR_TRUE;
  ------------------
  |  |  437|  64.6k|#define PR_TRUE 1
  ------------------
 1243|   305k|    object->refCount--;
 1244|   305k|    PZ_Unlock(object->refLock);
  ------------------
  |  |  246|   305k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1245|       |
 1246|   305k|    if (destroy) {
  ------------------
  |  Branch (1246:9): [True: 64.6k, False: 241k]
  ------------------
 1247|  64.6k|        crv = sftk_DestroyObject(object);
 1248|  64.6k|        if (crv != CKR_OK) {
  ------------------
  |  | 1388|  64.6k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1248:13): [True: 0, False: 64.6k]
  ------------------
 1249|      0|            return SFTK_DestroyFailure;
 1250|      0|        }
 1251|  64.6k|        return SFTK_Destroyed;
 1252|  64.6k|    }
 1253|   241k|    return SFTK_Busy;
 1254|   305k|}
sftk_getNextHandle:
 1263|  62.5k|{
 1264|  62.5k|    CK_OBJECT_HANDLE handle;
 1265|  62.5k|    SFTKObject *duplicateObject = NULL;
 1266|  62.5k|    do {
 1267|  62.5k|        PRUint32 wrappedAround;
 1268|       |
 1269|  62.5k|        duplicateObject = NULL;
 1270|  62.5k|        PZ_Lock(slot->objectLock);
  ------------------
  |  |  245|  62.5k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1271|  62.5k|        wrappedAround = slot->sessionObjectHandleCount & SFTK_TOKEN_MASK;
  ------------------
  |  |  478|  62.5k|#define SFTK_TOKEN_MASK 0x80000000L
  ------------------
 1272|  62.5k|        handle = slot->sessionObjectHandleCount & ~SFTK_TOKEN_MASK;
  ------------------
  |  |  478|  62.5k|#define SFTK_TOKEN_MASK 0x80000000L
  ------------------
 1273|  62.5k|        if (!handle) /* don't allow zero handle */
  ------------------
  |  Branch (1273:13): [True: 0, False: 62.5k]
  ------------------
 1274|      0|            handle = NSC_MIN_SESSION_OBJECT_HANDLE;
  ------------------
  |  |   52|      0|#define NSC_MIN_SESSION_OBJECT_HANDLE 1U
  ------------------
 1275|  62.5k|        slot->sessionObjectHandleCount = (handle + 1U) | wrappedAround;
 1276|       |        /* Is there already a session object with this handle? */
 1277|  62.5k|        if (wrappedAround) {
  ------------------
  |  Branch (1277:13): [True: 0, False: 62.5k]
  ------------------
 1278|      0|            sftkqueue_find(duplicateObject, handle, slot->sessObjHashTable,
  ------------------
  |  |  524|      0|    for ((element) = (head)[sftk_hash(id, hash_size)]; (element) != NULL; \
  |  |  ------------------
  |  |  |  |  513|      0|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|      0|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (524:56): [True: 0, False: 0]
  |  |  ------------------
  |  |  525|      0|         (element) = (element)->next) {                                   \
  |  |  526|      0|        if ((element)->handle == (id)) {                                  \
  |  |  ------------------
  |  |  |  Branch (526:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  527|      0|            break;                                                        \
  |  |  528|      0|        }                                                                 \
  |  |  529|      0|    }
  ------------------
 1279|      0|                           slot->sessObjHashSize);
 1280|      0|        }
 1281|  62.5k|        PZ_Unlock(slot->objectLock);
  ------------------
  |  |  246|  62.5k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1282|  62.5k|    } while (duplicateObject != NULL);
  ------------------
  |  Branch (1282:14): [True: 0, False: 62.5k]
  ------------------
 1283|  62.5k|    return handle;
 1284|  62.5k|}
sftk_AddSlotObject:
 1292|  62.0k|{
 1293|  62.0k|    PRUint32 index = sftk_hash(object->handle, slot->sessObjHashSize);
  ------------------
  |  |  513|  62.0k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  ------------------
  |  |  |  |  509|  62.0k|#define SHMULTIPLIER 1791398085
  |  |  ------------------
  ------------------
 1294|  62.0k|    sftkqueue_init_element(object);
  ------------------
  |  |  544|  62.0k|    (element)->prev = NULL;
  ------------------
 1295|  62.0k|    PZ_Lock(slot->objectLock);
  ------------------
  |  |  245|  62.0k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1296|  62.0k|    sftkqueue_add2(object, object->handle, index, slot->sessObjHashTable);
  ------------------
  |  |  547|  62.0k|    {                                            \
  |  |  548|  62.0k|        (element)->next = (head)[index];         \
  |  |  549|  62.0k|        if ((head)[index])                       \
  |  |  ------------------
  |  |  |  Branch (549:13): [True: 1.37k, False: 60.6k]
  |  |  ------------------
  |  |  550|  62.0k|            (head)[index]->prev = (element);     \
  |  |  551|  62.0k|        (head)[index] = (element);               \
  |  |  552|  62.0k|    }
  ------------------
 1297|  62.0k|    PZ_Unlock(slot->objectLock);
  ------------------
  |  |  246|  62.0k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1298|  62.0k|}
sftk_AddObject:
 1302|  62.0k|{
 1303|  62.0k|    SFTKSlot *slot = sftk_SlotFromSession(session);
  ------------------
  |  |  503|  62.0k|#define sftk_SlotFromSession(sp) ((sp)->slot)
  ------------------
 1304|  62.0k|    SFTKSessionObject *so = sftk_narrowToSessionObject(object);
 1305|       |
 1306|  62.0k|    if (so) {
  ------------------
  |  Branch (1306:9): [True: 62.0k, False: 0]
  ------------------
 1307|  62.0k|        PZ_Lock(session->objectLock);
  ------------------
  |  |  245|  62.0k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1308|  62.0k|        sftkqueue_add(&so->sessionList, 0, session->objects, 0);
  ------------------
  |  |  515|  62.0k|    {                                               \
  |  |  516|  62.0k|        int tmp = sftk_hash(id, hash_size);         \
  |  |  ------------------
  |  |  |  |  513|  62.0k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  62.0k|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|  62.0k|        (element)->next = (head)[tmp];              \
  |  |  518|  62.0k|        (element)->prev = NULL;                     \
  |  |  519|  62.0k|        if ((head)[tmp])                            \
  |  |  ------------------
  |  |  |  Branch (519:13): [True: 17.2k, False: 44.7k]
  |  |  ------------------
  |  |  520|  62.0k|            (head)[tmp]->prev = (element);          \
  |  |  521|  62.0k|        (head)[tmp] = (element);                    \
  |  |  522|  62.0k|    }
  ------------------
 1309|  62.0k|        so->session = session;
 1310|  62.0k|        PZ_Unlock(session->objectLock);
  ------------------
  |  |  246|  62.0k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1311|  62.0k|    }
 1312|  62.0k|    sftk_AddSlotObject(slot, object);
 1313|  62.0k|    sftk_ReferenceObject(object);
 1314|  62.0k|}
sftk_DeleteObject:
 1321|  62.0k|{
 1322|  62.0k|    SFTKSlot *slot = sftk_SlotFromSession(session);
  ------------------
  |  |  503|  62.0k|#define sftk_SlotFromSession(sp) ((sp)->slot)
  ------------------
 1323|  62.0k|    SFTKSessionObject *so = sftk_narrowToSessionObject(object);
 1324|  62.0k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  62.0k|#define CKR_OK 0x00000000UL
  ------------------
 1325|  62.0k|    PRUint32 index = sftk_hash(object->handle, slot->sessObjHashSize);
  ------------------
  |  |  513|  62.0k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  ------------------
  |  |  |  |  509|  62.0k|#define SHMULTIPLIER 1791398085
  |  |  ------------------
  ------------------
 1326|       |
 1327|       |    /* Handle Token case */
 1328|  62.0k|    if (so && so->session) {
  ------------------
  |  Branch (1328:9): [True: 62.0k, False: 0]
  |  Branch (1328:15): [True: 62.0k, False: 0]
  ------------------
 1329|  62.0k|        session = so->session;
 1330|  62.0k|        PZ_Lock(session->objectLock);
  ------------------
  |  |  245|  62.0k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1331|  62.0k|        sftkqueue_delete(&so->sessionList, 0, session->objects, 0);
  ------------------
  |  |  534|  62.0k|    if ((element)->next)                                      \
  |  |  ------------------
  |  |  |  Branch (534:9): [True: 6.90k, False: 55.1k]
  |  |  ------------------
  |  |  535|  62.0k|        (element)->next->prev = (element)->prev;              \
  |  |  536|  62.0k|    if ((element)->prev)                                      \
  |  |  ------------------
  |  |  |  Branch (536:9): [True: 12.3k, False: 49.6k]
  |  |  ------------------
  |  |  537|  62.0k|        (element)->prev->next = (element)->next;              \
  |  |  538|  62.0k|    else                                                      \
  |  |  539|  62.0k|        (head)[sftk_hash(id, hash_size)] = ((element)->next); \
  |  |  ------------------
  |  |  |  |  513|  49.6k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  49.6k|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  540|  62.0k|    (element)->next = NULL;                                   \
  |  |  541|  62.0k|    (element)->prev = NULL;
  ------------------
 1332|  62.0k|        PZ_Unlock(session->objectLock);
  ------------------
  |  |  246|  62.0k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1333|  62.0k|        PZ_Lock(slot->objectLock);
  ------------------
  |  |  245|  62.0k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1334|  62.0k|        sftkqueue_delete2(object, object->handle, index, slot->sessObjHashTable);
  ------------------
  |  |  564|  62.0k|    if ((element)->next)                            \
  |  |  ------------------
  |  |  |  Branch (564:9): [True: 1.37k, False: 60.6k]
  |  |  ------------------
  |  |  565|  62.0k|        (element)->next->prev = (element)->prev;    \
  |  |  566|  62.0k|    if ((element)->prev)                            \
  |  |  ------------------
  |  |  |  Branch (566:9): [True: 0, False: 62.0k]
  |  |  ------------------
  |  |  567|  62.0k|        (element)->prev->next = (element)->next;    \
  |  |  568|  62.0k|    else                                            \
  |  |  569|  62.0k|        (head)[index] = ((element)->next);
  ------------------
 1335|  62.0k|        PZ_Unlock(slot->objectLock);
  ------------------
  |  |  246|  62.0k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1336|  62.0k|        sftkqueue_clear_deleted_element(object);
  ------------------
  |  |  572|  62.0k|    (element)->next = NULL;                      \
  |  |  573|  62.0k|    (element)->prev = NULL;
  ------------------
 1337|  62.0k|        sftk_FreeObject(object); /* free the reference owned by the queue */
 1338|  62.0k|    } else {
 1339|      0|        SFTKDBHandle *handle = sftk_getDBForTokenObject(slot, object->handle);
 1340|      0|#ifdef DEBUG
 1341|      0|        SFTKTokenObject *to = sftk_narrowToTokenObject(object);
 1342|      0|        PORT_Assert(to);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1343|      0|#endif
 1344|      0|        crv = sftkdb_DestroyObject(handle, object->handle, object->objclass);
 1345|      0|        sftk_freeDB(handle);
 1346|      0|    }
 1347|  62.0k|    return crv;
 1348|  62.0k|}
sftk_CopyObject:
 1685|  6.29k|{
 1686|  6.29k|    SFTKAttribute *attribute;
 1687|  6.29k|    SFTKSessionObject *src_so = sftk_narrowToSessionObject(srcObject);
 1688|  6.29k|    unsigned int i;
 1689|       |
 1690|  6.29k|    destObject->isFIPS = srcObject->isFIPS;
 1691|  6.29k|    if (src_so == NULL) {
  ------------------
  |  Branch (1691:9): [True: 0, False: 6.29k]
  ------------------
 1692|      0|        return sftk_CopyTokenObject(destObject, srcObject);
 1693|      0|    }
 1694|       |
 1695|  6.29k|    PZ_Lock(src_so->attributeLock);
  ------------------
  |  |  245|  6.29k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1696|   207k|    for (i = 0; i < src_so->hashSize; i++) {
  ------------------
  |  Branch (1696:17): [True: 201k, False: 6.29k]
  ------------------
 1697|   201k|        attribute = src_so->head[i];
 1698|   207k|        do {
 1699|   207k|            if (attribute) {
  ------------------
  |  Branch (1699:17): [True: 37.0k, False: 170k]
  ------------------
 1700|  37.0k|                if (!sftk_hasAttribute(destObject, attribute->handle)) {
  ------------------
  |  Branch (1700:21): [True: 37.0k, False: 0]
  ------------------
 1701|       |                    /* we need to copy the attribute since each attribute
 1702|       |                     * only has one set of link list pointers */
 1703|  37.0k|                    SFTKAttribute *newAttribute = sftk_NewAttribute(
 1704|  37.0k|                        destObject, sftk_attr_expand(&attribute->attrib));
  ------------------
  |  |  587|  37.0k|#define sftk_attr_expand(ap) (ap)->type, (ap)->pValue, (ap)->ulValueLen
  ------------------
 1705|  37.0k|                    if (newAttribute == NULL) {
  ------------------
  |  Branch (1705:25): [True: 0, False: 37.0k]
  ------------------
 1706|      0|                        PZ_Unlock(src_so->attributeLock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1707|      0|                        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1708|      0|                    }
 1709|  37.0k|                    sftk_AddAttribute(destObject, newAttribute);
 1710|  37.0k|                }
 1711|  37.0k|                attribute = attribute->next;
 1712|  37.0k|            }
 1713|   207k|        } while (attribute != NULL);
  ------------------
  |  Branch (1713:18): [True: 6.29k, False: 201k]
  ------------------
 1714|   201k|    }
 1715|  6.29k|    PZ_Unlock(src_so->attributeLock);
  ------------------
  |  |  246|  6.29k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1716|       |
 1717|  6.29k|    return CKR_OK;
  ------------------
  |  | 1388|  6.29k|#define CKR_OK 0x00000000UL
  ------------------
 1718|  6.29k|}
sftk_searchObjectList:
 1773|      2|{
 1774|      2|    unsigned int i;
 1775|      2|    SFTKObject *object;
 1776|      2|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|      2|#define CKR_OK 0x00000000UL
  ------------------
 1777|       |
 1778|      2|    PZ_Lock(lock);
  ------------------
  |  |  245|      2|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1779|     66|    for (i = 0; i < size; i++) {
  ------------------
  |  Branch (1779:17): [True: 64, False: 2]
  ------------------
 1780|     64|        for (object = head[i]; object != NULL; object = object->next) {
  ------------------
  |  Branch (1780:32): [True: 0, False: 64]
  ------------------
 1781|      0|            if (sftk_objectMatch(object, theTemplate, count)) {
  ------------------
  |  Branch (1781:17): [True: 0, False: 0]
  ------------------
 1782|       |                /* don't return objects that aren't yet visible */
 1783|      0|                if ((!isLoggedIn) && sftk_isTrue(object, CKA_PRIVATE))
  ------------------
  |  |  513|      0|#define CKA_PRIVATE 0x00000002UL
  ------------------
  |  Branch (1783:21): [True: 0, False: 0]
  |  Branch (1783:38): [True: 0, False: 0]
  ------------------
 1784|      0|                    continue;
 1785|      0|                sftk_addHandle(search, object->handle);
 1786|      0|            }
 1787|      0|        }
 1788|     64|    }
 1789|      2|    PZ_Unlock(lock);
  ------------------
  |  |  246|      2|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1790|      2|    return crv;
 1791|      2|}
sftk_FreeSearch:
 1821|  31.3k|{
 1822|  31.3k|    if (search->handles) {
  ------------------
  |  Branch (1822:9): [True: 31.3k, False: 0]
  ------------------
 1823|  31.3k|        PORT_Free(search->handles);
  ------------------
  |  |   60|  31.3k|#define PORT_Free PORT_Free_Util
  ------------------
 1824|  31.3k|    }
 1825|  31.3k|    PORT_Free(search);
  ------------------
  |  |   60|  31.3k|#define PORT_Free PORT_Free_Util
  ------------------
 1826|  31.3k|}
sftk_update_state:
 1836|   100k|{
 1837|   100k|    if (slot->isLoggedIn) {
  ------------------
  |  Branch (1837:9): [True: 0, False: 100k]
  ------------------
 1838|      0|        if (slot->ssoLoggedIn) {
  ------------------
  |  Branch (1838:13): [True: 0, False: 0]
  ------------------
 1839|      0|            session->info.state = CKS_RW_SO_FUNCTIONS;
  ------------------
  |  |  286|      0|#define CKS_RW_SO_FUNCTIONS 4
  ------------------
 1840|      0|        } else if (session->info.flags & CKF_RW_SESSION) {
  ------------------
  |  |  302|      0|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (1840:20): [True: 0, False: 0]
  ------------------
 1841|      0|            session->info.state = CKS_RW_USER_FUNCTIONS;
  ------------------
  |  |  285|      0|#define CKS_RW_USER_FUNCTIONS 3
  ------------------
 1842|      0|        } else {
 1843|      0|            session->info.state = CKS_RO_USER_FUNCTIONS;
  ------------------
  |  |  283|      0|#define CKS_RO_USER_FUNCTIONS 1
  ------------------
 1844|      0|        }
 1845|   100k|    } else {
 1846|   100k|        if (session->info.flags & CKF_RW_SESSION) {
  ------------------
  |  |  302|   100k|#define CKF_RW_SESSION 0x00000002UL     /* session is r/w */
  ------------------
  |  Branch (1846:13): [True: 0, False: 100k]
  ------------------
 1847|      0|            session->info.state = CKS_RW_PUBLIC_SESSION;
  ------------------
  |  |  284|      0|#define CKS_RW_PUBLIC_SESSION 2
  ------------------
 1848|   100k|        } else {
 1849|   100k|            session->info.state = CKS_RO_PUBLIC_SESSION;
  ------------------
  |  |  282|   100k|#define CKS_RO_PUBLIC_SESSION 0
  ------------------
 1850|   100k|        }
 1851|   100k|    }
 1852|   100k|}
sftk_FreeContext:
 1876|  52.5k|{
 1877|  52.5k|    if (context->cipherInfo) {
  ------------------
  |  Branch (1877:9): [True: 52.5k, False: 0]
  ------------------
 1878|  52.5k|        (*context->destroy)(context->cipherInfo, PR_TRUE);
  ------------------
  |  |  437|  52.5k|#define PR_TRUE 1
  ------------------
 1879|  52.5k|    }
 1880|  52.5k|    if (context->hashInfo) {
  ------------------
  |  Branch (1880:9): [True: 9.51k, False: 42.9k]
  ------------------
 1881|  9.51k|        (*context->hashdestroy)(context->hashInfo, PR_TRUE);
  ------------------
  |  |  437|  9.51k|#define PR_TRUE 1
  ------------------
 1882|  9.51k|    }
 1883|  52.5k|    if (context->key) {
  ------------------
  |  Branch (1883:9): [True: 16.8k, False: 35.6k]
  ------------------
 1884|  16.8k|        sftk_FreeObject(context->key);
 1885|  16.8k|        context->key = NULL;
 1886|  16.8k|    }
 1887|  52.5k|    PORT_Free(context);
  ------------------
  |  |   60|  52.5k|#define PORT_Free PORT_Free_Util
  ------------------
 1888|  52.5k|}
sftk_InitSession:
 1897|  50.4k|{
 1898|  50.4k|    session->next = session->prev = NULL;
 1899|  50.4k|    session->enc_context = NULL;
 1900|  50.4k|    session->hash_context = NULL;
 1901|  50.4k|    session->sign_context = NULL;
 1902|  50.4k|    session->search = NULL;
 1903|  50.4k|    session->objectIDCount = 1;
 1904|  50.4k|    session->objectLock = PZ_NewLock(nssILockObject);
  ------------------
  |  |  243|  50.4k|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 1905|  50.4k|    if (session->objectLock == NULL) {
  ------------------
  |  Branch (1905:9): [True: 0, False: 50.4k]
  ------------------
 1906|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1907|      0|    }
 1908|  50.4k|    session->objects[0] = NULL;
 1909|       |
 1910|  50.4k|    session->slot = slot;
 1911|  50.4k|    session->notify = notify;
 1912|  50.4k|    session->appData = pApplication;
 1913|  50.4k|    session->info.flags = flags;
 1914|  50.4k|    session->info.slotID = slotID;
 1915|  50.4k|    session->info.ulDeviceError = 0;
 1916|  50.4k|    sftk_update_state(slot, session);
 1917|       |    /* no ops completed yet, so the last one couldn't be a FIPS op */
 1918|  50.4k|    session->lastOpWasFIPS = PR_FALSE;
  ------------------
  |  |  438|  50.4k|#define PR_FALSE 0
  ------------------
 1919|  50.4k|    return CKR_OK;
  ------------------
  |  | 1388|  50.4k|#define CKR_OK 0x00000000UL
  ------------------
 1920|  50.4k|}
sftk_NewSession:
 1928|  50.4k|{
 1929|  50.4k|    SFTKSession *session;
 1930|  50.4k|    SFTKSlot *slot = sftk_SlotFromID(slotID, PR_FALSE);
  ------------------
  |  |  438|  50.4k|#define PR_FALSE 0
  ------------------
 1931|  50.4k|    CK_RV crv;
 1932|       |
 1933|  50.4k|    if (slot == NULL)
  ------------------
  |  Branch (1933:9): [True: 0, False: 50.4k]
  ------------------
 1934|      0|        return NULL;
 1935|       |
 1936|  50.4k|    session = (SFTKSession *)PORT_Alloc(sizeof(SFTKSession));
  ------------------
  |  |   52|  50.4k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1937|  50.4k|    if (session == NULL)
  ------------------
  |  Branch (1937:9): [True: 0, False: 50.4k]
  ------------------
 1938|      0|        return NULL;
 1939|       |
 1940|  50.4k|    crv = sftk_InitSession(session, slot, slotID, notify, pApplication, flags);
 1941|  50.4k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  50.4k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1941:9): [True: 0, False: 50.4k]
  ------------------
 1942|      0|        PORT_Free(session);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1943|      0|        return NULL;
 1944|      0|    }
 1945|  50.4k|    return session;
 1946|  50.4k|}
sftk_ClearSession:
 1951|  50.4k|{
 1952|  50.4k|    SFTKObjectList *op, *next;
 1953|       |
 1954|       |    /* clean out the attributes */
 1955|       |    /* since no one is referencing us, it's safe to walk the chain
 1956|       |     * without a lock */
 1957|  50.4k|    for (op = session->objects[0]; op != NULL; op = next) {
  ------------------
  |  Branch (1957:36): [True: 1, False: 50.4k]
  ------------------
 1958|      1|        next = op->next;
 1959|       |        /* paranoia */
 1960|      1|        op->next = op->prev = NULL;
 1961|      1|        sftk_DeleteObject(session, op->parent);
 1962|      1|    }
 1963|  50.4k|    PZ_DestroyLock(session->objectLock);
  ------------------
  |  |  244|  50.4k|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 1964|  50.4k|    if (session->enc_context) {
  ------------------
  |  Branch (1964:9): [True: 3.66k, False: 46.7k]
  ------------------
 1965|  3.66k|        sftk_FreeContext(session->enc_context);
 1966|  3.66k|    }
 1967|  50.4k|    if (session->hash_context) {
  ------------------
  |  Branch (1967:9): [True: 4.85k, False: 45.6k]
  ------------------
 1968|  4.85k|        sftk_FreeContext(session->hash_context);
 1969|  4.85k|    }
 1970|  50.4k|    if (session->sign_context) {
  ------------------
  |  Branch (1970:9): [True: 0, False: 50.4k]
  ------------------
 1971|      0|        sftk_FreeContext(session->sign_context);
 1972|      0|    }
 1973|  50.4k|    if (session->search) {
  ------------------
  |  Branch (1973:9): [True: 0, False: 50.4k]
  ------------------
 1974|      0|        sftk_FreeSearch(session->search);
 1975|      0|    }
 1976|  50.4k|}
sftk_DestroySession:
 1981|  50.4k|{
 1982|  50.4k|    sftk_ClearSession(session);
 1983|  50.4k|    PORT_Free(session);
  ------------------
  |  |   60|  50.4k|#define PORT_Free PORT_Free_Util
  ------------------
 1984|  50.4k|}
sftk_SessionFromHandle:
 1992|   513k|{
 1993|   513k|    SFTKSlot *slot = sftk_SlotFromSessionHandle(handle);
 1994|   513k|    SFTKSession *session;
 1995|   513k|    PZLock *lock;
  ------------------
  |  |  185|   513k|#define PZLock PRLock
  ------------------
 1996|       |
 1997|   513k|    if (!slot)
  ------------------
  |  Branch (1997:9): [True: 0, False: 513k]
  ------------------
 1998|      0|        return NULL;
 1999|   513k|    lock = SFTK_SESSION_LOCK(slot, handle);
  ------------------
  |  |  583|   513k|    ((slot)->sessionLock[(handle) & (slot)->sessionLockMask])
  ------------------
 2000|       |
 2001|   513k|    PZ_Lock(lock);
  ------------------
  |  |  245|   513k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 2002|   513k|    sftkqueue_find(session, handle, slot->head, slot->sessHashSize);
  ------------------
  |  |  524|   525k|    for ((element) = (head)[sftk_hash(id, hash_size)]; (element) != NULL; \
  |  |  ------------------
  |  |  |  |  513|   513k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|   513k|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (524:56): [True: 525k, False: 0]
  |  |  ------------------
  |  |  525|   525k|         (element) = (element)->next) {                                   \
  |  |  526|   525k|        if ((element)->handle == (id)) {                                  \
  |  |  ------------------
  |  |  |  Branch (526:13): [True: 513k, False: 12.8k]
  |  |  ------------------
  |  |  527|   513k|            break;                                                        \
  |  |  528|   513k|        }                                                                 \
  |  |  529|   525k|    }
  ------------------
 2003|   513k|    PZ_Unlock(lock);
  ------------------
  |  |  246|   513k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 2004|       |
 2005|   513k|    return (session);
 2006|   513k|}
sftk_FreeSession:
 2015|   462k|{
 2016|   462k|    return;
 2017|   462k|}
sftk_narrowToSessionObject:
 2122|  5.33M|{
 2123|  5.33M|    return !sftk_isToken(obj->handle) ? (SFTKSessionObject *)obj : NULL;
  ------------------
  |  |  504|  5.33M|#define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  478|  5.33M|#define SFTK_TOKEN_MASK 0x80000000L
  |  |  ------------------
  |  |               #define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  479|  5.33M|#define SFTK_TOKEN_MAGIC 0x80000000L
  |  |  ------------------
  ------------------
  |  Branch (2123:12): [True: 5.33M, False: 0]
  ------------------
 2124|  5.33M|}
sftk_narrowToTokenObject:
 2128|  66.5k|{
 2129|  66.5k|    return sftk_isToken(obj->handle) ? (SFTKTokenObject *)obj : NULL;
  ------------------
  |  |  504|  66.5k|#define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  478|  66.5k|#define SFTK_TOKEN_MASK 0x80000000L
  |  |  ------------------
  |  |               #define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  479|  66.5k|#define SFTK_TOKEN_MAGIC 0x80000000L
  |  |  ------------------
  |  |  |  Branch (504:26): [True: 0, False: 66.5k]
  |  |  ------------------
  ------------------
 2130|  66.5k|}
sftk_AttributeToFlags:
 2207|  4.84k|{
 2208|  4.84k|    CK_FLAGS flags = 0;
 2209|       |
 2210|  4.84k|    switch (op) {
 2211|  1.20k|        case CKA_ENCRYPT:
  ------------------
  |  |  547|  1.20k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
  |  Branch (2211:9): [True: 1.20k, False: 3.64k]
  ------------------
 2212|  1.20k|            flags = CKF_ENCRYPT;
  ------------------
  |  | 1353|  1.20k|#define CKF_ENCRYPT 0x00000100UL
  ------------------
 2213|  1.20k|            break;
 2214|  1.20k|        case CKA_DECRYPT:
  ------------------
  |  |  548|  1.20k|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (2214:9): [True: 1.20k, False: 3.64k]
  ------------------
 2215|  1.20k|            flags = CKF_DECRYPT;
  ------------------
  |  | 1354|  1.20k|#define CKF_DECRYPT 0x00000200UL
  ------------------
 2216|  1.20k|            break;
 2217|  1.17k|        case CKA_WRAP:
  ------------------
  |  |  549|  1.17k|#define CKA_WRAP 0x00000106UL
  ------------------
  |  Branch (2217:9): [True: 1.17k, False: 3.66k]
  ------------------
 2218|  1.17k|            flags = CKF_WRAP;
  ------------------
  |  | 1362|  1.17k|#define CKF_WRAP 0x00020000UL
  ------------------
 2219|  1.17k|            break;
 2220|      0|        case CKA_UNWRAP:
  ------------------
  |  |  550|      0|#define CKA_UNWRAP 0x00000107UL
  ------------------
  |  Branch (2220:9): [True: 0, False: 4.84k]
  ------------------
 2221|      0|            flags = CKF_UNWRAP;
  ------------------
  |  | 1363|      0|#define CKF_UNWRAP 0x00040000UL
  ------------------
 2222|      0|            break;
 2223|      0|        case CKA_SIGN:
  ------------------
  |  |  551|      0|#define CKA_SIGN 0x00000108UL
  ------------------
  |  Branch (2223:9): [True: 0, False: 4.84k]
  ------------------
 2224|      0|            flags = CKF_SIGN;
  ------------------
  |  | 1356|      0|#define CKF_SIGN 0x00000800UL
  ------------------
 2225|      0|            break;
 2226|      0|        case CKA_SIGN_RECOVER:
  ------------------
  |  |  552|      0|#define CKA_SIGN_RECOVER 0x00000109UL
  ------------------
  |  Branch (2226:9): [True: 0, False: 4.84k]
  ------------------
 2227|      0|            flags = CKF_SIGN_RECOVER;
  ------------------
  |  | 1357|      0|#define CKF_SIGN_RECOVER 0x00001000UL
  ------------------
 2228|      0|            break;
 2229|      0|        case CKA_VERIFY:
  ------------------
  |  |  553|      0|#define CKA_VERIFY 0x0000010AUL
  ------------------
  |  Branch (2229:9): [True: 0, False: 4.84k]
  ------------------
 2230|      0|            flags = CKF_VERIFY;
  ------------------
  |  | 1358|      0|#define CKF_VERIFY 0x00002000
  ------------------
 2231|      0|            break;
 2232|      0|        case CKA_VERIFY_RECOVER:
  ------------------
  |  |  554|      0|#define CKA_VERIFY_RECOVER 0x0000010BUL
  ------------------
  |  Branch (2232:9): [True: 0, False: 4.84k]
  ------------------
 2233|      0|            flags = CKF_VERIFY_RECOVER;
  ------------------
  |  | 1359|      0|#define CKF_VERIFY_RECOVER 0x00004000UL
  ------------------
 2234|      0|            break;
 2235|      0|        case CKA_DERIVE:
  ------------------
  |  |  555|      0|#define CKA_DERIVE 0x0000010CUL
  ------------------
  |  Branch (2235:9): [True: 0, False: 4.84k]
  ------------------
 2236|      0|            flags = CKF_DERIVE;
  ------------------
  |  | 1364|      0|#define CKF_DERIVE 0x00080000UL
  ------------------
 2237|      0|            break;
 2238|       |        /* fake attribute to select digesting */
 2239|      0|        case CKA_DIGEST:
  ------------------
  |  |   68|      0|#define CKA_DIGEST 0x81000000L
  ------------------
  |  Branch (2239:9): [True: 0, False: 4.84k]
  ------------------
 2240|      0|            flags = CKF_DIGEST;
  ------------------
  |  | 1355|      0|#define CKF_DIGEST 0x00000400UL
  ------------------
 2241|      0|            break;
 2242|    236|        case CKA_NSS_MESSAGE | CKA_ENCRYPT:
  ------------------
  |  |   69|    236|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_ENCRYPT:
  ------------------
  |  |  547|    236|#define CKA_ENCRYPT 0x00000104UL
  ------------------
  |  Branch (2242:9): [True: 236, False: 4.61k]
  ------------------
 2243|    236|            flags = CKF_MESSAGE_ENCRYPT;
  ------------------
  |  | 1339|    236|#define CKF_MESSAGE_ENCRYPT 0x00000002UL
  ------------------
 2244|    236|            break;
 2245|  1.03k|        case CKA_NSS_MESSAGE | CKA_DECRYPT:
  ------------------
  |  |   69|  1.03k|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_DECRYPT:
  ------------------
  |  |  548|  1.03k|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (2245:9): [True: 1.03k, False: 3.81k]
  ------------------
 2246|  1.03k|            flags = CKF_MESSAGE_DECRYPT;
  ------------------
  |  | 1340|  1.03k|#define CKF_MESSAGE_DECRYPT 0x00000004UL
  ------------------
 2247|  1.03k|            break;
 2248|      0|        case CKA_NSS_MESSAGE | CKA_SIGN:
  ------------------
  |  |   69|      0|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_SIGN:
  ------------------
  |  |  551|      0|#define CKA_SIGN 0x00000108UL
  ------------------
  |  Branch (2248:9): [True: 0, False: 4.84k]
  ------------------
 2249|      0|            flags = CKF_MESSAGE_SIGN;
  ------------------
  |  | 1341|      0|#define CKF_MESSAGE_SIGN 0x00000008UL
  ------------------
 2250|      0|            break;
 2251|      0|        case CKA_NSS_MESSAGE | CKA_VERIFY:
  ------------------
  |  |   69|      0|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                      case CKA_NSS_MESSAGE | CKA_VERIFY:
  ------------------
  |  |  553|      0|#define CKA_VERIFY 0x0000010AUL
  ------------------
  |  Branch (2251:9): [True: 0, False: 4.84k]
  ------------------
 2252|      0|            flags = CKF_MESSAGE_VERIFY;
  ------------------
  |  | 1342|      0|#define CKF_MESSAGE_VERIFY 0x00000010UL
  ------------------
 2253|      0|            break;
 2254|      0|        default:
  ------------------
  |  Branch (2254:9): [True: 0, False: 4.84k]
  ------------------
 2255|      0|            break;
 2256|  4.84k|    }
 2257|  4.84k|    return flags;
 2258|  4.84k|}
sftk_GetHashTypeFromMechanism:
 2269|  29.5k|{
 2270|  29.5k|    switch (mech) {
 2271|      0|        case CKM_SHA_1:
  ------------------
  |  |  859|      0|#define CKM_SHA_1 0x00000220UL
  ------------------
  |  Branch (2271:9): [True: 0, False: 29.5k]
  ------------------
 2272|      0|        case CKG_MGF1_SHA1:
  ------------------
  |  | 1648|      0|#define CKG_MGF1_SHA1 0x00000001UL
  ------------------
  |  Branch (2272:9): [True: 0, False: 29.5k]
  ------------------
 2273|      0|            return HASH_AlgSHA1;
 2274|      0|        case CKM_SHA224:
  ------------------
  |  |  887|      0|#define CKM_SHA224 0x00000255UL
  ------------------
  |  Branch (2274:9): [True: 0, False: 29.5k]
  ------------------
 2275|      0|        case CKG_MGF1_SHA224:
  ------------------
  |  | 1654|      0|#define CKG_MGF1_SHA224 0x00000005UL
  ------------------
  |  Branch (2275:9): [True: 0, False: 29.5k]
  ------------------
 2276|      0|            return HASH_AlgSHA224;
 2277|  17.1k|        case CKM_SHA256:
  ------------------
  |  |  876|  17.1k|#define CKM_SHA256 0x00000250UL
  ------------------
  |  Branch (2277:9): [True: 17.1k, False: 12.3k]
  ------------------
 2278|  18.6k|        case CKG_MGF1_SHA256:
  ------------------
  |  | 1649|  18.6k|#define CKG_MGF1_SHA256 0x00000002UL
  ------------------
  |  Branch (2278:9): [True: 1.48k, False: 28.0k]
  ------------------
 2279|  18.6k|            return HASH_AlgSHA256;
 2280|  10.4k|        case CKM_SHA384:
  ------------------
  |  |  879|  10.4k|#define CKM_SHA384 0x00000260UL
  ------------------
  |  Branch (2280:9): [True: 10.4k, False: 19.0k]
  ------------------
 2281|  10.6k|        case CKG_MGF1_SHA384:
  ------------------
  |  | 1650|  10.6k|#define CKG_MGF1_SHA384 0x00000003UL
  ------------------
  |  Branch (2281:9): [True: 218, False: 29.2k]
  ------------------
 2282|  10.6k|            return HASH_AlgSHA384;
 2283|    120|        case CKM_SHA512:
  ------------------
  |  |  882|    120|#define CKM_SHA512 0x00000270UL
  ------------------
  |  Branch (2283:9): [True: 120, False: 29.3k]
  ------------------
 2284|    240|        case CKG_MGF1_SHA512:
  ------------------
  |  | 1651|    240|#define CKG_MGF1_SHA512 0x00000004UL
  ------------------
  |  Branch (2284:9): [True: 120, False: 29.3k]
  ------------------
 2285|    240|            return HASH_AlgSHA512;
 2286|      0|        default:
  ------------------
  |  Branch (2286:9): [True: 0, False: 29.5k]
  ------------------
 2287|      0|            return HASH_AlgNULL;
 2288|  29.5k|    }
 2289|  29.5k|}
sftk_operationIsFIPS:
 2475|  78.6k|{
 2476|  78.6k|#ifndef NSS_HAS_FIPS_INDICATORS
 2477|  78.6k|    return PR_FALSE;
  ------------------
  |  |  438|  78.6k|#define PR_FALSE 0
  ------------------
 2478|       |#else
 2479|       |    int i;
 2480|       |    CK_FLAGS opFlags;
 2481|       |    CK_ULONG keyLength;
 2482|       |
 2483|       |    /* handle all the quick stuff first */
 2484|       |    if (!sftk_isFIPS(slot->slotID)) {
 2485|       |        return PR_FALSE;
 2486|       |    }
 2487|       |    if (source && !source->isFIPS) {
 2488|       |        return PR_FALSE;
 2489|       |    }
 2490|       |    if (mech == NULL) {
 2491|       |        return PR_FALSE;
 2492|       |    }
 2493|       |
 2494|       |    /* now get the calculated values */
 2495|       |    opFlags = sftk_AttributeToFlags(op);
 2496|       |    if (opFlags == 0) {
 2497|       |        return PR_FALSE;
 2498|       |    }
 2499|       |    keyLength = sftk_getKeyLength(source);
 2500|       |
 2501|       |    /* check against our algorithm array */
 2502|       |    for (i = 0; i < SFTK_NUMBER_FIPS_ALGORITHMS; i++) {
 2503|       |        SFTKFIPSAlgorithmList *mechs = &sftk_fips_mechs[i];
 2504|       |        /* if we match the number of records exactly, then we are an
 2505|       |         * approved algorithm in the approved mode with an approved key */
 2506|       |        if (((mech->mechanism == mechs->type) &&
 2507|       |             (opFlags == (mechs->info.flags & opFlags)) &&
 2508|       |             (keyLength <= mechs->info.ulMaxKeySize) &&
 2509|       |             (keyLength >= mechs->info.ulMinKeySize) &&
 2510|       |             ((keyLength - mechs->info.ulMinKeySize) % mechs->step) == 0) &&
 2511|       |            ((mechs->special == SFTKFIPSNone) ||
 2512|       |             sftk_handleSpecial(slot, mech, mechs, source))) {
 2513|       |            return PR_TRUE;
 2514|       |        }
 2515|       |    }
 2516|       |    return PR_FALSE;
 2517|       |#endif
 2518|  78.6k|}
pkcs11u.c:sftk_NewAttribute:
  114|  1.34M|{
  115|  1.34M|    SFTKAttribute *attribute;
  116|       |
  117|  1.34M|    SFTKSessionObject *so = sftk_narrowToSessionObject(object);
  118|  1.34M|    int index;
  119|       |
  120|  1.34M|    if (so == NULL) {
  ------------------
  |  Branch (120:9): [True: 0, False: 1.34M]
  ------------------
  121|       |        /* allocate new attribute in a buffer */
  122|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  123|      0|        return NULL;
  124|      0|    }
  125|       |    /*
  126|       |     * We attempt to keep down contention on Malloc and Arena locks by
  127|       |     * limiting the number of these calls on high traversed paths. This
  128|       |     * is done for attributes by 'allocating' them from a pool already
  129|       |     * allocated by the parent object.
  130|       |     */
  131|  1.34M|    PZ_Lock(so->attributeLock);
  ------------------
  |  |  245|  1.34M|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  132|  1.34M|    index = so->nextAttr++;
  133|  1.34M|    PZ_Unlock(so->attributeLock);
  ------------------
  |  |  246|  1.34M|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  134|  1.34M|    PORT_Assert(index < MAX_OBJS_ATTRS);
  ------------------
  |  |  120|  1.34M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.34M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.34M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  135|  1.34M|    if (index >= MAX_OBJS_ATTRS)
  ------------------
  |  |   37|  1.34M|#define MAX_OBJS_ATTRS 45 /* number of attributes to preallocate in \
  ------------------
  |  Branch (135:9): [True: 0, False: 1.34M]
  ------------------
  136|      0|        return NULL;
  137|       |
  138|  1.34M|    attribute = &so->attrList[index];
  139|  1.34M|    attribute->attrib.type = type;
  140|  1.34M|    attribute->freeAttr = PR_FALSE;
  ------------------
  |  |  438|  1.34M|#define PR_FALSE 0
  ------------------
  141|  1.34M|    attribute->freeData = PR_FALSE;
  ------------------
  |  |  438|  1.34M|#define PR_FALSE 0
  ------------------
  142|  1.34M|    if (value) {
  ------------------
  |  Branch (142:9): [True: 1.06M, False: 270k]
  ------------------
  143|  1.06M|        if (len <= ATTR_SPACE) {
  ------------------
  |  |   39|  1.06M|#define ATTR_SPACE 50     /* Maximum size of attribute data before extra \
  ------------------
  |  Branch (143:13): [True: 1.05M, False: 16.7k]
  ------------------
  144|  1.05M|            attribute->attrib.pValue = attribute->space;
  145|  1.05M|        } else {
  146|  16.7k|            attribute->attrib.pValue = PORT_Alloc(len);
  ------------------
  |  |   52|  16.7k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  147|  16.7k|            attribute->freeData = PR_TRUE;
  ------------------
  |  |  437|  16.7k|#define PR_TRUE 1
  ------------------
  148|  16.7k|        }
  149|  1.06M|        if (attribute->attrib.pValue == NULL) {
  ------------------
  |  Branch (149:13): [True: 0, False: 1.06M]
  ------------------
  150|      0|            return NULL;
  151|      0|        }
  152|  1.06M|        PORT_Memcpy(attribute->attrib.pValue, value, len);
  ------------------
  |  |  180|  1.06M|#define PORT_Memcpy memcpy
  ------------------
  153|  1.06M|        attribute->attrib.ulValueLen = len;
  154|  1.06M|    } else {
  155|   270k|        attribute->attrib.pValue = NULL;
  156|   270k|        attribute->attrib.ulValueLen = 0;
  157|   270k|    }
  158|  1.34M|    attribute->attrib.type = type;
  159|  1.34M|    attribute->handle = type;
  160|  1.34M|    attribute->next = attribute->prev = NULL;
  161|  1.34M|    return attribute;
  162|  1.34M|}
pkcs11u.c:sftk_AddAttribute:
  387|  1.34M|{
  388|  1.34M|    SFTKSessionObject *sessObject = sftk_narrowToSessionObject(object);
  389|       |
  390|  1.34M|    if (sessObject == NULL)
  ------------------
  |  Branch (390:9): [True: 0, False: 1.34M]
  ------------------
  391|      0|        return;
  392|  1.34M|    PZ_Lock(sessObject->attributeLock);
  ------------------
  |  |  245|  1.34M|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  393|  1.34M|    sftkqueue_add(attribute, attribute->handle,
  ------------------
  |  |  515|  1.34M|    {                                               \
  |  |  516|  1.34M|        int tmp = sftk_hash(id, hash_size);         \
  |  |  ------------------
  |  |  |  |  513|  1.34M|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  |  |  ------------------
  |  |  |  |  |  |  509|  1.34M|#define SHMULTIPLIER 1791398085
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  517|  1.34M|        (element)->next = (head)[tmp];              \
  |  |  518|  1.34M|        (element)->prev = NULL;                     \
  |  |  519|  1.34M|        if ((head)[tmp])                            \
  |  |  ------------------
  |  |  |  Branch (519:13): [True: 574k, False: 765k]
  |  |  ------------------
  |  |  520|  1.34M|            (head)[tmp]->prev = (element);          \
  |  |  521|  1.34M|        (head)[tmp] = (element);                    \
  |  |  522|  1.34M|    }
  ------------------
  394|  1.34M|                  sessObject->head, sessObject->hashSize);
  395|  1.34M|    PZ_Unlock(sessObject->attributeLock);
  ------------------
  |  |  246|  1.34M|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  396|  1.34M|}
pkcs11u.c:sftk_tokenKeyLock:
  917|      2|{
  918|      2|    SKIP_AFTER_FORK(PZ_Lock(slot->objectLock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
  919|      2|}
pkcs11u.c:sftk_tokenKeyUnlock:
  923|      2|{
  924|      2|    SKIP_AFTER_FORK(PZ_Unlock(slot->objectLock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
  925|      2|}
pkcs11u.c:sftk_InitFreeList:
 1031|      2|{
 1032|      2|    if (!list->lock) {
  ------------------
  |  Branch (1032:9): [True: 2, False: 0]
  ------------------
 1033|      2|        list->lock = PZ_NewLock(nssILockObject);
  ------------------
  |  |  243|      2|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 1034|      2|    }
 1035|      2|}
pkcs11u.c:sftk_CleanupFreeList:
 1046|      2|{
 1047|      2|    SFTKObject *object;
 1048|       |
 1049|      2|    if (!list->lock) {
  ------------------
  |  Branch (1049:9): [True: 0, False: 2]
  ------------------
 1050|      0|        return;
 1051|      0|    }
 1052|      2|    SKIP_AFTER_FORK(PZ_Lock(list->lock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
 1053|      2|    for (object = list->head; object != NULL;
  ------------------
  |  Branch (1053:31): [True: 0, False: 2]
  ------------------
 1054|      2|         object = sftk_freeObjectData(object)) {
 1055|      0|        PZ_DestroyLock(object->refLock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 1056|      0|        if (isSessionList) {
  ------------------
  |  Branch (1056:13): [True: 0, False: 0]
  ------------------
 1057|      0|            PZ_DestroyLock(((SFTKSessionObject *)object)->attributeLock);
  ------------------
  |  |  244|      0|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 1058|      0|        }
 1059|      0|    }
 1060|      2|    list->count = 0;
 1061|      2|    list->head = NULL;
 1062|      2|    SKIP_AFTER_FORK(PZ_Unlock(list->lock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
 1063|      2|    SKIP_AFTER_FORK(PZ_DestroyLock(list->lock));
  ------------------
  |  |  256|      2|#define SKIP_AFTER_FORK(x) x
  ------------------
 1064|      2|    list->lock = NULL;
 1065|      2|}
pkcs11u.c:sftk_ObjectFromHandleOnSlot:
 1201|   179k|{
 1202|   179k|    SFTKObject *object;
 1203|   179k|    PRUint32 index = sftk_hash(handle, slot->sessObjHashSize);
  ------------------
  |  |  513|   179k|    ((PRUint32)((value)*SHMULTIPLIER) & (size - 1))
  |  |  ------------------
  |  |  |  |  509|   179k|#define SHMULTIPLIER 1791398085
  |  |  ------------------
  ------------------
 1204|       |
 1205|   179k|    if (sftk_isToken(handle)) {
  ------------------
  |  |  504|   179k|#define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  478|   179k|#define SFTK_TOKEN_MASK 0x80000000L
  |  |  ------------------
  |  |               #define sftk_isToken(id) (((id)&SFTK_TOKEN_MASK) == SFTK_TOKEN_MAGIC)
  |  |  ------------------
  |  |  |  |  479|   179k|#define SFTK_TOKEN_MAGIC 0x80000000L
  |  |  ------------------
  |  |  |  Branch (504:26): [True: 0, False: 179k]
  |  |  ------------------
  ------------------
 1206|      0|        return sftk_NewTokenObject(slot, NULL, handle);
 1207|      0|    }
 1208|       |
 1209|   179k|    PZ_Lock(slot->objectLock);
  ------------------
  |  |  245|   179k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 1210|   179k|    sftkqueue_find2(object, handle, index, slot->sessObjHashTable);
  ------------------
  |  |  555|   179k|    for ((element) = (head)[index];               \
  |  |  556|   179k|         (element) != NULL;                       \
  |  |  ------------------
  |  |  |  Branch (556:10): [True: 179k, False: 0]
  |  |  ------------------
  |  |  557|   179k|         (element) = (element)->next) {           \
  |  |  558|   179k|        if ((element)->handle == (id)) {          \
  |  |  ------------------
  |  |  |  Branch (558:13): [True: 179k, False: 19]
  |  |  ------------------
  |  |  559|   179k|            break;                                \
  |  |  560|   179k|        }                                         \
  |  |  561|   179k|    }
  ------------------
 1211|   179k|    if (object) {
  ------------------
  |  Branch (1211:9): [True: 179k, False: 0]
  ------------------
 1212|   179k|        sftk_ReferenceObject(object);
 1213|   179k|    }
 1214|   179k|    PZ_Unlock(slot->objectLock);
  ------------------
  |  |  246|   179k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1215|       |
 1216|   179k|    return (object);
 1217|   179k|}
pkcs11u.c:sftk_DestroyObject:
 1160|  64.6k|{
 1161|  64.6k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  64.6k|#define CKR_OK 0x00000000UL
  ------------------
 1162|  64.6k|    SFTKSessionObject *so = sftk_narrowToSessionObject(object);
 1163|  64.6k|    SFTKTokenObject *to = sftk_narrowToTokenObject(object);
 1164|       |
 1165|  64.6k|    PORT_Assert(object->refCount == 0);
  ------------------
  |  |  120|  64.6k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  64.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 64.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1166|       |
 1167|       |    /* delete the database value */
 1168|  64.6k|    if (to) {
  ------------------
  |  Branch (1168:9): [True: 0, False: 64.6k]
  ------------------
 1169|      0|        if (to->dbKey.data) {
  ------------------
  |  Branch (1169:13): [True: 0, False: 0]
  ------------------
 1170|      0|            PORT_Free(to->dbKey.data);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1171|      0|            to->dbKey.data = NULL;
 1172|      0|        }
 1173|      0|    }
 1174|  64.6k|    if (so) {
  ------------------
  |  Branch (1174:9): [True: 64.6k, False: 0]
  ------------------
 1175|  64.6k|        sftk_DestroySessionObjectData(so);
 1176|  64.6k|    }
 1177|  64.6k|    if (object->objectInfo) {
  ------------------
  |  Branch (1177:9): [True: 23.3k, False: 41.2k]
  ------------------
 1178|  23.3k|        (*object->infoFree)(object->objectInfo);
 1179|  23.3k|        object->objectInfo = NULL;
 1180|  23.3k|        object->infoFree = NULL;
 1181|  23.3k|    }
 1182|  64.6k|    if (so) {
  ------------------
  |  Branch (1182:9): [True: 64.6k, False: 0]
  ------------------
 1183|  64.6k|        sftk_PutObjectToList(object, &sessionObjectList, PR_TRUE);
  ------------------
  |  |  437|  64.6k|#define PR_TRUE 1
  ------------------
 1184|  64.6k|    } else {
 1185|      0|        sftk_PutObjectToList(object, &tokenObjectList, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1186|      0|    }
 1187|  64.6k|    return crv;
 1188|  64.6k|}
pkcs11u.c:sftk_PutObjectToList:
  989|  64.6k|{
  990|       |
  991|       |    /* the code below is equivalent to :
  992|       |     *     optimizeSpace = isSessionObject ? object->optimizeSpace : PR_FALSE;
  993|       |     * just faster.
  994|       |     */
  995|  64.6k|    PRBool optimizeSpace = isSessionObject &&
  ------------------
  |  Branch (995:28): [True: 64.6k, False: 0]
  ------------------
  996|  64.6k|                           ((SFTKSessionObject *)object)->optimizeSpace;
  ------------------
  |  Branch (996:28): [True: 64.6k, False: 0]
  ------------------
  997|  64.6k|    if (object->refLock && !optimizeSpace) {
  ------------------
  |  Branch (997:9): [True: 64.6k, False: 0]
  |  Branch (997:28): [True: 0, False: 64.6k]
  ------------------
  998|      0|        PZ_Lock(list->lock);
  ------------------
  |  |  245|      0|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  999|      0|        if (list->count < MAX_OBJECT_LIST_SIZE) {
  ------------------
  |  |   71|      0|#define MAX_OBJECT_LIST_SIZE 800
  ------------------
  |  Branch (999:13): [True: 0, False: 0]
  ------------------
 1000|      0|            object->next = list->head;
 1001|      0|            list->head = object;
 1002|      0|            list->count++;
 1003|      0|            PZ_Unlock(list->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1004|      0|            return;
 1005|      0|        }
 1006|      0|        PZ_Unlock(list->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 1007|      0|    }
 1008|  64.6k|    if (isSessionObject) {
  ------------------
  |  Branch (1008:9): [True: 64.6k, False: 0]
  ------------------
 1009|  64.6k|        SFTKSessionObject *so = (SFTKSessionObject *)object;
 1010|  64.6k|        PZ_DestroyLock(so->attributeLock);
  ------------------
  |  |  244|  64.6k|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 1011|  64.6k|        so->attributeLock = NULL;
 1012|  64.6k|    }
 1013|  64.6k|    if (object->refLock) {
  ------------------
  |  Branch (1013:9): [True: 64.6k, False: 0]
  ------------------
 1014|  64.6k|        PZ_DestroyLock(object->refLock);
  ------------------
  |  |  244|  64.6k|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 1015|  64.6k|        object->refLock = NULL;
 1016|  64.6k|    }
 1017|  64.6k|    PORT_Free(object);
  ------------------
  |  |   60|  64.6k|#define PORT_Free PORT_Free_Util
  ------------------
 1018|  64.6k|}
pkcs11u.c:sftk_DestroySessionObjectData:
 1136|  64.6k|{
 1137|  64.6k|    int i;
 1138|       |
 1139|  2.97M|    for (i = 0; i < MAX_OBJS_ATTRS; i++) {
  ------------------
  |  |   37|  2.97M|#define MAX_OBJS_ATTRS 45 /* number of attributes to preallocate in \
  ------------------
  |  Branch (1139:17): [True: 2.90M, False: 64.6k]
  ------------------
 1140|  2.90M|        unsigned char *value = so->attrList[i].attrib.pValue;
 1141|  2.90M|        if (value) {
  ------------------
  |  Branch (1141:13): [True: 1.07M, False: 1.82M]
  ------------------
 1142|  1.07M|            PORT_Memset(value, 0, so->attrList[i].attrib.ulValueLen);
  ------------------
  |  |  182|  1.07M|#define PORT_Memset memset
  ------------------
 1143|  1.07M|            if (so->attrList[i].freeData) {
  ------------------
  |  Branch (1143:17): [True: 16.7k, False: 1.06M]
  ------------------
 1144|  16.7k|                PORT_Free(value);
  ------------------
  |  |   60|  16.7k|#define PORT_Free PORT_Free_Util
  ------------------
 1145|  16.7k|            }
 1146|  1.07M|            so->attrList[i].attrib.pValue = NULL;
 1147|  1.07M|            so->attrList[i].freeData = PR_FALSE;
  ------------------
  |  |  438|  1.07M|#define PR_FALSE 0
  ------------------
 1148|  1.07M|        }
 1149|  2.90M|    }
 1150|       |    /*  PZ_DestroyLock(so->attributeLock);*/
 1151|  64.6k|    return CKR_OK;
  ------------------
  |  | 1388|  64.6k|#define CKR_OK 0x00000000UL
  ------------------
 1152|  64.6k|}

s_shutdown:
 2461|      1|{
 2462|       |#ifdef SQLITE_UNSAFE_THREADS
 2463|       |    if (sqlite_lock) {
 2464|       |        PR_DestroyLock(sqlite_lock);
 2465|       |        sqlite_lock = NULL;
 2466|       |    }
 2467|       |#endif
 2468|      1|    return CKR_OK;
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
 2469|      1|}

sftkdb_FindObjectsInit:
 1341|  31.3k|{
 1342|  31.3k|    unsigned char *data = NULL;
 1343|  31.3k|    CK_ATTRIBUTE *ntemplate = NULL;
 1344|  31.3k|    CK_RV crv;
 1345|  31.3k|    int dataSize;
 1346|  31.3k|    SDB *db;
 1347|       |
 1348|  31.3k|    if (handle == NULL) {
  ------------------
  |  Branch (1348:9): [True: 31.3k, False: 0]
  ------------------
 1349|  31.3k|        return CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 1350|  31.3k|    }
 1351|      0|    db = SFTK_GET_SDB(handle);
  ------------------
  |  |   40|      0|    ((handle)->update ? (handle)->update : (handle)->db)
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1352|       |
 1353|      0|    if (count != 0) {
  ------------------
  |  Branch (1353:9): [True: 0, False: 0]
  ------------------
 1354|      0|        ntemplate = sftkdb_fixupTemplateIn(template, count, &data, &dataSize);
 1355|      0|        if (ntemplate == NULL) {
  ------------------
  |  Branch (1355:13): [True: 0, False: 0]
  ------------------
 1356|      0|            return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
 1357|      0|        }
 1358|      0|    }
 1359|       |
 1360|      0|    crv = (*db->sdb_FindObjectsInit)(db, ntemplate,
 1361|      0|                                     count, find);
 1362|      0|    if (data) {
  ------------------
  |  Branch (1362:9): [True: 0, False: 0]
  ------------------
 1363|      0|        PORT_Free(ntemplate);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1364|      0|        PORT_ZFree(data, dataSize);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 1365|      0|    }
 1366|      0|    return crv;
 1367|      0|}
sftkdb_FindObjects:
 1372|  31.3k|{
 1373|  31.3k|    CK_RV crv;
 1374|  31.3k|    SDB *db;
 1375|       |
 1376|  31.3k|    if (handle == NULL) {
  ------------------
  |  Branch (1376:9): [True: 31.3k, False: 0]
  ------------------
 1377|  31.3k|        *count = 0;
 1378|  31.3k|        return CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 1379|  31.3k|    }
 1380|      0|    db = SFTK_GET_SDB(handle);
  ------------------
  |  |   40|      0|    ((handle)->update ? (handle)->update : (handle)->db)
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1381|       |
 1382|      0|    crv = (*db->sdb_FindObjects)(db, find, ids,
 1383|      0|                                 arraySize, count);
 1384|      0|    if (crv == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (1384:9): [True: 0, False: 0]
  ------------------
 1385|      0|        unsigned int i;
 1386|      0|        for (i = 0; i < *count; i++) {
  ------------------
  |  Branch (1386:21): [True: 0, False: 0]
  ------------------
 1387|      0|            ids[i] |= (handle->type | SFTK_TOKEN_TYPE);
  ------------------
  |  |   33|      0|#define SFTK_TOKEN_TYPE 0x80000000
  ------------------
 1388|      0|        }
 1389|      0|    }
 1390|      0|    return crv;
 1391|  31.3k|}
sftkdb_FindObjectsFinal:
 1395|  31.3k|{
 1396|  31.3k|    SDB *db;
 1397|  31.3k|    if (handle == NULL) {
  ------------------
  |  Branch (1397:9): [True: 31.3k, False: 0]
  ------------------
 1398|  31.3k|        return CKR_OK;
  ------------------
  |  | 1388|  31.3k|#define CKR_OK 0x00000000UL
  ------------------
 1399|  31.3k|    }
 1400|      0|    db = SFTK_GET_SDB(handle);
  ------------------
  |  |   40|      0|    ((handle)->update ? (handle)->update : (handle)->db)
  |  |  ------------------
  |  |  |  Branch (40:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1401|      0|    return (*db->sdb_FindObjectsFinal)(db, find);
 1402|  31.3k|}
sftk_freeDB:
 2621|  31.3k|{
 2622|  31.3k|    PRInt32 ref;
 2623|       |
 2624|  31.3k|    if (!handle)
  ------------------
  |  Branch (2624:9): [True: 31.3k, False: 0]
  ------------------
 2625|  31.3k|        return;
 2626|      0|    ref = PR_ATOMIC_DECREMENT(&handle->ref);
  ------------------
  |  |  123|      0|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
 2627|      0|    if (ref == 0) {
  ------------------
  |  Branch (2627:9): [True: 0, False: 0]
  ------------------
 2628|      0|        sftkdb_CloseDB(handle);
 2629|      0|    }
 2630|      0|    return;
 2631|  31.3k|}
sftk_getCertDB:
 2639|  31.3k|{
 2640|  31.3k|    SFTKDBHandle *dbHandle;
 2641|       |
 2642|  31.3k|    PZ_Lock(slot->slotLock);
  ------------------
  |  |  245|  31.3k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
 2643|  31.3k|    dbHandle = slot->certDB;
 2644|  31.3k|    if (dbHandle) {
  ------------------
  |  Branch (2644:9): [True: 0, False: 31.3k]
  ------------------
 2645|      0|        (void)PR_ATOMIC_INCREMENT(&dbHandle->ref);
  ------------------
  |  |  122|      0|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
 2646|      0|    }
 2647|  31.3k|    PZ_Unlock(slot->slotLock);
  ------------------
  |  |  246|  31.3k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
 2648|  31.3k|    return dbHandle;
 2649|  31.3k|}
sftk_getKeyDB:
 2657|  50.4k|{
 2658|  50.4k|    SFTKDBHandle *dbHandle;
 2659|       |
 2660|  50.4k|    SKIP_AFTER_FORK(PZ_Lock(slot->slotLock));
  ------------------
  |  |  256|  50.4k|#define SKIP_AFTER_FORK(x) x
  ------------------
 2661|  50.4k|    dbHandle = slot->keyDB;
 2662|  50.4k|    if (dbHandle) {
  ------------------
  |  Branch (2662:9): [True: 0, False: 50.4k]
  ------------------
 2663|      0|        (void)PR_ATOMIC_INCREMENT(&dbHandle->ref);
  ------------------
  |  |  122|      0|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
 2664|      0|    }
 2665|  50.4k|    SKIP_AFTER_FORK(PZ_Unlock(slot->slotLock));
  ------------------
  |  |  256|  50.4k|#define SKIP_AFTER_FORK(x) x
  ------------------
 2666|  50.4k|    return dbHandle;
 2667|  50.4k|}
sftkdb_Shutdown:
 3041|      1|{
 3042|      1|    s_shutdown();
 3043|       |#ifndef NSS_DISABLE_DBM
 3044|       |    sftkdbCall_Shutdown();
 3045|       |#endif /* NSS_DISABLE_DBM */
 3046|      1|    return CKR_OK;
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
 3047|      1|}

sftk_VerifyDH_Prime:
 6741|  1.11k|{
 6742|       |    /* use the length to decide which primes to check */
 6743|  1.11k|    switch (dhPrime->len) {
  ------------------
  |  Branch (6743:13): [True: 3, False: 1.11k]
  ------------------
 6744|      0|        case 1536 / PR_BITS_PER_BYTE:
  ------------------
  |  |  286|      0|#define PR_BITS_PER_BYTE    8
  ------------------
  |  Branch (6744:9): [True: 0, False: 1.11k]
  ------------------
 6745|       |            /* don't accept 1536 bit primes in FIPS mode */
 6746|      0|            if (isFIPS) {
  ------------------
  |  Branch (6746:17): [True: 0, False: 0]
  ------------------
 6747|      0|                break;
 6748|      0|            }
 6749|      0|            if (PORT_Memcmp(dhPrime->data, prime_ike_1536,
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6749:17): [True: 0, False: 0]
  ------------------
 6750|      0|                            sizeof(prime_ike_1536)) == 0) {
 6751|      0|                if (g)
  ------------------
  |  Branch (6751:21): [True: 0, False: 0]
  ------------------
 6752|      0|                    *g = generator_2;
 6753|      0|                return &subprime_ike_1536;
 6754|      0|            }
 6755|      0|            break;
 6756|    602|        case 2048 / PR_BITS_PER_BYTE:
  ------------------
  |  |  286|    602|#define PR_BITS_PER_BYTE    8
  ------------------
  |  Branch (6756:9): [True: 602, False: 514]
  ------------------
 6757|    602|            if (PORT_Memcmp(dhPrime->data, prime_tls_2048,
  ------------------
  |  |  179|    602|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6757:17): [True: 238, False: 364]
  ------------------
 6758|    602|                            sizeof(prime_tls_2048)) == 0) {
 6759|    238|                if (g)
  ------------------
  |  Branch (6759:21): [True: 0, False: 238]
  ------------------
 6760|      0|                    *g = generator_2;
 6761|    238|                return &subprime_tls_2048;
 6762|    238|            }
 6763|    364|            if (PORT_Memcmp(dhPrime->data, prime_ike_2048,
  ------------------
  |  |  179|    364|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6763:17): [True: 0, False: 364]
  ------------------
 6764|    364|                            sizeof(prime_ike_2048)) == 0) {
 6765|      0|                if (g)
  ------------------
  |  Branch (6765:21): [True: 0, False: 0]
  ------------------
 6766|      0|                    *g = generator_2;
 6767|      0|                return &subprime_ike_2048;
 6768|      0|            }
 6769|    364|            break;
 6770|    364|        case 3072 / PR_BITS_PER_BYTE:
  ------------------
  |  |  286|     45|#define PR_BITS_PER_BYTE    8
  ------------------
  |  Branch (6770:9): [True: 45, False: 1.07k]
  ------------------
 6771|     45|            if (PORT_Memcmp(dhPrime->data, prime_tls_3072,
  ------------------
  |  |  179|     45|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6771:17): [True: 4, False: 41]
  ------------------
 6772|     45|                            sizeof(prime_tls_3072)) == 0) {
 6773|      4|                if (g)
  ------------------
  |  Branch (6773:21): [True: 0, False: 4]
  ------------------
 6774|      0|                    *g = generator_2;
 6775|      4|                return &subprime_tls_3072;
 6776|      4|            }
 6777|     41|            if (PORT_Memcmp(dhPrime->data, prime_ike_3072,
  ------------------
  |  |  179|     41|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6777:17): [True: 0, False: 41]
  ------------------
 6778|     41|                            sizeof(prime_ike_3072)) == 0) {
 6779|      0|                if (g)
  ------------------
  |  Branch (6779:21): [True: 0, False: 0]
  ------------------
 6780|      0|                    *g = generator_2;
 6781|      0|                return &subprime_ike_3072;
 6782|      0|            }
 6783|     41|            break;
 6784|    440|        case 4096 / PR_BITS_PER_BYTE:
  ------------------
  |  |  286|    440|#define PR_BITS_PER_BYTE    8
  ------------------
  |  Branch (6784:9): [True: 440, False: 676]
  ------------------
 6785|    440|            if (PORT_Memcmp(dhPrime->data, prime_tls_4096,
  ------------------
  |  |  179|    440|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6785:17): [True: 440, False: 0]
  ------------------
 6786|    440|                            sizeof(prime_tls_4096)) == 0) {
 6787|    440|                if (g)
  ------------------
  |  Branch (6787:21): [True: 0, False: 440]
  ------------------
 6788|      0|                    *g = generator_2;
 6789|    440|                return &subprime_tls_4096;
 6790|    440|            }
 6791|      0|            if (PORT_Memcmp(dhPrime->data, prime_ike_4096,
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6791:17): [True: 0, False: 0]
  ------------------
 6792|      0|                            sizeof(prime_ike_4096)) == 0) {
 6793|      0|                if (g)
  ------------------
  |  Branch (6793:21): [True: 0, False: 0]
  ------------------
 6794|      0|                    *g = generator_2;
 6795|      0|                return &subprime_ike_4096;
 6796|      0|            }
 6797|      0|            break;
 6798|      1|        case 6144 / PR_BITS_PER_BYTE:
  ------------------
  |  |  286|      1|#define PR_BITS_PER_BYTE    8
  ------------------
  |  Branch (6798:9): [True: 1, False: 1.11k]
  ------------------
 6799|      1|            if (PORT_Memcmp(dhPrime->data, prime_tls_6144,
  ------------------
  |  |  179|      1|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6799:17): [True: 1, False: 0]
  ------------------
 6800|      1|                            sizeof(prime_tls_6144)) == 0) {
 6801|      1|                if (g)
  ------------------
  |  Branch (6801:21): [True: 0, False: 1]
  ------------------
 6802|      0|                    *g = generator_2;
 6803|      1|                return &subprime_tls_6144;
 6804|      1|            }
 6805|      0|            if (PORT_Memcmp(dhPrime->data, prime_ike_6144,
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6805:17): [True: 0, False: 0]
  ------------------
 6806|      0|                            sizeof(prime_ike_6144)) == 0) {
 6807|      0|                if (g)
  ------------------
  |  Branch (6807:21): [True: 0, False: 0]
  ------------------
 6808|      0|                    *g = generator_2;
 6809|      0|                return &subprime_ike_6144;
 6810|      0|            }
 6811|      0|            break;
 6812|     25|        case 8192 / PR_BITS_PER_BYTE:
  ------------------
  |  |  286|     25|#define PR_BITS_PER_BYTE    8
  ------------------
  |  Branch (6812:9): [True: 25, False: 1.09k]
  ------------------
 6813|     25|            if (PORT_Memcmp(dhPrime->data, prime_tls_8192,
  ------------------
  |  |  179|     25|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6813:17): [True: 25, False: 0]
  ------------------
 6814|     25|                            sizeof(prime_tls_8192)) == 0) {
 6815|     25|                if (g)
  ------------------
  |  Branch (6815:21): [True: 0, False: 25]
  ------------------
 6816|      0|                    *g = generator_2;
 6817|     25|                return &subprime_tls_8192;
 6818|     25|            }
 6819|      0|            if (PORT_Memcmp(dhPrime->data, prime_ike_8192,
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6819:17): [True: 0, False: 0]
  ------------------
 6820|      0|                            sizeof(prime_ike_8192)) == 0) {
 6821|      0|                if (g)
  ------------------
  |  Branch (6821:21): [True: 0, False: 0]
  ------------------
 6822|      0|                    *g = generator_2;
 6823|      0|                return &subprime_ike_8192;
 6824|      0|            }
 6825|      0|            break;
 6826|  1.11k|    }
 6827|       |    /* no match found, return an error */
 6828|    408|    PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|    408|#define PORT_SetError PORT_SetError_Util
  ------------------
 6829|    408|    return NULL;
 6830|  1.11k|}

sftk_HMACMechanismToHash:
   31|  7.61k|{
   32|  7.61k|    switch (mech) {
  ------------------
  |  Branch (32:13): [True: 0, False: 7.61k]
  ------------------
   33|      0|        case CKM_MD2_HMAC:
  ------------------
  |  |  850|      0|#define CKM_MD2_HMAC 0x00000201UL
  ------------------
  |  Branch (33:9): [True: 0, False: 7.61k]
  ------------------
   34|      0|            return HASH_AlgMD2;
   35|    196|        case CKM_MD5_HMAC:
  ------------------
  |  |  856|    196|#define CKM_MD5_HMAC 0x00000211UL
  ------------------
  |  Branch (35:9): [True: 196, False: 7.41k]
  ------------------
   36|    196|        case CKM_SSL3_MD5_MAC:
  ------------------
  |  |  975|    196|#define CKM_SSL3_MD5_MAC 0x00000380UL
  ------------------
  |  Branch (36:9): [True: 0, False: 7.61k]
  ------------------
   37|    196|            return HASH_AlgMD5;
   38|  2.59k|        case CKM_SHA_1_HMAC:
  ------------------
  |  |  862|  2.59k|#define CKM_SHA_1_HMAC 0x00000221UL
  ------------------
  |  Branch (38:9): [True: 2.59k, False: 5.01k]
  ------------------
   39|  2.59k|        case CKM_SSL3_SHA1_MAC:
  ------------------
  |  |  976|  2.59k|#define CKM_SSL3_SHA1_MAC 0x00000381UL
  ------------------
  |  Branch (39:9): [True: 0, False: 7.61k]
  ------------------
   40|  2.59k|            return HASH_AlgSHA1;
   41|      0|        case CKM_SHA224_HMAC:
  ------------------
  |  |  888|      0|#define CKM_SHA224_HMAC 0x00000256UL
  ------------------
  |  Branch (41:9): [True: 0, False: 7.61k]
  ------------------
   42|      0|            return HASH_AlgSHA224;
   43|  1.73k|        case CKM_SHA256_HMAC:
  ------------------
  |  |  877|  1.73k|#define CKM_SHA256_HMAC 0x00000251UL
  ------------------
  |  Branch (43:9): [True: 1.73k, False: 5.88k]
  ------------------
   44|  1.73k|            return HASH_AlgSHA256;
   45|  3.08k|        case CKM_SHA384_HMAC:
  ------------------
  |  |  880|  3.08k|#define CKM_SHA384_HMAC 0x00000261UL
  ------------------
  |  Branch (45:9): [True: 3.08k, False: 4.52k]
  ------------------
   46|  3.08k|            return HASH_AlgSHA384;
   47|      0|        case CKM_SHA512_HMAC:
  ------------------
  |  |  883|      0|#define CKM_SHA512_HMAC 0x00000271UL
  ------------------
  |  Branch (47:9): [True: 0, False: 7.61k]
  ------------------
   48|      0|            return HASH_AlgSHA512;
   49|      0|        case CKM_SHA3_224_HMAC:
  ------------------
  |  |  903|      0|#define CKM_SHA3_224_HMAC 0x000002B6UL
  ------------------
  |  Branch (49:9): [True: 0, False: 7.61k]
  ------------------
   50|      0|            return HASH_AlgSHA3_224;
   51|      0|        case CKM_SHA3_256_HMAC:
  ------------------
  |  |  899|      0|#define CKM_SHA3_256_HMAC 0x000002B1UL
  ------------------
  |  Branch (51:9): [True: 0, False: 7.61k]
  ------------------
   52|      0|            return HASH_AlgSHA3_256;
   53|      0|        case CKM_SHA3_384_HMAC:
  ------------------
  |  |  907|      0|#define CKM_SHA3_384_HMAC 0x000002C1UL
  ------------------
  |  Branch (53:9): [True: 0, False: 7.61k]
  ------------------
   54|      0|            return HASH_AlgSHA3_384;
   55|      0|        case CKM_SHA3_512_HMAC:
  ------------------
  |  |  911|      0|#define CKM_SHA3_512_HMAC 0x000002D1UL
  ------------------
  |  Branch (55:9): [True: 0, False: 7.61k]
  ------------------
   56|      0|            return HASH_AlgSHA3_512;
   57|  7.61k|    }
   58|      0|    return HASH_AlgNULL;
   59|  7.61k|}
sftk_MAC_Create:
  221|  7.61k|{
  222|  7.61k|    CK_RV ret;
  223|       |
  224|  7.61k|    if (ret_ctx == NULL || key == NULL) {
  ------------------
  |  Branch (224:9): [True: 0, False: 7.61k]
  |  Branch (224:28): [True: 0, False: 7.61k]
  ------------------
  225|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  226|      0|    }
  227|       |
  228|  7.61k|    *ret_ctx = PORT_New(sftk_MACCtx);
  ------------------
  |  |  151|  7.61k|#define PORT_New(type) (type *)PORT_Alloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   52|  7.61k|#define PORT_Alloc PORT_Alloc_Util
  |  |  ------------------
  ------------------
  229|  7.61k|    if (*ret_ctx == NULL) {
  ------------------
  |  Branch (229:9): [True: 0, False: 7.61k]
  ------------------
  230|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  231|      0|    }
  232|       |
  233|  7.61k|    ret = sftk_MAC_Init(*ret_ctx, mech, key);
  234|  7.61k|    if (ret != CKR_OK) {
  ------------------
  |  | 1388|  7.61k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (234:9): [True: 0, False: 7.61k]
  ------------------
  235|      0|        sftk_MAC_DestroyContext(*ret_ctx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  236|      0|    }
  237|       |
  238|  7.61k|    return ret;
  239|  7.61k|}
sftk_MAC_Init:
  243|  7.61k|{
  244|  7.61k|    SFTKAttribute *keyval = NULL;
  245|  7.61k|    PRBool isFIPS = sftk_isFIPS(key->slot->slotID);
  ------------------
  |  |  506|  7.61k|    (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  500|  7.61k|#define FIPS_SLOT_ID 3
  |  |  ------------------
  |  |                   (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  567|  7.61k|#define SFTK_MIN_FIPS_USER_SLOT_ID 101
  |  |  ------------------
  |  |  |  Branch (506:6): [True: 0, False: 7.61k]
  |  |  |  Branch (506:32): [True: 0, False: 7.61k]
  |  |  ------------------
  ------------------
  246|  7.61k|    CK_RV ret = CKR_OK;
  ------------------
  |  | 1388|  7.61k|#define CKR_OK 0x00000000UL
  ------------------
  247|       |
  248|       |    /* Find the actual value of the key. */
  249|  7.61k|    keyval = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|  7.61k|#define CKA_VALUE 0x00000011UL
  ------------------
  250|  7.61k|    if (keyval == NULL) {
  ------------------
  |  Branch (250:9): [True: 0, False: 7.61k]
  ------------------
  251|      0|        ret = CKR_KEY_SIZE_RANGE;
  ------------------
  |  | 1432|      0|#define CKR_KEY_SIZE_RANGE 0x00000062UL
  ------------------
  252|      0|        goto done;
  253|      0|    }
  254|       |
  255|  7.61k|    ret = sftk_MAC_InitRaw(ctx, mech,
  256|  7.61k|                           (const unsigned char *)keyval->attrib.pValue,
  257|  7.61k|                           keyval->attrib.ulValueLen, isFIPS);
  258|       |
  259|  7.61k|done:
  260|  7.61k|    if (keyval) {
  ------------------
  |  Branch (260:9): [True: 7.61k, False: 0]
  ------------------
  261|  7.61k|        sftk_FreeAttribute(keyval);
  262|  7.61k|    }
  263|  7.61k|    return ret;
  264|  7.61k|}
sftk_MAC_InitRaw:
  268|  7.61k|{
  269|  7.61k|    const SECHashObject *hashObj = NULL;
  270|  7.61k|    CK_RV ret = CKR_OK;
  ------------------
  |  | 1388|  7.61k|#define CKR_OK 0x00000000UL
  ------------------
  271|       |
  272|  7.61k|    if (ctx == NULL) {
  ------------------
  |  Branch (272:9): [True: 0, False: 7.61k]
  ------------------
  273|      0|        return CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  274|      0|    }
  275|       |
  276|       |    /* Clear the context before use. */
  277|  7.61k|    PORT_Memset(ctx, 0, sizeof(*ctx));
  ------------------
  |  |  182|  7.61k|#define PORT_Memset memset
  ------------------
  278|       |
  279|       |    /* Save the mech. */
  280|  7.61k|    ctx->mech = mech;
  281|       |
  282|       |    /* Initialize the correct MAC context. */
  283|  7.61k|    switch (mech) {
  284|      0|        case CKM_MD2_HMAC:
  ------------------
  |  |  850|      0|#define CKM_MD2_HMAC 0x00000201UL
  ------------------
  |  Branch (284:9): [True: 0, False: 7.61k]
  ------------------
  285|    196|        case CKM_MD5_HMAC:
  ------------------
  |  |  856|    196|#define CKM_MD5_HMAC 0x00000211UL
  ------------------
  |  Branch (285:9): [True: 196, False: 7.41k]
  ------------------
  286|  2.79k|        case CKM_SHA_1_HMAC:
  ------------------
  |  |  862|  2.79k|#define CKM_SHA_1_HMAC 0x00000221UL
  ------------------
  |  Branch (286:9): [True: 2.59k, False: 5.01k]
  ------------------
  287|  2.79k|        case CKM_SHA224_HMAC:
  ------------------
  |  |  888|  2.79k|#define CKM_SHA224_HMAC 0x00000256UL
  ------------------
  |  Branch (287:9): [True: 0, False: 7.61k]
  ------------------
  288|  4.52k|        case CKM_SHA256_HMAC:
  ------------------
  |  |  877|  4.52k|#define CKM_SHA256_HMAC 0x00000251UL
  ------------------
  |  Branch (288:9): [True: 1.73k, False: 5.88k]
  ------------------
  289|  7.61k|        case CKM_SHA384_HMAC:
  ------------------
  |  |  880|  7.61k|#define CKM_SHA384_HMAC 0x00000261UL
  ------------------
  |  Branch (289:9): [True: 3.08k, False: 4.52k]
  ------------------
  290|  7.61k|        case CKM_SHA512_HMAC:
  ------------------
  |  |  883|  7.61k|#define CKM_SHA512_HMAC 0x00000271UL
  ------------------
  |  Branch (290:9): [True: 0, False: 7.61k]
  ------------------
  291|  7.61k|        case CKM_SHA3_224_HMAC:
  ------------------
  |  |  903|  7.61k|#define CKM_SHA3_224_HMAC 0x000002B6UL
  ------------------
  |  Branch (291:9): [True: 0, False: 7.61k]
  ------------------
  292|  7.61k|        case CKM_SHA3_256_HMAC:
  ------------------
  |  |  899|  7.61k|#define CKM_SHA3_256_HMAC 0x000002B1UL
  ------------------
  |  Branch (292:9): [True: 0, False: 7.61k]
  ------------------
  293|  7.61k|        case CKM_SHA3_384_HMAC:
  ------------------
  |  |  907|  7.61k|#define CKM_SHA3_384_HMAC 0x000002C1UL
  ------------------
  |  Branch (293:9): [True: 0, False: 7.61k]
  ------------------
  294|  7.61k|        case CKM_SHA3_512_HMAC:
  ------------------
  |  |  911|  7.61k|#define CKM_SHA3_512_HMAC 0x000002D1UL
  ------------------
  |  Branch (294:9): [True: 0, False: 7.61k]
  ------------------
  295|  7.61k|            hashObj = HASH_GetRawHashObject(sftk_HMACMechanismToHash(mech));
  296|       |
  297|       |            /* Because we condition above only on hashes we know to be valid,
  298|       |             * hashObj should never be NULL. This assert is only useful when
  299|       |             * adding a new hash function (for which only partial support has
  300|       |             * been added); thus there is no need to turn it into an if and
  301|       |             * avoid the NULL dereference on the following line. */
  302|  7.61k|            PR_ASSERT(hashObj != NULL);
  ------------------
  |  |  208|  7.61k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 7.61k, False: 0]
  |  |  ------------------
  ------------------
  303|  7.61k|            ctx->mac_size = hashObj->length;
  304|       |
  305|  7.61k|            goto hmac;
  306|      0|        case CKM_AES_CMAC:
  ------------------
  |  | 1119|      0|#define CKM_AES_CMAC 0x0000108AUL
  ------------------
  |  Branch (306:9): [True: 0, False: 7.61k]
  ------------------
  307|      0|            ctx->mac.cmac = CMAC_Create(CMAC_AES, key, key_len);
  308|      0|            ctx->destroy_func = SFTKMAC_CMAC_Destroy;
  309|       |
  310|       |            /* Copy the behavior of sftk_doCMACInit here. */
  311|      0|            if (ctx->mac.cmac == NULL) {
  ------------------
  |  Branch (311:17): [True: 0, False: 0]
  ------------------
  312|      0|                if (PORT_GetError() == SEC_ERROR_INVALID_ARGS) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (312:21): [True: 0, False: 0]
  ------------------
  313|      0|                    ret = CKR_KEY_SIZE_RANGE;
  ------------------
  |  | 1432|      0|#define CKR_KEY_SIZE_RANGE 0x00000062UL
  ------------------
  314|      0|                    goto done;
  315|      0|                }
  316|       |
  317|      0|                ret = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  318|      0|                goto done;
  319|      0|            }
  320|       |
  321|      0|            ctx->mac_size = AES_BLOCK_SIZE;
  ------------------
  |  |  130|      0|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  322|       |
  323|      0|            goto done;
  324|      0|        default:
  ------------------
  |  Branch (324:9): [True: 0, False: 7.61k]
  ------------------
  325|      0|            ret = CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
  326|      0|            goto done;
  327|  7.61k|    }
  328|       |
  329|  7.61k|hmac:
  330|  7.61k|    ctx->mac.hmac = HMAC_Create(hashObj, key, key_len, isFIPS);
  331|  7.61k|    ctx->destroy_func = SFTKMAC_HMAC_Destroy;
  332|       |
  333|       |    /* Copy the behavior of sftk_doHMACInit here. */
  334|  7.61k|    if (ctx->mac.hmac == NULL) {
  ------------------
  |  Branch (334:9): [True: 0, False: 7.61k]
  ------------------
  335|      0|        if (PORT_GetError() == SEC_ERROR_INVALID_ARGS) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  |  Branch (335:13): [True: 0, False: 0]
  ------------------
  336|      0|            ret = CKR_KEY_SIZE_RANGE;
  ------------------
  |  | 1432|      0|#define CKR_KEY_SIZE_RANGE 0x00000062UL
  ------------------
  337|      0|            goto done;
  338|      0|        }
  339|      0|        ret = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|      0|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  340|      0|        goto done;
  341|      0|    }
  342|       |
  343|       |    /* Semantics: HMAC and CMAC should behave the same. Begin HMAC now. */
  344|  7.61k|    HMAC_Begin(ctx->mac.hmac);
  345|       |
  346|  7.61k|done:
  347|       |    /* Handle a failure: ctx->mac.raw should be NULL, but make sure
  348|       |     * destroy_func isn't set. */
  349|  7.61k|    if (ret != CKR_OK) {
  ------------------
  |  | 1388|  7.61k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (349:9): [True: 0, False: 7.61k]
  ------------------
  350|      0|        ctx->destroy_func = NULL;
  351|      0|    }
  352|       |
  353|  7.61k|    return ret;
  354|  7.61k|}
sftk_MAC_Update:
  394|  4.46k|{
  395|  4.46k|    switch (ctx->mech) {
  396|      0|        case CKM_MD2_HMAC:
  ------------------
  |  |  850|      0|#define CKM_MD2_HMAC 0x00000201UL
  ------------------
  |  Branch (396:9): [True: 0, False: 4.46k]
  ------------------
  397|      0|        case CKM_MD5_HMAC:
  ------------------
  |  |  856|      0|#define CKM_MD5_HMAC 0x00000211UL
  ------------------
  |  Branch (397:9): [True: 0, False: 4.46k]
  ------------------
  398|      0|        case CKM_SHA_1_HMAC:
  ------------------
  |  |  862|      0|#define CKM_SHA_1_HMAC 0x00000221UL
  ------------------
  |  Branch (398:9): [True: 0, False: 4.46k]
  ------------------
  399|      0|        case CKM_SHA224_HMAC:
  ------------------
  |  |  888|      0|#define CKM_SHA224_HMAC 0x00000256UL
  ------------------
  |  Branch (399:9): [True: 0, False: 4.46k]
  ------------------
  400|  1.38k|        case CKM_SHA256_HMAC:
  ------------------
  |  |  877|  1.38k|#define CKM_SHA256_HMAC 0x00000251UL
  ------------------
  |  Branch (400:9): [True: 1.38k, False: 3.07k]
  ------------------
  401|  4.46k|        case CKM_SHA384_HMAC:
  ------------------
  |  |  880|  4.46k|#define CKM_SHA384_HMAC 0x00000261UL
  ------------------
  |  Branch (401:9): [True: 3.07k, False: 1.38k]
  ------------------
  402|  4.46k|        case CKM_SHA512_HMAC:
  ------------------
  |  |  883|  4.46k|#define CKM_SHA512_HMAC 0x00000271UL
  ------------------
  |  Branch (402:9): [True: 0, False: 4.46k]
  ------------------
  403|  4.46k|        case CKM_SHA3_224_HMAC:
  ------------------
  |  |  903|  4.46k|#define CKM_SHA3_224_HMAC 0x000002B6UL
  ------------------
  |  Branch (403:9): [True: 0, False: 4.46k]
  ------------------
  404|  4.46k|        case CKM_SHA3_256_HMAC:
  ------------------
  |  |  899|  4.46k|#define CKM_SHA3_256_HMAC 0x000002B1UL
  ------------------
  |  Branch (404:9): [True: 0, False: 4.46k]
  ------------------
  405|  4.46k|        case CKM_SHA3_384_HMAC:
  ------------------
  |  |  907|  4.46k|#define CKM_SHA3_384_HMAC 0x000002C1UL
  ------------------
  |  Branch (405:9): [True: 0, False: 4.46k]
  ------------------
  406|  4.46k|        case CKM_SHA3_512_HMAC:
  ------------------
  |  |  911|  4.46k|#define CKM_SHA3_512_HMAC 0x000002D1UL
  ------------------
  |  Branch (406:9): [True: 0, False: 4.46k]
  ------------------
  407|       |            /* HMAC doesn't indicate failure in the return code. */
  408|  4.46k|            HMAC_Update(ctx->mac.hmac, data, data_len);
  409|  4.46k|            break;
  410|      0|        case CKM_AES_CMAC:
  ------------------
  |  | 1119|      0|#define CKM_AES_CMAC 0x0000108AUL
  ------------------
  |  Branch (410:9): [True: 0, False: 4.46k]
  ------------------
  411|       |            /* CMAC indicates failure in the return code, however this is
  412|       |             * unlikely to occur. */
  413|      0|            if (CMAC_Update(ctx->mac.cmac, data, data_len) != SECSuccess) {
  ------------------
  |  Branch (413:17): [True: 0, False: 0]
  ------------------
  414|      0|                return CKR_FUNCTION_FAILED;
  ------------------
  |  | 1397|      0|#define CKR_FUNCTION_FAILED 0x00000006UL
  ------------------
  415|      0|            }
  416|      0|            break;
  417|      0|        default:
  ------------------
  |  Branch (417:9): [True: 0, False: 4.46k]
  ------------------
  418|       |            /* This shouldn't happen -- asserting indicates partial support
  419|       |             * for a new MAC type. */
  420|      0|            PR_ASSERT(PR_FALSE);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  ------------------
  ------------------
  421|      0|            return CKR_FUNCTION_FAILED;
  ------------------
  |  | 1397|      0|#define CKR_FUNCTION_FAILED 0x00000006UL
  ------------------
  422|  4.46k|    }
  423|  4.46k|    return CKR_OK;
  ------------------
  |  | 1388|  4.46k|#define CKR_OK 0x00000000UL
  ------------------
  424|  4.46k|}
sftk_MAC_End:
  428|  4.46k|{
  429|  4.46k|    unsigned int actual_result_len;
  430|       |
  431|  4.46k|    switch (ctx->mech) {
  432|      0|        case CKM_MD2_HMAC:
  ------------------
  |  |  850|      0|#define CKM_MD2_HMAC 0x00000201UL
  ------------------
  |  Branch (432:9): [True: 0, False: 4.46k]
  ------------------
  433|      0|        case CKM_MD5_HMAC:
  ------------------
  |  |  856|      0|#define CKM_MD5_HMAC 0x00000211UL
  ------------------
  |  Branch (433:9): [True: 0, False: 4.46k]
  ------------------
  434|      0|        case CKM_SHA_1_HMAC:
  ------------------
  |  |  862|      0|#define CKM_SHA_1_HMAC 0x00000221UL
  ------------------
  |  Branch (434:9): [True: 0, False: 4.46k]
  ------------------
  435|      0|        case CKM_SHA224_HMAC:
  ------------------
  |  |  888|      0|#define CKM_SHA224_HMAC 0x00000256UL
  ------------------
  |  Branch (435:9): [True: 0, False: 4.46k]
  ------------------
  436|  1.38k|        case CKM_SHA256_HMAC:
  ------------------
  |  |  877|  1.38k|#define CKM_SHA256_HMAC 0x00000251UL
  ------------------
  |  Branch (436:9): [True: 1.38k, False: 3.07k]
  ------------------
  437|  4.46k|        case CKM_SHA384_HMAC:
  ------------------
  |  |  880|  4.46k|#define CKM_SHA384_HMAC 0x00000261UL
  ------------------
  |  Branch (437:9): [True: 3.07k, False: 1.38k]
  ------------------
  438|  4.46k|        case CKM_SHA512_HMAC:
  ------------------
  |  |  883|  4.46k|#define CKM_SHA512_HMAC 0x00000271UL
  ------------------
  |  Branch (438:9): [True: 0, False: 4.46k]
  ------------------
  439|  4.46k|        case CKM_SHA3_224_HMAC:
  ------------------
  |  |  903|  4.46k|#define CKM_SHA3_224_HMAC 0x000002B6UL
  ------------------
  |  Branch (439:9): [True: 0, False: 4.46k]
  ------------------
  440|  4.46k|        case CKM_SHA3_256_HMAC:
  ------------------
  |  |  899|  4.46k|#define CKM_SHA3_256_HMAC 0x000002B1UL
  ------------------
  |  Branch (440:9): [True: 0, False: 4.46k]
  ------------------
  441|  4.46k|        case CKM_SHA3_384_HMAC:
  ------------------
  |  |  907|  4.46k|#define CKM_SHA3_384_HMAC 0x000002C1UL
  ------------------
  |  Branch (441:9): [True: 0, False: 4.46k]
  ------------------
  442|  4.46k|        case CKM_SHA3_512_HMAC:
  ------------------
  |  |  911|  4.46k|#define CKM_SHA3_512_HMAC 0x000002D1UL
  ------------------
  |  Branch (442:9): [True: 0, False: 4.46k]
  ------------------
  443|       |            /* HMAC doesn't indicate failure in the return code. Additionally,
  444|       |             * unlike CMAC, it doesn't support partial results. This means that we
  445|       |             * need to allocate a buffer if max_result_len < ctx->mac_size. */
  446|  4.46k|            if (max_result_len >= ctx->mac_size) {
  ------------------
  |  Branch (446:17): [True: 4.46k, False: 0]
  ------------------
  447|       |                /* Split this into two calls to avoid an unnecessary stack
  448|       |                 * allocation and memcpy when possible. */
  449|  4.46k|                HMAC_Finish(ctx->mac.hmac, result, &actual_result_len, max_result_len);
  450|  4.46k|            } else {
  451|      0|                uint8_t tmp_buffer[SFTK_MAX_MAC_LENGTH];
  452|       |
  453|       |                /* Assumption: buffer is large enough to hold this HMAC's
  454|       |                 * output. */
  455|      0|                PR_ASSERT(SFTK_MAX_MAC_LENGTH >= ctx->mac_size);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  456|       |
  457|      0|                HMAC_Finish(ctx->mac.hmac, tmp_buffer, &actual_result_len, SFTK_MAX_MAC_LENGTH);
  ------------------
  |  |  255|      0|#define SFTK_MAX_MAC_LENGTH 64
  ------------------
  458|       |
  459|      0|                if (actual_result_len > max_result_len) {
  ------------------
  |  Branch (459:21): [True: 0, False: 0]
  ------------------
  460|       |                    /* This should always be true since:
  461|       |                     *
  462|       |                     *   (SFTK_MAX_MAC_LENGTH >= ctx->mac_size =
  463|       |                     *       actual_result_len) > max_result_len,
  464|       |                     *
  465|       |                     * but guard this truncation just in case. */
  466|      0|                    actual_result_len = max_result_len;
  467|      0|                }
  468|       |
  469|      0|                PORT_Memcpy(result, tmp_buffer, actual_result_len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  470|      0|            }
  471|  4.46k|            break;
  472|      0|        case CKM_AES_CMAC:
  ------------------
  |  | 1119|      0|#define CKM_AES_CMAC 0x0000108AUL
  ------------------
  |  Branch (472:9): [True: 0, False: 4.46k]
  ------------------
  473|       |            /* CMAC indicates failure in the return code, however this is
  474|       |             * unlikely to occur. */
  475|      0|            if (CMAC_Finish(ctx->mac.cmac, result, &actual_result_len, max_result_len) != SECSuccess) {
  ------------------
  |  Branch (475:17): [True: 0, False: 0]
  ------------------
  476|      0|                return CKR_FUNCTION_FAILED;
  ------------------
  |  | 1397|      0|#define CKR_FUNCTION_FAILED 0x00000006UL
  ------------------
  477|      0|            }
  478|      0|            break;
  479|      0|        default:
  ------------------
  |  Branch (479:9): [True: 0, False: 4.46k]
  ------------------
  480|       |            /* This shouldn't happen -- asserting indicates partial support
  481|       |             * for a new MAC type. */
  482|      0|            PR_ASSERT(PR_FALSE);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  ------------------
  ------------------
  483|      0|            return CKR_FUNCTION_FAILED;
  ------------------
  |  | 1397|      0|#define CKR_FUNCTION_FAILED 0x00000006UL
  ------------------
  484|  4.46k|    }
  485|       |
  486|  4.46k|    if (result_len) {
  ------------------
  |  Branch (486:9): [True: 4.46k, False: 0]
  ------------------
  487|       |        /* When result length is passed, inform the caller of its value. */
  488|  4.46k|        *result_len = actual_result_len;
  489|  4.46k|    } else if (max_result_len == ctx->mac_size) {
  ------------------
  |  Branch (489:16): [True: 0, False: 0]
  ------------------
  490|       |        /* Validate that the amount requested was what was actually given; the
  491|       |         * caller assumes that what they passed was the output size of the
  492|       |         * underlying MAC and that they got all the bytes the asked for. */
  493|      0|        PR_ASSERT(actual_result_len == max_result_len);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  494|      0|    }
  495|       |
  496|  4.46k|    return CKR_OK;
  ------------------
  |  | 1388|  4.46k|#define CKR_OK 0x00000000UL
  ------------------
  497|  4.46k|}
sftk_MAC_DestroyContext:
  501|  7.61k|{
  502|  7.61k|    if (ctx == NULL) {
  ------------------
  |  Branch (502:9): [True: 0, False: 7.61k]
  ------------------
  503|      0|        return;
  504|      0|    }
  505|       |
  506|  7.61k|    if (ctx->mac.raw != NULL && ctx->destroy_func != NULL) {
  ------------------
  |  Branch (506:9): [True: 7.61k, False: 0]
  |  Branch (506:33): [True: 7.61k, False: 0]
  ------------------
  507|  7.61k|        ctx->destroy_func(ctx->mac.raw, PR_TRUE);
  ------------------
  |  |  437|  7.61k|#define PR_TRUE 1
  ------------------
  508|  7.61k|    }
  509|       |
  510|       |    /* Clean up the struct so we don't double free accidentally. */
  511|  7.61k|    PORT_Memset(ctx, 0, sizeof(sftk_MACCtx));
  ------------------
  |  |  182|  7.61k|#define PORT_Memset memset
  ------------------
  512|       |
  513|  7.61k|    if (free_it == PR_TRUE) {
  ------------------
  |  |  437|  7.61k|#define PR_TRUE 1
  ------------------
  |  Branch (513:9): [True: 7.61k, False: 0]
  ------------------
  514|  7.61k|        PORT_Free(ctx);
  ------------------
  |  |   60|  7.61k|#define PORT_Free PORT_Free_Util
  ------------------
  515|  7.61k|    }
  516|  7.61k|}
sftkhmac.c:SFTKMAC_HMAC_Destroy:
   22|  7.61k|{
   23|  7.61k|    HMACContext *hctx = ctx;
   24|  7.61k|    HMAC_Destroy(hctx, freeit);
   25|  7.61k|}

sftk_ChaCha20Poly1305_DestroyContext:
   50|     26|{
   51|     26|    ChaCha20Poly1305Context *ctx = vctx;
   52|     26|    ChaCha20Poly1305_DestroyContext(ctx, freeit);
   53|     26|}
sftk_AES_DestroyContext:
   70|  1.24k|{
   71|  1.24k|    AESContext *actx = ctx;
   72|  1.24k|    AES_DestroyContext(actx, freeit);
   73|  1.24k|}
NSC_MessageEncryptInit:
  233|    236|{
  234|    236|    return sftk_MessageCryptInit(hSession, pMechanism, hKey,
  235|    236|                                 SFTK_MESSAGE_ENCRYPT, CKA_ENCRYPT, PR_TRUE);
  ------------------
  |  |  547|    236|#define CKA_ENCRYPT 0x00000104UL
  ------------------
                                               SFTK_MESSAGE_ENCRYPT, CKA_ENCRYPT, PR_TRUE);
  ------------------
  |  |  437|    236|#define PR_TRUE 1
  ------------------
  236|    236|}
NSC_MessageDecryptInit:
  284|  1.03k|{
  285|  1.03k|    return sftk_MessageCryptInit(hSession, pMechanism, hKey,
  286|  1.03k|                                 SFTK_MESSAGE_DECRYPT, CKA_DECRYPT, PR_FALSE);
  ------------------
  |  |  548|  1.03k|#define CKA_DECRYPT 0x00000105UL
  ------------------
                                               SFTK_MESSAGE_DECRYPT, CKA_DECRYPT, PR_FALSE);
  ------------------
  |  |  438|  1.03k|#define PR_FALSE 0
  ------------------
  287|  1.03k|}
sftkmessage.c:sftk_MessageCryptInit:
   86|  1.26k|{
   87|  1.26k|    SFTKSession *session;
   88|  1.26k|    SFTKObject *key;
   89|  1.26k|    SFTKSessionContext *context;
   90|  1.26k|    SFTKAttribute *att;
   91|  1.26k|    CK_KEY_TYPE key_type;
   92|  1.26k|    CK_RV crv = CKR_OK;
  ------------------
  |  | 1388|  1.26k|#define CKR_OK 0x00000000UL
  ------------------
   93|       |
   94|  1.26k|    if (!pMechanism) {
  ------------------
  |  Branch (94:9): [True: 0, False: 1.26k]
  ------------------
   95|      0|        return CKR_MECHANISM_PARAM_INVALID;
  ------------------
  |  | 1448|      0|#define CKR_MECHANISM_PARAM_INVALID 0x00000071UL
  ------------------
   96|      0|    }
   97|       |
   98|  1.26k|    crv = sftk_MechAllowsOperation(pMechanism->mechanism,
   99|  1.26k|                                   CKA_NSS_MESSAGE | operation);
  ------------------
  |  |   69|  1.26k|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
  100|  1.26k|    if (crv != CKR_OK)
  ------------------
  |  | 1388|  1.26k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (100:9): [True: 0, False: 1.26k]
  ------------------
  101|      0|        return crv;
  102|       |
  103|  1.26k|    session = sftk_SessionFromHandle(hSession);
  104|  1.26k|    if (session == NULL)
  ------------------
  |  Branch (104:9): [True: 0, False: 1.26k]
  ------------------
  105|      0|        return CKR_SESSION_HANDLE_INVALID;
  ------------------
  |  | 1465|      0|#define CKR_SESSION_HANDLE_INVALID 0x000000B3UL
  ------------------
  106|       |
  107|  1.26k|    crv = sftk_InitGeneric(session, pMechanism, &context, contextType, &key,
  108|  1.26k|                           hKey, &key_type, CKO_SECRET_KEY, operation);
  ------------------
  |  |  329|  1.26k|#define CKO_SECRET_KEY 0x00000004UL
  ------------------
  109|  1.26k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.26k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (109:9): [True: 0, False: 1.26k]
  ------------------
  110|      0|        sftk_FreeSession(session);
  111|      0|        return crv;
  112|      0|    }
  113|       |
  114|  1.26k|    att = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|  1.26k|#define CKA_VALUE 0x00000011UL
  ------------------
  115|  1.26k|    if (att == NULL) {
  ------------------
  |  Branch (115:9): [True: 0, False: 1.26k]
  ------------------
  116|      0|        sftk_FreeSession(session);
  117|      0|        sftk_FreeContext(context);
  118|      0|        return CKR_KEY_HANDLE_INVALID;
  ------------------
  |  | 1428|      0|#define CKR_KEY_HANDLE_INVALID 0x00000060UL
  ------------------
  119|      0|    }
  120|       |
  121|  1.26k|    context->doPad = PR_FALSE;
  ------------------
  |  |  438|  1.26k|#define PR_FALSE 0
  ------------------
  122|  1.26k|    context->multi = PR_TRUE; /* All message are 'multi' operations */
  ------------------
  |  |  437|  1.26k|#define PR_TRUE 1
  ------------------
  123|       |
  124|  1.26k|    switch (pMechanism->mechanism) {
  125|  1.24k|        case CKM_AES_GCM:
  ------------------
  |  | 1115|  1.24k|#define CKM_AES_GCM 0x00001087UL
  ------------------
  |  Branch (125:9): [True: 1.24k, False: 26]
  ------------------
  126|  1.24k|            context->cipherInfo = AES_CreateContext(
  127|  1.24k|                (unsigned char *)att->attrib.pValue,
  128|  1.24k|                NULL, NSS_AES_GCM, encrypt, att->attrib.ulValueLen,
  ------------------
  |  |   39|  1.24k|#define NSS_AES_GCM 4
  ------------------
  129|  1.24k|                AES_BLOCK_SIZE);
  ------------------
  |  |  130|  1.24k|#define AES_BLOCK_SIZE 16 /* bytes */
  ------------------
  130|  1.24k|            context->aeadUpdate = sftk_AES_AEAD;
  131|  1.24k|            context->destroy = sftk_AES_DestroyContext;
  132|  1.24k|            break;
  133|     26|        case CKM_CHACHA20_POLY1305:
  ------------------
  |  | 1287|     26|#define CKM_CHACHA20_POLY1305 0x00004021UL
  ------------------
  |  Branch (133:9): [True: 26, False: 1.24k]
  ------------------
  134|     26|            context->cipherInfo = ChaCha20Poly1305_CreateContext(
  135|     26|                (unsigned char *)att->attrib.pValue, att->attrib.ulValueLen,
  136|     26|                16);
  137|     26|            context->aeadUpdate = (encrypt ? sftk_ChaCha20_Poly1305_Message_Encrypt : sftk_ChaCha20_Poly1305_Message_Decrypt);
  ------------------
  |  Branch (137:36): [True: 9, False: 17]
  ------------------
  138|     26|            context->destroy = sftk_ChaCha20Poly1305_DestroyContext;
  139|     26|            break;
  140|      0|        default:
  ------------------
  |  Branch (140:9): [True: 0, False: 1.26k]
  ------------------
  141|      0|            crv = CKR_MECHANISM_INVALID;
  ------------------
  |  | 1447|      0|#define CKR_MECHANISM_INVALID 0x00000070UL
  ------------------
  142|      0|            break;
  143|  1.26k|    }
  144|  1.26k|    if (context->cipherInfo == NULL) {
  ------------------
  |  Branch (144:9): [True: 0, False: 1.26k]
  ------------------
  145|      0|        crv = sftk_MapCryptError(PORT_GetError());
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  146|      0|        if (crv == CKR_OK) {
  ------------------
  |  | 1388|      0|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (146:13): [True: 0, False: 0]
  ------------------
  147|      0|            crv = CKR_GENERAL_ERROR;
  ------------------
  |  | 1396|      0|#define CKR_GENERAL_ERROR 0x00000005UL
  ------------------
  148|      0|        }
  149|      0|    }
  150|  1.26k|    if (crv != CKR_OK) {
  ------------------
  |  | 1388|  1.26k|#define CKR_OK 0x00000000UL
  ------------------
  |  Branch (150:9): [True: 0, False: 1.26k]
  ------------------
  151|      0|        sftk_FreeContext(context);
  152|      0|        sftk_FreeSession(session);
  153|      0|        return crv;
  154|      0|    }
  155|  1.26k|    sftk_SetContextByType(session, contextType, context);
  156|  1.26k|    sftk_FreeSession(session);
  157|  1.26k|    return CKR_OK;
  ------------------
  |  | 1388|  1.26k|#define CKR_OK 0x00000000UL
  ------------------
  158|  1.26k|}

sftk_parseParameters:
  127|      1|{
  128|      1|    int next;
  129|      1|    char *tmp = NULL;
  130|      1|    const char *index;
  131|      1|    char *certPrefix = NULL, *keyPrefix = NULL;
  132|      1|    char *tokdes = NULL, *ptokdes = NULL, *pupdtokdes = NULL;
  133|      1|    char *slotdes = NULL, *pslotdes = NULL;
  134|      1|    char *fslotdes = NULL, *ftokdes = NULL;
  135|      1|    char *minPW = NULL;
  136|      1|    index = NSSUTIL_ArgStrip(param);
  137|       |
  138|      1|    PORT_Memset(parsed, 0, sizeof(sftk_parameters));
  ------------------
  |  |  182|      1|#define PORT_Memset memset
  ------------------
  139|       |
  140|     11|    while (*index) {
  ------------------
  |  Branch (140:12): [True: 10, False: 1]
  ------------------
  141|     10|        NSSUTIL_HANDLE_STRING_ARG(index, parsed->configdir, "configDir=", ;)
  ------------------
  |  |   21|     10|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|     10|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 1, False: 9]
  |  |  ------------------
  |  |   22|      1|        param += sizeof(value) - 1;                               \
  |  |   23|      1|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      1|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      1|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      1|        param += next;                                            \
  |  |   27|      1|        command;                                                  \
  |  |   28|      1|    } else
  ------------------
  142|      9|        NSSUTIL_HANDLE_STRING_ARG(index, parsed->updatedir, "updateDir=", ;)
  ------------------
  |  |   21|      9|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      9|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 1, False: 8]
  |  |  ------------------
  |  |   22|      1|        param += sizeof(value) - 1;                               \
  |  |   23|      1|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      1|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      1|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      1|        param += next;                                            \
  |  |   27|      1|        command;                                                  \
  |  |   28|      1|    } else
  ------------------
  143|      8|        NSSUTIL_HANDLE_STRING_ARG(index, parsed->updateID, "updateID=", ;)
  ------------------
  |  |   21|      8|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      8|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 1, False: 7]
  |  |  ------------------
  |  |   22|      1|        param += sizeof(value) - 1;                               \
  |  |   23|      1|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      1|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      1|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      1|        param += next;                                            \
  |  |   27|      1|        command;                                                  \
  |  |   28|      1|    } else
  ------------------
  144|      7|        NSSUTIL_HANDLE_STRING_ARG(index, parsed->secmodName, "secmod=", ;)
  ------------------
  |  |   21|      7|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      7|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 1, False: 6]
  |  |  ------------------
  |  |   22|      1|        param += sizeof(value) - 1;                               \
  |  |   23|      1|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      1|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      1|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      1|        param += next;                                            \
  |  |   27|      1|        command;                                                  \
  |  |   28|      1|    } else
  ------------------
  145|      6|        NSSUTIL_HANDLE_STRING_ARG(index, parsed->man, "manufacturerID=", ;)
  ------------------
  |  |   21|      6|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      6|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 6]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  146|      6|        NSSUTIL_HANDLE_STRING_ARG(index, parsed->libdes, "libraryDescription=", ;)
  ------------------
  |  |   21|      6|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      6|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 6]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  147|       |        /* constructed values, used so legacy interfaces still work */
  148|      6|        NSSUTIL_HANDLE_STRING_ARG(index, certPrefix, "certPrefix=", ;)
  ------------------
  |  |   21|      6|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      6|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 1, False: 5]
  |  |  ------------------
  |  |   22|      1|        param += sizeof(value) - 1;                               \
  |  |   23|      1|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      1|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      1|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      1|        param += next;                                            \
  |  |   27|      1|        command;                                                  \
  |  |   28|      1|    } else
  ------------------
  149|      5|        NSSUTIL_HANDLE_STRING_ARG(index, keyPrefix, "keyPrefix=", ;)
  ------------------
  |  |   21|      5|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      5|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 1, False: 4]
  |  |  ------------------
  |  |   22|      1|        param += sizeof(value) - 1;                               \
  |  |   23|      1|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      1|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      1|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      1|        param += next;                                            \
  |  |   27|      1|        command;                                                  \
  |  |   28|      1|    } else
  ------------------
  150|      4|        NSSUTIL_HANDLE_STRING_ARG(index, tokdes, "cryptoTokenDescription=", ;)
  ------------------
  |  |   21|      4|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      4|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  151|      4|        NSSUTIL_HANDLE_STRING_ARG(index, ptokdes, "dbTokenDescription=", ;)
  ------------------
  |  |   21|      4|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      4|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  152|      4|        NSSUTIL_HANDLE_STRING_ARG(index, slotdes, "cryptoSlotDescription=", ;)
  ------------------
  |  |   21|      4|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      4|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  153|      4|        NSSUTIL_HANDLE_STRING_ARG(index, pslotdes, "dbSlotDescription=", ;)
  ------------------
  |  |   21|      4|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      4|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  154|      4|        NSSUTIL_HANDLE_STRING_ARG(index, fslotdes, "FIPSSlotDescription=", ;)
  ------------------
  |  |   21|      4|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      4|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  155|      4|        NSSUTIL_HANDLE_STRING_ARG(index, ftokdes, "FIPSTokenDescription=", ;)
  ------------------
  |  |   21|      4|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      4|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 4]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  156|      4|        NSSUTIL_HANDLE_STRING_ARG(index, pupdtokdes, "updateTokenDescription=", ;)
  ------------------
  |  |   21|      4|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      4|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 1, False: 3]
  |  |  ------------------
  |  |   22|      1|        param += sizeof(value) - 1;                               \
  |  |   23|      1|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      1|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      1|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      1|        param += next;                                            \
  |  |   27|      1|        command;                                                  \
  |  |   28|      1|    } else
  ------------------
  157|      3|        NSSUTIL_HANDLE_STRING_ARG(index, minPW, "minPWLen=", ;)
  ------------------
  |  |   21|      3|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      3|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 3]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  158|       |
  159|      3|        NSSUTIL_HANDLE_STRING_ARG(
  ------------------
  |  |   21|      3|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      3|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 1, False: 2]
  |  |  ------------------
  |  |   22|      1|        param += sizeof(value) - 1;                               \
  |  |   23|      1|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      1|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      1|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      1|        param += next;                                            \
  |  |   27|      2|        command;                                                  \
  |  |  ------------------
  |  |  |  Branch (27:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   28|      1|    } else
  ------------------
  160|      3|            index, tmp, "flags=",
  161|      3|            if (tmp) { sftk_parseFlags(param,parsed); PORT_Free(tmp); tmp = NULL; })
  162|      2|        NSSUTIL_HANDLE_STRING_ARG(
  ------------------
  |  |   21|      2|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      2|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |  ------------------
  |  |  |  Branch (27:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   28|      0|    } else
  ------------------
  163|      2|            index, tmp, "tokens=",
  164|      2|            if (tmp) { sftk_parseTokens(tmp,parsed); PORT_Free(tmp); tmp = NULL; })
  165|      2|        NSSUTIL_HANDLE_FINAL_ARG(index)
  ------------------
  |  |   31|      2|    {                                            \
  |  |   32|      2|        param = NSSUTIL_ArgSkipParameter(param); \
  |  |   33|      2|    }                                            \
  |  |   34|     10|    param = NSSUTIL_ArgStrip(param);
  ------------------
  166|     10|    }
  167|      1|    if (parsed->tokens == NULL) {
  ------------------
  |  Branch (167:9): [True: 1, False: 0]
  ------------------
  168|      1|        int count = isFIPS ? 1 : 2;
  ------------------
  |  Branch (168:21): [True: 0, False: 1]
  ------------------
  169|      1|        int i = count - 1;
  170|      1|        sftk_token_parameters *tokens = NULL;
  171|       |
  172|      1|        tokens = (sftk_token_parameters *)
  173|      1|            PORT_ZAlloc(count * sizeof(sftk_token_parameters));
  ------------------
  |  |   72|      1|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  174|      1|        if (tokens == NULL) {
  ------------------
  |  Branch (174:13): [True: 0, False: 1]
  ------------------
  175|      0|            goto loser;
  176|      0|        }
  177|      1|        parsed->tokens = tokens;
  178|      1|        parsed->token_count = count;
  179|      1|        tokens[i].slotID = isFIPS ? FIPS_SLOT_ID : PRIVATE_KEY_SLOT_ID;
  ------------------
  |  |  500|      0|#define FIPS_SLOT_ID 3
  ------------------
                      tokens[i].slotID = isFIPS ? FIPS_SLOT_ID : PRIVATE_KEY_SLOT_ID;
  ------------------
  |  |  499|      2|#define PRIVATE_KEY_SLOT_ID 2
  ------------------
  |  Branch (179:28): [True: 0, False: 1]
  ------------------
  180|      1|        tokens[i].certPrefix = certPrefix;
  181|      1|        tokens[i].keyPrefix = keyPrefix;
  182|      1|        tokens[i].minPW = minPW ? atoi(minPW) : 0;
  ------------------
  |  Branch (182:27): [True: 0, False: 1]
  ------------------
  183|      1|        tokens[i].readOnly = parsed->readOnly;
  184|      1|        tokens[i].noCertDB = parsed->noCertDB;
  185|      1|        tokens[i].noKeyDB = parsed->noCertDB;
  186|      1|        tokens[i].forceOpen = parsed->forceOpen;
  187|      1|        tokens[i].pwRequired = parsed->pwRequired;
  188|      1|        tokens[i].optimizeSpace = parsed->optimizeSpace;
  189|      1|        tokens[0].optimizeSpace = parsed->optimizeSpace;
  190|      1|        certPrefix = NULL;
  191|      1|        keyPrefix = NULL;
  192|      1|        if (isFIPS) {
  ------------------
  |  Branch (192:13): [True: 0, False: 1]
  ------------------
  193|      0|            tokens[i].tokdes = ftokdes;
  194|      0|            tokens[i].updtokdes = pupdtokdes;
  195|      0|            tokens[i].slotdes = fslotdes;
  196|      0|            fslotdes = NULL;
  197|      0|            ftokdes = NULL;
  198|      0|            pupdtokdes = NULL;
  199|      1|        } else {
  200|      1|            tokens[i].tokdes = ptokdes;
  201|      1|            tokens[i].updtokdes = pupdtokdes;
  202|      1|            tokens[i].slotdes = pslotdes;
  203|      1|            tokens[0].slotID = NETSCAPE_SLOT_ID;
  ------------------
  |  |  498|      1|#define NETSCAPE_SLOT_ID 1
  ------------------
  204|      1|            tokens[0].tokdes = tokdes;
  205|      1|            tokens[0].slotdes = slotdes;
  206|      1|            tokens[0].noCertDB = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  207|      1|            tokens[0].noKeyDB = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  208|      1|            pupdtokdes = NULL;
  209|      1|            ptokdes = NULL;
  210|      1|            pslotdes = NULL;
  211|      1|            tokdes = NULL;
  212|      1|            slotdes = NULL;
  213|      1|        }
  214|      1|    }
  215|       |
  216|      1|loser:
  217|      1|    FREE_CLEAR(certPrefix);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  218|      1|    FREE_CLEAR(keyPrefix);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  219|      1|    FREE_CLEAR(tokdes);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  220|      1|    FREE_CLEAR(ptokdes);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  221|      1|    FREE_CLEAR(pupdtokdes);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  222|      1|    FREE_CLEAR(slotdes);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  223|      1|    FREE_CLEAR(pslotdes);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  224|      1|    FREE_CLEAR(fslotdes);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  225|      1|    FREE_CLEAR(ftokdes);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  226|      1|    FREE_CLEAR(minPW);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  227|      1|    return CKR_OK;
  ------------------
  |  | 1388|      1|#define CKR_OK 0x00000000UL
  ------------------
  228|      1|}
sftk_freeParams:
  232|      1|{
  233|      1|    int i;
  234|       |
  235|      3|    for (i = 0; i < params->token_count; i++) {
  ------------------
  |  Branch (235:17): [True: 2, False: 1]
  ------------------
  236|      2|        FREE_CLEAR(params->tokens[i].configdir);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  237|      2|        FREE_CLEAR(params->tokens[i].certPrefix);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 1, False: 1]
  |  |  ------------------
  |  |   17|      1|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      1|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      1|        p = NULL;     \
  |  |   19|      1|    }
  ------------------
  238|      2|        FREE_CLEAR(params->tokens[i].keyPrefix);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 1, False: 1]
  |  |  ------------------
  |  |   17|      1|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      1|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      1|        p = NULL;     \
  |  |   19|      1|    }
  ------------------
  239|      2|        FREE_CLEAR(params->tokens[i].tokdes);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  240|      2|        FREE_CLEAR(params->tokens[i].slotdes);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  241|      2|        FREE_CLEAR(params->tokens[i].updatedir);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  242|      2|        FREE_CLEAR(params->tokens[i].updCertPrefix);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  243|      2|        FREE_CLEAR(params->tokens[i].updKeyPrefix);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  244|      2|        FREE_CLEAR(params->tokens[i].updateID);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  245|      2|        FREE_CLEAR(params->tokens[i].updtokdes);
  ------------------
  |  |   16|      2|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 1, False: 1]
  |  |  ------------------
  |  |   17|      1|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      1|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      1|        p = NULL;     \
  |  |   19|      1|    }
  ------------------
  246|      2|    }
  247|       |
  248|      1|    FREE_CLEAR(params->configdir);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   17|      1|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      1|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      1|        p = NULL;     \
  |  |   19|      1|    }
  ------------------
  249|      1|    FREE_CLEAR(params->secmodName);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   17|      1|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      1|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      1|        p = NULL;     \
  |  |   19|      1|    }
  ------------------
  250|      1|    FREE_CLEAR(params->man);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  251|      1|    FREE_CLEAR(params->libdes);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   17|      0|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      0|        p = NULL;     \
  |  |   19|      0|    }
  ------------------
  252|      1|    FREE_CLEAR(params->tokens);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   17|      1|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      1|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      1|        p = NULL;     \
  |  |   19|      1|    }
  ------------------
  253|      1|    FREE_CLEAR(params->updatedir);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   17|      1|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      1|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      1|        p = NULL;     \
  |  |   19|      1|    }
  ------------------
  254|      1|    FREE_CLEAR(params->updateID);
  ------------------
  |  |   16|      1|    if (p) {          \
  |  |  ------------------
  |  |  |  Branch (16:9): [True: 1, False: 0]
  |  |  ------------------
  |  |   17|      1|        PORT_Free(p); \
  |  |  ------------------
  |  |  |  |   60|      1|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   18|      1|        p = NULL;     \
  |  |   19|      1|    }
  ------------------
  255|      1|}
sftkpars.c:sftk_parseFlags:
   35|      1|{
   36|      1|    parsed->noModDB = NSSUTIL_ArgHasFlag("flags", "noModDB", tmp);
   37|      1|    parsed->readOnly = NSSUTIL_ArgHasFlag("flags", "readOnly", tmp);
   38|       |    /* keep legacy interface working */
   39|      1|    parsed->noCertDB = NSSUTIL_ArgHasFlag("flags", "noCertDB", tmp);
   40|      1|    parsed->forceOpen = NSSUTIL_ArgHasFlag("flags", "forceOpen", tmp);
   41|      1|    parsed->pwRequired = NSSUTIL_ArgHasFlag("flags", "passwordRequired", tmp);
   42|      1|    parsed->optimizeSpace = NSSUTIL_ArgHasFlag("flags", "optimizeSpace", tmp);
   43|      1|    return;
   44|      1|}

sftk_TLSPRFInit:
  158|  1.89k|{
  159|  1.89k|    SFTKAttribute *keyVal;
  160|  1.89k|    TLSPRFContext *prf_cx;
  161|  1.89k|    CK_RV crv = CKR_HOST_MEMORY;
  ------------------
  |  | 1390|  1.89k|#define CKR_HOST_MEMORY 0x00000002UL
  ------------------
  162|  1.89k|    PRUint32 keySize;
  163|  1.89k|    PRUint32 blockSize;
  164|       |
  165|  1.89k|    if (key_type != CKK_GENERIC_SECRET)
  ------------------
  |  |  383|  1.89k|#define CKK_GENERIC_SECRET 0x00000010UL
  ------------------
  |  Branch (165:9): [True: 0, False: 1.89k]
  ------------------
  166|      0|        return CKR_KEY_TYPE_INCONSISTENT; /* CKR_KEY_FUNCTION_NOT_PERMITTED */
  ------------------
  |  | 1433|      0|#define CKR_KEY_TYPE_INCONSISTENT 0x00000063UL
  ------------------
  167|       |
  168|  1.89k|    context->multi = PR_TRUE;
  ------------------
  |  |  437|  1.89k|#define PR_TRUE 1
  ------------------
  169|       |
  170|  1.89k|    keyVal = sftk_FindAttribute(key, CKA_VALUE);
  ------------------
  |  |  516|  1.89k|#define CKA_VALUE 0x00000011UL
  ------------------
  171|  1.89k|    keySize = (!keyVal) ? 0 : keyVal->attrib.ulValueLen;
  ------------------
  |  Branch (171:15): [True: 0, False: 1.89k]
  ------------------
  172|  1.89k|    blockSize = keySize + sizeof(TLSPRFContext);
  173|  1.89k|    prf_cx = (TLSPRFContext *)PORT_Alloc(blockSize);
  ------------------
  |  |   52|  1.89k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  174|  1.89k|    if (!prf_cx)
  ------------------
  |  Branch (174:9): [True: 0, False: 1.89k]
  ------------------
  175|      0|        goto done;
  176|  1.89k|    prf_cx->cxSize = blockSize;
  177|  1.89k|    prf_cx->cxKeyLen = keySize;
  178|  1.89k|    prf_cx->cxDataLen = 0;
  179|  1.89k|    prf_cx->cxBufSize = blockSize - offsetof(TLSPRFContext, cxBuf);
  180|  1.89k|    prf_cx->cxRv = SECSuccess;
  181|  1.89k|    prf_cx->cxIsFIPS = sftk_isFIPS(key->slot->slotID);
  ------------------
  |  |  506|  1.89k|    (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  500|  1.89k|#define FIPS_SLOT_ID 3
  |  |  ------------------
  |  |                   (((id) == FIPS_SLOT_ID) || ((id) >= SFTK_MIN_FIPS_USER_SLOT_ID))
  |  |  ------------------
  |  |  |  |  567|  1.89k|#define SFTK_MIN_FIPS_USER_SLOT_ID 101
  |  |  ------------------
  |  |  |  Branch (506:6): [True: 0, False: 1.89k]
  |  |  |  Branch (506:32): [True: 0, False: 1.89k]
  |  |  ------------------
  ------------------
  182|  1.89k|    prf_cx->cxBufPtr = prf_cx->cxBuf;
  183|  1.89k|    prf_cx->cxHashAlg = hash_alg;
  184|  1.89k|    prf_cx->cxOutLen = out_len;
  185|  1.89k|    if (keySize)
  ------------------
  |  Branch (185:9): [True: 1.89k, False: 0]
  ------------------
  186|  1.89k|        PORT_Memcpy(prf_cx->cxBufPtr, keyVal->attrib.pValue, keySize);
  ------------------
  |  |  180|  1.89k|#define PORT_Memcpy memcpy
  ------------------
  187|       |
  188|  1.89k|    context->hashInfo = (void *)prf_cx;
  189|  1.89k|    context->cipherInfo = (void *)prf_cx;
  190|  1.89k|    context->hashUpdate = sftk_TLSPRFHashUpdate;
  191|  1.89k|    context->end = sftk_TLSPRFEnd;
  192|  1.89k|    context->update = sftk_TLSPRFUpdate;
  193|  1.89k|    context->verify = sftk_TLSPRFVerify;
  194|  1.89k|    context->destroy = sftk_TLSPRFNull;
  195|  1.89k|    context->hashdestroy = sftk_TLSPRFHashDestroy;
  196|  1.89k|    crv = CKR_OK;
  ------------------
  |  | 1388|  1.89k|#define CKR_OK 0x00000000UL
  ------------------
  197|       |
  198|  1.89k|done:
  199|  1.89k|    if (keyVal)
  ------------------
  |  Branch (199:9): [True: 1.89k, False: 0]
  ------------------
  200|  1.89k|        sftk_FreeAttribute(keyVal);
  201|  1.89k|    return crv;
  202|  1.89k|}
tlsprf.c:sftk_TLSPRFHashUpdate:
   33|  3.79k|{
   34|  3.79k|    TLSPRFContext *cx = ctx;
   35|  3.79k|    PRUint32 bytesUsed = cx->cxKeyLen + cx->cxDataLen;
   36|       |
   37|  3.79k|    if (cx->cxRv != SECSuccess) /* function has previously failed. */
  ------------------
  |  Branch (37:9): [True: 0, False: 3.79k]
  ------------------
   38|      0|        return;
   39|  3.79k|    if (bytesUsed + data_len > cx->cxBufSize) {
  ------------------
  |  Branch (39:9): [True: 0, False: 3.79k]
  ------------------
   40|       |        /* We don't use realloc here because
   41|       |        ** (a) realloc doesn't zero out the old block, and
   42|       |        ** (b) if realloc fails, we lose the old block.
   43|       |        */
   44|      0|        PRUint32 newBufSize = bytesUsed + data_len + 512;
   45|      0|        unsigned char *newBuf = (unsigned char *)PORT_Alloc(newBufSize);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
   46|      0|        if (!newBuf) {
  ------------------
  |  Branch (46:13): [True: 0, False: 0]
  ------------------
   47|      0|            cx->cxRv = SECFailure;
   48|      0|            return;
   49|      0|        }
   50|      0|        PORT_Memcpy(newBuf, cx->cxBufPtr, bytesUsed);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
   51|      0|        if (cx->cxBufPtr != cx->cxBuf) {
  ------------------
  |  Branch (51:13): [True: 0, False: 0]
  ------------------
   52|      0|            PORT_ZFree(cx->cxBufPtr, bytesUsed);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
   53|      0|        }
   54|      0|        cx->cxBufPtr = newBuf;
   55|      0|        cx->cxBufSize = newBufSize;
   56|      0|    }
   57|  3.79k|    PORT_Memcpy(cx->cxBufPtr + bytesUsed, data, data_len);
  ------------------
  |  |  180|  3.79k|#define PORT_Memcpy memcpy
  ------------------
   58|  3.79k|    cx->cxDataLen += data_len;
   59|  3.79k|}
tlsprf.c:sftk_TLSPRFEnd:
   64|  1.89k|{
   65|  1.89k|    *pDigestLen = 0; /* tells Verify that no data has been input yet. */
   66|  1.89k|}
tlsprf.c:sftk_TLSPRFUpdate:
   76|  1.89k|{
   77|  1.89k|    TLSPRFContext *cx = ctx;
   78|  1.89k|    SECStatus rv;
   79|  1.89k|    SECItem sigItem;
   80|  1.89k|    SECItem seedItem;
   81|  1.89k|    SECItem secretItem;
   82|       |
   83|  1.89k|    if (cx->cxRv != SECSuccess)
  ------------------
  |  Branch (83:9): [True: 0, False: 1.89k]
  ------------------
   84|      0|        return cx->cxRv;
   85|       |
   86|  1.89k|    secretItem.data = cx->cxBufPtr;
   87|  1.89k|    secretItem.len = cx->cxKeyLen;
   88|       |
   89|  1.89k|    seedItem.data = cx->cxBufPtr + cx->cxKeyLen;
   90|  1.89k|    seedItem.len = cx->cxDataLen;
   91|       |
   92|  1.89k|    sigItem.data = sig;
   93|  1.89k|    if (cx->cxOutLen == 0) {
  ------------------
  |  Branch (93:9): [True: 0, False: 1.89k]
  ------------------
   94|      0|        sigItem.len = maxLen;
   95|  1.89k|    } else if (cx->cxOutLen <= maxLen) {
  ------------------
  |  Branch (95:16): [True: 1.89k, False: 0]
  ------------------
   96|  1.89k|        sigItem.len = cx->cxOutLen;
   97|  1.89k|    } else {
   98|      0|        PORT_SetError(SEC_ERROR_OUTPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   99|      0|        return SECFailure;
  100|      0|    }
  101|       |
  102|  1.89k|    if (cx->cxHashAlg != HASH_AlgNULL) {
  ------------------
  |  Branch (102:9): [True: 1.72k, False: 171]
  ------------------
  103|  1.72k|        rv = TLS_P_hash(cx->cxHashAlg, &secretItem, NULL, &seedItem, &sigItem,
  104|  1.72k|                        cx->cxIsFIPS);
  105|  1.72k|    } else {
  106|    171|        rv = TLS_PRF(&secretItem, NULL, &seedItem, &sigItem, cx->cxIsFIPS);
  107|    171|    }
  108|  1.89k|    if (rv == SECSuccess && sigLen != NULL)
  ------------------
  |  Branch (108:9): [True: 1.89k, False: 0]
  |  Branch (108:29): [True: 1.89k, False: 0]
  ------------------
  109|  1.89k|        *sigLen = sigItem.len;
  110|  1.89k|    return rv;
  111|  1.89k|}
tlsprf.c:sftk_TLSPRFNull:
   13|  1.89k|{
   14|  1.89k|    return;
   15|  1.89k|}
tlsprf.c:sftk_TLSPRFHashDestroy:
  143|  1.89k|{
  144|  1.89k|    TLSPRFContext *cx = ctx;
  145|  1.89k|    if (freeit) {
  ------------------
  |  Branch (145:9): [True: 1.89k, False: 0]
  ------------------
  146|  1.89k|        if (cx->cxBufPtr != cx->cxBuf)
  ------------------
  |  Branch (146:13): [True: 0, False: 1.89k]
  ------------------
  147|      0|            PORT_ZFree(cx->cxBufPtr, cx->cxBufSize);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  148|  1.89k|        PORT_ZFree(cx, cx->cxSize);
  ------------------
  |  |   75|  1.89k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  149|  1.89k|    }
  150|  1.89k|}

dtls13_RememberFragment:
  128|  20.7k|{
  129|  20.7k|    DTLSHandshakeRecordEntry *entry;
  130|       |
  131|  20.7k|    PORT_Assert(IS_DTLS(ss));
  ------------------
  |  |  120|  20.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  20.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 20.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  132|       |    /* We should never send an empty fragment with offset > 0. */
  133|  20.7k|    PORT_Assert(length || !offset);
  ------------------
  |  |  120|  20.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  27.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 14.5k, False: 6.28k]
  |  |  |  |  |  Branch (208:7): [True: 6.28k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  134|       |
  135|  20.7k|    if (!tls13_MaybeTls13(ss)) {
  ------------------
  |  Branch (135:9): [True: 4.94k, False: 15.8k]
  ------------------
  136|  4.94k|        return SECSuccess;
  137|  4.94k|    }
  138|       |
  139|  15.8k|    SSL_TRC(20, ("%d: SSL3[%d]: %s remembering %s record=%llx msg=%d offset=%d",
  ------------------
  |  |   71|  15.8k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 15.8k]
  |  |  ------------------
  |  |   72|  15.8k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  140|  15.8k|                 SSL_GETPID(), ss->fd,
  141|  15.8k|                 SSL_ROLE(ss),
  142|  15.8k|                 list == &ss->ssl3.hs.dtlsSentHandshake ? "sent" : "received",
  143|  15.8k|                 dtls_CombineSequenceNumber(epoch, record), sequence, offset));
  144|       |
  145|  15.8k|    entry = PORT_ZAlloc(sizeof(DTLSHandshakeRecordEntry));
  ------------------
  |  |   72|  15.8k|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  146|  15.8k|    if (!entry) {
  ------------------
  |  Branch (146:9): [True: 0, False: 15.8k]
  ------------------
  147|      0|        return SECFailure;
  148|      0|    }
  149|       |
  150|  15.8k|    entry->messageSeq = sequence;
  151|  15.8k|    entry->offset = offset;
  152|  15.8k|    entry->length = length;
  153|  15.8k|    entry->record = dtls_CombineSequenceNumber(epoch, record);
  154|  15.8k|    entry->acked = PR_FALSE;
  ------------------
  |  |  438|  15.8k|#define PR_FALSE 0
  ------------------
  155|       |
  156|  15.8k|    PR_APPEND_LINK(&entry->link, list);
  ------------------
  |  |   57|  15.8k|#define PR_APPEND_LINK(_e,_l) PR_INSERT_BEFORE(_e,_l)
  |  |  ------------------
  |  |  |  |   25|  15.8k|    PR_BEGIN_MACRO       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  15.8k|#define PR_BEGIN_MACRO  do {
  |  |  |  |  ------------------
  |  |  |  |   26|  15.8k|    (_e)->next = (_l);   \
  |  |  |  |   27|  15.8k|    (_e)->prev = (_l)->prev; \
  |  |  |  |   28|  15.8k|    (_l)->prev->next = (_e); \
  |  |  |  |   29|  15.8k|    (_l)->prev = (_e);   \
  |  |  |  |   30|  15.8k|    PR_END_MACRO
  |  |  |  |  ------------------
  |  |  |  |  |  |  124|  15.8k|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|       |
  158|  15.8k|    return SECSuccess;
  159|  15.8k|}
dtls13_SendAck:
  164|     11|{
  165|     11|    sslBuffer buf = SSL_BUFFER_EMPTY;
  ------------------
  |  |   23|     11|    {                        \
  |  |   24|     11|        NULL, 0, 0, PR_FALSE \
  |  |  ------------------
  |  |  |  |  438|     11|#define PR_FALSE 0
  |  |  ------------------
  |  |   25|     11|    }
  ------------------
  166|     11|    SECStatus rv = SECSuccess;
  167|     11|    PRCList *cursor;
  168|     11|    PRInt32 sent;
  169|     11|    unsigned int offset = 0;
  170|       |
  171|     11|    SSL_TRC(10, ("%d: SSL3[%d]: Sending ACK",
  ------------------
  |  |   71|     11|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 11]
  |  |  ------------------
  |  |   72|     11|    ssl_Trace b
  ------------------
  172|     11|                 SSL_GETPID(), ss->fd));
  173|       |
  174|       |    /*    RecordNumber record_numbers<0..2^16-1>;
  175|       |    2 length bytes for the list of ACKs*/
  176|     11|    PRUint32 sizeOfListACK = 2;
  177|     11|    rv = sslBuffer_Skip(&buf, sizeOfListACK, &offset);
  178|     11|    if (rv != SECSuccess) {
  ------------------
  |  Branch (178:9): [True: 0, False: 11]
  ------------------
  179|      0|        goto loser;
  180|      0|    }
  181|     11|    for (cursor = PR_LIST_HEAD(&ss->ssl3.hs.dtlsRcvdHandshake);
  ------------------
  |  |   65|     11|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
  182|    131|         cursor != &ss->ssl3.hs.dtlsRcvdHandshake;
  ------------------
  |  Branch (182:10): [True: 120, False: 11]
  ------------------
  183|    120|         cursor = PR_NEXT_LINK(cursor)) {
  ------------------
  |  |   47|    120|        ((_e)->next)
  ------------------
  184|    120|        DTLSHandshakeRecordEntry *entry = (DTLSHandshakeRecordEntry *)cursor;
  185|       |
  186|    120|        SSL_TRC(10, ("%d: SSL3[%d]: ACK for record=%llx",
  ------------------
  |  |   71|    120|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 120]
  |  |  ------------------
  |  |   72|    120|    ssl_Trace b
  ------------------
  187|    120|                     SSL_GETPID(), ss->fd, entry->record));
  188|       |
  189|       |        /*See dtls_CombineSequenceNumber function */
  190|    120|        PRUint64 epoch = entry->record >> 48;
  191|    120|        PRUint64 seqNum = entry->record & 0xffffffffffff;
  192|       |
  193|    120|        rv = sslBuffer_AppendNumber(&buf, epoch, 8);
  194|    120|        if (rv != SECSuccess) {
  ------------------
  |  Branch (194:13): [True: 0, False: 120]
  ------------------
  195|      0|            goto loser;
  196|      0|        }
  197|       |
  198|    120|        rv = sslBuffer_AppendNumber(&buf, seqNum, 8);
  199|    120|        if (rv != SECSuccess) {
  ------------------
  |  Branch (199:13): [True: 0, False: 120]
  ------------------
  200|      0|            goto loser;
  201|      0|        }
  202|    120|    }
  203|       |
  204|     11|    rv = sslBuffer_InsertLength(&buf, offset, sizeOfListACK);
  205|     11|    if (rv != SECSuccess) {
  ------------------
  |  Branch (205:9): [True: 0, False: 11]
  ------------------
  206|      0|        goto loser;
  207|      0|    }
  208|       |
  209|     11|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|     11|    {                                           \
  |  | 1467|     11|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 9, False: 2]
  |  |  ------------------
  |  | 1468|     11|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|      9|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|     11|    }
  ------------------
  210|     11|    sent = ssl3_SendRecord(ss, NULL, ssl_ct_ack,
  211|     11|                           buf.buf, buf.len, 0);
  212|     11|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|     11|    {                                          \
  |  | 1472|     11|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 9, False: 2]
  |  |  ------------------
  |  | 1473|     11|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|      9|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|     11|    }
  ------------------
  213|     11|    if (sent != buf.len) {
  ------------------
  |  Branch (213:9): [True: 0, False: 11]
  ------------------
  214|      0|        rv = SECFailure;
  215|      0|        if (sent != -1) {
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  217|      0|        }
  218|      0|    }
  219|       |
  220|     11|loser:
  221|     11|    sslBuffer_Clear(&buf);
  222|     11|    return rv;
  223|     11|}
dtls13_SendAckCb:
  227|     11|{
  228|     11|    if (!IS_DTLS(ss)) {
  ------------------
  |  |  892|     11|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (228:9): [True: 0, False: 11]
  ------------------
  229|      0|        return;
  230|      0|    }
  231|     11|    (void)dtls13_SendAck(ss);
  232|     11|}
dtls13_AeadLimitReached:
  237|  3.92k|{
  238|  3.92k|    if (spec->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  3.92k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (238:9): [True: 0, False: 3.92k]
  ------------------
  239|      0|        switch (spec->cipherDef->calg) {
  240|      0|            case ssl_calg_chacha20:
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            case ssl_calg_aes_gcm:
  ------------------
  |  Branch (241:13): [True: 0, False: 0]
  ------------------
  242|      0|                return spec->deprotectionFailures >= (1ULL << 36);
  243|      0|#ifdef UNSAFE_FUZZER_MODE
  244|      0|            case ssl_calg_null:
  ------------------
  |  Branch (244:13): [True: 0, False: 0]
  ------------------
  245|      0|                return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  246|      0|#endif
  247|      0|            default:
  ------------------
  |  Branch (247:13): [True: 0, False: 0]
  ------------------
  248|      0|                PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|      0|                break;
  250|      0|        }
  251|      0|    }
  252|  3.92k|    return PR_FALSE;
  ------------------
  |  |  438|  3.92k|#define PR_FALSE 0
  ------------------
  253|  3.92k|}
dtls_NextUnackedRange:
  326|  14.5k|{
  327|  14.5k|    PRCList *cur_p;
  328|  14.5k|    PRBool done = PR_FALSE;
  ------------------
  |  |  438|  14.5k|#define PR_FALSE 0
  ------------------
  329|  14.5k|    DTLSHandshakeRecordEntry *entry;
  330|  14.5k|    PRUint32 start;
  331|  14.5k|    PRUint32 end;
  332|       |
  333|  14.5k|    PORT_Assert(IS_DTLS(ss));
  ------------------
  |  |  120|  14.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  334|       |
  335|  14.5k|    *startOut = offset;
  336|  14.5k|    *endOut = len;
  337|  14.5k|    if (!tls13_MaybeTls13(ss)) {
  ------------------
  |  Branch (337:9): [True: 4.94k, False: 9.62k]
  ------------------
  338|  4.94k|        return PR_TRUE;
  ------------------
  |  |  437|  4.94k|#define PR_TRUE 1
  ------------------
  339|  4.94k|    }
  340|       |
  341|       |    /* The message is empty. Use a simple search. */
  342|  9.62k|    if (!len) {
  ------------------
  |  Branch (342:9): [True: 0, False: 9.62k]
  ------------------
  343|      0|        PORT_Assert(!offset);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  344|      0|        return !dtls_IsEmptyMessageAcknowledged(ss, msgSeq, offset);
  345|      0|    }
  346|       |
  347|       |    /* This iterates multiple times over the acknowledgments and only terminates
  348|       |     * when an entire iteration happens without start or end moving.  If that
  349|       |     * happens without start and end crossing each other, then there is a range
  350|       |     * of unacknowledged data.  If they meet, then the message is fully
  351|       |     * acknowledged. */
  352|  9.62k|    start = offset;
  353|  9.62k|    end = len;
  354|  19.2k|    while (!done) {
  ------------------
  |  Branch (354:12): [True: 9.68k, False: 9.55k]
  ------------------
  355|  9.68k|        done = PR_TRUE;
  ------------------
  |  |  437|  9.68k|#define PR_TRUE 1
  ------------------
  356|  9.68k|        for (cur_p = PR_LIST_HEAD(&ss->ssl3.hs.dtlsSentHandshake);
  ------------------
  |  |   65|  9.68k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
  357|  14.1k|             cur_p != &ss->ssl3.hs.dtlsSentHandshake;
  ------------------
  |  Branch (357:14): [True: 4.54k, False: 9.55k]
  ------------------
  358|  9.68k|             cur_p = PR_NEXT_LINK(cur_p)) {
  ------------------
  |  |   47|  4.41k|        ((_e)->next)
  ------------------
  359|  4.54k|            entry = (DTLSHandshakeRecordEntry *)cur_p;
  360|  4.54k|            if (!entry->acked || msgSeq != entry->messageSeq) {
  ------------------
  |  Branch (360:17): [True: 4.21k, False: 328]
  |  Branch (360:34): [True: 139, False: 189]
  ------------------
  361|  4.35k|                continue;
  362|  4.35k|            }
  363|       |
  364|    189|            if (dtls_MoveUnackedStartForward(entry, &start) ||
  ------------------
  |  Branch (364:17): [True: 100, False: 89]
  ------------------
  365|    189|                dtls_MoveUnackedEndBackward(entry, &end)) {
  ------------------
  |  Branch (365:17): [True: 30, False: 59]
  ------------------
  366|    130|                if (start >= end) {
  ------------------
  |  Branch (366:21): [True: 71, False: 59]
  ------------------
  367|       |                    /* The message is all acknowledged. */
  368|     71|                    return PR_FALSE;
  ------------------
  |  |  438|     71|#define PR_FALSE 0
  ------------------
  369|     71|                }
  370|       |                /* Start over again and keep going until we don't move either
  371|       |                 * start or end. */
  372|     59|                done = PR_FALSE;
  ------------------
  |  |  438|     59|#define PR_FALSE 0
  ------------------
  373|     59|                break;
  374|    130|            }
  375|    189|        }
  376|  9.68k|    }
  377|  9.55k|    PORT_Assert(start < end);
  ------------------
  |  |  120|  9.55k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  9.55k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 9.55k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  378|       |
  379|  9.55k|    *startOut = start;
  380|  9.55k|    *endOut = end;
  381|  9.55k|    return PR_TRUE;
  ------------------
  |  |  437|  9.55k|#define PR_TRUE 1
  ------------------
  382|  9.62k|}
dtls13_SetupAcks:
  386|  22.9k|{
  387|  22.9k|    if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  22.9k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (387:9): [True: 20.4k, False: 2.42k]
  ------------------
  388|  20.4k|        return SECSuccess;
  389|  20.4k|    }
  390|       |
  391|  2.42k|    if (ss->ssl3.hs.endOfFlight) {
  ------------------
  |  Branch (391:9): [True: 0, False: 2.42k]
  ------------------
  392|      0|        dtls_CancelTimer(ss, ss->ssl3.hs.ackTimer);
  393|       |
  394|      0|        if (ss->ssl3.hs.ws == idle_handshake && ss->sec.isServer) {
  ------------------
  |  Branch (394:13): [True: 0, False: 0]
  |  Branch (394:49): [True: 0, False: 0]
  ------------------
  395|      0|            SSL_TRC(10, ("%d: SSL3[%d]: dtls_HandleHandshake, sending ACK",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  396|      0|                         SSL_GETPID(), ss->fd));
  397|      0|            return dtls13_SendAck(ss);
  398|      0|        }
  399|      0|        return SECSuccess;
  400|      0|    }
  401|       |
  402|       |    /* We need to send an ACK. */
  403|  2.42k|    if (!ss->ssl3.hs.ackTimer->cb) {
  ------------------
  |  Branch (403:9): [True: 1.08k, False: 1.34k]
  ------------------
  404|       |        /* We're not armed, so arm. */
  405|  1.08k|        SSL_TRC(10, ("%d: SSL3[%d]: dtls_HandleHandshake, arming ack timer",
  ------------------
  |  |   71|  1.08k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.08k]
  |  |  ------------------
  |  |   72|  1.08k|    ssl_Trace b
  ------------------
  406|  1.08k|                     SSL_GETPID(), ss->fd));
  407|  1.08k|        return dtls_StartTimer(ss, ss->ssl3.hs.ackTimer,
  408|  1.08k|                               DTLS_RETRANSMIT_INITIAL_MS / 4,
  ------------------
  |  |  126|  1.08k|#define DTLS_RETRANSMIT_INITIAL_MS 50
  ------------------
  409|  1.08k|                               dtls13_SendAckCb);
  410|  1.08k|    }
  411|       |    /* The ack timer is already armed, so just return. */
  412|  1.34k|    return SECSuccess;
  413|  2.42k|}
dtls13_maybeProcessKeyUpdateAck:
  500|    686|{
  501|       |    /*    RFC 9147. Section 8.
  502|       |    Due to the possibility of an ACK message for a KeyUpdate being lost
  503|       |    and thereby preventing the sender of KeyUpdate from updating its
  504|       |    keying material, receivers MUST retain the pre-update keying material
  505|       |    until receipt and successful decryption of a message using the new
  506|       |    keys.*/
  507|       |
  508|    686|    if (ss->ssl3.hs.isKeyUpdateInProgress && entrySeq == ss->ssl3.hs.dtlsHandhakeKeyUpdateMessage) {
  ------------------
  |  Branch (508:9): [True: 0, False: 686]
  |  Branch (508:46): [True: 0, False: 0]
  ------------------
  509|      0|        SSL_TRC(30, ("%d: DTLS13[%d]: %s key update is completed", SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  510|      0|        PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  511|       |
  512|      0|        SECStatus rv = SECSuccess;
  513|      0|        rv = tls13_UpdateTrafficKeys(ss, ssl_secret_write);
  514|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (514:13): [True: 0, False: 0]
  ------------------
  515|      0|            return SECFailure;
  516|      0|        }
  517|      0|        PORT_Assert(ss->ssl3.hs.isKeyUpdateInProgress);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  518|      0|        ss->ssl3.hs.isKeyUpdateInProgress = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  519|       |
  520|      0|        return rv;
  521|      0|    }
  522|       |
  523|    686|    else
  524|    686|        return SECSuccess;
  525|    686|}
dtls13_HandleAck:
  529|    774|{
  530|    774|    PRUint8 *b = databuf->buf;
  531|    774|    PRUint32 l = databuf->len;
  532|    774|    unsigned int length;
  533|    774|    SECStatus rv;
  534|       |
  535|    774|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    774|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.15k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 392, False: 382]
  |  |  |  |  |  Branch (208:7): [True: 382, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  536|       |
  537|       |    /* Ensure we don't loop. */
  538|    774|    databuf->len = 0;
  539|       |
  540|    774|    PORT_Assert(IS_DTLS(ss));
  ------------------
  |  |  120|    774|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    774|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 774, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  541|    774|    if (!tls13_MaybeTls13(ss)) {
  ------------------
  |  Branch (541:9): [True: 0, False: 774]
  ------------------
  542|      0|        tls13_FatalError(ss, SSL_ERROR_RX_UNKNOWN_RECORD_TYPE, illegal_parameter);
  543|      0|        return SECFailure;
  544|      0|    }
  545|       |
  546|    774|    SSL_TRC(10, ("%d: SSL3[%d]: Handling ACK", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|    774|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 774]
  |  |  ------------------
  |  |   72|    774|    ssl_Trace b
  ------------------
  547|    774|    rv = ssl3_ConsumeHandshakeNumber(ss, &length, 2, &b, &l);
  548|    774|    if (rv != SECSuccess) {
  ------------------
  |  Branch (548:9): [True: 13, False: 761]
  ------------------
  549|     13|        goto loser;
  550|     13|    }
  551|    761|    if (length != l) {
  ------------------
  |  Branch (551:9): [True: 43, False: 718]
  ------------------
  552|     43|        goto loser;
  553|     43|    }
  554|       |
  555|  3.57k|    while (l > 0) {
  ------------------
  |  Branch (555:12): [True: 2.87k, False: 692]
  ------------------
  556|  2.87k|        PRUint64 seq;
  557|  2.87k|        PRUint64 epoch;
  558|  2.87k|        PRCList *cursor;
  559|       |
  560|  2.87k|        rv = ssl3_ConsumeHandshakeNumber64(ss, &epoch, 8, &b, &l);
  561|  2.87k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (561:13): [True: 19, False: 2.85k]
  ------------------
  562|     19|            goto loser;
  563|     19|        }
  564|       |
  565|  2.85k|        rv = ssl3_ConsumeHandshakeNumber64(ss, &seq, 8, &b, &l);
  566|  2.85k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (566:13): [True: 7, False: 2.85k]
  ------------------
  567|      7|            goto loser;
  568|      7|        }
  569|       |
  570|  2.85k|        if (epoch > RECORD_EPOCH_MAX) {
  ------------------
  |  |   16|  2.85k|#define RECORD_EPOCH_MAX UINT16_MAX
  ------------------
  |  Branch (570:13): [True: 1.49k, False: 1.35k]
  ------------------
  571|  1.49k|            SSL_TRC(50, ("%d: SSL3[%d]: ACK message was rejected: the epoch exceeds the limit", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|  1.49k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.49k]
  |  |  ------------------
  |  |   72|  1.49k|    ssl_Trace b
  ------------------
  572|  1.49k|            continue;
  573|  1.49k|        }
  574|  1.35k|        if (seq > RECORD_SEQ_MAX) {
  ------------------
  |  |  126|  1.35k|#define RECORD_SEQ_MAX RECORD_SEQ_MASK
  |  |  ------------------
  |  |  |  |  125|  1.35k|#define RECORD_SEQ_MASK ((1ULL << 48) - 1)
  |  |  ------------------
  ------------------
  |  Branch (574:13): [True: 299, False: 1.05k]
  ------------------
  575|    299|            SSL_TRC(50, ("%d: SSL3[%d]: ACK message was rejected: the sequence number exceeds the limit", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|    299|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 299]
  |  |  ------------------
  |  |   72|    299|    ssl_Trace b
  ------------------
  576|    299|            continue;
  577|    299|        }
  578|       |
  579|  1.05k|        seq = dtls_CombineSequenceNumber(epoch, seq);
  580|       |
  581|  1.05k|        for (cursor = PR_LIST_HEAD(&ss->ssl3.hs.dtlsSentHandshake);
  ------------------
  |  |   65|  1.05k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
  582|  3.15k|             cursor != &ss->ssl3.hs.dtlsSentHandshake;
  ------------------
  |  Branch (582:14): [True: 2.09k, False: 1.05k]
  ------------------
  583|  2.09k|             cursor = PR_NEXT_LINK(cursor)) {
  ------------------
  |  |   47|  2.09k|        ((_e)->next)
  ------------------
  584|  2.09k|            DTLSHandshakeRecordEntry *entry = (DTLSHandshakeRecordEntry *)cursor;
  585|       |
  586|  2.09k|            if (entry->record == seq) {
  ------------------
  |  Branch (586:17): [True: 686, False: 1.40k]
  ------------------
  587|    686|                SSL_TRC(30, (
  ------------------
  |  |   71|    686|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 686]
  |  |  ------------------
  |  |   72|    686|    ssl_Trace b
  ------------------
  588|    686|                                "%d: DTLS13[%d]: Marking record=%llx message %d offset %d length=%d as ACKed",
  589|    686|                                SSL_GETPID(), ss->fd,
  590|    686|                                entry->record, entry->messageSeq, entry->offset, entry->length));
  591|    686|                entry->acked = PR_TRUE;
  ------------------
  |  |  437|    686|#define PR_TRUE 1
  ------------------
  592|       |
  593|       |                /* When we sent a KeyUpdate message, we have recorded the identifier of the message.
  594|       |                During the HandleACK we check if we received an ack for the KeyUpdate message we sent.*/
  595|    686|                rv = dtls13_maybeProcessKeyUpdateAck(ss, entry->messageSeq);
  596|    686|                if (rv != SECSuccess) {
  ------------------
  |  Branch (596:21): [True: 0, False: 686]
  ------------------
  597|      0|                    return SECFailure;
  598|      0|                }
  599|    686|            }
  600|  2.09k|        }
  601|  1.05k|    }
  602|       |    /* Try to flush. */
  603|    692|    rv = dtls_TransmitMessageFlight(ss);
  604|    692|    if (rv != SECSuccess) {
  ------------------
  |  Branch (604:9): [True: 0, False: 692]
  ------------------
  605|      0|        return SECFailure;
  606|      0|    }
  607|       |
  608|       |    /* Reset the retransmit timer. */
  609|    692|    if (ss->ssl3.hs.rtTimer->cb) {
  ------------------
  |  Branch (609:9): [True: 639, False: 53]
  ------------------
  610|    639|        (void)dtls_RestartTimer(ss, ss->ssl3.hs.rtTimer);
  611|    639|    }
  612|       |
  613|       |    /* If there are no more messages to send, cleanup. */
  614|    692|    if (PR_CLIST_IS_EMPTY(&ss->ssl3.hs.lastMessageFlight)) {
  ------------------
  |  |   94|    692|    ((_l)->next == (_l))
  |  |  ------------------
  |  |  |  Branch (94:5): [True: 94, False: 598]
  |  |  ------------------
  ------------------
  615|     94|        SSL_TRC(10, ("%d: SSL3[%d]: No more unacked handshake messages",
  ------------------
  |  |   71|     94|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 94]
  |  |  ------------------
  |  |   72|     94|    ssl_Trace b
  ------------------
  616|     94|                     SSL_GETPID(), ss->fd));
  617|       |
  618|     94|        dtls_CancelTimer(ss, ss->ssl3.hs.rtTimer);
  619|     94|        ssl_ClearPRCList(&ss->ssl3.hs.dtlsSentHandshake, NULL);
  620|       |        /* If the handshake is finished, and we're the client then
  621|       |         * also clean up the handshake read cipher spec. Any ACKs
  622|       |         * we receive will be with the application data cipher spec.
  623|       |         * The server needs to keep the handshake cipher spec around
  624|       |         * for the holddown period to process retransmitted Finisheds.
  625|       |         */
  626|     94|        if (!ss->sec.isServer && (ss->ssl3.hs.ws == idle_handshake)) {
  ------------------
  |  Branch (626:13): [True: 94, False: 0]
  |  Branch (626:34): [True: 0, False: 94]
  ------------------
  627|      0|            ssl_CipherSpecReleaseByEpoch(ss, ssl_secret_read,
  628|      0|                                         TrafficKeyHandshake);
  629|      0|        }
  630|     94|    }
  631|    692|    return SECSuccess;
  632|       |
  633|     82|loser:
  634|       |    /* Due to bug 1829391 we may incorrectly send an alert rather than
  635|       |     * ignore an invalid record here. */
  636|     82|    SSL_TRC(11, ("%d: SSL3[%d]: Error processing DTLS1.3 ACK.",
  ------------------
  |  |   71|     82|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 82]
  |  |  ------------------
  |  |   72|     82|    ssl_Trace b
  ------------------
  637|     82|                 SSL_GETPID(), ss->fd));
  638|     82|    PORT_SetError(SSL_ERROR_RX_MALFORMED_DTLS_ACK);
  ------------------
  |  |   65|     82|#define PORT_SetError PORT_SetError_Util
  ------------------
  639|     82|    return SECFailure;
  640|    692|}
dtls13_MaskSequenceNumber:
  671|  1.44M|{
  672|  1.44M|    PORT_Assert(IS_DTLS(ss));
  ------------------
  |  |  120|  1.44M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.44M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.44M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  673|  1.44M|    if (spec->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  1.44M|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (673:9): [True: 1.44M, False: 296]
  ------------------
  674|  1.44M|        return SECSuccess;
  675|  1.44M|    }
  676|       |
  677|    296|    if (spec->maskContext) {
  ------------------
  |  Branch (677:9): [True: 296, False: 0]
  ------------------
  678|    296|#ifdef UNSAFE_FUZZER_MODE
  679|       |        /* Use a null mask. */
  680|    296|        PRUint8 mask[2] = { 0 };
  681|       |#else
  682|       |        /* "This procedure requires the ciphertext length be at least 16 bytes.
  683|       |         * Receivers MUST reject shorter records as if they had failed
  684|       |         * deprotection, as described in Section 4.5.2." */
  685|       |        if (cipherTextLen < 16) {
  686|       |            PORT_SetError(SSL_ERROR_BAD_MAC_READ);
  687|       |            return SECFailure;
  688|       |        }
  689|       |
  690|       |        PRUint8 mask[2];
  691|       |        SECStatus rv = ssl_CreateMaskInner(spec->maskContext, cipherText, cipherTextLen, mask, sizeof(mask));
  692|       |
  693|       |        if (rv != SECSuccess) {
  694|       |            PORT_SetError(SSL_ERROR_BAD_MAC_READ);
  695|       |            return SECFailure;
  696|       |        }
  697|       |#endif
  698|       |
  699|       |        /*
  700|       |        The encrypted sequence number is computed by XORing the leading bytes
  701|       |        of the mask with the on-the-wire representation of the sequence
  702|       |        number.  Decryption is accomplished by the same process.
  703|       |        */
  704|       |
  705|    296|        PRUint32 maskSBitIsSet = 0x08;
  706|    296|        hdr[1] ^= mask[0];
  707|    296|        if (hdr[0] & maskSBitIsSet) {
  ------------------
  |  Branch (707:13): [True: 2, False: 294]
  ------------------
  708|      2|            hdr[2] ^= mask[1];
  709|      2|        }
  710|    296|    }
  711|    296|    return SECSuccess;
  712|  1.44M|}
tls13_SequenceNumberEncryptionMechanism:
  716|    897|{
  717|       |    /*
  718|       |    When the AEAD is based on AES, then the mask is generated by
  719|       |        computing AES-ECB on the first 16 bytes of the ciphertext:
  720|       |
  721|       |    When the AEAD is based on ChaCha20, then the mask is generated by
  722|       |    treating the first 4 bytes of the ciphertext as the block counter and
  723|       |    the next 12 bytes as the nonce, passing them to the ChaCha20 block
  724|       |    function.
  725|       |    */
  726|       |
  727|    897|    switch (bulkAlgorithm) {
  728|    875|        case ssl_calg_aes_gcm:
  ------------------
  |  Branch (728:9): [True: 875, False: 22]
  ------------------
  729|    875|            return CKM_AES_ECB;
  ------------------
  |  | 1107|    875|#define CKM_AES_ECB 0x00001081UL
  ------------------
  730|     22|        case ssl_calg_chacha20:
  ------------------
  |  Branch (730:9): [True: 22, False: 875]
  ------------------
  731|     22|            return CKM_NSS_CHACHA20_CTR;
  ------------------
  |  |  251|     22|#define CKM_NSS_CHACHA20_CTR (CKM_NSS + 33)
  |  |  ------------------
  |  |  |  |  162|     22|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|     22|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     22|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  732|      0|        default:
  ------------------
  |  Branch (732:9): [True: 0, False: 897]
  ------------------
  733|      0|            PORT_Assert(PR_FALSE);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  734|    897|    }
  735|      0|    return CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|      0|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  736|    897|}
dtls13con.c:dtls_CombineSequenceNumber:
  115|  16.8k|{
  116|  16.8k|    PORT_Assert(seqNum <= RECORD_SEQ_MAX);
  ------------------
  |  |  120|  16.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  16.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 16.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  117|  16.8k|    return ((sslSequenceNumber)epoch << LENGTH_SEQ_NUMBER) | seqNum;
  ------------------
  |  |  110|  16.8k|#define LENGTH_SEQ_NUMBER 48
  ------------------
  118|  16.8k|}
dtls13con.c:dtls_MoveUnackedStartForward:
  282|    189|{
  283|       |    /* This entry starts too late. */
  284|    189|    if (*start < entry->offset) {
  ------------------
  |  Branch (284:9): [True: 60, False: 129]
  ------------------
  285|     60|        return PR_FALSE;
  ------------------
  |  |  438|     60|#define PR_FALSE 0
  ------------------
  286|     60|    }
  287|       |    /* This entry ends too early. */
  288|    129|    if (*start >= entry->offset + entry->length) {
  ------------------
  |  Branch (288:9): [True: 29, False: 100]
  ------------------
  289|     29|        return PR_FALSE;
  ------------------
  |  |  438|     29|#define PR_FALSE 0
  ------------------
  290|     29|    }
  291|    100|    *start = entry->offset + entry->length;
  292|    100|    return PR_TRUE;
  ------------------
  |  |  437|    100|#define PR_TRUE 1
  ------------------
  293|    129|}
dtls13con.c:dtls_MoveUnackedEndBackward:
  300|     89|{
  301|       |    /* This entry ends too early. */
  302|     89|    if (*end > entry->offset + entry->length) {
  ------------------
  |  Branch (302:9): [True: 29, False: 60]
  ------------------
  303|     29|        return PR_FALSE;
  ------------------
  |  |  438|     29|#define PR_FALSE 0
  ------------------
  304|     29|    }
  305|       |    /* This entry starts too late. */
  306|     60|    if (*end <= entry->offset) {
  ------------------
  |  Branch (306:9): [True: 30, False: 30]
  ------------------
  307|     30|        return PR_FALSE;
  ------------------
  |  |  438|     30|#define PR_FALSE 0
  ------------------
  308|     30|    }
  309|     30|    *end = entry->offset;
  310|     30|    return PR_TRUE;
  ------------------
  |  |  437|     30|#define PR_TRUE 1
  ------------------
  311|     60|}

dtls_TLSVersionToDTLSVersion:
   60|  53.8k|{
   61|  53.8k|    if (tlsv == SSL_LIBRARY_VERSION_TLS_1_1) {
  ------------------
  |  |   19|  53.8k|#define SSL_LIBRARY_VERSION_TLS_1_1             0x0302
  ------------------
  |  Branch (61:9): [True: 8.19k, False: 45.6k]
  ------------------
   62|  8.19k|        return SSL_LIBRARY_VERSION_DTLS_1_0_WIRE;
  ------------------
  |  |   32|  8.19k|#define SSL_LIBRARY_VERSION_DTLS_1_0_WIRE       ((~0x0100) & 0xffff)
  ------------------
   63|  8.19k|    }
   64|  45.6k|    if (tlsv == SSL_LIBRARY_VERSION_TLS_1_2) {
  ------------------
  |  |   20|  45.6k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (64:9): [True: 34.8k, False: 10.8k]
  ------------------
   65|  34.8k|        return SSL_LIBRARY_VERSION_DTLS_1_2_WIRE;
  ------------------
  |  |   33|  34.8k|#define SSL_LIBRARY_VERSION_DTLS_1_2_WIRE       ((~0x0102) & 0xffff)
  ------------------
   66|  34.8k|    }
   67|  10.8k|    if (tlsv == SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  10.8k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (67:9): [True: 10.8k, False: 0]
  ------------------
   68|  10.8k|        return SSL_LIBRARY_VERSION_DTLS_1_3_WIRE;
  ------------------
  |  |   34|  10.8k|#define SSL_LIBRARY_VERSION_DTLS_1_3_WIRE       ((~0x0103) & 0xffff)
  ------------------
   69|  10.8k|    }
   70|       |
   71|       |    /* Anything else is an error, so return
   72|       |     * the invalid version 0xffff. */
   73|      0|    return 0xffff;
   74|  10.8k|}
dtls_DTLSVersionToTLSVersion:
   82|  9.41k|{
   83|  9.41k|    if (MSB(dtlsv) == 0xff) {
  ------------------
  |  |   94|  9.41k|#define MSB(x) ((unsigned char)(((unsigned)(x)) >> 8))
  ------------------
  |  Branch (83:9): [True: 1, False: 9.41k]
  ------------------
   84|      1|        return 0;
   85|      1|    }
   86|       |
   87|  9.41k|    if (dtlsv == SSL_LIBRARY_VERSION_DTLS_1_0_WIRE) {
  ------------------
  |  |   32|  9.41k|#define SSL_LIBRARY_VERSION_DTLS_1_0_WIRE       ((~0x0100) & 0xffff)
  ------------------
  |  Branch (87:9): [True: 628, False: 8.78k]
  ------------------
   88|    628|        return SSL_LIBRARY_VERSION_TLS_1_1;
  ------------------
  |  |   19|    628|#define SSL_LIBRARY_VERSION_TLS_1_1             0x0302
  ------------------
   89|    628|    }
   90|       |    /* Handle the skipped version of DTLS 1.1 by returning
   91|       |     * an error. */
   92|  8.78k|    if (dtlsv == ((~0x0101) & 0xffff)) {
  ------------------
  |  Branch (92:9): [True: 2, False: 8.78k]
  ------------------
   93|      2|        return 0;
   94|      2|    }
   95|  8.78k|    if (dtlsv == SSL_LIBRARY_VERSION_DTLS_1_2_WIRE) {
  ------------------
  |  |   33|  8.78k|#define SSL_LIBRARY_VERSION_DTLS_1_2_WIRE       ((~0x0102) & 0xffff)
  ------------------
  |  Branch (95:9): [True: 8.75k, False: 34]
  ------------------
   96|  8.75k|        return SSL_LIBRARY_VERSION_TLS_1_2;
  ------------------
  |  |   20|  8.75k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
   97|  8.75k|    }
   98|     34|    if (dtlsv == SSL_LIBRARY_VERSION_DTLS_1_3_WIRE) {
  ------------------
  |  |   34|     34|#define SSL_LIBRARY_VERSION_DTLS_1_3_WIRE       ((~0x0103) & 0xffff)
  ------------------
  |  Branch (98:9): [True: 2, False: 32]
  ------------------
   99|      2|        return SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|      2|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  100|      2|    }
  101|       |
  102|       |    /* Return a fictional higher version than we know of */
  103|     32|    return SSL_LIBRARY_VERSION_MAX_SUPPORTED + 1;
  ------------------
  |  | 1497|     32|#define SSL_LIBRARY_VERSION_MAX_SUPPORTED SSL_LIBRARY_VERSION_TLS_1_3
  |  |  ------------------
  |  |  |  |   21|     32|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  |  |  ------------------
  ------------------
  104|     34|}
ssl3_DisableNonDTLSSuites:
  109|  10.2k|{
  110|  10.2k|    const ssl3CipherSuite *suite;
  111|       |
  112|  81.7k|    for (suite = nonDTLSSuites; *suite; ++suite) {
  ------------------
  |  Branch (112:33): [True: 71.5k, False: 10.2k]
  ------------------
  113|  71.5k|        PORT_CheckSuccess(ssl3_CipherPrefSet(ss, *suite, PR_FALSE));
  ------------------
  |  |  144|  71.5k|#define PORT_CheckSuccess(f) PR_ASSERT((f) == SECSuccess)
  |  |  ------------------
  |  |  |  |  208|  71.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 71.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  114|  71.5k|    }
  115|  10.2k|    return SECSuccess;
  116|  10.2k|}
dtls_FreeHandshakeMessage:
  156|  15.5k|{
  157|  15.5k|    if (!msg)
  ------------------
  |  Branch (157:9): [True: 0, False: 15.5k]
  ------------------
  158|      0|        return;
  159|       |
  160|       |    /* Safe if we are < 1.3, since the refct is
  161|       |     * already very high. */
  162|  15.5k|    ssl_CipherSpecRelease(msg->cwSpec);
  163|  15.5k|    PORT_ZFree(msg->data, msg->len);
  ------------------
  |  |   75|  15.5k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  164|  15.5k|    PORT_Free(msg);
  ------------------
  |  |   60|  15.5k|#define PORT_Free PORT_Free_Util
  ------------------
  165|  15.5k|}
dtls_FreeHandshakeMessages:
  176|  17.0k|{
  177|  17.0k|    PRCList *cur_p;
  178|       |
  179|  32.5k|    while (!PR_CLIST_IS_EMPTY(list)) {
  ------------------
  |  |   94|  32.5k|    ((_l)->next == (_l))
  ------------------
  |  Branch (179:12): [True: 15.4k, False: 17.0k]
  ------------------
  180|  15.4k|        cur_p = PR_LIST_TAIL(list);
  ------------------
  |  |   66|  15.4k|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
  181|  15.4k|        PR_REMOVE_LINK(cur_p);
  ------------------
  |  |   72|  15.4k|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|  15.4k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|  15.4k|    (_e)->prev->next = (_e)->next; \
  |  |   74|  15.4k|    (_e)->next->prev = (_e)->prev; \
  |  |   75|  15.4k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  15.4k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  182|  15.4k|        dtls_FreeHandshakeMessage((DTLSQueuedMessage *)cur_p);
  183|  15.4k|    }
  184|  17.0k|}
dtls_HandleHandshake:
  272|  25.7k|{
  273|  25.7k|    sslBuffer buf = *origBuf;
  274|  25.7k|    SECStatus rv = SECSuccess;
  275|  25.7k|    PRBool discarded = PR_FALSE;
  ------------------
  |  |  438|  25.7k|#define PR_FALSE 0
  ------------------
  276|       |
  277|  25.7k|    ss->ssl3.hs.endOfFlight = PR_FALSE;
  ------------------
  |  |  438|  25.7k|#define PR_FALSE 0
  ------------------
  278|       |
  279|  25.7k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  25.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  39.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 12.1k, False: 13.5k]
  |  |  |  |  |  Branch (208:7): [True: 13.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  280|  25.7k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  25.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  39.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 12.1k, False: 13.5k]
  |  |  |  |  |  Branch (208:7): [True: 13.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  281|       |
  282|  45.0k|    while (buf.len > 0) {
  ------------------
  |  Branch (282:12): [True: 22.1k, False: 22.9k]
  ------------------
  283|  22.1k|        PRUint8 type;
  284|  22.1k|        PRUint32 message_length;
  285|  22.1k|        PRUint16 message_seq;
  286|  22.1k|        PRUint32 fragment_offset;
  287|  22.1k|        PRUint32 fragment_length;
  288|  22.1k|        PRUint32 offset;
  289|       |
  290|  22.1k|        if (buf.len < 12) {
  ------------------
  |  Branch (290:13): [True: 36, False: 22.1k]
  ------------------
  291|     36|            PORT_SetError(SSL_ERROR_RX_MALFORMED_HANDSHAKE);
  ------------------
  |  |   65|     36|#define PORT_SetError PORT_SetError_Util
  ------------------
  292|     36|            rv = SECFailure;
  293|     36|            goto loser;
  294|     36|        }
  295|       |
  296|       |        /* Parse the header */
  297|  22.1k|        type = buf.buf[0];
  298|  22.1k|        message_length = (buf.buf[1] << 16) | (buf.buf[2] << 8) | buf.buf[3];
  299|  22.1k|        message_seq = (buf.buf[4] << 8) | buf.buf[5];
  300|  22.1k|        fragment_offset = (buf.buf[6] << 16) | (buf.buf[7] << 8) | buf.buf[8];
  301|  22.1k|        fragment_length = (buf.buf[9] << 16) | (buf.buf[10] << 8) | buf.buf[11];
  302|       |
  303|  22.1k|#define MAX_HANDSHAKE_MSG_LEN 0x1ffff /* 128k - 1 */
  304|  22.1k|        if (message_length > MAX_HANDSHAKE_MSG_LEN) {
  ------------------
  |  |  303|  22.1k|#define MAX_HANDSHAKE_MSG_LEN 0x1ffff /* 128k - 1 */
  ------------------
  |  Branch (304:13): [True: 25, False: 22.0k]
  ------------------
  305|     25|            (void)ssl3_DecodeError(ss);
  306|     25|            PORT_SetError(SSL_ERROR_RX_MALFORMED_HANDSHAKE);
  ------------------
  |  |   65|     25|#define PORT_SetError PORT_SetError_Util
  ------------------
  307|     25|            rv = SECFailure;
  308|     25|            goto loser;
  309|     25|        }
  310|  22.0k|#undef MAX_HANDSHAKE_MSG_LEN
  311|       |
  312|  22.0k|        buf.buf += 12;
  313|  22.0k|        buf.len -= 12;
  314|       |
  315|       |        /* This fragment must be complete */
  316|  22.0k|        if (buf.len < fragment_length) {
  ------------------
  |  Branch (316:13): [True: 38, False: 22.0k]
  ------------------
  317|     38|            PORT_SetError(SSL_ERROR_RX_MALFORMED_HANDSHAKE);
  ------------------
  |  |   65|     38|#define PORT_SetError PORT_SetError_Util
  ------------------
  318|     38|            rv = SECFailure;
  319|     38|            goto loser;
  320|     38|        }
  321|       |
  322|       |        /* Sanity check the packet contents */
  323|  22.0k|        if ((fragment_length + fragment_offset) > message_length) {
  ------------------
  |  Branch (323:13): [True: 37, False: 22.0k]
  ------------------
  324|     37|            PORT_SetError(SSL_ERROR_RX_MALFORMED_HANDSHAKE);
  ------------------
  |  |   65|     37|#define PORT_SetError PORT_SetError_Util
  ------------------
  325|     37|            rv = SECFailure;
  326|     37|            goto loser;
  327|     37|        }
  328|       |
  329|       |        /* If we're a server and we receive what appears to be a retried
  330|       |         * ClientHello, and we are expecting a ClientHello, move the receive
  331|       |         * sequence number forward.  This allows for a retried ClientHello if we
  332|       |         * send a stateless HelloRetryRequest. */
  333|  22.0k|        if (message_seq > ss->ssl3.hs.recvMessageSeq &&
  ------------------
  |  Branch (333:13): [True: 415, False: 21.5k]
  ------------------
  334|  22.0k|            message_seq == 1 &&
  ------------------
  |  Branch (334:13): [True: 171, False: 244]
  ------------------
  335|  22.0k|            fragment_offset == 0 &&
  ------------------
  |  Branch (335:13): [True: 135, False: 36]
  ------------------
  336|  22.0k|            ss->ssl3.hs.ws == wait_client_hello &&
  ------------------
  |  Branch (336:13): [True: 0, False: 135]
  ------------------
  337|  22.0k|            (SSLHandshakeType)type == ssl_hs_client_hello) {
  ------------------
  |  Branch (337:13): [True: 0, False: 0]
  ------------------
  338|      0|            SSL_TRC(5, ("%d: DTLS[%d]: Received apparent 2nd ClientHello",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  339|      0|                        SSL_GETPID(), ss->fd));
  340|      0|            ss->ssl3.hs.recvMessageSeq = 1;
  341|      0|            ss->ssl3.hs.helloRetry = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  342|      0|        }
  343|       |
  344|       |        /* There are three ways we could not be ready for this packet.
  345|       |         *
  346|       |         * 1. It's a partial next message.
  347|       |         * 2. It's a partial or complete message beyond the next
  348|       |         * 3. It's a message we've already seen
  349|       |         *
  350|       |         * If it's the complete next message we accept it right away.
  351|       |         * This is the common case for short messages
  352|       |         */
  353|  22.0k|        if ((message_seq == ss->ssl3.hs.recvMessageSeq) &&
  ------------------
  |  Branch (353:13): [True: 21.1k, False: 805]
  ------------------
  354|  22.0k|            (fragment_offset == 0) &&
  ------------------
  |  Branch (354:13): [True: 19.8k, False: 1.29k]
  ------------------
  355|  22.0k|            (fragment_length == message_length)) {
  ------------------
  |  Branch (355:13): [True: 19.0k, False: 860]
  ------------------
  356|       |            /* Complete next message. Process immediately */
  357|  19.0k|            ss->ssl3.hs.msg_type = (SSLHandshakeType)type;
  358|  19.0k|            ss->ssl3.hs.msg_len = message_length;
  359|       |
  360|  19.0k|            rv = dtls_HandleHandshakeMessage(ss, buf.buf,
  361|  19.0k|                                             buf.len == fragment_length);
  362|  19.0k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (362:17): [True: 2.20k, False: 16.8k]
  ------------------
  363|  2.20k|                goto loser;
  364|  2.20k|            }
  365|  19.0k|        } else {
  366|  2.96k|            if (message_seq < ss->ssl3.hs.recvMessageSeq) {
  ------------------
  |  Branch (366:17): [True: 390, False: 2.57k]
  ------------------
  367|       |                /* Case 3: we do an immediate retransmit if we're
  368|       |                 * in a waiting state. */
  369|    390|                rv = dtls_RetransmitDetected(ss);
  370|    390|                goto loser;
  371|  2.57k|            } else if (message_seq > ss->ssl3.hs.recvMessageSeq) {
  ------------------
  |  Branch (371:24): [True: 415, False: 2.15k]
  ------------------
  372|       |                /* Case 2
  373|       |                 *
  374|       |                 * Ignore this message. This means we don't handle out of
  375|       |                 * order complete messages that well, but we're still
  376|       |                 * compliant and this probably does not happen often
  377|       |                 *
  378|       |                 * XXX OK for now. Maybe do something smarter at some point?
  379|       |                 */
  380|    415|                SSL_TRC(10, ("%d: SSL3[%d]: dtls_HandleHandshake, discarding handshake message",
  ------------------
  |  |   71|    415|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 415]
  |  |  ------------------
  |  |   72|    415|    ssl_Trace b
  ------------------
  381|    415|                             SSL_GETPID(), ss->fd));
  382|    415|                discarded = PR_TRUE;
  ------------------
  |  |  437|    415|#define PR_TRUE 1
  ------------------
  383|  2.15k|            } else {
  384|  2.15k|                PRInt32 end = fragment_offset + fragment_length;
  385|       |
  386|       |                /* Case 1
  387|       |                 *
  388|       |                 * Buffer the fragment for reassembly
  389|       |                 */
  390|       |                /* Make room for the message */
  391|  2.15k|                if (ss->ssl3.hs.recvdHighWater == -1) {
  ------------------
  |  Branch (391:21): [True: 827, False: 1.33k]
  ------------------
  392|    827|                    PRUint32 map_length = OFFSET_BYTE(message_length) + 1;
  ------------------
  |  |  266|    827|#define OFFSET_BYTE(o) (o / 8)
  ------------------
  393|       |
  394|    827|                    rv = sslBuffer_Grow(&ss->ssl3.hs.msg_body, message_length);
  395|    827|                    if (rv != SECSuccess)
  ------------------
  |  Branch (395:25): [True: 0, False: 827]
  ------------------
  396|      0|                        goto loser;
  397|       |                    /* Make room for the fragment map */
  398|    827|                    rv = sslBuffer_Grow(&ss->ssl3.hs.recvdFragments,
  399|    827|                                        map_length);
  400|    827|                    if (rv != SECSuccess)
  ------------------
  |  Branch (400:25): [True: 0, False: 827]
  ------------------
  401|      0|                        goto loser;
  402|       |
  403|       |                    /* Reset the reassembly map */
  404|    827|                    ss->ssl3.hs.recvdHighWater = 0;
  405|    827|                    PORT_Memset(ss->ssl3.hs.recvdFragments.buf, 0,
  ------------------
  |  |  182|    827|#define PORT_Memset memset
  ------------------
  406|    827|                                ss->ssl3.hs.recvdFragments.space);
  407|    827|                    ss->ssl3.hs.msg_type = (SSLHandshakeType)type;
  408|    827|                    ss->ssl3.hs.msg_len = message_length;
  409|    827|                }
  410|       |
  411|       |                /* If we have a message length mismatch, abandon the reassembly
  412|       |                 * in progress and hope that the next retransmit will give us
  413|       |                 * something sane
  414|       |                 */
  415|  2.15k|                if (message_length != ss->ssl3.hs.msg_len) {
  ------------------
  |  Branch (415:21): [True: 30, False: 2.12k]
  ------------------
  416|     30|                    ss->ssl3.hs.recvdHighWater = -1;
  417|     30|                    PORT_SetError(SSL_ERROR_RX_MALFORMED_HANDSHAKE);
  ------------------
  |  |   65|     30|#define PORT_SetError PORT_SetError_Util
  ------------------
  418|     30|                    rv = SECFailure;
  419|     30|                    goto loser;
  420|     30|                }
  421|       |
  422|       |                /* Now copy this fragment into the buffer. */
  423|  2.12k|                if (end > ss->ssl3.hs.recvdHighWater) {
  ------------------
  |  Branch (423:21): [True: 1.85k, False: 271]
  ------------------
  424|  1.85k|                    PORT_Memcpy(ss->ssl3.hs.msg_body.buf + fragment_offset,
  ------------------
  |  |  180|  1.85k|#define PORT_Memcpy memcpy
  ------------------
  425|  1.85k|                                buf.buf, fragment_length);
  426|  1.85k|                }
  427|       |
  428|       |                /* This logic is a bit tricky. We have two values for
  429|       |                 * reassembly state:
  430|       |                 *
  431|       |                 * - recvdHighWater contains the highest contiguous number of
  432|       |                 *   bytes received
  433|       |                 * - recvdFragments contains a bitmask of packets received
  434|       |                 *   above recvdHighWater
  435|       |                 *
  436|       |                 * This avoids having to fill in the bitmask in the common
  437|       |                 * case of adjacent fragments received in sequence
  438|       |                 */
  439|  2.12k|                if (fragment_offset <= (unsigned int)ss->ssl3.hs.recvdHighWater) {
  ------------------
  |  Branch (439:21): [True: 1.40k, False: 727]
  ------------------
  440|       |                    /* Either this is the adjacent fragment or an overlapping
  441|       |                     * fragment */
  442|  1.40k|                    if (end > ss->ssl3.hs.recvdHighWater) {
  ------------------
  |  Branch (442:25): [True: 1.13k, False: 271]
  ------------------
  443|  1.13k|                        ss->ssl3.hs.recvdHighWater = end;
  444|  1.13k|                    }
  445|  1.40k|                } else {
  446|   110k|                    for (offset = fragment_offset; offset < end; offset++) {
  ------------------
  |  Branch (446:52): [True: 110k, False: 727]
  ------------------
  447|   110k|                        ss->ssl3.hs.recvdFragments.buf[OFFSET_BYTE(offset)] |=
  ------------------
  |  |  266|   110k|#define OFFSET_BYTE(o) (o / 8)
  ------------------
  448|   110k|                            OFFSET_MASK(offset);
  ------------------
  |  |  267|   110k|#define OFFSET_MASK(o) (1 << (o % 8))
  ------------------
  449|   110k|                    }
  450|    727|                }
  451|       |
  452|       |                /* Now figure out the new high water mark if appropriate */
  453|  2.12k|                for (offset = ss->ssl3.hs.recvdHighWater;
  454|  80.0k|                     offset < ss->ssl3.hs.msg_len; offset++) {
  ------------------
  |  Branch (454:22): [True: 79.4k, False: 637]
  ------------------
  455|       |                    /* Note that this loop is not efficient, since it counts
  456|       |                     * bit by bit. If we have a lot of out-of-order packets,
  457|       |                     * we should optimize this */
  458|  79.4k|                    if (ss->ssl3.hs.recvdFragments.buf[OFFSET_BYTE(offset)] &
  ------------------
  |  |  266|  79.4k|#define OFFSET_BYTE(o) (o / 8)
  ------------------
  |  Branch (458:25): [True: 77.9k, False: 1.49k]
  ------------------
  459|  79.4k|                        OFFSET_MASK(offset)) {
  ------------------
  |  |  267|  79.4k|#define OFFSET_MASK(o) (1 << (o % 8))
  ------------------
  460|  77.9k|                        ss->ssl3.hs.recvdHighWater++;
  461|  77.9k|                    } else {
  462|  1.49k|                        break;
  463|  1.49k|                    }
  464|  79.4k|                }
  465|       |
  466|       |                /* If we have all the bytes, then we are good to go */
  467|  2.12k|                if (ss->ssl3.hs.recvdHighWater == ss->ssl3.hs.msg_len) {
  ------------------
  |  Branch (467:21): [True: 637, False: 1.49k]
  ------------------
  468|    637|                    rv = dtls_HandleHandshakeMessage(ss, ss->ssl3.hs.msg_body.buf,
  469|    637|                                                     buf.len == fragment_length);
  470|       |
  471|    637|                    if (rv != SECSuccess) {
  ------------------
  |  Branch (471:25): [True: 22, False: 615]
  ------------------
  472|     22|                        goto loser;
  473|     22|                    }
  474|    637|                }
  475|  2.12k|            }
  476|  2.96k|        }
  477|       |
  478|  19.3k|        buf.buf += fragment_length;
  479|  19.3k|        buf.len -= fragment_length;
  480|  19.3k|    }
  481|       |
  482|       |    // This should never happen, but belt and suspenders.
  483|  22.9k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (483:9): [True: 0, False: 22.9k]
  ------------------
  484|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  485|      0|        goto loser;
  486|      0|    }
  487|       |
  488|       |    /* If we processed all the fragments in this message, then mark it as remembered.
  489|       |     * TODO(ekr@rtfm.com): Store out of order messages for DTLS 1.3 so ACKs work
  490|       |     * better. Bug 1392620.*/
  491|  22.9k|    if (!discarded && tls13_MaybeTls13(ss)) {
  ------------------
  |  Branch (491:9): [True: 22.7k, False: 221]
  |  Branch (491:23): [True: 6.28k, False: 16.4k]
  ------------------
  492|  6.28k|        rv = dtls13_RememberFragment(ss, &ss->ssl3.hs.dtlsRcvdHandshake,
  493|  6.28k|                                     0, 0, 0, epoch, seqNum);
  494|  6.28k|    }
  495|  22.9k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (495:9): [True: 0, False: 22.9k]
  ------------------
  496|      0|        goto loser;
  497|      0|    }
  498|  22.9k|    rv = dtls13_SetupAcks(ss);
  499|       |
  500|  25.7k|loser:
  501|  25.7k|    origBuf->len = 0; /* So ssl3_GatherAppDataRecord will keep looping. */
  502|  25.7k|    return rv;
  503|  22.9k|}
dtls_QueueMessage:
  514|  15.5k|{
  515|  15.5k|    SECStatus rv = SECSuccess;
  516|  15.5k|    DTLSQueuedMessage *msg = NULL;
  517|  15.5k|    ssl3CipherSpec *spec;
  518|       |
  519|  15.5k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  15.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  23.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 7.59k, False: 7.92k]
  |  |  |  |  |  Branch (208:7): [True: 7.92k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  520|  15.5k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  15.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  23.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 7.59k, False: 7.92k]
  |  |  |  |  |  Branch (208:7): [True: 7.92k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  521|       |
  522|  15.5k|    spec = ss->ssl3.cwSpec;
  523|  15.5k|    msg = dtls_AllocQueuedMessage(spec, ct, pIn, nIn);
  524|       |
  525|  15.5k|    if (!msg) {
  ------------------
  |  Branch (525:9): [True: 0, False: 15.5k]
  ------------------
  526|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  527|      0|        rv = SECFailure;
  528|  15.5k|    } else {
  529|  15.5k|        PR_APPEND_LINK(&msg->link, &ss->ssl3.hs.lastMessageFlight);
  ------------------
  |  |   57|  15.5k|#define PR_APPEND_LINK(_e,_l) PR_INSERT_BEFORE(_e,_l)
  |  |  ------------------
  |  |  |  |   25|  15.5k|    PR_BEGIN_MACRO       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  15.5k|#define PR_BEGIN_MACRO  do {
  |  |  |  |  ------------------
  |  |  |  |   26|  15.5k|    (_e)->next = (_l);   \
  |  |  |  |   27|  15.5k|    (_e)->prev = (_l)->prev; \
  |  |  |  |   28|  15.5k|    (_l)->prev->next = (_e); \
  |  |  |  |   29|  15.5k|    (_l)->prev = (_e);   \
  |  |  |  |   30|  15.5k|    PR_END_MACRO
  |  |  |  |  ------------------
  |  |  |  |  |  |  124|  15.5k|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  530|  15.5k|    }
  531|       |
  532|  15.5k|    return rv;
  533|  15.5k|}
dtls_StageHandshakeMessage:
  545|  30.4k|{
  546|  30.4k|    SECStatus rv = SECSuccess;
  547|       |
  548|  30.4k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  30.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  46.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 14.8k, False: 15.5k]
  |  |  |  |  |  Branch (208:7): [True: 15.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  549|  30.4k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  30.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  46.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 14.8k, False: 15.5k]
  |  |  |  |  |  Branch (208:7): [True: 15.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  550|       |
  551|       |    /* This function is sometimes called when no data is actually to
  552|       |     * be staged, so just return SECSuccess. */
  553|  30.4k|    if (!ss->sec.ci.sendBuf.buf || !ss->sec.ci.sendBuf.len)
  ------------------
  |  Branch (553:9): [True: 8.85k, False: 21.6k]
  |  Branch (553:36): [True: 7.86k, False: 13.7k]
  ------------------
  554|  16.7k|        return rv;
  555|       |
  556|  13.7k|    rv = dtls_QueueMessage(ss, ssl_ct_handshake,
  557|  13.7k|                           ss->sec.ci.sendBuf.buf, ss->sec.ci.sendBuf.len);
  558|       |
  559|       |    /* Whether we succeeded or failed, toss the old handshake data. */
  560|  13.7k|    ss->sec.ci.sendBuf.len = 0;
  561|  13.7k|    return rv;
  562|  30.4k|}
dtls_FlushHandshakeMessages:
  572|  16.7k|{
  573|  16.7k|    SECStatus rv = SECSuccess;
  574|       |
  575|  16.7k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  16.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  25.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8.15k, False: 8.55k]
  |  |  |  |  |  Branch (208:7): [True: 8.55k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  576|  16.7k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  16.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  25.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8.15k, False: 8.55k]
  |  |  |  |  |  Branch (208:7): [True: 8.55k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  577|       |
  578|  16.7k|    rv = dtls_StageHandshakeMessage(ss);
  579|  16.7k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (579:9): [True: 0, False: 16.7k]
  ------------------
  580|      0|        return rv;
  581|      0|    }
  582|       |
  583|  16.7k|    if (!(flags & ssl_SEND_FLAG_FORCE_INTO_BUFFER)) {
  ------------------
  |  |  223|  16.7k|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
  |  Branch (583:9): [True: 11.9k, False: 4.73k]
  ------------------
  584|  11.9k|        rv = dtls_TransmitMessageFlight(ss);
  585|  11.9k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (585:13): [True: 0, False: 11.9k]
  ------------------
  586|      0|            return rv;
  587|      0|        }
  588|       |
  589|  11.9k|        if (!(flags & ssl_SEND_FLAG_NO_RETRANSMIT)) {
  ------------------
  |  |  225|  11.9k|#define ssl_SEND_FLAG_NO_RETRANSMIT 0x08000000 /* DTLS only */
  ------------------
  |  Branch (589:13): [True: 11.9k, False: 0]
  ------------------
  590|  11.9k|            rv = dtls_StartRetransmitTimer(ss);
  591|  11.9k|        } else {
  592|      0|            PORT_Assert(ss->version < SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  593|      0|        }
  594|  11.9k|    }
  595|       |
  596|  16.7k|    return rv;
  597|  16.7k|}
dtls_TransmitMessageFlight:
  812|  12.6k|{
  813|  12.6k|    SECStatus rv = SECSuccess;
  814|  12.6k|    PRCList *msg_p;
  815|       |
  816|  12.6k|    SSL_TRC(10, ("%d: SSL3[%d]: dtls_TransmitMessageFlight",
  ------------------
  |  |   71|  12.6k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 12.6k]
  |  |  ------------------
  |  |   72|  12.6k|    ssl_Trace b
  ------------------
  817|  12.6k|                 SSL_GETPID(), ss->fd));
  818|       |
  819|  12.6k|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|  12.6k|    {                                           \
  |  | 1467|  12.6k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 6.45k, False: 6.21k]
  |  |  ------------------
  |  | 1468|  12.6k|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|  6.45k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|  12.6k|    }
  ------------------
  820|  12.6k|    ssl_GetSpecReadLock(ss);
  ------------------
  |  | 1422|  12.6k|    {                                           \
  |  | 1423|  12.6k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 6.45k, False: 6.21k]
  |  |  ------------------
  |  | 1424|  12.6k|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|  6.45k|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|  12.6k|    }
  ------------------
  821|       |
  822|       |    /* DTLS does not buffer its handshake messages in ss->pendingBuf, but rather
  823|       |     * in the lastMessageFlight structure. This is just a sanity check that some
  824|       |     * programming error hasn't inadvertantly stuffed something in
  825|       |     * ss->pendingBuf.  This function uses ss->pendingBuf temporarily and it
  826|       |     * needs to be empty to start.
  827|       |     */
  828|  12.6k|    PORT_Assert(!ss->pendingBuf.len);
  ------------------
  |  |  120|  12.6k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  12.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 12.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  829|       |
  830|  12.6k|    for (msg_p = PR_LIST_HEAD(&ss->ssl3.hs.lastMessageFlight);
  ------------------
  |  |   65|  12.6k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
  831|  28.8k|         msg_p != &ss->ssl3.hs.lastMessageFlight;) {
  ------------------
  |  Branch (831:10): [True: 16.1k, False: 12.6k]
  ------------------
  832|  16.1k|        DTLSQueuedMessage *msg = (DTLSQueuedMessage *)msg_p;
  833|       |
  834|       |        /* Move the pointer forward so that the functions below are free to
  835|       |         * remove messages from the list. */
  836|  16.1k|        msg_p = PR_NEXT_LINK(msg_p);
  ------------------
  |  |   47|  16.1k|        ((_e)->next)
  ------------------
  837|       |
  838|       |        /* Note: This function fragments messages so that each record is close
  839|       |         * to full.  This produces fewer records, but it means that messages can
  840|       |         * be quite fragmented.  Adding an extra flush here would push new
  841|       |         * messages into new records and reduce fragmentation. */
  842|  16.1k|        if (msg->type == ssl_ct_handshake) {
  ------------------
  |  Branch (842:13): [True: 14.3k, False: 1.76k]
  ------------------
  843|  14.3k|            rv = dtls_FragmentHandshake(ss, msg);
  844|  14.3k|        } else {
  845|  1.76k|            PORT_Assert(!tls13_MaybeTls13(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  846|  1.76k|            rv = dtls_SendFragment(ss, msg, msg->data, msg->len);
  847|  1.76k|        }
  848|  16.1k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (848:13): [True: 0, False: 16.1k]
  ------------------
  849|      0|            break;
  850|      0|        }
  851|  16.1k|    }
  852|       |
  853|       |    /* Finally, flush any data that wasn't flushed already. */
  854|  12.6k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (854:9): [True: 12.6k, False: 0]
  ------------------
  855|  12.6k|        rv = dtls_SendSavedWriteData(ss);
  856|  12.6k|    }
  857|       |
  858|       |    /* Give up the locks */
  859|  12.6k|    ssl_ReleaseSpecReadLock(ss);
  ------------------
  |  | 1427|  12.6k|    {                                             \
  |  | 1428|  12.6k|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 6.45k, False: 6.21k]
  |  |  ------------------
  |  | 1429|  12.6k|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|  6.45k|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|  12.6k|    }
  ------------------
  860|  12.6k|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|  12.6k|    {                                          \
  |  | 1472|  12.6k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 6.45k, False: 6.21k]
  |  |  ------------------
  |  | 1473|  12.6k|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|  6.45k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|  12.6k|    }
  ------------------
  861|       |
  862|  12.6k|    return rv;
  863|  12.6k|}
dtls_InitTimers:
  897|  8.85k|{
  898|  8.85k|    unsigned int i;
  899|  8.85k|    dtlsTimer **timers[PR_ARRAY_SIZE(ss->ssl3.hs.timers)] = {
  900|  8.85k|        &ss->ssl3.hs.rtTimer,
  901|  8.85k|        &ss->ssl3.hs.ackTimer,
  902|  8.85k|        &ss->ssl3.hs.hdTimer
  903|  8.85k|    };
  904|  8.85k|    static const char *timerLabels[] = {
  905|  8.85k|        "retransmit", "ack", "holddown"
  906|  8.85k|    };
  907|       |
  908|  8.85k|    PORT_Assert(PR_ARRAY_SIZE(timers) == PR_ARRAY_SIZE(timerLabels));
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  909|  35.4k|    for (i = 0; i < PR_ARRAY_SIZE(ss->ssl3.hs.timers); ++i) {
  ------------------
  |  |  167|  35.4k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (909:17): [True: 26.5k, False: 8.85k]
  ------------------
  910|  26.5k|        *timers[i] = &ss->ssl3.hs.timers[i];
  911|  26.5k|        ss->ssl3.hs.timers[i].label = timerLabels[i];
  912|  26.5k|    }
  913|  8.85k|}
dtls_StartTimer:
  917|  13.0k|{
  918|  13.0k|    PORT_Assert(timer->cb == NULL);
  ------------------
  |  |  120|  13.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 13.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  919|       |
  920|  13.0k|    SSL_TRC(10, ("%d: SSL3[%d]: %s dtls_StartTimer %s timeout=%d",
  ------------------
  |  |   71|  13.0k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 13.0k]
  |  |  ------------------
  |  |   72|  13.0k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  921|  13.0k|                 SSL_GETPID(), ss->fd, SSL_ROLE(ss), timer->label, time));
  922|       |
  923|  13.0k|    timer->started = PR_IntervalNow();
  924|  13.0k|    timer->timeout = time;
  925|  13.0k|    timer->cb = cb;
  926|  13.0k|    return SECSuccess;
  927|  13.0k|}
dtls_RestartTimer:
  931|    639|{
  932|    639|    timer->started = PR_IntervalNow();
  933|    639|    return SECSuccess;
  934|    639|}
dtls_CancelTimer:
  969|  8.33k|{
  970|  8.33k|    SSL_TRC(30, ("%d: SSL3[%d]: %s dtls_CancelTimer %s",
  ------------------
  |  |   71|  8.33k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 8.33k]
  |  |  ------------------
  |  |   72|  8.33k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  971|  8.33k|                 SSL_GETPID(), ss->fd, SSL_ROLE(ss),
  972|  8.33k|                 timer->label));
  973|       |
  974|  8.33k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  8.33k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  12.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.08k, False: 4.25k]
  |  |  |  |  |  Branch (208:7): [True: 4.25k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  975|       |
  976|  8.33k|    timer->cb = NULL;
  977|  8.33k|}
dtls_CheckTimer:
  995|  5.17k|{
  996|  5.17k|    unsigned int i;
  997|  5.17k|    SSL_TRC(30, ("%d: SSL3[%d]: dtls_CheckTimer (%s)",
  ------------------
  |  |   71|  5.17k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 5.17k]
  |  |  ------------------
  |  |   72|  5.17k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  998|  5.17k|                 SSL_GETPID(), ss->fd, ss->sec.isServer ? "server" : "client"));
  999|       |
 1000|  5.17k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  5.17k|    {                                                 \
  |  | 1408|  5.17k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 2.81k, False: 2.36k]
  |  |  ------------------
  |  | 1409|  2.81k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  2.81k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  2.81k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 2.81k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  2.81k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  2.81k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  2.81k|        }                                             \
  |  | 1412|  5.17k|    }
  ------------------
 1001|       |
 1002|  20.7k|    for (i = 0; i < PR_ARRAY_SIZE(ss->ssl3.hs.timers); ++i) {
  ------------------
  |  |  167|  20.7k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (1002:17): [True: 15.5k, False: 5.17k]
  ------------------
 1003|  15.5k|        dtlsTimer *timer = &ss->ssl3.hs.timers[i];
 1004|  15.5k|        if (!timer->cb) {
  ------------------
  |  Branch (1004:13): [True: 11.0k, False: 4.51k]
  ------------------
 1005|  11.0k|            continue;
 1006|  11.0k|        }
 1007|       |
 1008|  4.51k|        if ((PR_IntervalNow() - timer->started) >=
  ------------------
  |  Branch (1008:13): [True: 11, False: 4.50k]
  ------------------
 1009|  4.51k|            PR_MillisecondsToInterval(timer->timeout)) {
 1010|       |            /* Timer has expired */
 1011|     11|            DTLSTimerCb cb = timer->cb;
 1012|       |
 1013|     11|            SSL_TRC(10, ("%d: SSL3[%d]: %s firing timer %s",
  ------------------
  |  |   71|     11|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 11]
  |  |  ------------------
  |  |   72|     11|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1014|     11|                         SSL_GETPID(), ss->fd, SSL_ROLE(ss),
 1015|     11|                         timer->label));
 1016|       |
 1017|       |            /* Cancel the timer so that we can call the CB safely */
 1018|     11|            dtls_CancelTimer(ss, timer);
 1019|       |
 1020|       |            /* Now call the CB */
 1021|     11|            cb(ss);
 1022|     11|        }
 1023|  4.51k|    }
 1024|  5.17k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  5.17k|    {                                                \
  |  | 1415|  5.17k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 2.81k, False: 2.36k]
  |  |  ------------------
  |  | 1416|  5.17k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  2.81k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  5.17k|    }
  ------------------
 1025|  5.17k|}
dtls_SetMTU:
 1073|  8.85k|{
 1074|  8.85k|    int i;
 1075|       |
 1076|  8.85k|    if (advertised == 0) {
  ------------------
  |  Branch (1076:9): [True: 8.85k, False: 0]
  ------------------
 1077|  8.85k|        ss->ssl3.mtu = COMMON_MTU_VALUES[0];
 1078|  8.85k|        SSL_TRC(30, ("Resetting MTU to %d", ss->ssl3.mtu));
  ------------------
  |  |   71|  8.85k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 8.85k]
  |  |  ------------------
  |  |   72|  8.85k|    ssl_Trace b
  ------------------
 1079|  8.85k|        return;
 1080|  8.85k|    }
 1081|       |
 1082|      0|    for (i = 0; i < PR_ARRAY_SIZE(COMMON_MTU_VALUES); i++) {
  ------------------
  |  |  167|      0|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (1082:17): [True: 0, False: 0]
  ------------------
 1083|      0|        if (COMMON_MTU_VALUES[i] <= advertised) {
  ------------------
  |  Branch (1083:13): [True: 0, False: 0]
  ------------------
 1084|      0|            ss->ssl3.mtu = COMMON_MTU_VALUES[i];
 1085|      0|            SSL_TRC(30, ("Resetting MTU to %d", ss->ssl3.mtu));
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 1086|      0|            return;
 1087|      0|        }
 1088|      0|    }
 1089|       |
 1090|       |    /* Fallback */
 1091|      0|    ss->ssl3.mtu = COMMON_MTU_VALUES[PR_ARRAY_SIZE(COMMON_MTU_VALUES) - 1];
  ------------------
  |  |  167|      0|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
 1092|      0|    SSL_TRC(30, ("Resetting MTU to %d", ss->ssl3.mtu));
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 1093|      0|}
dtls_HandleHelloVerifyRequest:
 1101|    454|{
 1102|    454|    int errCode = SSL_ERROR_RX_MALFORMED_HELLO_VERIFY_REQUEST;
 1103|    454|    SECStatus rv;
 1104|    454|    SSL3ProtocolVersion temp;
 1105|    454|    SSL3AlertDescription desc = illegal_parameter;
 1106|       |
 1107|    454|    SSL_TRC(3, ("%d: SSL3[%d]: handle hello_verify_request handshake",
  ------------------
  |  |   71|    454|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 454]
  |  |  ------------------
  |  |   72|    454|    ssl_Trace b
  ------------------
 1108|    454|                SSL_GETPID(), ss->fd));
 1109|    454|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    454|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    707|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 201, False: 253]
  |  |  |  |  |  Branch (208:7): [True: 253, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1110|    454|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    454|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    707|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 201, False: 253]
  |  |  |  |  |  Branch (208:7): [True: 253, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1111|       |
 1112|    454|    if (ss->ssl3.hs.ws != wait_server_hello) {
  ------------------
  |  Branch (1112:9): [True: 2, False: 452]
  ------------------
 1113|      2|        errCode = SSL_ERROR_RX_UNEXPECTED_HELLO_VERIFY_REQUEST;
 1114|      2|        desc = unexpected_message;
 1115|      2|        goto alert_loser;
 1116|      2|    }
 1117|       |
 1118|    452|    dtls_ReceivedFirstMessageInFlight(ss);
 1119|       |
 1120|       |    /* The version.
 1121|       |     *
 1122|       |     * RFC 4347 required that you verify that the server versions
 1123|       |     * match (Section 4.2.1) in the HelloVerifyRequest and the
 1124|       |     * ServerHello.
 1125|       |     *
 1126|       |     * RFC 6347 (Section 4.2.1) suggests (SHOULD) that servers always use 1.0 in
 1127|       |     * HelloVerifyRequest and allows the versions not to match,
 1128|       |     * especially when 1.2 is being negotiated.
 1129|       |     *
 1130|       |     * Therefore we do not do anything to enforce a match, just
 1131|       |     * read and check that this value is sane.
 1132|       |     */
 1133|    452|    rv = ssl_ClientReadVersion(ss, &b, &length, &temp);
 1134|    452|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1134:9): [True: 42, False: 410]
  ------------------
 1135|     42|        goto loser; /* alert has been sent */
 1136|     42|    }
 1137|       |
 1138|       |    /* Read the cookie.
 1139|       |     * IMPORTANT: The value of ss->ssl3.hs.cookie is only valid while the
 1140|       |     * HelloVerifyRequest message remains valid. */
 1141|    410|    rv = ssl3_ConsumeHandshakeVariable(ss, &ss->ssl3.hs.cookie, 1, &b, &length);
 1142|    410|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1142:9): [True: 12, False: 398]
  ------------------
 1143|     12|        goto loser; /* alert has been sent */
 1144|     12|    }
 1145|    398|    if (ss->ssl3.hs.cookie.len > DTLS_COOKIE_BYTES) {
  ------------------
  |  |   33|    398|#define DTLS_COOKIE_BYTES 32
  ------------------
  |  Branch (1145:9): [True: 3, False: 395]
  ------------------
 1146|      3|        desc = decode_error;
 1147|      3|        goto alert_loser; /* malformed. */
 1148|      3|    }
 1149|       |
 1150|    395|    ssl_GetXmitBufLock(ss); /*******************************/
  ------------------
  |  | 1466|    395|    {                                           \
  |  | 1467|    395|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 209, False: 186]
  |  |  ------------------
  |  | 1468|    395|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|    209|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|    395|    }
  ------------------
 1151|       |
 1152|       |    /* Now re-send the client hello */
 1153|    395|    rv = ssl3_SendClientHello(ss, client_hello_retransmit);
 1154|       |
 1155|    395|    ssl_ReleaseXmitBufLock(ss); /*******************************/
  ------------------
  |  | 1471|    395|    {                                          \
  |  | 1472|    395|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 209, False: 186]
  |  |  ------------------
  |  | 1473|    395|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|    209|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|    395|    }
  ------------------
 1156|       |
 1157|    395|    if (rv == SECSuccess)
  ------------------
  |  Branch (1157:9): [True: 395, False: 0]
  ------------------
 1158|    395|        return rv;
 1159|       |
 1160|      5|alert_loser:
 1161|      5|    (void)SSL3_SendAlert(ss, alert_fatal, desc);
 1162|       |
 1163|     59|loser:
 1164|     59|    ssl_MapLowLevelError(errCode);
 1165|     59|    return SECFailure;
 1166|      5|}
dtls_InitRecvdRecords:
 1176|  24.1k|{
 1177|  24.1k|    PORT_Memset(records->data, 0, sizeof(records->data));
  ------------------
  |  |  182|  24.1k|#define PORT_Memset memset
  ------------------
 1178|  24.1k|    records->left = 0;
 1179|  24.1k|    records->right = DTLS_RECVD_RECORDS_WINDOW - 1;
  ------------------
  |  |  124|  24.1k|#define DTLS_RECVD_RECORDS_WINDOW 1024
  ------------------
 1180|  24.1k|}
dtls_RecordGetRecvd:
 1192|  1.44M|{
 1193|  1.44M|    PRUint64 offset;
 1194|       |
 1195|       |    /* Out of range to the left */
 1196|  1.44M|    if (seq < records->left) {
  ------------------
  |  Branch (1196:9): [True: 1.17M, False: 269k]
  ------------------
 1197|  1.17M|        return -1;
 1198|  1.17M|    }
 1199|       |
 1200|       |    /* Out of range to the right; since we advance the window on
 1201|       |     * receipt, that means that this packet has not been received
 1202|       |     * yet */
 1203|   269k|    if (seq > records->right)
  ------------------
  |  Branch (1203:9): [True: 8.71k, False: 260k]
  ------------------
 1204|  8.71k|        return 0;
 1205|       |
 1206|   260k|    offset = seq % DTLS_RECVD_RECORDS_WINDOW;
  ------------------
  |  |  124|   260k|#define DTLS_RECVD_RECORDS_WINDOW 1024
  ------------------
 1207|       |
 1208|   260k|    return !!(records->data[offset / 8] & (1 << (offset % 8)));
 1209|   269k|}
dtls_RecordSetRecvd:
 1217|  28.1k|{
 1218|  28.1k|    PRUint64 offset;
 1219|       |
 1220|  28.1k|    if (seq < records->left)
  ------------------
  |  Branch (1220:9): [True: 0, False: 28.1k]
  ------------------
 1221|      0|        return;
 1222|       |
 1223|  28.1k|    if (seq > records->right) {
  ------------------
  |  Branch (1223:9): [True: 5.16k, False: 23.0k]
  ------------------
 1224|  5.16k|        sslSequenceNumber new_left;
 1225|  5.16k|        sslSequenceNumber new_right;
 1226|  5.16k|        sslSequenceNumber right;
 1227|       |
 1228|       |        /* Slide to the right; this is the tricky part
 1229|       |         *
 1230|       |         * 1. new_top is set to have room for seq, on the
 1231|       |         *    next byte boundary by setting the right 8
 1232|       |         *    bits of seq
 1233|       |         * 2. new_left is set to compensate.
 1234|       |         * 3. Zero all bits between top and new_top. Since
 1235|       |         *    this is a ring, this zeroes everything as-yet
 1236|       |         *    unseen. Because we always operate on byte
 1237|       |         *    boundaries, we can zero one byte at a time
 1238|       |         */
 1239|  5.16k|        new_right = seq | 0x07;
 1240|  5.16k|        new_left = (new_right - DTLS_RECVD_RECORDS_WINDOW) + 1;
  ------------------
  |  |  124|  5.16k|#define DTLS_RECVD_RECORDS_WINDOW 1024
  ------------------
 1241|       |
 1242|  5.16k|        if (new_right > records->right + DTLS_RECVD_RECORDS_WINDOW) {
  ------------------
  |  |  124|  5.16k|#define DTLS_RECVD_RECORDS_WINDOW 1024
  ------------------
  |  Branch (1242:13): [True: 4.64k, False: 529]
  ------------------
 1243|  4.64k|            PORT_Memset(records->data, 0, sizeof(records->data));
  ------------------
  |  |  182|  4.64k|#define PORT_Memset memset
  ------------------
 1244|  4.64k|        } else {
 1245|  17.9k|            for (right = records->right + 8; right <= new_right; right += 8) {
  ------------------
  |  Branch (1245:46): [True: 17.3k, False: 529]
  ------------------
 1246|  17.3k|                offset = right % DTLS_RECVD_RECORDS_WINDOW;
  ------------------
  |  |  124|  17.3k|#define DTLS_RECVD_RECORDS_WINDOW 1024
  ------------------
 1247|  17.3k|                records->data[offset / 8] = 0;
 1248|  17.3k|            }
 1249|    529|        }
 1250|       |
 1251|  5.16k|        records->right = new_right;
 1252|  5.16k|        records->left = new_left;
 1253|  5.16k|    }
 1254|       |
 1255|  28.1k|    offset = seq % DTLS_RECVD_RECORDS_WINDOW;
  ------------------
  |  |  124|  28.1k|#define DTLS_RECVD_RECORDS_WINDOW 1024
  ------------------
 1256|       |
 1257|  28.1k|    records->data[offset / 8] |= (1 << (offset % 8));
 1258|  28.1k|}
dtls_IsLongHeader:
 1318|  4.36M|{
 1319|       |#ifndef UNSAFE_FUZZER_MODE
 1320|       |    return version < SSL_LIBRARY_VERSION_TLS_1_3 ||
 1321|       |           firstOctet == ssl_ct_handshake ||
 1322|       |           firstOctet == ssl_ct_ack ||
 1323|       |           firstOctet == ssl_ct_alert;
 1324|       |#else
 1325|  4.36M|    return PR_TRUE;
  ------------------
  |  |  437|  4.36M|#define PR_TRUE 1
  ------------------
 1326|  4.36M|#endif
 1327|  4.36M|}
dtls_IsDtls13Ciphertext:
 1331|  31.4k|{
 1332|       |    // Allow no version in case we haven't negotiated one yet.
 1333|  31.4k|    return (version == 0 || version >= SSL_LIBRARY_VERSION_TLS_1_3) &&
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1333:13): [True: 31.4k, False: 0]
  |  Branch (1333:29): [True: 0, False: 0]
  ------------------
 1334|  31.4k|           (firstOctet & 0xe0) == 0x20;
  ------------------
  |  Branch (1334:12): [True: 852, False: 30.5k]
  ------------------
 1335|  31.4k|}
dtls_ReadEpoch:
 1339|  1.45M|{
 1340|  1.45M|    if (dtls_IsLongHeader(version, hdr[0])) {
  ------------------
  |  Branch (1340:9): [True: 1.45M, False: 0]
  ------------------
 1341|  1.45M|        return ((DTLSEpoch)hdr[3] << 8) | hdr[4];
 1342|  1.45M|    }
 1343|       |
 1344|      0|    DTLSEpoch epoch = (specEpoch & ~3) | (hdr[0] & 3);
 1345|       |    /* The epoch cannot be higher than the current read epoch,
 1346|       |        though guard against underflow. */
 1347|      0|    if (epoch > specEpoch && epoch > 4) {
  ------------------
  |  Branch (1347:9): [True: 0, False: 0]
  |  Branch (1347:30): [True: 0, False: 0]
  ------------------
 1348|      0|        epoch -= 4;
 1349|      0|    }
 1350|       |
 1351|      0|    return epoch;
 1352|  1.45M|}
dtls_IsRelevant:
 1415|  1.44M|{
 1416|  1.44M|    sslSequenceNumber seqNum = dtls_ReadSequenceNumber(spec, cText->hdr);
 1417|  1.44M|    if (dtls_RecordGetRecvd(&spec->recvdRecords, seqNum) != 0) {
  ------------------
  |  Branch (1417:9): [True: 1.41M, False: 32.1k]
  ------------------
 1418|  1.41M|        SSL_TRC(10, ("%d: SSL3[%d]: dtls_IsRelevant, rejecting "
  ------------------
  |  |   71|  1.41M|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.41M]
  |  |  ------------------
  |  |   72|  1.41M|    ssl_Trace b
  ------------------
 1419|  1.41M|                     "potentially replayed packet",
 1420|  1.41M|                     SSL_GETPID(), ss->fd));
 1421|  1.41M|        return PR_FALSE;
  ------------------
  |  |  438|  1.41M|#define PR_FALSE 0
  ------------------
 1422|  1.41M|    }
 1423|       |
 1424|  32.1k|    *seqNumOut = seqNum;
 1425|  32.1k|    return PR_TRUE;
  ------------------
  |  |  437|  32.1k|#define PR_TRUE 1
  ------------------
 1426|  1.44M|}
dtls_ReceivedFirstMessageInFlight:
 1430|  8.23k|{
 1431|  8.23k|    if (!IS_DTLS(ss))
  ------------------
  |  |  892|  8.23k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (1431:9): [True: 0, False: 8.23k]
  ------------------
 1432|      0|        return;
 1433|       |
 1434|       |    /* At this point we are advancing our state machine, so we can free our last
 1435|       |     * flight of messages. */
 1436|  8.23k|    if (ss->ssl3.hs.ws != idle_handshake ||
  ------------------
  |  Branch (1436:9): [True: 8.23k, False: 0]
  ------------------
 1437|  8.23k|        ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1437:9): [True: 0, False: 0]
  ------------------
 1438|       |        /* We need to keep our last flight around in DTLS 1.2 and below,
 1439|       |         * so we can retransmit it in response to other people's
 1440|       |         * retransmits. */
 1441|  8.23k|        dtls_FreeHandshakeMessages(&ss->ssl3.hs.lastMessageFlight);
 1442|       |
 1443|       |        /* Reset the timer to the initial value if the retry counter
 1444|       |         * is 0, per RFC 6347, Sec. 4.2.4.1 */
 1445|  8.23k|        dtls_CancelTimer(ss, ss->ssl3.hs.rtTimer);
 1446|  8.23k|        if (ss->ssl3.hs.rtRetries == 0) {
  ------------------
  |  Branch (1446:13): [True: 8.23k, False: 0]
  ------------------
 1447|  8.23k|            ss->ssl3.hs.rtTimer->timeout = DTLS_RETRANSMIT_INITIAL_MS;
  ------------------
  |  |  126|  8.23k|#define DTLS_RETRANSMIT_INITIAL_MS 50
  ------------------
 1448|  8.23k|        }
 1449|  8.23k|    }
 1450|       |
 1451|       |    /* Empty the ACK queue (TLS 1.3 only). */
 1452|  8.23k|    ssl_ClearPRCList(&ss->ssl3.hs.dtlsRcvdHandshake, NULL);
 1453|  8.23k|}
dtlscon.c:dtls_HandleHandshakeMessage:
  245|  19.6k|{
  246|  19.6k|    ss->ssl3.hs.recvdHighWater = -1;
  247|       |
  248|  19.6k|    return ssl3_HandleHandshakeMessage(ss, data, ss->ssl3.hs.msg_len,
  249|  19.6k|                                       last);
  250|  19.6k|}
dtlscon.c:dtls_RetransmitDetected:
  190|    390|{
  191|    390|    dtlsTimer *timer = ss->ssl3.hs.rtTimer;
  192|    390|    SECStatus rv = SECSuccess;
  193|       |
  194|    390|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    390|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    607|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 173, False: 217]
  |  |  |  |  |  Branch (208:7): [True: 217, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|    390|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    390|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    607|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 173, False: 217]
  |  |  |  |  |  Branch (208:7): [True: 217, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  196|       |
  197|    390|    if (timer->cb == dtls_RetransmitTimerExpiredCb) {
  ------------------
  |  Branch (197:9): [True: 269, False: 121]
  ------------------
  198|       |        /* Check to see if we retransmitted recently. If so,
  199|       |         * suppress the triggered retransmit. This avoids
  200|       |         * retransmit wars after packet loss.
  201|       |         * This is not in RFC 5346 but it should be.
  202|       |         */
  203|    269|        if ((PR_IntervalNow() - timer->started) >
  ------------------
  |  Branch (203:13): [True: 1, False: 268]
  ------------------
  204|    269|            (timer->timeout / 4)) {
  205|      1|            SSL_TRC(30,
  ------------------
  |  |   71|      1|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   72|      1|    ssl_Trace b
  ------------------
  206|      1|                    ("%d: SSL3[%d]: Shortcutting retransmit timer",
  207|      1|                     SSL_GETPID(), ss->fd));
  208|       |
  209|       |            /* Cancel the timer and call the CB,
  210|       |             * which re-arms the timer */
  211|      1|            dtls_CancelTimer(ss, ss->ssl3.hs.rtTimer);
  212|      1|            dtls_RetransmitTimerExpiredCb(ss);
  213|    268|        } else {
  214|    268|            SSL_TRC(30,
  ------------------
  |  |   71|    268|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 268]
  |  |  ------------------
  |  |   72|    268|    ssl_Trace b
  ------------------
  215|    268|                    ("%d: SSL3[%d]: Ignoring retransmission: "
  216|    268|                     "last retransmission %dms ago, suppressed for %dms",
  217|    268|                     SSL_GETPID(), ss->fd,
  218|    268|                     PR_IntervalNow() - timer->started,
  219|    268|                     timer->timeout / 4));
  220|    268|        }
  221|       |
  222|    269|    } else if (timer->cb == dtls_FinishedTimerCb) {
  ------------------
  |  Branch (222:16): [True: 0, False: 121]
  ------------------
  223|      0|        SSL_TRC(30, ("%d: SSL3[%d]: Retransmit detected in holddown",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  224|      0|                     SSL_GETPID(), ss->fd));
  225|       |        /* Retransmit the messages and re-arm the timer
  226|       |         * Note that we are not backing off the timer here.
  227|       |         * The spec isn't clear and my reasoning is that this
  228|       |         * may be a re-ordered packet rather than slowness,
  229|       |         * so let's be aggressive. */
  230|      0|        dtls_CancelTimer(ss, ss->ssl3.hs.rtTimer);
  231|      0|        rv = dtls_TransmitMessageFlight(ss);
  232|      0|        if (rv == SECSuccess) {
  ------------------
  |  Branch (232:13): [True: 0, False: 0]
  ------------------
  233|      0|            rv = dtls_StartHolddownTimer(ss);
  234|      0|        }
  235|       |
  236|    121|    } else {
  237|    121|        PORT_Assert(timer->cb == NULL);
  ------------------
  |  |  120|    121|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    121|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 121, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|       |        /* ... and ignore it. */
  239|    121|    }
  240|    390|    return rv;
  241|    390|}
dtlscon.c:dtls_RetransmitTimerExpiredCb:
  607|      1|{
  608|      1|    SECStatus rv;
  609|      1|    dtlsTimer *timer = ss->ssl3.hs.rtTimer;
  610|      1|    ss->ssl3.hs.rtRetries++;
  611|       |
  612|      1|    if (!(ss->ssl3.hs.rtRetries % 3)) {
  ------------------
  |  Branch (612:9): [True: 0, False: 1]
  ------------------
  613|       |        /* If one of the messages was potentially greater than > MTU,
  614|       |         * then downgrade. Do this every time we have retransmitted a
  615|       |         * message twice, per RFC 9147 Sec. 4.4 */
  616|      0|        dtls_SetMTU(ss, ss->ssl3.hs.maxMessageSent - 1);
  617|      0|    }
  618|       |
  619|      1|    rv = dtls_TransmitMessageFlight(ss);
  620|      1|    if (rv == SECSuccess) {
  ------------------
  |  Branch (620:9): [True: 1, False: 0]
  ------------------
  621|       |        /* Re-arm the timer */
  622|      1|        timer->timeout *= 2;
  623|      1|        if (timer->timeout > DTLS_RETRANSMIT_MAX_MS) {
  ------------------
  |  |  128|      1|#define DTLS_RETRANSMIT_MAX_MS 10000
  ------------------
  |  Branch (623:13): [True: 0, False: 1]
  ------------------
  624|      0|            timer->timeout = DTLS_RETRANSMIT_MAX_MS;
  ------------------
  |  |  128|      0|#define DTLS_RETRANSMIT_MAX_MS 10000
  ------------------
  625|      0|        }
  626|       |
  627|      1|        timer->started = PR_IntervalNow();
  628|      1|        timer->cb = dtls_RetransmitTimerExpiredCb;
  629|       |
  630|      1|        SSL_TRC(30,
  ------------------
  |  |   71|      1|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   72|      1|    ssl_Trace b
  ------------------
  631|      1|                ("%d: SSL3[%d]: Retransmit #%d, next in %d",
  632|      1|                 SSL_GETPID(), ss->fd,
  633|      1|                 ss->ssl3.hs.rtRetries, timer->timeout));
  634|      1|    }
  635|       |    /* else: OK for now. In future maybe signal the stack that we couldn't
  636|       |     * transmit. For now, let the read handle any real network errors */
  637|      1|}
dtlscon.c:dtls_AllocQueuedMessage:
  125|  15.5k|{
  126|  15.5k|    DTLSQueuedMessage *msg;
  127|       |
  128|  15.5k|    msg = PORT_ZNew(DTLSQueuedMessage);
  ------------------
  |  |  148|  15.5k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  15.5k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  129|  15.5k|    if (!msg)
  ------------------
  |  Branch (129:9): [True: 0, False: 15.5k]
  ------------------
  130|      0|        return NULL;
  131|       |
  132|  15.5k|    msg->data = PORT_Alloc(len);
  ------------------
  |  |   52|  15.5k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  133|  15.5k|    if (!msg->data) {
  ------------------
  |  Branch (133:9): [True: 0, False: 15.5k]
  ------------------
  134|      0|        PORT_Free(msg);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  135|      0|        return NULL;
  136|      0|    }
  137|  15.5k|    PORT_Memcpy(msg->data, data, len);
  ------------------
  |  |  180|  15.5k|#define PORT_Memcpy memcpy
  ------------------
  138|       |
  139|  15.5k|    msg->len = len;
  140|  15.5k|    msg->cwSpec = cwSpec;
  141|  15.5k|    msg->type = ct;
  142|       |    /* Safe if we are < 1.3, since the refct is
  143|       |     * already very high. */
  144|  15.5k|    ssl_CipherSpecAddRef(cwSpec);
  145|       |
  146|  15.5k|    return msg;
  147|  15.5k|}
dtlscon.c:dtls_FragmentHandshake:
  676|  14.3k|{
  677|  14.3k|    PRBool fragmentWritten = PR_FALSE;
  ------------------
  |  |  438|  14.3k|#define PR_FALSE 0
  ------------------
  678|  14.3k|    PRUint16 msgSeq;
  679|  14.3k|    PRUint8 *fragment;
  680|  14.3k|    PRUint32 fragmentOffset = 0;
  681|  14.3k|    PRUint32 fragmentLen;
  682|  14.3k|    const PRUint8 *content = msg->data + DTLS_HS_HDR_LEN;
  ------------------
  |  |  639|  14.3k|#define DTLS_HS_HDR_LEN 12
  ------------------
  683|  14.3k|    PRUint32 contentLen = msg->len - DTLS_HS_HDR_LEN;
  ------------------
  |  |  639|  14.3k|#define DTLS_HS_HDR_LEN 12
  ------------------
  684|  14.3k|    SECStatus rv;
  685|       |
  686|       |    /* The headers consume 12 bytes so the smallest possible message (i.e., an
  687|       |     * empty one) is 12 bytes. */
  688|  14.3k|    PORT_Assert(msg->len >= DTLS_HS_HDR_LEN);
  ------------------
  |  |  120|  14.3k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  689|       |
  690|       |    /* DTLS only supports fragmenting handshaking messages. */
  691|  14.3k|    PORT_Assert(msg->type == ssl_ct_handshake);
  ------------------
  |  |  120|  14.3k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|       |
  693|  14.3k|    msgSeq = (msg->data[4] << 8) | msg->data[5];
  694|       |
  695|       |    /* do {} while() so that empty messages are sent at least once. */
  696|  14.5k|    do {
  697|  14.5k|        PRUint8 buf[DTLS_MAX_MTU]; /* >= than largest plausible MTU */
  698|  14.5k|        PRBool hasUnackedRange;
  699|  14.5k|        PRUint32 end;
  700|       |
  701|  14.5k|        hasUnackedRange = dtls_NextUnackedRange(ss, msgSeq,
  702|  14.5k|                                                fragmentOffset, contentLen,
  703|  14.5k|                                                &fragmentOffset, &end);
  704|  14.5k|        if (!hasUnackedRange) {
  ------------------
  |  Branch (704:13): [True: 71, False: 14.5k]
  ------------------
  705|     71|            SSL_TRC(20, ("%d: SSL3[%d]: FragmentHandshake %d: all acknowledged",
  ------------------
  |  |   71|     71|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 71]
  |  |  ------------------
  |  |   72|     71|    ssl_Trace b
  ------------------
  706|     71|                         SSL_GETPID(), ss->fd, msgSeq));
  707|     71|            break;
  708|     71|        }
  709|       |
  710|  14.5k|        SSL_TRC(20, ("%d: SSL3[%d]: FragmentHandshake %d: unacked=%u-%u",
  ------------------
  |  |   71|  14.5k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 14.5k]
  |  |  ------------------
  |  |   72|  14.5k|    ssl_Trace b
  ------------------
  711|  14.5k|                     SSL_GETPID(), ss->fd, msgSeq, fragmentOffset, end));
  712|       |
  713|       |        /* Cut down to the data we have available. */
  714|  14.5k|        PORT_Assert(fragmentOffset <= contentLen);
  ------------------
  |  |  120|  14.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  715|  14.5k|        PORT_Assert(fragmentOffset <= end);
  ------------------
  |  |  120|  14.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  716|  14.5k|        PORT_Assert(end <= contentLen);
  ------------------
  |  |  120|  14.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  717|  14.5k|        fragmentLen = PR_MIN(end, contentLen) - fragmentOffset;
  ------------------
  |  |  158|  14.5k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 30, False: 14.4k]
  |  |  ------------------
  ------------------
  718|       |
  719|       |        /* Limit further by the record size limit.  Account for the header. */
  720|  14.5k|        fragmentLen = PR_MIN(fragmentLen,
  ------------------
  |  |  158|  14.5k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 14.5k, False: 0]
  |  |  ------------------
  ------------------
  721|  14.5k|                             msg->cwSpec->recordSizeLimit - DTLS_HS_HDR_LEN);
  722|       |
  723|       |        /* Reduce to the space remaining in the MTU. */
  724|  14.5k|        fragmentLen = PR_MIN(fragmentLen,
  ------------------
  |  |  158|  14.5k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 14.3k, False: 178]
  |  |  ------------------
  ------------------
  725|  14.5k|                             ss->ssl3.mtu -           /* MTU estimate. */
  726|  14.5k|                                 ss->pendingBuf.len - /* Less any unsent records. */
  727|  14.5k|                                 DTLS_MAX_EXPANSION - /* Allow for expansion. */
  728|  14.5k|                                 DTLS_HS_HDR_LEN);    /* And the handshake header. */
  729|  14.5k|        PORT_Assert(fragmentLen > 0 || fragmentOffset == 0);
  ------------------
  |  |  120|  14.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 14.5k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  730|       |
  731|       |        /* Make totally sure that we will fit in the buffer. This should be
  732|       |         * impossible; DTLS_MAX_MTU should always be more than ss->ssl3.mtu. */
  733|  14.5k|        if (fragmentLen >= (DTLS_MAX_MTU - DTLS_HS_HDR_LEN)) {
  ------------------
  |  |  891|  14.5k|#define DTLS_MAX_MTU 1500U
  ------------------
                      if (fragmentLen >= (DTLS_MAX_MTU - DTLS_HS_HDR_LEN)) {
  ------------------
  |  |  639|  14.5k|#define DTLS_HS_HDR_LEN 12
  ------------------
  |  Branch (733:13): [True: 0, False: 14.5k]
  ------------------
  734|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  735|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  736|      0|            return SECFailure;
  737|      0|        }
  738|       |
  739|  14.5k|        if (fragmentLen == contentLen) {
  ------------------
  |  Branch (739:13): [True: 14.1k, False: 355]
  ------------------
  740|  14.1k|            fragment = msg->data;
  741|  14.1k|        } else {
  742|    355|            sslBuffer tmp = SSL_BUFFER_FIXED(buf, sizeof(buf));
  ------------------
  |  |   27|    355|    {                               \
  |  |   28|    355|        b, 0, maxlen, PR_TRUE       \
  |  |  ------------------
  |  |  |  |  437|    355|#define PR_TRUE 1
  |  |  ------------------
  |  |   29|    355|    }
  ------------------
  743|       |
  744|       |            /* Construct an appropriate-sized fragment */
  745|       |            /* Type, length, sequence */
  746|    355|            rv = sslBuffer_Append(&tmp, msg->data, 6);
  747|    355|            if (rv != SECSuccess) {
  ------------------
  |  Branch (747:17): [True: 0, False: 355]
  ------------------
  748|      0|                return SECFailure;
  749|      0|            }
  750|       |            /* Offset. */
  751|    355|            rv = sslBuffer_AppendNumber(&tmp, fragmentOffset, 3);
  752|    355|            if (rv != SECSuccess) {
  ------------------
  |  Branch (752:17): [True: 0, False: 355]
  ------------------
  753|      0|                return SECFailure;
  754|      0|            }
  755|       |            /* Length. */
  756|    355|            rv = sslBuffer_AppendNumber(&tmp, fragmentLen, 3);
  757|    355|            if (rv != SECSuccess) {
  ------------------
  |  Branch (757:17): [True: 0, False: 355]
  ------------------
  758|      0|                return SECFailure;
  759|      0|            }
  760|       |            /* Data. */
  761|    355|            rv = sslBuffer_Append(&tmp, content + fragmentOffset, fragmentLen);
  762|    355|            if (rv != SECSuccess) {
  ------------------
  |  Branch (762:17): [True: 0, False: 355]
  ------------------
  763|      0|                return SECFailure;
  764|      0|            }
  765|       |
  766|    355|            fragment = SSL_BUFFER_BASE(&tmp);
  ------------------
  |  |   35|    355|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
  767|    355|        }
  768|       |
  769|       |        /* Record that we are sending first, because encrypting
  770|       |         * increments the sequence number. */
  771|  14.5k|        rv = dtls13_RememberFragment(ss, &ss->ssl3.hs.dtlsSentHandshake,
  772|  14.5k|                                     msgSeq, fragmentOffset, fragmentLen,
  773|  14.5k|                                     msg->cwSpec->epoch,
  774|  14.5k|                                     msg->cwSpec->nextSeqNum);
  775|  14.5k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (775:13): [True: 0, False: 14.5k]
  ------------------
  776|      0|            return SECFailure;
  777|      0|        }
  778|       |
  779|  14.5k|        rv = dtls_SendFragment(ss, msg, fragment,
  780|  14.5k|                               fragmentLen + DTLS_HS_HDR_LEN);
  ------------------
  |  |  639|  14.5k|#define DTLS_HS_HDR_LEN 12
  ------------------
  781|  14.5k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (781:13): [True: 0, False: 14.5k]
  ------------------
  782|      0|            return SECFailure;
  783|      0|        }
  784|       |
  785|  14.5k|        fragmentWritten = PR_TRUE;
  ------------------
  |  |  437|  14.5k|#define PR_TRUE 1
  ------------------
  786|  14.5k|        fragmentOffset += fragmentLen;
  787|  14.5k|    } while (fragmentOffset < contentLen);
  ------------------
  |  Branch (787:14): [True: 178, False: 14.3k]
  ------------------
  788|       |
  789|  14.3k|    if (!fragmentWritten) {
  ------------------
  |  Branch (789:9): [True: 41, False: 14.3k]
  ------------------
  790|       |        /* Nothing was written if we got here, so the whole message must have
  791|       |         * been acknowledged.  Discard it. */
  792|     41|        SSL_TRC(10, ("%d: SSL3[%d]: FragmentHandshake %d: removed",
  ------------------
  |  |   71|     41|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 41]
  |  |  ------------------
  |  |   72|     41|    ssl_Trace b
  ------------------
  793|     41|                     SSL_GETPID(), ss->fd, msgSeq));
  794|     41|        PR_REMOVE_LINK(&msg->link);
  ------------------
  |  |   72|     41|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|     41|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|     41|    (_e)->prev->next = (_e)->next; \
  |  |   74|     41|    (_e)->next->prev = (_e)->prev; \
  |  |   75|     41|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|     41|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  795|     41|        dtls_FreeHandshakeMessage(msg);
  796|     41|    }
  797|       |
  798|  14.3k|    return SECSuccess;
  799|  14.3k|}
dtlscon.c:dtls_SendFragment:
  647|  16.2k|{
  648|  16.2k|    PRInt32 sent;
  649|  16.2k|    SECStatus rv;
  650|       |
  651|  16.2k|    PRINT_BUF(40, (ss, "dtls_SendFragment", data, len));
  ------------------
  |  |   74|  16.2k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 16.2k]
  |  |  ------------------
  |  |   75|  16.2k|    ssl_PrintBuf b
  ------------------
  652|  16.2k|    sent = ssl3_SendRecord(ss, msg->cwSpec, msg->type, data, len,
  653|  16.2k|                           ssl_SEND_FLAG_FORCE_INTO_BUFFER);
  ------------------
  |  |  223|  16.2k|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
  654|  16.2k|    if (sent != len) {
  ------------------
  |  Branch (654:9): [True: 0, False: 16.2k]
  ------------------
  655|      0|        if (sent != -1) {
  ------------------
  |  Branch (655:13): [True: 0, False: 0]
  ------------------
  656|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  657|      0|        }
  658|      0|        return SECFailure;
  659|      0|    }
  660|       |
  661|       |    /* If another fragment won't fit, flush. */
  662|  16.2k|    if (ss->ssl3.mtu < ss->pendingBuf.len + DTLS_MIN_FRAGMENT) {
  ------------------
  |  |  640|  16.2k|#define DTLS_MIN_FRAGMENT (DTLS_HS_HDR_LEN + 1 + DTLS_MAX_EXPANSION)
  |  |  ------------------
  |  |  |  |  639|  16.2k|#define DTLS_HS_HDR_LEN 12
  |  |  ------------------
  |  |               #define DTLS_MIN_FRAGMENT (DTLS_HS_HDR_LEN + 1 + DTLS_MAX_EXPANSION)
  |  |  ------------------
  |  |  |  |   36|  16.2k|#define DTLS_MAX_EXPANSION (DTLS_RECORD_HEADER_LENGTH + 16 + 16 + 32)
  |  |  |  |  ------------------
  |  |  |  |  |  |   29|  16.2k|#define DTLS_RECORD_HEADER_LENGTH 13
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (662:9): [True: 186, False: 16.0k]
  ------------------
  663|    186|        SSL_TRC(20, ("%d: DTLS[%d]: dtls_SendFragment: flush",
  ------------------
  |  |   71|    186|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 186]
  |  |  ------------------
  |  |   72|    186|    ssl_Trace b
  ------------------
  664|    186|                     SSL_GETPID(), ss->fd));
  665|    186|        rv = dtls_SendSavedWriteData(ss);
  666|    186|        if (rv != SECSuccess) {
  ------------------
  |  Branch (666:13): [True: 0, False: 186]
  ------------------
  667|      0|            return SECFailure;
  668|      0|        }
  669|    186|    }
  670|  16.2k|    return SECSuccess;
  671|  16.2k|}
dtlscon.c:dtls_SendSavedWriteData:
  873|  12.8k|{
  874|  12.8k|    PRInt32 sent;
  875|       |
  876|  12.8k|    sent = ssl_SendSavedWriteData(ss);
  877|  12.8k|    if (sent < 0)
  ------------------
  |  Branch (877:9): [True: 0, False: 12.8k]
  ------------------
  878|      0|        return SECFailure;
  879|       |
  880|       |    /* We should always have complete writes b/c datagram sockets
  881|       |     * don't really block */
  882|  12.8k|    if (ss->pendingBuf.len > 0) {
  ------------------
  |  Branch (882:9): [True: 0, False: 12.8k]
  ------------------
  883|      0|        ssl_MapLowLevelError(SSL_ERROR_SOCKET_WRITE_FAILURE);
  884|      0|        return SECFailure;
  885|      0|    }
  886|       |
  887|       |    /* Update the largest message sent so we can adjust the MTU
  888|       |     * estimate if necessary */
  889|  12.8k|    if (sent > ss->ssl3.hs.maxMessageSent)
  ------------------
  |  Branch (889:9): [True: 10.0k, False: 2.77k]
  ------------------
  890|  10.0k|        ss->ssl3.hs.maxMessageSent = sent;
  891|       |
  892|  12.8k|    return SECSuccess;
  893|  12.8k|}
dtlscon.c:dtls_StartRetransmitTimer:
  944|  11.9k|{
  945|  11.9k|    ss->ssl3.hs.rtRetries = 0;
  946|  11.9k|    return dtls_StartTimer(ss, ss->ssl3.hs.rtTimer,
  947|  11.9k|                           DTLS_RETRANSMIT_INITIAL_MS,
  ------------------
  |  |  126|  11.9k|#define DTLS_RETRANSMIT_INITIAL_MS 50
  ------------------
  948|  11.9k|                           dtls_RetransmitTimerExpiredCb);
  949|  11.9k|}
dtlscon.c:dtls_ReadSequenceNumber:
 1356|  1.44M|{
 1357|  1.44M|    sslSequenceNumber cap;
 1358|  1.44M|    sslSequenceNumber partial;
 1359|  1.44M|    sslSequenceNumber seqNum;
 1360|  1.44M|    sslSequenceNumber mask;
 1361|       |
 1362|  1.44M|    if (dtls_IsLongHeader(spec->version, hdr[0])) {
  ------------------
  |  Branch (1362:9): [True: 1.44M, False: 0]
  ------------------
 1363|  1.44M|        static const unsigned int seqNumOffset = 5; /* type, version, epoch */
 1364|  1.44M|        static const unsigned int seqNumLength = 6;
 1365|  1.44M|        sslReader r = SSL_READER(hdr + seqNumOffset, seqNumLength);
  ------------------
  |  |   85|  1.44M|    {                    \
  |  |   86|  1.44M|        { b, l }, 0      \
  |  |   87|  1.44M|    }
  ------------------
 1366|  1.44M|        (void)sslRead_ReadNumber(&r, seqNumLength, &seqNum);
 1367|  1.44M|        return seqNum;
 1368|  1.44M|    }
 1369|       |
 1370|       |    /* Only the least significant bits of the sequence number is available here.
 1371|       |     * This recovers the value based on the next expected sequence number.
 1372|       |     *
 1373|       |     * This works by determining the maximum possible sequence number, which is
 1374|       |     * half the range of possible values above the expected next value (the
 1375|       |     * expected next value is in |spec->seqNum|).  Then, the last part of the
 1376|       |     * sequence number is replaced.  If that causes the value to exceed the
 1377|       |     * maximum, subtract an entire range.
 1378|       |     */
 1379|      0|    if (hdr[0] & 0x08) {
  ------------------
  |  Branch (1379:9): [True: 0, False: 0]
  ------------------
 1380|      0|        cap = spec->nextSeqNum + (1ULL << 15);
 1381|      0|        partial = (((sslSequenceNumber)hdr[1]) << 8) |
 1382|      0|                  (sslSequenceNumber)hdr[2];
 1383|      0|        mask = (1ULL << 16) - 1;
 1384|      0|    } else {
 1385|      0|        cap = spec->nextSeqNum + (1ULL << 7);
 1386|      0|        partial = (sslSequenceNumber)hdr[1];
 1387|      0|        mask = (1ULL << 8) - 1;
 1388|      0|    }
 1389|      0|    seqNum = (cap & ~mask) | partial;
 1390|       |    /* The second check prevents the value from underflowing if we get a large
 1391|       |     * gap at the start of a connection, where this subtraction would cause the
 1392|       |     * sequence number to wrap to near UINT64_MAX. */
 1393|      0|    if ((partial > (cap & mask)) && (seqNum > mask)) {
  ------------------
  |  Branch (1393:9): [True: 0, False: 0]
  |  Branch (1393:37): [True: 0, False: 0]
  ------------------
 1394|      0|        seqNum -= mask + 1;
 1395|      0|    }
 1396|      0|    return seqNum;
 1397|  1.44M|}

ssl3_CheckCipherSuiteOrderConsistency:
  218|      1|{
  219|      1|    unsigned int i;
  220|       |
  221|      1|    PORT_Assert(SSL_NumImplementedCiphers == PR_ARRAY_SIZE(cipherSuites));
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  222|       |
  223|     72|    for (i = 0; i < PR_ARRAY_SIZE(cipherSuites); ++i) {
  ------------------
  |  |  167|     72|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (223:17): [True: 71, False: 1]
  ------------------
  224|     71|        PORT_Assert(SSL_ImplementedCiphers[i] == cipherSuites[i].cipher_suite);
  ------------------
  |  |  120|     71|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     71|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 71, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|     71|    }
  226|      1|}
ssl3_Alg2Mech:
  437|  1.21M|{
  438|  1.21M|    PORT_Assert(alg2Mech[calg].calg == calg);
  ------------------
  |  |  120|  1.21M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.21M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.21M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  439|  1.21M|    return alg2Mech[calg].cmech;
  440|  1.21M|}
SSL_GetStatistics:
  545|  9.73k|{
  546|  9.73k|    return &ssl3stats;
  547|  9.73k|}
SSL_AtomicIncrementLong:
  561|  15.7k|{
  562|  15.7k|    if ((sizeof *x) == sizeof(PRInt32)) {
  ------------------
  |  Branch (562:9): [Folded - Ignored]
  ------------------
  563|      0|        PR_ATOMIC_INCREMENT((PRInt32 *)x);
  ------------------
  |  |  122|      0|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  564|  15.7k|    } else {
  565|  15.7k|        tooLong *tl = (tooLong *)x;
  566|  15.7k|        if (PR_ATOMIC_INCREMENT(&tl->low) == 0)
  ------------------
  |  |  122|  15.7k|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  |  Branch (566:13): [True: 0, False: 15.7k]
  ------------------
  567|      0|            PR_ATOMIC_INCREMENT(&tl->high);
  ------------------
  |  |  122|      0|#define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
  ------------------
  568|  15.7k|    }
  569|  15.7k|}
ssl3_CipherSuiteAllowedForVersionRange:
  574|   662k|{
  575|   662k|    switch (cipherSuite) {
  576|  10.5k|        case TLS_DHE_RSA_WITH_AES_256_CBC_SHA256:
  ------------------
  |  |  128|  10.5k|#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256     0x006B
  ------------------
  |  Branch (576:9): [True: 10.5k, False: 652k]
  ------------------
  577|  20.8k|        case TLS_RSA_WITH_AES_256_CBC_SHA256:
  ------------------
  |  |  115|  20.8k|#define TLS_RSA_WITH_AES_256_CBC_SHA256         0x003D
  ------------------
  |  Branch (577:9): [True: 10.2k, False: 652k]
  ------------------
  578|  31.0k|        case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256:
  ------------------
  |  |  190|  31.0k|#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 0xC023
  ------------------
  |  Branch (578:9): [True: 10.2k, False: 652k]
  ------------------
  579|  41.3k|        case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384:
  ------------------
  |  |  191|  41.3k|#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 0xC024
  ------------------
  |  Branch (579:9): [True: 10.2k, False: 652k]
  ------------------
  580|  51.5k|        case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256:
  ------------------
  |  |  192|  51.5k|#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256   0xC027
  ------------------
  |  Branch (580:9): [True: 10.2k, False: 652k]
  ------------------
  581|  61.7k|        case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384:
  ------------------
  |  |  193|  61.7k|#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384   0xC028
  ------------------
  |  Branch (581:9): [True: 10.2k, False: 652k]
  ------------------
  582|  72.0k|        case TLS_DHE_RSA_WITH_AES_128_CBC_SHA256:
  ------------------
  |  |  126|  72.0k|#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256     0x0067
  ------------------
  |  Branch (582:9): [True: 10.2k, False: 652k]
  ------------------
  583|  82.2k|        case TLS_RSA_WITH_AES_128_CBC_SHA256:
  ------------------
  |  |  114|  82.2k|#define TLS_RSA_WITH_AES_128_CBC_SHA256         0x003C
  ------------------
  |  Branch (583:9): [True: 10.2k, False: 652k]
  ------------------
  584|  92.5k|        case TLS_RSA_WITH_AES_128_GCM_SHA256:
  ------------------
  |  |  139|  92.5k|#define TLS_RSA_WITH_AES_128_GCM_SHA256         0x009C
  ------------------
  |  Branch (584:9): [True: 10.2k, False: 652k]
  ------------------
  585|   102k|        case TLS_RSA_WITH_AES_256_GCM_SHA384:
  ------------------
  |  |  140|   102k|#define TLS_RSA_WITH_AES_256_GCM_SHA384         0x009D
  ------------------
  |  Branch (585:9): [True: 10.2k, False: 652k]
  ------------------
  586|   113k|        case TLS_DHE_DSS_WITH_AES_128_CBC_SHA256:
  ------------------
  |  |  117|   113k|#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA256     0x0040
  ------------------
  |  Branch (586:9): [True: 10.6k, False: 651k]
  ------------------
  587|   123k|        case TLS_DHE_DSS_WITH_AES_256_CBC_SHA256:
  ------------------
  |  |  127|   123k|#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA256     0x006A
  ------------------
  |  Branch (587:9): [True: 10.2k, False: 652k]
  ------------------
  588|   134k|        case TLS_RSA_WITH_NULL_SHA256:
  ------------------
  |  |  113|   134k|#define TLS_RSA_WITH_NULL_SHA256                0x003B
  ------------------
  |  Branch (588:9): [True: 10.3k, False: 652k]
  ------------------
  589|   144k|        case TLS_DHE_DSS_WITH_AES_128_GCM_SHA256:
  ------------------
  |  |  143|   144k|#define TLS_DHE_DSS_WITH_AES_128_GCM_SHA256     0x00A2
  ------------------
  |  Branch (589:9): [True: 10.5k, False: 652k]
  ------------------
  590|   154k|        case TLS_DHE_DSS_WITH_AES_256_GCM_SHA384:
  ------------------
  |  |  144|   154k|#define TLS_DHE_DSS_WITH_AES_256_GCM_SHA384     0x00A3
  ------------------
  |  Branch (590:9): [True: 10.2k, False: 652k]
  ------------------
  591|   165k|        case TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:
  ------------------
  |  |  195|   165k|#define TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0xC02B
  ------------------
  |  Branch (591:9): [True: 10.4k, False: 652k]
  ------------------
  592|   175k|        case TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:
  ------------------
  |  |  196|   175k|#define TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0xC02C
  ------------------
  |  Branch (592:9): [True: 10.2k, False: 652k]
  ------------------
  593|   185k|        case TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:
  ------------------
  |  |  198|   185k|#define TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256   0xC02F
  ------------------
  |  Branch (593:9): [True: 10.2k, False: 652k]
  ------------------
  594|   197k|        case TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:
  ------------------
  |  |  199|   197k|#define TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384   0xC030
  ------------------
  |  Branch (594:9): [True: 11.4k, False: 651k]
  ------------------
  595|   207k|        case TLS_DHE_RSA_WITH_AES_128_GCM_SHA256:
  ------------------
  |  |  141|   207k|#define TLS_DHE_RSA_WITH_AES_128_GCM_SHA256     0x009E
  ------------------
  |  Branch (595:9): [True: 10.2k, False: 652k]
  ------------------
  596|   217k|        case TLS_DHE_RSA_WITH_AES_256_GCM_SHA384:
  ------------------
  |  |  142|   217k|#define TLS_DHE_RSA_WITH_AES_256_GCM_SHA384     0x009F
  ------------------
  |  Branch (596:9): [True: 10.3k, False: 652k]
  ------------------
  597|   227k|        case TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:
  ------------------
  |  |  204|   227k|#define TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0xCCA9
  ------------------
  |  Branch (597:9): [True: 10.2k, False: 652k]
  ------------------
  598|   238k|        case TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:
  ------------------
  |  |  203|   238k|#define TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256   0xCCA8
  ------------------
  |  Branch (598:9): [True: 10.2k, False: 652k]
  ------------------
  599|   248k|        case TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256:
  ------------------
  |  |  205|   248k|#define TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256     0xCCAA
  ------------------
  |  Branch (599:9): [True: 10.2k, False: 652k]
  ------------------
  600|   248k|            return vrange->max >= SSL_LIBRARY_VERSION_TLS_1_2 &&
  ------------------
  |  |   20|   496k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (600:20): [True: 244k, False: 4.25k]
  ------------------
  601|   248k|                   vrange->min < SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|   244k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (601:20): [True: 221k, False: 22.8k]
  ------------------
  602|       |
  603|       |        /* RFC 4492: ECC cipher suites need TLS extensions to negotiate curves and
  604|       |         * point formats.*/
  605|  10.3k|        case TLS_ECDH_ECDSA_WITH_NULL_SHA:
  ------------------
  |  |  160|  10.3k|#define TLS_ECDH_ECDSA_WITH_NULL_SHA            0xC001
  ------------------
  |  Branch (605:9): [True: 10.3k, False: 652k]
  ------------------
  606|  10.3k|        case TLS_ECDH_ECDSA_WITH_RC4_128_SHA:
  ------------------
  |  |  161|  10.3k|#define TLS_ECDH_ECDSA_WITH_RC4_128_SHA         0xC002
  ------------------
  |  Branch (606:9): [True: 1, False: 662k]
  ------------------
  607|  20.7k|        case TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA:
  ------------------
  |  |  162|  20.7k|#define TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA    0xC003
  ------------------
  |  Branch (607:9): [True: 10.4k, False: 652k]
  ------------------
  608|  31.0k|        case TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA:
  ------------------
  |  |  163|  31.0k|#define TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA     0xC004
  ------------------
  |  Branch (608:9): [True: 10.2k, False: 652k]
  ------------------
  609|  41.2k|        case TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA:
  ------------------
  |  |  164|  41.2k|#define TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA     0xC005
  ------------------
  |  Branch (609:9): [True: 10.2k, False: 652k]
  ------------------
  610|  51.4k|        case TLS_ECDHE_ECDSA_WITH_NULL_SHA:
  ------------------
  |  |  166|  51.4k|#define TLS_ECDHE_ECDSA_WITH_NULL_SHA           0xC006
  ------------------
  |  Branch (610:9): [True: 10.2k, False: 652k]
  ------------------
  611|  51.4k|        case TLS_ECDHE_ECDSA_WITH_RC4_128_SHA:
  ------------------
  |  |  167|  51.4k|#define TLS_ECDHE_ECDSA_WITH_RC4_128_SHA        0xC007
  ------------------
  |  Branch (611:9): [True: 1, False: 662k]
  ------------------
  612|  61.6k|        case TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA:
  ------------------
  |  |  168|  61.6k|#define TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA   0xC008
  ------------------
  |  Branch (612:9): [True: 10.2k, False: 652k]
  ------------------
  613|  71.9k|        case TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA:
  ------------------
  |  |  169|  71.9k|#define TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA    0xC009
  ------------------
  |  Branch (613:9): [True: 10.2k, False: 652k]
  ------------------
  614|  82.2k|        case TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA:
  ------------------
  |  |  170|  82.2k|#define TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA    0xC00A
  ------------------
  |  Branch (614:9): [True: 10.3k, False: 652k]
  ------------------
  615|  92.4k|        case TLS_ECDH_RSA_WITH_NULL_SHA:
  ------------------
  |  |  172|  92.4k|#define TLS_ECDH_RSA_WITH_NULL_SHA              0xC00B
  ------------------
  |  Branch (615:9): [True: 10.2k, False: 652k]
  ------------------
  616|  92.4k|        case TLS_ECDH_RSA_WITH_RC4_128_SHA:
  ------------------
  |  |  173|  92.4k|#define TLS_ECDH_RSA_WITH_RC4_128_SHA           0xC00C
  ------------------
  |  Branch (616:9): [True: 1, False: 662k]
  ------------------
  617|   102k|        case TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA:
  ------------------
  |  |  174|   102k|#define TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA      0xC00D
  ------------------
  |  Branch (617:9): [True: 10.2k, False: 652k]
  ------------------
  618|   112k|        case TLS_ECDH_RSA_WITH_AES_128_CBC_SHA:
  ------------------
  |  |  175|   112k|#define TLS_ECDH_RSA_WITH_AES_128_CBC_SHA       0xC00E
  ------------------
  |  Branch (618:9): [True: 10.2k, False: 652k]
  ------------------
  619|   123k|        case TLS_ECDH_RSA_WITH_AES_256_CBC_SHA:
  ------------------
  |  |  176|   123k|#define TLS_ECDH_RSA_WITH_AES_256_CBC_SHA       0xC00F
  ------------------
  |  Branch (619:9): [True: 10.2k, False: 652k]
  ------------------
  620|   133k|        case TLS_ECDHE_RSA_WITH_NULL_SHA:
  ------------------
  |  |  178|   133k|#define TLS_ECDHE_RSA_WITH_NULL_SHA             0xC010
  ------------------
  |  Branch (620:9): [True: 10.2k, False: 652k]
  ------------------
  621|   133k|        case TLS_ECDHE_RSA_WITH_RC4_128_SHA:
  ------------------
  |  |  179|   133k|#define TLS_ECDHE_RSA_WITH_RC4_128_SHA          0xC011
  ------------------
  |  Branch (621:9): [True: 1, False: 662k]
  ------------------
  622|   143k|        case TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA:
  ------------------
  |  |  180|   143k|#define TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA     0xC012
  ------------------
  |  Branch (622:9): [True: 10.2k, False: 652k]
  ------------------
  623|   153k|        case TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:
  ------------------
  |  |  181|   153k|#define TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA      0xC013
  ------------------
  |  Branch (623:9): [True: 10.2k, False: 652k]
  ------------------
  624|   164k|        case TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
  ------------------
  |  |  182|   164k|#define TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA      0xC014
  ------------------
  |  Branch (624:9): [True: 10.2k, False: 652k]
  ------------------
  625|   164k|            return vrange->max >= SSL_LIBRARY_VERSION_TLS_1_0 &&
  ------------------
  |  |   18|   328k|#define SSL_LIBRARY_VERSION_TLS_1_0             0x0301
  ------------------
  |  Branch (625:20): [True: 164k, False: 0]
  ------------------
  626|   164k|                   vrange->min < SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|   164k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (626:20): [True: 148k, False: 15.2k]
  ------------------
  627|       |
  628|  12.7k|        case TLS_AES_128_GCM_SHA256:
  ------------------
  |  |  208|  12.7k|#define TLS_AES_128_GCM_SHA256                0x1301
  ------------------
  |  Branch (628:9): [True: 12.7k, False: 649k]
  ------------------
  629|  23.2k|        case TLS_AES_256_GCM_SHA384:
  ------------------
  |  |  209|  23.2k|#define TLS_AES_256_GCM_SHA384                0x1302
  ------------------
  |  Branch (629:9): [True: 10.4k, False: 652k]
  ------------------
  630|  33.5k|        case TLS_CHACHA20_POLY1305_SHA256:
  ------------------
  |  |  210|  33.5k|#define TLS_CHACHA20_POLY1305_SHA256          0x1303
  ------------------
  |  Branch (630:9): [True: 10.2k, False: 652k]
  ------------------
  631|  33.5k|            return vrange->max >= SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|  33.5k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  632|       |
  633|   216k|        default:
  ------------------
  |  Branch (633:9): [True: 216k, False: 446k]
  ------------------
  634|   216k|            return vrange->min < SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|   216k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  635|   662k|    }
  636|   662k|}
ssl_LookupCipherSuiteDef:
  642|  1.88M|{
  643|  1.88M|    int cipher_suite_def_len =
  644|  1.88M|        sizeof(cipher_suite_defs) / sizeof(cipher_suite_defs[0]);
  645|  1.88M|    int i;
  646|       |
  647|  69.9M|    for (i = 0; i < cipher_suite_def_len; i++) {
  ------------------
  |  Branch (647:17): [True: 69.9M, False: 0]
  ------------------
  648|  69.9M|        if (cipher_suite_defs[i].cipher_suite == suite)
  ------------------
  |  Branch (648:13): [True: 1.88M, False: 68.0M]
  ------------------
  649|  1.88M|            return &cipher_suite_defs[i];
  650|  69.9M|    }
  651|      0|    PORT_Assert(PR_FALSE); /* We should never get here. */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  652|      0|    PORT_SetError(SSL_ERROR_UNKNOWN_CIPHER_SUITE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  653|      0|    return NULL;
  654|  1.88M|}
ssl_LookupCipherSuiteCfg:
  675|  12.1k|{
  676|  12.1k|    return ssl_LookupCipherSuiteCfgMutable(suite,
  677|  12.1k|                                           CONST_CAST(ssl3CipherSuiteCfg, suites));
  ------------------
  |  |   96|  12.1k|#define CONST_CAST(T, X) ((T *)(X))
  ------------------
  678|  12.1k|}
ssl3_config_match_init:
  940|  17.8k|{
  941|  17.8k|    ssl3CipherSuiteCfg *suite;
  942|  17.8k|    const ssl3CipherSuiteDef *cipher_def;
  943|  17.8k|    SSLCipherAlgorithm cipher_alg;
  944|  17.8k|    CK_MECHANISM_TYPE cipher_mech;
  945|  17.8k|    SSLAuthType authType;
  946|  17.8k|    SSLKEAType keaType;
  947|  17.8k|    unsigned int i;
  948|  17.8k|    unsigned int numPresent = 0;
  949|  17.8k|    unsigned int numEnabled = 0;
  950|       |
  951|  17.8k|    PORT_Assert(ss);
  ------------------
  |  |  120|  17.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  17.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 17.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  952|  17.8k|    if (!ss) {
  ------------------
  |  Branch (952:9): [True: 0, False: 17.8k]
  ------------------
  953|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  954|      0|        return 0;
  955|      0|    }
  956|  17.8k|    if (SSL_ALL_VERSIONS_DISABLED(&ss->vrange)) {
  ------------------
  |  | 1503|  17.8k|    ((vrange)->min == SSL_LIBRARY_VERSION_NONE)
  |  |  ------------------
  |  |  |  | 1481|  17.8k|#define SSL_LIBRARY_VERSION_NONE 0
  |  |  ------------------
  |  |  |  Branch (1503:5): [True: 0, False: 17.8k]
  |  |  ------------------
  ------------------
  957|      0|        return 0;
  958|      0|    }
  959|  17.8k|    if (ss->sec.isServer && ss->psk &&
  ------------------
  |  Branch (959:9): [True: 0, False: 17.8k]
  |  Branch (959:29): [True: 0, False: 0]
  ------------------
  960|  17.8k|        PR_CLIST_IS_EMPTY(&ss->serverCerts) &&
  ------------------
  |  |   94|  17.8k|    ((_l)->next == (_l))
  |  |  ------------------
  |  |  |  Branch (94:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  961|  17.8k|        (ss->opt.requestCertificate || ss->opt.requireCertificate)) {
  ------------------
  |  Branch (961:10): [True: 0, False: 0]
  |  Branch (961:40): [True: 0, False: 0]
  ------------------
  962|       |        /* PSK and certificate auth cannot be combined. */
  963|      0|        PORT_SetError(SSL_ERROR_NO_CERTIFICATE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  964|      0|        return 0;
  965|      0|    }
  966|  17.8k|    if (ssl_CheckSignatureSchemes(ss) != SECSuccess) {
  ------------------
  |  Branch (966:9): [True: 0, False: 17.8k]
  ------------------
  967|      0|        return 0; /* Code already set. */
  968|      0|    }
  969|       |
  970|  17.8k|    ssl_FilterSupportedGroups(ss);
  971|  1.28M|    for (i = 0; i < ssl_V3_SUITES_IMPLEMENTED; i++) {
  ------------------
  |  |  245|  1.28M|#define ssl_V3_SUITES_IMPLEMENTED 71
  ------------------
  |  Branch (971:17): [True: 1.27M, False: 17.8k]
  ------------------
  972|  1.27M|        suite = &ss->cipherSuites[i];
  973|  1.27M|        if (suite->enabled) {
  ------------------
  |  Branch (973:13): [True: 1.20M, False: 63.3k]
  ------------------
  974|  1.20M|            ++numEnabled;
  975|       |            /* We need the cipher defs to see if we have a token that can handle
  976|       |             * this cipher.  It isn't part of the static definition.
  977|       |             */
  978|  1.20M|            cipher_def = ssl_LookupCipherSuiteDef(suite->cipher_suite);
  979|  1.20M|            if (!cipher_def) {
  ------------------
  |  Branch (979:17): [True: 0, False: 1.20M]
  ------------------
  980|      0|                suite->isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  981|      0|                continue;
  982|      0|            }
  983|  1.20M|            cipher_alg = ssl_GetBulkCipherDef(cipher_def)->calg;
  984|  1.20M|            cipher_mech = ssl3_Alg2Mech(cipher_alg);
  985|       |
  986|       |            /* Mark the suites that are backed by real tokens, certs and keys */
  987|  1.20M|            suite->isPresent = PR_TRUE;
  ------------------
  |  |  437|  1.20M|#define PR_TRUE 1
  ------------------
  988|       |
  989|  1.20M|            authType = kea_defs[cipher_def->key_exchange_alg].authKeyType;
  990|  1.20M|            if (authType != ssl_auth_null && authType != ssl_auth_tls13_any) {
  ------------------
  |  Branch (990:17): [True: 1.20M, False: 0]
  |  Branch (990:46): [True: 1.15M, False: 53.6k]
  ------------------
  991|  1.15M|                if (ss->sec.isServer &&
  ------------------
  |  Branch (991:21): [True: 0, False: 1.15M]
  ------------------
  992|  1.15M|                    !(ssl_HasCert(ss, ss->vrange.max, authType) &&
  ------------------
  |  Branch (992:23): [True: 0, False: 0]
  ------------------
  993|      0|                      ssl_HasSignatureScheme(ss, authType))) {
  ------------------
  |  Branch (993:23): [True: 0, False: 0]
  ------------------
  994|      0|                    suite->isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  995|  1.15M|                } else if (!PK11_TokenExists(auth_alg_defs[authType])) {
  ------------------
  |  Branch (995:28): [True: 0, False: 1.15M]
  ------------------
  996|      0|                    suite->isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  997|      0|                }
  998|  1.15M|            }
  999|       |
 1000|  1.20M|            keaType = kea_defs[cipher_def->key_exchange_alg].exchKeyType;
 1001|  1.20M|            if (keaType != ssl_kea_null &&
  ------------------
  |  Branch (1001:17): [True: 1.20M, False: 0]
  ------------------
 1002|  1.20M|                keaType != ssl_kea_tls13_any &&
  ------------------
  |  Branch (1002:17): [True: 1.15M, False: 53.6k]
  ------------------
 1003|  1.20M|                !PK11_TokenExists(kea_alg_defs[keaType])) {
  ------------------
  |  Branch (1003:17): [True: 0, False: 1.15M]
  ------------------
 1004|      0|                suite->isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1005|      0|            }
 1006|       |
 1007|  1.20M|            if (cipher_alg != ssl_calg_null &&
  ------------------
  |  Branch (1007:17): [True: 1.08M, False: 125k]
  ------------------
 1008|  1.20M|                !PK11_TokenExists(cipher_mech)) {
  ------------------
  |  Branch (1008:17): [True: 0, False: 1.08M]
  ------------------
 1009|      0|                suite->isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1010|      0|            }
 1011|       |
 1012|  1.20M|            if (suite->isPresent) {
  ------------------
  |  Branch (1012:17): [True: 1.20M, False: 0]
  ------------------
 1013|  1.20M|                ++numPresent;
 1014|  1.20M|            }
 1015|  1.20M|        }
 1016|  1.27M|    }
 1017|  17.8k|    PORT_AssertArg(numPresent > 0 || numEnabled == 0);
  ------------------
  |  |  124|  17.8k|#define PORT_AssertArg PR_ASSERT_ARG
  |  |  ------------------
  |  |  |  |  210|  17.8k|#define PR_ASSERT_ARG(_expr) PR_ASSERT(_expr)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  17.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 17.8k, False: 0]
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1018|  17.8k|    if (numPresent == 0) {
  ------------------
  |  Branch (1018:9): [True: 0, False: 17.8k]
  ------------------
 1019|      0|        PORT_SetError(SSL_ERROR_NO_CIPHERS_SUPPORTED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1020|      0|    }
 1021|  17.8k|    return numPresent;
 1022|  17.8k|}
ssl3_config_match:
 1030|   733k|{
 1031|   733k|    const ssl3CipherSuiteDef *cipher_def;
 1032|   733k|    const ssl3KEADef *kea_def;
 1033|       |
 1034|   733k|    if (!suite) {
  ------------------
  |  Branch (1034:9): [True: 0, False: 733k]
  ------------------
 1035|      0|        PORT_Assert(suite);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1036|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1037|      0|    }
 1038|       |
 1039|   733k|    PORT_Assert(policy != SSL_NOT_ALLOWED);
  ------------------
  |  |  120|   733k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   733k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 733k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1040|   733k|    if (policy == SSL_NOT_ALLOWED)
  ------------------
  |  |  699|   733k|#define SSL_NOT_ALLOWED 0 /* or invalid or unimplemented */
  ------------------
  |  Branch (1040:9): [True: 0, False: 733k]
  ------------------
 1041|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1042|       |
 1043|   733k|    if (!suite->enabled || !suite->isPresent)
  ------------------
  |  Branch (1043:9): [True: 71.5k, False: 661k]
  |  Branch (1043:28): [True: 0, False: 661k]
  ------------------
 1044|  71.5k|        return PR_FALSE;
  ------------------
  |  |  438|  71.5k|#define PR_FALSE 0
  ------------------
 1045|       |
 1046|   661k|    if ((suite->policy == SSL_NOT_ALLOWED) ||
  ------------------
  |  |  699|   661k|#define SSL_NOT_ALLOWED 0 /* or invalid or unimplemented */
  ------------------
  |  Branch (1046:9): [True: 0, False: 661k]
  ------------------
 1047|   661k|        (suite->policy > policy))
  ------------------
  |  Branch (1047:9): [True: 0, False: 661k]
  ------------------
 1048|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1049|       |
 1050|   661k|    PORT_Assert(ss != NULL);
  ------------------
  |  |  120|   661k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   661k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 661k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1051|   661k|    cipher_def = ssl_LookupCipherSuiteDef(suite->cipher_suite);
 1052|   661k|    PORT_Assert(cipher_def != NULL);
  ------------------
  |  |  120|   661k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   661k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 661k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1053|   661k|    kea_def = &kea_defs[cipher_def->key_exchange_alg];
 1054|   661k|    PORT_Assert(kea_def != NULL);
  ------------------
  |  |  120|   661k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   661k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 661k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1055|   661k|    if (!ssl_KEAEnabled(ss, kea_def->exchKeyType)) {
  ------------------
  |  Branch (1055:9): [True: 0, False: 661k]
  ------------------
 1056|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1057|      0|    }
 1058|       |
 1059|   661k|    if (ss->sec.isServer && !ssl_HasCert(ss, vrange->max, kea_def->authKeyType)) {
  ------------------
  |  Branch (1059:9): [True: 0, False: 661k]
  |  Branch (1059:29): [True: 0, False: 0]
  ------------------
 1060|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1061|      0|    }
 1062|       |
 1063|       |    /* If a PSK is selected, disable suites that use a different hash than
 1064|       |     * the PSK. We advertise non-PSK-compatible suites in the CH, as we could
 1065|       |     * fallback to certificate auth. The client handler will check hash
 1066|       |     * compatibility before committing to use the PSK. */
 1067|   661k|    if (ss->xtnData.selectedPsk) {
  ------------------
  |  Branch (1067:9): [True: 0, False: 661k]
  ------------------
 1068|      0|        if (ss->xtnData.selectedPsk->hash != cipher_def->prf_hash) {
  ------------------
  |  Branch (1068:13): [True: 0, False: 0]
  ------------------
 1069|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1070|      0|        }
 1071|      0|    }
 1072|       |
 1073|   661k|    return ssl3_CipherSuiteAllowedForVersionRange(suite->cipher_suite, vrange);
 1074|   661k|}
Null_Cipher:
 1103|  47.0k|{
 1104|  47.0k|    if (inputLen > maxOutputLen) {
  ------------------
  |  Branch (1104:9): [True: 0, False: 47.0k]
  ------------------
 1105|      0|        *outputLen = 0; /* Match PK11_CipherOp in setting outputLen */
 1106|      0|        PORT_SetError(SEC_ERROR_OUTPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1107|      0|        return SECFailure;
 1108|      0|    }
 1109|  47.0k|    *outputLen = inputLen;
 1110|  47.0k|    if (inputLen > 0 && input != output) {
  ------------------
  |  Branch (1110:9): [True: 42.3k, False: 4.66k]
  |  Branch (1110:25): [True: 42.3k, False: 0]
  ------------------
 1111|  42.3k|        PORT_Memcpy(output, input, inputLen);
  ------------------
  |  |  180|  42.3k|#define PORT_Memcpy memcpy
  ------------------
 1112|  42.3k|    }
 1113|  47.0k|    return SECSuccess;
 1114|  47.0k|}
ssl_ClientReadVersion:
 1195|  8.34k|{
 1196|  8.34k|    SSL3ProtocolVersion v;
 1197|  8.34k|    PRUint32 temp;
 1198|  8.34k|    SECStatus rv;
 1199|       |
 1200|  8.34k|    rv = ssl3_ConsumeHandshakeNumber(ss, &temp, 2, b, len);
 1201|  8.34k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1201:9): [True: 14, False: 8.33k]
  ------------------
 1202|     14|        return SECFailure; /* alert has been sent */
 1203|     14|    }
 1204|  8.33k|    v = (SSL3ProtocolVersion)temp;
 1205|       |
 1206|  8.33k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  8.33k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 8.33k, False: 0]
  |  |  ------------------
  ------------------
 1207|  8.33k|        v = dtls_DTLSVersionToTLSVersion(v);
 1208|       |        /* Check for failure. */
 1209|  8.33k|        if (!v || v > SSL_LIBRARY_VERSION_MAX_SUPPORTED) {
  ------------------
  |  | 1497|  8.33k|#define SSL_LIBRARY_VERSION_MAX_SUPPORTED SSL_LIBRARY_VERSION_TLS_1_3
  |  |  ------------------
  |  |  |  |   21|  8.33k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  |  |  ------------------
  ------------------
  |  Branch (1209:13): [True: 3, False: 8.33k]
  |  Branch (1209:19): [True: 32, False: 8.29k]
  ------------------
 1210|     35|            SSL3_SendAlert(ss, alert_fatal, illegal_parameter);
 1211|     35|            return SECFailure;
 1212|     35|        }
 1213|  8.33k|    }
 1214|       |
 1215|       |    /* You can't negotiate TLS 1.3 this way. */
 1216|  8.29k|    if (v >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  8.29k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1216:9): [True: 2, False: 8.29k]
  ------------------
 1217|      2|        SSL3_SendAlert(ss, alert_fatal, illegal_parameter);
 1218|      2|        return SECFailure;
 1219|      2|    }
 1220|  8.29k|    *version = v;
 1221|  8.29k|    return SECSuccess;
 1222|  8.29k|}
ssl3_GetNewRandom:
 1226|  8.85k|{
 1227|  8.85k|    SECStatus rv;
 1228|       |
 1229|  8.85k|    rv = PK11_GenerateRandom(random, SSL3_RANDOM_LENGTH);
  ------------------
  |  |   24|  8.85k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 1230|  8.85k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1230:9): [True: 0, False: 8.85k]
  ------------------
 1231|      0|        ssl_MapLowLevelError(SSL_ERROR_GENERATE_RANDOM_FAILURE);
 1232|      0|    }
 1233|  8.85k|    return rv;
 1234|  8.85k|}
ssl_VerifySignedHashesWithPubKey:
 1378|  2.90k|{
 1379|  2.90k|    SECItem *signature = NULL;
 1380|  2.90k|    SECStatus rv = SECFailure;
 1381|  2.90k|    SECItem hashItem;
 1382|  2.90k|    SECOidTag encAlg;
 1383|  2.90k|    SECOidTag hashAlg;
 1384|  2.90k|    void *pwArg = ss->pkcs11PinArg;
 1385|  2.90k|    PRBool isRsaPssScheme = ssl_IsRsaPssSignatureScheme(scheme);
 1386|       |
 1387|  2.90k|    PRINT_BUF(60, (NULL, "check signed hashes", buf->data, buf->len));
  ------------------
  |  |   74|  2.90k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 2.90k]
  |  |  ------------------
  |  |   75|  2.90k|    ssl_PrintBuf b
  ------------------
 1388|       |
 1389|  2.90k|    hashAlg = ssl3_HashTypeToOID(hash->hashAlg);
 1390|  2.90k|    switch (SECKEY_GetPublicKeyType(key)) {
 1391|  1.75k|        case rsaKey:
  ------------------
  |  Branch (1391:9): [True: 1.75k, False: 1.15k]
  ------------------
 1392|  1.75k|            encAlg = SEC_OID_PKCS1_RSA_ENCRYPTION;
 1393|  1.75k|            hashItem.data = hash->u.raw;
 1394|  1.75k|            hashItem.len = hash->len;
 1395|  1.75k|            if (scheme == ssl_sig_none) {
  ------------------
  |  Branch (1395:17): [True: 50, False: 1.70k]
  ------------------
 1396|     50|                scheme = ssl_sig_rsa_pkcs1_sha1md5;
 1397|     50|            }
 1398|  1.75k|            break;
 1399|    921|        case dsaKey:
  ------------------
  |  Branch (1399:9): [True: 921, False: 1.98k]
  ------------------
 1400|    921|            encAlg = SEC_OID_ANSIX9_DSA_SIGNATURE;
 1401|       |            /* ssl_hash_none is used to specify the MD5/SHA1 concatenated hash.
 1402|       |             * In that case, we use just the SHA1 part. */
 1403|    921|            if (hash->hashAlg == ssl_hash_none) {
  ------------------
  |  Branch (1403:17): [True: 4, False: 917]
  ------------------
 1404|      4|                hashItem.data = hash->u.s.sha;
 1405|      4|                hashItem.len = sizeof(hash->u.s.sha);
 1406|    917|            } else {
 1407|    917|                hashItem.data = hash->u.raw;
 1408|    917|                hashItem.len = hash->len;
 1409|    917|            }
 1410|       |            /* Allow DER encoded DSA signatures in SSL 3.0 */
 1411|    921|            if (ss->ssl3.prSpec->version > SSL_LIBRARY_VERSION_3_0 ||
  ------------------
  |  |   17|  1.84k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (1411:17): [True: 921, False: 0]
  ------------------
 1412|    921|                buf->len != SECKEY_SignatureLen(key)) {
  ------------------
  |  Branch (1412:17): [True: 0, False: 0]
  ------------------
 1413|    921|                signature = DSAU_DecodeDerSigToLen(buf, SECKEY_SignatureLen(key));
 1414|    921|                if (!signature) {
  ------------------
  |  Branch (1414:21): [True: 6, False: 915]
  ------------------
 1415|      6|                    PORT_SetError(SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE);
  ------------------
  |  |   65|      6|#define PORT_SetError PORT_SetError_Util
  ------------------
 1416|      6|                    goto loser;
 1417|      6|                }
 1418|    915|                buf = signature;
 1419|    915|            }
 1420|    915|            if (scheme == ssl_sig_none) {
  ------------------
  |  Branch (1420:17): [True: 0, False: 915]
  ------------------
 1421|      0|                scheme = ssl_sig_dsa_sha1;
 1422|      0|            }
 1423|    915|            break;
 1424|       |
 1425|    230|        case ecKey:
  ------------------
  |  Branch (1425:9): [True: 230, False: 2.67k]
  ------------------
 1426|    230|            encAlg = SEC_OID_ANSIX962_EC_PUBLIC_KEY;
 1427|       |            /* ssl_hash_none is used to specify the MD5/SHA1 concatenated hash.
 1428|       |             * In that case, we use just the SHA1 part.
 1429|       |             * ECDSA signatures always encode the integers r and s using ASN.1
 1430|       |             * (unlike DSA where ASN.1 encoding is used with TLS but not with
 1431|       |             * SSL3). So we can use VFY_VerifyDigestDirect for ECDSA.
 1432|       |             */
 1433|    230|            if (hash->hashAlg == ssl_hash_none) {
  ------------------
  |  Branch (1433:17): [True: 75, False: 155]
  ------------------
 1434|     75|                hashAlg = SEC_OID_SHA1;
 1435|     75|                hashItem.data = hash->u.s.sha;
 1436|     75|                hashItem.len = sizeof(hash->u.s.sha);
 1437|    155|            } else {
 1438|    155|                hashItem.data = hash->u.raw;
 1439|    155|                hashItem.len = hash->len;
 1440|    155|            }
 1441|    230|            if (scheme == ssl_sig_none) {
  ------------------
  |  Branch (1441:17): [True: 75, False: 155]
  ------------------
 1442|     75|                scheme = ssl_sig_ecdsa_sha1;
 1443|     75|            }
 1444|    230|            break;
 1445|       |
 1446|      2|        default:
  ------------------
  |  Branch (1446:9): [True: 2, False: 2.90k]
  ------------------
 1447|      2|            PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
 1448|      2|            goto loser;
 1449|  2.90k|    }
 1450|       |
 1451|  2.90k|    PRINT_BUF(60, (NULL, "hash(es) to be verified",
  ------------------
  |  |   74|  2.90k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 2.90k]
  |  |  ------------------
  |  |   75|  2.90k|    ssl_PrintBuf b
  ------------------
 1452|  2.90k|                   hashItem.data, hashItem.len));
 1453|       |
 1454|  2.90k|    if (isRsaPssScheme ||
  ------------------
  |  Branch (1454:9): [True: 1.08k, False: 1.81k]
  ------------------
 1455|  2.90k|        hashAlg == SEC_OID_UNKNOWN ||
  ------------------
  |  Branch (1455:9): [True: 50, False: 1.76k]
  ------------------
 1456|  2.90k|        SECKEY_GetPublicKeyType(key) == dsaKey) {
  ------------------
  |  Branch (1456:9): [True: 915, False: 854]
  ------------------
 1457|       |        /* VFY_VerifyDigestDirect requires DSA signatures to be DER-encoded.
 1458|       |         * DSA signatures are DER-encoded in TLS but not in SSL3 and the code
 1459|       |         * above always removes the DER encoding of DSA signatures when
 1460|       |         * present. Thus DSA signatures are always verified with PK11_Verify.
 1461|       |         */
 1462|  2.04k|        CK_MECHANISM_TYPE mech = PK11_MapSignKeyType(key->keyType);
 1463|       |
 1464|  2.04k|        SECItem *params = NULL;
 1465|  2.04k|        CK_RSA_PKCS_PSS_PARAMS pssParams;
 1466|  2.04k|        SECItem pssParamsItem = { siBuffer,
 1467|  2.04k|                                  (unsigned char *)&pssParams,
 1468|  2.04k|                                  sizeof(pssParams) };
 1469|       |
 1470|  2.04k|        if (isRsaPssScheme) {
  ------------------
  |  Branch (1470:13): [True: 1.08k, False: 965]
  ------------------
 1471|  1.08k|            pssParams.hashAlg = ssl3_GetHashMechanismByHashType(hash->hashAlg);
 1472|  1.08k|            pssParams.mgf = ssl3_GetMgfMechanismByHashType(hash->hashAlg);
 1473|  1.08k|            pssParams.sLen = hashItem.len;
 1474|  1.08k|            params = &pssParamsItem;
 1475|  1.08k|            mech = CKM_RSA_PKCS_PSS;
  ------------------
  |  |  741|  1.08k|#define CKM_RSA_PKCS_PSS 0x0000000DUL
  ------------------
 1476|  1.08k|        }
 1477|       |
 1478|  2.04k|        rv = PK11_VerifyWithMechanism(key, mech, params, buf, &hashItem, pwArg);
 1479|  2.04k|    } else {
 1480|    854|        rv = VFY_VerifyDigestDirect(&hashItem, key, buf, encAlg, hashAlg,
 1481|    854|                                    pwArg);
 1482|    854|    }
 1483|  2.90k|    if (signature) {
  ------------------
  |  Branch (1483:9): [True: 915, False: 1.98k]
  ------------------
 1484|    915|        SECITEM_FreeItem(signature, PR_TRUE);
  ------------------
  |  |  108|    915|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(signature, PR_TRUE);
  ------------------
  |  |  437|    915|#define PR_TRUE 1
  ------------------
 1485|    915|    }
 1486|  2.90k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1486:9): [True: 2.90k, False: 0]
  ------------------
 1487|  2.90k|        ssl_MapLowLevelError(SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE);
 1488|  2.90k|    }
 1489|  2.90k|    if (!ss->sec.isServer) {
  ------------------
  |  Branch (1489:9): [True: 2.90k, False: 0]
  ------------------
 1490|  2.90k|        ss->sec.signatureScheme = scheme;
 1491|  2.90k|        ss->sec.authType = ssl_SignatureSchemeToAuthType(scheme);
 1492|  2.90k|    }
 1493|       |
 1494|  2.90k|loser:
 1495|  2.90k|#ifdef UNSAFE_FUZZER_MODE
 1496|  2.90k|    rv = SECSuccess;
 1497|  2.90k|    PORT_SetError(0);
  ------------------
  |  |   65|  2.90k|#define PORT_SetError PORT_SetError_Util
  ------------------
 1498|  2.90k|#endif
 1499|  2.90k|    return rv;
 1500|  2.90k|}
ssl3_VerifySignedHashes:
 1506|  2.90k|{
 1507|  2.90k|    SECKEYPublicKey *pubKey =
 1508|  2.90k|        SECKEY_ExtractPublicKey(&ss->sec.peerCert->subjectPublicKeyInfo);
 1509|  2.90k|    if (pubKey == NULL) {
  ------------------
  |  Branch (1509:9): [True: 0, False: 2.90k]
  ------------------
 1510|      0|        ssl_MapLowLevelError(SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE);
 1511|      0|        return SECFailure;
 1512|      0|    }
 1513|  2.90k|    SECStatus rv = ssl_VerifySignedHashesWithPubKey(ss, pubKey, scheme,
 1514|  2.90k|                                                    hash, buf);
 1515|  2.90k|    SECKEY_DestroyPublicKey(pubKey);
 1516|  2.90k|    return rv;
 1517|  2.90k|}
ssl3_ComputeCommonKeyHash:
 1529|  2.90k|{
 1530|  2.90k|    SECStatus rv;
 1531|  2.90k|    SECOidTag hashOID;
 1532|  2.90k|    PRUint32 policy;
 1533|       |
 1534|  2.90k|    if (hashAlg == ssl_hash_none) {
  ------------------
  |  Branch (1534:9): [True: 131, False: 2.77k]
  ------------------
 1535|    131|        if ((NSS_GetAlgorithmPolicy(SEC_OID_SHA1, &policy) == SECSuccess) &&
  ------------------
  |  Branch (1535:13): [True: 131, False: 0]
  ------------------
 1536|    131|            !(policy & NSS_USE_ALG_IN_SSL_KX)) {
  ------------------
  |  |  572|    131|#define NSS_USE_ALG_IN_SSL_KX 0x00000004           /* used in SSL key exchange */
  ------------------
  |  Branch (1536:13): [True: 0, False: 131]
  ------------------
 1537|      0|            ssl_MapLowLevelError(SSL_ERROR_UNSUPPORTED_HASH_ALGORITHM);
 1538|      0|            return SECFailure;
 1539|      0|        }
 1540|    131|        rv = PK11_HashBuf(SEC_OID_MD5, hashes->u.s.md5, hashBuf, bufLen);
 1541|    131|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1541:13): [True: 0, False: 131]
  ------------------
 1542|      0|            ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);
 1543|      0|            return rv;
 1544|      0|        }
 1545|    131|        rv = PK11_HashBuf(SEC_OID_SHA1, hashes->u.s.sha, hashBuf, bufLen);
 1546|    131|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1546:13): [True: 0, False: 131]
  ------------------
 1547|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 1548|      0|            return rv;
 1549|      0|        }
 1550|    131|        hashes->len = MD5_LENGTH + SHA1_LENGTH;
  ------------------
  |  |   38|    131|#define MD5_LENGTH 16
  ------------------
                      hashes->len = MD5_LENGTH + SHA1_LENGTH;
  ------------------
  |  |   39|    131|#define SHA1_LENGTH 20
  ------------------
 1551|  2.77k|    } else {
 1552|  2.77k|        hashOID = ssl3_HashTypeToOID(hashAlg);
 1553|  2.77k|        if ((NSS_GetAlgorithmPolicy(hashOID, &policy) == SECSuccess) &&
  ------------------
  |  Branch (1553:13): [True: 2.77k, False: 0]
  ------------------
 1554|  2.77k|            !(policy & NSS_USE_ALG_IN_SSL_KX)) {
  ------------------
  |  |  572|  2.77k|#define NSS_USE_ALG_IN_SSL_KX 0x00000004           /* used in SSL key exchange */
  ------------------
  |  Branch (1554:13): [True: 0, False: 2.77k]
  ------------------
 1555|      0|            ssl_MapLowLevelError(SSL_ERROR_UNSUPPORTED_HASH_ALGORITHM);
 1556|      0|            return SECFailure;
 1557|      0|        }
 1558|  2.77k|        hashes->len = HASH_ResultLenByOidTag(hashOID);
 1559|  2.77k|        if (hashes->len == 0 || hashes->len > sizeof(hashes->u.raw)) {
  ------------------
  |  Branch (1559:13): [True: 0, False: 2.77k]
  |  Branch (1559:33): [True: 0, False: 2.77k]
  ------------------
 1560|      0|            ssl_MapLowLevelError(SSL_ERROR_UNSUPPORTED_HASH_ALGORITHM);
 1561|      0|            return SECFailure;
 1562|      0|        }
 1563|  2.77k|        rv = PK11_HashBuf(hashOID, hashes->u.raw, hashBuf, bufLen);
 1564|  2.77k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1564:13): [True: 0, False: 2.77k]
  ------------------
 1565|      0|            ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 1566|      0|            return rv;
 1567|      0|        }
 1568|  2.77k|    }
 1569|  2.90k|    hashes->hashAlg = hashAlg;
 1570|  2.90k|    return SECSuccess;
 1571|  2.90k|}
ssl3_SetupBothPendingCipherSpecs:
 1693|  5.56k|{
 1694|  5.56k|    ssl3CipherSuite suite = ss->ssl3.hs.cipher_suite;
 1695|  5.56k|    SSL3KeyExchangeAlgorithm kea;
 1696|  5.56k|    const ssl3CipherSuiteDef *suiteDef;
 1697|  5.56k|    SECStatus rv;
 1698|       |
 1699|  5.56k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  5.56k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.39k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2.73k, False: 2.83k]
  |  |  |  |  |  Branch (208:7): [True: 2.83k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1700|  5.56k|    PORT_Assert(ss->version < SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|  5.56k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.56k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.56k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1701|       |
 1702|  5.56k|    ssl_GetSpecWriteLock(ss); /*******************************/
  ------------------
  |  | 1435|  5.56k|    {                                            \
  |  | 1436|  5.56k|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 2.83k, False: 2.73k]
  |  |  ------------------
  |  | 1437|  5.56k|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|  2.83k|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|  5.56k|    }
  ------------------
 1703|       |
 1704|       |    /* This hack provides maximal interoperability with SSL 3 servers. */
 1705|  5.56k|    if (ss->ssl3.cwSpec->macDef->mac == ssl_mac_null) {
  ------------------
  |  Branch (1705:9): [True: 5.56k, False: 0]
  ------------------
 1706|       |        /* SSL records are not being MACed. */
 1707|  5.56k|        ss->ssl3.cwSpec->version = ss->version;
 1708|  5.56k|    }
 1709|       |
 1710|  5.56k|    SSL_TRC(3, ("%d: SSL3[%d]: Set XXX Pending Cipher Suite to 0x%04x",
  ------------------
  |  |   71|  5.56k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 5.56k]
  |  |  ------------------
  |  |   72|  5.56k|    ssl_Trace b
  ------------------
 1711|  5.56k|                SSL_GETPID(), ss->fd, suite));
 1712|       |
 1713|  5.56k|    suiteDef = ssl_LookupCipherSuiteDef(suite);
 1714|  5.56k|    if (suiteDef == NULL) {
  ------------------
  |  Branch (1714:9): [True: 0, False: 5.56k]
  ------------------
 1715|      0|        goto loser;
 1716|      0|    }
 1717|       |
 1718|  5.56k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  5.56k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 5.56k, False: 0]
  |  |  ------------------
  ------------------
 1719|       |        /* Double-check that we did not pick an RC4 suite */
 1720|  5.56k|        PORT_Assert(suiteDef->bulk_cipher_alg != cipher_rc4);
  ------------------
  |  |  120|  5.56k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.56k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.56k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1721|  5.56k|    }
 1722|       |
 1723|  5.56k|    ss->ssl3.hs.suite_def = suiteDef;
 1724|       |
 1725|  5.56k|    kea = suiteDef->key_exchange_alg;
 1726|  5.56k|    ss->ssl3.hs.kea_def = &kea_defs[kea];
 1727|  5.56k|    PORT_Assert(ss->ssl3.hs.kea_def->kea == kea);
  ------------------
  |  |  120|  5.56k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.56k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.56k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1728|       |
 1729|  5.56k|    rv = ssl3_SetupPendingCipherSpec(ss, ssl_secret_read, suiteDef,
 1730|  5.56k|                                     &ss->ssl3.prSpec);
 1731|  5.56k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1731:9): [True: 0, False: 5.56k]
  ------------------
 1732|      0|        goto loser;
 1733|      0|    }
 1734|  5.56k|    rv = ssl3_SetupPendingCipherSpec(ss, ssl_secret_write, suiteDef,
 1735|  5.56k|                                     &ss->ssl3.pwSpec);
 1736|  5.56k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1736:9): [True: 0, False: 5.56k]
  ------------------
 1737|      0|        goto loser;
 1738|      0|    }
 1739|       |
 1740|  5.56k|    if (ssl3_ExtensionNegotiated(ss, ssl_record_size_limit_xtn)) {
  ------------------
  |  Branch (1740:9): [True: 157, False: 5.40k]
  ------------------
 1741|    157|        ss->ssl3.prSpec->recordSizeLimit = PR_MIN(MAX_FRAGMENT_LENGTH,
  ------------------
  |  |  158|    157|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 157, False: 0]
  |  |  ------------------
  ------------------
 1742|    157|                                                  ss->opt.recordSizeLimit);
 1743|    157|        ss->ssl3.pwSpec->recordSizeLimit = PR_MIN(MAX_FRAGMENT_LENGTH,
  ------------------
  |  |  158|    157|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 157]
  |  |  ------------------
  ------------------
 1744|    157|                                                  ss->xtnData.recordSizeLimit);
 1745|    157|    }
 1746|       |
 1747|  5.56k|    ssl_ReleaseSpecWriteLock(ss); /*******************************/
  ------------------
  |  | 1440|  5.56k|    {                                              \
  |  | 1441|  5.56k|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 2.83k, False: 2.73k]
  |  |  ------------------
  |  | 1442|  5.56k|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|  2.83k|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|  5.56k|    }
  ------------------
 1748|  5.56k|    return SECSuccess;
 1749|       |
 1750|      0|loser:
 1751|      0|    ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|      0|    {                                              \
  |  | 1441|      0|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1442|      0|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|      0|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|      0|    }
  ------------------
 1752|      0|    return SECFailure;
 1753|  5.56k|}
ssl3_InitPendingCipherSpecs:
 1898|  1.76k|{
 1899|  1.76k|    PK11SymKey *masterSecret;
 1900|  1.76k|    ssl3CipherSpec *pwSpec;
 1901|  1.76k|    ssl3CipherSpec *prSpec;
 1902|  1.76k|    SECStatus rv;
 1903|       |
 1904|  1.76k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.66k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 860, False: 900]
  |  |  |  |  |  Branch (208:7): [True: 900, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1905|  1.76k|    PORT_Assert(secret);
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1906|       |
 1907|  1.76k|    ssl_GetSpecWriteLock(ss); /**************************************/
  ------------------
  |  | 1435|  1.76k|    {                                            \
  |  | 1436|  1.76k|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 900, False: 860]
  |  |  ------------------
  |  | 1437|  1.76k|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|    900|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|  1.76k|    }
  ------------------
 1908|       |
 1909|  1.76k|    PORT_Assert(ss->ssl3.pwSpec);
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1910|  1.76k|    PORT_Assert(ss->ssl3.cwSpec->epoch == ss->ssl3.crSpec->epoch);
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1911|  1.76k|    prSpec = ss->ssl3.prSpec;
 1912|  1.76k|    pwSpec = ss->ssl3.pwSpec;
 1913|       |
 1914|  1.76k|    if (ss->ssl3.cwSpec->epoch == PR_UINT16_MAX) {
  ------------------
  |  |  270|  1.76k|#define PR_UINT16_MAX 65535U
  ------------------
  |  Branch (1914:9): [True: 0, False: 1.76k]
  ------------------
 1915|       |        /* The problem here is that we have rehandshaked too many
 1916|       |         * times (you are not allowed to wrap the epoch). The
 1917|       |         * spec says you should be discarding the connection
 1918|       |         * and start over, so not much we can do here. */
 1919|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1920|      0|        goto loser;
 1921|      0|    }
 1922|       |
 1923|  1.76k|    if (derive) {
  ------------------
  |  Branch (1923:9): [True: 1.76k, False: 0]
  ------------------
 1924|  1.76k|        rv = ssl3_ComputeMasterSecret(ss, secret, &masterSecret);
 1925|  1.76k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1925:13): [True: 0, False: 1.76k]
  ------------------
 1926|      0|            goto loser;
 1927|      0|        }
 1928|  1.76k|    } else {
 1929|      0|        masterSecret = secret;
 1930|      0|    }
 1931|       |
 1932|  1.76k|    PORT_Assert(masterSecret);
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1933|  1.76k|    rv = ssl3_DeriveConnectionKeys(ss, masterSecret);
 1934|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1934:9): [True: 0, False: 1.76k]
  ------------------
 1935|      0|        if (derive) {
  ------------------
  |  Branch (1935:13): [True: 0, False: 0]
  ------------------
 1936|       |            /* masterSecret was created here. */
 1937|      0|            PK11_FreeSymKey(masterSecret);
 1938|      0|        }
 1939|      0|        goto loser;
 1940|      0|    }
 1941|       |
 1942|       |    /* Both cipher specs maintain a reference to the master secret, since each
 1943|       |     * is managed and freed independently. */
 1944|  1.76k|    prSpec->masterSecret = masterSecret;
 1945|  1.76k|    pwSpec->masterSecret = PK11_ReferenceSymKey(masterSecret);
 1946|  1.76k|    rv = ssl3_InitPendingContexts(ss, ss->ssl3.prSpec);
 1947|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1947:9): [True: 0, False: 1.76k]
  ------------------
 1948|      0|        goto loser;
 1949|      0|    }
 1950|       |
 1951|  1.76k|    rv = ssl3_InitPendingContexts(ss, ss->ssl3.pwSpec);
 1952|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1952:9): [True: 0, False: 1.76k]
  ------------------
 1953|      0|        goto loser;
 1954|      0|    }
 1955|       |
 1956|  1.76k|    ssl_ReleaseSpecWriteLock(ss); /******************************/
  ------------------
  |  | 1440|  1.76k|    {                                              \
  |  | 1441|  1.76k|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 900, False: 860]
  |  |  ------------------
  |  | 1442|  1.76k|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|    900|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|  1.76k|    }
  ------------------
 1957|  1.76k|    return SECSuccess;
 1958|       |
 1959|      0|loser:
 1960|      0|    ssl_ReleaseSpecWriteLock(ss); /******************************/
  ------------------
  |  | 1440|      0|    {                                              \
  |  | 1441|      0|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1442|      0|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|      0|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|      0|    }
  ------------------
 1961|      0|    ssl_MapLowLevelError(SSL_ERROR_SESSION_KEY_GEN_FAILURE);
 1962|      0|    return SECFailure;
 1963|  1.76k|}
ssl_InsertRecordHeader:
 2338|  18.8k|{
 2339|  18.8k|    SECStatus rv;
 2340|       |
 2341|       |#ifndef UNSAFE_FUZZER_MODE
 2342|       |    if (cwSpec->version >= SSL_LIBRARY_VERSION_TLS_1_3 &&
 2343|       |        cwSpec->epoch > TrafficKeyClearText) {
 2344|       |        if (IS_DTLS(ss)) {
 2345|       |            return dtls13_InsertCipherTextHeader(ss, cwSpec, wrBuf,
 2346|       |                                                 needsLength);
 2347|       |        }
 2348|       |        contentType = ssl_ct_application_data;
 2349|       |    }
 2350|       |#endif
 2351|  18.8k|    rv = sslBuffer_AppendNumber(wrBuf, contentType, 1);
 2352|  18.8k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2352:9): [True: 0, False: 18.8k]
  ------------------
 2353|      0|        return SECFailure;
 2354|      0|    }
 2355|       |
 2356|  18.8k|    rv = sslBuffer_AppendNumber(wrBuf, cwSpec->recordVersion, 2);
 2357|  18.8k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2357:9): [True: 0, False: 18.8k]
  ------------------
 2358|      0|        return SECFailure;
 2359|      0|    }
 2360|  18.8k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  18.8k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 18.8k, False: 0]
  |  |  ------------------
  ------------------
 2361|  18.8k|        rv = sslBuffer_AppendNumber(wrBuf, cwSpec->epoch, 2);
 2362|  18.8k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2362:13): [True: 0, False: 18.8k]
  ------------------
 2363|      0|            return SECFailure;
 2364|      0|        }
 2365|  18.8k|        rv = sslBuffer_AppendNumber(wrBuf, cwSpec->nextSeqNum, 6);
 2366|  18.8k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2366:13): [True: 0, False: 18.8k]
  ------------------
 2367|      0|            return SECFailure;
 2368|      0|        }
 2369|  18.8k|    }
 2370|  18.8k|    *needsLength = PR_TRUE;
  ------------------
  |  |  437|  18.8k|#define PR_TRUE 1
  ------------------
 2371|  18.8k|    return SECSuccess;
 2372|  18.8k|}
ssl_ProtectRecord:
 2377|  18.8k|{
 2378|  18.8k|    PRBool needsLength;
 2379|  18.8k|    unsigned int lenOffset;
 2380|  18.8k|    SECStatus rv;
 2381|       |
 2382|  18.8k|    PORT_Assert(cwSpec->direction == ssl_secret_write);
  ------------------
  |  |  120|  18.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  18.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2383|  18.8k|    PORT_Assert(SSL_BUFFER_LEN(wrBuf) == 0);
  ------------------
  |  |  120|  18.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  18.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2384|  18.8k|    PORT_Assert(cwSpec->cipherDef->max_records <= RECORD_SEQ_MAX);
  ------------------
  |  |  120|  18.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  18.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2385|       |
 2386|  18.8k|    if (cwSpec->nextSeqNum >= cwSpec->cipherDef->max_records) {
  ------------------
  |  Branch (2386:9): [True: 0, False: 18.8k]
  ------------------
 2387|      0|        SSL_TRC(3, ("%d: SSL[-]: write sequence number at limit 0x%0llx",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 2388|      0|                    SSL_GETPID(), cwSpec->nextSeqNum));
 2389|      0|        PORT_SetError(SSL_ERROR_TOO_MANY_RECORDS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2390|      0|        return SECFailure;
 2391|      0|    }
 2392|       |
 2393|  18.8k|    rv = ssl_InsertRecordHeader(ss, cwSpec, ct, wrBuf, &needsLength);
 2394|  18.8k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2394:9): [True: 0, False: 18.8k]
  ------------------
 2395|      0|        return SECFailure;
 2396|      0|    }
 2397|  18.8k|    if (needsLength) {
  ------------------
  |  Branch (2397:9): [True: 18.8k, False: 0]
  ------------------
 2398|  18.8k|        rv = sslBuffer_Skip(wrBuf, 2, &lenOffset);
 2399|  18.8k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2399:13): [True: 0, False: 18.8k]
  ------------------
 2400|      0|            return SECFailure;
 2401|      0|        }
 2402|  18.8k|    }
 2403|       |
 2404|  18.8k|#ifdef UNSAFE_FUZZER_MODE
 2405|  18.8k|    {
 2406|  18.8k|        unsigned int len;
 2407|  18.8k|        rv = Null_Cipher(NULL, SSL_BUFFER_NEXT(wrBuf), &len,
  ------------------
  |  |   37|  18.8k|#define SSL_BUFFER_NEXT(b) ((b)->buf + (b)->len)
  ------------------
 2408|  18.8k|                         SSL_BUFFER_SPACE(wrBuf), pIn, contentLen);
  ------------------
  |  |   38|  18.8k|#define SSL_BUFFER_SPACE(b) ((b)->space - (b)->len)
  ------------------
 2409|  18.8k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2409:13): [True: 0, False: 18.8k]
  ------------------
 2410|      0|            return SECFailure; /* error was set */
 2411|      0|        }
 2412|  18.8k|        rv = sslBuffer_Skip(wrBuf, len, NULL);
 2413|  18.8k|        PORT_Assert(rv == SECSuccess); /* Can't fail. */
  ------------------
  |  |  120|  18.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  18.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2414|  18.8k|    }
 2415|       |#else
 2416|       |    if (cwSpec->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
 2417|       |        PRUint8 *cipherText = SSL_BUFFER_NEXT(wrBuf);
 2418|       |        unsigned int bufLen = SSL_BUFFER_LEN(wrBuf);
 2419|       |        rv = tls13_ProtectRecord(ss, cwSpec, ct, pIn, contentLen, wrBuf);
 2420|       |        if (rv != SECSuccess) {
 2421|       |            return SECFailure;
 2422|       |        }
 2423|       |        if (IS_DTLS(ss)) {
 2424|       |            bufLen = SSL_BUFFER_LEN(wrBuf) - bufLen;
 2425|       |            rv = dtls13_MaskSequenceNumber(ss, cwSpec,
 2426|       |                                           SSL_BUFFER_BASE(wrBuf),
 2427|       |                                           cipherText, bufLen);
 2428|       |        }
 2429|       |    } else {
 2430|       |        rv = ssl3_MACEncryptRecord(cwSpec, ss->sec.isServer, IS_DTLS(ss), ct,
 2431|       |                                   pIn, contentLen, wrBuf);
 2432|       |    }
 2433|       |#endif
 2434|  18.8k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2434:9): [True: 0, False: 18.8k]
  ------------------
 2435|      0|        return SECFailure; /* error was set */
 2436|      0|    }
 2437|       |
 2438|  18.8k|    if (needsLength) {
  ------------------
  |  Branch (2438:9): [True: 18.8k, False: 0]
  ------------------
 2439|       |        /* Insert the length. */
 2440|  18.8k|        rv = sslBuffer_InsertLength(wrBuf, lenOffset, 2);
 2441|  18.8k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2441:13): [True: 0, False: 18.8k]
  ------------------
 2442|      0|            PORT_Assert(0); /* Can't fail. */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2443|      0|            return SECFailure;
 2444|      0|        }
 2445|  18.8k|    }
 2446|       |
 2447|  18.8k|    ++cwSpec->nextSeqNum;
 2448|  18.8k|    return SECSuccess;
 2449|  18.8k|}
ssl_ProtectNextRecord:
 2455|  18.8k|{
 2456|  18.8k|    sslBuffer *wrBuf = &ss->sec.writeBuf;
 2457|  18.8k|    unsigned int contentLen;
 2458|  18.8k|    unsigned int spaceNeeded;
 2459|  18.8k|    SECStatus rv;
 2460|       |
 2461|  18.8k|    contentLen = PR_MIN(nIn, spec->recordSizeLimit);
  ------------------
  |  |  158|  18.8k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 18.5k, False: 260]
  |  |  ------------------
  ------------------
 2462|  18.8k|    spaceNeeded = contentLen + SSL3_BUFFER_FUDGE;
  ------------------
  |  | 1373|  18.8k|#define SSL3_BUFFER_FUDGE 100
  ------------------
 2463|  18.8k|    if (spec->version >= SSL_LIBRARY_VERSION_TLS_1_1 &&
  ------------------
  |  |   19|  37.6k|#define SSL_LIBRARY_VERSION_TLS_1_1             0x0302
  ------------------
  |  Branch (2463:9): [True: 18.8k, False: 0]
  ------------------
 2464|  18.8k|        spec->cipherDef->type == type_block) {
  ------------------
  |  Branch (2464:9): [True: 1.92k, False: 16.9k]
  ------------------
 2465|  1.92k|        spaceNeeded += spec->cipherDef->iv_size;
 2466|  1.92k|    }
 2467|  18.8k|    if (spaceNeeded > SSL_BUFFER_SPACE(wrBuf)) {
  ------------------
  |  |   38|  18.8k|#define SSL_BUFFER_SPACE(b) ((b)->space - (b)->len)
  ------------------
  |  Branch (2467:9): [True: 0, False: 18.8k]
  ------------------
 2468|      0|        rv = sslBuffer_Grow(wrBuf, spaceNeeded);
 2469|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2469:13): [True: 0, False: 0]
  ------------------
 2470|      0|            SSL_DBG(("%d: SSL3[%d]: failed to expand write buffer to %d",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
 2471|      0|                     SSL_GETPID(), ss->fd, spaceNeeded));
 2472|      0|            return SECFailure;
 2473|      0|        }
 2474|      0|    }
 2475|       |
 2476|  18.8k|    rv = ssl_ProtectRecord(ss, spec, ct, pIn, contentLen, wrBuf);
 2477|  18.8k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2477:9): [True: 0, False: 18.8k]
  ------------------
 2478|      0|        return SECFailure;
 2479|      0|    }
 2480|  18.8k|    PRINT_BUF(50, (ss, "send (encrypted) record data:",
  ------------------
  |  |   74|  18.8k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.8k]
  |  |  ------------------
  |  |   75|  18.8k|    ssl_PrintBuf b
  ------------------
 2481|  18.8k|                   SSL_BUFFER_BASE(wrBuf), SSL_BUFFER_LEN(wrBuf)));
 2482|  18.8k|    *written = contentLen;
 2483|  18.8k|    return SECSuccess;
 2484|  18.8k|}
ssl3_SendRecord:
 2514|  18.7k|{
 2515|  18.7k|    sslBuffer *wrBuf = &ss->sec.writeBuf;
 2516|  18.7k|    ssl3CipherSpec *spec;
 2517|  18.7k|    SECStatus rv;
 2518|  18.7k|    PRInt32 totalSent = 0;
 2519|       |
 2520|  18.7k|    SSL_TRC(3, ("%d: SSL3[%d] SendRecord type: %s nIn=%d",
  ------------------
  |  |   71|  18.7k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   72|  18.7k|    ssl_Trace b
  ------------------
 2521|  18.7k|                SSL_GETPID(), ss->fd, ssl3_DecodeContentType(ct),
 2522|  18.7k|                nIn));
 2523|  18.7k|    PRINT_BUF(50, (ss, "Send record (plain text)", pIn, nIn));
  ------------------
  |  |   74|  18.7k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 18.7k]
  |  |  ------------------
  |  |   75|  18.7k|    ssl_PrintBuf b
  ------------------
 2524|       |
 2525|  18.7k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  18.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  28.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 9.14k, False: 9.63k]
  |  |  |  |  |  Branch (208:7): [True: 9.63k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2526|  18.7k|    PORT_Assert(SSL_BUFFER_LEN(wrBuf) == 0);
  ------------------
  |  |  120|  18.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  18.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 18.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2527|       |
 2528|  18.7k|    if (ss->ssl3.fatalAlertSent) {
  ------------------
  |  Branch (2528:9): [True: 194, False: 18.5k]
  ------------------
 2529|    194|        SSL_TRC(3, ("%d: SSL3[%d] Suppress write, fatal alert already sent",
  ------------------
  |  |   71|    194|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 194]
  |  |  ------------------
  |  |   72|    194|    ssl_Trace b
  ------------------
 2530|    194|                    SSL_GETPID(), ss->fd));
 2531|    194|        if (ct != ssl_ct_alert) {
  ------------------
  |  Branch (2531:13): [True: 0, False: 194]
  ------------------
 2532|       |            /* If we are sending an alert, then we already have an
 2533|       |             * error, so don't overwrite. */
 2534|      0|            PORT_SetError(SSL_ERROR_HANDSHAKE_FAILED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2535|      0|        }
 2536|    194|        return -1;
 2537|    194|    }
 2538|       |
 2539|       |    /* check for Token Presence */
 2540|  18.5k|    if (!ssl3_ClientAuthTokenPresent(ss->sec.ci.sid)) {
  ------------------
  |  Branch (2540:9): [True: 0, False: 18.5k]
  ------------------
 2541|      0|        PORT_SetError(SSL_ERROR_TOKEN_INSERTION_REMOVAL);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2542|      0|        return -1;
 2543|      0|    }
 2544|       |
 2545|  18.5k|    if (ss->recordWriteCallback) {
  ------------------
  |  Branch (2545:9): [True: 0, False: 18.5k]
  ------------------
 2546|      0|        PRUint16 epoch;
 2547|      0|        ssl_GetSpecReadLock(ss);
  ------------------
  |  | 1422|      0|    {                                           \
  |  | 1423|      0|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1424|      0|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|      0|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|      0|    }
  ------------------
 2548|      0|        epoch = ss->ssl3.cwSpec->epoch;
 2549|      0|        ssl_ReleaseSpecReadLock(ss);
  ------------------
  |  | 1427|      0|    {                                             \
  |  | 1428|      0|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1429|      0|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|      0|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|      0|    }
  ------------------
 2550|      0|        rv = ss->recordWriteCallback(ss->fd, epoch, ct, pIn, nIn,
 2551|      0|                                     ss->recordWriteCallbackArg);
 2552|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2552:13): [True: 0, False: 0]
  ------------------
 2553|      0|            return -1;
 2554|      0|        }
 2555|      0|        return nIn;
 2556|      0|    }
 2557|       |
 2558|  18.5k|    if (cwSpec) {
  ------------------
  |  Branch (2558:9): [True: 16.2k, False: 2.31k]
  ------------------
 2559|       |        /* cwSpec can only be set for retransmissions of the DTLS handshake. */
 2560|  16.2k|        PORT_Assert(IS_DTLS(ss) &&
  ------------------
  |  |  120|  16.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  50.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 14.5k, False: 1.76k]
  |  |  |  |  |  Branch (208:7): [True: 1.76k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 16.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2561|  16.2k|                    (ct == ssl_ct_handshake ||
 2562|  16.2k|                     ct == ssl_ct_change_cipher_spec));
 2563|  16.2k|        spec = cwSpec;
 2564|  16.2k|    } else {
 2565|  2.31k|        spec = ss->ssl3.cwSpec;
 2566|  2.31k|    }
 2567|       |
 2568|  37.4k|    while (nIn > 0) {
  ------------------
  |  Branch (2568:12): [True: 18.8k, False: 18.5k]
  ------------------
 2569|  18.8k|        unsigned int written = 0;
 2570|  18.8k|        PRInt32 sent;
 2571|       |
 2572|  18.8k|        ssl_GetSpecReadLock(ss);
  ------------------
  |  | 1422|  18.8k|    {                                           \
  |  | 1423|  18.8k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 9.65k, False: 9.17k]
  |  |  ------------------
  |  | 1424|  18.8k|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|  9.65k|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|  18.8k|    }
  ------------------
 2573|  18.8k|        rv = ssl_ProtectNextRecord(ss, spec, ct, pIn, nIn, &written);
 2574|  18.8k|        ssl_ReleaseSpecReadLock(ss);
  ------------------
  |  | 1427|  18.8k|    {                                             \
  |  | 1428|  18.8k|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 9.65k, False: 9.17k]
  |  |  ------------------
  |  | 1429|  18.8k|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|  9.65k|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|  18.8k|    }
  ------------------
 2575|  18.8k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2575:13): [True: 0, False: 18.8k]
  ------------------
 2576|      0|            goto loser;
 2577|      0|        }
 2578|       |
 2579|  18.8k|        PORT_Assert(written > 0);
  ------------------
  |  |  120|  18.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  18.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2580|       |        /* DTLS should not fragment non-application data here. */
 2581|  18.8k|        if (IS_DTLS(ss) && ct != ssl_ct_application_data) {
  ------------------
  |  |  892|  37.6k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 18.8k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2581:28): [True: 18.1k, False: 676]
  ------------------
 2582|  18.1k|            PORT_Assert(written == nIn);
  ------------------
  |  |  120|  18.1k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  18.1k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 18.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2583|  18.1k|        }
 2584|       |
 2585|  18.8k|        pIn += written;
 2586|  18.8k|        nIn -= written;
 2587|  18.8k|        PORT_Assert(nIn >= 0);
  ------------------
  |  |  120|  18.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  18.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 18.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2588|       |
 2589|       |        /* If there's still some previously saved ciphertext,
 2590|       |         * or the caller doesn't want us to send the data yet,
 2591|       |         * then add all our new ciphertext to the amount previously saved.
 2592|       |         */
 2593|  18.8k|        if ((ss->pendingBuf.len > 0) ||
  ------------------
  |  Branch (2593:13): [True: 3.53k, False: 15.3k]
  ------------------
 2594|  18.8k|            (flags & ssl_SEND_FLAG_FORCE_INTO_BUFFER)) {
  ------------------
  |  |  223|  15.3k|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
  |  Branch (2594:13): [True: 12.7k, False: 2.57k]
  ------------------
 2595|       |
 2596|  16.2k|            rv = ssl_SaveWriteData(ss, SSL_BUFFER_BASE(wrBuf),
  ------------------
  |  |   35|  16.2k|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
 2597|  16.2k|                                   SSL_BUFFER_LEN(wrBuf));
  ------------------
  |  |   36|  16.2k|#define SSL_BUFFER_LEN(b) ((b)->len)
  ------------------
 2598|  16.2k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (2598:17): [True: 0, False: 16.2k]
  ------------------
 2599|       |                /* presumably a memory error, SEC_ERROR_NO_MEMORY */
 2600|      0|                goto loser;
 2601|      0|            }
 2602|       |
 2603|  16.2k|            if (!(flags & ssl_SEND_FLAG_FORCE_INTO_BUFFER)) {
  ------------------
  |  |  223|  16.2k|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
  |  Branch (2603:17): [True: 0, False: 16.2k]
  ------------------
 2604|      0|                ss->handshakeBegun = 1;
 2605|      0|                sent = ssl_SendSavedWriteData(ss);
 2606|      0|                if (sent < 0 && PR_GetError() != PR_WOULD_BLOCK_ERROR) {
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (2606:21): [True: 0, False: 0]
  |  Branch (2606:33): [True: 0, False: 0]
  ------------------
 2607|      0|                    ssl_MapLowLevelError(SSL_ERROR_SOCKET_WRITE_FAILURE);
 2608|      0|                    goto loser;
 2609|      0|                }
 2610|      0|                if (ss->pendingBuf.len) {
  ------------------
  |  Branch (2610:21): [True: 0, False: 0]
  ------------------
 2611|      0|                    flags |= ssl_SEND_FLAG_FORCE_INTO_BUFFER;
  ------------------
  |  |  223|      0|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
 2612|      0|                }
 2613|      0|            }
 2614|  16.2k|        } else {
 2615|  2.57k|            PORT_Assert(SSL_BUFFER_LEN(wrBuf) > 0);
  ------------------
  |  |  120|  2.57k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.57k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2.57k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2616|  2.57k|            ss->handshakeBegun = 1;
 2617|  2.57k|            sent = ssl_DefSend(ss, SSL_BUFFER_BASE(wrBuf),
  ------------------
  |  |   35|  2.57k|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
 2618|  2.57k|                               SSL_BUFFER_LEN(wrBuf),
  ------------------
  |  |   36|  2.57k|#define SSL_BUFFER_LEN(b) ((b)->len)
  ------------------
 2619|  2.57k|                               flags & ~ssl_SEND_FLAG_MASK);
  ------------------
  |  |  226|  2.57k|#define ssl_SEND_FLAG_MASK 0x7f000000
  ------------------
 2620|  2.57k|            if (sent < 0) {
  ------------------
  |  Branch (2620:17): [True: 0, False: 2.57k]
  ------------------
 2621|      0|                if (PORT_GetError() != PR_WOULD_BLOCK_ERROR) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
                              if (PORT_GetError() != PR_WOULD_BLOCK_ERROR) {
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (2621:21): [True: 0, False: 0]
  ------------------
 2622|      0|                    ssl_MapLowLevelError(SSL_ERROR_SOCKET_WRITE_FAILURE);
 2623|      0|                    goto loser;
 2624|      0|                }
 2625|       |                /* we got PR_WOULD_BLOCK_ERROR, which means none was sent. */
 2626|      0|                sent = 0;
 2627|      0|            }
 2628|  2.57k|            if (SSL_BUFFER_LEN(wrBuf) > (unsigned int)sent) {
  ------------------
  |  |   36|  2.57k|#define SSL_BUFFER_LEN(b) ((b)->len)
  ------------------
  |  Branch (2628:17): [True: 0, False: 2.57k]
  ------------------
 2629|      0|                if (IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2630|       |                    /* DTLS just says no in this case. No buffering */
 2631|      0|                    PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                                  PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
 2632|      0|                    goto loser;
 2633|      0|                }
 2634|       |                /* now take all the remaining unsent new ciphertext and
 2635|       |                 * append it to the buffer of previously unsent ciphertext.
 2636|       |                 */
 2637|      0|                rv = ssl_SaveWriteData(ss, SSL_BUFFER_BASE(wrBuf) + sent,
  ------------------
  |  |   35|      0|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
 2638|      0|                                       SSL_BUFFER_LEN(wrBuf) - sent);
  ------------------
  |  |   36|      0|#define SSL_BUFFER_LEN(b) ((b)->len)
  ------------------
 2639|      0|                if (rv != SECSuccess) {
  ------------------
  |  Branch (2639:21): [True: 0, False: 0]
  ------------------
 2640|       |                    /* presumably a memory error, SEC_ERROR_NO_MEMORY */
 2641|      0|                    goto loser;
 2642|      0|                }
 2643|      0|            }
 2644|  2.57k|        }
 2645|  18.8k|        wrBuf->len = 0;
 2646|  18.8k|        totalSent += written;
 2647|  18.8k|    }
 2648|  18.5k|    return totalSent;
 2649|       |
 2650|      0|loser:
 2651|       |    /* Don't leave bits of buffer lying around. */
 2652|      0|    wrBuf->len = 0;
 2653|      0|    return -1;
 2654|  18.5k|}
ssl3_SendApplicationData:
 2664|    419|{
 2665|    419|    PRInt32 totalSent = 0;
 2666|    419|    PRInt32 discarded = 0;
 2667|    419|    PRBool splitNeeded = PR_FALSE;
  ------------------
  |  |  438|    419|#define PR_FALSE 0
  ------------------
 2668|       |
 2669|    419|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|    419|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    639|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 199, False: 220]
  |  |  |  |  |  Branch (208:7): [True: 220, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2670|       |    /* These flags for internal use only */
 2671|    419|    PORT_Assert(!(flags & ssl_SEND_FLAG_NO_RETRANSMIT));
  ------------------
  |  |  120|    419|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    419|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 419, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2672|    419|    if (len < 0 || !in) {
  ------------------
  |  Branch (2672:9): [True: 0, False: 419]
  |  Branch (2672:20): [True: 0, False: 419]
  ------------------
 2673|      0|        PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
 2674|      0|        return -1;
 2675|      0|    }
 2676|       |
 2677|    419|    if (ss->pendingBuf.len > SSL3_PENDING_HIGH_WATER &&
  ------------------
  |  | 2656|    838|#define SSL3_PENDING_HIGH_WATER 1024
  ------------------
  |  Branch (2677:9): [True: 0, False: 419]
  ------------------
 2678|    419|        !ssl_SocketIsBlocking(ss)) {
  ------------------
  |  Branch (2678:9): [True: 0, False: 0]
  ------------------
 2679|      0|        PORT_Assert(!ssl_SocketIsBlocking(ss));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2680|      0|        PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
 2681|      0|        return -1;
 2682|      0|    }
 2683|       |
 2684|    419|    if (ss->appDataBuffered && len) {
  ------------------
  |  Branch (2684:9): [True: 0, False: 419]
  |  Branch (2684:32): [True: 0, False: 0]
  ------------------
 2685|      0|        PORT_Assert(in[0] == (unsigned char)(ss->appDataBuffered));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2686|      0|        if (in[0] != (unsigned char)(ss->appDataBuffered)) {
  ------------------
  |  Branch (2686:13): [True: 0, False: 0]
  ------------------
 2687|      0|            PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                          PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
 2688|      0|            return -1;
 2689|      0|        }
 2690|      0|        in++;
 2691|      0|        len--;
 2692|      0|        discarded = 1;
 2693|      0|    }
 2694|       |
 2695|       |    /* We will split the first byte of the record into its own record, as
 2696|       |     * explained in the documentation for SSL_CBC_RANDOM_IV in ssl.h.
 2697|       |     */
 2698|    419|    if (len > 1 && ss->opt.cbcRandomIV &&
  ------------------
  |  Branch (2698:9): [True: 220, False: 199]
  |  Branch (2698:20): [True: 104, False: 116]
  ------------------
 2699|    419|        ss->version < SSL_LIBRARY_VERSION_TLS_1_1 &&
  ------------------
  |  |   19|    523|#define SSL_LIBRARY_VERSION_TLS_1_1             0x0302
  ------------------
  |  Branch (2699:9): [True: 0, False: 104]
  ------------------
 2700|    419|        ss->ssl3.cwSpec->cipherDef->type == type_block /* CBC */) {
  ------------------
  |  Branch (2700:9): [True: 0, False: 0]
  ------------------
 2701|      0|        splitNeeded = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2702|      0|    }
 2703|       |
 2704|    838|    while (len > totalSent) {
  ------------------
  |  Branch (2704:12): [True: 419, False: 419]
  ------------------
 2705|    419|        PRInt32 sent, toSend;
 2706|       |
 2707|    419|        if (totalSent > 0) {
  ------------------
  |  Branch (2707:13): [True: 0, False: 419]
  ------------------
 2708|       |            /*
 2709|       |             * The thread yield is intended to give the reader thread a
 2710|       |             * chance to get some cycles while the writer thread is in
 2711|       |             * the middle of a large application data write.  (See
 2712|       |             * Bugzilla bug 127740, comment #1.)
 2713|       |             */
 2714|      0|            ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|      0|    {                                          \
  |  | 1472|      0|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1473|      0|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|      0|    }
  ------------------
 2715|      0|            PR_Sleep(PR_INTERVAL_NO_WAIT); /* PR_Yield(); */
  ------------------
  |  |   53|      0|#define PR_INTERVAL_NO_WAIT 0UL
  ------------------
 2716|      0|            ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|      0|    {                                           \
  |  | 1467|      0|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1468|      0|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|      0|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|      0|    }
  ------------------
 2717|      0|        }
 2718|       |
 2719|    419|        if (splitNeeded) {
  ------------------
  |  Branch (2719:13): [True: 0, False: 419]
  ------------------
 2720|      0|            toSend = 1;
 2721|      0|            splitNeeded = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 2722|    419|        } else {
 2723|    419|            toSend = PR_MIN(len - totalSent, MAX_FRAGMENT_LENGTH);
  ------------------
  |  |  158|    419|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 419, False: 0]
  |  |  ------------------
  ------------------
 2724|    419|        }
 2725|       |
 2726|       |        /*
 2727|       |         * Note that the 0 epoch is OK because flags will never require
 2728|       |         * its use, as guaranteed by the PORT_Assert above.
 2729|       |         */
 2730|    419|        sent = ssl3_SendRecord(ss, NULL, ssl_ct_application_data,
 2731|    419|                               in + totalSent, toSend, flags);
 2732|    419|        if (sent < 0) {
  ------------------
  |  Branch (2732:13): [True: 0, False: 419]
  ------------------
 2733|      0|            if (totalSent > 0 && PR_GetError() == PR_WOULD_BLOCK_ERROR) {
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (2733:17): [True: 0, False: 0]
  |  Branch (2733:34): [True: 0, False: 0]
  ------------------
 2734|      0|                PORT_Assert(ss->lastWriteBlocked);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2735|      0|                break;
 2736|      0|            }
 2737|      0|            return -1; /* error code set by ssl3_SendRecord */
 2738|      0|        }
 2739|    419|        totalSent += sent;
 2740|    419|        if (ss->pendingBuf.len) {
  ------------------
  |  Branch (2740:13): [True: 0, False: 419]
  ------------------
 2741|       |            /* must be a non-blocking socket */
 2742|      0|            PORT_Assert(!ssl_SocketIsBlocking(ss));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2743|      0|            PORT_Assert(ss->lastWriteBlocked);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2744|      0|            break;
 2745|      0|        }
 2746|    419|    }
 2747|    419|    if (ss->pendingBuf.len) {
  ------------------
  |  Branch (2747:9): [True: 0, False: 419]
  ------------------
 2748|       |        /* Must be non-blocking. */
 2749|      0|        PORT_Assert(!ssl_SocketIsBlocking(ss));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2750|      0|        if (totalSent > 0) {
  ------------------
  |  Branch (2750:13): [True: 0, False: 0]
  ------------------
 2751|      0|            ss->appDataBuffered = 0x100 | in[totalSent - 1];
 2752|      0|        }
 2753|       |
 2754|      0|        totalSent = totalSent + discarded - 1;
 2755|      0|        if (totalSent <= 0) {
  ------------------
  |  Branch (2755:13): [True: 0, False: 0]
  ------------------
 2756|      0|            PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                          PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
 2757|      0|            totalSent = SECFailure;
 2758|      0|        }
 2759|      0|        return totalSent;
 2760|      0|    }
 2761|    419|    ss->appDataBuffered = 0;
 2762|    419|    return totalSent + discarded;
 2763|    419|}
ssl3_FlushHandshake:
 2780|  16.7k|{
 2781|  16.7k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  16.7k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 16.7k, False: 0]
  |  |  ------------------
  ------------------
 2782|  16.7k|        return dtls_FlushHandshakeMessages(ss, flags);
 2783|  16.7k|    }
 2784|      0|    return ssl3_FlushHandshakeMessages(ss, flags);
 2785|  16.7k|}
SSL3_SendAlert:
 2907|  2.08k|{
 2908|  2.08k|    PRUint8 bytes[2];
 2909|  2.08k|    SECStatus rv;
 2910|  2.08k|    PRBool needHsLock = !ssl_HaveSSL3HandshakeLock(ss);
  ------------------
  |  | 1419|  2.08k|    (PZ_InMonitor((ss)->ssl3HandshakeLock))
  |  |  ------------------
  |  |  |  |  258|  2.08k|#define PZ_InMonitor(m) PR_InMonitor((m))
  |  |  |  |  ------------------
  |  |  |  |  |  |  281|  2.08k|#define PR_InMonitor(m)     (PR_GetMonitorEntryCount(m) > 0)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2911|       |
 2912|       |    /* Check that if I need the HS lock I also need the Xmit lock */
 2913|  2.08k|    PORT_Assert(!needHsLock || !ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  2.08k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.12k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.03k, False: 1.04k]
  |  |  |  |  |  Branch (208:7): [True: 1.04k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2914|       |
 2915|  2.08k|    SSL_TRC(3, ("%d: SSL3[%d]: send alert record, level=%d desc=%d",
  ------------------
  |  |   71|  2.08k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 2.08k]
  |  |  ------------------
  |  |   72|  2.08k|    ssl_Trace b
  ------------------
 2916|  2.08k|                SSL_GETPID(), ss->fd, level, desc));
 2917|       |
 2918|  2.08k|    bytes[0] = level;
 2919|  2.08k|    bytes[1] = desc;
 2920|       |
 2921|  2.08k|    if (needHsLock) {
  ------------------
  |  Branch (2921:9): [True: 1.04k, False: 1.03k]
  ------------------
 2922|  1.04k|        ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  1.04k|    {                                                 \
  |  | 1408|  1.04k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 70, False: 978]
  |  |  ------------------
  |  | 1409|     70|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|     70|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|     70|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 70, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|     70|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|     70|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|     70|        }                                             \
  |  | 1412|  1.04k|    }
  ------------------
 2923|  1.04k|    }
 2924|  2.08k|    if (level == alert_fatal) {
  ------------------
  |  Branch (2924:9): [True: 1.94k, False: 138]
  ------------------
 2925|  1.94k|        if (ss->sec.ci.sid) {
  ------------------
  |  Branch (2925:13): [True: 1.94k, False: 0]
  ------------------
 2926|  1.94k|            ssl_UncacheSessionID(ss);
 2927|  1.94k|        }
 2928|  1.94k|    }
 2929|       |
 2930|  2.08k|    rv = tls13_SetAlertCipherSpec(ss);
 2931|  2.08k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2931:9): [True: 0, False: 2.08k]
  ------------------
 2932|      0|        if (needHsLock) {
  ------------------
  |  Branch (2932:13): [True: 0, False: 0]
  ------------------
 2933|      0|            ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
 2934|      0|        }
 2935|      0|        return rv;
 2936|      0|    }
 2937|       |
 2938|  2.08k|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|  2.08k|    {                                           \
  |  | 1467|  2.08k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 1.10k, False: 978]
  |  |  ------------------
  |  | 1468|  2.08k|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|  1.10k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|  2.08k|    }
  ------------------
 2939|  2.08k|    rv = ssl3_FlushHandshake(ss, ssl_SEND_FLAG_FORCE_INTO_BUFFER);
  ------------------
  |  |  223|  2.08k|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
 2940|  2.08k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (2940:9): [True: 2.08k, False: 0]
  ------------------
 2941|  2.08k|        PRInt32 sent;
 2942|  2.08k|        sent = ssl3_SendRecord(ss, NULL, ssl_ct_alert, bytes, 2,
 2943|  2.08k|                               (desc == no_certificate) ? ssl_SEND_FLAG_FORCE_INTO_BUFFER : 0);
  ------------------
  |  |  223|      0|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
  |  Branch (2943:32): [True: 0, False: 2.08k]
  ------------------
 2944|  2.08k|        rv = (sent >= 0) ? SECSuccess : (SECStatus)sent;
  ------------------
  |  Branch (2944:14): [True: 1.88k, False: 194]
  ------------------
 2945|  2.08k|    }
 2946|  2.08k|    if (level == alert_fatal) {
  ------------------
  |  Branch (2946:9): [True: 1.94k, False: 138]
  ------------------
 2947|  1.94k|        ss->ssl3.fatalAlertSent = PR_TRUE;
  ------------------
  |  |  437|  1.94k|#define PR_TRUE 1
  ------------------
 2948|  1.94k|    }
 2949|  2.08k|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|  2.08k|    {                                          \
  |  | 1472|  2.08k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 1.10k, False: 978]
  |  |  ------------------
  |  | 1473|  2.08k|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|  1.10k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|  2.08k|    }
  ------------------
 2950|  2.08k|    if (needHsLock) {
  ------------------
  |  Branch (2950:9): [True: 1.04k, False: 1.03k]
  ------------------
 2951|  1.04k|        ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  1.04k|    {                                                \
  |  | 1415|  1.04k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 70, False: 978]
  |  |  ------------------
  |  | 1416|  1.04k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|     70|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  1.04k|    }
  ------------------
 2952|  1.04k|    }
 2953|  2.08k|    if (rv == SECSuccess && ss->alertSentCallback) {
  ------------------
  |  Branch (2953:9): [True: 1.88k, False: 194]
  |  Branch (2953:29): [True: 0, False: 1.88k]
  ------------------
 2954|      0|        SSLAlert alert = { level, desc };
 2955|      0|        ss->alertSentCallback(ss->fd, ss->alertSentCallbackArg, &alert);
 2956|      0|    }
 2957|  2.08k|    return rv; /* error set by ssl3_FlushHandshake or ssl3_SendRecord */
 2958|  2.08k|}
ssl3_SendAlertForCertError:
 2986|    275|{
 2987|    275|    SSL3AlertDescription desc = bad_certificate;
 2988|    275|    PRBool isTLS = ss->version >= SSL_LIBRARY_VERSION_3_1_TLS;
  ------------------
  |  |   29|    275|#define SSL_LIBRARY_VERSION_3_1_TLS SSL_LIBRARY_VERSION_TLS_1_0
  |  |  ------------------
  |  |  |  |   18|    275|#define SSL_LIBRARY_VERSION_TLS_1_0             0x0301
  |  |  ------------------
  ------------------
 2989|       |
 2990|    275|    switch (errCode) {
 2991|     41|        case SEC_ERROR_LIBRARY_FAILURE:
  ------------------
  |  Branch (2991:9): [True: 41, False: 234]
  ------------------
 2992|     41|            desc = unsupported_certificate;
 2993|     41|            break;
 2994|      0|        case SEC_ERROR_EXPIRED_CERTIFICATE:
  ------------------
  |  Branch (2994:9): [True: 0, False: 275]
  ------------------
 2995|      0|            desc = certificate_expired;
 2996|      0|            break;
 2997|      0|        case SEC_ERROR_REVOKED_CERTIFICATE:
  ------------------
  |  Branch (2997:9): [True: 0, False: 275]
  ------------------
 2998|      0|            desc = certificate_revoked;
 2999|      0|            break;
 3000|      0|        case SEC_ERROR_INADEQUATE_KEY_USAGE:
  ------------------
  |  Branch (3000:9): [True: 0, False: 275]
  ------------------
 3001|      0|        case SEC_ERROR_INADEQUATE_CERT_TYPE:
  ------------------
  |  Branch (3001:9): [True: 0, False: 275]
  ------------------
 3002|      0|            desc = certificate_unknown;
 3003|      0|            break;
 3004|      0|        case SEC_ERROR_UNTRUSTED_CERT:
  ------------------
  |  Branch (3004:9): [True: 0, False: 275]
  ------------------
 3005|      0|            desc = isTLS ? access_denied : certificate_unknown;
  ------------------
  |  Branch (3005:20): [True: 0, False: 0]
  ------------------
 3006|      0|            break;
 3007|      0|        case SEC_ERROR_UNKNOWN_ISSUER:
  ------------------
  |  Branch (3007:9): [True: 0, False: 275]
  ------------------
 3008|      0|        case SEC_ERROR_UNTRUSTED_ISSUER:
  ------------------
  |  Branch (3008:9): [True: 0, False: 275]
  ------------------
 3009|      0|            desc = isTLS ? unknown_ca : certificate_unknown;
  ------------------
  |  Branch (3009:20): [True: 0, False: 0]
  ------------------
 3010|      0|            break;
 3011|      0|        case SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE:
  ------------------
  |  Branch (3011:9): [True: 0, False: 275]
  ------------------
 3012|      0|            desc = isTLS ? unknown_ca : certificate_expired;
  ------------------
  |  Branch (3012:20): [True: 0, False: 0]
  ------------------
 3013|      0|            break;
 3014|       |
 3015|      0|        case SEC_ERROR_CERT_NOT_IN_NAME_SPACE:
  ------------------
  |  Branch (3015:9): [True: 0, False: 275]
  ------------------
 3016|      0|        case SEC_ERROR_PATH_LEN_CONSTRAINT_INVALID:
  ------------------
  |  Branch (3016:9): [True: 0, False: 275]
  ------------------
 3017|      0|        case SEC_ERROR_CA_CERT_INVALID:
  ------------------
  |  Branch (3017:9): [True: 0, False: 275]
  ------------------
 3018|      0|        case SEC_ERROR_BAD_SIGNATURE:
  ------------------
  |  Branch (3018:9): [True: 0, False: 275]
  ------------------
 3019|    234|        default:
  ------------------
  |  Branch (3019:9): [True: 234, False: 41]
  ------------------
 3020|    234|            desc = bad_certificate;
 3021|    234|            break;
 3022|    275|    }
 3023|    275|    SSL_DBG(("%d: SSL3[%d]: peer certificate is no good: error=%d",
  ------------------
  |  |   87|    275|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 275]
  |  |  ------------------
  |  |   88|    275|    ssl_Trace b
  ------------------
 3024|    275|             SSL_GETPID(), ss->fd, errCode));
 3025|       |
 3026|    275|    (void)SSL3_SendAlert(ss, alert_fatal, desc);
 3027|    275|}
ssl3_DecodeError:
 3034|    387|{
 3035|    387|    (void)SSL3_SendAlert(ss, alert_fatal,
 3036|    387|                         ss->version > SSL_LIBRARY_VERSION_3_0 ? decode_error
  ------------------
  |  |   17|    387|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (3036:26): [True: 261, False: 126]
  ------------------
 3037|    387|                                                               : illegal_parameter);
 3038|    387|    PORT_SetError(ss->sec.isServer ? SSL_ERROR_BAD_CLIENT
  ------------------
  |  |   65|    387|#define PORT_SetError PORT_SetError_Util
  ------------------
  |  Branch (3038:19): [True: 0, False: 387]
  ------------------
 3039|    387|                                   : SSL_ERROR_BAD_SERVER);
 3040|    387|    return SECFailure;
 3041|    387|}
ssl3_SendChangeCipherSpecsInt:
 3234|  1.76k|{
 3235|  1.76k|    PRUint8 change = change_cipher_spec_choice;
 3236|  1.76k|    SECStatus rv;
 3237|       |
 3238|  1.76k|    SSL_TRC(3, ("%d: SSL3[%d]: send change_cipher_spec record",
  ------------------
  |  |   71|  1.76k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.76k]
  |  |  ------------------
  |  |   72|  1.76k|    ssl_Trace b
  ------------------
 3239|  1.76k|                SSL_GETPID(), ss->fd));
 3240|       |
 3241|  1.76k|    rv = ssl3_FlushHandshake(ss, ssl_SEND_FLAG_FORCE_INTO_BUFFER);
  ------------------
  |  |  223|  1.76k|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
 3242|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3242:9): [True: 0, False: 1.76k]
  ------------------
 3243|      0|        return SECFailure; /* error code set by ssl3_FlushHandshake */
 3244|      0|    }
 3245|       |
 3246|  1.76k|    if (!IS_DTLS(ss)) {
  ------------------
  |  |  892|  1.76k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (3246:9): [True: 0, False: 1.76k]
  ------------------
 3247|      0|        PRInt32 sent;
 3248|      0|        sent = ssl3_SendRecord(ss, NULL, ssl_ct_change_cipher_spec,
 3249|      0|                               &change, 1, ssl_SEND_FLAG_FORCE_INTO_BUFFER);
  ------------------
  |  |  223|      0|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
 3250|      0|        if (sent < 0) {
  ------------------
  |  Branch (3250:13): [True: 0, False: 0]
  ------------------
 3251|      0|            return SECFailure; /* error code set by ssl3_SendRecord */
 3252|      0|        }
 3253|  1.76k|    } else {
 3254|  1.76k|        rv = dtls_QueueMessage(ss, ssl_ct_change_cipher_spec, &change, 1);
 3255|  1.76k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (3255:13): [True: 0, False: 1.76k]
  ------------------
 3256|      0|            return SECFailure;
 3257|      0|        }
 3258|  1.76k|    }
 3259|  1.76k|    return SECSuccess;
 3260|  1.76k|}
ssl3_InitHandshakeHashes:
 3861|  6.64k|{
 3862|  6.64k|    SSL_TRC(30, ("%d: SSL3[%d]: start handshake hashes", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|  6.64k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 6.64k]
  |  |  ------------------
  |  |   72|  6.64k|    ssl_Trace b
  ------------------
 3863|       |
 3864|  6.64k|    PORT_Assert(ss->ssl3.hs.hashType == handshake_hash_unknown);
  ------------------
  |  |  120|  6.64k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  6.64k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6.64k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3865|  6.64k|    if (ss->version == SSL_LIBRARY_VERSION_TLS_1_2) {
  ------------------
  |  |   20|  6.64k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (3865:9): [True: 5.29k, False: 1.34k]
  ------------------
 3866|  5.29k|        ss->ssl3.hs.hashType = handshake_hash_record;
 3867|  5.29k|    } else {
 3868|  1.34k|        PORT_Assert(!ss->ssl3.hs.md5 && !ss->ssl3.hs.sha);
  ------------------
  |  |  120|  1.34k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.69k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.34k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1.34k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3869|       |        /*
 3870|       |         * note: We should probably lookup an SSL3 slot for these
 3871|       |         * handshake hashes in hopes that we wind up with the same slots
 3872|       |         * that the master secret will wind up in ...
 3873|       |         */
 3874|  1.34k|        if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  1.34k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (3874:13): [True: 992, False: 357]
  ------------------
 3875|       |            /* determine the hash from the prf */
 3876|    992|            const SECOidData *hash_oid =
 3877|    992|                SECOID_FindOIDByMechanism(ssl3_GetPrfHashMechanism(ss));
 3878|       |
 3879|       |            /* Get the PKCS #11 mechanism for the Hash from the cipher suite (prf_hash)
 3880|       |             * Convert that to the OidTag. We can then use that OidTag to create our
 3881|       |             * PK11Context */
 3882|    992|            PORT_Assert(hash_oid != NULL);
  ------------------
  |  |  120|    992|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    992|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 992, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3883|    992|            if (hash_oid == NULL) {
  ------------------
  |  Branch (3883:17): [True: 0, False: 992]
  ------------------
 3884|      0|                ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 3885|      0|                return SECFailure;
 3886|      0|            }
 3887|       |
 3888|    992|            ss->ssl3.hs.sha = PK11_CreateDigestContext(hash_oid->offset);
 3889|    992|            if (ss->ssl3.hs.sha == NULL) {
  ------------------
  |  Branch (3889:17): [True: 0, False: 992]
  ------------------
 3890|      0|                ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 3891|      0|                return SECFailure;
 3892|      0|            }
 3893|    992|            ss->ssl3.hs.hashType = handshake_hash_single;
 3894|    992|            if (PK11_DigestBegin(ss->ssl3.hs.sha) != SECSuccess) {
  ------------------
  |  Branch (3894:17): [True: 0, False: 992]
  ------------------
 3895|      0|                ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 3896|      0|                return SECFailure;
 3897|      0|            }
 3898|       |
 3899|       |            /* Transcript hash used on ECH client. */
 3900|    992|            if (!ss->sec.isServer && ss->ssl3.hs.echHpkeCtx) {
  ------------------
  |  Branch (3900:17): [True: 992, False: 0]
  |  Branch (3900:38): [True: 0, False: 992]
  ------------------
 3901|      0|                ss->ssl3.hs.shaEchInner = PK11_CreateDigestContext(hash_oid->offset);
 3902|      0|                if (ss->ssl3.hs.shaEchInner == NULL) {
  ------------------
  |  Branch (3902:21): [True: 0, False: 0]
  ------------------
 3903|      0|                    ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 3904|      0|                    return SECFailure;
 3905|      0|                }
 3906|      0|                if (PK11_DigestBegin(ss->ssl3.hs.shaEchInner) != SECSuccess) {
  ------------------
  |  Branch (3906:21): [True: 0, False: 0]
  ------------------
 3907|      0|                    ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 3908|      0|                    return SECFailure;
 3909|      0|                }
 3910|      0|            }
 3911|    992|        } else {
 3912|       |            /* Both ss->ssl3.hs.md5 and ss->ssl3.hs.sha should be NULL or
 3913|       |             * created successfully. */
 3914|    357|            ss->ssl3.hs.md5 = PK11_CreateDigestContext(SEC_OID_MD5);
 3915|    357|            if (ss->ssl3.hs.md5 == NULL) {
  ------------------
  |  Branch (3915:17): [True: 0, False: 357]
  ------------------
 3916|      0|                ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);
 3917|      0|                return SECFailure;
 3918|      0|            }
 3919|    357|            ss->ssl3.hs.sha = PK11_CreateDigestContext(SEC_OID_SHA1);
 3920|    357|            if (ss->ssl3.hs.sha == NULL) {
  ------------------
  |  Branch (3920:17): [True: 0, False: 357]
  ------------------
 3921|      0|                PK11_DestroyContext(ss->ssl3.hs.md5, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3922|      0|                ss->ssl3.hs.md5 = NULL;
 3923|      0|                ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 3924|      0|                return SECFailure;
 3925|      0|            }
 3926|    357|            ss->ssl3.hs.hashType = handshake_hash_combo;
 3927|       |
 3928|    357|            if (PK11_DigestBegin(ss->ssl3.hs.md5) != SECSuccess) {
  ------------------
  |  Branch (3928:17): [True: 0, False: 357]
  ------------------
 3929|      0|                ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);
 3930|      0|                return SECFailure;
 3931|      0|            }
 3932|    357|            if (PK11_DigestBegin(ss->ssl3.hs.sha) != SECSuccess) {
  ------------------
  |  Branch (3932:17): [True: 0, False: 357]
  ------------------
 3933|      0|                ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 3934|      0|                return SECFailure;
 3935|      0|            }
 3936|    357|        }
 3937|  1.34k|    }
 3938|       |
 3939|  6.64k|    if (ss->ssl3.hs.hashType != handshake_hash_record &&
  ------------------
  |  Branch (3939:9): [True: 1.34k, False: 5.29k]
  ------------------
 3940|  6.64k|        ss->ssl3.hs.messages.len > 0) {
  ------------------
  |  Branch (3940:9): [True: 1.34k, False: 0]
  ------------------
 3941|       |        /* When doing ECH, ssl3_UpdateHandshakeHashes will store outer messages
 3942|       |         * into the both the outer and inner transcripts.
 3943|       |         * ssl3_UpdateDefaultHandshakeHashes uses the default context which is
 3944|       |         * the outer when doing client ECH. For ECH shared-mode or backend
 3945|       |         * servers only the hs.messages buffer is used. */
 3946|  1.34k|        if (ssl3_UpdateDefaultHandshakeHashes(ss, ss->ssl3.hs.messages.buf,
  ------------------
  |  Branch (3946:13): [True: 0, False: 1.34k]
  ------------------
 3947|  1.34k|                                              ss->ssl3.hs.messages.len) != SECSuccess) {
 3948|      0|            return SECFailure;
 3949|      0|        }
 3950|       |        /* When doing ECH, deriving the accept_confirmation value requires all
 3951|       |         * messages up to and including the ServerHello
 3952|       |         * (see draft-ietf-tls-esni-14, Section 7.2).
 3953|       |         *
 3954|       |         * Don't free the transcript buffer until confirmation calculation. */
 3955|  1.34k|        if (!ss->ssl3.hs.echHpkeCtx && !ss->opt.enableTls13BackendEch) {
  ------------------
  |  Branch (3955:13): [True: 1.34k, False: 0]
  |  Branch (3955:40): [True: 1.34k, False: 0]
  ------------------
 3956|  1.34k|            sslBuffer_Clear(&ss->ssl3.hs.messages);
 3957|  1.34k|        }
 3958|  1.34k|    }
 3959|  6.64k|    if (ss->ssl3.hs.shaEchInner &&
  ------------------
  |  Branch (3959:9): [True: 0, False: 6.64k]
  ------------------
 3960|  6.64k|        ss->ssl3.hs.echInnerMessages.len > 0) {
  ------------------
  |  Branch (3960:9): [True: 0, False: 0]
  ------------------
 3961|      0|        if (PK11_DigestOp(ss->ssl3.hs.shaEchInner, ss->ssl3.hs.echInnerMessages.buf,
  ------------------
  |  Branch (3961:13): [True: 0, False: 0]
  ------------------
 3962|      0|                          ss->ssl3.hs.echInnerMessages.len) != SECSuccess) {
 3963|      0|            ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 3964|      0|            return SECFailure;
 3965|      0|        }
 3966|      0|        if (!ss->ssl3.hs.echHpkeCtx) {
  ------------------
  |  Branch (3966:13): [True: 0, False: 0]
  ------------------
 3967|      0|            sslBuffer_Clear(&ss->ssl3.hs.echInnerMessages);
 3968|      0|        }
 3969|      0|    }
 3970|       |
 3971|  6.64k|    return SECSuccess;
 3972|  6.64k|}
ssl3_RestartHandshakeHashes:
 3976|  10.2k|{
 3977|  10.2k|    SSL_TRC(30, ("%d: SSL3[%d]: reset handshake hashes",
  ------------------
  |  |   71|  10.2k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   72|  10.2k|    ssl_Trace b
  ------------------
 3978|  10.2k|                 SSL_GETPID(), ss->fd));
 3979|  10.2k|    ss->ssl3.hs.hashType = handshake_hash_unknown;
 3980|  10.2k|    ss->ssl3.hs.messages.len = 0;
 3981|  10.2k|    ss->ssl3.hs.echInnerMessages.len = 0;
 3982|  10.2k|    if (ss->ssl3.hs.md5) {
  ------------------
  |  Branch (3982:9): [True: 1, False: 10.2k]
  ------------------
 3983|      1|        PK11_DestroyContext(ss->ssl3.hs.md5, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 3984|      1|        ss->ssl3.hs.md5 = NULL;
 3985|      1|    }
 3986|  10.2k|    if (ss->ssl3.hs.sha) {
  ------------------
  |  Branch (3986:9): [True: 1, False: 10.2k]
  ------------------
 3987|      1|        PK11_DestroyContext(ss->ssl3.hs.sha, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
 3988|      1|        ss->ssl3.hs.sha = NULL;
 3989|      1|    }
 3990|  10.2k|    if (ss->ssl3.hs.shaEchInner) {
  ------------------
  |  Branch (3990:9): [True: 0, False: 10.2k]
  ------------------
 3991|      0|        PK11_DestroyContext(ss->ssl3.hs.shaEchInner, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3992|      0|        ss->ssl3.hs.shaEchInner = NULL;
 3993|      0|    }
 3994|  10.2k|    if (ss->ssl3.hs.shaPostHandshake) {
  ------------------
  |  Branch (3994:9): [True: 0, False: 10.2k]
  ------------------
 3995|      0|        PK11_DestroyContext(ss->ssl3.hs.shaPostHandshake, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3996|      0|        ss->ssl3.hs.shaPostHandshake = NULL;
 3997|      0|    }
 3998|  10.2k|}
ssl3_UpdateHandshakeHashesInt:
 4007|  89.8k|{
 4008|       |
 4009|  89.8k|    SECStatus rv = SECSuccess;
 4010|  89.8k|    PRBool explicit = (target != NULL);
 4011|  89.8k|    PRBool appendToEchInner = !ss->sec.isServer &&
  ------------------
  |  Branch (4011:31): [True: 89.8k, False: 0]
  ------------------
 4012|  89.8k|                              ss->ssl3.hs.echHpkeCtx &&
  ------------------
  |  Branch (4012:31): [True: 0, False: 89.8k]
  ------------------
 4013|  89.8k|                              !explicit;
  ------------------
  |  Branch (4013:31): [True: 0, False: 0]
  ------------------
 4014|  89.8k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  89.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   135k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 44.2k, False: 45.6k]
  |  |  |  |  |  Branch (208:7): [True: 45.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4015|  89.8k|    PORT_Assert(target != &ss->ssl3.hs.echInnerMessages ||
  ------------------
  |  |  120|  89.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  89.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 89.8k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4016|  89.8k|                !ss->sec.isServer);
 4017|       |
 4018|  89.8k|    if (target == NULL) {
  ------------------
  |  Branch (4018:9): [True: 86.5k, False: 3.29k]
  ------------------
 4019|       |        /* Default context. */
 4020|  86.5k|        target = &ss->ssl3.hs.messages;
 4021|  86.5k|    }
 4022|       |    /* With TLS 1.3, and versions TLS.1.1 and older, we keep the hash(es)
 4023|       |     * always up to date. However, we must initially buffer the handshake
 4024|       |     * messages, until we know what to do.
 4025|       |     * If ss->ssl3.hs.hashType != handshake_hash_unknown,
 4026|       |     * it means we know what to do. We calculate (hash our input),
 4027|       |     * and we stop appending to the buffer.
 4028|       |     *
 4029|       |     * With TLS 1.2, we always append all handshake messages,
 4030|       |     * and never update the hash, because the hash function we must use for
 4031|       |     * certificate_verify might be different from the hash function we use
 4032|       |     * when signing other handshake hashes. */
 4033|  89.8k|    if (ss->ssl3.hs.hashType == handshake_hash_unknown ||
  ------------------
  |  Branch (4033:9): [True: 14.0k, False: 75.7k]
  ------------------
 4034|  89.8k|        ss->ssl3.hs.hashType == handshake_hash_record) {
  ------------------
  |  Branch (4034:9): [True: 67.4k, False: 8.38k]
  ------------------
 4035|  81.4k|        rv = sslBuffer_Append(target, b, l);
 4036|  81.4k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4036:13): [True: 0, False: 81.4k]
  ------------------
 4037|      0|            return SECFailure;
 4038|      0|        }
 4039|  81.4k|        if (appendToEchInner) {
  ------------------
  |  Branch (4039:13): [True: 0, False: 81.4k]
  ------------------
 4040|      0|            return sslBuffer_Append(&ss->ssl3.hs.echInnerMessages, b, l);
 4041|      0|        }
 4042|  81.4k|        return SECSuccess;
 4043|  81.4k|    }
 4044|       |
 4045|  8.38k|    PRINT_BUF(90, (ss, "handshake hash input:", b, l));
  ------------------
  |  |   74|  8.38k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 8.38k]
  |  |  ------------------
  |  |   75|  8.38k|    ssl_PrintBuf b
  ------------------
 4046|       |
 4047|  8.38k|    if (ss->ssl3.hs.hashType == handshake_hash_single) {
  ------------------
  |  Branch (4047:9): [True: 2.88k, False: 5.49k]
  ------------------
 4048|  2.88k|        PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|  2.88k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.88k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2.88k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4049|  2.88k|        if (target == &ss->ssl3.hs.messages) {
  ------------------
  |  Branch (4049:13): [True: 2.88k, False: 0]
  ------------------
 4050|  2.88k|            rv = PK11_DigestOp(ss->ssl3.hs.sha, b, l);
 4051|  2.88k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (4051:17): [True: 0, False: 2.88k]
  ------------------
 4052|      0|                ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 4053|      0|                return rv;
 4054|      0|            }
 4055|  2.88k|        }
 4056|  2.88k|        if (ss->ssl3.hs.shaEchInner &&
  ------------------
  |  Branch (4056:13): [True: 0, False: 2.88k]
  ------------------
 4057|  2.88k|            (target == &ss->ssl3.hs.echInnerMessages || !explicit)) {
  ------------------
  |  Branch (4057:14): [True: 0, False: 0]
  |  Branch (4057:57): [True: 0, False: 0]
  ------------------
 4058|      0|            rv = PK11_DigestOp(ss->ssl3.hs.shaEchInner, b, l);
 4059|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (4059:17): [True: 0, False: 0]
  ------------------
 4060|      0|                ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 4061|      0|                return rv;
 4062|      0|            }
 4063|      0|        }
 4064|  5.49k|    } else if (ss->ssl3.hs.hashType == handshake_hash_combo) {
  ------------------
  |  Branch (4064:16): [True: 5.49k, False: 0]
  ------------------
 4065|  5.49k|        rv = PK11_DigestOp(ss->ssl3.hs.md5, b, l);
 4066|  5.49k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4066:13): [True: 0, False: 5.49k]
  ------------------
 4067|      0|            ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);
 4068|      0|            return rv;
 4069|      0|        }
 4070|  5.49k|        rv = PK11_DigestOp(ss->ssl3.hs.sha, b, l);
 4071|  5.49k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4071:13): [True: 0, False: 5.49k]
  ------------------
 4072|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 4073|      0|            return rv;
 4074|      0|        }
 4075|  5.49k|    }
 4076|  8.38k|    return rv;
 4077|  8.38k|}
ssl3_UpdateHandshakeHashes:
 4106|  86.5k|{
 4107|  86.5k|    return ssl3_UpdateHandshakeHashesInt(ss, b, l, NULL);
 4108|  86.5k|}
ssl3_AppendHandshakeHeaderAndStashSeqNum:
 4135|  3.53k|{
 4136|  3.53k|    PORT_Assert(t != ssl_hs_client_hello);
  ------------------
  |  |  120|  3.53k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.53k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.53k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4137|  3.53k|    SECStatus rv;
 4138|       |
 4139|       |    /* If we already have a message in place, we need to enqueue it.
 4140|       |     * This empties the buffer. This is a convenient place to call
 4141|       |     * dtls_StageHandshakeMessage to mark the message boundary.
 4142|       |     */
 4143|  3.53k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  3.53k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 3.53k, False: 0]
  |  |  ------------------
  ------------------
 4144|  3.53k|        rv = dtls_StageHandshakeMessage(ss);
 4145|  3.53k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4145:13): [True: 0, False: 3.53k]
  ------------------
 4146|      0|            return rv;
 4147|      0|        }
 4148|  3.53k|    }
 4149|       |
 4150|  3.53k|    SSL_TRC(30, ("%d: SSL3[%d]: append handshake header: type %s",
  ------------------
  |  |   71|  3.53k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 3.53k]
  |  |  ------------------
  |  |   72|  3.53k|    ssl_Trace b
  ------------------
 4151|  3.53k|                 SSL_GETPID(), ss->fd, ssl3_DecodeHandshakeType(t)));
 4152|       |
 4153|  3.53k|    rv = ssl3_AppendHandshakeNumber(ss, t, 1);
 4154|  3.53k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4154:9): [True: 0, False: 3.53k]
  ------------------
 4155|      0|        return rv; /* error code set by AppendHandshake, if applicable. */
 4156|      0|    }
 4157|  3.53k|    rv = ssl3_AppendHandshakeNumber(ss, length, 3);
 4158|  3.53k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4158:9): [True: 0, False: 3.53k]
  ------------------
 4159|      0|        return rv; /* error code set by AppendHandshake, if applicable. */
 4160|      0|    }
 4161|       |
 4162|  3.53k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  3.53k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 3.53k, False: 0]
  |  |  ------------------
  ------------------
 4163|       |        /* RFC 9147. 5.2.  DTLS Handshake Message Format.
 4164|       |         * In DTLS 1.3, the message transcript is computed over the original TLS
 4165|       |         * 1.3-style Handshake messages without the message_seq,
 4166|       |         * fragment_offset, and fragment_length values.  Note that this is a
 4167|       |         * change from DTLS 1.2 where those values were included in the transcript. */
 4168|  3.53k|        PRBool suppressHash = ss->version == SSL_LIBRARY_VERSION_TLS_1_3 ? PR_TRUE : PR_FALSE;
  ------------------
  |  |   21|  3.53k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
                      PRBool suppressHash = ss->version == SSL_LIBRARY_VERSION_TLS_1_3 ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                      PRBool suppressHash = ss->version == SSL_LIBRARY_VERSION_TLS_1_3 ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|  3.53k|#define PR_FALSE 0
  ------------------
  |  Branch (4168:31): [True: 0, False: 3.53k]
  ------------------
 4169|       |
 4170|       |        /* Note that we make an unfragmented message here. We fragment in the
 4171|       |         * transmission code, if necessary */
 4172|  3.53k|        rv = ssl3_AppendHandshakeNumberSuppressHash(ss, ss->ssl3.hs.sendMessageSeq, 2, suppressHash);
 4173|  3.53k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4173:13): [True: 0, False: 3.53k]
  ------------------
 4174|      0|            return rv; /* error code set by AppendHandshake, if applicable. */
 4175|      0|        }
 4176|       |        /* In case if we provide a buffer for the sequence message,
 4177|       |        we write down sendMessageSeq to the buffer. */
 4178|  3.53k|        if (sendMessageSeqOut != NULL) {
  ------------------
  |  Branch (4178:13): [True: 0, False: 3.53k]
  ------------------
 4179|      0|            *sendMessageSeqOut = ss->ssl3.hs.sendMessageSeq;
 4180|      0|        }
 4181|  3.53k|        ss->ssl3.hs.sendMessageSeq++;
 4182|       |
 4183|       |        /* 0 is the fragment offset, because it's not fragmented yet */
 4184|  3.53k|        rv = ssl3_AppendHandshakeNumberSuppressHash(ss, 0, 3, suppressHash);
 4185|  3.53k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4185:13): [True: 0, False: 3.53k]
  ------------------
 4186|      0|            return rv; /* error code set by AppendHandshake, if applicable. */
 4187|      0|        }
 4188|       |
 4189|       |        /* Fragment length -- set to the packet length because not fragmented */
 4190|  3.53k|        rv = ssl3_AppendHandshakeNumberSuppressHash(ss, length, 3, suppressHash);
 4191|  3.53k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4191:13): [True: 0, False: 3.53k]
  ------------------
 4192|      0|            return rv; /* error code set by AppendHandshake, if applicable. */
 4193|      0|        }
 4194|  3.53k|    }
 4195|       |
 4196|  3.53k|    return rv; /* error code set by AppendHandshake, if applicable. */
 4197|  3.53k|}
ssl3_AppendHandshakeHeader:
 4204|  3.53k|{
 4205|  3.53k|    return ssl3_AppendHandshakeHeaderAndStashSeqNum(ss, t, length, NULL);
 4206|  3.53k|}
ssl3_ConsumeHandshake:
 4226|  9.21k|{
 4227|  9.21k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  9.21k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.9k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.47k, False: 4.74k]
  |  |  |  |  |  Branch (208:7): [True: 4.74k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4228|  9.21k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  9.21k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.9k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.47k, False: 4.74k]
  |  |  |  |  |  Branch (208:7): [True: 4.74k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4229|       |
 4230|  9.21k|    if ((PRUint32)bytes > *length) {
  ------------------
  |  Branch (4230:9): [True: 6, False: 9.21k]
  ------------------
 4231|      6|        return ssl3_DecodeError(ss);
 4232|      6|    }
 4233|  9.21k|    PORT_Memcpy(v, *b, bytes);
  ------------------
  |  |  180|  9.21k|#define PORT_Memcpy memcpy
  ------------------
 4234|  9.21k|    PRINT_BUF(60, (ss, "consume bytes:", *b, bytes));
  ------------------
  |  |   74|  9.21k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 9.21k]
  |  |  ------------------
  |  |   75|  9.21k|    ssl_PrintBuf b
  ------------------
 4235|  9.21k|    *b += bytes;
 4236|  9.21k|    *length -= bytes;
 4237|  9.21k|    return SECSuccess;
 4238|  9.21k|}
ssl3_ConsumeHandshakeNumber64:
 4250|   109k|{
 4251|   109k|    PRUint8 *buf = *b;
 4252|   109k|    PRUint32 i;
 4253|       |
 4254|   109k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|   109k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   163k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 55.2k, False: 54.0k]
  |  |  |  |  |  Branch (208:7): [True: 54.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4255|   109k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|   109k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   163k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 55.2k, False: 54.0k]
  |  |  |  |  |  Branch (208:7): [True: 54.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4256|       |
 4257|   109k|    *num = 0;
 4258|   109k|    if (bytes > sizeof(*num)) {
  ------------------
  |  Branch (4258:9): [True: 0, False: 109k]
  ------------------
 4259|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4260|      0|        return SECFailure;
 4261|      0|    }
 4262|       |
 4263|   109k|    if (bytes > *length) {
  ------------------
  |  Branch (4263:9): [True: 117, False: 109k]
  ------------------
 4264|    117|        return ssl3_DecodeError(ss);
 4265|    117|    }
 4266|   109k|    PRINT_BUF(60, (ss, "consume bytes:", *b, bytes));
  ------------------
  |  |   74|   109k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 109k]
  |  |  ------------------
  |  |   75|   109k|    ssl_PrintBuf b
  ------------------
 4267|       |
 4268|   356k|    for (i = 0; i < bytes; i++) {
  ------------------
  |  Branch (4268:17): [True: 247k, False: 109k]
  ------------------
 4269|   247k|        *num = (*num << 8) + buf[i];
 4270|   247k|    }
 4271|   109k|    *b += bytes;
 4272|   109k|    *length -= bytes;
 4273|   109k|    return SECSuccess;
 4274|   109k|}
ssl3_ConsumeHandshakeNumber:
 4279|   103k|{
 4280|   103k|    PRUint64 num64;
 4281|   103k|    SECStatus rv;
 4282|       |
 4283|   103k|    PORT_Assert(bytes <= sizeof(*num));
  ------------------
  |  |  120|   103k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   103k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 103k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4284|   103k|    if (bytes > sizeof(*num)) {
  ------------------
  |  Branch (4284:9): [True: 0, False: 103k]
  ------------------
 4285|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4286|      0|        return SECFailure;
 4287|      0|    }
 4288|   103k|    rv = ssl3_ConsumeHandshakeNumber64(ss, &num64, bytes, b, length);
 4289|   103k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4289:9): [True: 91, False: 103k]
  ------------------
 4290|     91|        return SECFailure;
 4291|     91|    }
 4292|   103k|    *num = num64 & 0xffffffff;
 4293|   103k|    return SECSuccess;
 4294|   103k|}
ssl3_ConsumeHandshakeVariable:
 4313|  26.6k|{
 4314|  26.6k|    PRUint32 count;
 4315|  26.6k|    SECStatus rv;
 4316|       |
 4317|  26.6k|    PORT_Assert(bytes <= 3);
  ------------------
  |  |  120|  26.6k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  26.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 26.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4318|  26.6k|    i->len = 0;
 4319|  26.6k|    i->data = NULL;
 4320|  26.6k|    i->type = siBuffer;
 4321|  26.6k|    rv = ssl3_ConsumeHandshakeNumber(ss, &count, bytes, b, length);
 4322|  26.6k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4322:9): [True: 9, False: 26.6k]
  ------------------
 4323|      9|        return SECFailure;
 4324|      9|    }
 4325|  26.6k|    if (count > 0) {
  ------------------
  |  Branch (4325:9): [True: 19.4k, False: 7.21k]
  ------------------
 4326|  19.4k|        if (count > *length) {
  ------------------
  |  Branch (4326:13): [True: 166, False: 19.2k]
  ------------------
 4327|    166|            return ssl3_DecodeError(ss);
 4328|    166|        }
 4329|  19.2k|        i->data = *b;
 4330|  19.2k|        i->len = count;
 4331|  19.2k|        *b += count;
 4332|  19.2k|        *length -= count;
 4333|  19.2k|    }
 4334|  26.4k|    return SECSuccess;
 4335|  26.6k|}
ssl3_HashTypeToOID:
 4343|   212k|{
 4344|   212k|    switch (hashType) {
 4345|  35.5k|        case ssl_hash_sha1:
  ------------------
  |  Branch (4345:9): [True: 35.5k, False: 176k]
  ------------------
 4346|  35.5k|            return SEC_OID_SHA1;
 4347|  76.1k|        case ssl_hash_sha256:
  ------------------
  |  Branch (4347:9): [True: 76.1k, False: 136k]
  ------------------
 4348|  76.1k|            return SEC_OID_SHA256;
 4349|  53.1k|        case ssl_hash_sha384:
  ------------------
  |  Branch (4349:9): [True: 53.1k, False: 159k]
  ------------------
 4350|  53.1k|            return SEC_OID_SHA384;
 4351|  47.4k|        case ssl_hash_sha512:
  ------------------
  |  Branch (4351:9): [True: 47.4k, False: 165k]
  ------------------
 4352|  47.4k|            return SEC_OID_SHA512;
 4353|    131|        default:
  ------------------
  |  Branch (4353:9): [True: 131, False: 212k]
  ------------------
 4354|    131|            break;
 4355|   212k|    }
 4356|    131|    return SEC_OID_UNKNOWN;
 4357|   212k|}
ssl3_AuthTypeToOID:
 4361|   161k|{
 4362|   161k|    switch (authType) {
 4363|  43.3k|        case ssl_auth_rsa_sign:
  ------------------
  |  Branch (4363:9): [True: 43.3k, False: 118k]
  ------------------
 4364|  43.3k|            return SEC_OID_PKCS1_RSA_ENCRYPTION;
 4365|      4|        case ssl_auth_rsa_pss:
  ------------------
  |  Branch (4365:9): [True: 4, False: 161k]
  ------------------
 4366|      4|            return SEC_OID_PKCS1_RSA_PSS_SIGNATURE;
 4367|  78.7k|        case ssl_auth_ecdsa:
  ------------------
  |  Branch (4367:9): [True: 78.7k, False: 82.7k]
  ------------------
 4368|  78.7k|            return SEC_OID_ANSIX962_EC_PUBLIC_KEY;
 4369|  39.3k|        case ssl_auth_dsa:
  ------------------
  |  Branch (4369:9): [True: 39.3k, False: 122k]
  ------------------
 4370|  39.3k|            return SEC_OID_ANSIX9_DSA_SIGNATURE;
 4371|      0|        default:
  ------------------
  |  Branch (4371:9): [True: 0, False: 161k]
  ------------------
 4372|      0|            break;
 4373|   161k|    }
 4374|       |    /* shouldn't ever get there */
 4375|      0|    PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4376|      0|    return SEC_OID_UNKNOWN;
 4377|   161k|}
ssl_SignatureSchemeToHashType:
 4381|   196k|{
 4382|   196k|    switch (scheme) {
  ------------------
  |  Branch (4382:13): [True: 0, False: 196k]
  ------------------
 4383|  10.1k|        case ssl_sig_rsa_pkcs1_sha1:
  ------------------
  |  Branch (4383:9): [True: 10.1k, False: 186k]
  ------------------
 4384|  20.0k|        case ssl_sig_dsa_sha1:
  ------------------
  |  Branch (4384:9): [True: 9.83k, False: 186k]
  ------------------
 4385|  35.2k|        case ssl_sig_ecdsa_sha1:
  ------------------
  |  Branch (4385:9): [True: 15.2k, False: 181k]
  ------------------
 4386|  35.2k|            return ssl_hash_sha1;
 4387|  11.0k|        case ssl_sig_rsa_pkcs1_sha256:
  ------------------
  |  Branch (4387:9): [True: 11.0k, False: 185k]
  ------------------
 4388|  44.0k|        case ssl_sig_ecdsa_secp256r1_sha256:
  ------------------
  |  Branch (4388:9): [True: 32.9k, False: 163k]
  ------------------
 4389|  57.7k|        case ssl_sig_rsa_pss_rsae_sha256:
  ------------------
  |  Branch (4389:9): [True: 13.7k, False: 183k]
  ------------------
 4390|  57.8k|        case ssl_sig_rsa_pss_pss_sha256:
  ------------------
  |  Branch (4390:9): [True: 45, False: 196k]
  ------------------
 4391|  68.1k|        case ssl_sig_dsa_sha256:
  ------------------
  |  Branch (4391:9): [True: 10.2k, False: 186k]
  ------------------
 4392|  68.1k|            return ssl_hash_sha256;
 4393|  10.6k|        case ssl_sig_rsa_pkcs1_sha384:
  ------------------
  |  Branch (4393:9): [True: 10.6k, False: 186k]
  ------------------
 4394|  25.8k|        case ssl_sig_ecdsa_secp384r1_sha384:
  ------------------
  |  Branch (4394:9): [True: 15.1k, False: 181k]
  ------------------
 4395|  37.2k|        case ssl_sig_rsa_pss_rsae_sha384:
  ------------------
  |  Branch (4395:9): [True: 11.3k, False: 185k]
  ------------------
 4396|  37.2k|        case ssl_sig_rsa_pss_pss_sha384:
  ------------------
  |  Branch (4396:9): [True: 44, False: 196k]
  ------------------
 4397|  46.4k|        case ssl_sig_dsa_sha384:
  ------------------
  |  Branch (4397:9): [True: 9.15k, False: 187k]
  ------------------
 4398|  46.4k|            return ssl_hash_sha384;
 4399|  10.3k|        case ssl_sig_rsa_pkcs1_sha512:
  ------------------
  |  Branch (4399:9): [True: 10.3k, False: 186k]
  ------------------
 4400|  25.6k|        case ssl_sig_ecdsa_secp521r1_sha512:
  ------------------
  |  Branch (4400:9): [True: 15.2k, False: 181k]
  ------------------
 4401|  36.9k|        case ssl_sig_rsa_pss_rsae_sha512:
  ------------------
  |  Branch (4401:9): [True: 11.2k, False: 185k]
  ------------------
 4402|  36.9k|        case ssl_sig_rsa_pss_pss_sha512:
  ------------------
  |  Branch (4402:9): [True: 31, False: 196k]
  ------------------
 4403|  46.9k|        case ssl_sig_dsa_sha512:
  ------------------
  |  Branch (4403:9): [True: 10.0k, False: 186k]
  ------------------
 4404|  46.9k|            return ssl_hash_sha512;
 4405|      0|        case ssl_sig_rsa_pkcs1_sha1md5:
  ------------------
  |  Branch (4405:9): [True: 0, False: 196k]
  ------------------
 4406|      0|            return ssl_hash_none; /* Special for TLS 1.0/1.1. */
 4407|      0|        case ssl_sig_none:
  ------------------
  |  Branch (4407:9): [True: 0, False: 196k]
  ------------------
 4408|      0|        case ssl_sig_ed25519:
  ------------------
  |  Branch (4408:9): [True: 0, False: 196k]
  ------------------
 4409|      0|        case ssl_sig_ed448:
  ------------------
  |  Branch (4409:9): [True: 0, False: 196k]
  ------------------
 4410|      0|            break;
 4411|   196k|    }
 4412|      0|    PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4413|      0|    return ssl_hash_none;
 4414|   196k|}
ssl_SignatureSchemeValid:
 4435|  25.3k|{
 4436|  25.3k|    if (!ssl_IsSupportedSignatureScheme(scheme)) {
  ------------------
  |  Branch (4436:9): [True: 21.6k, False: 3.69k]
  ------------------
 4437|  21.6k|        return PR_FALSE;
  ------------------
  |  |  438|  21.6k|#define PR_FALSE 0
  ------------------
 4438|  21.6k|    }
 4439|       |    /* if we are purposefully passed SEC_OID_UNKNOWN, it means
 4440|       |     * we not checking the scheme against a potential key, so skip
 4441|       |     * the call */
 4442|  3.69k|    if ((spkiOid != SEC_OID_UNKNOWN) &&
  ------------------
  |  Branch (4442:9): [True: 2.79k, False: 898]
  ------------------
 4443|  3.69k|        !ssl_SignatureSchemeMatchesSpkiOid(scheme, spkiOid)) {
  ------------------
  |  Branch (4443:9): [True: 13, False: 2.78k]
  ------------------
 4444|     13|        return PR_FALSE;
  ------------------
  |  |  438|     13|#define PR_FALSE 0
  ------------------
 4445|     13|    }
 4446|  3.68k|    if (isTls13) {
  ------------------
  |  Branch (4446:9): [True: 0, False: 3.68k]
  ------------------
 4447|      0|        if (ssl_SignatureSchemeToHashType(scheme) == ssl_hash_sha1) {
  ------------------
  |  Branch (4447:13): [True: 0, False: 0]
  ------------------
 4448|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4449|      0|        }
 4450|      0|        if (ssl_IsRsaPkcs1SignatureScheme(scheme)) {
  ------------------
  |  Branch (4450:13): [True: 0, False: 0]
  ------------------
 4451|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4452|      0|        }
 4453|      0|        if (ssl_IsDsaSignatureScheme(scheme)) {
  ------------------
  |  Branch (4453:13): [True: 0, False: 0]
  ------------------
 4454|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4455|      0|        }
 4456|       |        /* With TLS 1.3, EC keys should have been selected based on calling
 4457|       |         * ssl_SignatureSchemeFromSpki(), reject them otherwise. */
 4458|      0|        return spkiOid != SEC_OID_ANSIX962_EC_PUBLIC_KEY;
 4459|      0|    }
 4460|  3.68k|    return PR_TRUE;
  ------------------
  |  |  437|  3.68k|#define PR_TRUE 1
  ------------------
 4461|  3.68k|}
ssl_SignatureSchemeFromSpki:
 4552|  2.81k|{
 4553|  2.81k|    SECOidTag spkiOid = SECOID_GetAlgorithmTag(&spki->algorithm);
  ------------------
  |  |  119|  2.81k|#define SECOID_GetAlgorithmTag SECOID_GetAlgorithmTag_Util
  ------------------
 4554|       |
 4555|  2.81k|    if (spkiOid == SEC_OID_PKCS1_RSA_PSS_SIGNATURE) {
  ------------------
  |  Branch (4555:9): [True: 9, False: 2.80k]
  ------------------
 4556|      9|        return ssl_SignatureSchemeFromPssSpki(spki, scheme);
 4557|      9|    }
 4558|       |
 4559|       |    /* Only do this lookup for TLS 1.3, where the scheme can be determined from
 4560|       |     * the SPKI alone because the ECDSA key size determines the hash. Earlier
 4561|       |     * TLS versions allow the same EC key to be used with different hashes. */
 4562|  2.80k|    if (isTls13 && spkiOid == SEC_OID_ANSIX962_EC_PUBLIC_KEY) {
  ------------------
  |  Branch (4562:9): [True: 0, False: 2.80k]
  |  Branch (4562:20): [True: 0, False: 0]
  ------------------
 4563|      0|        return ssl_SignatureSchemeFromEcSpki(spki, scheme);
 4564|      0|    }
 4565|       |
 4566|  2.80k|    *scheme = ssl_sig_none;
 4567|  2.80k|    return SECSuccess;
 4568|  2.80k|}
ssl_SignatureSchemeEnabled:
 4573|  2.78k|{
 4574|  2.78k|    unsigned int i;
 4575|  23.8k|    for (i = 0; i < ss->ssl3.signatureSchemeCount; ++i) {
  ------------------
  |  Branch (4575:17): [True: 23.8k, False: 2]
  ------------------
 4576|  23.8k|        if (scheme == ss->ssl3.signatureSchemes[i]) {
  ------------------
  |  Branch (4576:13): [True: 2.78k, False: 21.0k]
  ------------------
 4577|  2.78k|            return PR_TRUE;
  ------------------
  |  |  437|  2.78k|#define PR_TRUE 1
  ------------------
 4578|  2.78k|        }
 4579|  23.8k|    }
 4580|      2|    return PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 4581|  2.78k|}
ssl_CheckSignatureSchemeConsistency:
 4609|  2.81k|{
 4610|  2.81k|    SSLSignatureScheme spkiScheme;
 4611|  2.81k|    PRBool isTLS13 = ss->version == SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|  2.81k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
 4612|  2.81k|    SECOidTag spkiOid;
 4613|  2.81k|    SECStatus rv;
 4614|       |
 4615|  2.81k|    rv = ssl_SignatureSchemeFromSpki(spki, isTLS13, &spkiScheme);
 4616|  2.81k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4616:9): [True: 4, False: 2.80k]
  ------------------
 4617|      4|        return SECFailure;
 4618|      4|    }
 4619|  2.80k|    if (spkiScheme != ssl_sig_none) {
  ------------------
  |  Branch (4619:9): [True: 2, False: 2.80k]
  ------------------
 4620|       |        /* The SPKI in the certificate can only be used for a single scheme. */
 4621|      2|        if (spkiScheme != scheme ||
  ------------------
  |  Branch (4621:13): [True: 1, False: 1]
  ------------------
 4622|      2|            !ssl_SignatureSchemeEnabled(ss, scheme)) {
  ------------------
  |  Branch (4622:13): [True: 1, False: 0]
  ------------------
 4623|      2|            PORT_SetError(SSL_ERROR_INCORRECT_SIGNATURE_ALGORITHM);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
 4624|      2|            return SECFailure;
 4625|      2|        }
 4626|      0|        return SECSuccess;
 4627|      2|    }
 4628|       |
 4629|  2.80k|    spkiOid = SECOID_GetAlgorithmTag(&spki->algorithm);
  ------------------
  |  |  119|  2.80k|#define SECOID_GetAlgorithmTag SECOID_GetAlgorithmTag_Util
  ------------------
 4630|       |
 4631|       |    /* If we're a client, check that the signature algorithm matches the signing
 4632|       |     * key type of the cipher suite. */
 4633|  2.80k|    if (!isTLS13 && !ss->sec.isServer) {
  ------------------
  |  Branch (4633:9): [True: 2.80k, False: 0]
  |  Branch (4633:21): [True: 2.80k, False: 0]
  ------------------
 4634|  2.80k|        if (!ssl_SignatureKeyMatchesSpkiOid(ss->ssl3.hs.kea_def, spkiOid)) {
  ------------------
  |  Branch (4634:13): [True: 6, False: 2.79k]
  ------------------
 4635|      6|            PORT_SetError(SSL_ERROR_INCORRECT_SIGNATURE_ALGORITHM);
  ------------------
  |  |   65|      6|#define PORT_SetError PORT_SetError_Util
  ------------------
 4636|      6|            return SECFailure;
 4637|      6|        }
 4638|  2.80k|    }
 4639|       |
 4640|       |    /* Verify that the signature scheme matches the signing key. */
 4641|  2.79k|    if ((spkiOid == SEC_OID_UNKNOWN) ||
  ------------------
  |  Branch (4641:9): [True: 0, False: 2.79k]
  ------------------
 4642|  2.79k|        !ssl_SignatureSchemeValid(scheme, spkiOid, isTLS13)) {
  ------------------
  |  Branch (4642:9): [True: 13, False: 2.78k]
  ------------------
 4643|     13|        PORT_SetError(SSL_ERROR_INCORRECT_SIGNATURE_ALGORITHM);
  ------------------
  |  |   65|     13|#define PORT_SetError PORT_SetError_Util
  ------------------
 4644|     13|        return SECFailure;
 4645|     13|    }
 4646|       |
 4647|  2.78k|    if (!ssl_SignatureSchemeEnabled(ss, scheme)) {
  ------------------
  |  Branch (4647:9): [True: 1, False: 2.78k]
  ------------------
 4648|      1|        PORT_SetError(SSL_ERROR_UNSUPPORTED_SIGNATURE_ALGORITHM);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
 4649|      1|        return SECFailure;
 4650|      1|    }
 4651|       |
 4652|  2.78k|    return SECSuccess;
 4653|  2.78k|}
ssl_IsSupportedSignatureScheme:
 4657|  28.1k|{
 4658|  28.1k|    switch (scheme) {
  ------------------
  |  Branch (4658:13): [True: 17.6k, False: 10.4k]
  ------------------
 4659|    111|        case ssl_sig_rsa_pkcs1_sha1:
  ------------------
  |  Branch (4659:9): [True: 111, False: 28.0k]
  ------------------
 4660|    773|        case ssl_sig_rsa_pkcs1_sha256:
  ------------------
  |  Branch (4660:9): [True: 662, False: 27.5k]
  ------------------
 4661|  1.22k|        case ssl_sig_rsa_pkcs1_sha384:
  ------------------
  |  Branch (4661:9): [True: 453, False: 27.7k]
  ------------------
 4662|  1.48k|        case ssl_sig_rsa_pkcs1_sha512:
  ------------------
  |  Branch (4662:9): [True: 254, False: 27.9k]
  ------------------
 4663|  3.35k|        case ssl_sig_rsa_pss_rsae_sha256:
  ------------------
  |  Branch (4663:9): [True: 1.87k, False: 26.2k]
  ------------------
 4664|  3.61k|        case ssl_sig_rsa_pss_rsae_sha384:
  ------------------
  |  Branch (4664:9): [True: 265, False: 27.8k]
  ------------------
 4665|  3.79k|        case ssl_sig_rsa_pss_rsae_sha512:
  ------------------
  |  Branch (4665:9): [True: 182, False: 27.9k]
  ------------------
 4666|  3.84k|        case ssl_sig_rsa_pss_pss_sha256:
  ------------------
  |  Branch (4666:9): [True: 45, False: 28.1k]
  ------------------
 4667|  3.88k|        case ssl_sig_rsa_pss_pss_sha384:
  ------------------
  |  Branch (4667:9): [True: 44, False: 28.1k]
  ------------------
 4668|  3.91k|        case ssl_sig_rsa_pss_pss_sha512:
  ------------------
  |  Branch (4668:9): [True: 31, False: 28.1k]
  ------------------
 4669|  4.10k|        case ssl_sig_ecdsa_secp256r1_sha256:
  ------------------
  |  Branch (4669:9): [True: 182, False: 27.9k]
  ------------------
 4670|  4.16k|        case ssl_sig_ecdsa_secp384r1_sha384:
  ------------------
  |  Branch (4670:9): [True: 66, False: 28.0k]
  ------------------
 4671|  4.32k|        case ssl_sig_ecdsa_secp521r1_sha512:
  ------------------
  |  Branch (4671:9): [True: 160, False: 28.0k]
  ------------------
 4672|  4.85k|        case ssl_sig_dsa_sha1:
  ------------------
  |  Branch (4672:9): [True: 523, False: 27.6k]
  ------------------
 4673|  5.67k|        case ssl_sig_dsa_sha256:
  ------------------
  |  Branch (4673:9): [True: 821, False: 27.3k]
  ------------------
 4674|  5.72k|        case ssl_sig_dsa_sha384:
  ------------------
  |  Branch (4674:9): [True: 55, False: 28.1k]
  ------------------
 4675|  6.37k|        case ssl_sig_dsa_sha512:
  ------------------
  |  Branch (4675:9): [True: 649, False: 27.5k]
  ------------------
 4676|  6.50k|        case ssl_sig_ecdsa_sha1:
  ------------------
  |  Branch (4676:9): [True: 131, False: 28.0k]
  ------------------
 4677|  6.50k|            return ssl_SchemePolicyOK(scheme, kSSLSigSchemePolicy);
 4678|      0|            break;
 4679|       |
 4680|      0|        case ssl_sig_rsa_pkcs1_sha1md5:
  ------------------
  |  Branch (4680:9): [True: 0, False: 28.1k]
  ------------------
 4681|  3.92k|        case ssl_sig_none:
  ------------------
  |  Branch (4681:9): [True: 3.92k, False: 24.2k]
  ------------------
 4682|  3.93k|        case ssl_sig_ed25519:
  ------------------
  |  Branch (4682:9): [True: 2, False: 28.1k]
  ------------------
 4683|  3.99k|        case ssl_sig_ed448:
  ------------------
  |  Branch (4683:9): [True: 61, False: 28.1k]
  ------------------
 4684|  3.99k|            return PR_FALSE;
  ------------------
  |  |  438|  3.99k|#define PR_FALSE 0
  ------------------
 4685|  28.1k|    }
 4686|  17.6k|    return PR_FALSE;
  ------------------
  |  |  438|  17.6k|#define PR_FALSE 0
  ------------------
 4687|  28.1k|}
ssl_IsRsaPssSignatureScheme:
 4691|   436k|{
 4692|   436k|    switch (scheme) {
 4693|  24.7k|        case ssl_sig_rsa_pss_rsae_sha256:
  ------------------
  |  Branch (4693:9): [True: 24.7k, False: 411k]
  ------------------
 4694|  47.1k|        case ssl_sig_rsa_pss_rsae_sha384:
  ------------------
  |  Branch (4694:9): [True: 22.3k, False: 413k]
  ------------------
 4695|  69.3k|        case ssl_sig_rsa_pss_rsae_sha512:
  ------------------
  |  Branch (4695:9): [True: 22.2k, False: 414k]
  ------------------
 4696|  69.4k|        case ssl_sig_rsa_pss_pss_sha256:
  ------------------
  |  Branch (4696:9): [True: 45, False: 436k]
  ------------------
 4697|  69.4k|        case ssl_sig_rsa_pss_pss_sha384:
  ------------------
  |  Branch (4697:9): [True: 44, False: 436k]
  ------------------
 4698|  69.4k|        case ssl_sig_rsa_pss_pss_sha512:
  ------------------
  |  Branch (4698:9): [True: 31, False: 436k]
  ------------------
 4699|  69.4k|            return PR_TRUE;
  ------------------
  |  |  437|  69.4k|#define PR_TRUE 1
  ------------------
 4700|       |
 4701|   366k|        default:
  ------------------
  |  Branch (4701:9): [True: 366k, False: 69.4k]
  ------------------
 4702|   366k|            return PR_FALSE;
  ------------------
  |  |  438|   366k|#define PR_FALSE 0
  ------------------
 4703|   436k|    }
 4704|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4705|   436k|}
ssl_IsRsaeSignatureScheme:
 4709|  61.3k|{
 4710|  61.3k|    switch (scheme) {
 4711|  4.08k|        case ssl_sig_rsa_pss_rsae_sha256:
  ------------------
  |  Branch (4711:9): [True: 4.08k, False: 57.2k]
  ------------------
 4712|  8.17k|        case ssl_sig_rsa_pss_rsae_sha384:
  ------------------
  |  Branch (4712:9): [True: 4.08k, False: 57.2k]
  ------------------
 4713|  12.2k|        case ssl_sig_rsa_pss_rsae_sha512:
  ------------------
  |  Branch (4713:9): [True: 4.08k, False: 57.2k]
  ------------------
 4714|  12.2k|            return PR_TRUE;
  ------------------
  |  |  437|  12.2k|#define PR_TRUE 1
  ------------------
 4715|       |
 4716|  49.0k|        default:
  ------------------
  |  Branch (4716:9): [True: 49.0k, False: 12.2k]
  ------------------
 4717|  49.0k|            return PR_FALSE;
  ------------------
  |  |  438|  49.0k|#define PR_FALSE 0
  ------------------
 4718|  61.3k|    }
 4719|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4720|  61.3k|}
ssl_IsRsaPkcs1SignatureScheme:
 4724|  89.6k|{
 4725|  89.6k|    switch (scheme) {
 4726|  5.99k|        case ssl_sig_rsa_pkcs1_sha256:
  ------------------
  |  Branch (4726:9): [True: 5.99k, False: 83.6k]
  ------------------
 4727|  11.9k|        case ssl_sig_rsa_pkcs1_sha384:
  ------------------
  |  Branch (4727:9): [True: 5.99k, False: 83.6k]
  ------------------
 4728|  17.9k|        case ssl_sig_rsa_pkcs1_sha512:
  ------------------
  |  Branch (4728:9): [True: 5.99k, False: 83.6k]
  ------------------
 4729|  23.9k|        case ssl_sig_rsa_pkcs1_sha1:
  ------------------
  |  Branch (4729:9): [True: 5.99k, False: 83.6k]
  ------------------
 4730|  23.9k|            return PR_TRUE;
  ------------------
  |  |  437|  23.9k|#define PR_TRUE 1
  ------------------
 4731|       |
 4732|  65.6k|        default:
  ------------------
  |  Branch (4732:9): [True: 65.6k, False: 23.9k]
  ------------------
 4733|  65.6k|            return PR_FALSE;
  ------------------
  |  |  438|  65.6k|#define PR_FALSE 0
  ------------------
 4734|  89.6k|    }
 4735|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4736|  89.6k|}
ssl_IsDsaSignatureScheme:
 4740|   182k|{
 4741|   182k|    switch (scheme) {
 4742|  16.0k|        case ssl_sig_dsa_sha256:
  ------------------
  |  Branch (4742:9): [True: 16.0k, False: 166k]
  ------------------
 4743|  32.0k|        case ssl_sig_dsa_sha384:
  ------------------
  |  Branch (4743:9): [True: 16.0k, False: 166k]
  ------------------
 4744|  48.1k|        case ssl_sig_dsa_sha512:
  ------------------
  |  Branch (4744:9): [True: 16.0k, False: 166k]
  ------------------
 4745|  64.1k|        case ssl_sig_dsa_sha1:
  ------------------
  |  Branch (4745:9): [True: 16.0k, False: 166k]
  ------------------
 4746|  64.1k|            return PR_TRUE;
  ------------------
  |  |  437|  64.1k|#define PR_TRUE 1
  ------------------
 4747|       |
 4748|   118k|        default:
  ------------------
  |  Branch (4748:9): [True: 118k, False: 64.1k]
  ------------------
 4749|   118k|            return PR_FALSE;
  ------------------
  |  |  438|   118k|#define PR_FALSE 0
  ------------------
 4750|   182k|    }
 4751|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4752|   182k|}
ssl_SignatureSchemeToAuthType:
 4756|   164k|{
 4757|   164k|    switch (scheme) {
 4758|  10.1k|        case ssl_sig_rsa_pkcs1_sha1:
  ------------------
  |  Branch (4758:9): [True: 10.1k, False: 154k]
  ------------------
 4759|  10.2k|        case ssl_sig_rsa_pkcs1_sha1md5:
  ------------------
  |  Branch (4759:9): [True: 50, False: 164k]
  ------------------
 4760|  21.5k|        case ssl_sig_rsa_pkcs1_sha256:
  ------------------
  |  Branch (4760:9): [True: 11.3k, False: 153k]
  ------------------
 4761|  32.4k|        case ssl_sig_rsa_pkcs1_sha384:
  ------------------
  |  Branch (4761:9): [True: 10.8k, False: 153k]
  ------------------
 4762|  42.9k|        case ssl_sig_rsa_pkcs1_sha512:
  ------------------
  |  Branch (4762:9): [True: 10.4k, False: 153k]
  ------------------
 4763|       |        /* We report based on the key type for PSS signatures. */
 4764|  44.7k|        case ssl_sig_rsa_pss_rsae_sha256:
  ------------------
  |  Branch (4764:9): [True: 1.82k, False: 162k]
  ------------------
 4765|  45.0k|        case ssl_sig_rsa_pss_rsae_sha384:
  ------------------
  |  Branch (4765:9): [True: 219, False: 164k]
  ------------------
 4766|  45.1k|        case ssl_sig_rsa_pss_rsae_sha512:
  ------------------
  |  Branch (4766:9): [True: 121, False: 164k]
  ------------------
 4767|  45.1k|            return ssl_auth_rsa_sign;
 4768|      2|        case ssl_sig_rsa_pss_pss_sha256:
  ------------------
  |  Branch (4768:9): [True: 2, False: 164k]
  ------------------
 4769|      3|        case ssl_sig_rsa_pss_pss_sha384:
  ------------------
  |  Branch (4769:9): [True: 1, False: 164k]
  ------------------
 4770|      4|        case ssl_sig_rsa_pss_pss_sha512:
  ------------------
  |  Branch (4770:9): [True: 1, False: 164k]
  ------------------
 4771|      4|            return ssl_auth_rsa_pss;
 4772|  33.0k|        case ssl_sig_ecdsa_secp256r1_sha256:
  ------------------
  |  Branch (4772:9): [True: 33.0k, False: 131k]
  ------------------
 4773|  48.2k|        case ssl_sig_ecdsa_secp384r1_sha384:
  ------------------
  |  Branch (4773:9): [True: 15.2k, False: 149k]
  ------------------
 4774|  63.5k|        case ssl_sig_ecdsa_secp521r1_sha512:
  ------------------
  |  Branch (4774:9): [True: 15.3k, False: 148k]
  ------------------
 4775|  78.9k|        case ssl_sig_ecdsa_sha1:
  ------------------
  |  Branch (4775:9): [True: 15.3k, False: 148k]
  ------------------
 4776|  78.9k|            return ssl_auth_ecdsa;
 4777|  10.0k|        case ssl_sig_dsa_sha1:
  ------------------
  |  Branch (4777:9): [True: 10.0k, False: 154k]
  ------------------
 4778|  20.7k|        case ssl_sig_dsa_sha256:
  ------------------
  |  Branch (4778:9): [True: 10.6k, False: 153k]
  ------------------
 4779|  29.9k|        case ssl_sig_dsa_sha384:
  ------------------
  |  Branch (4779:9): [True: 9.16k, False: 155k]
  ------------------
 4780|  40.2k|        case ssl_sig_dsa_sha512:
  ------------------
  |  Branch (4780:9): [True: 10.3k, False: 153k]
  ------------------
 4781|  40.2k|            return ssl_auth_dsa;
 4782|       |
 4783|      0|        default:
  ------------------
  |  Branch (4783:9): [True: 0, False: 164k]
  ------------------
 4784|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4785|   164k|    }
 4786|      0|    return ssl_auth_null;
 4787|   164k|}
ssl_ConsumeSignatureScheme:
 4797|  2.82k|{
 4798|  2.82k|    PRUint32 tmp;
 4799|  2.82k|    SECStatus rv;
 4800|       |
 4801|  2.82k|    rv = ssl3_ConsumeHandshakeNumber(ss, &tmp, 2, b, length);
 4802|  2.82k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4802:9): [True: 1, False: 2.82k]
  ------------------
 4803|      1|        return SECFailure; /* Alert sent, Error code set already. */
 4804|      1|    }
 4805|  2.82k|    if (!ssl_IsSupportedSignatureScheme((SSLSignatureScheme)tmp)) {
  ------------------
  |  Branch (4805:9): [True: 11, False: 2.81k]
  ------------------
 4806|     11|        SSL3_SendAlert(ss, alert_fatal, illegal_parameter);
 4807|     11|        PORT_SetError(SSL_ERROR_UNSUPPORTED_SIGNATURE_ALGORITHM);
  ------------------
  |  |   65|     11|#define PORT_SetError PORT_SetError_Util
  ------------------
 4808|     11|        return SECFailure;
 4809|     11|    }
 4810|  2.81k|    *out = (SSLSignatureScheme)tmp;
 4811|  2.81k|    return SECSuccess;
 4812|  2.82k|}
ssl3_ComputeHandshakeHashes:
 4858|  1.92k|{
 4859|  1.92k|    SECStatus rv = SECSuccess;
 4860|  1.92k|    PRBool isTLS = (PRBool)(spec->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|  1.92k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
 4861|  1.92k|    unsigned int outLength;
 4862|  1.92k|    PRUint8 md5_inner[MAX_MAC_LENGTH];
 4863|  1.92k|    PRUint8 sha_inner[MAX_MAC_LENGTH];
 4864|       |
 4865|  1.92k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  1.92k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.91k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 946, False: 982]
  |  |  |  |  |  Branch (208:7): [True: 982, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4866|  1.92k|    if (ss->ssl3.hs.hashType == handshake_hash_unknown) {
  ------------------
  |  Branch (4866:9): [True: 0, False: 1.92k]
  ------------------
 4867|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4868|      0|        return SECFailure;
 4869|      0|    }
 4870|       |
 4871|  1.92k|    hashes->hashAlg = ssl_hash_none;
 4872|       |
 4873|  1.92k|    if (ss->ssl3.hs.hashType == handshake_hash_single) {
  ------------------
  |  Branch (4873:9): [True: 0, False: 1.92k]
  ------------------
 4874|      0|        PK11Context *h;
 4875|      0|        unsigned int stateLen;
 4876|      0|        unsigned char stackBuf[1024];
 4877|      0|        unsigned char *stateBuf = NULL;
 4878|       |
 4879|      0|        h = ss->ssl3.hs.sha;
 4880|      0|        stateBuf = PK11_SaveContextAlloc(h, stackBuf,
 4881|      0|                                         sizeof(stackBuf), &stateLen);
 4882|      0|        if (stateBuf == NULL) {
  ------------------
  |  Branch (4882:13): [True: 0, False: 0]
  ------------------
 4883|      0|            ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 4884|      0|            rv = SECFailure;
 4885|      0|            goto tls12_loser;
 4886|      0|        }
 4887|      0|        rv |= PK11_DigestFinal(h, hashes->u.raw, &hashes->len,
 4888|      0|                               sizeof(hashes->u.raw));
 4889|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4889:13): [True: 0, False: 0]
  ------------------
 4890|      0|            ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 4891|      0|            rv = SECFailure;
 4892|      0|            goto tls12_loser;
 4893|      0|        }
 4894|       |
 4895|      0|        hashes->hashAlg = ssl3_GetSuitePrfHash(ss);
 4896|       |
 4897|      0|    tls12_loser:
 4898|      0|        if (stateBuf) {
  ------------------
  |  Branch (4898:13): [True: 0, False: 0]
  ------------------
 4899|      0|            if (PK11_RestoreContext(h, stateBuf, stateLen) != SECSuccess) {
  ------------------
  |  Branch (4899:17): [True: 0, False: 0]
  ------------------
 4900|      0|                ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 4901|      0|                rv = SECFailure;
 4902|      0|            }
 4903|      0|            if (stateBuf != stackBuf) {
  ------------------
  |  Branch (4903:17): [True: 0, False: 0]
  ------------------
 4904|      0|                PORT_ZFree(stateBuf, stateLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 4905|      0|            }
 4906|      0|        }
 4907|  1.92k|    } else if (ss->ssl3.hs.hashType == handshake_hash_record) {
  ------------------
  |  Branch (4907:16): [True: 1.74k, False: 185]
  ------------------
 4908|  1.74k|        rv = ssl3_ComputeHandshakeHash(ss->ssl3.hs.messages.buf,
 4909|  1.74k|                                       ss->ssl3.hs.messages.len,
 4910|  1.74k|                                       ssl3_GetSuitePrfHash(ss),
 4911|  1.74k|                                       hashes);
 4912|  1.74k|    } else {
 4913|    185|        PK11Context *md5;
 4914|    185|        PK11Context *sha = NULL;
 4915|    185|        unsigned char *md5StateBuf = NULL;
 4916|    185|        unsigned char *shaStateBuf = NULL;
 4917|    185|        unsigned int md5StateLen, shaStateLen;
 4918|    185|        unsigned char md5StackBuf[256];
 4919|    185|        unsigned char shaStackBuf[512];
 4920|    185|        const int md5Pad = ssl_GetMacDefByAlg(ssl_mac_md5)->pad_size;
 4921|    185|        const int shaPad = ssl_GetMacDefByAlg(ssl_mac_sha)->pad_size;
 4922|       |
 4923|    185|        md5StateBuf = PK11_SaveContextAlloc(ss->ssl3.hs.md5, md5StackBuf,
 4924|    185|                                            sizeof md5StackBuf, &md5StateLen);
 4925|    185|        if (md5StateBuf == NULL) {
  ------------------
  |  Branch (4925:13): [True: 0, False: 185]
  ------------------
 4926|      0|            ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);
 4927|      0|            rv = SECFailure;
 4928|      0|            goto loser;
 4929|      0|        }
 4930|    185|        md5 = ss->ssl3.hs.md5;
 4931|       |
 4932|    185|        shaStateBuf = PK11_SaveContextAlloc(ss->ssl3.hs.sha, shaStackBuf,
 4933|    185|                                            sizeof shaStackBuf, &shaStateLen);
 4934|    185|        if (shaStateBuf == NULL) {
  ------------------
  |  Branch (4934:13): [True: 0, False: 185]
  ------------------
 4935|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 4936|      0|            rv = SECFailure;
 4937|      0|            goto loser;
 4938|      0|        }
 4939|    185|        sha = ss->ssl3.hs.sha;
 4940|       |
 4941|    185|        if (!isTLS) {
  ------------------
  |  Branch (4941:13): [True: 0, False: 185]
  ------------------
 4942|       |            /* compute hashes for SSL3. */
 4943|      0|            unsigned char s[4];
 4944|       |
 4945|      0|            if (!spec->masterSecret) {
  ------------------
  |  Branch (4945:17): [True: 0, False: 0]
  ------------------
 4946|      0|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HANDSHAKE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4947|      0|                rv = SECFailure;
 4948|      0|                goto loser;
 4949|      0|            }
 4950|       |
 4951|      0|            s[0] = (unsigned char)(sender >> 24);
 4952|      0|            s[1] = (unsigned char)(sender >> 16);
 4953|      0|            s[2] = (unsigned char)(sender >> 8);
 4954|      0|            s[3] = (unsigned char)sender;
 4955|       |
 4956|      0|            if (sender != 0) {
  ------------------
  |  Branch (4956:17): [True: 0, False: 0]
  ------------------
 4957|      0|                rv |= PK11_DigestOp(md5, s, 4);
 4958|      0|                PRINT_BUF(95, (NULL, "MD5 inner: sender", s, 4));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4959|      0|            }
 4960|       |
 4961|      0|            PRINT_BUF(95, (NULL, "MD5 inner: MAC Pad 1", mac_pad_1, md5Pad));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4962|       |
 4963|      0|            rv |= PK11_DigestKey(md5, spec->masterSecret);
 4964|      0|            rv |= PK11_DigestOp(md5, mac_pad_1, md5Pad);
 4965|      0|            rv |= PK11_DigestFinal(md5, md5_inner, &outLength, MD5_LENGTH);
  ------------------
  |  |   38|      0|#define MD5_LENGTH 16
  ------------------
 4966|      0|            PORT_Assert(rv != SECSuccess || outLength == MD5_LENGTH);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4967|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (4967:17): [True: 0, False: 0]
  ------------------
 4968|      0|                ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);
 4969|      0|                rv = SECFailure;
 4970|      0|                goto loser;
 4971|      0|            }
 4972|       |
 4973|      0|            PRINT_BUF(95, (NULL, "MD5 inner: result", md5_inner, outLength));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4974|       |
 4975|      0|            if (sender != 0) {
  ------------------
  |  Branch (4975:17): [True: 0, False: 0]
  ------------------
 4976|      0|                rv |= PK11_DigestOp(sha, s, 4);
 4977|      0|                PRINT_BUF(95, (NULL, "SHA inner: sender", s, 4));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4978|      0|            }
 4979|       |
 4980|      0|            PRINT_BUF(95, (NULL, "SHA inner: MAC Pad 1", mac_pad_1, shaPad));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4981|       |
 4982|      0|            rv |= PK11_DigestKey(sha, spec->masterSecret);
 4983|      0|            rv |= PK11_DigestOp(sha, mac_pad_1, shaPad);
 4984|      0|            rv |= PK11_DigestFinal(sha, sha_inner, &outLength, SHA1_LENGTH);
  ------------------
  |  |   39|      0|#define SHA1_LENGTH 20
  ------------------
 4985|      0|            PORT_Assert(rv != SECSuccess || outLength == SHA1_LENGTH);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4986|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (4986:17): [True: 0, False: 0]
  ------------------
 4987|      0|                ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 4988|      0|                rv = SECFailure;
 4989|      0|                goto loser;
 4990|      0|            }
 4991|       |
 4992|      0|            PRINT_BUF(95, (NULL, "SHA inner: result", sha_inner, outLength));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4993|       |
 4994|      0|            PRINT_BUF(95, (NULL, "MD5 outer: MAC Pad 2", mac_pad_2, md5Pad));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4995|      0|            PRINT_BUF(95, (NULL, "MD5 outer: MD5 inner", md5_inner, MD5_LENGTH));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4996|       |
 4997|      0|            rv |= PK11_DigestBegin(md5);
 4998|      0|            rv |= PK11_DigestKey(md5, spec->masterSecret);
 4999|      0|            rv |= PK11_DigestOp(md5, mac_pad_2, md5Pad);
 5000|      0|            rv |= PK11_DigestOp(md5, md5_inner, MD5_LENGTH);
  ------------------
  |  |   38|      0|#define MD5_LENGTH 16
  ------------------
 5001|      0|        }
 5002|    185|        rv |= PK11_DigestFinal(md5, hashes->u.s.md5, &outLength, MD5_LENGTH);
  ------------------
  |  |   38|    185|#define MD5_LENGTH 16
  ------------------
 5003|    185|        PORT_Assert(rv != SECSuccess || outLength == MD5_LENGTH);
  ------------------
  |  |  120|    185|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    370|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 185]
  |  |  |  |  |  Branch (208:7): [True: 185, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5004|    185|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5004:13): [True: 0, False: 185]
  ------------------
 5005|      0|            ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);
 5006|      0|            rv = SECFailure;
 5007|      0|            goto loser;
 5008|      0|        }
 5009|       |
 5010|    185|        PRINT_BUF(60, (NULL, "MD5 outer: result", hashes->u.s.md5, MD5_LENGTH));
  ------------------
  |  |   74|    185|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 185]
  |  |  ------------------
  |  |   75|    185|    ssl_PrintBuf b
  ------------------
 5011|       |
 5012|    185|        if (!isTLS) {
  ------------------
  |  Branch (5012:13): [True: 0, False: 185]
  ------------------
 5013|      0|            PRINT_BUF(95, (NULL, "SHA outer: MAC Pad 2", mac_pad_2, shaPad));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 5014|      0|            PRINT_BUF(95, (NULL, "SHA outer: SHA inner", sha_inner, SHA1_LENGTH));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 5015|       |
 5016|      0|            rv |= PK11_DigestBegin(sha);
 5017|      0|            rv |= PK11_DigestKey(sha, spec->masterSecret);
 5018|      0|            rv |= PK11_DigestOp(sha, mac_pad_2, shaPad);
 5019|      0|            rv |= PK11_DigestOp(sha, sha_inner, SHA1_LENGTH);
  ------------------
  |  |   39|      0|#define SHA1_LENGTH 20
  ------------------
 5020|      0|        }
 5021|    185|        rv |= PK11_DigestFinal(sha, hashes->u.s.sha, &outLength, SHA1_LENGTH);
  ------------------
  |  |   39|    185|#define SHA1_LENGTH 20
  ------------------
 5022|    185|        PORT_Assert(rv != SECSuccess || outLength == SHA1_LENGTH);
  ------------------
  |  |  120|    185|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    370|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 185]
  |  |  |  |  |  Branch (208:7): [True: 185, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5023|    185|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5023:13): [True: 0, False: 185]
  ------------------
 5024|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 5025|      0|            rv = SECFailure;
 5026|      0|            goto loser;
 5027|      0|        }
 5028|       |
 5029|    185|        PRINT_BUF(60, (NULL, "SHA outer: result", hashes->u.s.sha, SHA1_LENGTH));
  ------------------
  |  |   74|    185|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 185]
  |  |  ------------------
  |  |   75|    185|    ssl_PrintBuf b
  ------------------
 5030|       |
 5031|    185|        hashes->len = MD5_LENGTH + SHA1_LENGTH;
  ------------------
  |  |   38|    185|#define MD5_LENGTH 16
  ------------------
                      hashes->len = MD5_LENGTH + SHA1_LENGTH;
  ------------------
  |  |   39|    185|#define SHA1_LENGTH 20
  ------------------
 5032|       |
 5033|    185|    loser:
 5034|    185|        if (md5StateBuf) {
  ------------------
  |  Branch (5034:13): [True: 185, False: 0]
  ------------------
 5035|    185|            if (PK11_RestoreContext(ss->ssl3.hs.md5, md5StateBuf, md5StateLen) !=
  ------------------
  |  Branch (5035:17): [True: 0, False: 185]
  ------------------
 5036|    185|                SECSuccess) {
 5037|      0|                ssl_MapLowLevelError(SSL_ERROR_MD5_DIGEST_FAILURE);
 5038|      0|                rv = SECFailure;
 5039|      0|            }
 5040|    185|            if (md5StateBuf != md5StackBuf) {
  ------------------
  |  Branch (5040:17): [True: 0, False: 185]
  ------------------
 5041|      0|                PORT_ZFree(md5StateBuf, md5StateLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 5042|      0|            }
 5043|    185|        }
 5044|    185|        if (shaStateBuf) {
  ------------------
  |  Branch (5044:13): [True: 185, False: 0]
  ------------------
 5045|    185|            if (PK11_RestoreContext(ss->ssl3.hs.sha, shaStateBuf, shaStateLen) !=
  ------------------
  |  Branch (5045:17): [True: 0, False: 185]
  ------------------
 5046|    185|                SECSuccess) {
 5047|      0|                ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 5048|      0|                rv = SECFailure;
 5049|      0|            }
 5050|    185|            if (shaStateBuf != shaStackBuf) {
  ------------------
  |  Branch (5050:17): [True: 0, False: 185]
  ------------------
 5051|      0|                PORT_ZFree(shaStateBuf, shaStateLen);
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 5052|      0|            }
 5053|    185|        }
 5054|    185|    }
 5055|  1.92k|    return rv;
 5056|  1.92k|}
ssl3_InsertChHeaderSize:
 5127|  20.4k|{
 5128|  20.4k|    SECStatus rv;
 5129|  20.4k|    unsigned int msgLen = preamble->len;
 5130|  20.4k|    msgLen += extensions->len ? (2 + extensions->len) : 0;
  ------------------
  |  Branch (5130:15): [True: 20.4k, False: 0]
  ------------------
 5131|  20.4k|    unsigned int headerLen = IS_DTLS(ss) ? 12 : 4;
  ------------------
  |  |  892|  20.4k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 20.4k, False: 0]
  |  |  ------------------
  ------------------
 5132|       |
 5133|       |    /* Record the message length. */
 5134|  20.4k|    rv = sslBuffer_InsertNumber(preamble, 1, msgLen - headerLen, 3);
 5135|  20.4k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5135:9): [True: 0, False: 20.4k]
  ------------------
 5136|      0|        return SECFailure; /* code set */
 5137|      0|    }
 5138|  20.4k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  20.4k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 20.4k, False: 0]
  |  |  ------------------
  ------------------
 5139|       |        /* Record the (unfragmented) fragment length. */
 5140|  20.4k|        unsigned int offset = 1 /* ch */ + 3 /* len */ +
 5141|  20.4k|                              2 /* seq */ + 3 /* fragment offset */;
 5142|  20.4k|        rv = sslBuffer_InsertNumber(preamble, offset, msgLen - headerLen, 3);
 5143|  20.4k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5143:13): [True: 0, False: 20.4k]
  ------------------
 5144|      0|            return SECFailure; /* code set */
 5145|      0|        }
 5146|  20.4k|    }
 5147|       |
 5148|  20.4k|    return SECSuccess;
 5149|  20.4k|}
ssl3_CreateClientHelloPreamble:
 5217|  10.2k|{
 5218|  10.2k|    SECStatus rv;
 5219|  10.2k|    sslBuffer constructed = SSL_BUFFER_EMPTY;
  ------------------
  |  |   23|  10.2k|    {                        \
  |  |   24|  10.2k|        NULL, 0, 0, PR_FALSE \
  |  |  ------------------
  |  |  |  |  438|  10.2k|#define PR_FALSE 0
  |  |  ------------------
  |  |   25|  10.2k|    }
  ------------------
 5220|  10.2k|    const PRUint8 *client_random = isEchInner ? ss->ssl3.hs.client_inner_random : ss->ssl3.hs.client_random;
  ------------------
  |  Branch (5220:36): [True: 0, False: 10.2k]
  ------------------
 5221|  10.2k|    PORT_Assert(sid);
  ------------------
  |  |  120|  10.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5222|  10.2k|    PRBool fallbackSCSV = ss->opt.enableFallbackSCSV && !isEchInner &&
  ------------------
  |  Branch (5222:27): [True: 5.05k, False: 5.16k]
  |  Branch (5222:57): [True: 5.05k, False: 0]
  ------------------
 5223|  10.2k|                          (!realSid || version < sid->version);
  ------------------
  |  Branch (5223:28): [True: 5.05k, False: 0]
  |  Branch (5223:40): [True: 0, False: 0]
  ------------------
 5224|       |
 5225|  10.2k|    rv = sslBuffer_AppendNumber(&constructed, ssl_hs_client_hello, 1);
 5226|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5226:9): [True: 0, False: 10.2k]
  ------------------
 5227|      0|        goto loser;
 5228|      0|    }
 5229|       |
 5230|  10.2k|    rv = sslBuffer_Skip(&constructed, 3, NULL);
 5231|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5231:9): [True: 0, False: 10.2k]
  ------------------
 5232|      0|        goto loser;
 5233|      0|    }
 5234|       |
 5235|  10.2k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  10.2k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
 5236|       |        /* Note that we make an unfragmented message here. We fragment in the
 5237|       |         * transmission code, if necessary */
 5238|  10.2k|        rv = sslBuffer_AppendNumber(&constructed, ss->ssl3.hs.sendMessageSeq, 2);
 5239|  10.2k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5239:13): [True: 0, False: 10.2k]
  ------------------
 5240|      0|            goto loser;
 5241|      0|        }
 5242|  10.2k|        ss->ssl3.hs.sendMessageSeq++;
 5243|       |
 5244|       |        /* 0 is the fragment offset, because it's not fragmented yet */
 5245|  10.2k|        rv = sslBuffer_AppendNumber(&constructed, 0, 3);
 5246|  10.2k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5246:13): [True: 0, False: 10.2k]
  ------------------
 5247|      0|            goto loser;
 5248|      0|        }
 5249|       |
 5250|       |        /* Fragment length -- set to the packet length because not fragmented */
 5251|  10.2k|        rv = sslBuffer_Skip(&constructed, 3, NULL);
 5252|  10.2k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5252:13): [True: 0, False: 10.2k]
  ------------------
 5253|      0|            goto loser;
 5254|      0|        }
 5255|  10.2k|    }
 5256|       |
 5257|  10.2k|    if (ss->firstHsDone) {
  ------------------
  |  Branch (5257:9): [True: 0, False: 10.2k]
  ------------------
 5258|       |        /* The client hello version must stay unchanged to work around
 5259|       |         * the Windows SChannel bug described in ssl3_SendClientHello. */
 5260|      0|        PORT_Assert(version == ss->clientHelloVersion);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5261|      0|    }
 5262|       |
 5263|  10.2k|    ss->clientHelloVersion = PR_MIN(version, SSL_LIBRARY_VERSION_TLS_1_2);
  ------------------
  |  |  158|  10.2k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 177, False: 10.0k]
  |  |  ------------------
  ------------------
 5264|  10.2k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  10.2k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
 5265|  10.2k|        PRUint16 dtlsVersion = dtls_TLSVersionToDTLSVersion(ss->clientHelloVersion);
 5266|  10.2k|        rv = sslBuffer_AppendNumber(&constructed, dtlsVersion, 2);
 5267|  10.2k|    } else {
 5268|      0|        rv = sslBuffer_AppendNumber(&constructed, ss->clientHelloVersion, 2);
 5269|      0|    }
 5270|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5270:9): [True: 0, False: 10.2k]
  ------------------
 5271|      0|        goto loser;
 5272|      0|    }
 5273|       |
 5274|  10.2k|    rv = sslBuffer_Append(&constructed, client_random, SSL3_RANDOM_LENGTH);
  ------------------
  |  |   24|  10.2k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 5275|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5275:9): [True: 0, False: 10.2k]
  ------------------
 5276|      0|        goto loser;
 5277|      0|    }
 5278|       |
 5279|  10.2k|    if (sid->version < SSL_LIBRARY_VERSION_TLS_1_3 && !isEchInner) {
  ------------------
  |  |   21|  20.4k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (5279:9): [True: 1.40k, False: 8.81k]
  |  Branch (5279:55): [True: 1.40k, False: 0]
  ------------------
 5280|  1.40k|        rv = sslBuffer_AppendVariable(&constructed, sid->u.ssl3.sessionID,
 5281|  1.40k|                                      sid->u.ssl3.sessionIDLength, 1);
 5282|  8.81k|    } else if (ss->opt.enableTls13CompatMode && !IS_DTLS(ss)) {
  ------------------
  |  |  892|  4.27k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (5282:16): [True: 4.27k, False: 4.53k]
  |  Branch (5282:49): [True: 0, False: 4.27k]
  ------------------
 5283|       |        /* We're faking session resumption, so rather than create new
 5284|       |         * randomness, just mix up the client random a little. */
 5285|      0|        PRUint8 buf[SSL3_SESSIONID_BYTES];
 5286|      0|        ssl_MakeFakeSid(ss, buf);
 5287|      0|        rv = sslBuffer_AppendVariable(&constructed, buf, SSL3_SESSIONID_BYTES, 1);
  ------------------
  |  |  107|      0|#define SSL3_SESSIONID_BYTES 32
  ------------------
 5288|  8.81k|    } else {
 5289|  8.81k|        rv = sslBuffer_AppendNumber(&constructed, 0, 1);
 5290|  8.81k|    }
 5291|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5291:9): [True: 0, False: 10.2k]
  ------------------
 5292|      0|        goto loser;
 5293|      0|    }
 5294|       |
 5295|  10.2k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  10.2k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
 5296|       |        /* This cookieLen applies to the cookie that appears in the DTLS
 5297|       |         * ClientHello, which isn't used in DTLS 1.3. */
 5298|  10.2k|        rv = sslBuffer_AppendVariable(&constructed, ss->ssl3.hs.cookie.data,
 5299|  10.2k|                                      ss->ssl3.hs.helloRetry ? 0 : ss->ssl3.hs.cookie.len,
  ------------------
  |  Branch (5299:39): [True: 972, False: 9.24k]
  ------------------
 5300|  10.2k|                                      1);
 5301|  10.2k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5301:13): [True: 0, False: 10.2k]
  ------------------
 5302|      0|            goto loser;
 5303|      0|        }
 5304|  10.2k|    }
 5305|       |
 5306|  10.2k|    rv = ssl3_AppendCipherSuites(ss, fallbackSCSV, &constructed);
 5307|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5307:9): [True: 0, False: 10.2k]
  ------------------
 5308|      0|        goto loser;
 5309|      0|    }
 5310|       |
 5311|       |    /* Compression methods: count is always 1, null compression. */
 5312|  10.2k|    rv = sslBuffer_AppendNumber(&constructed, 1, 1);
 5313|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5313:9): [True: 0, False: 10.2k]
  ------------------
 5314|      0|        goto loser;
 5315|      0|    }
 5316|  10.2k|    rv = sslBuffer_AppendNumber(&constructed, ssl_compression_null, 1);
 5317|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5317:9): [True: 0, False: 10.2k]
  ------------------
 5318|      0|        goto loser;
 5319|      0|    }
 5320|       |
 5321|  10.2k|    rv = ssl3_InsertChHeaderSize(ss, &constructed, extensions);
 5322|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5322:9): [True: 0, False: 10.2k]
  ------------------
 5323|      0|        goto loser;
 5324|      0|    }
 5325|       |
 5326|  10.2k|    *preamble = constructed;
 5327|  10.2k|    return SECSuccess;
 5328|      0|loser:
 5329|      0|    sslBuffer_Clear(&constructed);
 5330|      0|    return SECFailure;
 5331|  10.2k|}
ssl3_SendClientHello:
 5347|  10.2k|{
 5348|  10.2k|    sslSessionID *sid;
 5349|  10.2k|    SECStatus rv;
 5350|  10.2k|    PRBool isTLS = PR_FALSE;
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
 5351|  10.2k|    PRBool requestingResume = PR_FALSE;
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
 5352|  10.2k|    PRBool unlockNeeded = PR_FALSE;
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
 5353|  10.2k|    sslBuffer extensionBuf = SSL_BUFFER_EMPTY;
  ------------------
  |  |   23|  10.2k|    {                        \
  |  |   24|  10.2k|        NULL, 0, 0, PR_FALSE \
  |  |  ------------------
  |  |  |  |  438|  10.2k|#define PR_FALSE 0
  |  |  ------------------
  |  |   25|  10.2k|    }
  ------------------
 5354|  10.2k|    PRUint16 version = ss->vrange.max;
 5355|  10.2k|    PRInt32 flags;
 5356|  10.2k|    sslBuffer chBuf = SSL_BUFFER_EMPTY;
  ------------------
  |  |   23|  10.2k|    {                        \
  |  |   24|  10.2k|        NULL, 0, 0, PR_FALSE \
  |  |  ------------------
  |  |  |  |  438|  10.2k|#define PR_FALSE 0
  |  |  ------------------
  |  |   25|  10.2k|    }
  ------------------
 5357|       |
 5358|  10.2k|    SSL_TRC(3, ("%d: SSL3[%d]: send %s ClientHello handshake", SSL_GETPID(),
  ------------------
  |  |   71|  10.2k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 10.2k]
  |  |  ------------------
  |  |   72|  10.2k|    ssl_Trace b
  ------------------
 5359|  10.2k|                ss->fd, ssl_ClientHelloTypeName(type)));
 5360|       |
 5361|  10.2k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  10.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 5.00k, False: 5.21k]
  |  |  |  |  |  Branch (208:7): [True: 5.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5362|  10.2k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  10.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  15.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 5.00k, False: 5.21k]
  |  |  |  |  |  Branch (208:7): [True: 5.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5363|       |
 5364|       |    /* shouldn't get here if SSL3 is disabled, but ... */
 5365|  10.2k|    if (SSL_ALL_VERSIONS_DISABLED(&ss->vrange)) {
  ------------------
  |  | 1503|  10.2k|    ((vrange)->min == SSL_LIBRARY_VERSION_NONE)
  |  |  ------------------
  |  |  |  | 1481|  10.2k|#define SSL_LIBRARY_VERSION_NONE 0
  |  |  ------------------
  |  |  |  Branch (1503:5): [True: 0, False: 10.2k]
  |  |  ------------------
  ------------------
 5366|      0|        PR_NOT_REACHED("No versions of SSL 3.0 or later are enabled");
  ------------------
  |  |  213|      0|    PR_Assert(_reasonStr,__FILE__,__LINE__)
  ------------------
 5367|      0|        PORT_SetError(SSL_ERROR_SSL_DISABLED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5368|      0|        return SECFailure;
 5369|      0|    }
 5370|       |
 5371|       |    /* If we are responding to a HelloRetryRequest, don't reinitialize. We need
 5372|       |     * to maintain the handshake hashes. */
 5373|  10.2k|    if (!ss->ssl3.hs.helloRetry) {
  ------------------
  |  Branch (5373:9): [True: 9.24k, False: 972]
  ------------------
 5374|  9.24k|        ssl3_RestartHandshakeHashes(ss);
 5375|  9.24k|    }
 5376|  10.2k|    PORT_Assert(!ss->ssl3.hs.helloRetry || type == client_hello_retry);
  ------------------
  |  |  120|  10.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  11.1k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 9.24k, False: 972]
  |  |  |  |  |  Branch (208:7): [True: 972, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5377|       |
 5378|  10.2k|    if (type == client_hello_initial) {
  ------------------
  |  Branch (5378:9): [True: 8.85k, False: 1.36k]
  ------------------
 5379|  8.85k|        ssl_SetClientHelloSpecVersion(ss, ss->ssl3.cwSpec);
 5380|  8.85k|    }
 5381|       |    /* These must be reset every handshake. */
 5382|  10.2k|    ssl3_ResetExtensionData(&ss->xtnData, ss);
 5383|  10.2k|    ss->ssl3.hs.sendingSCSV = PR_FALSE;
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
 5384|  10.2k|    ss->ssl3.hs.preliminaryInfo = 0;
 5385|  10.2k|    PORT_Assert(IS_DTLS(ss) || type != client_hello_retransmit);
  ------------------
  |  |  120|  10.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 10.2k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5386|  10.2k|    SECITEM_FreeItem(&ss->ssl3.hs.newSessionTicket.ticket, PR_FALSE);
  ------------------
  |  |  108|  10.2k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&ss->ssl3.hs.newSessionTicket.ticket, PR_FALSE);
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
 5387|  10.2k|    ss->ssl3.hs.receivedNewSessionTicket = PR_FALSE;
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
 5388|       |
 5389|       |    /* How many suites does our PKCS11 support (regardless of policy)? */
 5390|  10.2k|    if (ssl3_config_match_init(ss) == 0) {
  ------------------
  |  Branch (5390:9): [True: 0, False: 10.2k]
  ------------------
 5391|      0|        return SECFailure; /* ssl3_config_match_init has set error code. */
 5392|      0|    }
 5393|       |
 5394|       |    /*
 5395|       |     * During a renegotiation, ss->clientHelloVersion will be used again to
 5396|       |     * work around a Windows SChannel bug. Ensure that it is still enabled.
 5397|       |     */
 5398|  10.2k|    if (ss->firstHsDone) {
  ------------------
  |  Branch (5398:9): [True: 0, False: 10.2k]
  ------------------
 5399|      0|        PORT_Assert(type != client_hello_initial);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5400|      0|        if (SSL_ALL_VERSIONS_DISABLED(&ss->vrange)) {
  ------------------
  |  | 1503|      0|    ((vrange)->min == SSL_LIBRARY_VERSION_NONE)
  |  |  ------------------
  |  |  |  | 1481|      0|#define SSL_LIBRARY_VERSION_NONE 0
  |  |  ------------------
  |  |  |  Branch (1503:5): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5401|      0|            PORT_SetError(SSL_ERROR_SSL_DISABLED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5402|      0|            return SECFailure;
 5403|      0|        }
 5404|       |
 5405|      0|        if (ss->clientHelloVersion < ss->vrange.min ||
  ------------------
  |  Branch (5405:13): [True: 0, False: 0]
  ------------------
 5406|      0|            ss->clientHelloVersion > ss->vrange.max) {
  ------------------
  |  Branch (5406:13): [True: 0, False: 0]
  ------------------
 5407|      0|            PORT_SetError(SSL_ERROR_NO_CYPHER_OVERLAP);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5408|      0|            return SECFailure;
 5409|      0|        }
 5410|      0|    }
 5411|       |
 5412|       |    /* Check if we have a ss->sec.ci.sid.
 5413|       |     * Check that it's not expired.
 5414|       |     * If we have an sid and it comes from an external cache, we use it. */
 5415|  10.2k|    if (ss->sec.ci.sid && ss->sec.ci.sid->cached == in_external_cache) {
  ------------------
  |  Branch (5415:9): [True: 10.2k, False: 0]
  |  Branch (5415:27): [True: 0, False: 10.2k]
  ------------------
 5416|      0|        PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5417|      0|        sid = ssl_ReferenceSID(ss->sec.ci.sid);
 5418|      0|        SSL_TRC(3, ("%d: SSL3[%d]: using external resumption token in ClientHello",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 5419|      0|                    SSL_GETPID(), ss->fd));
 5420|  10.2k|    } else if (ss->sec.ci.sid && ss->statelessResume && type == client_hello_retry) {
  ------------------
  |  Branch (5420:16): [True: 10.2k, False: 0]
  |  Branch (5420:34): [True: 0, False: 10.2k]
  |  Branch (5420:57): [True: 0, False: 0]
  ------------------
 5421|       |        /* If we are sending a second ClientHello, reuse the same SID
 5422|       |         * as the original one. */
 5423|      0|        sid = ssl_ReferenceSID(ss->sec.ci.sid);
 5424|  10.2k|    } else if (!ss->opt.noCache) {
  ------------------
  |  Branch (5424:16): [True: 5.25k, False: 4.96k]
  ------------------
 5425|       |        /* We ignore ss->sec.ci.sid here, and use ssl_Lookup because Lookup
 5426|       |         * handles expired entries and other details.
 5427|       |         * XXX If we've been called from ssl_BeginClientHandshake, then
 5428|       |         * this lookup is duplicative and wasteful.
 5429|       |         */
 5430|  5.25k|        sid = ssl_LookupSID(ssl_Time(ss), &ss->sec.ci.peer,
 5431|  5.25k|                            ss->sec.ci.port, ss->peerID, ss->url);
 5432|  5.25k|    } else {
 5433|  4.96k|        sid = NULL;
 5434|  4.96k|    }
 5435|       |
 5436|       |    /* We can't resume based on a different token. If the sid exists,
 5437|       |     * make sure the token that holds the master secret still exists ...
 5438|       |     * If we previously did client-auth, make sure that the token that holds
 5439|       |     * the private key still exists, is logged in, hasn't been removed, etc.
 5440|       |     */
 5441|  10.2k|    if (sid) {
  ------------------
  |  Branch (5441:9): [True: 0, False: 10.2k]
  ------------------
 5442|      0|        PRBool sidOK = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5443|       |
 5444|      0|        if (sid->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (5444:13): [True: 0, False: 0]
  ------------------
 5445|      0|            if (!tls13_ResumptionCompatible(ss, sid->u.ssl3.cipherSuite)) {
  ------------------
  |  Branch (5445:17): [True: 0, False: 0]
  ------------------
 5446|      0|                sidOK = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5447|      0|            }
 5448|      0|        } else {
 5449|       |            /* Check that the cipher suite we need is enabled. */
 5450|      0|            const ssl3CipherSuiteCfg *suite =
 5451|      0|                ssl_LookupCipherSuiteCfg(sid->u.ssl3.cipherSuite,
 5452|      0|                                         ss->cipherSuites);
 5453|      0|            SSLVersionRange vrange = { sid->version, sid->version };
 5454|      0|            if (!suite || !ssl3_config_match(suite, ss->ssl3.policy, &vrange, ss)) {
  ------------------
  |  Branch (5454:17): [True: 0, False: 0]
  |  Branch (5454:27): [True: 0, False: 0]
  ------------------
 5455|      0|                sidOK = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5456|      0|            }
 5457|       |
 5458|       |            /* Check that no (valid) ECHConfigs are setup in combination with a
 5459|       |             * (resumable) TLS < 1.3 session id. */
 5460|      0|            if (!PR_CLIST_IS_EMPTY(&ss->echConfigs)) {
  ------------------
  |  |   94|      0|    ((_l)->next == (_l))
  ------------------
  |  Branch (5460:17): [True: 0, False: 0]
  ------------------
 5461|       |                /* If there are ECH configs, the client must not resume but
 5462|       |                 * offer ECH. */
 5463|      0|                sidOK = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5464|      0|            }
 5465|      0|        }
 5466|       |
 5467|       |        /* Check that we can recover the master secret. */
 5468|      0|        if (sidOK) {
  ------------------
  |  Branch (5468:13): [True: 0, False: 0]
  ------------------
 5469|      0|            PK11SlotInfo *slot = NULL;
 5470|      0|            if (sid->u.ssl3.masterValid) {
  ------------------
  |  Branch (5470:17): [True: 0, False: 0]
  ------------------
 5471|      0|                slot = SECMOD_LookupSlot(sid->u.ssl3.masterModuleID,
 5472|      0|                                         sid->u.ssl3.masterSlotID);
 5473|      0|            }
 5474|      0|            if (slot == NULL) {
  ------------------
  |  Branch (5474:17): [True: 0, False: 0]
  ------------------
 5475|      0|                sidOK = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5476|      0|            } else {
 5477|      0|                PK11SymKey *wrapKey = NULL;
 5478|      0|                if (!PK11_IsPresent(slot) ||
  ------------------
  |  Branch (5478:21): [True: 0, False: 0]
  ------------------
 5479|      0|                    ((wrapKey = PK11_GetWrapKey(slot,
  ------------------
  |  Branch (5479:21): [True: 0, False: 0]
  ------------------
 5480|      0|                                                sid->u.ssl3.masterWrapIndex,
 5481|      0|                                                sid->u.ssl3.masterWrapMech,
 5482|      0|                                                sid->u.ssl3.masterWrapSeries,
 5483|      0|                                                ss->pkcs11PinArg)) == NULL)) {
 5484|      0|                    sidOK = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5485|      0|                }
 5486|      0|                if (wrapKey)
  ------------------
  |  Branch (5486:21): [True: 0, False: 0]
  ------------------
 5487|      0|                    PK11_FreeSymKey(wrapKey);
 5488|      0|                PK11_FreeSlot(slot);
 5489|      0|                slot = NULL;
 5490|      0|            }
 5491|      0|        }
 5492|       |        /* If we previously did client-auth, make sure that the token that
 5493|       |        ** holds the private key still exists, is logged in, hasn't been
 5494|       |        ** removed, etc.
 5495|       |        */
 5496|      0|        if (sidOK && !ssl3_ClientAuthTokenPresent(sid)) {
  ------------------
  |  Branch (5496:13): [True: 0, False: 0]
  |  Branch (5496:22): [True: 0, False: 0]
  ------------------
 5497|      0|            sidOK = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5498|      0|        }
 5499|       |
 5500|      0|        if (sidOK) {
  ------------------
  |  Branch (5500:13): [True: 0, False: 0]
  ------------------
 5501|       |            /* Set version based on the sid. */
 5502|      0|            if (ss->firstHsDone) {
  ------------------
  |  Branch (5502:17): [True: 0, False: 0]
  ------------------
 5503|       |                /*
 5504|       |                 * Windows SChannel compares the client_version inside the RSA
 5505|       |                 * EncryptedPreMasterSecret of a renegotiation with the
 5506|       |                 * client_version of the initial ClientHello rather than the
 5507|       |                 * ClientHello in the renegotiation. To work around this bug, we
 5508|       |                 * continue to use the client_version used in the initial
 5509|       |                 * ClientHello when renegotiating.
 5510|       |                 *
 5511|       |                 * The client_version of the initial ClientHello is still
 5512|       |                 * available in ss->clientHelloVersion. Ensure that
 5513|       |                 * sid->version is bounded within
 5514|       |                 * [ss->vrange.min, ss->clientHelloVersion], otherwise we
 5515|       |                 * can't use sid.
 5516|       |                 */
 5517|      0|                if (sid->version >= ss->vrange.min &&
  ------------------
  |  Branch (5517:21): [True: 0, False: 0]
  ------------------
 5518|      0|                    sid->version <= ss->clientHelloVersion) {
  ------------------
  |  Branch (5518:21): [True: 0, False: 0]
  ------------------
 5519|      0|                    version = ss->clientHelloVersion;
 5520|      0|                } else {
 5521|      0|                    sidOK = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5522|      0|                }
 5523|      0|            } else {
 5524|       |                /*
 5525|       |                 * Check sid->version is OK first.
 5526|       |                 * Previously, we would cap the version based on sid->version,
 5527|       |                 * but that prevents negotiation of a higher version if the
 5528|       |                 * previous session was reduced (e.g., with version fallback)
 5529|       |                 */
 5530|      0|                if (sid->version < ss->vrange.min ||
  ------------------
  |  Branch (5530:21): [True: 0, False: 0]
  ------------------
 5531|      0|                    sid->version > ss->vrange.max) {
  ------------------
  |  Branch (5531:21): [True: 0, False: 0]
  ------------------
 5532|      0|                    sidOK = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5533|      0|                }
 5534|      0|            }
 5535|      0|        }
 5536|       |
 5537|      0|        if (!sidOK) {
  ------------------
  |  Branch (5537:13): [True: 0, False: 0]
  ------------------
 5538|      0|            SSL_AtomicIncrementLong(&ssl3stats.sch_sid_cache_not_ok);
 5539|      0|            ssl_UncacheSessionID(ss);
 5540|      0|            ssl_FreeSID(sid);
 5541|      0|            sid = NULL;
 5542|      0|        }
 5543|      0|    }
 5544|       |
 5545|  10.2k|    if (sid) {
  ------------------
  |  Branch (5545:9): [True: 0, False: 10.2k]
  ------------------
 5546|      0|        requestingResume = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5547|      0|        SSL_AtomicIncrementLong(&ssl3stats.sch_sid_cache_hits);
 5548|       |
 5549|      0|        PRINT_BUF(4, (ss, "client, found session-id:", sid->u.ssl3.sessionID,
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 5550|      0|                      sid->u.ssl3.sessionIDLength));
 5551|       |
 5552|      0|        ss->ssl3.policy = sid->u.ssl3.policy;
 5553|  10.2k|    } else {
 5554|  10.2k|        SSL_AtomicIncrementLong(&ssl3stats.sch_sid_cache_misses);
 5555|       |
 5556|       |        /*
 5557|       |         * Windows SChannel compares the client_version inside the RSA
 5558|       |         * EncryptedPreMasterSecret of a renegotiation with the
 5559|       |         * client_version of the initial ClientHello rather than the
 5560|       |         * ClientHello in the renegotiation. To work around this bug, we
 5561|       |         * continue to use the client_version used in the initial
 5562|       |         * ClientHello when renegotiating.
 5563|       |         */
 5564|  10.2k|        if (ss->firstHsDone) {
  ------------------
  |  Branch (5564:13): [True: 0, False: 10.2k]
  ------------------
 5565|      0|            version = ss->clientHelloVersion;
 5566|      0|        }
 5567|       |
 5568|  10.2k|        sid = ssl3_NewSessionID(ss, PR_FALSE);
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
 5569|  10.2k|        if (!sid) {
  ------------------
  |  Branch (5569:13): [True: 0, False: 10.2k]
  ------------------
 5570|      0|            return SECFailure; /* memory error is set */
 5571|      0|        }
 5572|       |        /* ss->version isn't set yet, but the sid needs a sane value. */
 5573|  10.2k|        sid->version = version;
 5574|  10.2k|    }
 5575|       |
 5576|  10.2k|    isTLS = (version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|  10.2k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
 5577|  10.2k|    ssl_GetSpecWriteLock(ss);
  ------------------
  |  | 1435|  10.2k|    {                                            \
  |  | 1436|  10.2k|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 5.21k, False: 5.00k]
  |  |  ------------------
  |  | 1437|  10.2k|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|  5.21k|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|  10.2k|    }
  ------------------
 5578|  10.2k|    if (ss->ssl3.cwSpec->macDef->mac == ssl_mac_null) {
  ------------------
  |  Branch (5578:9): [True: 10.2k, False: 0]
  ------------------
 5579|       |        /* SSL records are not being MACed. */
 5580|  10.2k|        ss->ssl3.cwSpec->version = version;
 5581|  10.2k|    }
 5582|  10.2k|    ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|  10.2k|    {                                              \
  |  | 1441|  10.2k|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 5.21k, False: 5.00k]
  |  |  ------------------
  |  | 1442|  10.2k|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|  5.21k|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|  10.2k|    }
  ------------------
 5583|       |
 5584|  10.2k|    ssl_FreeSID(ss->sec.ci.sid); /* release the old sid */
 5585|  10.2k|    ss->sec.ci.sid = sid;
 5586|       |
 5587|       |    /* HACK for SCSV in SSL 3.0.  On initial handshake, prepend SCSV,
 5588|       |     * only if TLS is disabled.
 5589|       |     */
 5590|  10.2k|    if (!ss->firstHsDone && !isTLS) {
  ------------------
  |  Branch (5590:9): [True: 10.2k, False: 0]
  |  Branch (5590:29): [True: 0, False: 10.2k]
  ------------------
 5591|       |        /* Must set this before calling Hello Extension Senders,
 5592|       |         * to suppress sending of empty RI extension.
 5593|       |         */
 5594|      0|        ss->ssl3.hs.sendingSCSV = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5595|      0|    }
 5596|       |
 5597|       |    /* When we attempt session resumption (only), we must lock the sid to
 5598|       |     * prevent races with other resumption connections that receive a
 5599|       |     * NewSessionTicket that will cause the ticket in the sid to be replaced.
 5600|       |     * Once we've copied the session ticket into our ClientHello message, it
 5601|       |     * is OK for the ticket to change, so we just need to make sure we hold
 5602|       |     * the lock across the calls to ssl_ConstructExtensions.
 5603|       |     */
 5604|  10.2k|    if (sid->u.ssl3.lock) {
  ------------------
  |  Branch (5604:9): [True: 0, False: 10.2k]
  ------------------
 5605|      0|        unlockNeeded = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5606|      0|        PR_RWLock_Rlock(sid->u.ssl3.lock);
 5607|      0|    }
 5608|       |
 5609|       |    /* Generate a new random if this is the first attempt or renegotiation. */
 5610|  10.2k|    if (type == client_hello_initial ||
  ------------------
  |  Branch (5610:9): [True: 8.85k, False: 1.36k]
  ------------------
 5611|  10.2k|        type == client_hello_renegotiation) {
  ------------------
  |  Branch (5611:9): [True: 0, False: 1.36k]
  ------------------
 5612|  8.85k|        rv = ssl3_GetNewRandom(ss->ssl3.hs.client_random);
 5613|  8.85k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5613:13): [True: 0, False: 8.85k]
  ------------------
 5614|      0|            goto loser; /* err set by GetNewRandom. */
 5615|      0|        }
 5616|  8.85k|    }
 5617|       |
 5618|  10.2k|    if (ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (5618:9): [True: 8.81k, False: 1.40k]
  ------------------
 5619|  8.81k|        rv = tls13_SetupClientHello(ss, type);
 5620|  8.81k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5620:13): [True: 0, False: 8.81k]
  ------------------
 5621|      0|            goto loser;
 5622|      0|        }
 5623|  8.81k|    }
 5624|       |
 5625|       |    /* Setup TLS ClientHello Extension Permutation? */
 5626|  10.2k|    if (type == client_hello_initial &&
  ------------------
  |  Branch (5626:9): [True: 8.85k, False: 1.36k]
  ------------------
 5627|  10.2k|        ss->vrange.max > SSL_LIBRARY_VERSION_3_0 &&
  ------------------
  |  |   17|  19.0k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (5627:9): [True: 8.85k, False: 0]
  ------------------
 5628|  10.2k|        ss->opt.enableChXtnPermutation) {
  ------------------
  |  Branch (5628:9): [True: 4.48k, False: 4.36k]
  ------------------
 5629|  4.48k|        rv = tls_ClientHelloExtensionPermutationSetup(ss);
 5630|  4.48k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5630:13): [True: 0, False: 4.48k]
  ------------------
 5631|      0|            goto loser;
 5632|      0|        }
 5633|  4.48k|    }
 5634|       |
 5635|  10.2k|    if (isTLS || (ss->firstHsDone && ss->peerRequestedProtection)) {
  ------------------
  |  Branch (5635:9): [True: 10.2k, False: 0]
  |  Branch (5635:19): [True: 0, False: 0]
  |  Branch (5635:38): [True: 0, False: 0]
  ------------------
 5636|  10.2k|        rv = ssl_ConstructExtensions(ss, &extensionBuf, ssl_hs_client_hello);
 5637|  10.2k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5637:13): [True: 0, False: 10.2k]
  ------------------
 5638|      0|            goto loser;
 5639|      0|        }
 5640|  10.2k|    }
 5641|       |
 5642|  10.2k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  10.2k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
 5643|  10.2k|        ssl3_DisableNonDTLSSuites(ss);
 5644|  10.2k|    }
 5645|       |
 5646|  10.2k|    rv = ssl3_CreateClientHelloPreamble(ss, sid, requestingResume, version,
 5647|  10.2k|                                        PR_FALSE, &extensionBuf, &chBuf);
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
 5648|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5648:9): [True: 0, False: 10.2k]
  ------------------
 5649|      0|        goto loser; /* err set by ssl3_CreateClientHelloPreamble. */
 5650|      0|    }
 5651|       |
 5652|  10.2k|    if (!ss->ssl3.hs.echHpkeCtx) {
  ------------------
  |  Branch (5652:9): [True: 10.2k, False: 0]
  ------------------
 5653|  10.2k|        if (extensionBuf.len) {
  ------------------
  |  Branch (5653:13): [True: 10.2k, False: 0]
  ------------------
 5654|  10.2k|            rv = tls13_MaybeGreaseEch(ss, &chBuf, &extensionBuf);
 5655|  10.2k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5655:17): [True: 0, False: 10.2k]
  ------------------
 5656|      0|                goto loser; /* err set by tls13_MaybeGreaseEch. */
 5657|      0|            }
 5658|  10.2k|            rv = ssl_InsertPaddingExtension(ss, chBuf.len, &extensionBuf);
 5659|  10.2k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5659:17): [True: 0, False: 10.2k]
  ------------------
 5660|      0|                goto loser; /* err set by ssl_InsertPaddingExtension. */
 5661|      0|            }
 5662|       |
 5663|  10.2k|            rv = ssl3_InsertChHeaderSize(ss, &chBuf, &extensionBuf);
 5664|  10.2k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5664:17): [True: 0, False: 10.2k]
  ------------------
 5665|      0|                goto loser; /* err set by ssl3_InsertChHeaderSize. */
 5666|      0|            }
 5667|       |
 5668|       |            /* If we are sending a PSK binder, replace the dummy value. */
 5669|  10.2k|            if (ssl3_ExtensionAdvertised(ss, ssl_tls13_pre_shared_key_xtn)) {
  ------------------
  |  Branch (5669:17): [True: 4.46k, False: 5.75k]
  ------------------
 5670|  4.46k|                rv = tls13_WriteExtensionsWithBinder(ss, &extensionBuf, &chBuf);
 5671|  5.75k|            } else {
 5672|  5.75k|                rv = sslBuffer_AppendNumber(&chBuf, extensionBuf.len, 2);
 5673|  5.75k|                if (rv != SECSuccess) {
  ------------------
  |  Branch (5673:21): [True: 0, False: 5.75k]
  ------------------
 5674|      0|                    goto loser;
 5675|      0|                }
 5676|  5.75k|                rv = sslBuffer_AppendBuffer(&chBuf, &extensionBuf);
 5677|  5.75k|            }
 5678|  10.2k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5678:17): [True: 0, False: 10.2k]
  ------------------
 5679|      0|                goto loser; /* err set by sslBuffer_Append*. */
 5680|      0|            }
 5681|  10.2k|        }
 5682|       |
 5683|       |        /* If we already have a message in place, we need to enqueue it.
 5684|       |         * This empties the buffer. This is a convenient place to call
 5685|       |         * dtls_StageHandshakeMessage to mark the message boundary.  */
 5686|  10.2k|        if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  10.2k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
 5687|  10.2k|            rv = dtls_StageHandshakeMessage(ss);
 5688|  10.2k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5688:17): [True: 0, False: 10.2k]
  ------------------
 5689|      0|                goto loser;
 5690|      0|            }
 5691|  10.2k|        }
 5692|       |
 5693|       |        /* As here the function takes the full message and hashes it in one go,
 5694|       |         * For DTLS1.3, we skip hashing the unnecessary header fields.
 5695|       |         * See ssl3_AppendHandshakeHeader. */
 5696|  10.2k|        if (IS_DTLS(ss) && ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |  892|  20.4k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
                      if (IS_DTLS(ss) && ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (5696:28): [True: 8.81k, False: 1.40k]
  ------------------
 5697|  8.81k|            rv = ssl3_AppendHandshakeSuppressHash(ss, chBuf.buf, chBuf.len);
 5698|  8.81k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5698:17): [True: 0, False: 8.81k]
  ------------------
 5699|      0|                goto loser; /* code set */
 5700|      0|            }
 5701|  8.81k|            if (!ss->firstHsDone) {
  ------------------
  |  Branch (5701:17): [True: 8.81k, False: 0]
  ------------------
 5702|  8.81k|                PORT_Assert(type == client_hello_retransmit ||
  ------------------
  |  |  120|  8.81k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  17.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 330, False: 8.48k]
  |  |  |  |  |  Branch (208:7): [True: 8.48k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5703|  8.81k|                            ss->ssl3.hs.dtls13ClientMessageBuffer.len == 0);
 5704|  8.81k|                sslBuffer_Clear(&ss->ssl3.hs.dtls13ClientMessageBuffer);
 5705|       |                /* Here instead of computing the hash, we copy the data to a buffer.*/
 5706|  8.81k|                rv = sslBuffer_Append(&ss->ssl3.hs.dtls13ClientMessageBuffer, chBuf.buf, chBuf.len);
 5707|  8.81k|            }
 5708|  8.81k|        } else {
 5709|  1.40k|            rv = ssl3_AppendHandshake(ss, chBuf.buf, chBuf.len);
 5710|  1.40k|        }
 5711|       |
 5712|  10.2k|    } else {
 5713|      0|        PORT_Assert(!IS_DTLS(ss));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5714|      0|        rv = tls13_ConstructClientHelloWithEch(ss, sid, !requestingResume, &chBuf, &extensionBuf);
 5715|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5715:13): [True: 0, False: 0]
  ------------------
 5716|      0|            goto loser; /* code set */
 5717|      0|        }
 5718|      0|        rv = ssl3_UpdateDefaultHandshakeHashes(ss, chBuf.buf, chBuf.len);
 5719|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5719:13): [True: 0, False: 0]
  ------------------
 5720|      0|            goto loser; /* code set */
 5721|      0|        }
 5722|       |
 5723|      0|        if (IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5724|      0|            rv = dtls_StageHandshakeMessage(ss);
 5725|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5725:17): [True: 0, False: 0]
  ------------------
 5726|      0|                goto loser;
 5727|      0|            }
 5728|      0|        }
 5729|       |        /* By default, all messagess are added to both the inner and
 5730|       |         * outer transcripts. For CH (or CH2 if HRR), that's problematic. */
 5731|      0|        rv = ssl3_AppendHandshakeSuppressHash(ss, chBuf.buf, chBuf.len);
 5732|      0|    }
 5733|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5733:9): [True: 0, False: 10.2k]
  ------------------
 5734|      0|        goto loser;
 5735|      0|    }
 5736|       |
 5737|  10.2k|    if (unlockNeeded) {
  ------------------
  |  Branch (5737:9): [True: 0, False: 10.2k]
  ------------------
 5738|       |        /* Note: goto loser can't be used past this point. */
 5739|      0|        PR_RWLock_Unlock(sid->u.ssl3.lock);
 5740|      0|    }
 5741|       |
 5742|  10.2k|    if (ss->xtnData.sentSessionTicketInClientHello) {
  ------------------
  |  Branch (5742:9): [True: 0, False: 10.2k]
  ------------------
 5743|      0|        SSL_AtomicIncrementLong(&ssl3stats.sch_sid_stateless_resumes);
 5744|      0|    }
 5745|       |
 5746|  10.2k|    if (ss->ssl3.hs.sendingSCSV) {
  ------------------
  |  Branch (5746:9): [True: 0, False: 10.2k]
  ------------------
 5747|       |        /* Since we sent the SCSV, pretend we sent empty RI extension. */
 5748|      0|        TLSExtensionData *xtnData = &ss->xtnData;
 5749|      0|        xtnData->advertised[xtnData->numAdvertised++] =
 5750|      0|            ssl_renegotiation_info_xtn;
 5751|      0|    }
 5752|       |
 5753|  10.2k|    flags = 0;
 5754|  10.2k|    rv = ssl3_FlushHandshake(ss, flags);
 5755|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5755:9): [True: 0, False: 10.2k]
  ------------------
 5756|      0|        return rv; /* error code set by ssl3_FlushHandshake */
 5757|      0|    }
 5758|       |
 5759|  10.2k|    if (version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (5759:9): [True: 8.81k, False: 1.40k]
  ------------------
 5760|  8.81k|        rv = tls13_MaybeDo0RTTHandshake(ss);
 5761|  8.81k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5761:13): [True: 0, False: 8.81k]
  ------------------
 5762|      0|            return SECFailure; /* error code set already. */
 5763|      0|        }
 5764|  8.81k|    }
 5765|       |
 5766|  10.2k|    ss->ssl3.hs.ws = wait_server_hello;
 5767|  10.2k|    sslBuffer_Clear(&chBuf);
 5768|  10.2k|    sslBuffer_Clear(&extensionBuf);
 5769|  10.2k|    return SECSuccess;
 5770|       |
 5771|      0|loser:
 5772|      0|    if (unlockNeeded) {
  ------------------
  |  Branch (5772:9): [True: 0, False: 0]
  ------------------
 5773|      0|        PR_RWLock_Unlock(sid->u.ssl3.lock);
 5774|      0|    }
 5775|      0|    sslBuffer_Clear(&chBuf);
 5776|      0|    sslBuffer_Clear(&extensionBuf);
 5777|      0|    return SECFailure;
 5778|  10.2k|}
ssl_FreeSymWrapKeysLock:
 5997|      1|{
 5998|      1|    if (symWrapKeysLock) {
  ------------------
  |  Branch (5998:9): [True: 1, False: 0]
  ------------------
 5999|      1|        PZ_DestroyLock(symWrapKeysLock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
 6000|      1|        symWrapKeysLock = NULL;
 6001|      1|        return SECSuccess;
 6002|      1|    }
 6003|      0|    PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 6004|      0|    return SECFailure;
 6005|      1|}
ssl_InitSymWrapKeysLock:
 6034|      1|{
 6035|      1|    symWrapKeysLock = PZ_NewLock(nssILockOther);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 6036|      1|    return symWrapKeysLock ? SECSuccess : SECFailure;
  ------------------
  |  Branch (6036:12): [True: 1, False: 0]
  ------------------
 6037|      1|}
ssl_AppendPaddedDHKeyShare:
 6414|  1.28k|{
 6415|  1.28k|    SECStatus rv;
 6416|  1.28k|    unsigned int pad = pubKey->u.dh.prime.len - pubKey->u.dh.publicValue.len;
 6417|       |
 6418|  1.28k|    if (appendLength) {
  ------------------
  |  Branch (6418:9): [True: 411, False: 874]
  ------------------
 6419|    411|        rv = sslBuffer_AppendNumber(buf, pubKey->u.dh.prime.len, 2);
 6420|    411|        if (rv != SECSuccess) {
  ------------------
  |  Branch (6420:13): [True: 0, False: 411]
  ------------------
 6421|      0|            return rv;
 6422|      0|        }
 6423|    411|    }
 6424|  22.5k|    while (pad) {
  ------------------
  |  Branch (6424:12): [True: 21.2k, False: 1.28k]
  ------------------
 6425|  21.2k|        rv = sslBuffer_AppendNumber(buf, 0, 1);
 6426|  21.2k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (6426:13): [True: 0, False: 21.2k]
  ------------------
 6427|      0|            return rv;
 6428|      0|        }
 6429|  21.2k|        --pad;
 6430|  21.2k|    }
 6431|  1.28k|    rv = sslBuffer_Append(buf, pubKey->u.dh.publicValue.data,
 6432|  1.28k|                          pubKey->u.dh.publicValue.len);
 6433|  1.28k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6433:9): [True: 0, False: 1.28k]
  ------------------
 6434|      0|        return rv;
 6435|      0|    }
 6436|  1.28k|    return SECSuccess;
 6437|  1.28k|}
ssl3_SetupCipherSuite:
 6920|  7.64k|{
 6921|  7.64k|    ss->ssl3.hs.suite_def = ssl_LookupCipherSuiteDef(ss->ssl3.hs.cipher_suite);
 6922|  7.64k|    if (!ss->ssl3.hs.suite_def) {
  ------------------
  |  Branch (6922:9): [True: 0, False: 7.64k]
  ------------------
 6923|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6924|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 6925|      0|        return SECFailure;
 6926|      0|    }
 6927|       |
 6928|  7.64k|    ss->ssl3.hs.kea_def = &kea_defs[ss->ssl3.hs.suite_def->key_exchange_alg];
 6929|  7.64k|    ss->ssl3.hs.preliminaryInfo |= ssl_preinfo_cipher_suite;
  ------------------
  |  |  393|  7.64k|#define ssl_preinfo_cipher_suite (1U << 1)
  ------------------
 6930|       |
 6931|  7.64k|    if (!initHashes) {
  ------------------
  |  Branch (6931:9): [True: 998, False: 6.64k]
  ------------------
 6932|    998|        return SECSuccess;
 6933|    998|    }
 6934|       |    /* Now we have a cipher suite, initialize the handshake hashes. */
 6935|  6.64k|    return ssl3_InitHandshakeHashes(ss);
 6936|  7.64k|}
ssl_ClientSetCipherSuite:
 6941|  7.67k|{
 6942|  7.67k|    unsigned int i;
 6943|  7.67k|    if (ssl3_config_match_init(ss) == 0) {
  ------------------
  |  Branch (6943:9): [True: 0, False: 7.67k]
  ------------------
 6944|      0|        PORT_Assert(PR_FALSE);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6945|      0|        return SECFailure;
 6946|      0|    }
 6947|   207k|    for (i = 0; i < ssl_V3_SUITES_IMPLEMENTED; i++) {
  ------------------
  |  |  245|   207k|#define ssl_V3_SUITES_IMPLEMENTED 71
  ------------------
  |  Branch (6947:17): [True: 207k, False: 14]
  ------------------
 6948|   207k|        ssl3CipherSuiteCfg *suiteCfg = &ss->cipherSuites[i];
 6949|   207k|        if (suite == suiteCfg->cipher_suite) {
  ------------------
  |  Branch (6949:13): [True: 7.66k, False: 199k]
  ------------------
 6950|  7.66k|            SSLVersionRange vrange = { version, version };
 6951|  7.66k|            if (!ssl3_config_match(suiteCfg, ss->ssl3.policy, &vrange, ss)) {
  ------------------
  |  Branch (6951:17): [True: 16, False: 7.64k]
  ------------------
 6952|       |                /* config_match already checks whether the cipher suite is
 6953|       |                 * acceptable for the version, but the check is repeated here
 6954|       |                 * in order to give a more precise error code. */
 6955|     16|                if (!ssl3_CipherSuiteAllowedForVersionRange(suite, &vrange)) {
  ------------------
  |  Branch (6955:21): [True: 11, False: 5]
  ------------------
 6956|     11|                    PORT_SetError(SSL_ERROR_CIPHER_DISALLOWED_FOR_VERSION);
  ------------------
  |  |   65|     11|#define PORT_SetError PORT_SetError_Util
  ------------------
 6957|     11|                } else {
 6958|      5|                    PORT_SetError(SSL_ERROR_NO_CYPHER_OVERLAP);
  ------------------
  |  |   65|      5|#define PORT_SetError PORT_SetError_Util
  ------------------
 6959|      5|                }
 6960|     16|                return SECFailure;
 6961|     16|            }
 6962|  7.64k|            break;
 6963|  7.66k|        }
 6964|   207k|    }
 6965|  7.66k|    if (i >= ssl_V3_SUITES_IMPLEMENTED) {
  ------------------
  |  |  245|  7.66k|#define ssl_V3_SUITES_IMPLEMENTED 71
  ------------------
  |  Branch (6965:9): [True: 14, False: 7.64k]
  ------------------
 6966|     14|        PORT_SetError(SSL_ERROR_NO_CYPHER_OVERLAP);
  ------------------
  |  |   65|     14|#define PORT_SetError PORT_SetError_Util
  ------------------
 6967|     14|        return SECFailure;
 6968|     14|    }
 6969|       |
 6970|       |    /* Don't let the server change its mind. */
 6971|  7.64k|    if (ss->ssl3.hs.helloRetry && suite != ss->ssl3.hs.cipher_suite) {
  ------------------
  |  Branch (6971:9): [True: 769, False: 6.87k]
  |  Branch (6971:35): [True: 2, False: 767]
  ------------------
 6972|      2|        (void)SSL3_SendAlert(ss, alert_fatal, illegal_parameter);
 6973|      2|        PORT_SetError(SSL_ERROR_RX_MALFORMED_SERVER_HELLO);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
 6974|      2|        return SECFailure;
 6975|      2|    }
 6976|       |
 6977|  7.64k|    ss->ssl3.hs.cipher_suite = (ssl3CipherSuite)suite;
 6978|  7.64k|    return ssl3_SetupCipherSuite(ss, initHashes);
 6979|  7.64k|}
ssl3_ParseCertificateRequestCAs:
 7776|    152|{
 7777|    152|    PRUint32 remaining;
 7778|    152|    int nnames = 0;
 7779|    152|    dnameNode *node;
 7780|    152|    SECStatus rv;
 7781|    152|    int i;
 7782|       |
 7783|    152|    rv = ssl3_ConsumeHandshakeNumber(ss, &remaining, 2, b, length);
 7784|    152|    if (rv != SECSuccess)
  ------------------
  |  Branch (7784:9): [True: 9, False: 143]
  ------------------
 7785|      9|        return SECFailure; /* malformed, alert has been sent */
 7786|       |
 7787|    143|    if (remaining > *length)
  ------------------
  |  Branch (7787:9): [True: 79, False: 64]
  ------------------
 7788|     79|        goto alert_loser;
 7789|       |
 7790|     64|    ca_list->head = node = PORT_ArenaZNew(ca_list->arena, dnameNode);
  ------------------
  |  |  155|     64|    (type *)PORT_ArenaZAlloc(poolp, sizeof(type))
  |  |  ------------------
  |  |  |  |   59|     64|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  |  |  ------------------
  ------------------
 7791|     64|    if (node == NULL)
  ------------------
  |  Branch (7791:9): [True: 0, False: 64]
  ------------------
 7792|      0|        goto no_mem;
 7793|       |
 7794|    191|    while (remaining > 0) {
  ------------------
  |  Branch (7794:12): [True: 167, False: 24]
  ------------------
 7795|    167|        PRUint32 len;
 7796|       |
 7797|    167|        if (remaining < 2)
  ------------------
  |  Branch (7797:13): [True: 1, False: 166]
  ------------------
 7798|      1|            goto alert_loser; /* malformed */
 7799|       |
 7800|    166|        rv = ssl3_ConsumeHandshakeNumber(ss, &len, 2, b, length);
 7801|    166|        if (rv != SECSuccess)
  ------------------
  |  Branch (7801:13): [True: 0, False: 166]
  ------------------
 7802|      0|            return SECFailure; /* malformed, alert has been sent */
 7803|    166|        if (len == 0 || remaining < len + 2)
  ------------------
  |  Branch (7803:13): [True: 5, False: 161]
  |  Branch (7803:25): [True: 28, False: 133]
  ------------------
 7804|     33|            goto alert_loser; /* malformed */
 7805|       |
 7806|    133|        remaining -= 2;
 7807|    133|        if (SECITEM_MakeItem(ca_list->arena, &node->name, *b, len) != SECSuccess) {
  ------------------
  |  Branch (7807:13): [True: 0, False: 133]
  ------------------
 7808|      0|            goto no_mem;
 7809|      0|        }
 7810|    133|        node->name.len = len;
 7811|    133|        *b += len;
 7812|    133|        *length -= len;
 7813|    133|        remaining -= len;
 7814|    133|        nnames++;
 7815|    133|        if (remaining <= 0)
  ------------------
  |  Branch (7815:13): [True: 6, False: 127]
  ------------------
 7816|      6|            break; /* success */
 7817|       |
 7818|    127|        node->next = PORT_ArenaZNew(ca_list->arena, dnameNode);
  ------------------
  |  |  155|    127|    (type *)PORT_ArenaZAlloc(poolp, sizeof(type))
  |  |  ------------------
  |  |  |  |   59|    127|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  |  |  ------------------
  ------------------
 7819|    127|        node = node->next;
 7820|    127|        if (node == NULL)
  ------------------
  |  Branch (7820:13): [True: 0, False: 127]
  ------------------
 7821|      0|            goto no_mem;
 7822|    127|    }
 7823|       |
 7824|     30|    ca_list->nnames = nnames;
 7825|     30|    ca_list->names = PORT_ArenaNewArray(ca_list->arena, SECItem, nnames);
  ------------------
  |  |  161|     30|    (type *)PORT_ArenaAlloc(poolp, sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   53|     30|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  |  |  ------------------
  ------------------
 7826|     30|    if (nnames > 0 && ca_list->names == NULL)
  ------------------
  |  Branch (7826:9): [True: 6, False: 24]
  |  Branch (7826:23): [True: 0, False: 6]
  ------------------
 7827|      0|        goto no_mem;
 7828|       |
 7829|     30|    for (i = 0, node = (dnameNode *)ca_list->head;
 7830|     77|         i < nnames;
  ------------------
  |  Branch (7830:10): [True: 47, False: 30]
  ------------------
 7831|     47|         i++, node = node->next) {
 7832|     47|        ca_list->names[i] = node->name;
 7833|     47|    }
 7834|       |
 7835|     30|    return SECSuccess;
 7836|       |
 7837|      0|no_mem:
 7838|      0|    return SECFailure;
 7839|       |
 7840|    113|alert_loser:
 7841|    113|    (void)SSL3_SendAlert(ss, alert_fatal,
 7842|    113|                         ss->version < SSL_LIBRARY_VERSION_TLS_1_0 ? illegal_parameter
  ------------------
  |  |   18|    113|#define SSL_LIBRARY_VERSION_TLS_1_0             0x0301
  ------------------
  |  Branch (7842:26): [True: 0, False: 113]
  ------------------
 7843|    113|                                                                   : decode_error);
 7844|    113|    PORT_SetError(SSL_ERROR_RX_MALFORMED_CERT_REQUEST);
  ------------------
  |  |   65|    113|#define PORT_SetError PORT_SetError_Util
  ------------------
 7845|    113|    return SECFailure;
 7846|     30|}
ssl_ParseSignatureSchemes:
 7853|    152|{
 7854|    152|    SECStatus rv;
 7855|    152|    SECItem buf;
 7856|    152|    SSLSignatureScheme *schemes = NULL;
 7857|    152|    unsigned int numSupported = 0;
 7858|    152|    unsigned int numRemaining = 0;
 7859|    152|    unsigned int max;
 7860|       |
 7861|    152|    rv = ssl3_ExtConsumeHandshakeVariable(ss, &buf, 2, b, len);
 7862|    152|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7862:9): [True: 3, False: 149]
  ------------------
 7863|      3|        return SECFailure;
 7864|      3|    }
 7865|       |    /* An odd-length value is invalid. */
 7866|    149|    if ((buf.len & 1) != 0) {
  ------------------
  |  Branch (7866:9): [True: 1, False: 148]
  ------------------
 7867|      1|        ssl3_ExtSendAlert(ss, alert_fatal, decode_error);
 7868|      1|        return SECFailure;
 7869|      1|    }
 7870|       |
 7871|       |    /* Let the caller decide whether to alert here. */
 7872|    148|    if (buf.len == 0) {
  ------------------
  |  Branch (7872:9): [True: 2, False: 146]
  ------------------
 7873|      2|        goto done;
 7874|      2|    }
 7875|       |
 7876|       |    /* Limit the number of schemes we read. */
 7877|    146|    numRemaining = buf.len / 2;
 7878|    146|    max = PR_MIN(numRemaining, MAX_SIGNATURE_SCHEMES);
  ------------------
  |  |  158|    146|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 90, False: 56]
  |  |  ------------------
  ------------------
 7879|       |
 7880|    146|    if (arena) {
  ------------------
  |  Branch (7880:9): [True: 146, False: 0]
  ------------------
 7881|    146|        schemes = PORT_ArenaZNewArray(arena, SSLSignatureScheme, max);
  ------------------
  |  |  163|    146|    (type *)PORT_ArenaZAlloc(poolp, sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   59|    146|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  |  |  ------------------
  ------------------
 7882|    146|    } else {
 7883|      0|        schemes = PORT_ZNewArray(SSLSignatureScheme, max);
  ------------------
  |  |  159|      0|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 7884|      0|    }
 7885|    146|    if (!schemes) {
  ------------------
  |  Branch (7885:9): [True: 0, False: 146]
  ------------------
 7886|      0|        ssl3_ExtSendAlert(ss, alert_fatal, internal_error);
 7887|      0|        return SECFailure;
 7888|      0|    }
 7889|       |
 7890|  22.6k|    for (; numRemaining && numSupported < MAX_SIGNATURE_SCHEMES; --numRemaining) {
  ------------------
  |  |  250|  22.5k|#define MAX_SIGNATURE_SCHEMES 18
  ------------------
  |  Branch (7890:12): [True: 22.5k, False: 127]
  |  Branch (7890:28): [True: 22.5k, False: 19]
  ------------------
 7891|  22.5k|        PRUint32 tmp;
 7892|  22.5k|        rv = ssl3_ExtConsumeHandshakeNumber(ss, &tmp, 2, &buf.data, &buf.len);
 7893|  22.5k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7893:13): [True: 0, False: 22.5k]
  ------------------
 7894|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7895|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 7896|      0|            return SECFailure;
 7897|      0|        }
 7898|  22.5k|        if (ssl_SignatureSchemeValid((SSLSignatureScheme)tmp, SEC_OID_UNKNOWN,
  ------------------
  |  Branch (7898:13): [True: 898, False: 21.6k]
  ------------------
 7899|  22.5k|                                     (PRBool)ss->version >= SSL_LIBRARY_VERSION_TLS_1_3)) {
  ------------------
  |  |   21|  22.5k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
 7900|    898|            ;
 7901|    898|            schemes[numSupported++] = (SSLSignatureScheme)tmp;
 7902|    898|        }
 7903|  22.5k|    }
 7904|       |
 7905|    146|    if (!numSupported) {
  ------------------
  |  Branch (7905:9): [True: 8, False: 138]
  ------------------
 7906|      8|        if (!arena) {
  ------------------
  |  Branch (7906:13): [True: 0, False: 8]
  ------------------
 7907|      0|            PORT_Free(schemes);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 7908|      0|        }
 7909|      8|        schemes = NULL;
 7910|      8|    }
 7911|       |
 7912|    148|done:
 7913|    148|    *schemesOut = schemes;
 7914|    148|    *numSchemesOut = numSupported;
 7915|    148|    return SECSuccess;
 7916|    146|}
ssl3_BeginHandleCertificateRequest:
 8083|     19|{
 8084|     19|    SECStatus rv;
 8085|       |
 8086|     19|    PR_ASSERT(!ss->ssl3.hs.clientCertificatePending);
  ------------------
  |  |  208|     19|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 19, False: 0]
  |  |  ------------------
  ------------------
 8087|       |
 8088|       |    /* Should not send a client cert when (non-GREASE) ECH is rejected. */
 8089|     19|    if (ss->ssl3.hs.echHpkeCtx && !ss->ssl3.hs.echAccepted) {
  ------------------
  |  Branch (8089:9): [True: 0, False: 19]
  |  Branch (8089:35): [True: 0, False: 0]
  ------------------
 8090|      0|        PORT_Assert(ssl3_ExtensionAdvertised(ss, ssl_tls13_encrypted_client_hello_xtn));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8091|      0|        rv = SECFailure;
 8092|     19|    } else if (ss->getClientAuthData != NULL) {
  ------------------
  |  Branch (8092:16): [True: 0, False: 19]
  ------------------
 8093|      0|        PORT_Assert(signatureSchemes || !signatureSchemeCount);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8094|      0|        PORT_Assert((ss->ssl3.hs.preliminaryInfo & ssl_preinfo_all) ==
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8095|      0|                    ssl_preinfo_all);
 8096|      0|        PORT_Assert(ss->ssl3.clientPrivateKey == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8097|      0|        PORT_Assert(ss->ssl3.clientCertificate == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8098|      0|        PORT_Assert(ss->ssl3.clientCertChain == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8099|       |
 8100|       |        /* Previously cached parameters should be empty */
 8101|      0|        PORT_Assert(ss->ssl3.hs.clientAuthSignatureSchemes == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8102|      0|        PORT_Assert(ss->ssl3.hs.clientAuthSignatureSchemesLen == 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8103|       |        /*
 8104|       |         * Peer signatures are only available while in the context of
 8105|       |         * of a getClientAuthData callback. It is required for proper
 8106|       |         * functioning of SSL_CertIsUsable and SSL_FilterClientCertListBySocket
 8107|       |         * Calling these functions outside the context of a getClientAuthData
 8108|       |         * callback will result in no filtering.*/
 8109|       |
 8110|      0|        ss->ssl3.hs.clientAuthSignatureSchemes = PORT_ZNewArray(SSLSignatureScheme, signatureSchemeCount);
  ------------------
  |  |  159|      0|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 8111|      0|        if (signatureSchemes) {
  ------------------
  |  Branch (8111:13): [True: 0, False: 0]
  ------------------
 8112|      0|            PORT_Memcpy(ss->ssl3.hs.clientAuthSignatureSchemes, signatureSchemes, signatureSchemeCount * sizeof(SSLSignatureScheme));
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
 8113|      0|        }
 8114|      0|        ss->ssl3.hs.clientAuthSignatureSchemesLen = signatureSchemeCount;
 8115|       |
 8116|      0|        rv = (SECStatus)(*ss->getClientAuthData)(ss->getClientAuthDataArg,
 8117|      0|                                                 ss->fd, ca_list,
 8118|      0|                                                 &ss->ssl3.clientCertificate,
 8119|      0|                                                 &ss->ssl3.clientPrivateKey);
 8120|     19|    } else {
 8121|     19|        rv = SECFailure; /* force it to send a no_certificate alert */
 8122|     19|    }
 8123|       |
 8124|     19|    if (rv == SECWouldBlock) {
  ------------------
  |  Branch (8124:9): [True: 0, False: 19]
  ------------------
 8125|       |        /* getClientAuthData needs more time (e.g. for user interaction) */
 8126|       |
 8127|       |        /* The out parameters should not have changed. */
 8128|      0|        PORT_Assert(ss->ssl3.clientCertificate == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8129|      0|        PORT_Assert(ss->ssl3.clientPrivateKey == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8130|       |
 8131|       |        /* Mark the handshake as blocked */
 8132|      0|        ss->ssl3.hs.clientCertificatePending = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 8133|       |
 8134|      0|        rv = SECSuccess;
 8135|     19|    } else {
 8136|       |        /* getClientAuthData returned SECSuccess or SECFailure immediately, handle accordingly */
 8137|     19|        ssl3_ClientAuthCallbackOutcome(ss, rv);
 8138|     19|        rv = SECSuccess;
 8139|     19|    }
 8140|     19|    return rv;
 8141|     19|}
ssl3_WaitingForServerSecondRound:
 8230|  3.64k|{
 8231|  3.64k|    PRBool result;
 8232|       |
 8233|  3.64k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  3.64k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.74k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.55k, False: 2.09k]
  |  |  |  |  |  Branch (208:7): [True: 2.09k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8234|       |
 8235|  3.64k|    switch (ss->ssl3.hs.ws) {
 8236|    225|        case wait_new_session_ticket:
  ------------------
  |  Branch (8236:9): [True: 225, False: 3.42k]
  ------------------
 8237|  2.84k|        case wait_change_cipher:
  ------------------
  |  Branch (8237:9): [True: 2.62k, False: 1.02k]
  ------------------
 8238|  3.64k|        case wait_finished:
  ------------------
  |  Branch (8238:9): [True: 800, False: 2.84k]
  ------------------
 8239|  3.64k|            result = PR_TRUE;
  ------------------
  |  |  437|  3.64k|#define PR_TRUE 1
  ------------------
 8240|  3.64k|            break;
 8241|      0|        default:
  ------------------
  |  Branch (8241:9): [True: 0, False: 3.64k]
  ------------------
 8242|      0|            result = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8243|      0|            break;
 8244|  3.64k|    }
 8245|       |
 8246|  3.64k|    return result;
 8247|  3.64k|}
ssl3_NewSessionID:
 8482|  25.5k|{
 8483|  25.5k|    sslSessionID *sid;
 8484|       |
 8485|  25.5k|    sid = PORT_ZNew(sslSessionID);
  ------------------
  |  |  148|  25.5k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  25.5k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 8486|  25.5k|    if (sid == NULL)
  ------------------
  |  Branch (8486:9): [True: 0, False: 25.5k]
  ------------------
 8487|      0|        return sid;
 8488|       |
 8489|  25.5k|    if (is_server) {
  ------------------
  |  Branch (8489:9): [True: 0, False: 25.5k]
  ------------------
 8490|      0|        const SECItem *srvName;
 8491|      0|        SECStatus rv = SECSuccess;
 8492|       |
 8493|      0|        ssl_GetSpecReadLock(ss); /********************************/
  ------------------
  |  | 1422|      0|    {                                           \
  |  | 1423|      0|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1424|      0|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|      0|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|      0|    }
  ------------------
 8494|      0|        srvName = &ss->ssl3.hs.srvVirtName;
 8495|      0|        if (srvName->len && srvName->data) {
  ------------------
  |  Branch (8495:13): [True: 0, False: 0]
  |  Branch (8495:29): [True: 0, False: 0]
  ------------------
 8496|      0|            rv = SECITEM_CopyItem(NULL, &sid->u.ssl3.srvName, srvName);
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 8497|      0|        }
 8498|      0|        ssl_ReleaseSpecReadLock(ss); /************************************/
  ------------------
  |  | 1427|      0|    {                                             \
  |  | 1428|      0|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1429|      0|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|      0|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|      0|    }
  ------------------
 8499|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (8499:13): [True: 0, False: 0]
  ------------------
 8500|      0|            PORT_Free(sid);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 8501|      0|            return NULL;
 8502|      0|        }
 8503|      0|    }
 8504|  25.5k|    sid->peerID = (ss->peerID == NULL) ? NULL : PORT_Strdup(ss->peerID);
  ------------------
  |  |   69|      0|#define PORT_Strdup PORT_Strdup_Util
  ------------------
  |  Branch (8504:19): [True: 25.5k, False: 0]
  ------------------
 8505|  25.5k|    sid->urlSvrName = (ss->url == NULL) ? NULL : PORT_Strdup(ss->url);
  ------------------
  |  |   69|  25.5k|#define PORT_Strdup PORT_Strdup_Util
  ------------------
  |  Branch (8505:23): [True: 0, False: 25.5k]
  ------------------
 8506|  25.5k|    sid->addr = ss->sec.ci.peer;
 8507|  25.5k|    sid->port = ss->sec.ci.port;
 8508|  25.5k|    sid->references = 1;
 8509|  25.5k|    sid->cached = never_cached;
 8510|  25.5k|    sid->version = ss->version;
 8511|  25.5k|    sid->sigScheme = ssl_sig_none;
 8512|       |
 8513|  25.5k|    sid->u.ssl3.keys.resumable = PR_TRUE;
  ------------------
  |  |  437|  25.5k|#define PR_TRUE 1
  ------------------
 8514|  25.5k|    sid->u.ssl3.policy = SSL_ALLOWED;
  ------------------
  |  |  700|  25.5k|#define SSL_ALLOWED 1
  ------------------
 8515|  25.5k|    sid->u.ssl3.keys.extendedMasterSecretUsed = PR_FALSE;
  ------------------
  |  |  438|  25.5k|#define PR_FALSE 0
  ------------------
 8516|       |
 8517|  25.5k|    if (is_server) {
  ------------------
  |  Branch (8517:9): [True: 0, False: 25.5k]
  ------------------
 8518|      0|        SECStatus rv;
 8519|      0|        int pid = SSL_GETPID();
  ------------------
  |  | 2059|      0|#define SSL_GETPID getpid
  ------------------
 8520|       |
 8521|      0|        sid->u.ssl3.sessionIDLength = SSL3_SESSIONID_BYTES;
  ------------------
  |  |  107|      0|#define SSL3_SESSIONID_BYTES 32
  ------------------
 8522|      0|        sid->u.ssl3.sessionID[0] = (pid >> 8) & 0xff;
 8523|      0|        sid->u.ssl3.sessionID[1] = pid & 0xff;
 8524|      0|        rv = PK11_GenerateRandom(sid->u.ssl3.sessionID + 2,
 8525|      0|                                 SSL3_SESSIONID_BYTES - 2);
  ------------------
  |  |  107|      0|#define SSL3_SESSIONID_BYTES 32
  ------------------
 8526|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (8526:13): [True: 0, False: 0]
  ------------------
 8527|      0|            ssl_FreeSID(sid);
 8528|      0|            ssl_MapLowLevelError(SSL_ERROR_GENERATE_RANDOM_FAILURE);
 8529|      0|            return NULL;
 8530|      0|        }
 8531|      0|    }
 8532|  25.5k|    return sid;
 8533|  25.5k|}
ssl_CreateDHEKeyPair:
10150|  1.60k|{
10151|  1.60k|    SECKEYDHParams dhParam;
10152|  1.60k|    SECKEYPublicKey *pubKey = NULL;   /* Ephemeral DH key */
10153|  1.60k|    SECKEYPrivateKey *privKey = NULL; /* Ephemeral DH key */
10154|  1.60k|    sslEphemeralKeyPair *pair;
10155|       |
10156|  1.60k|    dhParam.prime.data = params->prime.data;
10157|  1.60k|    dhParam.prime.len = params->prime.len;
10158|  1.60k|    dhParam.base.data = params->base.data;
10159|  1.60k|    dhParam.base.len = params->base.len;
10160|       |
10161|  1.60k|    PRINT_BUF(60, (NULL, "Server DH p", dhParam.prime.data,
  ------------------
  |  |   74|  1.60k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.60k]
  |  |  ------------------
  |  |   75|  1.60k|    ssl_PrintBuf b
  ------------------
10162|  1.60k|                   dhParam.prime.len));
10163|  1.60k|    PRINT_BUF(60, (NULL, "Server DH g", dhParam.base.data,
  ------------------
  |  |   74|  1.60k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.60k]
  |  |  ------------------
  |  |   75|  1.60k|    ssl_PrintBuf b
  ------------------
10164|  1.60k|                   dhParam.base.len));
10165|       |
10166|       |    /* Generate ephemeral DH keypair */
10167|  1.60k|    privKey = SECKEY_CreateDHPrivateKey(&dhParam, &pubKey, NULL);
10168|  1.60k|    if (!privKey || !pubKey) {
  ------------------
  |  Branch (10168:9): [True: 308, False: 1.29k]
  |  Branch (10168:21): [True: 0, False: 1.29k]
  ------------------
10169|    308|        ssl_MapLowLevelError(SEC_ERROR_KEYGEN_FAIL);
10170|    308|        return SECFailure;
10171|    308|    }
10172|       |
10173|  1.29k|    pair = ssl_NewEphemeralKeyPair(groupDef, privKey, pubKey);
10174|  1.29k|    if (!pair) {
  ------------------
  |  Branch (10174:9): [True: 0, False: 1.29k]
  ------------------
10175|      0|        SECKEY_DestroyPrivateKey(privKey);
10176|      0|        SECKEY_DestroyPublicKey(pubKey);
10177|       |
10178|      0|        return SECFailure;
10179|      0|    }
10180|       |
10181|  1.29k|    *keyPair = pair;
10182|  1.29k|    return SECSuccess;
10183|  1.29k|}
ssl3_EncodeSigAlgs:
10344|  10.0k|{
10345|  10.0k|    SSLSignatureScheme filtered[MAX_SIGNATURE_SCHEMES] = { 0 };
10346|  10.0k|    unsigned int filteredCount = 0;
10347|       |
10348|  10.0k|    SECStatus rv = ssl3_FilterSigAlgs(ss, minVersion, PR_FALSE, forCert,
  ------------------
  |  |  438|  10.0k|#define PR_FALSE 0
  ------------------
10349|  10.0k|                                      PR_ARRAY_SIZE(filtered),
  ------------------
  |  |  167|  10.0k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
10350|  10.0k|                                      filtered, &filteredCount);
10351|  10.0k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (10351:9): [True: 0, False: 10.0k]
  ------------------
10352|      0|        return SECFailure;
10353|      0|    }
10354|  10.0k|    return ssl3_EncodeFilteredSigAlgs(ss, filtered, filteredCount, grease, buf);
10355|  10.0k|}
ssl3_EncodeFilteredSigAlgs:
10360|  14.1k|{
10361|  14.1k|    if (!numSchemes) {
  ------------------
  |  Branch (10361:9): [True: 0, False: 14.1k]
  ------------------
10362|      0|        PORT_SetError(SSL_ERROR_NO_SUPPORTED_SIGNATURE_ALGORITHM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
10363|      0|        return SECFailure;
10364|      0|    }
10365|       |
10366|  14.1k|    unsigned int lengthOffset;
10367|  14.1k|    SECStatus rv;
10368|       |
10369|  14.1k|    rv = sslBuffer_Skip(buf, 2, &lengthOffset);
10370|  14.1k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (10370:9): [True: 0, False: 14.1k]
  ------------------
10371|      0|        return SECFailure;
10372|      0|    }
10373|       |
10374|   177k|    for (unsigned int i = 0; i < numSchemes; ++i) {
  ------------------
  |  Branch (10374:30): [True: 163k, False: 14.1k]
  ------------------
10375|   163k|        rv = sslBuffer_AppendNumber(buf, schemes[i], 2);
10376|   163k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (10376:13): [True: 0, False: 163k]
  ------------------
10377|      0|            return SECFailure;
10378|      0|        }
10379|   163k|    }
10380|       |
10381|       |    /* GREASE SignatureAlgorithms:
10382|       |     * A client MAY select one or more GREASE signature algorithm values and
10383|       |     * advertise them in the "signature_algorithms" or
10384|       |     * "signature_algorithms_cert" extensions, if sent [RFC8701, Section 3.1].
10385|       |     *
10386|       |     * When sending a CertificateRequest in TLS 1.3, a server MAY behave as
10387|       |     * follows: [...] A server MAY select one or more GREASE signature
10388|       |     * algorithm values and advertise them in the "signature_algorithms" or
10389|       |     * "signature_algorithms_cert" extensions, if present
10390|       |     * [RFC8701, Section 4.1]. */
10391|  14.1k|    if (grease &&
  ------------------
  |  Branch (10391:9): [True: 4.96k, False: 9.16k]
  ------------------
10392|  14.1k|        ((!ss->sec.isServer && ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3) ||
  ------------------
  |  |   21|  4.96k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (10392:11): [True: 4.96k, False: 0]
  |  Branch (10392:32): [True: 4.35k, False: 611]
  ------------------
10393|  4.96k|         (ss->sec.isServer && ss->version >= SSL_LIBRARY_VERSION_TLS_1_3))) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (10393:11): [True: 0, False: 611]
  |  Branch (10393:31): [True: 0, False: 0]
  ------------------
10394|  4.35k|        PRUint16 value;
10395|  4.35k|        if (ss->sec.isServer) {
  ------------------
  |  Branch (10395:13): [True: 0, False: 4.35k]
  ------------------
10396|      0|            rv = tls13_RandomGreaseValue(&value);
10397|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (10397:17): [True: 0, False: 0]
  ------------------
10398|      0|                return SECFailure;
10399|      0|            }
10400|  4.35k|        } else {
10401|  4.35k|            value = ss->ssl3.hs.grease->idx[grease_sigalg];
10402|  4.35k|        }
10403|  4.35k|        rv = sslBuffer_AppendNumber(buf, value, 2);
10404|  4.35k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (10404:13): [True: 0, False: 4.35k]
  ------------------
10405|      0|            return SECFailure;
10406|      0|        }
10407|  4.35k|    }
10408|       |
10409|  14.1k|    return sslBuffer_InsertLength(buf, lengthOffset, 2);
10410|  14.1k|}
ssl3_FilterSigAlgs:
10429|  14.1k|{
10430|  14.1k|    PORT_Assert(filteredSchemes);
  ------------------
  |  |  120|  14.1k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.1k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10431|  14.1k|    PORT_Assert(numFilteredSchemes);
  ------------------
  |  |  120|  14.1k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.1k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10432|  14.1k|    PORT_Assert(maxSchemes >= ss->ssl3.signatureSchemeCount);
  ------------------
  |  |  120|  14.1k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.1k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10433|  14.1k|    if (maxSchemes < ss->ssl3.signatureSchemeCount) {
  ------------------
  |  Branch (10433:9): [True: 0, False: 14.1k]
  ------------------
10434|      0|        return SECFailure;
10435|      0|    }
10436|       |
10437|  14.1k|    *numFilteredSchemes = 0;
10438|  14.1k|    PRBool allowUnsortedPkcs1 = forCert && minVersion < SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|  10.0k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (10438:33): [True: 10.0k, False: 4.08k]
  |  Branch (10438:44): [True: 9.09k, False: 952]
  ------------------
10439|   226k|    for (unsigned int i = 0; i < ss->ssl3.signatureSchemeCount; ++i) {
  ------------------
  |  Branch (10439:30): [True: 211k, False: 14.1k]
  ------------------
10440|   211k|        if (disableRsae && ssl_IsRsaeSignatureScheme(ss->ssl3.signatureSchemes[i])) {
  ------------------
  |  Branch (10440:13): [True: 61.3k, False: 150k]
  |  Branch (10440:28): [True: 12.2k, False: 49.0k]
  ------------------
10441|  12.2k|            continue;
10442|  12.2k|        }
10443|   199k|        if (ssl_SignatureSchemeAccepted(minVersion,
  ------------------
  |  Branch (10443:13): [True: 159k, False: 40.3k]
  ------------------
10444|   199k|                                        ss->ssl3.signatureSchemes[i],
10445|   199k|                                        allowUnsortedPkcs1)) {
10446|   159k|            filteredSchemes[(*numFilteredSchemes)++] = ss->ssl3.signatureSchemes[i];
10447|   159k|        }
10448|   199k|    }
10449|  14.1k|    if (forCert && !allowUnsortedPkcs1) {
  ------------------
  |  Branch (10449:9): [True: 10.0k, False: 4.08k]
  |  Branch (10449:20): [True: 952, False: 9.09k]
  ------------------
10450|  15.2k|        for (unsigned int i = 0; i < ss->ssl3.signatureSchemeCount; ++i) {
  ------------------
  |  Branch (10450:34): [True: 14.2k, False: 952]
  ------------------
10451|  14.2k|            if (disableRsae && ssl_IsRsaeSignatureScheme(ss->ssl3.signatureSchemes[i])) {
  ------------------
  |  Branch (10451:17): [True: 0, False: 14.2k]
  |  Branch (10451:32): [True: 0, False: 0]
  ------------------
10452|      0|                continue;
10453|      0|            }
10454|  14.2k|            if (!ssl_SignatureSchemeAccepted(minVersion,
  ------------------
  |  Branch (10454:17): [True: 7.61k, False: 6.66k]
  ------------------
10455|  14.2k|                                             ss->ssl3.signatureSchemes[i],
10456|  14.2k|                                             PR_FALSE) &&
  ------------------
  |  |  438|  14.2k|#define PR_FALSE 0
  ------------------
10457|  14.2k|                ssl_SignatureSchemeAccepted(minVersion,
  ------------------
  |  Branch (10457:17): [True: 3.80k, False: 3.80k]
  ------------------
10458|  7.61k|                                            ss->ssl3.signatureSchemes[i],
10459|  7.61k|                                            PR_TRUE)) {
  ------------------
  |  |  437|  7.61k|#define PR_TRUE 1
  ------------------
10460|  3.80k|                filteredSchemes[(*numFilteredSchemes)++] = ss->ssl3.signatureSchemes[i];
10461|  3.80k|            }
10462|  14.2k|        }
10463|    952|    }
10464|  14.1k|    return SECSuccess;
10465|  14.1k|}
ssl3_SendEmptyCertificate:
11021|     14|{
11022|     14|    SECStatus rv;
11023|     14|    unsigned int len = 0;
11024|     14|    PRBool isTLS13 = PR_FALSE;
  ------------------
  |  |  438|     14|#define PR_FALSE 0
  ------------------
11025|     14|    const SECItem *context;
11026|       |
11027|     14|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|     14|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (11027:9): [True: 0, False: 14]
  ------------------
11028|      0|        PORT_Assert(ss->ssl3.hs.clientCertRequested);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11029|      0|        context = &ss->xtnData.certReqContext;
11030|      0|        len = context->len + 1;
11031|      0|        isTLS13 = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
11032|      0|    }
11033|       |
11034|     14|    rv = ssl3_AppendHandshakeHeader(ss, ssl_hs_certificate, len + 3);
11035|     14|    if (rv != SECSuccess) {
  ------------------
  |  Branch (11035:9): [True: 0, False: 14]
  ------------------
11036|      0|        return rv;
11037|      0|    }
11038|       |
11039|     14|    if (isTLS13) {
  ------------------
  |  Branch (11039:9): [True: 0, False: 14]
  ------------------
11040|      0|        rv = ssl3_AppendHandshakeVariable(ss, context->data, context->len, 1);
11041|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (11041:13): [True: 0, False: 0]
  ------------------
11042|      0|            return rv;
11043|      0|        }
11044|      0|    }
11045|       |
11046|     14|    return ssl3_AppendHandshakeNumber(ss, 0, 3);
11047|     14|}
ssl3_CleanupPeerCerts:
11377|  10.9k|{
11378|  10.9k|    PLArenaPool *arena = ss->ssl3.peerCertArena;
11379|       |
11380|  10.9k|    if (arena)
  ------------------
  |  Branch (11380:9): [True: 5.43k, False: 5.47k]
  ------------------
11381|  5.43k|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|  5.43k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|  5.43k|#define PR_FALSE 0
  ------------------
11382|  10.9k|    ss->ssl3.peerCertArena = NULL;
11383|  10.9k|    ss->ssl3.peerCertChain = NULL;
11384|       |
11385|  10.9k|    if (ss->sec.peerCert != NULL) {
  ------------------
  |  Branch (11385:9): [True: 0, False: 10.9k]
  ------------------
11386|      0|        if (ss->sec.peerKey) {
  ------------------
  |  Branch (11386:13): [True: 0, False: 0]
  ------------------
11387|      0|            SECKEY_DestroyPublicKey(ss->sec.peerKey);
11388|      0|            ss->sec.peerKey = NULL;
11389|      0|        }
11390|      0|        CERT_DestroyCertificate(ss->sec.peerCert);
11391|      0|        ss->sec.peerCert = NULL;
11392|      0|    }
11393|  10.9k|}
ssl_ReadCertificateStatus:
11420|     27|{
11421|     27|    PRUint32 status, len;
11422|     27|    SECStatus rv;
11423|       |
11424|     27|    PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|     27|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     27|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 27, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11425|       |
11426|       |    /* Consume the CertificateStatusType enum */
11427|     27|    rv = ssl3_ConsumeHandshakeNumber(ss, &status, 1, &b, &length);
11428|     27|    if (rv != SECSuccess || status != 1 /* ocsp */) {
  ------------------
  |  Branch (11428:9): [True: 2, False: 25]
  |  Branch (11428:29): [True: 1, False: 24]
  ------------------
11429|      3|        return ssl3_DecodeError(ss);
11430|      3|    }
11431|       |
11432|     24|    rv = ssl3_ConsumeHandshakeNumber(ss, &len, 3, &b, &length);
11433|     24|    if (rv != SECSuccess || len != length) {
  ------------------
  |  Branch (11433:9): [True: 0, False: 24]
  |  Branch (11433:29): [True: 16, False: 8]
  ------------------
11434|     16|        return ssl3_DecodeError(ss);
11435|     16|    }
11436|       |
11437|      8|#define MAX_CERTSTATUS_LEN 0x1ffff /* 128k - 1 */
11438|      8|    if (length > MAX_CERTSTATUS_LEN) {
  ------------------
  |  |11437|      8|#define MAX_CERTSTATUS_LEN 0x1ffff /* 128k - 1 */
  ------------------
  |  Branch (11438:9): [True: 0, False: 8]
  ------------------
11439|      0|        ssl3_DecodeError(ss); /* sets error code */
11440|      0|        return SECFailure;
11441|      0|    }
11442|      8|#undef MAX_CERTSTATUS_LEN
11443|       |
11444|       |    /* Array size 1, because we currently implement single-stapling only */
11445|      8|    SECITEM_AllocArray(NULL, &ss->sec.ci.sid->peerCertStatus, 1);
11446|      8|    if (!ss->sec.ci.sid->peerCertStatus.items)
  ------------------
  |  Branch (11446:9): [True: 0, False: 8]
  ------------------
11447|      0|        return SECFailure; /* code already set */
11448|       |
11449|      8|    ss->sec.ci.sid->peerCertStatus.items[0].data = PORT_Alloc(length);
  ------------------
  |  |   52|      8|#define PORT_Alloc PORT_Alloc_Util
  ------------------
11450|       |
11451|      8|    if (!ss->sec.ci.sid->peerCertStatus.items[0].data) {
  ------------------
  |  Branch (11451:9): [True: 0, False: 8]
  ------------------
11452|      0|        SECITEM_FreeArray(&ss->sec.ci.sid->peerCertStatus, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
11453|      0|        return SECFailure; /* code already set */
11454|      0|    }
11455|       |
11456|      8|    PORT_Memcpy(ss->sec.ci.sid->peerCertStatus.items[0].data, b, length);
  ------------------
  |  |  180|      8|#define PORT_Memcpy memcpy
  ------------------
11457|      8|    ss->sec.ci.sid->peerCertStatus.items[0].len = length;
11458|      8|    ss->sec.ci.sid->peerCertStatus.items[0].type = siBuffer;
11459|      8|    return SECSuccess;
11460|      8|}
ssl3_CompleteHandleCertificate:
11492|  5.47k|{
11493|  5.47k|    ssl3CertNode *c;
11494|  5.47k|    ssl3CertNode *lastCert = NULL;
11495|  5.47k|    PRUint32 remaining = 0;
11496|  5.47k|    PRUint32 size;
11497|  5.47k|    SECStatus rv;
11498|  5.47k|    PRBool isServer = ss->sec.isServer;
11499|  5.47k|    PRBool isTLS;
11500|  5.47k|    SSL3AlertDescription desc;
11501|  5.47k|    int errCode = SSL_ERROR_RX_MALFORMED_CERTIFICATE;
11502|  5.47k|    SECItem certItem;
11503|       |
11504|  5.47k|    ssl3_CleanupPeerCerts(ss);
11505|  5.47k|    isTLS = (PRBool)(ss->ssl3.prSpec->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|  5.47k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
11506|       |
11507|       |    /* It is reported that some TLS client sends a Certificate message
11508|       |    ** with a zero-length message body.  We'll treat that case like a
11509|       |    ** normal no_certificates message to maximize interoperability.
11510|       |    */
11511|  5.47k|    if (length) {
  ------------------
  |  Branch (11511:9): [True: 5.47k, False: 1]
  ------------------
11512|  5.47k|        rv = ssl3_ConsumeHandshakeNumber(ss, &remaining, 3, &b, &length);
11513|  5.47k|        if (rv != SECSuccess)
  ------------------
  |  Branch (11513:13): [True: 1, False: 5.47k]
  ------------------
11514|      1|            goto loser; /* fatal alert already sent by ConsumeHandshake. */
11515|  5.47k|        if (remaining > length)
  ------------------
  |  Branch (11515:13): [True: 36, False: 5.43k]
  ------------------
11516|     36|            goto decode_loser;
11517|  5.47k|    }
11518|       |
11519|  5.43k|    if (!remaining) {
  ------------------
  |  Branch (11519:9): [True: 1, False: 5.43k]
  ------------------
11520|      1|        if (!(isTLS && isServer)) {
  ------------------
  |  Branch (11520:15): [True: 1, False: 0]
  |  Branch (11520:24): [True: 0, False: 1]
  ------------------
11521|      1|            desc = bad_certificate;
11522|      1|            goto alert_loser;
11523|      1|        }
11524|       |        /* This is TLS's version of a no_certificate alert. */
11525|       |        /* I'm a server. I've requested a client cert. He hasn't got one. */
11526|      0|        rv = ssl3_HandleNoCertificate(ss);
11527|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (11527:13): [True: 0, False: 0]
  ------------------
11528|      0|            errCode = PORT_GetError();
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
11529|      0|            goto loser;
11530|      0|        }
11531|       |
11532|      0|        if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (11532:13): [True: 0, False: 0]
  ------------------
11533|      0|            ss->ssl3.hs.ws = wait_client_key;
11534|      0|        } else {
11535|      0|            TLS13_SET_HS_STATE(ss, wait_finished);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
11536|      0|        }
11537|      0|        return SECSuccess;
11538|      0|    }
11539|       |
11540|  5.43k|    ss->ssl3.peerCertArena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  5.43k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  ss->ssl3.peerCertArena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  5.43k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
11541|  5.43k|    if (ss->ssl3.peerCertArena == NULL) {
  ------------------
  |  Branch (11541:9): [True: 0, False: 5.43k]
  ------------------
11542|      0|        goto loser; /* don't send alerts on memory errors */
11543|      0|    }
11544|       |
11545|       |    /* First get the peer cert. */
11546|  5.43k|    if (remaining < 3)
  ------------------
  |  Branch (11546:9): [True: 1, False: 5.43k]
  ------------------
11547|      1|        goto decode_loser;
11548|       |
11549|  5.43k|    remaining -= 3;
11550|  5.43k|    rv = ssl3_ConsumeHandshakeNumber(ss, &size, 3, &b, &length);
11551|  5.43k|    if (rv != SECSuccess)
  ------------------
  |  Branch (11551:9): [True: 0, False: 5.43k]
  ------------------
11552|      0|        goto loser; /* fatal alert already sent by ConsumeHandshake. */
11553|  5.43k|    if (size == 0 || remaining < size)
  ------------------
  |  Branch (11553:9): [True: 1, False: 5.43k]
  |  Branch (11553:22): [True: 29, False: 5.40k]
  ------------------
11554|     30|        goto decode_loser;
11555|       |
11556|  5.40k|    certItem.data = b;
11557|  5.40k|    certItem.len = size;
11558|  5.40k|    b += size;
11559|  5.40k|    length -= size;
11560|  5.40k|    remaining -= size;
11561|       |
11562|  5.40k|    ss->sec.peerCert = CERT_NewTempCertificate(ss->dbHandle, &certItem, NULL,
11563|  5.40k|                                               PR_FALSE, PR_TRUE);
  ------------------
  |  |  438|  5.40k|#define PR_FALSE 0
  ------------------
                                                             PR_FALSE, PR_TRUE);
  ------------------
  |  |  437|  5.40k|#define PR_TRUE 1
  ------------------
11564|  5.40k|    if (ss->sec.peerCert == NULL) {
  ------------------
  |  Branch (11564:9): [True: 193, False: 5.21k]
  ------------------
11565|       |        /* We should report an alert if the cert was bad, but not if the
11566|       |         * problem was just some local problem, like memory error.
11567|       |         */
11568|    193|        goto ambiguous_err;
11569|    193|    }
11570|       |
11571|       |    /* Now get all of the CA certs. */
11572|  6.18k|    while (remaining > 0) {
  ------------------
  |  Branch (11572:12): [True: 1.05k, False: 5.13k]
  ------------------
11573|  1.05k|        if (remaining < 3)
  ------------------
  |  Branch (11573:13): [True: 7, False: 1.04k]
  ------------------
11574|      7|            goto decode_loser;
11575|       |
11576|  1.04k|        remaining -= 3;
11577|  1.04k|        rv = ssl3_ConsumeHandshakeNumber(ss, &size, 3, &b, &length);
11578|  1.04k|        if (rv != SECSuccess)
  ------------------
  |  Branch (11578:13): [True: 0, False: 1.04k]
  ------------------
11579|      0|            goto loser; /* fatal alert already sent by ConsumeHandshake. */
11580|  1.04k|        if (size == 0 || remaining < size)
  ------------------
  |  Branch (11580:13): [True: 30, False: 1.01k]
  |  Branch (11580:26): [True: 46, False: 968]
  ------------------
11581|     76|            goto decode_loser;
11582|       |
11583|    968|        certItem.data = b;
11584|    968|        certItem.len = size;
11585|    968|        b += size;
11586|    968|        length -= size;
11587|    968|        remaining -= size;
11588|       |
11589|    968|        c = PORT_ArenaNew(ss->ssl3.peerCertArena, ssl3CertNode);
  ------------------
  |  |  153|    968|    (type *)PORT_ArenaAlloc(poolp, sizeof(type))
  |  |  ------------------
  |  |  |  |   53|    968|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  |  |  ------------------
  ------------------
11590|    968|        if (c == NULL) {
  ------------------
  |  Branch (11590:13): [True: 0, False: 968]
  ------------------
11591|      0|            goto loser; /* don't send alerts on memory errors */
11592|      0|        }
11593|       |
11594|    968|        c->derCert = SECITEM_ArenaDupItem(ss->ssl3.peerCertArena,
  ------------------
  |  |  104|    968|#define SECITEM_ArenaDupItem SECITEM_ArenaDupItem_Util
  ------------------
11595|    968|                                          &certItem);
11596|    968|        if (c->derCert == NULL) {
  ------------------
  |  Branch (11596:13): [True: 0, False: 968]
  ------------------
11597|      0|            goto loser;
11598|      0|        }
11599|       |
11600|    968|        c->next = NULL;
11601|    968|        if (lastCert) {
  ------------------
  |  Branch (11601:13): [True: 327, False: 641]
  ------------------
11602|    327|            lastCert->next = c;
11603|    641|        } else {
11604|    641|            ss->ssl3.peerCertChain = c;
11605|    641|        }
11606|    968|        lastCert = c;
11607|    968|    }
11608|       |
11609|  5.13k|    SECKEY_UpdateCertPQG(ss->sec.peerCert);
11610|       |
11611|  5.13k|    if (!isServer &&
  ------------------
  |  Branch (11611:9): [True: 5.13k, False: 0]
  ------------------
11612|  5.13k|        ss->version < SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (11612:9): [True: 5.13k, False: 0]
  ------------------
11613|  5.13k|        ssl3_ExtensionNegotiated(ss, ssl_cert_status_xtn)) {
  ------------------
  |  Branch (11613:9): [True: 37, False: 5.09k]
  ------------------
11614|     37|        ss->ssl3.hs.ws = wait_certificate_status;
11615|     37|        rv = SECSuccess;
11616|  5.09k|    } else {
11617|  5.09k|        rv = ssl3_AuthCertificate(ss); /* sets ss->ssl3.hs.ws */
11618|  5.09k|    }
11619|       |
11620|  5.13k|    return rv;
11621|       |
11622|    193|ambiguous_err:
11623|    193|    errCode = PORT_GetError();
  ------------------
  |  |   62|    193|#define PORT_GetError PORT_GetError_Util
  ------------------
11624|    193|    switch (errCode) {
  ------------------
  |  Branch (11624:13): [True: 193, False: 0]
  ------------------
11625|      0|        case PR_OUT_OF_MEMORY_ERROR:
  ------------------
  |  |   16|      0|#define PR_OUT_OF_MEMORY_ERROR                   (-6000L)
  ------------------
  |  Branch (11625:9): [True: 0, False: 193]
  ------------------
11626|      0|        case SEC_ERROR_BAD_DATABASE:
  ------------------
  |  Branch (11626:9): [True: 0, False: 193]
  ------------------
11627|      0|        case SEC_ERROR_NO_MEMORY:
  ------------------
  |  Branch (11627:9): [True: 0, False: 193]
  ------------------
11628|      0|            if (isTLS) {
  ------------------
  |  Branch (11628:17): [True: 0, False: 0]
  ------------------
11629|      0|                desc = internal_error;
11630|      0|                goto alert_loser;
11631|      0|            }
11632|      0|            goto loser;
11633|    193|    }
11634|    193|    ssl3_SendAlertForCertError(ss, errCode);
11635|    193|    goto loser;
11636|       |
11637|    150|decode_loser:
11638|    150|    desc = isTLS ? decode_error : bad_certificate;
  ------------------
  |  Branch (11638:12): [True: 150, False: 0]
  ------------------
11639|       |
11640|    151|alert_loser:
11641|    151|    (void)SSL3_SendAlert(ss, alert_fatal, desc);
11642|       |
11643|    345|loser:
11644|    345|    (void)ssl_MapLowLevelError(errCode);
11645|    345|    return SECFailure;
11646|    151|}
ssl_SetAuthKeyBits:
11650|  4.90k|{
11651|  4.90k|    SECStatus rv;
11652|  4.90k|    PRUint32 minKey = 0;
11653|  4.90k|    PRInt32 optval;
11654|  4.90k|    PRBool usePolicyLength = PR_TRUE;
  ------------------
  |  |  437|  4.90k|#define PR_TRUE 1
  ------------------
11655|       |
11656|  4.90k|    rv = NSS_OptionGet(NSS_KEY_SIZE_POLICY_FLAGS, &optval);
  ------------------
  |  |  317|  4.90k|#define NSS_KEY_SIZE_POLICY_FLAGS 0x00e
  ------------------
11657|  4.90k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (11657:9): [True: 4.90k, False: 0]
  ------------------
11658|  4.90k|        usePolicyLength = (PRBool)((optval & NSS_KEY_SIZE_POLICY_SSL_FLAG) == NSS_KEY_SIZE_POLICY_SSL_FLAG);
  ------------------
  |  |  321|  4.90k|#define NSS_KEY_SIZE_POLICY_SSL_FLAG 1
  ------------------
                      usePolicyLength = (PRBool)((optval & NSS_KEY_SIZE_POLICY_SSL_FLAG) == NSS_KEY_SIZE_POLICY_SSL_FLAG);
  ------------------
  |  |  321|  4.90k|#define NSS_KEY_SIZE_POLICY_SSL_FLAG 1
  ------------------
11659|  4.90k|    }
11660|       |
11661|  4.90k|    ss->sec.authKeyBits = SECKEY_PublicKeyStrengthInBits(pubKey);
11662|  4.90k|    switch (SECKEY_GetPublicKeyType(pubKey)) {
11663|  2.94k|        case rsaKey:
  ------------------
  |  Branch (11663:9): [True: 2.94k, False: 1.95k]
  ------------------
11664|  2.94k|        case rsaPssKey:
  ------------------
  |  Branch (11664:9): [True: 0, False: 4.90k]
  ------------------
11665|  2.94k|        case rsaOaepKey:
  ------------------
  |  Branch (11665:9): [True: 0, False: 4.90k]
  ------------------
11666|  2.94k|            rv = usePolicyLength ? NSS_OptionGet(NSS_RSA_MIN_KEY_SIZE, &optval)
  ------------------
  |  |  286|  2.94k|#define NSS_RSA_MIN_KEY_SIZE 0x001
  ------------------
  |  Branch (11666:18): [True: 2.94k, False: 0]
  ------------------
11667|  2.94k|                                 : SECFailure;
11668|  2.94k|            if (rv == SECSuccess && optval > 0) {
  ------------------
  |  Branch (11668:17): [True: 2.94k, False: 0]
  |  Branch (11668:37): [True: 2.94k, False: 0]
  ------------------
11669|  2.94k|                minKey = (PRUint32)optval;
11670|  2.94k|            } else {
11671|      0|                minKey = SSL_RSA_MIN_MODULUS_BITS;
  ------------------
  |  |   15|      0|#define SSL_RSA_MIN_MODULUS_BITS 1023
  ------------------
11672|      0|            }
11673|  2.94k|            break;
11674|       |
11675|    936|        case dsaKey:
  ------------------
  |  Branch (11675:9): [True: 936, False: 3.96k]
  ------------------
11676|    936|            rv = usePolicyLength ? NSS_OptionGet(NSS_DSA_MIN_KEY_SIZE, &optval)
  ------------------
  |  |  288|    936|#define NSS_DSA_MIN_KEY_SIZE 0x004
  ------------------
  |  Branch (11676:18): [True: 936, False: 0]
  ------------------
11677|    936|                                 : SECFailure;
11678|    936|            if (rv == SECSuccess && optval > 0) {
  ------------------
  |  Branch (11678:17): [True: 936, False: 0]
  |  Branch (11678:37): [True: 936, False: 0]
  ------------------
11679|    936|                minKey = (PRUint32)optval;
11680|    936|            } else {
11681|      0|                minKey = SSL_DSA_MIN_P_BITS;
  ------------------
  |  |   20|      0|#define SSL_DSA_MIN_P_BITS 1023
  ------------------
11682|      0|            }
11683|    936|            break;
11684|       |
11685|     11|        case dhKey:
  ------------------
  |  Branch (11685:9): [True: 11, False: 4.89k]
  ------------------
11686|     11|            rv = usePolicyLength ? NSS_OptionGet(NSS_DH_MIN_KEY_SIZE, &optval)
  ------------------
  |  |  287|     11|#define NSS_DH_MIN_KEY_SIZE 0x002
  ------------------
  |  Branch (11686:18): [True: 11, False: 0]
  ------------------
11687|     11|                                 : SECFailure;
11688|     11|            if (rv == SECSuccess && optval > 0) {
  ------------------
  |  Branch (11688:17): [True: 11, False: 0]
  |  Branch (11688:37): [True: 11, False: 0]
  ------------------
11689|     11|                minKey = (PRUint32)optval;
11690|     11|            } else {
11691|      0|                minKey = SSL_DH_MIN_P_BITS;
  ------------------
  |  |   19|      0|#define SSL_DH_MIN_P_BITS 1023
  ------------------
11692|      0|            }
11693|     11|            break;
11694|       |
11695|  1.00k|        case ecKey:
  ------------------
  |  Branch (11695:9): [True: 1.00k, False: 3.89k]
  ------------------
11696|  1.00k|            rv = usePolicyLength ? NSS_OptionGet(NSS_ECC_MIN_KEY_SIZE, &optval)
  ------------------
  |  |  327|  1.00k|#define NSS_ECC_MIN_KEY_SIZE 0x011
  ------------------
  |  Branch (11696:18): [True: 1.00k, False: 0]
  ------------------
11697|  1.00k|                                 : SECFailure;
11698|  1.00k|            if (rv == SECSuccess && optval > 0) {
  ------------------
  |  Branch (11698:17): [True: 1.00k, False: 0]
  |  Branch (11698:37): [True: 1.00k, False: 0]
  ------------------
11699|  1.00k|                minKey = (PRUint32)optval;
11700|  1.00k|            } else {
11701|       |                /* Don't check EC strength here on the understanding that we
11702|       |                 * only support curves we like. */
11703|      0|                minKey = ss->sec.authKeyBits;
11704|      0|            }
11705|  1.00k|            break;
11706|       |
11707|      0|        default:
  ------------------
  |  Branch (11707:9): [True: 0, False: 4.90k]
  ------------------
11708|      0|            FATAL_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE, internal_error);
  ------------------
  |  |  175|      0|    do {                                     \
  |  |  176|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |  167|      0|    do {                                                                           \
  |  |  |  |  168|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |  169|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |  170|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |  171|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  177|      0|        tls13_FatalError(ss, prError, desc); \
  |  |  178|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (178:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
11709|      0|            return SECFailure;
11710|  4.90k|    }
11711|       |
11712|       |    /* Too small: not good enough. Send a fatal alert. */
11713|  4.90k|    if (ss->sec.authKeyBits < minKey) {
  ------------------
  |  Branch (11713:9): [True: 152, False: 4.74k]
  ------------------
11714|    152|        FATAL_ERROR(ss, SSL_ERROR_WEAK_SERVER_CERT_KEY,
  ------------------
  |  |  175|    152|    do {                                     \
  |  |  176|    152|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |  167|    152|    do {                                                                           \
  |  |  |  |  168|    152|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|    152|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 152]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|    152|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |  169|    152|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |  170|    152|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|    152|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |  171|    152|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  177|    304|        tls13_FatalError(ss, prError, desc); \
  |  |  ------------------
  |  |  |  Branch (177:39): [True: 152, False: 0]
  |  |  ------------------
  |  |  178|    152|    } while (0)
  |  |  ------------------
  |  |  |  Branch (178:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
11715|    152|                    ss->version >= SSL_LIBRARY_VERSION_TLS_1_0
11716|    152|                        ? insufficient_security
11717|    152|                        : illegal_parameter);
11718|    152|        return SECFailure;
11719|    152|    }
11720|       |
11721|       |    /* PreliminaryChannelInfo.authKeyBits, scheme, and peerDelegCred are now valid. */
11722|  4.74k|    ss->ssl3.hs.preliminaryInfo |= ssl_preinfo_peer_auth;
  ------------------
  |  |  397|  4.74k|#define ssl_preinfo_peer_auth (1U << 3)
  ------------------
11723|       |
11724|  4.74k|    return SECSuccess;
11725|  4.90k|}
ssl3_HandleServerSpki:
11729|  5.10k|{
11730|  5.10k|    PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|  5.10k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.10k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.10k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11731|  5.10k|    SECKEYPublicKey *pubKey;
11732|       |
11733|  5.10k|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (11733:9): [True: 0, False: 5.10k]
  ------------------
11734|  5.10k|        tls13_IsVerifyingWithDelegatedCredential(ss)) {
  ------------------
  |  Branch (11734:9): [True: 0, False: 0]
  ------------------
11735|      0|        sslDelegatedCredential *dc = ss->xtnData.peerDelegCred;
11736|      0|        pubKey = SECKEY_ExtractPublicKey(dc->spki);
11737|      0|        if (!pubKey) {
  ------------------
  |  Branch (11737:13): [True: 0, False: 0]
  ------------------
11738|      0|            PORT_SetError(SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
11739|      0|            return SECFailure;
11740|      0|        }
11741|       |
11742|       |        /* Because we have only a single authType (ssl_auth_tls13_any)
11743|       |         * for TLS 1.3 at this point, set the scheme so that the
11744|       |         * callback can interpret |authKeyBits| correctly.
11745|       |         */
11746|      0|        ss->sec.signatureScheme = dc->expectedCertVerifyAlg;
11747|  5.10k|    } else {
11748|  5.10k|        pubKey = CERT_ExtractPublicKey(ss->sec.peerCert);
11749|  5.10k|        if (!pubKey) {
  ------------------
  |  Branch (11749:13): [True: 206, False: 4.90k]
  ------------------
11750|    206|            PORT_SetError(SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE);
  ------------------
  |  |   65|    206|#define PORT_SetError PORT_SetError_Util
  ------------------
11751|    206|            return SECFailure;
11752|    206|        }
11753|  5.10k|    }
11754|       |
11755|  4.90k|    SECStatus rv = ssl_SetAuthKeyBits(ss, pubKey);
11756|  4.90k|    SECKEY_DestroyPublicKey(pubKey);
11757|  4.90k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (11757:9): [True: 152, False: 4.74k]
  ------------------
11758|    152|        return rv; /* Alert sent and code set. */
11759|    152|    }
11760|       |
11761|  4.74k|    return SECSuccess;
11762|  4.90k|}
ssl3_AuthCertificate:
11766|  5.10k|{
11767|  5.10k|    SECStatus rv;
11768|  5.10k|    PRBool isServer = ss->sec.isServer;
11769|  5.10k|    int errCode;
11770|       |
11771|  5.10k|    ss->ssl3.hs.authCertificatePending = PR_FALSE;
  ------------------
  |  |  438|  5.10k|#define PR_FALSE 0
  ------------------
11772|       |
11773|  5.10k|    PORT_Assert((ss->ssl3.hs.preliminaryInfo & ssl_preinfo_all) ==
  ------------------
  |  |  120|  5.10k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.10k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 5.10k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11774|  5.10k|                ssl_preinfo_all);
11775|       |
11776|  5.10k|    if (!ss->sec.isServer) {
  ------------------
  |  Branch (11776:9): [True: 5.10k, False: 0]
  ------------------
11777|       |        /* Set the |spki| used to verify the handshake. When verifying with a
11778|       |         * delegated credential (DC), this corresponds to the DC public key;
11779|       |         * otherwise it correspond to the public key of the peer's end-entity
11780|       |         * certificate. */
11781|  5.10k|        rv = ssl3_HandleServerSpki(ss);
11782|  5.10k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (11782:13): [True: 358, False: 4.74k]
  ------------------
11783|       |            /* Alert sent and code set (if not SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE).
11784|       |             * In either case, we're done here. */
11785|    358|            errCode = PORT_GetError();
  ------------------
  |  |   62|    358|#define PORT_GetError PORT_GetError_Util
  ------------------
11786|    358|            goto loser;
11787|    358|        }
11788|       |
11789|  4.74k|        if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  4.74k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (11789:13): [True: 4.74k, False: 0]
  ------------------
11790|  4.74k|            ss->sec.authType = ss->ssl3.hs.kea_def->authKeyType;
11791|  4.74k|            ss->sec.keaType = ss->ssl3.hs.kea_def->exchKeyType;
11792|  4.74k|        }
11793|  4.74k|    }
11794|       |
11795|       |    /*
11796|       |     * Ask caller-supplied callback function to validate cert chain.
11797|       |     */
11798|  4.74k|    rv = (SECStatus)(*ss->authCertificate)(ss->authCertificateArg, ss->fd,
11799|  4.74k|                                           PR_TRUE, isServer);
  ------------------
  |  |  437|  4.74k|#define PR_TRUE 1
  ------------------
11800|  4.74k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (11800:9): [True: 82, False: 4.66k]
  ------------------
11801|     82|        errCode = PORT_GetError();
  ------------------
  |  |   62|     82|#define PORT_GetError PORT_GetError_Util
  ------------------
11802|     82|        if (errCode == 0) {
  ------------------
  |  Branch (11802:13): [True: 5, False: 77]
  ------------------
11803|      5|            errCode = SSL_ERROR_BAD_CERTIFICATE;
11804|      5|        }
11805|     82|        if (rv != SECWouldBlock) {
  ------------------
  |  Branch (11805:13): [True: 82, False: 0]
  ------------------
11806|     82|            if (ss->handleBadCert) {
  ------------------
  |  Branch (11806:17): [True: 0, False: 82]
  ------------------
11807|      0|                rv = (*ss->handleBadCert)(ss->badCertArg, ss->fd);
11808|      0|            }
11809|     82|        }
11810|       |
11811|     82|        if (rv == SECWouldBlock) {
  ------------------
  |  Branch (11811:13): [True: 0, False: 82]
  ------------------
11812|      0|            if (ss->sec.isServer) {
  ------------------
  |  Branch (11812:17): [True: 0, False: 0]
  ------------------
11813|      0|                errCode = SSL_ERROR_FEATURE_NOT_SUPPORTED_FOR_SERVERS;
11814|      0|                goto loser;
11815|      0|            }
11816|       |
11817|      0|            ss->ssl3.hs.authCertificatePending = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
11818|      0|            rv = SECSuccess;
11819|      0|        }
11820|       |
11821|     82|        if (rv != SECSuccess) {
  ------------------
  |  Branch (11821:13): [True: 82, False: 0]
  ------------------
11822|     82|            ssl3_SendAlertForCertError(ss, errCode);
11823|     82|            goto loser;
11824|     82|        }
11825|     82|    }
11826|       |
11827|  4.66k|    if (ss->sec.ci.sid->peerCert) {
  ------------------
  |  Branch (11827:9): [True: 0, False: 4.66k]
  ------------------
11828|      0|        CERT_DestroyCertificate(ss->sec.ci.sid->peerCert);
11829|      0|    }
11830|  4.66k|    ss->sec.ci.sid->peerCert = CERT_DupCertificate(ss->sec.peerCert);
11831|       |
11832|  4.66k|    if (!ss->sec.isServer) {
  ------------------
  |  Branch (11832:9): [True: 4.66k, False: 0]
  ------------------
11833|  4.66k|        if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  4.66k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (11833:13): [True: 0, False: 4.66k]
  ------------------
11834|      0|            TLS13_SET_HS_STATE(ss, wait_cert_verify);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
11835|  4.66k|        } else {
11836|       |            /* Ephemeral suites require ServerKeyExchange. */
11837|  4.66k|            if (ss->ssl3.hs.kea_def->ephemeral) {
  ------------------
  |  Branch (11837:17): [True: 3.10k, False: 1.56k]
  ------------------
11838|       |                /* require server_key_exchange */
11839|  3.10k|                ss->ssl3.hs.ws = wait_server_key;
11840|  3.10k|            } else {
11841|       |                /* disallow server_key_exchange */
11842|  1.56k|                ss->ssl3.hs.ws = wait_cert_request;
11843|       |                /* This is static RSA key exchange so set the key exchange
11844|       |                 * details to compensate for that. */
11845|  1.56k|                ss->sec.keaKeyBits = ss->sec.authKeyBits;
11846|  1.56k|                ss->sec.signatureScheme = ssl_sig_none;
11847|  1.56k|                ss->sec.keaGroup = NULL;
11848|  1.56k|            }
11849|  4.66k|        }
11850|  4.66k|    } else {
11851|       |        /* Server */
11852|      0|        if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (11852:13): [True: 0, False: 0]
  ------------------
11853|      0|            ss->ssl3.hs.ws = wait_client_key;
11854|      0|        } else {
11855|      0|            TLS13_SET_HS_STATE(ss, wait_cert_verify);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
11856|      0|        }
11857|      0|    }
11858|       |
11859|  4.66k|    PORT_Assert(rv == SECSuccess);
  ------------------
  |  |  120|  4.66k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.66k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.66k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11860|  4.66k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (11860:9): [True: 0, False: 4.66k]
  ------------------
11861|      0|        errCode = SEC_ERROR_LIBRARY_FAILURE;
11862|      0|        goto loser;
11863|      0|    }
11864|       |
11865|  4.66k|    return SECSuccess;
11866|       |
11867|    440|loser:
11868|    440|    (void)ssl_MapLowLevelError(errCode);
11869|    440|    return SECFailure;
11870|  4.66k|}
ssl3_RecordKeyLog:
12083|  3.45k|{
12084|  3.45k|#ifdef NSS_ALLOW_SSLKEYLOGFILE
12085|  3.45k|    SECStatus rv;
12086|  3.45k|    SECItem *keyData;
12087|       |    /* Longest label is "CLIENT_HANDSHAKE_TRAFFIC_SECRET", master secret is 48
12088|       |     * bytes which happens to be the largest in TLS 1.3 as well (SHA384).
12089|       |     * Maximum line length: "CLIENT_HANDSHAKE_TRAFFIC_SECRET" (31) + " " (1) +
12090|       |     * client_random (32*2) + " " (1) +
12091|       |     * traffic_secret (48*2) + "\n" (1) = 194. */
12092|  3.45k|    char buf[200];
12093|  3.45k|    unsigned int offset, len;
12094|       |
12095|  3.45k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  3.45k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.18k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.71k, False: 1.73k]
  |  |  |  |  |  Branch (208:7): [True: 1.73k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12096|       |
12097|  3.45k|    if (!ssl_keylog_iob)
  ------------------
  |  Branch (12097:9): [True: 3.45k, False: 0]
  ------------------
12098|  3.45k|        return;
12099|       |
12100|      0|    rv = PK11_ExtractKeyValue(secret);
12101|      0|    if (rv != SECSuccess)
  ------------------
  |  Branch (12101:9): [True: 0, False: 0]
  ------------------
12102|      0|        return;
12103|       |
12104|       |    /* keyData does not need to be freed. */
12105|      0|    keyData = PK11_GetKeyData(secret);
12106|      0|    if (!keyData || !keyData->data)
  ------------------
  |  Branch (12106:9): [True: 0, False: 0]
  |  Branch (12106:21): [True: 0, False: 0]
  ------------------
12107|      0|        return;
12108|       |
12109|      0|    len = strlen(label) + 1 +          /* label + space */
12110|      0|          SSL3_RANDOM_LENGTH * 2 + 1 + /* client random (hex) + space */
  ------------------
  |  |   24|      0|#define SSL3_RANDOM_LENGTH 32
  ------------------
12111|      0|          keyData->len * 2 + 1;        /* secret (hex) + newline */
12112|      0|    PORT_Assert(len <= sizeof(buf));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12113|      0|    if (len > sizeof(buf))
  ------------------
  |  Branch (12113:9): [True: 0, False: 0]
  ------------------
12114|      0|        return;
12115|       |
12116|       |    /* https://developer.mozilla.org/en/NSS_Key_Log_Format */
12117|       |
12118|       |    /* There could be multiple, concurrent writers to the
12119|       |     * keylog, so we have to do everything in a single call to
12120|       |     * fwrite. */
12121|       |
12122|      0|    strcpy(buf, label);
12123|      0|    offset = strlen(label);
12124|      0|    buf[offset++] += ' ';
12125|      0|    hexEncode(buf + offset, ss->ssl3.hs.client_random, SSL3_RANDOM_LENGTH);
  ------------------
  |  |   24|      0|#define SSL3_RANDOM_LENGTH 32
  ------------------
12126|      0|    offset += SSL3_RANDOM_LENGTH * 2;
  ------------------
  |  |   24|      0|#define SSL3_RANDOM_LENGTH 32
  ------------------
12127|      0|    buf[offset++] = ' ';
12128|      0|    hexEncode(buf + offset, keyData->data, keyData->len);
12129|      0|    offset += keyData->len * 2;
12130|      0|    buf[offset++] = '\n';
12131|       |
12132|      0|    PORT_Assert(offset == len);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12133|       |
12134|      0|    PZ_Lock(ssl_keylog_lock);
  ------------------
  |  |  245|      0|#define PZ_Lock(k) PR_Lock((k))
  ------------------
12135|      0|    if (fwrite(buf, len, 1, ssl_keylog_iob) == 1)
  ------------------
  |  Branch (12135:9): [True: 0, False: 0]
  ------------------
12136|      0|        fflush(ssl_keylog_iob);
12137|      0|    PZ_Unlock(ssl_keylog_lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
12138|      0|#endif
12139|      0|}
ssl3_CacheWrappedSecret:
12219|     89|{
12220|     89|    PK11SymKey *wrappingKey = NULL;
12221|     89|    PK11SlotInfo *symKeySlot;
12222|     89|    void *pwArg = ss->pkcs11PinArg;
12223|     89|    SECStatus rv = SECFailure;
12224|     89|    PRBool isServer = ss->sec.isServer;
12225|     89|    CK_MECHANISM_TYPE mechanism = CKM_INVALID_MECHANISM;
  ------------------
  |  |  155|     89|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
12226|       |
12227|     89|    symKeySlot = PK11_GetSlotFromKey(secret);
12228|     89|    if (!isServer) {
  ------------------
  |  Branch (12228:9): [True: 89, False: 0]
  ------------------
12229|     89|        int wrapKeyIndex;
12230|     89|        int incarnation;
12231|       |
12232|       |        /* these next few functions are mere accessors and don't fail. */
12233|     89|        sid->u.ssl3.masterWrapIndex = wrapKeyIndex =
12234|     89|            PK11_GetCurrentWrapIndex(symKeySlot);
12235|     89|        PORT_Assert(wrapKeyIndex == 0); /* array has only one entry! */
  ------------------
  |  |  120|     89|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     89|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12236|       |
12237|     89|        sid->u.ssl3.masterWrapSeries = incarnation =
12238|     89|            PK11_GetSlotSeries(symKeySlot);
12239|     89|        sid->u.ssl3.masterSlotID = PK11_GetSlotID(symKeySlot);
12240|     89|        sid->u.ssl3.masterModuleID = PK11_GetModuleID(symKeySlot);
12241|     89|        sid->u.ssl3.masterValid = PR_TRUE;
  ------------------
  |  |  437|     89|#define PR_TRUE 1
  ------------------
12242|       |        /* Get the default wrapping key, for wrapping the master secret before
12243|       |         * placing it in the SID cache entry. */
12244|     89|        wrappingKey = PK11_GetWrapKey(symKeySlot, wrapKeyIndex,
12245|     89|                                      CKM_INVALID_MECHANISM, incarnation,
  ------------------
  |  |  155|     89|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
12246|     89|                                      pwArg);
12247|     89|        if (wrappingKey) {
  ------------------
  |  Branch (12247:13): [True: 88, False: 1]
  ------------------
12248|     88|            mechanism = PK11_GetMechanism(wrappingKey); /* can't fail. */
12249|     88|        } else {
12250|      1|            int keyLength;
12251|       |            /* if the wrappingKey doesn't exist, attempt to create it.
12252|       |             * Note: we intentionally ignore errors here.  If we cannot
12253|       |             * generate a wrapping key, it is not fatal to this SSL connection,
12254|       |             * but we will not be able to restart this session.
12255|       |             */
12256|      1|            mechanism = PK11_GetBestWrapMechanism(symKeySlot);
12257|      1|            keyLength = PK11_GetBestKeyLength(symKeySlot, mechanism);
12258|       |            /* Zero length means fixed key length algorithm, or error.
12259|       |             * It's ambiguous.
12260|       |             */
12261|      1|            wrappingKey = PK11_KeyGen(symKeySlot, mechanism, NULL,
12262|      1|                                      keyLength, pwArg);
12263|      1|            if (wrappingKey) {
  ------------------
  |  Branch (12263:17): [True: 1, False: 0]
  ------------------
12264|       |                /* The thread safety characteristics of PK11_[SG]etWrapKey is
12265|       |                 * abominable.  This protects against races in calling
12266|       |                 * PK11_SetWrapKey by dropping and re-acquiring the canonical
12267|       |                 * value once it is set.  The mutex in PK11_[SG]etWrapKey will
12268|       |                 * ensure that races produce the same value in the end. */
12269|      1|                PK11_SetWrapKey(symKeySlot, wrapKeyIndex, wrappingKey);
12270|      1|                PK11_FreeSymKey(wrappingKey);
12271|      1|                wrappingKey = PK11_GetWrapKey(symKeySlot, wrapKeyIndex,
12272|      1|                                              CKM_INVALID_MECHANISM, incarnation, pwArg);
  ------------------
  |  |  155|      1|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
12273|      1|                if (!wrappingKey) {
  ------------------
  |  Branch (12273:21): [True: 0, False: 1]
  ------------------
12274|      0|                    PK11_FreeSlot(symKeySlot);
12275|      0|                    return SECFailure;
12276|      0|                }
12277|      1|            }
12278|      1|        }
12279|     89|    } else {
12280|       |        /* server socket using session cache. */
12281|      0|        mechanism = PK11_GetBestWrapMechanism(symKeySlot);
12282|      0|        if (mechanism != CKM_INVALID_MECHANISM) {
  ------------------
  |  |  155|      0|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  |  Branch (12282:13): [True: 0, False: 0]
  ------------------
12283|      0|            wrappingKey =
12284|      0|                ssl3_GetWrappingKey(ss, symKeySlot, mechanism, pwArg);
12285|      0|            if (wrappingKey) {
  ------------------
  |  Branch (12285:17): [True: 0, False: 0]
  ------------------
12286|      0|                mechanism = PK11_GetMechanism(wrappingKey); /* can't fail. */
12287|      0|            }
12288|      0|        }
12289|      0|    }
12290|       |
12291|     89|    sid->u.ssl3.masterWrapMech = mechanism;
12292|     89|    PK11_FreeSlot(symKeySlot);
12293|       |
12294|     89|    if (wrappingKey) {
  ------------------
  |  Branch (12294:9): [True: 89, False: 0]
  ------------------
12295|     89|        SECItem wmsItem;
12296|       |
12297|     89|        wmsItem.data = sid->u.ssl3.keys.wrapped_master_secret;
12298|     89|        wmsItem.len = sizeof sid->u.ssl3.keys.wrapped_master_secret;
12299|     89|        rv = PK11_WrapSymKey(mechanism, NULL, wrappingKey,
12300|     89|                             secret, &wmsItem);
12301|       |        /* rv is examined below. */
12302|     89|        sid->u.ssl3.keys.wrapped_master_secret_len = wmsItem.len;
12303|     89|        PK11_FreeSymKey(wrappingKey);
12304|     89|    }
12305|     89|    return rv;
12306|     89|}
ssl3_FillInCachedSID:
12476|     89|{
12477|     89|    PORT_Assert(secret);
  ------------------
  |  |  120|     89|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     89|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12478|       |
12479|       |    /* fill in the sid */
12480|     89|    sid->u.ssl3.cipherSuite = ss->ssl3.hs.cipher_suite;
12481|     89|    sid->u.ssl3.policy = ss->ssl3.policy;
12482|     89|    sid->version = ss->version;
12483|     89|    sid->authType = ss->sec.authType;
12484|     89|    sid->authKeyBits = ss->sec.authKeyBits;
12485|     89|    sid->keaType = ss->sec.keaType;
12486|     89|    sid->keaKeyBits = ss->sec.keaKeyBits;
12487|     89|    if (ss->sec.keaGroup) {
  ------------------
  |  Branch (12487:9): [True: 85, False: 4]
  ------------------
12488|     85|        sid->keaGroup = ss->sec.keaGroup->name;
12489|     85|    } else {
12490|      4|        sid->keaGroup = ssl_grp_none;
12491|      4|    }
12492|     89|    sid->sigScheme = ss->sec.signatureScheme;
12493|     89|    sid->lastAccessTime = sid->creationTime = ssl_Time(ss);
12494|     89|    sid->expirationTime = sid->creationTime + (ssl_ticket_lifetime * PR_USEC_PER_SEC);
  ------------------
  |  |   28|     89|#define PR_USEC_PER_SEC     1000000L
  ------------------
12495|     89|    if (sid->localCert) {
  ------------------
  |  Branch (12495:9): [True: 0, False: 89]
  ------------------
12496|      0|        CERT_DestroyCertificate(sid->localCert);
12497|      0|    }
12498|     89|    sid->localCert = CERT_DupCertificate(ss->sec.localCert);
12499|     89|    if (ss->sec.isServer) {
  ------------------
  |  Branch (12499:9): [True: 0, False: 89]
  ------------------
12500|      0|        sid->namedCurve = ss->sec.serverCert->namedCurve;
12501|      0|    }
12502|       |
12503|     89|    if (ss->xtnData.nextProtoState != SSL_NEXT_PROTO_NO_SUPPORT &&
  ------------------
  |  Branch (12503:9): [True: 0, False: 89]
  ------------------
12504|     89|        ss->xtnData.nextProto.data) {
  ------------------
  |  Branch (12504:9): [True: 0, False: 0]
  ------------------
12505|      0|        SECITEM_FreeItem(&sid->u.ssl3.alpnSelection, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(&sid->u.ssl3.alpnSelection, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
12506|      0|        if (SECITEM_CopyItem(
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  |  Branch (12506:13): [True: 0, False: 0]
  ------------------
12507|      0|                NULL, &sid->u.ssl3.alpnSelection, &ss->xtnData.nextProto) != SECSuccess) {
12508|      0|            return SECFailure; /* error already set. */
12509|      0|        }
12510|      0|    }
12511|       |
12512|       |    /* Copy the master secret (wrapped or unwrapped) into the sid */
12513|     89|    return ssl3_CacheWrappedSecret(ss, ss->sec.ci.sid, secret);
12514|     89|}
ssl_HashHandshakeMessageInt:
12577|  19.5k|{
12578|  19.5k|    PRUint8 hdr[4];
12579|  19.5k|    PRUint8 dtlsData[8];
12580|  19.5k|    SECStatus rv;
12581|       |
12582|  19.5k|    PRINT_BUF(50, (ss, "Hash handshake message:", b, length));
  ------------------
  |  |   74|  19.5k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 19.5k]
  |  |  ------------------
  |  |   75|  19.5k|    ssl_PrintBuf b
  ------------------
12583|       |
12584|  19.5k|    hdr[0] = (PRUint8)ct;
12585|  19.5k|    hdr[1] = (PRUint8)(length >> 16);
12586|  19.5k|    hdr[2] = (PRUint8)(length >> 8);
12587|  19.5k|    hdr[3] = (PRUint8)(length);
12588|       |
12589|  19.5k|    rv = updateHashes(ss, (unsigned char *)hdr, 4);
12590|  19.5k|    if (rv != SECSuccess)
  ------------------
  |  Branch (12590:9): [True: 0, False: 19.5k]
  ------------------
12591|      0|        return rv; /* err code already set. */
12592|       |
12593|       |    /* Extra data to simulate a complete DTLS handshake fragment */
12594|  19.5k|    if (IS_DTLS_1_OR_12(ss)) {
  ------------------
  |  |  893|  19.5k|#define IS_DTLS_1_OR_12(ss) (IS_DTLS(ss) && ss->version < SSL_LIBRARY_VERSION_TLS_1_3)
  |  |  ------------------
  |  |  |  |  892|  39.1k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (892:21): [True: 19.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_DTLS_1_OR_12(ss) (IS_DTLS(ss) && ss->version < SSL_LIBRARY_VERSION_TLS_1_3)
  |  |  ------------------
  |  |  |  |   21|  39.1k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  |  |  ------------------
  |  |  |  Branch (893:45): [True: 16.6k, False: 2.90k]
  |  |  ------------------
  ------------------
12595|       |        /* Sequence number */
12596|  16.6k|        dtlsData[0] = MSB(dtlsSeq);
  ------------------
  |  |   94|  16.6k|#define MSB(x) ((unsigned char)(((unsigned)(x)) >> 8))
  ------------------
12597|  16.6k|        dtlsData[1] = LSB(dtlsSeq);
  ------------------
  |  |   93|  16.6k|#define LSB(x) ((unsigned char)((x)&0xff))
  ------------------
12598|       |
12599|       |        /* Fragment offset */
12600|  16.6k|        dtlsData[2] = 0;
12601|  16.6k|        dtlsData[3] = 0;
12602|  16.6k|        dtlsData[4] = 0;
12603|       |
12604|       |        /* Fragment length */
12605|  16.6k|        dtlsData[5] = (PRUint8)(length >> 16);
12606|  16.6k|        dtlsData[6] = (PRUint8)(length >> 8);
12607|  16.6k|        dtlsData[7] = (PRUint8)(length);
12608|       |
12609|  16.6k|        rv = updateHashes(ss, (unsigned char *)dtlsData, sizeof(dtlsData));
12610|  16.6k|        if (rv != SECSuccess)
  ------------------
  |  Branch (12610:13): [True: 0, False: 16.6k]
  ------------------
12611|      0|            return rv; /* err code already set. */
12612|  16.6k|    }
12613|       |
12614|       |    /* The message body */
12615|  19.5k|    rv = updateHashes(ss, b, length);
12616|  19.5k|    if (rv != SECSuccess)
  ------------------
  |  Branch (12616:9): [True: 0, False: 19.5k]
  ------------------
12617|      0|        return rv; /* err code already set. */
12618|       |
12619|  19.5k|    return SECSuccess;
12620|  19.5k|}
ssl_HashHandshakeMessage:
12625|  18.6k|{
12626|  18.6k|    return ssl_HashHandshakeMessageInt(ss, ct, ss->ssl3.hs.recvMessageSeq,
12627|  18.6k|                                       b, length, ssl3_UpdateHandshakeHashes);
12628|  18.6k|}
ssl_HashHandshakeMessageDefault:
12633|    972|{
12634|    972|    return ssl_HashHandshakeMessageInt(ss, ct, ss->ssl3.hs.recvMessageSeq,
12635|    972|                                       b, length, ssl3_UpdateDefaultHandshakeHashes);
12636|    972|}
ssl3_HandleHandshakeMessage:
12660|  19.6k|{
12661|  19.6k|    SECStatus rv = SECSuccess;
12662|  19.6k|    PRUint16 epoch;
12663|       |
12664|  19.6k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  19.6k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  29.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 9.65k, False: 10.0k]
  |  |  |  |  |  Branch (208:7): [True: 10.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12665|  19.6k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  19.6k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  29.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 9.65k, False: 10.0k]
  |  |  |  |  |  Branch (208:7): [True: 10.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12666|       |
12667|  19.6k|    SSL_TRC(30, ("%d: SSL3[%d]: handle handshake message: %s", SSL_GETPID(),
  ------------------
  |  |   71|  19.6k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 19.6k]
  |  |  ------------------
  |  |   72|  19.6k|    ssl_Trace b
  ------------------
12668|  19.6k|                 ss->fd, ssl3_DecodeHandshakeType(ss->ssl3.hs.msg_type)));
12669|       |
12670|       |    /* Start new handshake hashes when we start a new handshake. */
12671|  19.6k|    if (ss->ssl3.hs.msg_type == ssl_hs_client_hello) {
  ------------------
  |  Branch (12671:9): [True: 2, False: 19.6k]
  ------------------
12672|      2|        ssl3_RestartHandshakeHashes(ss);
12673|      2|    }
12674|  19.6k|    switch (ss->ssl3.hs.msg_type) {
12675|    168|        case ssl_hs_hello_request:
  ------------------
  |  Branch (12675:9): [True: 168, False: 19.5k]
  ------------------
12676|    623|        case ssl_hs_hello_verify_request:
  ------------------
  |  Branch (12676:9): [True: 455, False: 19.2k]
  ------------------
12677|       |            /* We don't include hello_request and hello_verify_request messages
12678|       |             * in the handshake hashes */
12679|    623|            break;
12680|       |
12681|       |        /* Defer hashing of these messages until the message handlers. */
12682|      2|        case ssl_hs_client_hello:
  ------------------
  |  Branch (12682:9): [True: 2, False: 19.6k]
  ------------------
12683|  7.90k|        case ssl_hs_server_hello:
  ------------------
  |  Branch (12683:9): [True: 7.90k, False: 11.7k]
  ------------------
12684|  7.90k|        case ssl_hs_certificate_verify:
  ------------------
  |  Branch (12684:9): [True: 3, False: 19.6k]
  ------------------
12685|  8.04k|        case ssl_hs_finished:
  ------------------
  |  Branch (12685:9): [True: 143, False: 19.5k]
  ------------------
12686|  8.04k|            break;
12687|       |
12688|  11.0k|        default:
  ------------------
  |  Branch (12688:9): [True: 11.0k, False: 8.67k]
  ------------------
12689|  11.0k|            if (!tls13_IsPostHandshake(ss)) {
  ------------------
  |  Branch (12689:17): [True: 11.0k, False: 0]
  ------------------
12690|  11.0k|                rv = ssl_HashHandshakeMessage(ss, ss->ssl3.hs.msg_type, b, length);
12691|  11.0k|                if (rv != SECSuccess) {
  ------------------
  |  Branch (12691:21): [True: 0, False: 11.0k]
  ------------------
12692|      0|                    return SECFailure;
12693|      0|                }
12694|  11.0k|            }
12695|  19.6k|    }
12696|       |
12697|  19.6k|    PORT_SetError(0); /* each message starts with no error. */
  ------------------
  |  |   65|  19.6k|#define PORT_SetError PORT_SetError_Util
  ------------------
12698|       |
12699|  19.6k|    if (ss->ssl3.hs.ws == wait_certificate_status &&
  ------------------
  |  Branch (12699:9): [True: 33, False: 19.6k]
  ------------------
12700|  19.6k|        ss->ssl3.hs.msg_type != ssl_hs_certificate_status) {
  ------------------
  |  Branch (12700:9): [True: 6, False: 27]
  ------------------
12701|       |        /* If we negotiated the certificate_status extension then we deferred
12702|       |         * certificate validation until we get the CertificateStatus messsage.
12703|       |         * But the CertificateStatus message is optional. If the server did
12704|       |         * not send it then we need to validate the certificate now. If the
12705|       |         * server does send the CertificateStatus message then we will
12706|       |         * authenticate the certificate in ssl3_HandleCertificateStatus.
12707|       |         */
12708|      6|        rv = ssl3_AuthCertificate(ss); /* sets ss->ssl3.hs.ws */
12709|      6|        if (rv != SECSuccess) {
  ------------------
  |  Branch (12709:13): [True: 4, False: 2]
  ------------------
12710|       |            /* This can't block. */
12711|      4|            PORT_Assert(PORT_GetError() != PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |  120|      4|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      4|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12712|      4|            return SECFailure;
12713|      4|        }
12714|      6|    }
12715|       |
12716|  19.6k|    epoch = ss->ssl3.crSpec->epoch;
12717|  19.6k|    switch (ss->ssl3.hs.msg_type) {
12718|      2|        case ssl_hs_client_hello:
  ------------------
  |  Branch (12718:9): [True: 2, False: 19.6k]
  ------------------
12719|      2|            if (!ss->sec.isServer) {
  ------------------
  |  Branch (12719:17): [True: 2, False: 0]
  ------------------
12720|      2|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12721|      2|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CLIENT_HELLO);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
12722|      2|                return SECFailure;
12723|      2|            }
12724|      0|            rv = ssl3_HandleClientHello(ss, b, length);
12725|      0|            break;
12726|  7.90k|        case ssl_hs_server_hello:
  ------------------
  |  Branch (12726:9): [True: 7.90k, False: 11.7k]
  ------------------
12727|  7.90k|            if (ss->sec.isServer) {
  ------------------
  |  Branch (12727:17): [True: 0, False: 7.90k]
  ------------------
12728|      0|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12729|      0|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12730|      0|                return SECFailure;
12731|      0|            }
12732|  7.90k|            rv = ssl3_HandleServerHello(ss, b, length);
12733|  7.90k|            break;
12734|  11.7k|        default:
  ------------------
  |  Branch (12734:9): [True: 11.7k, False: 7.90k]
  ------------------
12735|  11.7k|            if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  11.7k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (12735:17): [True: 11.7k, False: 39]
  ------------------
12736|  11.7k|                rv = ssl3_HandlePostHelloHandshakeMessage(ss, b, length);
12737|  11.7k|            } else {
12738|     39|                rv = tls13_HandlePostHelloHandshakeMessage(ss, b, length);
12739|     39|            }
12740|  11.7k|            break;
12741|  19.6k|    }
12742|  19.6k|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|  39.3k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (12742:9): [True: 2.03k, False: 17.6k]
  ------------------
12743|  19.6k|        (epoch != ss->ssl3.crSpec->epoch) && !endOfRecord) {
  ------------------
  |  Branch (12743:9): [True: 846, False: 1.19k]
  |  Branch (12743:46): [True: 15, False: 831]
  ------------------
12744|       |        /* If we changed read cipher states, there must not be any
12745|       |         * data in the input queue. */
12746|     15|        (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12747|     15|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HANDSHAKE);
  ------------------
  |  |   65|     15|#define PORT_SetError PORT_SetError_Util
  ------------------
12748|     15|        return SECFailure;
12749|     15|    }
12750|       |    /* We consider the record to have been handled if SECSuccess or else WOULD_BLOCK is set
12751|       |     * Whoever set WOULD_BLOCK must handle any remaining actions required to finsih processing the record.
12752|       |     * e.g. by setting restartTarget.
12753|       |     */
12754|  19.6k|    if (IS_DTLS(ss) && (rv == SECSuccess || (rv == SECFailure && PR_GetError() == PR_WOULD_BLOCK_ERROR))) {
  ------------------
  |  |  892|  39.3k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 19.6k, False: 0]
  |  |  ------------------
  ------------------
                  if (IS_DTLS(ss) && (rv == SECSuccess || (rv == SECFailure && PR_GetError() == PR_WOULD_BLOCK_ERROR))) {
  ------------------
  |  |   22|  2.20k|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (12754:25): [True: 17.4k, False: 2.20k]
  |  Branch (12754:46): [True: 2.20k, False: 0]
  |  Branch (12754:66): [True: 0, False: 2.20k]
  ------------------
12755|       |        /* Increment the expected sequence number */
12756|  17.4k|        ss->ssl3.hs.recvMessageSeq++;
12757|  17.4k|    }
12758|       |
12759|       |    /* Taint the message so that it's easier to detect UAFs. */
12760|  19.6k|    PORT_Memset(b, 'N', length);
  ------------------
  |  |  182|  19.6k|#define PORT_Memset memset
  ------------------
12761|       |
12762|  19.6k|    return rv;
12763|  19.6k|}
ssl3_HandleNonApplicationData:
13425|  27.7k|{
13426|  27.7k|    SECStatus rv;
13427|       |
13428|       |    /* check for Token Presence */
13429|  27.7k|    if (!ssl3_ClientAuthTokenPresent(ss->sec.ci.sid)) {
  ------------------
  |  Branch (13429:9): [True: 0, False: 27.7k]
  ------------------
13430|      0|        PORT_SetError(SSL_ERROR_TOKEN_INSERTION_REMOVAL);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
13431|      0|        return SECFailure;
13432|      0|    }
13433|       |
13434|  27.7k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  27.7k|    {                                                 \
  |  | 1408|  27.7k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 14.5k, False: 13.1k]
  |  |  ------------------
  |  | 1409|  14.5k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  14.5k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  14.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 14.5k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  14.5k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  14.5k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  14.5k|        }                                             \
  |  | 1412|  27.7k|    }
  ------------------
13435|       |
13436|       |    /* All the functions called in this switch MUST set error code if
13437|       |    ** they return SECFailure.
13438|       |    */
13439|  27.7k|    switch (rType) {
13440|    371|        case ssl_ct_change_cipher_spec:
  ------------------
  |  Branch (13440:9): [True: 371, False: 27.3k]
  ------------------
13441|    371|            rv = ssl3_HandleChangeCipherSpecs(ss, databuf);
13442|    371|            break;
13443|    769|        case ssl_ct_alert:
  ------------------
  |  Branch (13443:9): [True: 769, False: 26.9k]
  ------------------
13444|    769|            rv = ssl3_HandleAlert(ss, databuf);
13445|    769|            break;
13446|  25.7k|        case ssl_ct_handshake:
  ------------------
  |  Branch (13446:9): [True: 25.7k, False: 2.01k]
  ------------------
13447|  25.7k|            if (!IS_DTLS(ss)) {
  ------------------
  |  |  892|  25.7k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (13447:17): [True: 0, False: 25.7k]
  ------------------
13448|      0|                rv = ssl3_HandleHandshake(ss, databuf);
13449|  25.7k|            } else {
13450|  25.7k|                rv = dtls_HandleHandshake(ss, epoch, seqNum, databuf);
13451|  25.7k|            }
13452|  25.7k|            break;
13453|    780|        case ssl_ct_ack:
  ------------------
  |  Branch (13453:9): [True: 780, False: 26.9k]
  ------------------
13454|    780|            if (IS_DTLS(ss) && tls13_MaybeTls13(ss)) {
  ------------------
  |  |  892|  1.56k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 780, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (13454:32): [True: 774, False: 6]
  ------------------
13455|    774|                rv = dtls13_HandleAck(ss, databuf);
13456|    774|                break;
13457|    774|            }
13458|       |        /* Fall through. */
13459|    100|        default:
  ------------------
  |  Branch (13459:9): [True: 94, False: 27.6k]
  ------------------
13460|       |            /* If a TLS implementation receives an unexpected record type,
13461|       |             * it MUST terminate the connection with an "unexpected_message"
13462|       |             * alert [RFC8446, Section 5].
13463|       |             *
13464|       |             * For TLS 1.3 the outer content type is checked before in
13465|       |             * tls13con.c/tls13_UnprotectRecord(),
13466|       |             * For DTLS 1.3 the outer content type is checked before in
13467|       |             * ssl3gthr.c/dtls_GatherData.
13468|       |             * The inner content types will be checked here.
13469|       |             *
13470|       |             * In DTLS generally invalid records SHOULD be silently discarded,
13471|       |             * no alert is sent [RFC6347, Section 4.1.2.7].
13472|       |             */
13473|    100|            if (!IS_DTLS(ss)) {
  ------------------
  |  |  892|    100|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (13473:17): [True: 0, False: 100]
  ------------------
13474|      0|                SSL3_SendAlert(ss, alert_fatal, unexpected_message);
13475|      0|            }
13476|    100|            PORT_SetError(SSL_ERROR_RX_UNKNOWN_RECORD_TYPE);
  ------------------
  |  |   65|    100|#define PORT_SetError PORT_SetError_Util
  ------------------
13477|    100|            SSL_DBG(("%d: SSL3[%d]: bogus content type=%d",
  ------------------
  |  |   87|    100|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 100]
  |  |  ------------------
  |  |   88|    100|    ssl_Trace b
  ------------------
13478|    100|                     SSL_GETPID(), ss->fd, rType));
13479|    100|            rv = SECFailure;
13480|    100|            break;
13481|  27.7k|    }
13482|       |
13483|  27.7k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  27.7k|    {                                                \
  |  | 1415|  27.7k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 14.5k, False: 13.1k]
  |  |  ------------------
  |  | 1416|  27.7k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  14.5k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  27.7k|    }
  ------------------
13484|  27.7k|    return rv;
13485|  27.7k|}
ssl3_HandleRecord:
13544|  1.45M|{
13545|  1.45M|    SECStatus rv = SECFailure;
13546|  1.45M|    PRBool isTLS, isTLS13;
13547|  1.45M|    DTLSEpoch epoch;
13548|  1.45M|    ssl3CipherSpec *spec = NULL;
13549|  1.45M|    PRUint16 recordSizeLimit, cTextSizeLimit;
13550|  1.45M|    PRBool outOfOrderSpec = PR_FALSE;
  ------------------
  |  |  438|  1.45M|#define PR_FALSE 0
  ------------------
13551|  1.45M|    SSLContentType rType;
13552|  1.45M|    sslBuffer *plaintext = &ss->gs.buf;
13553|  1.45M|    SSL3AlertDescription alert = internal_error;
13554|  1.45M|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  1.45M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.47M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 435k, False: 1.02M]
  |  |  |  |  |  Branch (208:7): [True: 1.02M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13555|       |
13556|       |    /* check for Token Presence */
13557|  1.45M|    if (!ssl3_ClientAuthTokenPresent(ss->sec.ci.sid)) {
  ------------------
  |  Branch (13557:9): [True: 0, False: 1.45M]
  ------------------
13558|      0|        PORT_SetError(SSL_ERROR_TOKEN_INSERTION_REMOVAL);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
13559|      0|        return SECFailure;
13560|      0|    }
13561|       |
13562|       |    /* Clear out the buffer in case this exits early.  Any data then won't be
13563|       |     * processed twice. */
13564|  1.45M|    plaintext->len = 0;
13565|       |
13566|       |    /* We're waiting for another ClientHello, which will appear unencrypted.
13567|       |     * Use the content type to tell whether this should be discarded. */
13568|  1.45M|    if (ss->ssl3.hs.zeroRttIgnore == ssl_0rtt_ignore_hrr &&
  ------------------
  |  Branch (13568:9): [True: 0, False: 1.45M]
  ------------------
13569|  1.45M|        cText->hdr[0] == ssl_ct_application_data) {
  ------------------
  |  Branch (13569:9): [True: 0, False: 0]
  ------------------
13570|      0|        PORT_Assert(ss->ssl3.hs.ws == wait_client_hello);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13571|      0|        return SECSuccess;
13572|      0|    }
13573|       |
13574|  1.45M|    ssl_GetSpecReadLock(ss); /******************************************/
  ------------------
  |  | 1422|  1.45M|    {                                           \
  |  | 1423|  1.45M|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 1.02M, False: 435k]
  |  |  ------------------
  |  | 1424|  1.45M|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|  1.02M|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|  1.45M|    }
  ------------------
13575|  1.45M|    spec = ssl3_GetCipherSpec(ss, cText);
13576|  1.45M|    if (!spec) {
  ------------------
  |  Branch (13576:9): [True: 9.56k, False: 1.44M]
  ------------------
13577|  9.56k|        PORT_Assert(IS_DTLS(ss));
  ------------------
  |  |  120|  9.56k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  9.56k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 9.56k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13578|  9.56k|        ssl_ReleaseSpecReadLock(ss); /*****************************/
  ------------------
  |  | 1427|  9.56k|    {                                             \
  |  | 1428|  9.56k|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 6.16k, False: 3.40k]
  |  |  ------------------
  |  | 1429|  9.56k|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|  6.16k|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|  9.56k|    }
  ------------------
13579|  9.56k|        return SECSuccess;
13580|  9.56k|    }
13581|  1.44M|    if (spec != ss->ssl3.crSpec) {
  ------------------
  |  Branch (13581:9): [True: 0, False: 1.44M]
  ------------------
13582|      0|        PORT_Assert(IS_DTLS(ss));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13583|      0|        SSL_TRC(3, ("%d: DTLS[%d]: Handling out-of-epoch record from epoch=%d",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
13584|      0|                    SSL_GETPID(), ss->fd, spec->epoch));
13585|      0|        outOfOrderSpec = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
13586|      0|    }
13587|  1.44M|    isTLS = (PRBool)(spec->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|  1.44M|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
13588|  1.44M|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  1.44M|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 1.44M, False: 0]
  |  |  ------------------
  ------------------
13589|  1.44M|        if (dtls13_MaskSequenceNumber(ss, spec, cText->hdr,
  ------------------
  |  Branch (13589:13): [True: 0, False: 1.44M]
  ------------------
13590|  1.44M|                                      SSL_BUFFER_BASE(cText->buf), SSL_BUFFER_LEN(cText->buf)) != SECSuccess) {
  ------------------
  |  |   35|  1.44M|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
                                                    SSL_BUFFER_BASE(cText->buf), SSL_BUFFER_LEN(cText->buf)) != SECSuccess) {
  ------------------
  |  |   36|  1.44M|#define SSL_BUFFER_LEN(b) ((b)->len)
  ------------------
13591|      0|            ssl_ReleaseSpecReadLock(ss); /*****************************/
  ------------------
  |  | 1427|      0|    {                                             \
  |  | 1428|      0|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1429|      0|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|      0|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|      0|    }
  ------------------
13592|       |            /* code already set. */
13593|      0|            return SECFailure;
13594|      0|        }
13595|  1.44M|        if (!dtls_IsRelevant(ss, spec, cText, &cText->seqNum)) {
  ------------------
  |  Branch (13595:13): [True: 1.41M, False: 32.1k]
  ------------------
13596|  1.41M|            ssl_ReleaseSpecReadLock(ss); /*****************************/
  ------------------
  |  | 1427|  1.41M|    {                                             \
  |  | 1428|  1.41M|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 997k, False: 417k]
  |  |  ------------------
  |  | 1429|  1.41M|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|   997k|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|  1.41M|    }
  ------------------
13597|  1.41M|            return SECSuccess;
13598|  1.41M|        }
13599|  1.44M|    } else {
13600|      0|        cText->seqNum = spec->nextSeqNum;
13601|      0|    }
13602|  32.1k|    if (cText->seqNum >= spec->cipherDef->max_records) {
  ------------------
  |  Branch (13602:9): [True: 34, False: 32.1k]
  ------------------
13603|     34|        ssl_ReleaseSpecReadLock(ss); /*****************************/
  ------------------
  |  | 1427|     34|    {                                             \
  |  | 1428|     34|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 27, False: 7]
  |  |  ------------------
  |  | 1429|     34|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|     27|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|     34|    }
  ------------------
13604|     34|        SSL_TRC(3, ("%d: SSL[%d]: read sequence number at limit 0x%0llx",
  ------------------
  |  |   71|     34|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 34]
  |  |  ------------------
  |  |   72|     34|    ssl_Trace b
  ------------------
13605|     34|                    SSL_GETPID(), ss->fd, cText->seqNum));
13606|     34|        PORT_SetError(SSL_ERROR_TOO_MANY_RECORDS);
  ------------------
  |  |   65|     34|#define PORT_SetError PORT_SetError_Util
  ------------------
13607|     34|        return SECFailure;
13608|     34|    }
13609|       |
13610|  32.1k|    isTLS13 = (PRBool)(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |   21|  32.1k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
13611|  32.1k|    recordSizeLimit = spec->recordSizeLimit;
13612|  32.1k|    cTextSizeLimit = recordSizeLimit;
13613|  32.1k|    cTextSizeLimit += (isTLS13) ? TLS_1_3_MAX_EXPANSION : TLS_1_2_MAX_EXPANSION;
  ------------------
  |  |   37|  2.14k|#define TLS_1_3_MAX_EXPANSION (255 + 1)
  ------------------
                  cTextSizeLimit += (isTLS13) ? TLS_1_3_MAX_EXPANSION : TLS_1_2_MAX_EXPANSION;
  ------------------
  |  |   36|  62.0k|#define TLS_1_2_MAX_EXPANSION 2048
  ------------------
  |  Branch (13613:23): [True: 2.14k, False: 29.9k]
  ------------------
13614|       |
13615|       |    /* Check if the specified recordSizeLimit and the RFC8446 specified max
13616|       |     * expansion are respected. recordSizeLimit is probably at the default for
13617|       |     * the first (hello) handshake message and then set to a smaller size by
13618|       |     * the Record Size Limit Extension.
13619|       |     * Stricter expansion size checks dependent on implemented cipher suites
13620|       |     * are performed in ssl3con.c/ssl3_UnprotectRecord() OR
13621|       |     * tls13con.c/tls13_UnprotextRecord().
13622|       |     * After Decryption the plaintext size is checked (l. 13424). This also
13623|       |     * applies to unencrypted records. */
13624|  32.1k|    if (cText->buf->len > cTextSizeLimit) {
  ------------------
  |  Branch (13624:9): [True: 9, False: 32.0k]
  ------------------
13625|      9|        ssl_ReleaseSpecReadLock(ss); /*****************************/
  ------------------
  |  | 1427|      9|    {                                             \
  |  | 1428|      9|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 3, False: 6]
  |  |  ------------------
  |  | 1429|      9|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|      3|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|      9|    }
  ------------------
13626|       |        /* Drop DTLS Record Errors silently [RFC6347, Section 4.1.2.7] */
13627|      9|        if (IS_DTLS(ss)) {
  ------------------
  |  |  892|      9|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 9, False: 0]
  |  |  ------------------
  ------------------
13628|      9|            return SECSuccess;
13629|      9|        }
13630|      0|        SSL3_SendAlert(ss, alert_fatal, record_overflow);
13631|      0|        PORT_SetError(SSL_ERROR_RX_RECORD_TOO_LONG);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
13632|      0|        return SECFailure;
13633|      9|    }
13634|       |
13635|  32.0k|#ifdef DEBUG
13636|       |    /* In debug builds the gather buffers are freed after the handling of each
13637|       |     * record for advanced ASAN coverage. Allocate the buffer again to the
13638|       |     * maximum possibly needed size as on gather initialization in
13639|       |     * ssl3gthr.c/ssl3_InitGather(). */
13640|  32.0k|    PR_ASSERT(sslBuffer_Grow(plaintext, TLS_1_2_MAX_CTEXT_LENGTH) == SECSuccess);
  ------------------
  |  |  208|  32.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 32.0k, False: 0]
  |  |  ------------------
  ------------------
13641|  32.0k|#endif
13642|       |    /* This replaces a dynamic plaintext buffer size check, since the buffer is
13643|       |     * allocated to the maximum size in ssl3gthr.c/ssl3_InitGather(). The buffer
13644|       |     * was always grown to the maximum size at first record gathering before. */
13645|  32.0k|    PR_ASSERT(plaintext->space >= cTextSizeLimit);
  ------------------
  |  |  208|  32.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 32.0k, False: 0]
  |  |  ------------------
  ------------------
13646|       |
13647|       |    /* Most record types aside from protected TLS 1.3 records carry the content
13648|       |     * type in the first octet. TLS 1.3 will override this value later. */
13649|  32.0k|    rType = cText->hdr[0];
13650|       |    /* Encrypted application data records could arrive before the handshake
13651|       |     * completes in DTLS 1.3. These can look like valid TLS 1.2 application_data
13652|       |     * records in epoch 0, which is never valid. Pretend they didn't decrypt. */
13653|  32.0k|    if (spec->epoch == 0 && ((IS_DTLS(ss) &&
  ------------------
  |  |  892|  62.8k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 31.4k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (13653:9): [True: 31.4k, False: 665]
  ------------------
13654|  31.4k|                              dtls_IsDtls13Ciphertext(0, rType)) ||
  ------------------
  |  Branch (13654:31): [True: 852, False: 30.5k]
  ------------------
13655|  31.4k|                             rType == ssl_ct_application_data)) {
  ------------------
  |  Branch (13655:30): [True: 3.06k, False: 27.5k]
  ------------------
13656|  3.92k|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA);
  ------------------
  |  |   65|  3.92k|#define PORT_SetError PORT_SetError_Util
  ------------------
13657|  3.92k|        alert = unexpected_message;
13658|  3.92k|        rv = SECFailure;
13659|  28.1k|    } else {
13660|  28.1k|#ifdef UNSAFE_FUZZER_MODE
13661|  28.1k|        rv = Null_Cipher(NULL, plaintext->buf, &plaintext->len,
13662|  28.1k|                         plaintext->space, cText->buf->buf, cText->buf->len);
13663|       |#else
13664|       |        /* IMPORTANT:
13665|       |         * Unprotect functions MUST NOT send alerts
13666|       |         * because we still hold the spec read lock. Instead, if they
13667|       |         * return SECFailure, they set *alert to the alert to be sent.
13668|       |         * Additionaly, this is used to silently drop DTLS encryption/record
13669|       |         * errors/alerts using the error handling below as suggested in the
13670|       |         * DTLS specification [RFC6347, Section 4.1.2.7]. */
13671|       |        if (spec->cipherDef->cipher == cipher_null && cText->buf->len == 0) {
13672|       |            /* Handle a zero-length unprotected record
13673|       |             * In this case, we treat it as a no-op and let later functions decide
13674|       |             * whether to ignore or alert accordingly. */
13675|       |            PR_ASSERT(plaintext->len == 0);
13676|       |            rv = SECSuccess;
13677|       |        } else if (spec->version < SSL_LIBRARY_VERSION_TLS_1_3 || spec->epoch == 0) {
13678|       |            rv = ssl3_UnprotectRecord(ss, spec, cText, plaintext, &alert);
13679|       |        } else {
13680|       |            rv = tls13_UnprotectRecord(ss, spec, cText, plaintext, &rType,
13681|       |                                       &alert);
13682|       |        }
13683|       |#endif
13684|  28.1k|    }
13685|       |
13686|       |    /* Error/Alert handling for ssl3/tls13_UnprotectRecord */
13687|  32.0k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (13687:9): [True: 3.92k, False: 28.1k]
  ------------------
13688|  3.92k|        ssl_ReleaseSpecReadLock(ss); /***************************/
  ------------------
  |  | 1427|  3.92k|    {                                             \
  |  | 1428|  3.92k|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 2.72k, False: 1.20k]
  |  |  ------------------
  |  | 1429|  3.92k|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|  2.72k|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|  3.92k|    }
  ------------------
13689|       |
13690|  3.92k|        SSL_DBG(("%d: SSL3[%d]: decryption failed", SSL_GETPID(), ss->fd));
  ------------------
  |  |   87|  3.92k|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 3.92k]
  |  |  ------------------
  |  |   88|  3.92k|    ssl_Trace b
  ------------------
13691|       |
13692|       |        /* Ensure that we don't process this data again. */
13693|  3.92k|        plaintext->len = 0;
13694|       |
13695|       |        /* Ignore a CCS if compatibility mode is negotiated.  Note that this
13696|       |         * will fail if the server fails to negotiate compatibility mode in a
13697|       |         * 0-RTT session that is resumed from a session that did negotiate it.
13698|       |         * We don't care about that corner case right now. */
13699|  3.92k|        if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|  7.84k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (13699:13): [True: 433, False: 3.48k]
  ------------------
13700|  3.92k|            cText->hdr[0] == ssl_ct_change_cipher_spec &&
  ------------------
  |  Branch (13700:13): [True: 0, False: 433]
  ------------------
13701|  3.92k|            ss->ssl3.hs.ws != idle_handshake &&
  ------------------
  |  Branch (13701:13): [True: 0, False: 0]
  ------------------
13702|  3.92k|            cText->buf->len == 1 &&
  ------------------
  |  Branch (13702:13): [True: 0, False: 0]
  ------------------
13703|  3.92k|            cText->buf->buf[0] == change_cipher_spec_choice) {
  ------------------
  |  Branch (13703:13): [True: 0, False: 0]
  ------------------
13704|      0|            if (!ss->ssl3.hs.rejectCcs) {
  ------------------
  |  Branch (13704:17): [True: 0, False: 0]
  ------------------
13705|       |                /* Allow only the first CCS. */
13706|      0|                ss->ssl3.hs.rejectCcs = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
13707|      0|                return SECSuccess;
13708|      0|            } else {
13709|      0|                alert = unexpected_message;
13710|      0|                PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
13711|      0|            }
13712|      0|        }
13713|       |
13714|       |        /* All errors/alerts that might occur during unprotection are related
13715|       |         * to invalid records (e.g. invalid formatting, length, MAC, ...).
13716|       |         * Following the DTLS specification such errors/alerts SHOULD be
13717|       |         * dropped silently [RFC9147, Section 4.5.2].
13718|       |         * This is done below. */
13719|       |
13720|  3.92k|        if ((IS_DTLS(ss) && !dtls13_AeadLimitReached(spec)) ||
  ------------------
  |  |  892|  7.84k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 3.92k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (13720:29): [True: 3.92k, False: 0]
  ------------------
13721|  3.92k|            (!IS_DTLS(ss) && ss->sec.isServer &&
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (13721:14): [True: 0, False: 0]
  |  Branch (13721:30): [True: 0, False: 0]
  ------------------
13722|  3.92k|             ss->ssl3.hs.zeroRttIgnore == ssl_0rtt_ignore_trial)) {
  ------------------
  |  Branch (13722:14): [True: 0, False: 0]
  ------------------
13723|       |            /* Silently drop the packet unless we set ss->ssl3.fatalAlertSent.
13724|       |             * (Manually or by using functions like
13725|       |             * SSL3_SendAlert(.., alert_fatal,..))
13726|       |             * This is not currently used in the unprotection functions since
13727|       |             * all TLS and DTLS errors are propagated to this handler. */
13728|  3.92k|            if (ss->ssl3.fatalAlertSent) {
  ------------------
  |  Branch (13728:17): [True: 0, False: 3.92k]
  ------------------
13729|      0|                return SECFailure;
13730|      0|            }
13731|  3.92k|            return SECSuccess;
13732|  3.92k|        }
13733|       |
13734|      0|        int errCode = PORT_GetError();
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
13735|      0|        SSL3_SendAlert(ss, alert_fatal, alert);
13736|       |        /* Reset the error code in case SSL3_SendAlert called
13737|       |         * PORT_SetError(). */
13738|      0|        PORT_SetError(errCode);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
13739|      0|        return SECFailure;
13740|  3.92k|    }
13741|       |
13742|       |    /* SECSuccess */
13743|  28.1k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  28.1k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 28.1k, False: 0]
  |  |  ------------------
  ------------------
13744|  28.1k|        dtls_RecordSetRecvd(&spec->recvdRecords, cText->seqNum);
13745|  28.1k|        spec->nextSeqNum = PR_MAX(spec->nextSeqNum, cText->seqNum + 1);
  ------------------
  |  |  159|  28.1k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 5.93k, False: 22.2k]
  |  |  ------------------
  ------------------
13746|  28.1k|    } else {
13747|      0|        ++spec->nextSeqNum;
13748|      0|    }
13749|  28.1k|    epoch = spec->epoch;
13750|       |
13751|  28.1k|    ssl_ReleaseSpecReadLock(ss); /*****************************************/
  ------------------
  |  | 1427|  28.1k|    {                                             \
  |  | 1428|  28.1k|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 14.7k, False: 13.3k]
  |  |  ------------------
  |  | 1429|  28.1k|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|  14.7k|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|  28.1k|    }
  ------------------
13752|       |
13753|       |    /*
13754|       |     * The decrypted data is now in plaintext.
13755|       |     */
13756|       |
13757|       |    /* IMPORTANT: We are in DTLS 1.3 mode and we have processed something
13758|       |     * from the wrong epoch. Divert to a divert processing function to make
13759|       |     * sure we don't accidentally use the data unsafely. */
13760|       |
13761|       |    /* We temporary allowed reading the records from the previous epoch n-1
13762|       |    until the moment we get a message from the new epoch n. */
13763|       |
13764|  28.1k|    if (outOfOrderSpec) {
  ------------------
  |  Branch (13764:9): [True: 0, False: 28.1k]
  ------------------
13765|      0|        PORT_Assert(IS_DTLS(ss) && ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13766|      0|        ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|      0|    {                                                 \
  |  | 1408|      0|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1409|      0|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|      0|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|      0|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|      0|        }                                             \
  |  | 1412|      0|    }
  ------------------
13767|      0|        if (ss->ssl3.hs.allowPreviousEpoch && spec->epoch == ss->ssl3.crSpec->epoch - 1) {
  ------------------
  |  Branch (13767:13): [True: 0, False: 0]
  |  Branch (13767:47): [True: 0, False: 0]
  ------------------
13768|      0|            SSL_TRC(30, ("%d: DTLS13[%d]: Out of order message %d is accepted",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
13769|      0|                         SSL_GETPID(), ss->fd, spec->epoch));
13770|      0|            ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
13771|      0|        } else {
13772|      0|            ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
13773|      0|            return dtls13_HandleOutOfEpochRecord(ss, spec, rType, plaintext);
13774|      0|        }
13775|  28.1k|    } else {
13776|  28.1k|        ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  28.1k|    {                                                 \
  |  | 1408|  28.1k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 14.7k, False: 13.3k]
  |  |  ------------------
  |  | 1409|  14.7k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  14.7k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  14.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 14.7k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  14.7k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  14.7k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  14.7k|        }                                             \
  |  | 1412|  28.1k|    }
  ------------------
13777|       |        /* Forbid (application) messages from the previous epoch.
13778|       |           From now, messages that arrive out of order will be discarded. */
13779|  28.1k|        ss->ssl3.hs.allowPreviousEpoch = PR_FALSE;
  ------------------
  |  |  438|  28.1k|#define PR_FALSE 0
  ------------------
13780|  28.1k|        ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  28.1k|    {                                                \
  |  | 1415|  28.1k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 14.7k, False: 13.3k]
  |  |  ------------------
  |  | 1416|  28.1k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  14.7k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  28.1k|    }
  ------------------
13781|  28.1k|    }
13782|       |
13783|       |    /* Check the length of the plaintext. */
13784|  28.1k|    if (isTLS && plaintext->len > recordSizeLimit) {
  ------------------
  |  Branch (13784:9): [True: 28.1k, False: 0]
  |  Branch (13784:18): [True: 18, False: 28.1k]
  ------------------
13785|     18|        plaintext->len = 0;
13786|       |        /* Drop DTLS Record Errors silently [RFC6347, Section 4.1.2.7] */
13787|     18|        if (IS_DTLS(ss)) {
  ------------------
  |  |  892|     18|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 18, False: 0]
  |  |  ------------------
  ------------------
13788|     18|            return SECSuccess;
13789|     18|        }
13790|      0|        SSL3_SendAlert(ss, alert_fatal, record_overflow);
13791|      0|        PORT_SetError(SSL_ERROR_RX_RECORD_TOO_LONG);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
13792|      0|        return SECFailure;
13793|     18|    }
13794|       |
13795|       |    /* Application data records are processed by the caller of this
13796|       |    ** function, not by this function.
13797|       |    */
13798|  28.1k|    if (rType == ssl_ct_application_data) {
  ------------------
  |  Branch (13798:9): [True: 432, False: 27.7k]
  ------------------
13799|    432|        if (ss->firstHsDone)
  ------------------
  |  Branch (13799:13): [True: 427, False: 5]
  ------------------
13800|    427|            return SECSuccess;
13801|      5|        if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|     10|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (13801:13): [True: 4, False: 1]
  ------------------
13802|      5|            ss->sec.isServer &&
  ------------------
  |  Branch (13802:13): [True: 0, False: 4]
  ------------------
13803|      5|            ss->ssl3.hs.zeroRttState == ssl_0rtt_accepted) {
  ------------------
  |  Branch (13803:13): [True: 0, False: 0]
  ------------------
13804|      0|            return tls13_HandleEarlyApplicationData(ss, plaintext);
13805|      0|        }
13806|      5|        plaintext->len = 0;
13807|      5|        (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
13808|      5|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_APPLICATION_DATA);
  ------------------
  |  |   65|      5|#define PORT_SetError PORT_SetError_Util
  ------------------
13809|      5|        return SECFailure;
13810|      5|    }
13811|       |
13812|  27.7k|    rv = ssl3_HandleNonApplicationData(ss, rType, epoch, cText->seqNum,
13813|  27.7k|                                       plaintext);
13814|       |
13815|  27.7k|#ifdef DEBUG
13816|       |    /* In Debug builds free and zero gather plaintext buffer after its content
13817|       |     * has been used/copied for advanced ASAN coverage/utilization.
13818|       |     * This frees buffer for non application data records, for application data
13819|       |     * records it is freed in sslsecur.c/DoRecv(). */
13820|  27.7k|    sslBuffer_Clear(&ss->gs.buf);
13821|  27.7k|#endif
13822|       |
13823|  27.7k|    return rv;
13824|  28.1k|}
ssl_InitSecState:
13832|  8.85k|{
13833|  8.85k|    sec->authType = ssl_auth_null;
13834|  8.85k|    sec->authKeyBits = 0;
13835|  8.85k|    sec->signatureScheme = ssl_sig_none;
13836|  8.85k|    sec->keaType = ssl_kea_null;
13837|  8.85k|    sec->keaKeyBits = 0;
13838|  8.85k|    sec->keaGroup = NULL;
13839|  8.85k|}
ssl3_InitState:
13843|  8.85k|{
13844|  8.85k|    SECStatus rv;
13845|       |
13846|  8.85k|    ss->ssl3.policy = SSL_ALLOWED;
  ------------------
  |  |  700|  8.85k|#define SSL_ALLOWED 1
  ------------------
13847|       |
13848|  8.85k|    ssl_InitSecState(&ss->sec);
13849|       |
13850|  8.85k|    ssl_GetSpecWriteLock(ss);
  ------------------
  |  | 1435|  8.85k|    {                                            \
  |  | 1436|  8.85k|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1437|  8.85k|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|  8.85k|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|  8.85k|    }
  ------------------
13851|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.cipherSpecs);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13852|  8.85k|    rv = ssl_SetupNullCipherSpec(ss, ssl_secret_read);
13853|  8.85k|    rv |= ssl_SetupNullCipherSpec(ss, ssl_secret_write);
13854|  8.85k|    ss->ssl3.pwSpec = ss->ssl3.prSpec = NULL;
13855|  8.85k|    ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|  8.85k|    {                                              \
  |  | 1441|  8.85k|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1442|  8.85k|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|  8.85k|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|  8.85k|    }
  ------------------
13856|  8.85k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (13856:9): [True: 0, False: 8.85k]
  ------------------
13857|       |        /* Rely on ssl_CreateNullCipherSpec() to set error code. */
13858|      0|        return SECFailure;
13859|      0|    }
13860|       |
13861|  8.85k|    ss->ssl3.hs.sendingSCSV = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
13862|  8.85k|    ss->ssl3.hs.preliminaryInfo = 0;
13863|  8.85k|    ss->ssl3.hs.ws = (ss->sec.isServer) ? wait_client_hello : idle_handshake;
  ------------------
  |  Branch (13863:22): [True: 0, False: 8.85k]
  ------------------
13864|       |
13865|  8.85k|    ssl3_ResetExtensionData(&ss->xtnData, ss);
13866|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.remoteExtensions);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13867|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.echOuterExtensions);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13868|  8.85k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  8.85k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
13869|  8.85k|        ss->ssl3.hs.sendMessageSeq = 0;
13870|  8.85k|        ss->ssl3.hs.recvMessageSeq = 0;
13871|  8.85k|        ss->ssl3.hs.rtTimer->timeout = DTLS_RETRANSMIT_INITIAL_MS;
  ------------------
  |  |  126|  8.85k|#define DTLS_RETRANSMIT_INITIAL_MS 50
  ------------------
13872|  8.85k|        ss->ssl3.hs.rtRetries = 0;
13873|  8.85k|        ss->ssl3.hs.recvdHighWater = -1;
13874|  8.85k|        PR_INIT_CLIST(&ss->ssl3.hs.lastMessageFlight);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13875|  8.85k|        dtls_SetMTU(ss, 0); /* Set the MTU to the highest plateau */
13876|  8.85k|    }
13877|       |
13878|  8.85k|    ss->ssl3.hs.currentSecret = NULL;
13879|  8.85k|    ss->ssl3.hs.resumptionMasterSecret = NULL;
13880|  8.85k|    ss->ssl3.hs.dheSecret = NULL;
13881|  8.85k|    ss->ssl3.hs.clientEarlyTrafficSecret = NULL;
13882|  8.85k|    ss->ssl3.hs.clientHsTrafficSecret = NULL;
13883|  8.85k|    ss->ssl3.hs.serverHsTrafficSecret = NULL;
13884|  8.85k|    ss->ssl3.hs.clientTrafficSecret = NULL;
13885|  8.85k|    ss->ssl3.hs.serverTrafficSecret = NULL;
13886|  8.85k|    ss->ssl3.hs.echHpkeCtx = NULL;
13887|  8.85k|    ss->ssl3.hs.greaseEchSize = 100;
13888|  8.85k|    ss->ssl3.hs.echAccepted = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
13889|  8.85k|    ss->ssl3.hs.echDecided = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
13890|       |
13891|  8.85k|    ss->ssl3.hs.clientAuthSignatureSchemes = NULL;
13892|  8.85k|    ss->ssl3.hs.clientAuthSignatureSchemesLen = 0;
13893|       |
13894|  8.85k|    PORT_Assert(!ss->ssl3.hs.messages.buf && !ss->ssl3.hs.messages.space);
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  17.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8.85k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 8.85k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
13895|  8.85k|    ss->ssl3.hs.messages.buf = NULL;
13896|  8.85k|    ss->ssl3.hs.messages.space = 0;
13897|       |
13898|  8.85k|    ss->ssl3.hs.receivedNewSessionTicket = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
13899|  8.85k|    PORT_Memset(&ss->ssl3.hs.newSessionTicket, 0,
  ------------------
  |  |  182|  8.85k|#define PORT_Memset memset
  ------------------
13900|  8.85k|                sizeof(ss->ssl3.hs.newSessionTicket));
13901|       |
13902|  8.85k|    ss->ssl3.hs.zeroRttState = ssl_0rtt_none;
13903|  8.85k|    return SECSuccess;
13904|  8.85k|}
ssl3_CipherPrefSet:
13976|   700k|{
13977|   700k|    ssl3CipherSuiteCfg *suite;
13978|       |
13979|   700k|    suite = ssl_LookupCipherSuiteCfgMutable(which, ss->cipherSuites);
13980|   700k|    if (suite == NULL) {
  ------------------
  |  Branch (13980:9): [True: 0, False: 700k]
  ------------------
13981|      0|        return SECFailure; /* err code was set by ssl_LookupCipherSuiteCfg */
13982|      0|    }
13983|   700k|    suite->enabled = enabled;
13984|   700k|    return SECSuccess;
13985|   700k|}
ssl3_CipherPrefGet:
13989|  12.1k|{
13990|  12.1k|    const ssl3CipherSuiteCfg *suite;
13991|  12.1k|    PRBool pref;
13992|  12.1k|    SECStatus rv;
13993|       |
13994|  12.1k|    suite = ssl_LookupCipherSuiteCfg(which, ss->cipherSuites);
13995|  12.1k|    if (suite) {
  ------------------
  |  Branch (13995:9): [True: 12.1k, False: 0]
  ------------------
13996|  12.1k|        pref = suite->enabled;
13997|  12.1k|        rv = SECSuccess;
13998|  12.1k|    } else {
13999|      0|        pref = SSL_NOT_ALLOWED;
  ------------------
  |  |  699|      0|#define SSL_NOT_ALLOWED 0 /* or invalid or unimplemented */
  ------------------
14000|      0|        rv = SECFailure; /* err code was set by Lookup. */
14001|      0|    }
14002|  12.1k|    *enabled = pref;
14003|  12.1k|    return rv;
14004|  12.1k|}
ssl3_InitSocketPolicy:
14134|  8.85k|{
14135|  8.85k|    PORT_Memcpy(ss->cipherSuites, cipherSuites, sizeof(cipherSuites));
  ------------------
  |  |  180|  8.85k|#define PORT_Memcpy memcpy
  ------------------
14136|  8.85k|    PORT_Memcpy(ss->ssl3.signatureSchemes, defaultSignatureSchemes,
  ------------------
  |  |  180|  8.85k|#define PORT_Memcpy memcpy
  ------------------
14137|  8.85k|                sizeof(defaultSignatureSchemes));
14138|  8.85k|    ss->ssl3.signatureSchemeCount = PR_ARRAY_SIZE(defaultSignatureSchemes);
  ------------------
  |  |  167|  8.85k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
14139|  8.85k|}
ssl3_DestroySSL3Info:
14198|  8.85k|{
14199|       |
14200|  8.85k|    if (ss->ssl3.clientCertificate != NULL)
  ------------------
  |  Branch (14200:9): [True: 0, False: 8.85k]
  ------------------
14201|      0|        CERT_DestroyCertificate(ss->ssl3.clientCertificate);
14202|       |
14203|  8.85k|    if (ss->ssl3.clientPrivateKey != NULL)
  ------------------
  |  Branch (14203:9): [True: 0, False: 8.85k]
  ------------------
14204|      0|        SECKEY_DestroyPrivateKey(ss->ssl3.clientPrivateKey);
14205|       |
14206|  8.85k|    if (ss->ssl3.hs.clientAuthSignatureSchemes != NULL) {
  ------------------
  |  Branch (14206:9): [True: 0, False: 8.85k]
  ------------------
14207|      0|        PORT_Free(ss->ssl3.hs.clientAuthSignatureSchemes);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
14208|      0|        ss->ssl3.hs.clientAuthSignatureSchemes = NULL;
14209|      0|        ss->ssl3.hs.clientAuthSignatureSchemesLen = 0;
14210|      0|    }
14211|       |
14212|  8.85k|    if (ss->ssl3.peerCertArena != NULL)
  ------------------
  |  Branch (14212:9): [True: 5.43k, False: 3.41k]
  ------------------
14213|  5.43k|        ssl3_CleanupPeerCerts(ss);
14214|       |
14215|  8.85k|    if (ss->ssl3.clientCertChain != NULL) {
  ------------------
  |  Branch (14215:9): [True: 0, False: 8.85k]
  ------------------
14216|      0|        CERT_DestroyCertificateList(ss->ssl3.clientCertChain);
14217|      0|        ss->ssl3.clientCertChain = NULL;
14218|      0|    }
14219|  8.85k|    if (ss->ssl3.ca_list) {
  ------------------
  |  Branch (14219:9): [True: 0, False: 8.85k]
  ------------------
14220|      0|        CERT_FreeDistNames(ss->ssl3.ca_list);
14221|      0|    }
14222|       |
14223|       |    /* clean up handshake */
14224|  8.85k|    if (ss->ssl3.hs.md5) {
  ------------------
  |  Branch (14224:9): [True: 356, False: 8.49k]
  ------------------
14225|    356|        PK11_DestroyContext(ss->ssl3.hs.md5, PR_TRUE);
  ------------------
  |  |  437|    356|#define PR_TRUE 1
  ------------------
14226|    356|    }
14227|  8.85k|    if (ss->ssl3.hs.sha) {
  ------------------
  |  Branch (14227:9): [True: 1.34k, False: 7.50k]
  ------------------
14228|  1.34k|        PK11_DestroyContext(ss->ssl3.hs.sha, PR_TRUE);
  ------------------
  |  |  437|  1.34k|#define PR_TRUE 1
  ------------------
14229|  1.34k|    }
14230|  8.85k|    if (ss->ssl3.hs.shaEchInner) {
  ------------------
  |  Branch (14230:9): [True: 0, False: 8.85k]
  ------------------
14231|      0|        PK11_DestroyContext(ss->ssl3.hs.shaEchInner, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
14232|      0|    }
14233|  8.85k|    if (ss->ssl3.hs.shaPostHandshake) {
  ------------------
  |  Branch (14233:9): [True: 0, False: 8.85k]
  ------------------
14234|      0|        PK11_DestroyContext(ss->ssl3.hs.shaPostHandshake, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
14235|      0|    }
14236|  8.85k|    if (ss->ssl3.hs.messages.buf) {
  ------------------
  |  Branch (14236:9): [True: 5.91k, False: 2.93k]
  ------------------
14237|  5.91k|        sslBuffer_Clear(&ss->ssl3.hs.messages);
14238|  5.91k|    }
14239|  8.85k|    if (ss->ssl3.hs.echInnerMessages.buf) {
  ------------------
  |  Branch (14239:9): [True: 0, False: 8.85k]
  ------------------
14240|      0|        sslBuffer_Clear(&ss->ssl3.hs.echInnerMessages);
14241|      0|    }
14242|  8.85k|    if (ss->ssl3.hs.dtls13ClientMessageBuffer.buf) {
  ------------------
  |  Branch (14242:9): [True: 1.80k, False: 7.04k]
  ------------------
14243|  1.80k|        sslBuffer_Clear(&ss->ssl3.hs.dtls13ClientMessageBuffer);
14244|  1.80k|    }
14245|       |
14246|       |    /* free the SSL3Buffer (msg_body) */
14247|  8.85k|    PORT_Free(ss->ssl3.hs.msg_body.buf);
  ------------------
  |  |   60|  8.85k|#define PORT_Free PORT_Free_Util
  ------------------
14248|       |
14249|  8.85k|    SECITEM_FreeItem(&ss->ssl3.hs.newSessionTicket.ticket, PR_FALSE);
  ------------------
  |  |  108|  8.85k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&ss->ssl3.hs.newSessionTicket.ticket, PR_FALSE);
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
14250|  8.85k|    SECITEM_FreeItem(&ss->ssl3.hs.srvVirtName, PR_FALSE);
  ------------------
  |  |  108|  8.85k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&ss->ssl3.hs.srvVirtName, PR_FALSE);
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
14251|  8.85k|    SECITEM_FreeItem(&ss->ssl3.hs.fakeSid, PR_FALSE);
  ------------------
  |  |  108|  8.85k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&ss->ssl3.hs.fakeSid, PR_FALSE);
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
14252|       |
14253|       |    /* Destroy the DTLS data */
14254|  8.85k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  8.85k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
14255|  8.85k|        dtls_FreeHandshakeMessages(&ss->ssl3.hs.lastMessageFlight);
14256|  8.85k|        if (ss->ssl3.hs.recvdFragments.buf) {
  ------------------
  |  Branch (14256:13): [True: 795, False: 8.05k]
  ------------------
14257|    795|            PORT_Free(ss->ssl3.hs.recvdFragments.buf);
  ------------------
  |  |   60|    795|#define PORT_Free PORT_Free_Util
  ------------------
14258|    795|        }
14259|  8.85k|    }
14260|       |
14261|       |    /* Destroy remote extensions */
14262|  8.85k|    ssl3_DestroyRemoteExtensions(&ss->ssl3.hs.remoteExtensions);
14263|  8.85k|    ssl3_DestroyRemoteExtensions(&ss->ssl3.hs.echOuterExtensions);
14264|  8.85k|    ssl3_DestroyExtensionData(&ss->xtnData);
14265|       |
14266|       |    /* Destroy cipher specs */
14267|  8.85k|    ssl_DestroyCipherSpecs(&ss->ssl3.hs.cipherSpecs);
14268|       |
14269|       |    /* Destroy TLS 1.3 keys */
14270|  8.85k|    if (ss->ssl3.hs.currentSecret)
  ------------------
  |  Branch (14270:9): [True: 4.26k, False: 4.59k]
  ------------------
14271|  4.26k|        PK11_FreeSymKey(ss->ssl3.hs.currentSecret);
14272|  8.85k|    if (ss->ssl3.hs.resumptionMasterSecret)
  ------------------
  |  Branch (14272:9): [True: 0, False: 8.85k]
  ------------------
14273|      0|        PK11_FreeSymKey(ss->ssl3.hs.resumptionMasterSecret);
14274|  8.85k|    if (ss->ssl3.hs.dheSecret)
  ------------------
  |  Branch (14274:9): [True: 0, False: 8.85k]
  ------------------
14275|      0|        PK11_FreeSymKey(ss->ssl3.hs.dheSecret);
14276|  8.85k|    if (ss->ssl3.hs.clientEarlyTrafficSecret)
  ------------------
  |  Branch (14276:9): [True: 0, False: 8.85k]
  ------------------
14277|      0|        PK11_FreeSymKey(ss->ssl3.hs.clientEarlyTrafficSecret);
14278|  8.85k|    if (ss->ssl3.hs.clientHsTrafficSecret)
  ------------------
  |  Branch (14278:9): [True: 846, False: 8.00k]
  ------------------
14279|    846|        PK11_FreeSymKey(ss->ssl3.hs.clientHsTrafficSecret);
14280|  8.85k|    if (ss->ssl3.hs.serverHsTrafficSecret)
  ------------------
  |  Branch (14280:9): [True: 846, False: 8.00k]
  ------------------
14281|    846|        PK11_FreeSymKey(ss->ssl3.hs.serverHsTrafficSecret);
14282|  8.85k|    if (ss->ssl3.hs.clientTrafficSecret)
  ------------------
  |  Branch (14282:9): [True: 0, False: 8.85k]
  ------------------
14283|      0|        PK11_FreeSymKey(ss->ssl3.hs.clientTrafficSecret);
14284|  8.85k|    if (ss->ssl3.hs.serverTrafficSecret)
  ------------------
  |  Branch (14284:9): [True: 0, False: 8.85k]
  ------------------
14285|      0|        PK11_FreeSymKey(ss->ssl3.hs.serverTrafficSecret);
14286|  8.85k|    if (ss->ssl3.hs.earlyExporterSecret)
  ------------------
  |  Branch (14286:9): [True: 0, False: 8.85k]
  ------------------
14287|      0|        PK11_FreeSymKey(ss->ssl3.hs.earlyExporterSecret);
14288|  8.85k|    if (ss->ssl3.hs.exporterSecret)
  ------------------
  |  Branch (14288:9): [True: 0, False: 8.85k]
  ------------------
14289|      0|        PK11_FreeSymKey(ss->ssl3.hs.exporterSecret);
14290|       |
14291|  8.85k|    ss->ssl3.hs.zeroRttState = ssl_0rtt_none;
14292|       |    /* Destroy TLS 1.3 buffered early data. */
14293|  8.85k|    tls13_DestroyEarlyData(&ss->ssl3.hs.bufferedEarlyData);
14294|       |
14295|       |    /* Destroy TLS 1.3 PSKs. */
14296|  8.85k|    tls13_DestroyPskList(&ss->ssl3.hs.psks);
14297|       |
14298|       |    /* TLS 1.3 ECH state. */
14299|  8.85k|    PK11_HPKE_DestroyContext(ss->ssl3.hs.echHpkeCtx, PR_TRUE);
  ------------------
  |  |  437|  8.85k|#define PR_TRUE 1
  ------------------
14300|  8.85k|    PORT_Free((void *)ss->ssl3.hs.echPublicName); /* CONST */
  ------------------
  |  |   60|  8.85k|#define PORT_Free PORT_Free_Util
  ------------------
14301|  8.85k|    sslBuffer_Clear(&ss->ssl3.hs.greaseEchBuf);
14302|       |
14303|       |    /* TLS 1.3 GREASE (client) state. */
14304|  8.85k|    tls13_ClientGreaseDestroy(ss);
14305|       |
14306|       |    /* TLS ClientHello Extension Permutation state. */
14307|  8.85k|    tls_ClientHelloExtensionPermutationDestroy(ss);
14308|  8.85k|}
ssl3_ApplyNSSPolicy:
14404|      1|{
14405|      1|    unsigned i;
14406|      1|    SECStatus rv;
14407|      1|    PRUint32 policy = 0;
14408|       |
14409|      1|    rv = NSS_GetAlgorithmPolicy(SEC_OID_APPLY_SSL_POLICY, &policy);
14410|      1|    if (rv != SECSuccess || !(policy & NSS_USE_POLICY_IN_SSL)) {
  ------------------
  |  |  574|      1|#define NSS_USE_POLICY_IN_SSL 0x00000010           /* enable policy in SSL protocol */
  ------------------
  |  Branch (14410:9): [True: 0, False: 1]
  |  Branch (14410:29): [True: 1, False: 0]
  ------------------
14411|      1|        return SECSuccess; /* do nothing */
14412|      1|    }
14413|       |
14414|       |    /* disable every ciphersuite */
14415|      0|    for (i = 1; i < PR_ARRAY_SIZE(cipher_suite_defs); ++i) {
  ------------------
  |  |  167|      0|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (14415:17): [True: 0, False: 0]
  ------------------
14416|      0|        const ssl3CipherSuiteDef *suite = &cipher_suite_defs[i];
14417|      0|        SECOidTag policyOid;
14418|      0|        PRBool isDisabled = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
14419|       |
14420|       |        /* if we haven't explicitly disabled it below enable by policy */
14421|      0|        ssl_CipherPolicySet(suite->cipher_suite, SSL_ALLOWED);
  ------------------
  |  |  700|      0|#define SSL_ALLOWED 1
  ------------------
14422|       |
14423|       |        /* now check the various key exchange, ciphers and macs and
14424|       |         * if we ever disallow by policy, we are done, go to the next cipher
14425|       |         */
14426|      0|        policyOid = MAP_NULL(kea_defs[suite->key_exchange_alg].oid);
  ------------------
  |  |14400|      0|#define MAP_NULL(x) (((x) != 0) ? (x) : SEC_OID_NULL_CIPHER)
  |  |  ------------------
  |  |  |  Branch (14400:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
14427|      0|        if (ssl_HandlePolicy(suite->cipher_suite, policyOid,
  ------------------
  |  Branch (14427:13): [True: 0, False: 0]
  ------------------
14428|      0|                             NSS_USE_ALG_IN_SSL_KX, &isDisabled)) {
  ------------------
  |  |  572|      0|#define NSS_USE_ALG_IN_SSL_KX 0x00000004           /* used in SSL key exchange */
  ------------------
14429|      0|            continue;
14430|      0|        }
14431|       |
14432|      0|        policyOid = MAP_NULL(ssl_GetBulkCipherDef(suite)->oid);
  ------------------
  |  |14400|      0|#define MAP_NULL(x) (((x) != 0) ? (x) : SEC_OID_NULL_CIPHER)
  |  |  ------------------
  |  |  |  Branch (14400:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
14433|      0|        if (ssl_HandlePolicy(suite->cipher_suite, policyOid,
  ------------------
  |  Branch (14433:13): [True: 0, False: 0]
  ------------------
14434|      0|                             NSS_USE_ALG_IN_SSL, &isDisabled)) {
  ------------------
  |  |  573|      0|#define NSS_USE_ALG_IN_SSL 0x00000008              /* used in SSL record protocol */
  ------------------
14435|      0|            continue;
14436|      0|        }
14437|       |
14438|      0|        if (ssl_GetBulkCipherDef(suite)->type != type_aead) {
  ------------------
  |  Branch (14438:13): [True: 0, False: 0]
  ------------------
14439|      0|            policyOid = MAP_NULL(ssl_GetMacDefByAlg(suite->mac_alg)->oid);
  ------------------
  |  |14400|      0|#define MAP_NULL(x) (((x) != 0) ? (x) : SEC_OID_NULL_CIPHER)
  |  |  ------------------
  |  |  |  Branch (14400:22): [True: 0, False: 0]
  |  |  ------------------
  ------------------
14440|      0|            if (ssl_HandlePolicy(suite->cipher_suite, policyOid,
  ------------------
  |  Branch (14440:17): [True: 0, False: 0]
  ------------------
14441|      0|                                 NSS_USE_ALG_IN_SSL, &isDisabled)) {
  ------------------
  |  |  573|      0|#define NSS_USE_ALG_IN_SSL 0x00000008              /* used in SSL record protocol */
  ------------------
14442|      0|                continue;
14443|      0|            }
14444|      0|        }
14445|      0|    }
14446|       |
14447|      0|    rv = ssl3_ConstrainRangeByPolicy();
14448|       |
14449|      0|    return rv;
14450|      1|}
ssl3con.c:ssl_LookupCipherSuiteCfgMutable:
  661|   712k|{
  662|   712k|    int i;
  663|       |
  664|  25.9M|    for (i = 0; i < ssl_V3_SUITES_IMPLEMENTED; i++) {
  ------------------
  |  |  245|  25.9M|#define ssl_V3_SUITES_IMPLEMENTED 71
  ------------------
  |  Branch (664:17): [True: 25.9M, False: 0]
  ------------------
  665|  25.9M|        if (suites[i].cipher_suite == suite)
  ------------------
  |  Branch (665:13): [True: 712k, False: 25.2M]
  ------------------
  666|   712k|            return &suites[i];
  667|  25.9M|    }
  668|       |    /* return NULL and let the caller handle it.  */
  669|      0|    PORT_SetError(SSL_ERROR_UNKNOWN_CIPHER_SUITE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  670|      0|    return NULL;
  671|   712k|}
ssl3con.c:ssl_CheckSignatureSchemes:
  867|  17.8k|{
  868|  17.8k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_2) {
  ------------------
  |  |   20|  17.8k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (868:9): [True: 206, False: 17.6k]
  ------------------
  869|    206|        return SECSuccess;
  870|    206|    }
  871|       |
  872|       |    /* If this is a server using TLS 1.3, we just need to have one signature
  873|       |     * scheme for which we have a usable certificate.
  874|       |     *
  875|       |     * Note: Certificates for earlier TLS versions are checked along with the
  876|       |     * cipher suite in ssl3_config_match_init. */
  877|  17.6k|    if (ss->sec.isServer && ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (877:9): [True: 0, False: 17.6k]
  |  Branch (877:29): [True: 0, False: 0]
  ------------------
  878|      0|        PRBool foundCert = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  879|      0|        for (unsigned int i = 0; i < ss->ssl3.signatureSchemeCount; ++i) {
  ------------------
  |  Branch (879:34): [True: 0, False: 0]
  ------------------
  880|      0|            SSLAuthType authType =
  881|      0|                ssl_SignatureSchemeToAuthType(ss->ssl3.signatureSchemes[i]);
  882|      0|            if (ssl_HasCert(ss, ss->vrange.max, authType)) {
  ------------------
  |  Branch (882:17): [True: 0, False: 0]
  ------------------
  883|      0|                foundCert = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  884|      0|                break;
  885|      0|            }
  886|      0|        }
  887|      0|        if (!foundCert) {
  ------------------
  |  Branch (887:13): [True: 0, False: 0]
  ------------------
  888|      0|            PORT_SetError(SSL_ERROR_NO_SUPPORTED_SIGNATURE_ALGORITHM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  889|      0|            return SECFailure;
  890|      0|        }
  891|      0|    }
  892|       |
  893|       |    /* Ensure that there is a signature scheme that can be accepted.*/
  894|  17.6k|    for (unsigned int i = 0; i < ss->ssl3.signatureSchemeCount; ++i) {
  ------------------
  |  Branch (894:30): [True: 17.6k, False: 0]
  ------------------
  895|  17.6k|        if (ssl_SignatureSchemeAccepted(ss->vrange.min,
  ------------------
  |  Branch (895:13): [True: 17.6k, False: 0]
  ------------------
  896|  17.6k|                                        ss->ssl3.signatureSchemes[i],
  897|  17.6k|                                        PR_FALSE /* forCert */)) {
  ------------------
  |  |  438|  17.6k|#define PR_FALSE 0
  ------------------
  898|  17.6k|            return SECSuccess;
  899|  17.6k|        }
  900|  17.6k|    }
  901|      0|    PORT_SetError(SSL_ERROR_NO_SUPPORTED_SIGNATURE_ALGORITHM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  902|      0|    return SECFailure;
  903|  17.6k|}
ssl3con.c:ssl_KEAEnabled:
  695|   661k|{
  696|   661k|    switch (keaType) {
  697|   144k|        case ssl_kea_rsa:
  ------------------
  |  Branch (697:9): [True: 144k, False: 517k]
  ------------------
  698|   144k|            return PR_TRUE;
  ------------------
  |  |  437|   144k|#define PR_TRUE 1
  ------------------
  699|       |
  700|   216k|        case ssl_kea_dh:
  ------------------
  |  Branch (700:9): [True: 216k, False: 445k]
  ------------------
  701|   216k|        case ssl_kea_dh_psk: {
  ------------------
  |  Branch (701:9): [True: 0, False: 661k]
  ------------------
  702|   216k|            if (ss->sec.isServer && !ss->opt.enableServerDhe) {
  ------------------
  |  Branch (702:17): [True: 0, False: 216k]
  |  Branch (702:37): [True: 0, False: 0]
  ------------------
  703|      0|                return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  704|      0|            }
  705|       |
  706|   216k|            if (ss->sec.isServer) {
  ------------------
  |  Branch (706:17): [True: 0, False: 216k]
  ------------------
  707|       |                /* If the server requires named FFDHE groups, then the client
  708|       |                 * must have included an FFDHE group. peerSupportsFfdheGroups
  709|       |                 * is set to true in ssl_HandleSupportedGroupsXtn(). */
  710|      0|                if (ss->opt.requireDHENamedGroups &&
  ------------------
  |  Branch (710:21): [True: 0, False: 0]
  ------------------
  711|      0|                    !ss->xtnData.peerSupportsFfdheGroups) {
  ------------------
  |  Branch (711:21): [True: 0, False: 0]
  ------------------
  712|      0|                    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  713|      0|                }
  714|       |
  715|       |                /* We can use the weak DH group if all of these are true:
  716|       |                 * 1. We don't require named groups.
  717|       |                 * 2. The peer doesn't support named groups.
  718|       |                 * 3. This isn't TLS 1.3.
  719|       |                 * 4. The weak group is enabled. */
  720|      0|                if (!ss->opt.requireDHENamedGroups &&
  ------------------
  |  Branch (720:21): [True: 0, False: 0]
  ------------------
  721|      0|                    !ss->xtnData.peerSupportsFfdheGroups &&
  ------------------
  |  Branch (721:21): [True: 0, False: 0]
  ------------------
  722|      0|                    ss->version < SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (722:21): [True: 0, False: 0]
  ------------------
  723|      0|                    ss->ssl3.dheWeakGroupEnabled) {
  ------------------
  |  Branch (723:21): [True: 0, False: 0]
  ------------------
  724|      0|                    return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  725|      0|                }
  726|   216k|            } else {
  727|   216k|                if (ss->vrange.min < SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|   433k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (727:21): [True: 196k, False: 19.9k]
  ------------------
  728|   216k|                    !ss->opt.requireDHENamedGroups) {
  ------------------
  |  Branch (728:21): [True: 118k, False: 78.4k]
  ------------------
  729|       |                    /* The client enables DHE cipher suites even if no DHE groups
  730|       |                     * are enabled. Only if this isn't TLS 1.3 and named groups
  731|       |                     * are not required. */
  732|   118k|                    return PR_TRUE;
  ------------------
  |  |  437|   118k|#define PR_TRUE 1
  ------------------
  733|   118k|                }
  734|   216k|            }
  735|  98.3k|            return ssl_NamedGroupTypeEnabled(ss, ssl_kea_dh);
  736|   216k|        }
  737|       |
  738|   267k|        case ssl_kea_ecdh:
  ------------------
  |  Branch (738:9): [True: 267k, False: 393k]
  ------------------
  739|   267k|        case ssl_kea_ecdh_psk:
  ------------------
  |  Branch (739:9): [True: 0, False: 661k]
  ------------------
  740|   267k|            return ssl_NamedGroupTypeEnabled(ss, ssl_kea_ecdh);
  741|       |
  742|      0|        case ssl_kea_ecdh_hybrid:
  ------------------
  |  Branch (742:9): [True: 0, False: 661k]
  ------------------
  743|      0|        case ssl_kea_ecdh_hybrid_psk:
  ------------------
  |  Branch (743:9): [True: 0, False: 661k]
  ------------------
  744|      0|            if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (744:17): [True: 0, False: 0]
  ------------------
  745|      0|                return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  746|      0|            }
  747|      0|            return ssl_NamedGroupTypeEnabled(ss, ssl_kea_ecdh_hybrid);
  748|       |
  749|  32.6k|        case ssl_kea_tls13_any:
  ------------------
  |  Branch (749:9): [True: 32.6k, False: 629k]
  ------------------
  750|  32.6k|            return PR_TRUE;
  ------------------
  |  |  437|  32.6k|#define PR_TRUE 1
  ------------------
  751|       |
  752|      0|        case ssl_kea_fortezza:
  ------------------
  |  Branch (752:9): [True: 0, False: 661k]
  ------------------
  753|      0|        default:
  ------------------
  |  Branch (753:9): [True: 0, False: 661k]
  ------------------
  754|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  755|   661k|    }
  756|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  757|   661k|}
ssl3con.c:ssl_NamedGroupTypeEnabled:
  682|   366k|{
  683|   366k|    unsigned int i;
  684|   956k|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; ++i) {
  ------------------
  |  |  133|   956k|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (684:17): [True: 956k, False: 0]
  ------------------
  685|   956k|        if (ss->namedGroupPreferences[i] &&
  ------------------
  |  Branch (685:13): [True: 858k, False: 98.3k]
  ------------------
  686|   956k|            ss->namedGroupPreferences[i]->keaType == keaType) {
  ------------------
  |  Branch (686:13): [True: 366k, False: 491k]
  ------------------
  687|   366k|            return PR_TRUE;
  ------------------
  |  |  437|   366k|#define PR_TRUE 1
  ------------------
  688|   366k|        }
  689|   956k|    }
  690|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  691|   366k|}
ssl3con.c:ssl3_SetupPendingCipherSpec:
 1655|  11.1k|{
 1656|  11.1k|    ssl3CipherSpec *spec;
 1657|  11.1k|    const ssl3CipherSpec *prev;
 1658|       |
 1659|  11.1k|    prev = (direction == ssl_secret_write) ? ss->ssl3.cwSpec : ss->ssl3.crSpec;
  ------------------
  |  Branch (1659:12): [True: 5.56k, False: 5.56k]
  ------------------
 1660|  11.1k|    if (prev->epoch == PR_UINT16_MAX) {
  ------------------
  |  |  270|  11.1k|#define PR_UINT16_MAX 65535U
  ------------------
  |  Branch (1660:9): [True: 0, False: 11.1k]
  ------------------
 1661|      0|        PORT_SetError(SSL_ERROR_RENEGOTIATION_NOT_ALLOWED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1662|      0|        return SECFailure;
 1663|      0|    }
 1664|       |
 1665|  11.1k|    spec = ssl_CreateCipherSpec(ss, direction);
 1666|  11.1k|    if (!spec) {
  ------------------
  |  Branch (1666:9): [True: 0, False: 11.1k]
  ------------------
 1667|      0|        return SECFailure;
 1668|      0|    }
 1669|       |
 1670|  11.1k|    spec->cipherDef = ssl_GetBulkCipherDef(suiteDef);
 1671|  11.1k|    spec->macDef = ssl_GetMacDef(ss, suiteDef);
 1672|       |
 1673|  11.1k|    spec->epoch = prev->epoch + 1;
 1674|  11.1k|    spec->nextSeqNum = 0;
 1675|  11.1k|    if (IS_DTLS(ss) && direction == ssl_secret_read) {
  ------------------
  |  |  892|  22.2k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 11.1k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1675:24): [True: 5.56k, False: 5.56k]
  ------------------
 1676|  5.56k|        dtls_InitRecvdRecords(&spec->recvdRecords);
 1677|  5.56k|    }
 1678|  11.1k|    ssl_SetSpecVersions(ss, spec);
 1679|       |
 1680|  11.1k|    ssl_SaveCipherSpec(ss, spec);
 1681|  11.1k|    *specp = spec;
 1682|  11.1k|    return SECSuccess;
 1683|  11.1k|}
ssl3con.c:ssl3_InitPendingContexts:
 1817|  3.52k|{
 1818|  3.52k|    CK_MECHANISM_TYPE encMechanism;
 1819|  3.52k|    CK_ATTRIBUTE_TYPE encMode;
 1820|  3.52k|    SECItem macParam;
 1821|  3.52k|    CK_ULONG macLength;
 1822|  3.52k|    SECItem iv;
 1823|  3.52k|    SSLCipherAlgorithm calg;
 1824|       |
 1825|  3.52k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  3.52k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.32k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.72k, False: 1.80k]
  |  |  |  |  |  Branch (208:7): [True: 1.80k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1826|  3.52k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSpecWriteLock(ss));
  ------------------
  |  |  120|  3.52k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  5.32k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.72k, False: 1.80k]
  |  |  |  |  |  Branch (208:7): [True: 1.80k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1827|       |
 1828|  3.52k|    calg = spec->cipherDef->calg;
 1829|  3.52k|    PORT_Assert(alg2Mech[calg].calg == calg);
  ------------------
  |  |  120|  3.52k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1830|       |
 1831|  3.52k|    if (spec->cipherDef->type != type_aead) {
  ------------------
  |  Branch (1831:9): [True: 3.15k, False: 370]
  ------------------
 1832|  3.15k|        macLength = spec->macDef->mac_size;
 1833|       |
 1834|       |        /*
 1835|       |        ** Now setup the MAC contexts,
 1836|       |        **   crypto contexts are setup below.
 1837|       |        */
 1838|  3.15k|        macParam.data = (unsigned char *)&macLength;
 1839|  3.15k|        macParam.len = sizeof(macLength);
 1840|  3.15k|        macParam.type = siBuffer;
 1841|       |
 1842|  3.15k|        spec->keyMaterial.macContext = PK11_CreateContextBySymKey(
 1843|  3.15k|            spec->macDef->mmech, CKA_SIGN, spec->keyMaterial.macKey, &macParam);
  ------------------
  |  |  551|  3.15k|#define CKA_SIGN 0x00000108UL
  ------------------
 1844|  3.15k|        if (!spec->keyMaterial.macContext) {
  ------------------
  |  Branch (1844:13): [True: 0, False: 3.15k]
  ------------------
 1845|      0|            ssl_MapLowLevelError(SSL_ERROR_SYM_KEY_CONTEXT_FAILURE);
 1846|      0|            return SECFailure;
 1847|      0|        }
 1848|  3.15k|    }
 1849|       |
 1850|       |    /*
 1851|       |    ** Now setup the crypto contexts.
 1852|       |    */
 1853|  3.52k|    if (calg == ssl_calg_null) {
  ------------------
  |  Branch (1853:9): [True: 748, False: 2.77k]
  ------------------
 1854|    748|        spec->cipher = Null_Cipher;
 1855|    748|        return SECSuccess;
 1856|    748|    }
 1857|       |
 1858|  2.77k|    encMechanism = ssl3_Alg2Mech(calg);
 1859|  2.77k|    encMode = (spec->direction == ssl_secret_write) ? CKA_ENCRYPT : CKA_DECRYPT;
  ------------------
  |  |  547|  1.38k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
                  encMode = (spec->direction == ssl_secret_write) ? CKA_ENCRYPT : CKA_DECRYPT;
  ------------------
  |  |  548|  4.15k|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (1859:15): [True: 1.38k, False: 1.38k]
  ------------------
 1860|  2.77k|    if (spec->cipherDef->type == type_aead) {
  ------------------
  |  Branch (1860:9): [True: 370, False: 2.40k]
  ------------------
 1861|    370|        encMode |= CKA_NSS_MESSAGE;
  ------------------
  |  |   69|    370|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
 1862|    370|        iv.data = NULL;
 1863|    370|        iv.len = 0;
 1864|  2.40k|    } else {
 1865|  2.40k|        spec->cipher = SSLCipher_PK11_CipherOp;
 1866|  2.40k|        iv.data = spec->keyMaterial.iv;
 1867|  2.40k|        iv.len = spec->cipherDef->iv_size;
 1868|  2.40k|    }
 1869|       |
 1870|       |    /*
 1871|       |     * build the context
 1872|       |     */
 1873|  2.77k|    spec->cipherContext = PK11_CreateContextBySymKey(encMechanism, encMode,
 1874|  2.77k|                                                     spec->keyMaterial.key,
 1875|  2.77k|                                                     &iv);
 1876|  2.77k|    if (!spec->cipherContext) {
  ------------------
  |  Branch (1876:9): [True: 0, False: 2.77k]
  ------------------
 1877|      0|        ssl_MapLowLevelError(SSL_ERROR_SYM_KEY_CONTEXT_FAILURE);
 1878|      0|        return SECFailure;
 1879|      0|    }
 1880|       |
 1881|  2.77k|    return SECSuccess;
 1882|  2.77k|}
ssl3con.c:ssl3_ClientAuthTokenPresent:
 2108|  1.50M|{
 2109|  1.50M|    PK11SlotInfo *slot = NULL;
 2110|  1.50M|    PRBool isPresent = PR_TRUE;
  ------------------
  |  |  437|  1.50M|#define PR_TRUE 1
  ------------------
 2111|       |
 2112|       |    /* we only care if we are doing client auth */
 2113|  1.50M|    if (!sid || !sid->u.ssl3.clAuthValid) {
  ------------------
  |  Branch (2113:9): [True: 0, False: 1.50M]
  |  Branch (2113:17): [True: 1.50M, False: 0]
  ------------------
 2114|  1.50M|        return PR_TRUE;
  ------------------
  |  |  437|  1.50M|#define PR_TRUE 1
  ------------------
 2115|  1.50M|    }
 2116|       |
 2117|       |    /* get the slot */
 2118|      0|    slot = SECMOD_LookupSlot(sid->u.ssl3.clAuthModuleID,
 2119|      0|                             sid->u.ssl3.clAuthSlotID);
 2120|      0|    if (slot == NULL ||
  ------------------
  |  Branch (2120:9): [True: 0, False: 0]
  ------------------
 2121|      0|        !PK11_IsPresent(slot) ||
  ------------------
  |  Branch (2121:9): [True: 0, False: 0]
  ------------------
 2122|      0|        sid->u.ssl3.clAuthSeries != PK11_GetSlotSeries(slot) ||
  ------------------
  |  Branch (2122:9): [True: 0, False: 0]
  ------------------
 2123|      0|        sid->u.ssl3.clAuthSlotID != PK11_GetSlotID(slot) ||
  ------------------
  |  Branch (2123:9): [True: 0, False: 0]
  ------------------
 2124|      0|        sid->u.ssl3.clAuthModuleID != PK11_GetModuleID(slot) ||
  ------------------
  |  Branch (2124:9): [True: 0, False: 0]
  ------------------
 2125|      0|        (PK11_NeedLogin(slot) && !PK11_IsLoggedIn(slot, NULL))) {
  ------------------
  |  Branch (2125:10): [True: 0, False: 0]
  |  Branch (2125:34): [True: 0, False: 0]
  ------------------
 2126|      0|        isPresent = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 2127|      0|    }
 2128|      0|    if (slot) {
  ------------------
  |  Branch (2128:9): [True: 0, False: 0]
  ------------------
 2129|      0|        PK11_FreeSlot(slot);
 2130|      0|    }
 2131|      0|    return isPresent;
 2132|  1.50M|}
ssl3con.c:ssl3_GetMgfMechanismByHashType:
 3386|  1.08k|{
 3387|  1.08k|    switch (hash) {
 3388|    913|        case ssl_hash_sha256:
  ------------------
  |  Branch (3388:9): [True: 913, False: 169]
  ------------------
 3389|    913|            return CKG_MGF1_SHA256;
  ------------------
  |  | 1649|    913|#define CKG_MGF1_SHA256 0x00000002UL
  ------------------
 3390|    109|        case ssl_hash_sha384:
  ------------------
  |  Branch (3390:9): [True: 109, False: 973]
  ------------------
 3391|    109|            return CKG_MGF1_SHA384;
  ------------------
  |  | 1650|    109|#define CKG_MGF1_SHA384 0x00000003UL
  ------------------
 3392|     60|        case ssl_hash_sha512:
  ------------------
  |  Branch (3392:9): [True: 60, False: 1.02k]
  ------------------
 3393|     60|            return CKG_MGF1_SHA512;
  ------------------
  |  | 1651|     60|#define CKG_MGF1_SHA512 0x00000004UL
  ------------------
 3394|      0|        default:
  ------------------
  |  Branch (3394:9): [True: 0, False: 1.08k]
  ------------------
 3395|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3396|  1.08k|    }
 3397|      0|    return CKG_MGF1_SHA256;
  ------------------
  |  | 1649|      0|#define CKG_MGF1_SHA256 0x00000002UL
  ------------------
 3398|  1.08k|}
ssl3con.c:ssl3_GetHashMechanismByHashType:
 3403|  7.00k|{
 3404|  7.00k|    switch (hashType) {
 3405|     60|        case ssl_hash_sha512:
  ------------------
  |  Branch (3405:9): [True: 60, False: 6.94k]
  ------------------
 3406|     60|            return CKM_SHA512;
  ------------------
  |  |  882|     60|#define CKM_SHA512 0x00000270UL
  ------------------
 3407|    639|        case ssl_hash_sha384:
  ------------------
  |  Branch (3407:9): [True: 639, False: 6.36k]
  ------------------
 3408|    639|            return CKM_SHA384;
  ------------------
  |  |  879|    639|#define CKM_SHA384 0x00000260UL
  ------------------
 3409|  2.48k|        case ssl_hash_sha256:
  ------------------
  |  Branch (3409:9): [True: 2.48k, False: 4.52k]
  ------------------
 3410|  6.30k|        case ssl_hash_none:
  ------------------
  |  Branch (3410:9): [True: 3.82k, False: 3.17k]
  ------------------
 3411|       |            /* ssl_hash_none is for pre-1.2 suites, which use SHA-256. */
 3412|  6.30k|            return CKM_SHA256;
  ------------------
  |  |  876|  6.30k|#define CKM_SHA256 0x00000250UL
  ------------------
 3413|      0|        case ssl_hash_sha1:
  ------------------
  |  Branch (3413:9): [True: 0, False: 7.00k]
  ------------------
 3414|      0|            return CKM_SHA_1;
  ------------------
  |  |  859|      0|#define CKM_SHA_1 0x00000220UL
  ------------------
 3415|      0|        default:
  ------------------
  |  Branch (3415:9): [True: 0, False: 7.00k]
  ------------------
 3416|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3417|  7.00k|    }
 3418|      0|    return CKM_SHA256;
  ------------------
  |  |  876|      0|#define CKM_SHA256 0x00000250UL
  ------------------
 3419|  7.00k|}
ssl3con.c:ssl3_ComputeMasterSecret:
 3665|  1.76k|{
 3666|  1.76k|    PORT_Assert(pms != NULL);
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3667|  1.76k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.66k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 860, False: 900]
  |  |  |  |  |  Branch (208:7): [True: 900, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3668|       |
 3669|  1.76k|    if (ssl3_ExtensionNegotiated(ss, ssl_extended_master_secret_xtn)) {
  ------------------
  |  Branch (3669:9): [True: 31, False: 1.72k]
  ------------------
 3670|     31|        return tls_ComputeExtendedMasterSecretInt(ss, pms, msp);
 3671|  1.72k|    } else {
 3672|  1.72k|        return ssl3_ComputeMasterSecretInt(ss, pms, msp);
 3673|  1.72k|    }
 3674|  1.76k|}
ssl3con.c:tls_ComputeExtendedMasterSecretInt:
 3600|     31|{
 3601|     31|    ssl3CipherSpec *pwSpec = ss->ssl3.pwSpec;
 3602|     31|    CK_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_PARAMS extended_master_params;
 3603|     31|    SSL3Hashes hashes;
 3604|       |
 3605|       |    /*
 3606|       |     * Determine whether to use the DH/ECDH or RSA derivation modes.
 3607|       |     */
 3608|       |    /*
 3609|       |     * TODO(ekr@rtfm.com): Verify that the slot can handle this key expansion
 3610|       |     * mode. Bug 1198298 */
 3611|     31|    PRBool isDH = (PRBool)((ss->ssl3.hs.kea_def->exchKeyType == ssl_kea_dh) ||
  ------------------
  |  Branch (3611:28): [True: 8, False: 23]
  ------------------
 3612|     31|                           (ss->ssl3.hs.kea_def->exchKeyType == ssl_kea_ecdh) ||
  ------------------
  |  Branch (3612:28): [True: 21, False: 2]
  ------------------
 3613|     31|                           (ss->ssl3.hs.kea_def->exchKeyType == ssl_kea_ecdh_hybrid));
  ------------------
  |  Branch (3613:28): [True: 0, False: 2]
  ------------------
 3614|     31|    CK_MECHANISM_TYPE master_derive;
 3615|     31|    CK_MECHANISM_TYPE key_derive;
 3616|     31|    SECItem params;
 3617|     31|    const CK_FLAGS keyFlags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1356|     31|#define CKF_SIGN 0x00000800UL
  ------------------
                  const CK_FLAGS keyFlags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1358|     31|#define CKF_VERIFY 0x00002000
  ------------------
 3618|     31|    CK_VERSION pms_version;
 3619|     31|    CK_VERSION *pms_version_ptr = NULL;
 3620|     31|    SECStatus rv;
 3621|       |
 3622|     31|    rv = ssl3_ComputeHandshakeHashes(ss, pwSpec, &hashes, 0);
 3623|     31|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3623:9): [True: 0, False: 31]
  ------------------
 3624|      0|        PORT_Assert(0); /* Should never fail */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3625|      0|        ssl_MapLowLevelError(SSL_ERROR_SESSION_KEY_GEN_FAILURE);
 3626|      0|        return SECFailure;
 3627|      0|    }
 3628|       |
 3629|     31|    if (isDH) {
  ------------------
  |  Branch (3629:9): [True: 29, False: 2]
  ------------------
 3630|     29|        master_derive = CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH;
  ------------------
  |  |  240|     29|#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE_DH (CKM_NSS + 26)
  |  |  ------------------
  |  |  |  |  162|     29|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|     29|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|     29|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3631|     29|    } else {
 3632|      2|        master_derive = CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE;
  ------------------
  |  |  239|      2|#define CKM_NSS_TLS_EXTENDED_MASTER_KEY_DERIVE (CKM_NSS + 25)
  |  |  ------------------
  |  |  |  |  162|      2|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      2|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|      2|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3633|      2|        pms_version_ptr = &pms_version;
 3634|      2|    }
 3635|       |
 3636|     31|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_2) {
  ------------------
  |  |   20|     31|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (3636:9): [True: 17, False: 14]
  ------------------
 3637|       |        /* TLS 1.2+ */
 3638|     17|        extended_master_params.prfHashMechanism = ssl3_GetPrfHashMechanism(ss);
 3639|     17|        key_derive = CKM_TLS12_KEY_AND_MAC_DERIVE;
  ------------------
  |  | 1027|     17|#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1UL
  ------------------
 3640|     17|    } else {
 3641|       |        /* TLS < 1.2 */
 3642|     14|        extended_master_params.prfHashMechanism = CKM_TLS_PRF;
  ------------------
  |  |  973|     14|#define CKM_TLS_PRF 0x00000378UL
  ------------------
 3643|     14|        key_derive = CKM_TLS_KEY_AND_MAC_DERIVE;
  ------------------
  |  |  969|     14|#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL
  ------------------
 3644|     14|    }
 3645|       |
 3646|     31|    extended_master_params.pVersion = pms_version_ptr;
 3647|     31|    extended_master_params.pSessionHash = hashes.u.raw;
 3648|     31|    extended_master_params.ulSessionHashLen = hashes.len;
 3649|       |
 3650|     31|    params.data = (unsigned char *)&extended_master_params;
 3651|     31|    params.len = sizeof extended_master_params;
 3652|       |
 3653|     31|    return ssl3_ComputeMasterSecretFinish(ss, master_derive, key_derive,
 3654|     31|                                          pms_version_ptr, &params,
 3655|     31|                                          keyFlags, pms, msp);
 3656|     31|}
ssl3con.c:ssl3_ComputeMasterSecretFinish:
 3458|  1.76k|{
 3459|  1.76k|    PK11SymKey *ms = NULL;
 3460|       |
 3461|  1.76k|    ms = PK11_DeriveWithFlags(pms, master_derive,
 3462|  1.76k|                              params, key_derive,
 3463|  1.76k|                              CKA_DERIVE, 0, keyFlags);
  ------------------
  |  |  555|  1.76k|#define CKA_DERIVE 0x0000010CUL
  ------------------
 3464|  1.76k|    if (!ms) {
  ------------------
  |  Branch (3464:9): [True: 0, False: 1.76k]
  ------------------
 3465|      0|        ssl_MapLowLevelError(SSL_ERROR_SESSION_KEY_GEN_FAILURE);
 3466|      0|        return SECFailure;
 3467|      0|    }
 3468|       |
 3469|  1.76k|    if (pms_version && ss->opt.detectRollBack) {
  ------------------
  |  Branch (3469:9): [True: 1.08k, False: 678]
  |  Branch (3469:24): [True: 1.08k, False: 0]
  ------------------
 3470|  1.08k|        SSL3ProtocolVersion client_version;
 3471|  1.08k|        client_version = pms_version->major << 8 | pms_version->minor;
 3472|       |
 3473|  1.08k|        if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  1.08k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 1.08k, False: 0]
  |  |  ------------------
  ------------------
 3474|  1.08k|            client_version = dtls_DTLSVersionToTLSVersion(client_version);
 3475|  1.08k|        }
 3476|       |
 3477|  1.08k|        if (client_version != ss->clientHelloVersion) {
  ------------------
  |  Branch (3477:13): [True: 0, False: 1.08k]
  ------------------
 3478|       |            /* Destroy MS.  Version roll-back detected. */
 3479|      0|            PK11_FreeSymKey(ms);
 3480|      0|            ssl_MapLowLevelError(SSL_ERROR_SESSION_KEY_GEN_FAILURE);
 3481|      0|            return SECFailure;
 3482|      0|        }
 3483|  1.08k|    }
 3484|       |
 3485|  1.76k|    if (msp) {
  ------------------
  |  Branch (3485:9): [True: 1.76k, False: 0]
  ------------------
 3486|  1.76k|        *msp = ms;
 3487|  1.76k|    } else {
 3488|      0|        PK11_FreeSymKey(ms);
 3489|      0|    }
 3490|       |
 3491|  1.76k|    return SECSuccess;
 3492|  1.76k|}
ssl3con.c:ssl3_ComputeMasterSecretInt:
 3502|  1.72k|{
 3503|  1.72k|    PRBool isTLS = (PRBool)(ss->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|  1.72k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
 3504|  1.72k|    PRBool isTLS12 = (PRBool)(ss->version >= SSL_LIBRARY_VERSION_TLS_1_2);
  ------------------
  |  |   20|  1.72k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
 3505|       |    /*
 3506|       |     * Whenever isDH is true, we need to use CKM_TLS_MASTER_KEY_DERIVE_DH
 3507|       |     * which, unlike CKM_TLS_MASTER_KEY_DERIVE, converts arbitrary size
 3508|       |     * data into a 48-byte value, and does not expect to return the version.
 3509|       |     */
 3510|  1.72k|    PRBool isDH = (PRBool)((ss->ssl3.hs.kea_def->exchKeyType == ssl_kea_dh) ||
  ------------------
  |  Branch (3510:28): [True: 403, False: 1.32k]
  ------------------
 3511|  1.72k|                           (ss->ssl3.hs.kea_def->exchKeyType == ssl_kea_ecdh) ||
  ------------------
  |  Branch (3511:28): [True: 246, False: 1.08k]
  ------------------
 3512|  1.72k|                           (ss->ssl3.hs.kea_def->exchKeyType == ssl_kea_ecdh_hybrid));
  ------------------
  |  Branch (3512:28): [True: 0, False: 1.08k]
  ------------------
 3513|  1.72k|    CK_MECHANISM_TYPE master_derive;
 3514|  1.72k|    CK_MECHANISM_TYPE key_derive;
 3515|  1.72k|    SECItem params;
 3516|  1.72k|    CK_FLAGS keyFlags;
 3517|  1.72k|    CK_VERSION pms_version;
 3518|  1.72k|    CK_VERSION *pms_version_ptr = NULL;
 3519|       |    /* master_params may be used as a CK_SSL3_MASTER_KEY_DERIVE_PARAMS */
 3520|  1.72k|    CK_TLS12_MASTER_KEY_DERIVE_PARAMS master_params;
 3521|  1.72k|    unsigned int master_params_len;
 3522|       |
 3523|       |    /* if we are using TLS and we aren't using the extended master secret,
 3524|       |     * and SEC_OID_TLS_REQUIRE_EMS policy is true, fail. The caller will
 3525|       |     * send an alert (eventually). In the RSA Server case, the alert
 3526|       |     * won't happen until Finish time because the upper level code
 3527|       |     * can't tell a difference between this failure and an RSA decrypt
 3528|       |     * failure, so it will proceed with a faux key */
 3529|  1.72k|    if (isTLS) {
  ------------------
  |  Branch (3529:9): [True: 1.72k, False: 0]
  ------------------
 3530|  1.72k|        PRUint32 policy;
 3531|  1.72k|        SECStatus rv;
 3532|       |
 3533|       |        /* first fetch the policy for this algorithm */
 3534|  1.72k|        rv = NSS_GetAlgorithmPolicy(SEC_OID_TLS_REQUIRE_EMS, &policy);
 3535|       |        /* we only look at the policy if we can fetch it. */
 3536|  1.72k|        if ((rv == SECSuccess) && (policy & NSS_USE_ALG_IN_SSL_KX)) {
  ------------------
  |  |  572|  1.72k|#define NSS_USE_ALG_IN_SSL_KX 0x00000004           /* used in SSL key exchange */
  ------------------
  |  Branch (3536:13): [True: 1.72k, False: 0]
  |  Branch (3536:35): [True: 0, False: 1.72k]
  ------------------
 3537|       |            /* just set the error, we don't want to map any errors
 3538|       |             * set by NSS_GetAlgorithmPolicy here */
 3539|      0|            PORT_SetError(SSL_ERROR_MISSING_EXTENDED_MASTER_SECRET);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3540|      0|            return SECFailure;
 3541|      0|        }
 3542|  1.72k|    }
 3543|       |
 3544|  1.72k|    if (isTLS12) {
  ------------------
  |  Branch (3544:9): [True: 1.58k, False: 143]
  ------------------
 3545|  1.58k|        if (isDH)
  ------------------
  |  Branch (3545:13): [True: 541, False: 1.04k]
  ------------------
 3546|    541|            master_derive = CKM_TLS12_MASTER_KEY_DERIVE_DH;
  ------------------
  |  | 1028|    541|#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2UL
  ------------------
 3547|  1.04k|        else
 3548|  1.04k|            master_derive = CKM_TLS12_MASTER_KEY_DERIVE;
  ------------------
  |  | 1026|  1.04k|#define CKM_TLS12_MASTER_KEY_DERIVE 0x000003E0UL
  ------------------
 3549|  1.58k|        key_derive = CKM_TLS12_KEY_AND_MAC_DERIVE;
  ------------------
  |  | 1027|  1.58k|#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1UL
  ------------------
 3550|  1.58k|        keyFlags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1356|  1.58k|#define CKF_SIGN 0x00000800UL
  ------------------
                      keyFlags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1358|  1.58k|#define CKF_VERIFY 0x00002000
  ------------------
 3551|  1.58k|    } else if (isTLS) {
  ------------------
  |  Branch (3551:16): [True: 143, False: 0]
  ------------------
 3552|    143|        if (isDH)
  ------------------
  |  Branch (3552:13): [True: 108, False: 35]
  ------------------
 3553|    108|            master_derive = CKM_TLS_MASTER_KEY_DERIVE_DH;
  ------------------
  |  |  970|    108|#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL
  ------------------
 3554|     35|        else
 3555|     35|            master_derive = CKM_TLS_MASTER_KEY_DERIVE;
  ------------------
  |  |  968|     35|#define CKM_TLS_MASTER_KEY_DERIVE 0x00000375UL
  ------------------
 3556|    143|        key_derive = CKM_TLS_KEY_AND_MAC_DERIVE;
  ------------------
  |  |  969|    143|#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL
  ------------------
 3557|    143|        keyFlags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1356|    143|#define CKF_SIGN 0x00000800UL
  ------------------
                      keyFlags = CKF_SIGN | CKF_VERIFY;
  ------------------
  |  | 1358|    143|#define CKF_VERIFY 0x00002000
  ------------------
 3558|    143|    } else {
 3559|      0|        if (isDH)
  ------------------
  |  Branch (3559:13): [True: 0, False: 0]
  ------------------
 3560|      0|            master_derive = CKM_SSL3_MASTER_KEY_DERIVE_DH;
  ------------------
  |  |  966|      0|#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL
  ------------------
 3561|      0|        else
 3562|      0|            master_derive = CKM_SSL3_MASTER_KEY_DERIVE;
  ------------------
  |  |  960|      0|#define CKM_SSL3_MASTER_KEY_DERIVE 0x00000371UL
  ------------------
 3563|      0|        key_derive = CKM_SSL3_KEY_AND_MAC_DERIVE;
  ------------------
  |  |  961|      0|#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL
  ------------------
 3564|      0|        keyFlags = 0;
 3565|      0|    }
 3566|       |
 3567|  1.72k|    if (!isDH) {
  ------------------
  |  Branch (3567:9): [True: 1.08k, False: 649]
  ------------------
 3568|  1.08k|        pms_version_ptr = &pms_version;
 3569|  1.08k|    }
 3570|       |
 3571|  1.72k|    master_params.pVersion = pms_version_ptr;
 3572|  1.72k|    master_params.RandomInfo.pClientRandom = ss->ssl3.hs.client_random;
 3573|  1.72k|    master_params.RandomInfo.ulClientRandomLen = SSL3_RANDOM_LENGTH;
  ------------------
  |  |   24|  1.72k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 3574|  1.72k|    master_params.RandomInfo.pServerRandom = ss->ssl3.hs.server_random;
 3575|  1.72k|    master_params.RandomInfo.ulServerRandomLen = SSL3_RANDOM_LENGTH;
  ------------------
  |  |   24|  1.72k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 3576|  1.72k|    if (isTLS12) {
  ------------------
  |  Branch (3576:9): [True: 1.58k, False: 143]
  ------------------
 3577|  1.58k|        master_params.prfHashMechanism = ssl3_GetPrfHashMechanism(ss);
 3578|  1.58k|        master_params_len = sizeof(CK_TLS12_MASTER_KEY_DERIVE_PARAMS);
 3579|  1.58k|    } else {
 3580|       |        /* prfHashMechanism is not relevant with this PRF */
 3581|    143|        master_params_len = sizeof(CK_SSL3_MASTER_KEY_DERIVE_PARAMS);
 3582|    143|    }
 3583|       |
 3584|  1.72k|    params.data = (unsigned char *)&master_params;
 3585|  1.72k|    params.len = master_params_len;
 3586|       |
 3587|  1.72k|    return ssl3_ComputeMasterSecretFinish(ss, master_derive, key_derive,
 3588|  1.72k|                                          pms_version_ptr, &params,
 3589|  1.72k|                                          keyFlags, pms, msp);
 3590|  1.72k|}
ssl3con.c:ssl3_DeriveConnectionKeys:
 3693|  1.76k|{
 3694|  1.76k|    ssl3CipherSpec *pwSpec = ss->ssl3.pwSpec;
 3695|  1.76k|    ssl3CipherSpec *prSpec = ss->ssl3.prSpec;
 3696|  1.76k|    ssl3CipherSpec *clientSpec;
 3697|  1.76k|    ssl3CipherSpec *serverSpec;
 3698|  1.76k|    PRBool isTLS = (PRBool)(ss->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|  1.76k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
 3699|  1.76k|    PRBool isTLS12 =
 3700|  1.76k|        (PRBool)(isTLS && ss->version >= SSL_LIBRARY_VERSION_TLS_1_2);
  ------------------
  |  |   20|  1.76k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (3700:18): [True: 1.76k, False: 0]
  |  Branch (3700:27): [True: 1.60k, False: 157]
  ------------------
 3701|  1.76k|    const ssl3BulkCipherDef *cipher_def = pwSpec->cipherDef;
 3702|  1.76k|    PK11SlotInfo *slot = NULL;
 3703|  1.76k|    PK11SymKey *derivedKeyHandle = NULL;
 3704|  1.76k|    void *pwArg = ss->pkcs11PinArg;
 3705|  1.76k|    int keySize;
 3706|  1.76k|    CK_TLS12_KEY_MAT_PARAMS key_material_params; /* may be used as a
 3707|       |                                                  * CK_SSL3_KEY_MAT_PARAMS */
 3708|  1.76k|    unsigned int key_material_params_len;
 3709|  1.76k|    CK_SSL3_KEY_MAT_OUT returnedKeys;
 3710|  1.76k|    CK_MECHANISM_TYPE key_derive;
 3711|  1.76k|    CK_MECHANISM_TYPE bulk_mechanism;
 3712|  1.76k|    SSLCipherAlgorithm calg;
 3713|  1.76k|    SECItem params;
 3714|  1.76k|    PRBool skipKeysAndIVs = (PRBool)(cipher_def->calg == ssl_calg_null);
 3715|       |
 3716|  1.76k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.66k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 860, False: 900]
  |  |  |  |  |  Branch (208:7): [True: 900, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3717|  1.76k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSpecWriteLock(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.66k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 860, False: 900]
  |  |  |  |  |  Branch (208:7): [True: 900, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3718|  1.76k|    PORT_Assert(masterSecret);
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3719|       |
 3720|       |    /* These functions operate in terms of who is writing specs. */
 3721|  1.76k|    if (ss->sec.isServer) {
  ------------------
  |  Branch (3721:9): [True: 0, False: 1.76k]
  ------------------
 3722|      0|        clientSpec = prSpec;
 3723|      0|        serverSpec = pwSpec;
 3724|  1.76k|    } else {
 3725|  1.76k|        clientSpec = pwSpec;
 3726|  1.76k|        serverSpec = prSpec;
 3727|  1.76k|    }
 3728|       |
 3729|       |    /*
 3730|       |     * generate the key material
 3731|       |     */
 3732|  1.76k|    if (cipher_def->type == type_block &&
  ------------------
  |  Branch (3732:9): [True: 1.20k, False: 559]
  ------------------
 3733|  1.76k|        ss->version >= SSL_LIBRARY_VERSION_TLS_1_1) {
  ------------------
  |  |   19|  1.20k|#define SSL_LIBRARY_VERSION_TLS_1_1             0x0302
  ------------------
  |  Branch (3733:9): [True: 1.20k, False: 0]
  ------------------
 3734|       |        /* Block ciphers in >= TLS 1.1 use a per-record, explicit IV. */
 3735|  1.20k|        key_material_params.ulIVSizeInBits = 0;
 3736|  1.20k|        PORT_Memset(clientSpec->keyMaterial.iv, 0, cipher_def->iv_size);
  ------------------
  |  |  182|  1.20k|#define PORT_Memset memset
  ------------------
 3737|  1.20k|        PORT_Memset(serverSpec->keyMaterial.iv, 0, cipher_def->iv_size);
  ------------------
  |  |  182|  1.20k|#define PORT_Memset memset
  ------------------
 3738|  1.20k|    }
 3739|       |
 3740|  1.76k|    key_material_params.bIsExport = PR_FALSE;
  ------------------
  |  |  438|  1.76k|#define PR_FALSE 0
  ------------------
 3741|  1.76k|    key_material_params.RandomInfo.pClientRandom = ss->ssl3.hs.client_random;
 3742|  1.76k|    key_material_params.RandomInfo.ulClientRandomLen = SSL3_RANDOM_LENGTH;
  ------------------
  |  |   24|  1.76k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 3743|  1.76k|    key_material_params.RandomInfo.pServerRandom = ss->ssl3.hs.server_random;
 3744|  1.76k|    key_material_params.RandomInfo.ulServerRandomLen = SSL3_RANDOM_LENGTH;
  ------------------
  |  |   24|  1.76k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 3745|  1.76k|    key_material_params.pReturnedKeyMaterial = &returnedKeys;
 3746|       |
 3747|  1.76k|    if (skipKeysAndIVs) {
  ------------------
  |  Branch (3747:9): [True: 374, False: 1.38k]
  ------------------
 3748|    374|        keySize = 0;
 3749|    374|        returnedKeys.pIVClient = NULL;
 3750|    374|        returnedKeys.pIVServer = NULL;
 3751|    374|        key_material_params.ulKeySizeInBits = 0;
 3752|    374|        key_material_params.ulIVSizeInBits = 0;
 3753|  1.38k|    } else {
 3754|  1.38k|        keySize = cipher_def->key_size;
 3755|  1.38k|        returnedKeys.pIVClient = clientSpec->keyMaterial.iv;
 3756|  1.38k|        returnedKeys.pIVServer = serverSpec->keyMaterial.iv;
 3757|  1.38k|        key_material_params.ulKeySizeInBits = cipher_def->secret_key_size * BPB;
  ------------------
  |  |  122|  1.38k|#define BPB 8 /* Bits Per Byte */
  ------------------
 3758|  1.38k|        key_material_params.ulIVSizeInBits = cipher_def->iv_size * BPB;
  ------------------
  |  |  122|  1.38k|#define BPB 8 /* Bits Per Byte */
  ------------------
 3759|  1.38k|    }
 3760|  1.76k|    key_material_params.ulMacSizeInBits = pwSpec->macDef->mac_size * BPB;
  ------------------
  |  |  122|  1.76k|#define BPB 8 /* Bits Per Byte */
  ------------------
 3761|       |
 3762|  1.76k|    calg = cipher_def->calg;
 3763|  1.76k|    bulk_mechanism = ssl3_Alg2Mech(calg);
 3764|       |
 3765|  1.76k|    if (isTLS12) {
  ------------------
  |  Branch (3765:9): [True: 1.60k, False: 157]
  ------------------
 3766|  1.60k|        key_derive = CKM_TLS12_KEY_AND_MAC_DERIVE;
  ------------------
  |  | 1027|  1.60k|#define CKM_TLS12_KEY_AND_MAC_DERIVE 0x000003E1UL
  ------------------
 3767|  1.60k|        key_material_params.prfHashMechanism = ssl3_GetPrfHashMechanism(ss);
 3768|  1.60k|        key_material_params_len = sizeof(CK_TLS12_KEY_MAT_PARAMS);
 3769|  1.60k|    } else if (isTLS) {
  ------------------
  |  Branch (3769:16): [True: 157, False: 0]
  ------------------
 3770|    157|        key_derive = CKM_TLS_KEY_AND_MAC_DERIVE;
  ------------------
  |  |  969|    157|#define CKM_TLS_KEY_AND_MAC_DERIVE 0x00000376UL
  ------------------
 3771|    157|        key_material_params_len = sizeof(CK_SSL3_KEY_MAT_PARAMS);
 3772|    157|    } else {
 3773|      0|        key_derive = CKM_SSL3_KEY_AND_MAC_DERIVE;
  ------------------
  |  |  961|      0|#define CKM_SSL3_KEY_AND_MAC_DERIVE 0x00000372UL
  ------------------
 3774|      0|        key_material_params_len = sizeof(CK_SSL3_KEY_MAT_PARAMS);
 3775|      0|    }
 3776|       |
 3777|  1.76k|    params.data = (unsigned char *)&key_material_params;
 3778|  1.76k|    params.len = key_material_params_len;
 3779|       |
 3780|       |    /* CKM_SSL3_KEY_AND_MAC_DERIVE is defined to set ENCRYPT, DECRYPT, and
 3781|       |     * DERIVE by DEFAULT */
 3782|  1.76k|    derivedKeyHandle = PK11_Derive(masterSecret, key_derive, &params,
 3783|  1.76k|                                   bulk_mechanism, CKA_ENCRYPT, keySize);
  ------------------
  |  |  547|  1.76k|#define CKA_ENCRYPT 0x00000104UL
  ------------------
 3784|  1.76k|    if (!derivedKeyHandle) {
  ------------------
  |  Branch (3784:9): [True: 0, False: 1.76k]
  ------------------
 3785|      0|        ssl_MapLowLevelError(SSL_ERROR_SESSION_KEY_GEN_FAILURE);
 3786|      0|        return SECFailure;
 3787|      0|    }
 3788|       |    /* we really should use the actual mac'ing mechanism here, but we
 3789|       |     * don't because these types are used to map keytype anyway and both
 3790|       |     * mac's map to the same keytype.
 3791|       |     */
 3792|  1.76k|    slot = PK11_GetSlotFromKey(derivedKeyHandle);
 3793|       |
 3794|  1.76k|    PK11_FreeSlot(slot); /* slot is held until the key is freed */
 3795|  1.76k|    clientSpec->keyMaterial.macKey =
 3796|  1.76k|        PK11_SymKeyFromHandle(slot, derivedKeyHandle, PK11_OriginDerive,
 3797|  1.76k|                              CKM_SSL3_SHA1_MAC, returnedKeys.hClientMacSecret,
  ------------------
  |  |  976|  1.76k|#define CKM_SSL3_SHA1_MAC 0x00000381UL
  ------------------
 3798|  1.76k|                              PR_TRUE, pwArg);
  ------------------
  |  |  437|  1.76k|#define PR_TRUE 1
  ------------------
 3799|  1.76k|    if (clientSpec->keyMaterial.macKey == NULL) {
  ------------------
  |  Branch (3799:9): [True: 0, False: 1.76k]
  ------------------
 3800|      0|        goto loser; /* loser sets err */
 3801|      0|    }
 3802|  1.76k|    serverSpec->keyMaterial.macKey =
 3803|  1.76k|        PK11_SymKeyFromHandle(slot, derivedKeyHandle, PK11_OriginDerive,
 3804|  1.76k|                              CKM_SSL3_SHA1_MAC, returnedKeys.hServerMacSecret,
  ------------------
  |  |  976|  1.76k|#define CKM_SSL3_SHA1_MAC 0x00000381UL
  ------------------
 3805|  1.76k|                              PR_TRUE, pwArg);
  ------------------
  |  |  437|  1.76k|#define PR_TRUE 1
  ------------------
 3806|  1.76k|    if (serverSpec->keyMaterial.macKey == NULL) {
  ------------------
  |  Branch (3806:9): [True: 0, False: 1.76k]
  ------------------
 3807|      0|        goto loser; /* loser sets err */
 3808|      0|    }
 3809|  1.76k|    if (!skipKeysAndIVs) {
  ------------------
  |  Branch (3809:9): [True: 1.38k, False: 374]
  ------------------
 3810|  1.38k|        clientSpec->keyMaterial.key =
 3811|  1.38k|            PK11_SymKeyFromHandle(slot, derivedKeyHandle, PK11_OriginDerive,
 3812|  1.38k|                                  bulk_mechanism, returnedKeys.hClientKey,
 3813|  1.38k|                                  PR_TRUE, pwArg);
  ------------------
  |  |  437|  1.38k|#define PR_TRUE 1
  ------------------
 3814|  1.38k|        if (clientSpec->keyMaterial.key == NULL) {
  ------------------
  |  Branch (3814:13): [True: 0, False: 1.38k]
  ------------------
 3815|      0|            goto loser; /* loser sets err */
 3816|      0|        }
 3817|  1.38k|        serverSpec->keyMaterial.key =
 3818|  1.38k|            PK11_SymKeyFromHandle(slot, derivedKeyHandle, PK11_OriginDerive,
 3819|  1.38k|                                  bulk_mechanism, returnedKeys.hServerKey,
 3820|  1.38k|                                  PR_TRUE, pwArg);
  ------------------
  |  |  437|  1.38k|#define PR_TRUE 1
  ------------------
 3821|  1.38k|        if (serverSpec->keyMaterial.key == NULL) {
  ------------------
  |  Branch (3821:13): [True: 0, False: 1.38k]
  ------------------
 3822|      0|            goto loser; /* loser sets err */
 3823|      0|        }
 3824|  1.38k|    }
 3825|  1.76k|    PK11_FreeSymKey(derivedKeyHandle);
 3826|  1.76k|    return SECSuccess;
 3827|       |
 3828|      0|loser:
 3829|      0|    PK11_FreeSymKey(derivedKeyHandle);
 3830|      0|    ssl_MapLowLevelError(SSL_ERROR_SESSION_KEY_GEN_FAILURE);
 3831|      0|    return SECFailure;
 3832|  1.76k|}
ssl3con.c:ssl3_GetPrfHashMechanism:
 3424|  5.92k|{
 3425|  5.92k|    return ssl3_GetHashMechanismByHashType(ss->ssl3.hs.suite_def->prf_hash);
 3426|  5.92k|}
ssl3con.c:ssl3_UpdateDefaultHandshakeHashes:
 4082|  3.29k|{
 4083|  3.29k|    return ssl3_UpdateHandshakeHashesInt(ss, b, l,
 4084|  3.29k|                                         &ss->ssl3.hs.messages);
 4085|  3.29k|}
ssl3con.c:ssl_SignatureSchemeMatchesSpkiOid:
 4418|  2.79k|{
 4419|  2.79k|    SECOidTag authOid = ssl3_AuthTypeToOID(ssl_SignatureSchemeToAuthType(scheme));
 4420|       |
 4421|  2.79k|    if (spkiOid == authOid) {
  ------------------
  |  Branch (4421:9): [True: 2.78k, False: 13]
  ------------------
 4422|  2.78k|        return PR_TRUE;
  ------------------
  |  |  437|  2.78k|#define PR_TRUE 1
  ------------------
 4423|  2.78k|    }
 4424|     13|    if ((authOid == SEC_OID_PKCS1_RSA_ENCRYPTION) &&
  ------------------
  |  Branch (4424:9): [True: 6, False: 7]
  ------------------
 4425|     13|        (spkiOid == SEC_OID_X500_RSA_ENCRYPTION)) {
  ------------------
  |  Branch (4425:9): [True: 0, False: 6]
  ------------------
 4426|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 4427|      0|    }
 4428|     13|    return PR_FALSE;
  ------------------
  |  |  438|     13|#define PR_FALSE 0
  ------------------
 4429|     13|}
ssl3con.c:ssl_SignatureSchemeFromPssSpki:
 4466|      9|{
 4467|      9|    SECKEYRSAPSSParams pssParam = { 0 };
 4468|      9|    PORTCheapArenaPool arena;
 4469|      9|    SECStatus rv;
 4470|       |
 4471|       |    /* The key doesn't have parameters, boo. */
 4472|      9|    if (!spki->algorithm.parameters.len) {
  ------------------
  |  Branch (4472:9): [True: 3, False: 6]
  ------------------
 4473|      3|        *scheme = ssl_sig_none;
 4474|      3|        return SECSuccess;
 4475|      3|    }
 4476|       |
 4477|      6|    PORT_InitCheapArena(&arena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|      6|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 4478|      6|    rv = SEC_QuickDERDecodeItem(&arena.arena, &pssParam,
  ------------------
  |  |  102|      6|#define SEC_QuickDERDecodeItem SEC_QuickDERDecodeItem_Util
  ------------------
 4479|      6|                                SEC_ASN1_GET(SECKEY_RSAPSSParamsTemplate),
  ------------------
  |  |  188|      6|#define SEC_ASN1_GET(x) x
  ------------------
 4480|      6|                                &spki->algorithm.parameters);
 4481|      6|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4481:9): [True: 2, False: 4]
  ------------------
 4482|      2|        goto loser;
 4483|      2|    }
 4484|       |    /* Not having hashAlg means SHA-1 and we don't accept that. */
 4485|      4|    if (!pssParam.hashAlg) {
  ------------------
  |  Branch (4485:9): [True: 1, False: 3]
  ------------------
 4486|      1|        goto loser;
 4487|      1|    }
 4488|      3|    switch (SECOID_GetAlgorithmTag(pssParam.hashAlg)) {
  ------------------
  |  |  119|      3|#define SECOID_GetAlgorithmTag SECOID_GetAlgorithmTag_Util
  ------------------
 4489|      1|        case SEC_OID_SHA256:
  ------------------
  |  Branch (4489:9): [True: 1, False: 2]
  ------------------
 4490|      1|            *scheme = ssl_sig_rsa_pss_pss_sha256;
 4491|      1|            break;
 4492|      0|        case SEC_OID_SHA384:
  ------------------
  |  Branch (4492:9): [True: 0, False: 3]
  ------------------
 4493|      0|            *scheme = ssl_sig_rsa_pss_pss_sha384;
 4494|      0|            break;
 4495|      1|        case SEC_OID_SHA512:
  ------------------
  |  Branch (4495:9): [True: 1, False: 2]
  ------------------
 4496|      1|            *scheme = ssl_sig_rsa_pss_pss_sha512;
 4497|      1|            break;
 4498|      1|        default:
  ------------------
  |  Branch (4498:9): [True: 1, False: 2]
  ------------------
 4499|      1|            goto loser;
 4500|      3|    }
 4501|       |
 4502|      2|    PORT_DestroyCheapArena(&arena);
 4503|      2|    return SECSuccess;
 4504|       |
 4505|      4|loser:
 4506|      4|    PORT_DestroyCheapArena(&arena);
 4507|      4|    PORT_SetError(SSL_ERROR_BAD_CERTIFICATE);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
 4508|      4|    return SECFailure;
 4509|      3|}
ssl3con.c:ssl_SignatureKeyMatchesSpkiOid:
 4585|  2.80k|{
 4586|  2.80k|    switch (spkiOid) {
 4587|      0|        case SEC_OID_X500_RSA_ENCRYPTION:
  ------------------
  |  Branch (4587:9): [True: 0, False: 2.80k]
  ------------------
 4588|  1.71k|        case SEC_OID_PKCS1_RSA_ENCRYPTION:
  ------------------
  |  Branch (4588:9): [True: 1.71k, False: 1.09k]
  ------------------
 4589|  1.71k|        case SEC_OID_PKCS1_RSA_PSS_SIGNATURE:
  ------------------
  |  Branch (4589:9): [True: 3, False: 2.80k]
  ------------------
 4590|  1.71k|            return keaDef->signKeyType == rsaKey;
 4591|    918|        case SEC_OID_ANSIX9_DSA_SIGNATURE:
  ------------------
  |  Branch (4591:9): [True: 918, False: 1.88k]
  ------------------
 4592|    918|            return keaDef->signKeyType == dsaKey;
 4593|    168|        case SEC_OID_ANSIX962_EC_PUBLIC_KEY:
  ------------------
  |  Branch (4593:9): [True: 168, False: 2.63k]
  ------------------
 4594|    168|            return keaDef->signKeyType == ecKey;
 4595|      1|        default:
  ------------------
  |  Branch (4595:9): [True: 1, False: 2.80k]
  ------------------
 4596|      1|            break;
 4597|  2.80k|    }
 4598|      1|    return PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 4599|  2.80k|}
ssl3con.c:ssl_SchemePolicyOK:
  805|   194k|{
  806|       |    /* Hash policy. */
  807|   194k|    PRUint32 policy;
  808|   194k|    SECOidTag hashOID = ssl3_HashTypeToOID(ssl_SignatureSchemeToHashType(scheme));
  809|   194k|    SECOidTag sigOID;
  810|       |
  811|       |    /* policy bits needed to enable a SignatureScheme */
  812|   194k|    SECStatus rv = NSS_GetAlgorithmPolicy(hashOID, &policy);
  813|   194k|    if (rv == SECSuccess &&
  ------------------
  |  Branch (813:9): [True: 194k, False: 0]
  ------------------
  814|   194k|        (policy & require) != require) {
  ------------------
  |  Branch (814:9): [True: 0, False: 194k]
  ------------------
  815|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  816|      0|    }
  817|       |
  818|       |    /* ssl_SignatureSchemeToAuthType reports rsa for rsa_pss_rsae, but we
  819|       |     * actually implement pss signatures when we sign, so just use RSA_PSS
  820|       |     * for all RSA PSS Siganture schemes */
  821|   194k|    if (ssl_IsRsaPssSignatureScheme(scheme)) {
  ------------------
  |  Branch (821:9): [True: 35.4k, False: 158k]
  ------------------
  822|  35.4k|        sigOID = SEC_OID_PKCS1_RSA_PSS_SIGNATURE;
  823|   158k|    } else {
  824|   158k|        sigOID = ssl3_AuthTypeToOID(ssl_SignatureSchemeToAuthType(scheme));
  825|   158k|    }
  826|       |    /* Signature Policy. */
  827|   194k|    rv = NSS_GetAlgorithmPolicy(sigOID, &policy);
  828|   194k|    if (rv == SECSuccess &&
  ------------------
  |  Branch (828:9): [True: 194k, False: 0]
  ------------------
  829|   194k|        (policy & require) != require) {
  ------------------
  |  Branch (829:9): [True: 0, False: 194k]
  ------------------
  830|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  831|      0|    }
  832|   194k|    return PR_TRUE;
  ------------------
  |  |  437|   194k|#define PR_TRUE 1
  ------------------
  833|   194k|}
ssl3con.c:ssl3_GetSuitePrfHash:
 3430|  1.74k|{
 3431|       |    /* ssl_hash_none is for pre-1.2 suites, which use SHA-256. */
 3432|  1.74k|    if (ss->ssl3.hs.suite_def->prf_hash == ssl_hash_none) {
  ------------------
  |  Branch (3432:9): [True: 1.35k, False: 386]
  ------------------
 3433|  1.35k|        return ssl_hash_sha256;
 3434|  1.35k|    }
 3435|    386|    return ss->ssl3.hs.suite_def->prf_hash;
 3436|  1.74k|}
ssl3con.c:ssl3_ComputeHandshakeHash:
 4821|  1.74k|{
 4822|  1.74k|    SECStatus rv = SECFailure;
 4823|  1.74k|    PK11Context *hashContext = PK11_CreateDigestContext(
 4824|  1.74k|        ssl3_HashTypeToOID(hashAlg));
 4825|       |
 4826|  1.74k|    if (!hashContext) {
  ------------------
  |  Branch (4826:9): [True: 0, False: 1.74k]
  ------------------
 4827|      0|        return rv;
 4828|      0|    }
 4829|  1.74k|    rv = PK11_DigestBegin(hashContext);
 4830|  1.74k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (4830:9): [True: 1.74k, False: 0]
  ------------------
 4831|  1.74k|        rv = PK11_DigestOp(hashContext, buf, len);
 4832|  1.74k|    }
 4833|  1.74k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (4833:9): [True: 1.74k, False: 0]
  ------------------
 4834|  1.74k|        rv = PK11_DigestFinal(hashContext, hashes->u.raw, &hashes->len,
 4835|  1.74k|                              sizeof(hashes->u.raw));
 4836|  1.74k|    }
 4837|  1.74k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (4837:9): [True: 1.74k, False: 0]
  ------------------
 4838|  1.74k|        hashes->hashAlg = hashAlg;
 4839|  1.74k|    }
 4840|  1.74k|    PK11_DestroyContext(hashContext, PR_TRUE);
  ------------------
  |  |  437|  1.74k|#define PR_TRUE 1
  ------------------
 4841|  1.74k|    return rv;
 4842|  1.74k|}
ssl3con.c:ssl3_AppendCipherSuites:
 5153|  10.2k|{
 5154|  10.2k|    SECStatus rv;
 5155|  10.2k|    unsigned int offset;
 5156|  10.2k|    unsigned int i;
 5157|  10.2k|    unsigned int saveLen;
 5158|       |
 5159|  10.2k|    rv = sslBuffer_Skip(buf, 2, &offset);
 5160|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5160:9): [True: 0, False: 10.2k]
  ------------------
 5161|      0|        return SECFailure;
 5162|      0|    }
 5163|       |
 5164|  10.2k|    if (ss->ssl3.hs.sendingSCSV) {
  ------------------
  |  Branch (5164:9): [True: 0, False: 10.2k]
  ------------------
 5165|       |        /* Add the actual SCSV */
 5166|      0|        rv = sslBuffer_AppendNumber(buf, TLS_EMPTY_RENEGOTIATION_INFO_SCSV,
  ------------------
  |  |  150|      0|#define TLS_EMPTY_RENEGOTIATION_INFO_SCSV       0x00FF
  ------------------
 5167|      0|                                    sizeof(ssl3CipherSuite));
 5168|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5168:13): [True: 0, False: 0]
  ------------------
 5169|      0|            return SECFailure;
 5170|      0|        }
 5171|      0|    }
 5172|  10.2k|    if (fallbackSCSV) {
  ------------------
  |  Branch (5172:9): [True: 5.05k, False: 5.16k]
  ------------------
 5173|  5.05k|        rv = sslBuffer_AppendNumber(buf, TLS_FALLBACK_SCSV,
  ------------------
  |  |  155|  5.05k|#define TLS_FALLBACK_SCSV                       0x5600
  ------------------
 5174|  5.05k|                                    sizeof(ssl3CipherSuite));
 5175|  5.05k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5175:13): [True: 0, False: 5.05k]
  ------------------
 5176|      0|            return SECFailure;
 5177|      0|        }
 5178|  5.05k|    }
 5179|       |
 5180|  10.2k|    saveLen = SSL_BUFFER_LEN(buf);
  ------------------
  |  |   36|  10.2k|#define SSL_BUFFER_LEN(b) ((b)->len)
  ------------------
 5181|       |    /* CipherSuites are appended to Hello message here */
 5182|   735k|    for (i = 0; i < ssl_V3_SUITES_IMPLEMENTED; i++) {
  ------------------
  |  |  245|   735k|#define ssl_V3_SUITES_IMPLEMENTED 71
  ------------------
  |  Branch (5182:17): [True: 725k, False: 10.2k]
  ------------------
 5183|   725k|        ssl3CipherSuiteCfg *suite = &ss->cipherSuites[i];
 5184|   725k|        if (ssl3_config_match(suite, ss->ssl3.policy, &ss->vrange, ss)) {
  ------------------
  |  Branch (5184:13): [True: 587k, False: 138k]
  ------------------
 5185|   587k|            rv = sslBuffer_AppendNumber(buf, suite->cipher_suite,
 5186|   587k|                                        sizeof(ssl3CipherSuite));
 5187|   587k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (5187:17): [True: 0, False: 587k]
  ------------------
 5188|      0|                return SECFailure;
 5189|      0|            }
 5190|   587k|        }
 5191|   725k|    }
 5192|       |
 5193|       |    /* GREASE CipherSuites:
 5194|       |     * A client MAY select one or more GREASE cipher suite values and advertise
 5195|       |     * them in the "cipher_suites" field [RFC8701, Section 3.1]. */
 5196|  10.2k|    if (ss->opt.enableGrease && ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  5.05k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (5196:9): [True: 5.05k, False: 5.16k]
  |  Branch (5196:33): [True: 4.35k, False: 706]
  ------------------
 5197|  4.35k|        rv = sslBuffer_AppendNumber(buf, ss->ssl3.hs.grease->idx[grease_cipher],
 5198|  4.35k|                                    sizeof(ssl3CipherSuite));
 5199|  4.35k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5199:13): [True: 0, False: 4.35k]
  ------------------
 5200|      0|            return SECFailure;
 5201|      0|        }
 5202|  4.35k|    }
 5203|       |
 5204|  10.2k|    if (SSL_ALL_VERSIONS_DISABLED(&ss->vrange) ||
  ------------------
  |  | 1503|  20.4k|    ((vrange)->min == SSL_LIBRARY_VERSION_NONE)
  |  |  ------------------
  |  |  |  | 1481|  10.2k|#define SSL_LIBRARY_VERSION_NONE 0
  |  |  ------------------
  |  |  |  Branch (1503:5): [True: 0, False: 10.2k]
  |  |  ------------------
  ------------------
 5205|  10.2k|        (SSL_BUFFER_LEN(buf) - saveLen) == 0) {
  ------------------
  |  |   36|  10.2k|#define SSL_BUFFER_LEN(b) ((b)->len)
  ------------------
  |  Branch (5205:9): [True: 0, False: 10.2k]
  ------------------
 5206|      0|        PORT_SetError(SSL_ERROR_SSL_DISABLED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5207|      0|        return SECFailure;
 5208|      0|    }
 5209|       |
 5210|  10.2k|    return sslBuffer_InsertLength(buf, offset, 2);
 5211|  10.2k|}
ssl3con.c:ssl_SetClientHelloSpecVersion:
 5098|  8.85k|{
 5099|  8.85k|    ssl_GetSpecWriteLock(ss);
  ------------------
  |  | 1435|  8.85k|    {                                            \
  |  | 1436|  8.85k|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1437|  8.85k|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|  4.52k|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|  8.85k|    }
  ------------------
 5100|  8.85k|    PORT_Assert(spec->cipherDef->cipher == cipher_null);
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5101|       |    /* This is - a best guess - but it doesn't matter here. */
 5102|  8.85k|    spec->version = ss->vrange.max;
 5103|  8.85k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  8.85k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
 5104|  8.85k|        spec->recordVersion = SSL_LIBRARY_VERSION_DTLS_1_0_WIRE;
  ------------------
  |  |   32|  8.85k|#define SSL_LIBRARY_VERSION_DTLS_1_0_WIRE       ((~0x0100) & 0xffff)
  ------------------
 5105|  8.85k|    } else {
 5106|       |        /* For new connections, cap the record layer version number of TLS
 5107|       |         * ClientHello to { 3, 1 } (TLS 1.0). Some TLS 1.0 servers (which seem
 5108|       |         * to use F5 BIG-IP) ignore ClientHello.client_version and use the
 5109|       |         * record layer version number (TLSPlaintext.version) instead when
 5110|       |         * negotiating protocol versions. In addition, if the record layer
 5111|       |         * version number of ClientHello is { 3, 2 } (TLS 1.1) or higher, these
 5112|       |         * servers reset the TCP connections. Lastly, some F5 BIG-IP servers
 5113|       |         * hang if a record containing a ClientHello has a version greater than
 5114|       |         * { 3, 1 } and a length greater than 255. Set this flag to work around
 5115|       |         * such servers.
 5116|       |         *
 5117|       |         * The final version is set when a version is negotiated.
 5118|       |         */
 5119|      0|        spec->recordVersion = PR_MIN(SSL_LIBRARY_VERSION_TLS_1_0,
  ------------------
  |  |  158|      0|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5120|      0|                                     ss->vrange.max);
 5121|      0|    }
 5122|  8.85k|    ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|  8.85k|    {                                              \
  |  | 1441|  8.85k|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1442|  8.85k|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|  4.52k|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|  8.85k|    }
  ------------------
 5123|  8.85k|}
ssl3con.c:ssl3_ClientAuthCallbackOutcome:
 8016|     19|{
 8017|     19|    SECStatus rv;
 8018|     19|    switch (outcome) {
 8019|      0|        case SECSuccess:
  ------------------
  |  Branch (8019:9): [True: 0, False: 19]
  ------------------
 8020|       |            /* check what the callback function returned */
 8021|      0|            if ((!ss->ssl3.clientCertificate) || (!ss->ssl3.clientPrivateKey)) {
  ------------------
  |  Branch (8021:17): [True: 0, False: 0]
  |  Branch (8021:50): [True: 0, False: 0]
  ------------------
 8022|       |                /* we are missing either the key or cert */
 8023|      0|                goto send_no_certificate;
 8024|      0|            }
 8025|       |            /* Setting ssl3.clientCertChain non-NULL will cause
 8026|       |             * ssl3_HandleServerHelloDone to call SendCertificate.
 8027|       |             */
 8028|      0|            ss->ssl3.clientCertChain = CERT_CertChainFromCert(
 8029|      0|                ss->ssl3.clientCertificate,
 8030|      0|                certUsageSSLClient, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 8031|      0|            if (ss->ssl3.clientCertChain == NULL) {
  ------------------
  |  Branch (8031:17): [True: 0, False: 0]
  ------------------
 8032|      0|                goto send_no_certificate;
 8033|      0|            }
 8034|      0|            if (ss->ssl3.hs.hashType == handshake_hash_record ||
  ------------------
  |  Branch (8034:17): [True: 0, False: 0]
  ------------------
 8035|      0|                ss->ssl3.hs.hashType == handshake_hash_single) {
  ------------------
  |  Branch (8035:17): [True: 0, False: 0]
  ------------------
 8036|      0|                rv = ssl_PickClientSignatureScheme(ss,
 8037|      0|                                                   ss->ssl3.clientCertificate,
 8038|      0|                                                   ss->ssl3.clientPrivateKey,
 8039|      0|                                                   ss->ssl3.hs.clientAuthSignatureSchemes,
 8040|      0|                                                   ss->ssl3.hs.clientAuthSignatureSchemesLen,
 8041|      0|                                                   &ss->ssl3.hs.signatureScheme);
 8042|      0|                if (rv != SECSuccess) {
  ------------------
  |  Branch (8042:21): [True: 0, False: 0]
  ------------------
 8043|       |                    /* This should only happen if our schemes changed or
 8044|       |                     * if an RSA-PSS cert was selected, but the token
 8045|       |                     * does not support PSS schemes.
 8046|       |                     */
 8047|      0|                    goto send_no_certificate;
 8048|      0|                }
 8049|      0|            }
 8050|      0|            break;
 8051|       |
 8052|     19|        case SECFailure:
  ------------------
  |  Branch (8052:9): [True: 19, False: 0]
  ------------------
 8053|     19|        default:
  ------------------
  |  Branch (8053:9): [True: 0, False: 19]
  ------------------
 8054|     19|        send_no_certificate:
 8055|     19|            CERT_DestroyCertificate(ss->ssl3.clientCertificate);
 8056|     19|            SECKEY_DestroyPrivateKey(ss->ssl3.clientPrivateKey);
 8057|     19|            ss->ssl3.clientCertificate = NULL;
 8058|     19|            ss->ssl3.clientPrivateKey = NULL;
 8059|     19|            if (ss->ssl3.clientCertChain) {
  ------------------
  |  Branch (8059:17): [True: 0, False: 19]
  ------------------
 8060|      0|                CERT_DestroyCertificateList(ss->ssl3.clientCertChain);
 8061|      0|                ss->ssl3.clientCertChain = NULL;
 8062|      0|            }
 8063|       |
 8064|     19|            if (ss->version > SSL_LIBRARY_VERSION_3_0) {
  ------------------
  |  |   17|     19|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (8064:17): [True: 19, False: 0]
  ------------------
 8065|     19|                ss->ssl3.sendEmptyCert = PR_TRUE;
  ------------------
  |  |  437|     19|#define PR_TRUE 1
  ------------------
 8066|     19|            } else {
 8067|      0|                (void)SSL3_SendAlert(ss, alert_warning, no_certificate);
 8068|      0|            }
 8069|     19|            break;
 8070|     19|    }
 8071|       |
 8072|       |    /* Release the cached parameters */
 8073|     19|    PORT_Free(ss->ssl3.hs.clientAuthSignatureSchemes);
  ------------------
  |  |   60|     19|#define PORT_Free PORT_Free_Util
  ------------------
 8074|     19|    ss->ssl3.hs.clientAuthSignatureSchemes = NULL;
 8075|     19|    ss->ssl3.hs.clientAuthSignatureSchemesLen = 0;
 8076|     19|}
ssl3con.c:ssl_SetSpecVersions:
 1138|  17.8k|{
 1139|  17.8k|    spec->version = ss->version;
 1140|  17.8k|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  17.8k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1140:9): [True: 995, False: 16.8k]
  ------------------
 1141|    995|        tls13_SetSpecRecordVersion(ss, spec);
 1142|  16.8k|    } else if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  16.8k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 16.8k, False: 0]
  |  |  ------------------
  ------------------
 1143|  16.8k|        spec->recordVersion = dtls_TLSVersionToDTLSVersion(ss->version);
 1144|  16.8k|    } else {
 1145|      0|        spec->recordVersion = ss->version;
 1146|      0|    }
 1147|  17.8k|}
ssl3con.c:ssl3_ComputeDHKeyHash:
 1578|  1.63k|{
 1579|  1.63k|    sslBuffer buf = SSL_BUFFER_EMPTY;
  ------------------
  |  |   23|  1.63k|    {                        \
  |  |   24|  1.63k|        NULL, 0, 0, PR_FALSE \
  |  |  ------------------
  |  |  |  |  438|  1.63k|#define PR_FALSE 0
  |  |  ------------------
  |  |   25|  1.63k|    }
  ------------------
 1580|  1.63k|    SECStatus rv;
 1581|  1.63k|    unsigned int yLen;
 1582|  1.63k|    unsigned int i;
 1583|       |
 1584|  1.63k|    PORT_Assert(dh_p.data);
  ------------------
  |  |  120|  1.63k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.63k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.63k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1585|  1.63k|    PORT_Assert(dh_g.data);
  ------------------
  |  |  120|  1.63k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.63k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.63k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1586|  1.63k|    PORT_Assert(dh_Ys.data);
  ------------------
  |  |  120|  1.63k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.63k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.63k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1587|       |
 1588|  1.63k|    rv = sslBuffer_Append(&buf, ss->ssl3.hs.client_random, SSL3_RANDOM_LENGTH);
  ------------------
  |  |   24|  1.63k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 1589|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1589:9): [True: 0, False: 1.63k]
  ------------------
 1590|      0|        goto loser;
 1591|      0|    }
 1592|  1.63k|    rv = sslBuffer_Append(&buf, ss->ssl3.hs.server_random, SSL3_RANDOM_LENGTH);
  ------------------
  |  |   24|  1.63k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 1593|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1593:9): [True: 0, False: 1.63k]
  ------------------
 1594|      0|        goto loser;
 1595|      0|    }
 1596|       |    /* p */
 1597|  1.63k|    rv = sslBuffer_AppendVariable(&buf, dh_p.data, dh_p.len, 2);
 1598|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1598:9): [True: 0, False: 1.63k]
  ------------------
 1599|      0|        goto loser;
 1600|      0|    }
 1601|       |    /* g */
 1602|  1.63k|    rv = sslBuffer_AppendVariable(&buf, dh_g.data, dh_g.len, 2);
 1603|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1603:9): [True: 0, False: 1.63k]
  ------------------
 1604|      0|        goto loser;
 1605|      0|    }
 1606|       |    /* y - complicated by padding */
 1607|  1.63k|    yLen = padY ? dh_p.len : dh_Ys.len;
  ------------------
  |  Branch (1607:12): [True: 0, False: 1.63k]
  ------------------
 1608|  1.63k|    rv = sslBuffer_AppendNumber(&buf, yLen, 2);
 1609|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1609:9): [True: 0, False: 1.63k]
  ------------------
 1610|      0|        goto loser;
 1611|      0|    }
 1612|       |    /* If we're padding Y, dh_Ys can't be longer than dh_p. */
 1613|  1.63k|    PORT_Assert(!padY || dh_p.len >= dh_Ys.len);
  ------------------
  |  |  120|  1.63k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.63k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.63k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1614|  1.63k|    for (i = dh_Ys.len; i < yLen; ++i) {
  ------------------
  |  Branch (1614:25): [True: 0, False: 1.63k]
  ------------------
 1615|      0|        rv = sslBuffer_AppendNumber(&buf, 0, 1);
 1616|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1616:13): [True: 0, False: 0]
  ------------------
 1617|      0|            goto loser;
 1618|      0|        }
 1619|      0|    }
 1620|  1.63k|    rv = sslBuffer_Append(&buf, dh_Ys.data, dh_Ys.len);
 1621|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1621:9): [True: 0, False: 1.63k]
  ------------------
 1622|      0|        goto loser;
 1623|      0|    }
 1624|       |
 1625|  1.63k|    rv = ssl3_ComputeCommonKeyHash(hashAlg, SSL_BUFFER_BASE(&buf),
  ------------------
  |  |   35|  1.63k|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
 1626|  1.63k|                                   SSL_BUFFER_LEN(&buf), hashes);
  ------------------
  |  |   36|  1.63k|#define SSL_BUFFER_LEN(b) ((b)->len)
  ------------------
 1627|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1627:9): [True: 0, False: 1.63k]
  ------------------
 1628|      0|        goto loser;
 1629|      0|    }
 1630|       |
 1631|  1.63k|    PRINT_BUF(95, (NULL, "DHkey hash: ", SSL_BUFFER_BASE(&buf),
  ------------------
  |  |   74|  1.63k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.63k]
  |  |  ------------------
  |  |   75|  1.63k|    ssl_PrintBuf b
  ------------------
 1632|  1.63k|                   SSL_BUFFER_LEN(&buf)));
 1633|  1.63k|    if (hashAlg == ssl_hash_none) {
  ------------------
  |  Branch (1633:9): [True: 67, False: 1.56k]
  ------------------
 1634|     67|        PRINT_BUF(95, (NULL, "DHkey hash: MD5 result",
  ------------------
  |  |   74|     67|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 67]
  |  |  ------------------
  |  |   75|     67|    ssl_PrintBuf b
  ------------------
 1635|     67|                       hashes->u.s.md5, MD5_LENGTH));
 1636|     67|        PRINT_BUF(95, (NULL, "DHkey hash: SHA1 result",
  ------------------
  |  |   74|     67|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 67]
  |  |  ------------------
  |  |   75|     67|    ssl_PrintBuf b
  ------------------
 1637|     67|                       hashes->u.s.sha, SHA1_LENGTH));
 1638|  1.56k|    } else {
 1639|  1.56k|        PRINT_BUF(95, (NULL, "DHkey hash: result",
  ------------------
  |  |   74|  1.56k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.56k]
  |  |  ------------------
  |  |   75|  1.56k|    ssl_PrintBuf b
  ------------------
 1640|  1.56k|                       hashes->u.raw, hashes->len));
 1641|  1.56k|    }
 1642|       |
 1643|  1.63k|    sslBuffer_Clear(&buf);
 1644|  1.63k|    return SECSuccess;
 1645|       |
 1646|      0|loser:
 1647|      0|    sslBuffer_Clear(&buf);
 1648|      0|    return SECFailure;
 1649|  1.63k|}
ssl3con.c:ssl_SignatureSchemeAccepted:
  841|   239k|{
  842|       |    /* Disable RSA-PSS schemes if there are no tokens to verify them. */
  843|   239k|    if (ssl_IsRsaPssSignatureScheme(scheme)) {
  ------------------
  |  Branch (843:9): [True: 32.9k, False: 206k]
  ------------------
  844|  32.9k|        if (!PK11_TokenExists(auth_alg_defs[ssl_auth_rsa_pss])) {
  ------------------
  |  Branch (844:13): [True: 0, False: 32.9k]
  ------------------
  845|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  846|      0|        }
  847|   206k|    } else if (!forCert && ssl_IsRsaPkcs1SignatureScheme(scheme)) {
  ------------------
  |  Branch (847:16): [True: 89.6k, False: 116k]
  |  Branch (847:28): [True: 23.9k, False: 65.6k]
  ------------------
  848|       |        /* Disable PKCS#1 signatures if we are limited to TLS 1.3.
  849|       |         * We still need to advertise PKCS#1 signatures in CH and CR
  850|       |         * for certificate signatures.
  851|       |         */
  852|  23.9k|        if (minVersion >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  23.9k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (852:13): [True: 23.9k, False: 0]
  ------------------
  853|  23.9k|            return PR_FALSE;
  ------------------
  |  |  438|  23.9k|#define PR_FALSE 0
  ------------------
  854|  23.9k|        }
  855|   182k|    } else if (ssl_IsDsaSignatureScheme(scheme)) {
  ------------------
  |  Branch (855:16): [True: 64.1k, False: 118k]
  ------------------
  856|       |        /* DSA: not in TLS 1.3, and check policy. */
  857|  64.1k|        if (minVersion >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  64.1k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (857:13): [True: 27.7k, False: 36.3k]
  ------------------
  858|  27.7k|            return PR_FALSE;
  ------------------
  |  |  438|  27.7k|#define PR_FALSE 0
  ------------------
  859|  27.7k|        }
  860|  64.1k|    }
  861|       |
  862|   187k|    return ssl_SchemePolicyOK(scheme, kSSLSigSchemePolicy);
  863|   239k|}
ssl3con.c:ssl3_CheckFalseStart:
 8168|    880|{
 8169|    880|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    880|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.34k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 411, False: 469]
  |  |  |  |  |  Branch (208:7): [True: 469, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8170|    880|    PORT_Assert(!ss->ssl3.hs.authCertificatePending);
  ------------------
  |  |  120|    880|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    880|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 880, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8171|    880|    PORT_Assert(!ss->ssl3.hs.canFalseStart);
  ------------------
  |  |  120|    880|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    880|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 880, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8172|       |
 8173|    880|    if (!ss->canFalseStartCallback) {
  ------------------
  |  Branch (8173:9): [True: 0, False: 880]
  ------------------
 8174|      0|        SSL_TRC(3, ("%d: SSL[%d]: no false start callback so no false start",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 8175|      0|                    SSL_GETPID(), ss->fd));
 8176|    880|    } else {
 8177|    880|        SECStatus rv;
 8178|       |
 8179|    880|        rv = ssl_CheckServerRandom(ss);
 8180|    880|        if (rv != SECSuccess) {
  ------------------
  |  Branch (8180:13): [True: 0, False: 880]
  ------------------
 8181|      0|            SSL_TRC(3, ("%d: SSL[%d]: no false start due to possible downgrade",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 8182|      0|                        SSL_GETPID(), ss->fd));
 8183|      0|            goto no_false_start;
 8184|      0|        }
 8185|       |
 8186|       |        /* An attacker can control the selected ciphersuite so we only wish to
 8187|       |         * do False Start in the case that the selected ciphersuite is
 8188|       |         * sufficiently strong that the attack can gain no advantage.
 8189|       |         * Therefore we always require an 80-bit cipher. */
 8190|    880|        ssl_GetSpecReadLock(ss);
  ------------------
  |  | 1422|    880|    {                                           \
  |  | 1423|    880|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 469, False: 411]
  |  |  ------------------
  |  | 1424|    880|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|    469|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|    880|    }
  ------------------
 8191|    880|        PRBool weakCipher = ss->ssl3.cwSpec->cipherDef->secret_key_size < 10;
 8192|    880|        ssl_ReleaseSpecReadLock(ss);
  ------------------
  |  | 1427|    880|    {                                             \
  |  | 1428|    880|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 469, False: 411]
  |  |  ------------------
  |  | 1429|    880|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|    469|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|    880|    }
  ------------------
 8193|    880|        if (weakCipher) {
  ------------------
  |  Branch (8193:13): [True: 280, False: 600]
  ------------------
 8194|    280|            SSL_TRC(3, ("%d: SSL[%d]: no false start due to weak cipher",
  ------------------
  |  |   71|    280|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 280]
  |  |  ------------------
  |  |   72|    280|    ssl_Trace b
  ------------------
 8195|    280|                        SSL_GETPID(), ss->fd));
 8196|    280|            goto no_false_start;
 8197|    280|        }
 8198|       |
 8199|    600|        if (ssl3_ExtensionAdvertised(ss, ssl_tls13_encrypted_client_hello_xtn)) {
  ------------------
  |  Branch (8199:13): [True: 0, False: 600]
  ------------------
 8200|      0|            SSL_TRC(3, ("%d: SSL[%d]: no false start due to lower version after ECH",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 8201|      0|                        SSL_GETPID(), ss->fd));
 8202|      0|            goto no_false_start;
 8203|      0|        }
 8204|       |
 8205|    600|        PORT_Assert((ss->ssl3.hs.preliminaryInfo & ssl_preinfo_all) ==
  ------------------
  |  |  120|    600|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    600|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 600, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8206|    600|                    ssl_preinfo_all);
 8207|    600|        rv = (ss->canFalseStartCallback)(ss->fd,
 8208|    600|                                         ss->canFalseStartCallbackData,
 8209|    600|                                         &ss->ssl3.hs.canFalseStart);
 8210|    600|        if (rv == SECSuccess) {
  ------------------
  |  Branch (8210:13): [True: 600, False: 0]
  ------------------
 8211|    600|            SSL_TRC(3, ("%d: SSL[%d]: false start callback returned %s",
  ------------------
  |  |   71|    600|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 600]
  |  |  ------------------
  |  |   72|    600|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 8212|    600|                        SSL_GETPID(), ss->fd,
 8213|    600|                        ss->ssl3.hs.canFalseStart ? "TRUE"
 8214|    600|                                                  : "FALSE"));
 8215|    600|        } else {
 8216|      0|            SSL_TRC(3, ("%d: SSL[%d]: false start callback failed (%s)",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 8217|      0|                        SSL_GETPID(), ss->fd,
 8218|      0|                        PR_ErrorToName(PR_GetError())));
 8219|      0|        }
 8220|    600|        return rv;
 8221|    600|    }
 8222|       |
 8223|    280|no_false_start:
 8224|    280|    ss->ssl3.hs.canFalseStart = PR_FALSE;
  ------------------
  |  |  438|    280|#define PR_FALSE 0
  ------------------
 8225|    280|    return SECSuccess;
 8226|    880|}
ssl3con.c:ssl_CheckServerRandom:
 7028|  8.55k|{
 7029|       |    /* Check the ServerHello.random per [RFC 8446 Section 4.1.3].
 7030|       |     *
 7031|       |     * TLS 1.3 clients receiving a ServerHello indicating TLS 1.2 or below
 7032|       |     * MUST check that the last 8 bytes are not equal to either of these
 7033|       |     * values.  TLS 1.2 clients SHOULD also check that the last 8 bytes are
 7034|       |     * not equal to the second value if the ServerHello indicates TLS 1.1 or
 7035|       |     * below.  If a match is found, the client MUST abort the handshake with
 7036|       |     * an "illegal_parameter" alert.
 7037|       |     */
 7038|  8.55k|    SSL3ProtocolVersion checkVersion =
 7039|  8.55k|        ss->ssl3.downgradeCheckVersion ? ss->ssl3.downgradeCheckVersion
  ------------------
  |  Branch (7039:9): [True: 0, False: 8.55k]
  ------------------
 7040|  8.55k|                                       : ss->vrange.max;
 7041|       |
 7042|  8.55k|    if (checkVersion >= SSL_LIBRARY_VERSION_TLS_1_2 &&
  ------------------
  |  |   20|  17.1k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (7042:9): [True: 8.51k, False: 40]
  ------------------
 7043|  8.55k|        checkVersion > ss->version) {
  ------------------
  |  Branch (7043:9): [True: 5.43k, False: 3.08k]
  ------------------
 7044|       |        /* Both sections use the same sentinel region. */
 7045|  5.43k|        PRUint8 *downgrade_sentinel =
 7046|  5.43k|            ss->ssl3.hs.server_random +
 7047|  5.43k|            SSL3_RANDOM_LENGTH - sizeof(tls12_downgrade_random);
  ------------------
  |  |   24|  5.43k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 7048|       |
 7049|  5.43k|        if (!PORT_Memcmp(downgrade_sentinel,
  ------------------
  |  |  179|  5.43k|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (7049:13): [True: 1, False: 5.43k]
  ------------------
 7050|  5.43k|                         tls12_downgrade_random,
 7051|  5.43k|                         sizeof(tls12_downgrade_random)) ||
 7052|  5.43k|            !PORT_Memcmp(downgrade_sentinel,
  ------------------
  |  |  179|  5.43k|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (7052:13): [True: 1, False: 5.43k]
  ------------------
 7053|  5.43k|                         tls1_downgrade_random,
 7054|  5.43k|                         sizeof(tls1_downgrade_random))) {
 7055|      2|            return SECFailure;
 7056|      2|        }
 7057|  5.43k|    }
 7058|       |
 7059|  8.55k|    return SECSuccess;
 7060|  8.55k|}
ssl3con.c:ssl3_FinishHandshake:
12521|    137|{
12522|    137|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    137|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    204|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 70, False: 67]
  |  |  |  |  |  Branch (208:7): [True: 67, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12523|    137|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    137|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    204|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 70, False: 67]
  |  |  |  |  |  Branch (208:7): [True: 67, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12524|    137|    PORT_Assert(ss->ssl3.hs.restartTarget == NULL);
  ------------------
  |  |  120|    137|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    137|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 137, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12525|    137|    sslSessionID *sid = ss->sec.ci.sid;
12526|    137|    SECStatus sidRv = SECFailure;
12527|       |
12528|       |    /* The first handshake is now completed. */
12529|    137|    ss->handshake = NULL;
12530|       |
12531|    137|    if (sid->cached == never_cached && !ss->opt.noCache) {
  ------------------
  |  Branch (12531:9): [True: 137, False: 0]
  |  Branch (12531:40): [True: 89, False: 48]
  ------------------
12532|       |        /* If the wrap fails, don't cache the sid. The connection proceeds
12533|       |         * normally, so the rv is only used to determine whether we cache. */
12534|     89|        sidRv = ssl3_FillInCachedSID(ss, sid, ss->ssl3.crSpec->masterSecret);
12535|     89|    }
12536|       |
12537|       |    /* RFC 5077 Section 3.3: "The client MUST NOT treat the ticket as valid
12538|       |     * until it has verified the server's Finished message." When the server
12539|       |     * sends a NewSessionTicket in a resumption handshake, we must wait until
12540|       |     * the handshake is finished (we have verified the server's Finished
12541|       |     * AND the server's certificate) before we update the ticket in the sid.
12542|       |     *
12543|       |     * This must be done before we call ssl_CacheSessionID(ss)
12544|       |     * because CacheSID requires the session ticket to already be set, and also
12545|       |     * because of the lazy lock creation scheme used by CacheSID and
12546|       |     * ssl3_SetSIDSessionTicket. */
12547|    137|    if (ss->ssl3.hs.receivedNewSessionTicket) {
  ------------------
  |  Branch (12547:9): [True: 0, False: 137]
  ------------------
12548|      0|        PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12549|      0|        if (sidRv == SECSuccess) {
  ------------------
  |  Branch (12549:13): [True: 0, False: 0]
  ------------------
12550|       |            /* The sid takes over the ticket data */
12551|      0|            ssl3_SetSIDSessionTicket(ss->sec.ci.sid,
12552|      0|                                     &ss->ssl3.hs.newSessionTicket);
12553|      0|        } else {
12554|      0|            PORT_Assert(ss->ssl3.hs.newSessionTicket.ticket.data);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12555|      0|            SECITEM_FreeItem(&ss->ssl3.hs.newSessionTicket.ticket,
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
12556|      0|                             PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
12557|      0|        }
12558|      0|        PORT_Assert(!ss->ssl3.hs.newSessionTicket.ticket.data);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12559|      0|        ss->ssl3.hs.receivedNewSessionTicket = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
12560|      0|    }
12561|    137|    if (sidRv == SECSuccess) {
  ------------------
  |  Branch (12561:9): [True: 89, False: 48]
  ------------------
12562|     89|        PORT_Assert(ss->sec.ci.sid->cached == never_cached);
  ------------------
  |  |  120|     89|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     89|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12563|     89|        ssl_CacheSessionID(ss);
12564|     89|    }
12565|       |
12566|    137|    ss->ssl3.hs.canFalseStart = PR_FALSE; /* False Start phase is complete */
  ------------------
  |  |  438|    137|#define PR_FALSE 0
  ------------------
12567|    137|    ss->ssl3.hs.ws = idle_handshake;
12568|       |
12569|    137|    return ssl_FinishHandshake(ss);
12570|    137|}
ssl3con.c:ssl3_SendChangeCipherSpecs:
 3264|  1.76k|{
 3265|  1.76k|    SECStatus rv;
 3266|       |
 3267|  1.76k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.66k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 860, False: 900]
  |  |  |  |  |  Branch (208:7): [True: 900, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3268|  1.76k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.66k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 860, False: 900]
  |  |  |  |  |  Branch (208:7): [True: 900, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3269|       |
 3270|  1.76k|    rv = ssl3_SendChangeCipherSpecsInt(ss);
 3271|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3271:9): [True: 0, False: 1.76k]
  ------------------
 3272|      0|        return rv; /* Error code set. */
 3273|      0|    }
 3274|       |
 3275|       |    /* swap the pending and current write specs. */
 3276|  1.76k|    ssl_GetSpecWriteLock(ss); /**************************************/
  ------------------
  |  | 1435|  1.76k|    {                                            \
  |  | 1436|  1.76k|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 900, False: 860]
  |  |  ------------------
  |  | 1437|  1.76k|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|    900|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|  1.76k|    }
  ------------------
 3277|       |
 3278|  1.76k|    ssl_CipherSpecRelease(ss->ssl3.cwSpec);
 3279|  1.76k|    ss->ssl3.cwSpec = ss->ssl3.pwSpec;
 3280|  1.76k|    ss->ssl3.pwSpec = NULL;
 3281|       |
 3282|  1.76k|    SSL_TRC(3, ("%d: SSL3[%d] Set Current Write Cipher Suite to Pending",
  ------------------
  |  |   71|  1.76k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.76k]
  |  |  ------------------
  |  |   72|  1.76k|    ssl_Trace b
  ------------------
 3283|  1.76k|                SSL_GETPID(), ss->fd));
 3284|       |
 3285|       |    /* With DTLS, we need to set a holddown timer in case the final
 3286|       |     * message got lost */
 3287|  1.76k|    if (IS_DTLS(ss) && ss->ssl3.crSpec->epoch == ss->ssl3.cwSpec->epoch) {
  ------------------
  |  |  892|  3.52k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 1.76k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3287:24): [True: 0, False: 1.76k]
  ------------------
 3288|      0|        rv = dtls_StartHolddownTimer(ss);
 3289|      0|    }
 3290|  1.76k|    ssl_ReleaseSpecWriteLock(ss); /**************************************/
  ------------------
  |  | 1440|  1.76k|    {                                              \
  |  | 1441|  1.76k|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 900, False: 860]
  |  |  ------------------
  |  | 1442|  1.76k|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|    900|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|  1.76k|    }
  ------------------
 3291|       |
 3292|  1.76k|    return rv;
 3293|  1.76k|}
ssl3con.c:ssl3_SendFinished:
12147|  1.76k|{
12148|  1.76k|    ssl3CipherSpec *cwSpec;
12149|  1.76k|    PRBool isTLS;
12150|  1.76k|    PRBool isServer = ss->sec.isServer;
12151|  1.76k|    SECStatus rv;
12152|  1.76k|    SSL3Sender sender = isServer ? sender_server : sender_client;
  ------------------
  |  Branch (12152:25): [True: 0, False: 1.76k]
  ------------------
12153|  1.76k|    SSL3Hashes hashes;
12154|  1.76k|    TLSFinished tlsFinished;
12155|       |
12156|  1.76k|    SSL_TRC(3, ("%d: SSL3[%d]: send finished handshake", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|  1.76k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.76k]
  |  |  ------------------
  |  |   72|  1.76k|    ssl_Trace b
  ------------------
12157|       |
12158|  1.76k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.66k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 860, False: 900]
  |  |  |  |  |  Branch (208:7): [True: 900, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12159|  1.76k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.66k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 860, False: 900]
  |  |  |  |  |  Branch (208:7): [True: 900, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12160|  1.76k|    PR_ASSERT(!ss->ssl3.hs.clientCertificatePending);
  ------------------
  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  ------------------
  ------------------
12161|       |
12162|  1.76k|    ssl_GetSpecReadLock(ss);
  ------------------
  |  | 1422|  1.76k|    {                                           \
  |  | 1423|  1.76k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 900, False: 860]
  |  |  ------------------
  |  | 1424|  1.76k|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|    900|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|  1.76k|    }
  ------------------
12163|  1.76k|    cwSpec = ss->ssl3.cwSpec;
12164|  1.76k|    isTLS = (PRBool)(cwSpec->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|  1.76k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
12165|  1.76k|    rv = ssl3_ComputeHandshakeHashes(ss, cwSpec, &hashes, sender);
12166|  1.76k|    if (isTLS && rv == SECSuccess) {
  ------------------
  |  Branch (12166:9): [True: 1.76k, False: 0]
  |  Branch (12166:18): [True: 1.76k, False: 0]
  ------------------
12167|  1.76k|        rv = ssl3_ComputeTLSFinished(ss, cwSpec, isServer, &hashes, &tlsFinished);
12168|  1.76k|    }
12169|  1.76k|    ssl_ReleaseSpecReadLock(ss);
  ------------------
  |  | 1427|  1.76k|    {                                             \
  |  | 1428|  1.76k|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 900, False: 860]
  |  |  ------------------
  |  | 1429|  1.76k|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|    900|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|  1.76k|    }
  ------------------
12170|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (12170:9): [True: 0, False: 1.76k]
  ------------------
12171|      0|        goto fail; /* err code was set by ssl3_ComputeHandshakeHashes */
12172|      0|    }
12173|       |
12174|  1.76k|    if (isTLS) {
  ------------------
  |  Branch (12174:9): [True: 1.76k, False: 0]
  ------------------
12175|  1.76k|        if (isServer)
  ------------------
  |  Branch (12175:13): [True: 0, False: 1.76k]
  ------------------
12176|      0|            ss->ssl3.hs.finishedMsgs.tFinished[1] = tlsFinished;
12177|  1.76k|        else
12178|  1.76k|            ss->ssl3.hs.finishedMsgs.tFinished[0] = tlsFinished;
12179|  1.76k|        ss->ssl3.hs.finishedBytes = sizeof tlsFinished;
12180|  1.76k|        rv = ssl3_AppendHandshakeHeader(ss, ssl_hs_finished, sizeof tlsFinished);
12181|  1.76k|        if (rv != SECSuccess)
  ------------------
  |  Branch (12181:13): [True: 0, False: 1.76k]
  ------------------
12182|      0|            goto fail; /* err set by AppendHandshake. */
12183|  1.76k|        rv = ssl3_AppendHandshake(ss, &tlsFinished, sizeof tlsFinished);
12184|  1.76k|        if (rv != SECSuccess)
  ------------------
  |  Branch (12184:13): [True: 0, False: 1.76k]
  ------------------
12185|      0|            goto fail; /* err set by AppendHandshake. */
12186|  1.76k|    } else {
12187|      0|        if (isServer)
  ------------------
  |  Branch (12187:13): [True: 0, False: 0]
  ------------------
12188|      0|            ss->ssl3.hs.finishedMsgs.sFinished[1] = hashes.u.s;
12189|      0|        else
12190|      0|            ss->ssl3.hs.finishedMsgs.sFinished[0] = hashes.u.s;
12191|      0|        PORT_Assert(hashes.len == sizeof hashes.u.s);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12192|      0|        ss->ssl3.hs.finishedBytes = sizeof hashes.u.s;
12193|      0|        rv = ssl3_AppendHandshakeHeader(ss, ssl_hs_finished, sizeof hashes.u.s);
12194|      0|        if (rv != SECSuccess)
  ------------------
  |  Branch (12194:13): [True: 0, False: 0]
  ------------------
12195|      0|            goto fail; /* err set by AppendHandshake. */
12196|      0|        rv = ssl3_AppendHandshake(ss, &hashes.u.s, sizeof hashes.u.s);
12197|      0|        if (rv != SECSuccess)
  ------------------
  |  Branch (12197:13): [True: 0, False: 0]
  ------------------
12198|      0|            goto fail; /* err set by AppendHandshake. */
12199|      0|    }
12200|  1.76k|    rv = ssl3_FlushHandshake(ss, flags);
12201|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (12201:9): [True: 0, False: 1.76k]
  ------------------
12202|      0|        goto fail; /* error code set by ssl3_FlushHandshake */
12203|      0|    }
12204|       |
12205|  1.76k|    ssl3_RecordKeyLog(ss, "CLIENT_RANDOM", ss->ssl3.cwSpec->masterSecret);
12206|       |
12207|  1.76k|    return SECSuccess;
12208|       |
12209|      0|fail:
12210|      0|    return rv;
12211|  1.76k|}
ssl3con.c:ssl3_ComputeTLSFinished:
11957|  1.89k|{
11958|  1.89k|    SECStatus rv;
11959|  1.89k|    CK_TLS_MAC_PARAMS tls_mac_params;
11960|  1.89k|    SECItem param = { siBuffer, NULL, 0 };
11961|  1.89k|    PK11Context *prf_context;
11962|  1.89k|    unsigned int retLen;
11963|       |
11964|  1.89k|    PORT_Assert(spec->masterSecret);
  ------------------
  |  |  120|  1.89k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.89k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.89k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11965|  1.89k|    if (!spec->masterSecret) {
  ------------------
  |  Branch (11965:9): [True: 0, False: 1.89k]
  ------------------
11966|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
11967|      0|        return SECFailure;
11968|      0|    }
11969|       |
11970|  1.89k|    if (spec->version < SSL_LIBRARY_VERSION_TLS_1_2) {
  ------------------
  |  |   20|  1.89k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (11970:9): [True: 171, False: 1.72k]
  ------------------
11971|    171|        tls_mac_params.prfHashMechanism = CKM_TLS_PRF;
  ------------------
  |  |  973|    171|#define CKM_TLS_PRF 0x00000378UL
  ------------------
11972|  1.72k|    } else {
11973|  1.72k|        tls_mac_params.prfHashMechanism = ssl3_GetPrfHashMechanism(ss);
11974|  1.72k|    }
11975|  1.89k|    tls_mac_params.ulMacLength = 12;
11976|  1.89k|    tls_mac_params.ulServerOrClient = isServer ? 1 : 2;
  ------------------
  |  Branch (11976:39): [True: 137, False: 1.76k]
  ------------------
11977|  1.89k|    param.data = (unsigned char *)&tls_mac_params;
11978|  1.89k|    param.len = sizeof(tls_mac_params);
11979|  1.89k|    prf_context = PK11_CreateContextBySymKey(CKM_TLS_MAC, CKA_SIGN,
  ------------------
  |  | 1032|  1.89k|#define CKM_TLS_MAC 0x000003E4UL
  ------------------
                  prf_context = PK11_CreateContextBySymKey(CKM_TLS_MAC, CKA_SIGN,
  ------------------
  |  |  551|  1.89k|#define CKA_SIGN 0x00000108UL
  ------------------
11980|  1.89k|                                             spec->masterSecret, &param);
11981|  1.89k|    if (!prf_context)
  ------------------
  |  Branch (11981:9): [True: 0, False: 1.89k]
  ------------------
11982|      0|        return SECFailure;
11983|       |
11984|  1.89k|    rv = PK11_DigestBegin(prf_context);
11985|  1.89k|    rv |= PK11_DigestOp(prf_context, hashes->u.raw, hashes->len);
11986|  1.89k|    rv |= PK11_DigestFinal(prf_context, tlsFinished->verify_data, &retLen,
11987|  1.89k|                           sizeof tlsFinished->verify_data);
11988|  1.89k|    PORT_Assert(rv != SECSuccess || retLen == sizeof tlsFinished->verify_data);
  ------------------
  |  |  120|  1.89k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.79k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 1.89k]
  |  |  |  |  |  Branch (208:7): [True: 1.89k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11989|       |
11990|  1.89k|    PK11_DestroyContext(prf_context, PR_TRUE);
  ------------------
  |  |  437|  1.89k|#define PR_TRUE 1
  ------------------
11991|       |
11992|  1.89k|    return rv;
11993|  1.89k|}
ssl3con.c:ssl3_HandleServerHello:
 7068|  7.90k|{
 7069|  7.90k|    PRUint32 cipher;
 7070|  7.90k|    int errCode = SSL_ERROR_RX_MALFORMED_SERVER_HELLO;
 7071|  7.90k|    PRUint32 compression;
 7072|  7.90k|    SECStatus rv;
 7073|  7.90k|    SECItem sidBytes = { siBuffer, NULL, 0 };
 7074|  7.90k|    PRBool isHelloRetry;
 7075|  7.90k|    SSL3AlertDescription desc = illegal_parameter;
 7076|  7.90k|    const PRUint8 *savedMsg = b;
 7077|  7.90k|    const PRUint32 savedLength = length;
 7078|       |
 7079|  7.90k|    SSL_TRC(3, ("%d: SSL3[%d]: handle server_hello handshake",
  ------------------
  |  |   71|  7.90k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |   72|  7.90k|    ssl_Trace b
  ------------------
 7080|  7.90k|                SSL_GETPID(), ss->fd));
 7081|  7.90k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  7.90k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  11.9k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 3.88k, False: 4.01k]
  |  |  |  |  |  Branch (208:7): [True: 4.01k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7082|  7.90k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  7.90k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  11.9k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 3.88k, False: 4.01k]
  |  |  |  |  |  Branch (208:7): [True: 4.01k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7083|       |
 7084|  7.90k|    if (ss->ssl3.hs.ws != wait_server_hello) {
  ------------------
  |  Branch (7084:9): [True: 5, False: 7.89k]
  ------------------
 7085|      5|        errCode = SSL_ERROR_RX_UNEXPECTED_SERVER_HELLO;
 7086|      5|        desc = unexpected_message;
 7087|      5|        goto alert_loser;
 7088|      5|    }
 7089|       |
 7090|       |    /* clean up anything left from previous handshake. */
 7091|  7.89k|    if (ss->ssl3.clientCertChain != NULL) {
  ------------------
  |  Branch (7091:9): [True: 0, False: 7.89k]
  ------------------
 7092|      0|        CERT_DestroyCertificateList(ss->ssl3.clientCertChain);
 7093|      0|        ss->ssl3.clientCertChain = NULL;
 7094|      0|    }
 7095|  7.89k|    if (ss->ssl3.clientCertificate != NULL) {
  ------------------
  |  Branch (7095:9): [True: 0, False: 7.89k]
  ------------------
 7096|      0|        CERT_DestroyCertificate(ss->ssl3.clientCertificate);
 7097|      0|        ss->ssl3.clientCertificate = NULL;
 7098|      0|    }
 7099|  7.89k|    if (ss->ssl3.clientPrivateKey != NULL) {
  ------------------
  |  Branch (7099:9): [True: 0, False: 7.89k]
  ------------------
 7100|      0|        SECKEY_DestroyPrivateKey(ss->ssl3.clientPrivateKey);
 7101|      0|        ss->ssl3.clientPrivateKey = NULL;
 7102|      0|    }
 7103|       |    // TODO(djackson) - Bob removed this. Why?
 7104|  7.89k|    if (ss->ssl3.hs.clientAuthSignatureSchemes != NULL) {
  ------------------
  |  Branch (7104:9): [True: 0, False: 7.89k]
  ------------------
 7105|      0|        PR_Free(ss->ssl3.hs.clientAuthSignatureSchemes);
 7106|      0|        ss->ssl3.hs.clientAuthSignatureSchemes = NULL;
 7107|      0|        ss->ssl3.hs.clientAuthSignatureSchemesLen = 0;
 7108|      0|    }
 7109|       |
 7110|       |    /* Note that if the server selects TLS 1.3, this will set the version to TLS
 7111|       |     * 1.2.  We will amend that once all other fields have been read. */
 7112|  7.89k|    rv = ssl_ClientReadVersion(ss, &b, &length, &ss->version);
 7113|  7.89k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7113:9): [True: 9, False: 7.88k]
  ------------------
 7114|      9|        goto loser; /* alert has been sent */
 7115|      9|    }
 7116|       |
 7117|  7.88k|    rv = ssl3_ConsumeHandshake(
 7118|  7.88k|        ss, ss->ssl3.hs.server_random, SSL3_RANDOM_LENGTH, &b, &length);
  ------------------
  |  |   24|  7.88k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 7119|  7.88k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7119:9): [True: 5, False: 7.88k]
  ------------------
 7120|      5|        goto loser; /* alert has been sent */
 7121|      5|    }
 7122|  7.88k|    isHelloRetry = !PORT_Memcmp(ss->ssl3.hs.server_random,
  ------------------
  |  |  179|  7.88k|#define PORT_Memcmp memcmp
  ------------------
 7123|  7.88k|                                ssl_hello_retry_random, SSL3_RANDOM_LENGTH);
  ------------------
  |  |   24|  7.88k|#define SSL3_RANDOM_LENGTH 32
  ------------------
 7124|       |
 7125|  7.88k|    rv = ssl3_ConsumeHandshakeVariable(ss, &sidBytes, 1, &b, &length);
 7126|  7.88k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7126:9): [True: 73, False: 7.80k]
  ------------------
 7127|     73|        goto loser; /* alert has been sent */
 7128|     73|    }
 7129|  7.80k|    if (sidBytes.len > SSL3_SESSIONID_BYTES) {
  ------------------
  |  |  107|  7.80k|#define SSL3_SESSIONID_BYTES 32
  ------------------
  |  Branch (7129:9): [True: 3, False: 7.80k]
  ------------------
 7130|      3|        if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_0)
  ------------------
  |  |   18|      3|#define SSL_LIBRARY_VERSION_TLS_1_0             0x0301
  ------------------
  |  Branch (7130:13): [True: 3, False: 0]
  ------------------
 7131|      3|            desc = decode_error;
 7132|      3|        goto alert_loser; /* malformed. */
 7133|      3|    }
 7134|       |
 7135|       |    /* Read the cipher suite. */
 7136|  7.80k|    rv = ssl3_ConsumeHandshakeNumber(ss, &cipher, 2, &b, &length);
 7137|  7.80k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7137:9): [True: 31, False: 7.77k]
  ------------------
 7138|     31|        goto loser; /* alert has been sent */
 7139|     31|    }
 7140|       |
 7141|       |    /* Compression method. */
 7142|  7.77k|    rv = ssl3_ConsumeHandshakeNumber(ss, &compression, 1, &b, &length);
 7143|  7.77k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7143:9): [True: 3, False: 7.77k]
  ------------------
 7144|      3|        goto loser; /* alert has been sent */
 7145|      3|    }
 7146|  7.77k|    if (compression != ssl_compression_null) {
  ------------------
  |  Branch (7146:9): [True: 8, False: 7.76k]
  ------------------
 7147|      8|        desc = illegal_parameter;
 7148|      8|        errCode = SSL_ERROR_RX_MALFORMED_SERVER_HELLO;
 7149|      8|        goto alert_loser;
 7150|      8|    }
 7151|       |
 7152|       |    /* Parse extensions. */
 7153|  7.76k|    if (length != 0) {
  ------------------
  |  Branch (7153:9): [True: 3.62k, False: 4.13k]
  ------------------
 7154|  3.62k|        PRUint32 extensionLength;
 7155|  3.62k|        rv = ssl3_ConsumeHandshakeNumber(ss, &extensionLength, 2, &b, &length);
 7156|  3.62k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7156:13): [True: 1, False: 3.62k]
  ------------------
 7157|      1|            goto loser; /* alert already sent */
 7158|      1|        }
 7159|  3.62k|        if (extensionLength != length) {
  ------------------
  |  Branch (7159:13): [True: 24, False: 3.60k]
  ------------------
 7160|     24|            desc = decode_error;
 7161|     24|            goto alert_loser;
 7162|     24|        }
 7163|  3.60k|        rv = ssl3_ParseExtensions(ss, &b, &length);
 7164|  3.60k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7164:13): [True: 31, False: 3.56k]
  ------------------
 7165|     31|            goto alert_loser; /* malformed */
 7166|     31|        }
 7167|  3.60k|    }
 7168|       |
 7169|       |    /* Read supported_versions if present. */
 7170|  7.70k|    rv = tls13_ClientReadSupportedVersion(ss);
 7171|  7.70k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7171:9): [True: 15, False: 7.69k]
  ------------------
 7172|     15|        goto loser;
 7173|     15|    }
 7174|       |
 7175|       |    /* RFC 9147. 5.2.
 7176|       |     * DTLS Handshake Message Format states the difference between the computation
 7177|       |     * of the transcript if the version is DTLS1.2 or DTLS1.3.
 7178|       |     *
 7179|       |     * At this moment we are sure which version
 7180|       |     * we are planning to use during the connection, so we can compute the hash. */
 7181|  7.69k|    rv = ssl3_MaybeUpdateHashWithSavedRecord(ss);
 7182|  7.69k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7182:9): [True: 0, False: 7.69k]
  ------------------
 7183|      0|        goto loser;
 7184|      0|    }
 7185|       |
 7186|  7.69k|    PORT_Assert(!SSL_ALL_VERSIONS_DISABLED(&ss->vrange));
  ------------------
  |  |  120|  7.69k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  7.69k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 7.69k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7187|       |    /* Check that the version is within the configured range. */
 7188|  7.69k|    if (ss->vrange.min > ss->version || ss->vrange.max < ss->version) {
  ------------------
  |  Branch (7188:9): [True: 6, False: 7.68k]
  |  Branch (7188:41): [True: 2, False: 7.68k]
  ------------------
 7189|      8|        desc = (ss->version > SSL_LIBRARY_VERSION_3_0)
  ------------------
  |  |   17|      8|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (7189:16): [True: 8, False: 0]
  ------------------
 7190|      8|                   ? protocol_version
 7191|      8|                   : handshake_failure;
 7192|      8|        errCode = SSL_ERROR_UNSUPPORTED_VERSION;
 7193|      8|        goto alert_loser;
 7194|      8|    }
 7195|       |
 7196|  7.68k|    if (isHelloRetry && ss->ssl3.hs.helloRetry) {
  ------------------
  |  Branch (7196:9): [True: 1.00k, False: 6.68k]
  |  Branch (7196:25): [True: 2, False: 999]
  ------------------
 7197|      2|        SSL_TRC(3, ("%d: SSL3[%d]: received a second hello_retry_request",
  ------------------
  |  |   71|      2|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   72|      2|    ssl_Trace b
  ------------------
 7198|      2|                    SSL_GETPID(), ss->fd));
 7199|      2|        desc = unexpected_message;
 7200|      2|        errCode = SSL_ERROR_RX_UNEXPECTED_HELLO_RETRY_REQUEST;
 7201|      2|        goto alert_loser;
 7202|      2|    }
 7203|       |
 7204|       |    /* There are three situations in which the server must pick
 7205|       |     * TLS 1.3.
 7206|       |     *
 7207|       |     * 1. We received HRR
 7208|       |     * 2. We sent early app data
 7209|       |     * 3. ECH was accepted (checked in MaybeHandleEchSignal)
 7210|       |     *
 7211|       |     * If we offered ECH and the server negotiated a lower version,
 7212|       |     * authenticate to the public name for secure disablement.
 7213|       |     *
 7214|       |     */
 7215|  7.68k|    if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  7.68k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (7215:9): [True: 5.68k, False: 1.99k]
  ------------------
 7216|  5.68k|        if (isHelloRetry || ss->ssl3.hs.helloRetry) {
  ------------------
  |  Branch (7216:13): [True: 1, False: 5.68k]
  |  Branch (7216:29): [True: 2, False: 5.68k]
  ------------------
 7217|       |            /* SSL3_SendAlert() will uncache the SID. */
 7218|      3|            desc = illegal_parameter;
 7219|      3|            errCode = SSL_ERROR_RX_MALFORMED_SERVER_HELLO;
 7220|      3|            goto alert_loser;
 7221|      3|        }
 7222|  5.68k|        if (ss->ssl3.hs.zeroRttState == ssl_0rtt_sent) {
  ------------------
  |  Branch (7222:13): [True: 0, False: 5.68k]
  ------------------
 7223|       |            /* SSL3_SendAlert() will uncache the SID. */
 7224|      0|            desc = illegal_parameter;
 7225|      0|            errCode = SSL_ERROR_DOWNGRADE_WITH_EARLY_DATA;
 7226|      0|            goto alert_loser;
 7227|      0|        }
 7228|  5.68k|    }
 7229|       |
 7230|       |    /* Check that the server negotiated the same version as it did
 7231|       |     * in the first handshake. This isn't really the best place for
 7232|       |     * us to be getting this version number, but it's what we have.
 7233|       |     * (1294697). */
 7234|  7.67k|    if (ss->firstHsDone && (ss->version != ss->ssl3.crSpec->version)) {
  ------------------
  |  Branch (7234:9): [True: 0, False: 7.67k]
  |  Branch (7234:28): [True: 0, False: 0]
  ------------------
 7235|      0|        desc = protocol_version;
 7236|      0|        errCode = SSL_ERROR_UNSUPPORTED_VERSION;
 7237|      0|        goto alert_loser;
 7238|      0|    }
 7239|       |
 7240|  7.67k|    if (ss->opt.enableHelloDowngradeCheck) {
  ------------------
  |  Branch (7240:9): [True: 7.67k, False: 0]
  ------------------
 7241|  7.67k|        rv = ssl_CheckServerRandom(ss);
 7242|  7.67k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7242:13): [True: 2, False: 7.67k]
  ------------------
 7243|      2|            desc = illegal_parameter;
 7244|      2|            errCode = SSL_ERROR_RX_MALFORMED_SERVER_HELLO;
 7245|      2|            goto alert_loser;
 7246|      2|        }
 7247|  7.67k|    }
 7248|       |
 7249|       |    /* Finally, now all the version-related checks have passed. */
 7250|  7.67k|    ss->ssl3.hs.preliminaryInfo |= ssl_preinfo_version;
  ------------------
  |  |  392|  7.67k|#define ssl_preinfo_version (1U << 0)
  ------------------
 7251|       |    /* Update the write cipher spec to match the version. But not after
 7252|       |     * HelloRetryRequest, because cwSpec might be a 0-RTT cipher spec,
 7253|       |     * in which case this is a no-op. */
 7254|  7.67k|    if (!ss->firstHsDone && !isHelloRetry) {
  ------------------
  |  Branch (7254:9): [True: 7.67k, False: 0]
  |  Branch (7254:29): [True: 6.67k, False: 998]
  ------------------
 7255|  6.67k|        ssl_GetSpecWriteLock(ss);
  ------------------
  |  | 1435|  6.67k|    {                                            \
  |  | 1436|  6.67k|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 3.40k, False: 3.27k]
  |  |  ------------------
  |  | 1437|  6.67k|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|  3.40k|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|  6.67k|    }
  ------------------
 7256|  6.67k|        ssl_SetSpecVersions(ss, ss->ssl3.cwSpec);
 7257|  6.67k|        ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|  6.67k|    {                                              \
  |  | 1441|  6.67k|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 3.40k, False: 3.27k]
  |  |  ------------------
  |  | 1442|  6.67k|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|  3.40k|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|  6.67k|    }
  ------------------
 7258|  6.67k|    }
 7259|       |
 7260|       |    /* Check that the session ID is as expected. */
 7261|  7.67k|    if (!ssl_CheckServerSessionIdCorrectness(ss, &sidBytes)) {
  ------------------
  |  Branch (7261:9): [True: 1, False: 7.67k]
  ------------------
 7262|      1|        desc = illegal_parameter;
 7263|      1|        errCode = SSL_ERROR_RX_MALFORMED_SERVER_HELLO;
 7264|      1|        goto alert_loser;
 7265|      1|    }
 7266|       |
 7267|       |    /* Only initialize hashes if this isn't a Hello Retry. */
 7268|  7.67k|    rv = ssl_ClientSetCipherSuite(ss, ss->version, cipher,
 7269|  7.67k|                                  !isHelloRetry);
 7270|  7.67k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7270:9): [True: 32, False: 7.64k]
  ------------------
 7271|     32|        desc = illegal_parameter;
 7272|     32|        errCode = PORT_GetError();
  ------------------
  |  |   62|     32|#define PORT_GetError PORT_GetError_Util
  ------------------
 7273|     32|        goto alert_loser;
 7274|     32|    }
 7275|       |
 7276|  7.64k|    dtls_ReceivedFirstMessageInFlight(ss);
 7277|       |
 7278|  7.64k|    if (isHelloRetry) {
  ------------------
  |  Branch (7278:9): [True: 998, False: 6.64k]
  ------------------
 7279|    998|        rv = tls13_HandleHelloRetryRequest(ss, savedMsg, savedLength);
 7280|    998|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7280:13): [True: 26, False: 972]
  ------------------
 7281|     26|            goto loser;
 7282|     26|        }
 7283|    972|        return SECSuccess;
 7284|    998|    }
 7285|       |
 7286|  6.64k|    rv = ssl3_HandleParsedExtensions(ss, ssl_hs_server_hello);
 7287|  6.64k|    ssl3_DestroyRemoteExtensions(&ss->ssl3.hs.remoteExtensions);
 7288|  6.64k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7288:9): [True: 136, False: 6.51k]
  ------------------
 7289|    136|        goto alert_loser;
 7290|    136|    }
 7291|       |
 7292|  6.51k|    rv = ssl_HashHandshakeMessage(ss, ssl_hs_server_hello,
 7293|  6.51k|                                  savedMsg, savedLength);
 7294|  6.51k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7294:9): [True: 0, False: 6.51k]
  ------------------
 7295|      0|        goto loser;
 7296|      0|    }
 7297|       |
 7298|  6.51k|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  6.51k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (7298:9): [True: 922, False: 5.58k]
  ------------------
 7299|    922|        rv = tls13_HandleServerHelloPart2(ss, savedMsg, savedLength);
 7300|    922|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7300:13): [True: 76, False: 846]
  ------------------
 7301|     76|            errCode = PORT_GetError();
  ------------------
  |  |   62|     76|#define PORT_GetError PORT_GetError_Util
  ------------------
 7302|     76|            goto loser;
 7303|     76|        }
 7304|  5.58k|    } else {
 7305|  5.58k|        rv = ssl3_HandleServerHelloPart2(ss, &sidBytes, &errCode);
 7306|  5.58k|        if (rv != SECSuccess)
  ------------------
  |  Branch (7306:13): [True: 24, False: 5.56k]
  ------------------
 7307|     24|            goto loser;
 7308|  5.58k|    }
 7309|       |
 7310|  6.41k|    ss->ssl3.hs.preliminaryInfo |= ssl_preinfo_ech;
  ------------------
  |  |  398|  6.41k|#define ssl_preinfo_ech (1U << 4)
  ------------------
 7311|  6.41k|    return SECSuccess;
 7312|       |
 7313|    255|alert_loser:
 7314|    255|    (void)SSL3_SendAlert(ss, alert_fatal, desc);
 7315|       |
 7316|    518|loser:
 7317|       |    /* Clean up the temporary pointer to the handshake buffer. */
 7318|    518|    ss->xtnData.signedCertTimestamps.len = 0;
 7319|    518|    ssl_MapLowLevelError(errCode);
 7320|    518|    return SECFailure;
 7321|    255|}
ssl3con.c:ssl_CheckServerSessionIdCorrectness:
 6987|  7.67k|{
 6988|  7.67k|    sslSessionID *sid = ss->sec.ci.sid;
 6989|  7.67k|    PRBool sidMatch = PR_FALSE;
  ------------------
  |  |  438|  7.67k|#define PR_FALSE 0
  ------------------
 6990|  7.67k|    PRBool sentFakeSid = PR_FALSE;
  ------------------
  |  |  438|  7.67k|#define PR_FALSE 0
  ------------------
 6991|  7.67k|    PRBool sentRealSid = sid && sid->version < SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|  7.67k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (6991:26): [True: 7.67k, False: 0]
  |  Branch (6991:33): [True: 1.01k, False: 6.66k]
  ------------------
 6992|       |
 6993|       |    /* If attempting to resume a TLS 1.2 connection, the session ID won't be a
 6994|       |     * fake. Check for the real value. */
 6995|  7.67k|    if (sentRealSid) {
  ------------------
  |  Branch (6995:9): [True: 1.01k, False: 6.66k]
  ------------------
 6996|  1.01k|        sidMatch = (sidBytes->len == sid->u.ssl3.sessionIDLength) &&
  ------------------
  |  Branch (6996:20): [True: 739, False: 277]
  ------------------
 6997|  1.01k|                   (!sidBytes->len || PORT_Memcmp(sid->u.ssl3.sessionID, sidBytes->data, sidBytes->len) == 0);
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (6997:21): [True: 739, False: 0]
  |  Branch (6997:39): [True: 0, False: 0]
  ------------------
 6998|  6.66k|    } else {
 6999|       |        /* Otherwise, the session ID was a fake if TLS 1.3 compat mode is
 7000|       |         * enabled.  If so, check for the fake value. */
 7001|  6.66k|        sentFakeSid = ss->opt.enableTls13CompatMode && !IS_DTLS(ss);
  ------------------
  |  |  892|  9.92k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (7001:23): [True: 3.26k, False: 3.39k]
  |  Branch (7001:56): [True: 0, False: 3.26k]
  ------------------
 7002|  6.66k|        if (sentFakeSid && sidBytes->len == SSL3_SESSIONID_BYTES) {
  ------------------
  |  |  107|      0|#define SSL3_SESSIONID_BYTES 32
  ------------------
  |  Branch (7002:13): [True: 0, False: 6.66k]
  |  Branch (7002:28): [True: 0, False: 0]
  ------------------
 7003|      0|            PRUint8 buf[SSL3_SESSIONID_BYTES];
 7004|      0|            ssl_MakeFakeSid(ss, buf);
 7005|      0|            sidMatch = PORT_Memcmp(buf, sidBytes->data, sidBytes->len) == 0;
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
 7006|      0|        }
 7007|  6.66k|    }
 7008|       |
 7009|       |    /* TLS 1.2: Session ID shouldn't match if we sent a fake. */
 7010|  7.67k|    if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  7.67k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (7010:9): [True: 5.68k, False: 1.99k]
  ------------------
 7011|  5.68k|        if (sentFakeSid) {
  ------------------
  |  Branch (7011:13): [True: 0, False: 5.68k]
  ------------------
 7012|      0|            return !sidMatch;
 7013|      0|        }
 7014|  5.68k|        return PR_TRUE;
  ------------------
  |  |  437|  5.68k|#define PR_TRUE 1
  ------------------
 7015|  5.68k|    }
 7016|       |
 7017|       |    /* TLS 1.3: We sent a session ID.  The server's should match. */
 7018|  1.99k|    if (!IS_DTLS(ss) && (sentRealSid || sentFakeSid)) {
  ------------------
  |  |  892|  3.98k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (7018:9): [True: 0, False: 1.99k]
  |  Branch (7018:26): [True: 0, False: 0]
  |  Branch (7018:41): [True: 0, False: 0]
  ------------------
 7019|      0|        return sidMatch;
 7020|      0|    }
 7021|       |
 7022|       |    /* TLS 1.3 (no SID)/DTLS 1.3: The server shouldn't send a session ID. */
 7023|  1.99k|    return sidBytes->len == 0;
 7024|  1.99k|}
ssl3con.c:ssl3_HandleServerHelloPart2:
 7371|  5.58k|{
 7372|  5.58k|    SSL3AlertDescription desc = handshake_failure;
 7373|  5.58k|    int errCode = SSL_ERROR_RX_MALFORMED_SERVER_HELLO;
 7374|  5.58k|    SECStatus rv;
 7375|  5.58k|    PRBool sid_match;
 7376|  5.58k|    sslSessionID *sid = ss->sec.ci.sid;
 7377|       |
 7378|  5.58k|    if ((ss->opt.requireSafeNegotiation ||
  ------------------
  |  Branch (7378:10): [True: 810, False: 4.77k]
  ------------------
 7379|  5.58k|         (ss->firstHsDone && (ss->peerRequestedProtection ||
  ------------------
  |  Branch (7379:11): [True: 0, False: 4.77k]
  |  Branch (7379:31): [True: 0, False: 0]
  ------------------
 7380|      0|                              ss->opt.enableRenegotiation ==
  ------------------
  |  Branch (7380:31): [True: 0, False: 0]
  ------------------
 7381|      0|                                  SSL_RENEGOTIATE_REQUIRES_XTN))) &&
  ------------------
  |  |  717|      0|#define SSL_RENEGOTIATE_REQUIRES_XTN ((PRBool)2)
  ------------------
 7382|  5.58k|        !ssl3_ExtensionNegotiated(ss, ssl_renegotiation_info_xtn)) {
  ------------------
  |  Branch (7382:9): [True: 24, False: 786]
  ------------------
 7383|     24|        desc = handshake_failure;
 7384|     24|        errCode = ss->firstHsDone ? SSL_ERROR_RENEGOTIATION_NOT_ALLOWED
  ------------------
  |  Branch (7384:19): [True: 0, False: 24]
  ------------------
 7385|     24|                                  : SSL_ERROR_UNSAFE_NEGOTIATION;
 7386|     24|        goto alert_loser;
 7387|     24|    }
 7388|       |
 7389|       |    /* Any errors after this point are not "malformed" errors. */
 7390|  5.56k|    desc = handshake_failure;
 7391|       |
 7392|       |    /* we need to call ssl3_SetupPendingCipherSpec here so we can check the
 7393|       |     * key exchange algorithm. */
 7394|  5.56k|    rv = ssl3_SetupBothPendingCipherSpecs(ss);
 7395|  5.56k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7395:9): [True: 0, False: 5.56k]
  ------------------
 7396|      0|        goto alert_loser; /* error code is set. */
 7397|      0|    }
 7398|       |
 7399|       |    /* We may or may not have sent a session id, we may get one back or
 7400|       |     * not and if so it may match the one we sent.
 7401|       |     * Attempt to restore the master secret to see if this is so...
 7402|       |     * Don't consider failure to find a matching SID an error.
 7403|       |     */
 7404|  5.56k|    sid_match = (PRBool)(sidBytes->len > 0 &&
  ------------------
  |  Branch (7404:26): [True: 1.47k, False: 4.08k]
  ------------------
 7405|  5.56k|                         sidBytes->len ==
  ------------------
  |  Branch (7405:26): [True: 0, False: 1.47k]
  ------------------
 7406|  1.47k|                             sid->u.ssl3.sessionIDLength &&
 7407|  5.56k|                         !PORT_Memcmp(sid->u.ssl3.sessionID,
  ------------------
  |  |  179|      0|#define PORT_Memcmp memcmp
  ------------------
  |  Branch (7407:26): [True: 0, False: 0]
  ------------------
 7408|      0|                                      sidBytes->data, sidBytes->len));
 7409|       |
 7410|  5.56k|    if (sid_match) {
  ------------------
  |  Branch (7410:9): [True: 0, False: 5.56k]
  ------------------
 7411|      0|        if (sid->version != ss->version ||
  ------------------
  |  Branch (7411:13): [True: 0, False: 0]
  ------------------
 7412|      0|            sid->u.ssl3.cipherSuite != ss->ssl3.hs.cipher_suite) {
  ------------------
  |  Branch (7412:13): [True: 0, False: 0]
  ------------------
 7413|      0|            errCode = SSL_ERROR_RX_MALFORMED_SERVER_HELLO;
 7414|      0|            goto alert_loser;
 7415|      0|        }
 7416|      0|        do {
 7417|      0|            PK11SymKey *masterSecret;
 7418|       |
 7419|       |            /* [draft-ietf-tls-session-hash-06; Section 5.3]
 7420|       |             *
 7421|       |             * o  If the original session did not use the "extended_master_secret"
 7422|       |             *    extension but the new ServerHello contains the extension, the
 7423|       |             *    client MUST abort the handshake.
 7424|       |             */
 7425|      0|            if (!sid->u.ssl3.keys.extendedMasterSecretUsed &&
  ------------------
  |  Branch (7425:17): [True: 0, False: 0]
  ------------------
 7426|      0|                ssl3_ExtensionNegotiated(ss, ssl_extended_master_secret_xtn)) {
  ------------------
  |  Branch (7426:17): [True: 0, False: 0]
  ------------------
 7427|      0|                errCode = SSL_ERROR_UNEXPECTED_EXTENDED_MASTER_SECRET;
 7428|      0|                goto alert_loser;
 7429|      0|            }
 7430|       |
 7431|       |            /*
 7432|       |             *   o  If the original session used an extended master secret but the new
 7433|       |             *      ServerHello does not contain the "extended_master_secret"
 7434|       |             *      extension, the client SHOULD abort the handshake.
 7435|       |             *
 7436|       |             * TODO(ekr@rtfm.com): Add option to refuse to resume when EMS is not
 7437|       |             * used at all (bug 1176526).
 7438|       |             */
 7439|      0|            if (sid->u.ssl3.keys.extendedMasterSecretUsed &&
  ------------------
  |  Branch (7439:17): [True: 0, False: 0]
  ------------------
 7440|      0|                !ssl3_ExtensionNegotiated(ss, ssl_extended_master_secret_xtn)) {
  ------------------
  |  Branch (7440:17): [True: 0, False: 0]
  ------------------
 7441|      0|                errCode = SSL_ERROR_MISSING_EXTENDED_MASTER_SECRET;
 7442|      0|                goto alert_loser;
 7443|      0|            }
 7444|       |
 7445|      0|            ss->sec.authType = sid->authType;
 7446|      0|            ss->sec.authKeyBits = sid->authKeyBits;
 7447|      0|            ss->sec.keaType = sid->keaType;
 7448|      0|            ss->sec.keaKeyBits = sid->keaKeyBits;
 7449|      0|            ss->sec.originalKeaGroup = ssl_LookupNamedGroup(sid->keaGroup);
 7450|      0|            ss->sec.signatureScheme = sid->sigScheme;
 7451|       |
 7452|      0|            rv = ssl3_UnwrapMasterSecretClient(ss, sid, &masterSecret);
 7453|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (7453:17): [True: 0, False: 0]
  ------------------
 7454|      0|                break; /* not considered an error */
 7455|      0|            }
 7456|       |
 7457|       |            /* Got a Match */
 7458|      0|            SSL_AtomicIncrementLong(&ssl3stats.hsh_sid_cache_hits);
 7459|       |
 7460|       |            /* If we sent a session ticket, then this is a stateless resume. */
 7461|      0|            if (ss->xtnData.sentSessionTicketInClientHello)
  ------------------
  |  Branch (7461:17): [True: 0, False: 0]
  ------------------
 7462|      0|                SSL_AtomicIncrementLong(&ssl3stats.hsh_sid_stateless_resumes);
 7463|       |
 7464|      0|            if (ssl3_ExtensionNegotiated(ss, ssl_session_ticket_xtn))
  ------------------
  |  Branch (7464:17): [True: 0, False: 0]
  ------------------
 7465|      0|                ss->ssl3.hs.ws = wait_new_session_ticket;
 7466|      0|            else
 7467|      0|                ss->ssl3.hs.ws = wait_change_cipher;
 7468|       |
 7469|      0|            ss->ssl3.hs.isResuming = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 7470|       |
 7471|       |            /* copy the peer cert from the SID */
 7472|      0|            if (sid->peerCert != NULL) {
  ------------------
  |  Branch (7472:17): [True: 0, False: 0]
  ------------------
 7473|      0|                ss->sec.peerCert = CERT_DupCertificate(sid->peerCert);
 7474|      0|            }
 7475|       |
 7476|       |            /* We are re-using the old MS, so no need to derive again. */
 7477|      0|            rv = ssl3_InitPendingCipherSpecs(ss, masterSecret, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 7478|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (7478:17): [True: 0, False: 0]
  ------------------
 7479|      0|                goto alert_loser; /* err code was set */
 7480|      0|            }
 7481|      0|            return SECSuccess;
 7482|      0|        } while (0);
  ------------------
  |  Branch (7482:18): [Folded - Ignored]
  ------------------
 7483|      0|    }
 7484|       |
 7485|  5.56k|    if (sid_match)
  ------------------
  |  Branch (7485:9): [True: 0, False: 5.56k]
  ------------------
 7486|      0|        SSL_AtomicIncrementLong(&ssl3stats.hsh_sid_cache_not_ok);
 7487|  5.56k|    else
 7488|  5.56k|        SSL_AtomicIncrementLong(&ssl3stats.hsh_sid_cache_misses);
 7489|       |
 7490|       |    /* We tried to resume a 1.3 session but the server negotiated 1.2. */
 7491|  5.56k|    if (ss->statelessResume) {
  ------------------
  |  Branch (7491:9): [True: 0, False: 5.56k]
  ------------------
 7492|      0|        PORT_Assert(sid->version == SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7493|      0|        PORT_Assert(ss->ssl3.hs.currentSecret);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7494|       |
 7495|       |        /* Reset resumption state, only used by 1.3 code. */
 7496|      0|        ss->statelessResume = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 7497|       |
 7498|       |        /* Clear TLS 1.3 early data traffic key. */
 7499|      0|        PK11_FreeSymKey(ss->ssl3.hs.currentSecret);
 7500|      0|        ss->ssl3.hs.currentSecret = NULL;
 7501|      0|    }
 7502|       |
 7503|       |    /* throw the old one away */
 7504|  5.56k|    sid->u.ssl3.keys.resumable = PR_FALSE;
  ------------------
  |  |  438|  5.56k|#define PR_FALSE 0
  ------------------
 7505|  5.56k|    ssl_UncacheSessionID(ss);
 7506|  5.56k|    ssl_FreeSID(sid);
 7507|       |
 7508|       |    /* get a new sid */
 7509|  5.56k|    ss->sec.ci.sid = sid = ssl3_NewSessionID(ss, PR_FALSE);
  ------------------
  |  |  438|  5.56k|#define PR_FALSE 0
  ------------------
 7510|  5.56k|    if (sid == NULL) {
  ------------------
  |  Branch (7510:9): [True: 0, False: 5.56k]
  ------------------
 7511|      0|        goto alert_loser; /* memory error is set. */
 7512|      0|    }
 7513|       |
 7514|  5.56k|    sid->version = ss->version;
 7515|  5.56k|    sid->u.ssl3.sessionIDLength = sidBytes->len;
 7516|  5.56k|    if (sidBytes->len > 0) {
  ------------------
  |  Branch (7516:9): [True: 1.47k, False: 4.08k]
  ------------------
 7517|  1.47k|        PORT_Memcpy(sid->u.ssl3.sessionID, sidBytes->data, sidBytes->len);
  ------------------
  |  |  180|  1.47k|#define PORT_Memcpy memcpy
  ------------------
 7518|  1.47k|    }
 7519|       |
 7520|  5.56k|    sid->u.ssl3.keys.extendedMasterSecretUsed =
 7521|  5.56k|        ssl3_ExtensionNegotiated(ss, ssl_extended_master_secret_xtn);
 7522|       |
 7523|       |    /* Copy Signed Certificate Timestamps, if any. */
 7524|  5.56k|    if (ss->xtnData.signedCertTimestamps.len) {
  ------------------
  |  Branch (7524:9): [True: 0, False: 5.56k]
  ------------------
 7525|      0|        rv = SECITEM_CopyItem(NULL, &sid->u.ssl3.signedCertTimestamps,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 7526|      0|                              &ss->xtnData.signedCertTimestamps);
 7527|      0|        ss->xtnData.signedCertTimestamps.len = 0;
 7528|      0|        if (rv != SECSuccess)
  ------------------
  |  Branch (7528:13): [True: 0, False: 0]
  ------------------
 7529|      0|            goto loser;
 7530|      0|    }
 7531|       |
 7532|  5.56k|    ss->ssl3.hs.isResuming = PR_FALSE;
  ------------------
  |  |  438|  5.56k|#define PR_FALSE 0
  ------------------
 7533|  5.56k|    if (ss->ssl3.hs.kea_def->authKeyType != ssl_auth_null) {
  ------------------
  |  Branch (7533:9): [True: 5.56k, False: 0]
  ------------------
 7534|       |        /* All current cipher suites other than those with ssl_auth_null (i.e.,
 7535|       |         * (EC)DH_anon_* suites) require a certificate, so use that signal. */
 7536|  5.56k|        ss->ssl3.hs.ws = wait_server_cert;
 7537|  5.56k|    } else {
 7538|       |        /* All the remaining cipher suites must be (EC)DH_anon_* and so
 7539|       |         * must be ephemeral. Note, if we ever add PSK this might
 7540|       |         * change. */
 7541|      0|        PORT_Assert(ss->ssl3.hs.kea_def->ephemeral);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7542|      0|        ss->ssl3.hs.ws = wait_server_key;
 7543|      0|    }
 7544|  5.56k|    return SECSuccess;
 7545|       |
 7546|     24|alert_loser:
 7547|     24|    (void)SSL3_SendAlert(ss, alert_fatal, desc);
 7548|       |
 7549|     24|loser:
 7550|     24|    *retErrCode = errCode;
 7551|     24|    return SECFailure;
 7552|     24|}
ssl3con.c:ssl3_HandlePostHelloHandshakeMessage:
12768|  11.7k|{
12769|  11.7k|    SECStatus rv;
12770|  11.7k|    PORT_Assert(ss->version < SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|  11.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  11.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 11.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12771|       |
12772|  11.7k|    switch (ss->ssl3.hs.msg_type) {
12773|    168|        case ssl_hs_hello_request:
  ------------------
  |  Branch (12773:9): [True: 168, False: 11.5k]
  ------------------
12774|    168|            if (length != 0) {
  ------------------
  |  Branch (12774:17): [True: 9, False: 159]
  ------------------
12775|      9|                (void)ssl3_DecodeError(ss);
12776|      9|                PORT_SetError(SSL_ERROR_RX_MALFORMED_HELLO_REQUEST);
  ------------------
  |  |   65|      9|#define PORT_SetError PORT_SetError_Util
  ------------------
12777|      9|                return SECFailure;
12778|      9|            }
12779|    159|            if (ss->sec.isServer) {
  ------------------
  |  Branch (12779:17): [True: 0, False: 159]
  ------------------
12780|      0|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12781|      0|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12782|      0|                return SECFailure;
12783|      0|            }
12784|    159|            rv = ssl3_HandleHelloRequest(ss);
12785|    159|            break;
12786|       |
12787|    454|        case ssl_hs_hello_verify_request:
  ------------------
  |  Branch (12787:9): [True: 454, False: 11.2k]
  ------------------
12788|    454|            if (!IS_DTLS(ss) || ss->sec.isServer) {
  ------------------
  |  |  892|    908|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (12788:17): [True: 0, False: 454]
  |  Branch (12788:33): [True: 0, False: 454]
  ------------------
12789|      0|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12790|      0|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_VERIFY_REQUEST);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12791|      0|                return SECFailure;
12792|      0|            }
12793|    454|            rv = dtls_HandleHelloVerifyRequest(ss, b, length);
12794|    454|            break;
12795|  5.48k|        case ssl_hs_certificate:
  ------------------
  |  Branch (12795:9): [True: 5.48k, False: 6.24k]
  ------------------
12796|  5.48k|            rv = ssl3_HandleCertificate(ss, b, length);
12797|  5.48k|            break;
12798|     29|        case ssl_hs_certificate_status:
  ------------------
  |  Branch (12798:9): [True: 29, False: 11.6k]
  ------------------
12799|     29|            rv = ssl3_HandleCertificateStatus(ss, b, length);
12800|     29|            break;
12801|  3.04k|        case ssl_hs_server_key_exchange:
  ------------------
  |  Branch (12801:9): [True: 3.04k, False: 8.68k]
  ------------------
12802|  3.04k|            if (ss->sec.isServer) {
  ------------------
  |  Branch (12802:17): [True: 0, False: 3.04k]
  ------------------
12803|      0|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12804|      0|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12805|      0|                return SECFailure;
12806|      0|            }
12807|  3.04k|            rv = ssl3_HandleServerKeyExchange(ss, b, length);
12808|  3.04k|            break;
12809|    178|        case ssl_hs_certificate_request:
  ------------------
  |  Branch (12809:9): [True: 178, False: 11.5k]
  ------------------
12810|    178|            if (ss->sec.isServer) {
  ------------------
  |  Branch (12810:17): [True: 0, False: 178]
  ------------------
12811|      0|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12812|      0|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12813|      0|                return SECFailure;
12814|      0|            }
12815|    178|            rv = ssl3_HandleCertificateRequest(ss, b, length);
12816|    178|            break;
12817|  2.20k|        case ssl_hs_server_hello_done:
  ------------------
  |  Branch (12817:9): [True: 2.20k, False: 9.52k]
  ------------------
12818|  2.20k|            if (length != 0) {
  ------------------
  |  Branch (12818:17): [True: 2, False: 2.19k]
  ------------------
12819|      2|                (void)ssl3_DecodeError(ss);
12820|      2|                PORT_SetError(SSL_ERROR_RX_MALFORMED_HELLO_DONE);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
12821|      2|                return SECFailure;
12822|      2|            }
12823|  2.19k|            if (ss->sec.isServer) {
  ------------------
  |  Branch (12823:17): [True: 0, False: 2.19k]
  ------------------
12824|      0|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12825|      0|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_DONE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12826|      0|                return SECFailure;
12827|      0|            }
12828|  2.19k|            rv = ssl3_HandleServerHelloDone(ss);
12829|  2.19k|            break;
12830|      1|        case ssl_hs_certificate_verify:
  ------------------
  |  Branch (12830:9): [True: 1, False: 11.7k]
  ------------------
12831|      1|            if (!ss->sec.isServer) {
  ------------------
  |  Branch (12831:17): [True: 1, False: 0]
  ------------------
12832|      1|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12833|      1|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
12834|      1|                return SECFailure;
12835|      1|            }
12836|      0|            rv = ssl3_HandleCertificateVerify(ss, b, length);
12837|      0|            break;
12838|      1|        case ssl_hs_client_key_exchange:
  ------------------
  |  Branch (12838:9): [True: 1, False: 11.7k]
  ------------------
12839|      1|            if (!ss->sec.isServer) {
  ------------------
  |  Branch (12839:17): [True: 1, False: 0]
  ------------------
12840|      1|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12841|      1|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CLIENT_KEY_EXCH);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
12842|      1|                return SECFailure;
12843|      1|            }
12844|      0|            rv = ssl3_HandleClientKeyExchange(ss, b, length);
12845|      0|            break;
12846|     21|        case ssl_hs_new_session_ticket:
  ------------------
  |  Branch (12846:9): [True: 21, False: 11.7k]
  ------------------
12847|     21|            if (ss->sec.isServer) {
  ------------------
  |  Branch (12847:17): [True: 0, False: 21]
  ------------------
12848|      0|                (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12849|      0|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_NEW_SESSION_TICKET);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12850|      0|                return SECFailure;
12851|      0|            }
12852|     21|            rv = ssl3_HandleNewSessionTicket(ss, b, length);
12853|     21|            break;
12854|    141|        case ssl_hs_finished:
  ------------------
  |  Branch (12854:9): [True: 141, False: 11.5k]
  ------------------
12855|    141|            rv = ssl3_HandleFinished(ss, b, length);
12856|    141|            break;
12857|      6|        default:
  ------------------
  |  Branch (12857:9): [True: 6, False: 11.7k]
  ------------------
12858|      6|            (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12859|      6|            PORT_SetError(SSL_ERROR_RX_UNKNOWN_HANDSHAKE);
  ------------------
  |  |   65|      6|#define PORT_SetError PORT_SetError_Util
  ------------------
12860|      6|            rv = SECFailure;
12861|  11.7k|    }
12862|       |
12863|  11.7k|    return rv;
12864|  11.7k|}
ssl3con.c:ssl3_HandleHelloRequest:
 5786|    159|{
 5787|    159|    sslSessionID *sid = ss->sec.ci.sid;
 5788|    159|    SECStatus rv;
 5789|       |
 5790|    159|    SSL_TRC(3, ("%d: SSL3[%d]: handle hello_request handshake",
  ------------------
  |  |   71|    159|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 159]
  |  |  ------------------
  |  |   72|    159|    ssl_Trace b
  ------------------
 5791|    159|                SSL_GETPID(), ss->fd));
 5792|       |
 5793|    159|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    159|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    248|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 70, False: 89]
  |  |  |  |  |  Branch (208:7): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5794|    159|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    159|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    248|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 70, False: 89]
  |  |  |  |  |  Branch (208:7): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5795|    159|    PORT_Assert(ss->version < SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|    159|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    159|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 159, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5796|       |
 5797|    159|    if (ss->ssl3.hs.ws == wait_server_hello)
  ------------------
  |  Branch (5797:9): [True: 156, False: 3]
  ------------------
 5798|    156|        return SECSuccess;
 5799|      3|    if (ss->ssl3.hs.ws != idle_handshake || ss->sec.isServer) {
  ------------------
  |  Branch (5799:9): [True: 2, False: 1]
  |  Branch (5799:45): [True: 0, False: 1]
  ------------------
 5800|      2|        (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
 5801|      2|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_REQUEST);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
 5802|      2|        return SECFailure;
 5803|      2|    }
 5804|      1|    if (ss->opt.enableRenegotiation == SSL_RENEGOTIATE_NEVER) {
  ------------------
  |  |  711|      1|#define SSL_RENEGOTIATE_NEVER ((PRBool)0)
  ------------------
  |  Branch (5804:9): [True: 1, False: 0]
  ------------------
 5805|      1|        (void)SSL3_SendAlert(ss, alert_warning, no_renegotiation);
 5806|      1|        PORT_SetError(SSL_ERROR_RENEGOTIATION_NOT_ALLOWED);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
 5807|      1|        return SECFailure;
 5808|      1|    }
 5809|       |
 5810|      0|    if (sid) {
  ------------------
  |  Branch (5810:9): [True: 0, False: 0]
  ------------------
 5811|      0|        ssl_UncacheSessionID(ss);
 5812|      0|        ssl_FreeSID(sid);
 5813|      0|        ss->sec.ci.sid = NULL;
 5814|      0|    }
 5815|       |
 5816|      0|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5817|      0|        dtls_RehandshakeCleanup(ss);
 5818|      0|    }
 5819|       |
 5820|      0|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|      0|    {                                           \
  |  | 1467|      0|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1468|      0|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|      0|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|      0|    }
  ------------------
 5821|      0|    rv = ssl3_SendClientHello(ss, client_hello_renegotiation);
 5822|      0|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|      0|    {                                          \
  |  | 1472|      0|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1473|      0|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|      0|    }
  ------------------
 5823|       |
 5824|      0|    return rv;
 5825|      1|}
ssl3con.c:ssl3_HandleCertificate:
11468|  5.48k|{
11469|  5.48k|    SSL_TRC(3, ("%d: SSL3[%d]: handle certificate handshake",
  ------------------
  |  |   71|  5.48k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 5.48k]
  |  |  ------------------
  |  |   72|  5.48k|    ssl_Trace b
  ------------------
11470|  5.48k|                SSL_GETPID(), ss->fd));
11471|  5.48k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  5.48k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.26k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2.69k, False: 2.78k]
  |  |  |  |  |  Branch (208:7): [True: 2.78k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11472|  5.48k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  5.48k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.26k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2.69k, False: 2.78k]
  |  |  |  |  |  Branch (208:7): [True: 2.78k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11473|       |
11474|  5.48k|    if ((ss->sec.isServer && ss->ssl3.hs.ws != wait_client_cert) ||
  ------------------
  |  Branch (11474:10): [True: 0, False: 5.48k]
  |  Branch (11474:30): [True: 0, False: 0]
  ------------------
11475|  5.48k|        (!ss->sec.isServer && ss->ssl3.hs.ws != wait_server_cert)) {
  ------------------
  |  Branch (11475:10): [True: 5.48k, False: 0]
  |  Branch (11475:31): [True: 7, False: 5.47k]
  ------------------
11476|      7|        (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
11477|      7|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CERTIFICATE);
  ------------------
  |  |   65|      7|#define PORT_SetError PORT_SetError_Util
  ------------------
11478|      7|        return SECFailure;
11479|      7|    }
11480|       |
11481|  5.47k|    if (ss->sec.isServer) {
  ------------------
  |  Branch (11481:9): [True: 0, False: 5.47k]
  ------------------
11482|      0|        dtls_ReceivedFirstMessageInFlight(ss);
11483|      0|    }
11484|       |
11485|  5.47k|    return ssl3_CompleteHandleCertificate(ss, b, length);
11486|  5.48k|}
ssl3con.c:ssl3_HandleCertificateStatus:
11401|     29|{
11402|     29|    SECStatus rv;
11403|       |
11404|     29|    if (ss->ssl3.hs.ws != wait_certificate_status) {
  ------------------
  |  Branch (11404:9): [True: 2, False: 27]
  ------------------
11405|      2|        (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
11406|      2|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CERT_STATUS);
  ------------------
  |  |   65|      2|#define PORT_SetError PORT_SetError_Util
  ------------------
11407|      2|        return SECFailure;
11408|      2|    }
11409|       |
11410|     27|    rv = ssl_ReadCertificateStatus(ss, b, length);
11411|     27|    if (rv != SECSuccess) {
  ------------------
  |  Branch (11411:9): [True: 19, False: 8]
  ------------------
11412|     19|        return SECFailure; /* code already set */
11413|     19|    }
11414|       |
11415|      8|    return ssl3_AuthCertificate(ss);
11416|     27|}
ssl3con.c:ssl3_HandleServerKeyExchange:
 7724|  3.04k|{
 7725|  3.04k|    SECStatus rv;
 7726|       |
 7727|  3.04k|    SSL_TRC(3, ("%d: SSL3[%d]: handle server_key_exchange handshake",
  ------------------
  |  |   71|  3.04k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 3.04k]
  |  |  ------------------
  |  |   72|  3.04k|    ssl_Trace b
  ------------------
 7728|  3.04k|                SSL_GETPID(), ss->fd));
 7729|  3.04k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  3.04k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.58k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.50k, False: 1.54k]
  |  |  |  |  |  Branch (208:7): [True: 1.54k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7730|  3.04k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  3.04k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.58k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.50k, False: 1.54k]
  |  |  |  |  |  Branch (208:7): [True: 1.54k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7731|       |
 7732|  3.04k|    if (ss->ssl3.hs.ws != wait_server_key) {
  ------------------
  |  Branch (7732:9): [True: 5, False: 3.04k]
  ------------------
 7733|      5|        SSL3_SendAlert(ss, alert_fatal, unexpected_message);
 7734|      5|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_SERVER_KEY_EXCH);
  ------------------
  |  |   65|      5|#define PORT_SetError PORT_SetError_Util
  ------------------
 7735|      5|        return SECFailure;
 7736|      5|    }
 7737|       |
 7738|  3.04k|    switch (ss->ssl3.hs.kea_def->exchKeyType) {
 7739|  1.71k|        case ssl_kea_dh:
  ------------------
  |  Branch (7739:9): [True: 1.71k, False: 1.33k]
  ------------------
 7740|  1.71k|            rv = ssl_HandleDHServerKeyExchange(ss, b, length);
 7741|  1.71k|            break;
 7742|       |
 7743|  1.33k|        case ssl_kea_ecdh:
  ------------------
  |  Branch (7743:9): [True: 1.33k, False: 1.71k]
  ------------------
 7744|  1.33k|            rv = ssl3_HandleECDHServerKeyExchange(ss, b, length);
 7745|  1.33k|            break;
 7746|       |
 7747|      0|        default:
  ------------------
  |  Branch (7747:9): [True: 0, False: 3.04k]
  ------------------
 7748|      0|            SSL3_SendAlert(ss, alert_fatal, handshake_failure);
 7749|      0|            PORT_SetError(SEC_ERROR_UNSUPPORTED_KEYALG);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 7750|      0|            rv = SECFailure;
 7751|      0|            break;
 7752|  3.04k|    }
 7753|       |
 7754|  3.04k|    if (rv == SECSuccess) {
  ------------------
  |  Branch (7754:9): [True: 2.90k, False: 133]
  ------------------
 7755|  2.90k|        ss->ssl3.hs.ws = wait_cert_request;
 7756|  2.90k|    }
 7757|       |    /* All Handle*ServerKeyExchange functions set the error code. */
 7758|  3.04k|    return rv;
 7759|  3.04k|}
ssl3con.c:ssl_HandleDHServerKeyExchange:
 7556|  1.71k|{
 7557|  1.71k|    SECStatus rv;
 7558|  1.71k|    int errCode = SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH;
 7559|  1.71k|    SSL3AlertDescription desc = illegal_parameter;
 7560|  1.71k|    SSLHashType hashAlg;
 7561|  1.71k|    PRBool isTLS = ss->ssl3.prSpec->version > SSL_LIBRARY_VERSION_3_0;
  ------------------
  |  |   17|  1.71k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
 7562|  1.71k|    SSLSignatureScheme sigScheme;
 7563|       |
 7564|  1.71k|    SECItem dh_p = { siBuffer, NULL, 0 };
 7565|  1.71k|    SECItem dh_g = { siBuffer, NULL, 0 };
 7566|  1.71k|    SECItem dh_Ys = { siBuffer, NULL, 0 };
 7567|  1.71k|    unsigned dh_p_bits;
 7568|  1.71k|    unsigned dh_g_bits;
 7569|  1.71k|    PRInt32 minDH = 0;
 7570|  1.71k|    PRInt32 optval;
 7571|       |
 7572|  1.71k|    SSL3Hashes hashes;
 7573|  1.71k|    SECItem signature = { siBuffer, NULL, 0 };
 7574|  1.71k|    PLArenaPool *arena = NULL;
 7575|  1.71k|    SECKEYPublicKey *peerKey = NULL;
 7576|       |
 7577|  1.71k|    rv = ssl3_ConsumeHandshakeVariable(ss, &dh_p, 2, &b, &length);
 7578|  1.71k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7578:9): [True: 9, False: 1.70k]
  ------------------
 7579|      9|        goto loser; /* malformed. */
 7580|      9|    }
 7581|  1.70k|    rv = NSS_OptionGet(NSS_KEY_SIZE_POLICY_FLAGS, &optval);
  ------------------
  |  |  317|  1.70k|#define NSS_KEY_SIZE_POLICY_FLAGS 0x00e
  ------------------
 7582|  1.70k|    if ((rv == SECSuccess) && (optval & NSS_KEY_SIZE_POLICY_SSL_FLAG)) {
  ------------------
  |  |  321|  1.70k|#define NSS_KEY_SIZE_POLICY_SSL_FLAG 1
  ------------------
  |  Branch (7582:9): [True: 1.70k, False: 0]
  |  Branch (7582:31): [True: 1.70k, False: 0]
  ------------------
 7583|  1.70k|        (void)NSS_OptionGet(NSS_DH_MIN_KEY_SIZE, &minDH);
  ------------------
  |  |  287|  1.70k|#define NSS_DH_MIN_KEY_SIZE 0x002
  ------------------
 7584|  1.70k|    }
 7585|       |
 7586|  1.70k|    if (minDH <= 0) {
  ------------------
  |  Branch (7586:9): [True: 0, False: 1.70k]
  ------------------
 7587|      0|        minDH = SSL_DH_MIN_P_BITS;
  ------------------
  |  |   19|      0|#define SSL_DH_MIN_P_BITS 1023
  ------------------
 7588|      0|    }
 7589|  1.70k|    dh_p_bits = SECKEY_BigIntegerBitLength(&dh_p);
 7590|  1.70k|    if (dh_p_bits < (unsigned)minDH) {
  ------------------
  |  Branch (7590:9): [True: 4, False: 1.69k]
  ------------------
 7591|      4|        errCode = SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY;
 7592|      4|        goto alert_loser;
 7593|      4|    }
 7594|  1.69k|    if (dh_p_bits > SSL_MAX_DH_KEY_BITS) {
  ------------------
  |  |  136|  1.69k|#define SSL_MAX_DH_KEY_BITS 8192
  ------------------
  |  Branch (7594:9): [True: 1, False: 1.69k]
  ------------------
 7595|      1|        errCode = SSL_ERROR_DH_KEY_TOO_LONG;
 7596|      1|        goto alert_loser;
 7597|      1|    }
 7598|  1.69k|    rv = ssl3_ConsumeHandshakeVariable(ss, &dh_g, 2, &b, &length);
 7599|  1.69k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7599:9): [True: 19, False: 1.67k]
  ------------------
 7600|     19|        goto loser; /* malformed. */
 7601|     19|    }
 7602|       |    /* Abort if dh_g is 0, 1, or obviously too big. */
 7603|  1.67k|    dh_g_bits = SECKEY_BigIntegerBitLength(&dh_g);
 7604|  1.67k|    if (dh_g_bits > dh_p_bits || dh_g_bits <= 1) {
  ------------------
  |  Branch (7604:9): [True: 14, False: 1.66k]
  |  Branch (7604:34): [True: 4, False: 1.66k]
  ------------------
 7605|     18|        goto alert_loser;
 7606|     18|    }
 7607|  1.66k|    if (ss->opt.requireDHENamedGroups) {
  ------------------
  |  Branch (7607:9): [True: 31, False: 1.63k]
  ------------------
 7608|       |        /* If we're doing named groups, make sure it's good. */
 7609|     31|        rv = ssl_ValidateDHENamedGroup(ss, &dh_p, &dh_g, NULL, NULL);
 7610|     31|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7610:13): [True: 11, False: 20]
  ------------------
 7611|     11|            errCode = SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY;
 7612|     11|            goto alert_loser;
 7613|     11|        }
 7614|     31|    }
 7615|       |
 7616|  1.65k|    rv = ssl3_ConsumeHandshakeVariable(ss, &dh_Ys, 2, &b, &length);
 7617|  1.65k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7617:9): [True: 3, False: 1.64k]
  ------------------
 7618|      3|        goto loser; /* malformed. */
 7619|      3|    }
 7620|  1.64k|    if (!ssl_IsValidDHEShare(&dh_p, &dh_Ys)) {
  ------------------
  |  Branch (7620:9): [True: 8, False: 1.63k]
  ------------------
 7621|      8|        errCode = SSL_ERROR_RX_MALFORMED_DHE_KEY_SHARE;
 7622|      8|        goto alert_loser;
 7623|      8|    }
 7624|       |
 7625|  1.63k|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_2) {
  ------------------
  |  |   20|  1.63k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (7625:9): [True: 1.56k, False: 70]
  ------------------
 7626|  1.56k|        rv = ssl_ConsumeSignatureScheme(ss, &b, &length, &sigScheme);
 7627|  1.56k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7627:13): [True: 4, False: 1.56k]
  ------------------
 7628|      4|            goto loser; /* alert already sent */
 7629|      4|        }
 7630|  1.56k|        rv = ssl_CheckSignatureSchemeConsistency(
 7631|  1.56k|            ss, sigScheme, &ss->sec.peerCert->subjectPublicKeyInfo);
 7632|  1.56k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7632:13): [True: 2, False: 1.56k]
  ------------------
 7633|      2|            goto alert_loser;
 7634|      2|        }
 7635|  1.56k|        hashAlg = ssl_SignatureSchemeToHashType(sigScheme);
 7636|  1.56k|    } else {
 7637|       |        /* Use ssl_hash_none to represent the MD5+SHA1 combo. */
 7638|     70|        hashAlg = ssl_hash_none;
 7639|     70|        sigScheme = ssl_sig_none;
 7640|     70|    }
 7641|  1.63k|    rv = ssl3_ConsumeHandshakeVariable(ss, &signature, 2, &b, &length);
 7642|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7642:9): [True: 2, False: 1.63k]
  ------------------
 7643|      2|        goto loser; /* malformed. */
 7644|      2|    }
 7645|  1.63k|    if (length != 0) {
  ------------------
  |  Branch (7645:9): [True: 1, False: 1.63k]
  ------------------
 7646|      1|        if (isTLS) {
  ------------------
  |  Branch (7646:13): [True: 1, False: 0]
  ------------------
 7647|      1|            desc = decode_error;
 7648|      1|        }
 7649|      1|        goto alert_loser; /* malformed. */
 7650|      1|    }
 7651|       |
 7652|  1.63k|    PRINT_BUF(60, (NULL, "Server DH p", dh_p.data, dh_p.len));
  ------------------
  |  |   74|  1.63k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.63k]
  |  |  ------------------
  |  |   75|  1.63k|    ssl_PrintBuf b
  ------------------
 7653|  1.63k|    PRINT_BUF(60, (NULL, "Server DH g", dh_g.data, dh_g.len));
  ------------------
  |  |   74|  1.63k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.63k]
  |  |  ------------------
  |  |   75|  1.63k|    ssl_PrintBuf b
  ------------------
 7654|  1.63k|    PRINT_BUF(60, (NULL, "Server DH Ys", dh_Ys.data, dh_Ys.len));
  ------------------
  |  |   74|  1.63k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.63k]
  |  |  ------------------
  |  |   75|  1.63k|    ssl_PrintBuf b
  ------------------
 7655|       |
 7656|       |    /* failures after this point are not malformed handshakes. */
 7657|       |    /* TLS: send decrypt_error if signature failed. */
 7658|  1.63k|    desc = isTLS ? decrypt_error : handshake_failure;
  ------------------
  |  Branch (7658:12): [True: 1.63k, False: 0]
  ------------------
 7659|       |
 7660|       |    /*
 7661|       |     * Check to make sure the hash is signed by right guy.
 7662|       |     */
 7663|  1.63k|    rv = ssl3_ComputeDHKeyHash(ss, hashAlg, &hashes,
 7664|  1.63k|                               dh_p, dh_g, dh_Ys, PR_FALSE /* padY */);
  ------------------
  |  |  438|  1.63k|#define PR_FALSE 0
  ------------------
 7665|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7665:9): [True: 0, False: 1.63k]
  ------------------
 7666|      0|        errCode =
 7667|      0|            ssl_MapLowLevelError(SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE);
 7668|      0|        goto alert_loser;
 7669|      0|    }
 7670|  1.63k|    rv = ssl3_VerifySignedHashes(ss, sigScheme, &hashes, &signature);
 7671|  1.63k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7671:9): [True: 0, False: 1.63k]
  ------------------
 7672|      0|        errCode =
 7673|      0|            ssl_MapLowLevelError(SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE);
 7674|      0|        goto alert_loser;
 7675|      0|    }
 7676|       |
 7677|       |    /*
 7678|       |     * we really need to build a new key here because we can no longer
 7679|       |     * ignore calling SECKEY_DestroyPublicKey. Using the key may allocate
 7680|       |     * pkcs11 slots and ID's.
 7681|       |     */
 7682|  1.63k|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  1.63k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  1.63k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 7683|  1.63k|    if (arena == NULL) {
  ------------------
  |  Branch (7683:9): [True: 0, False: 1.63k]
  ------------------
 7684|      0|        errCode = SEC_ERROR_NO_MEMORY;
 7685|      0|        goto loser;
 7686|      0|    }
 7687|       |
 7688|  1.63k|    peerKey = PORT_ArenaZNew(arena, SECKEYPublicKey);
  ------------------
  |  |  155|  1.63k|    (type *)PORT_ArenaZAlloc(poolp, sizeof(type))
  |  |  ------------------
  |  |  |  |   59|  1.63k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  |  |  ------------------
  ------------------
 7689|  1.63k|    if (peerKey == NULL) {
  ------------------
  |  Branch (7689:9): [True: 0, False: 1.63k]
  ------------------
 7690|      0|        errCode = SEC_ERROR_NO_MEMORY;
 7691|      0|        goto loser;
 7692|      0|    }
 7693|       |
 7694|  1.63k|    peerKey->arena = arena;
 7695|  1.63k|    peerKey->keyType = dhKey;
 7696|  1.63k|    peerKey->pkcs11Slot = NULL;
 7697|  1.63k|    peerKey->pkcs11ID = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  1.63k|#define CK_INVALID_HANDLE 0
  ------------------
 7698|       |
 7699|  1.63k|    if (SECITEM_CopyItem(arena, &peerKey->u.dh.prime, &dh_p) ||
  ------------------
  |  |  106|  1.63k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  |  Branch (7699:9): [True: 0, False: 1.63k]
  ------------------
 7700|  1.63k|        SECITEM_CopyItem(arena, &peerKey->u.dh.base, &dh_g) ||
  ------------------
  |  |  106|  1.63k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  |  Branch (7700:9): [True: 0, False: 1.63k]
  ------------------
 7701|  1.63k|        SECITEM_CopyItem(arena, &peerKey->u.dh.publicValue, &dh_Ys)) {
  ------------------
  |  |  106|  1.63k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  |  Branch (7701:9): [True: 0, False: 1.63k]
  ------------------
 7702|      0|        errCode = SEC_ERROR_NO_MEMORY;
 7703|      0|        goto loser;
 7704|      0|    }
 7705|  1.63k|    ss->sec.peerKey = peerKey;
 7706|  1.63k|    return SECSuccess;
 7707|       |
 7708|     45|alert_loser:
 7709|     45|    (void)SSL3_SendAlert(ss, alert_fatal, desc);
 7710|     82|loser:
 7711|     82|    if (arena) {
  ------------------
  |  Branch (7711:9): [True: 0, False: 82]
  ------------------
 7712|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 7713|      0|    }
 7714|     82|    PORT_SetError(ssl_MapLowLevelError(errCode));
  ------------------
  |  |   65|     82|#define PORT_SetError PORT_SetError_Util
  ------------------
 7715|     82|    return SECFailure;
 7716|     45|}
ssl3con.c:ssl3_HandleCertificateRequest:
 7924|    178|{
 7925|    178|    PLArenaPool *arena = NULL;
 7926|    178|    PRBool isTLS = PR_FALSE;
  ------------------
  |  |  438|    178|#define PR_FALSE 0
  ------------------
 7927|    178|    PRBool isTLS12 = PR_FALSE;
  ------------------
  |  |  438|    178|#define PR_FALSE 0
  ------------------
 7928|    178|    int errCode = SSL_ERROR_RX_MALFORMED_CERT_REQUEST;
 7929|    178|    SECStatus rv;
 7930|    178|    SSL3AlertDescription desc = illegal_parameter;
 7931|    178|    SECItem cert_types = { siBuffer, NULL, 0 };
 7932|    178|    SSLSignatureScheme *signatureSchemes = NULL;
 7933|    178|    unsigned int signatureSchemeCount = 0;
 7934|    178|    CERTDistNames ca_list;
 7935|       |
 7936|    178|    SSL_TRC(3, ("%d: SSL3[%d]: handle certificate_request handshake",
  ------------------
  |  |   71|    178|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 178]
  |  |  ------------------
  |  |   72|    178|    ssl_Trace b
  ------------------
 7937|    178|                SSL_GETPID(), ss->fd));
 7938|    178|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    178|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    261|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 95, False: 83]
  |  |  |  |  |  Branch (208:7): [True: 83, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7939|    178|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    178|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    261|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 95, False: 83]
  |  |  |  |  |  Branch (208:7): [True: 83, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7940|       |
 7941|    178|    if (ss->ssl3.hs.ws != wait_cert_request) {
  ------------------
  |  Branch (7941:9): [True: 5, False: 173]
  ------------------
 7942|      5|        desc = unexpected_message;
 7943|      5|        errCode = SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST;
 7944|      5|        goto alert_loser;
 7945|      5|    }
 7946|       |
 7947|    173|    PORT_Assert(ss->ssl3.clientCertChain == NULL);
  ------------------
  |  |  120|    173|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    173|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 173, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7948|    173|    PORT_Assert(ss->ssl3.clientCertificate == NULL);
  ------------------
  |  |  120|    173|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    173|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 173, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7949|    173|    PORT_Assert(ss->ssl3.clientPrivateKey == NULL);
  ------------------
  |  |  120|    173|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    173|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 173, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7950|       |
 7951|    173|    isTLS = (PRBool)(ss->ssl3.prSpec->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|    173|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
 7952|    173|    isTLS12 = (PRBool)(ss->ssl3.prSpec->version >= SSL_LIBRARY_VERSION_TLS_1_2);
  ------------------
  |  |   20|    173|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
 7953|    173|    rv = ssl3_ConsumeHandshakeVariable(ss, &cert_types, 1, &b, &length);
 7954|    173|    if (rv != SECSuccess)
  ------------------
  |  Branch (7954:9): [True: 7, False: 166]
  ------------------
 7955|      7|        goto loser; /* malformed, alert has been sent */
 7956|       |
 7957|    166|    arena = ca_list.arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|    166|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = ca_list.arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|    166|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 7958|    166|    if (arena == NULL)
  ------------------
  |  Branch (7958:9): [True: 0, False: 166]
  ------------------
 7959|      0|        goto no_mem;
 7960|       |
 7961|    166|    if (isTLS12) {
  ------------------
  |  Branch (7961:9): [True: 152, False: 14]
  ------------------
 7962|    152|        rv = ssl_ParseSignatureSchemes(ss, arena,
 7963|    152|                                       &signatureSchemes,
 7964|    152|                                       &signatureSchemeCount,
 7965|    152|                                       &b, &length);
 7966|    152|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7966:13): [True: 4, False: 148]
  ------------------
 7967|      4|            PORT_SetError(SSL_ERROR_RX_MALFORMED_CERT_REQUEST);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
 7968|      4|            goto loser; /* malformed, alert has been sent */
 7969|      4|        }
 7970|    148|        if (signatureSchemeCount == 0) {
  ------------------
  |  Branch (7970:13): [True: 10, False: 138]
  ------------------
 7971|     10|            errCode = SSL_ERROR_UNSUPPORTED_SIGNATURE_ALGORITHM;
 7972|     10|            desc = handshake_failure;
 7973|     10|            goto alert_loser;
 7974|     10|        }
 7975|    148|    }
 7976|       |
 7977|    152|    rv = ssl3_ParseCertificateRequestCAs(ss, &b, &length, &ca_list);
 7978|    152|    if (rv != SECSuccess)
  ------------------
  |  Branch (7978:9): [True: 122, False: 30]
  ------------------
 7979|    122|        goto done; /* alert sent in ssl3_ParseCertificateRequestCAs */
 7980|       |
 7981|     30|    if (length != 0)
  ------------------
  |  Branch (7981:9): [True: 11, False: 19]
  ------------------
 7982|     11|        goto alert_loser; /* malformed */
 7983|       |
 7984|     19|    ss->ssl3.hs.ws = wait_hello_done;
 7985|       |
 7986|     19|    rv = ssl3_BeginHandleCertificateRequest(ss, signatureSchemes,
 7987|     19|                                            signatureSchemeCount, &ca_list);
 7988|     19|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7988:9): [True: 0, False: 19]
  ------------------
 7989|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7990|      0|        errCode = SEC_ERROR_LIBRARY_FAILURE;
 7991|      0|        desc = internal_error;
 7992|      0|        goto alert_loser;
 7993|      0|    }
 7994|     19|    goto done;
 7995|       |
 7996|     19|no_mem:
 7997|      0|    rv = SECFailure;
 7998|      0|    PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 7999|      0|    goto done;
 8000|       |
 8001|     26|alert_loser:
 8002|     26|    if (isTLS && desc == illegal_parameter)
  ------------------
  |  Branch (8002:9): [True: 21, False: 5]
  |  Branch (8002:18): [True: 11, False: 10]
  ------------------
 8003|     11|        desc = decode_error;
 8004|     26|    (void)SSL3_SendAlert(ss, alert_fatal, desc);
 8005|     37|loser:
 8006|     37|    PORT_SetError(errCode);
  ------------------
  |  |   65|     37|#define PORT_SetError PORT_SetError_Util
  ------------------
 8007|     37|    rv = SECFailure;
 8008|    178|done:
 8009|    178|    if (arena != NULL)
  ------------------
  |  Branch (8009:9): [True: 166, False: 12]
  ------------------
 8010|    166|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|    166|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|    166|#define PR_FALSE 0
  ------------------
 8011|    178|    return rv;
 8012|     37|}
ssl3con.c:ssl3_HandleServerHelloDone:
 8257|  2.19k|{
 8258|  2.19k|    SECStatus rv;
 8259|  2.19k|    SSL3WaitState ws = ss->ssl3.hs.ws;
 8260|       |
 8261|  2.19k|    SSL_TRC(3, ("%d: SSL3[%d]: handle server_hello_done handshake",
  ------------------
  |  |   71|  2.19k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 2.19k]
  |  |  ------------------
  |  |   72|  2.19k|    ssl_Trace b
  ------------------
 8262|  2.19k|                SSL_GETPID(), ss->fd));
 8263|  2.19k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  2.19k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.32k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.07k, False: 1.12k]
  |  |  |  |  |  Branch (208:7): [True: 1.12k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8264|  2.19k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  2.19k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.32k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.07k, False: 1.12k]
  |  |  |  |  |  Branch (208:7): [True: 1.12k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8265|       |
 8266|       |    /* Skipping CertificateRequest is always permitted. */
 8267|  2.19k|    if (ws != wait_hello_done &&
  ------------------
  |  Branch (8267:9): [True: 2.18k, False: 14]
  ------------------
 8268|  2.19k|        ws != wait_cert_request) {
  ------------------
  |  Branch (8268:9): [True: 12, False: 2.17k]
  ------------------
 8269|     12|        SSL3_SendAlert(ss, alert_fatal, unexpected_message);
 8270|     12|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_HELLO_DONE);
  ------------------
  |  |   65|     12|#define PORT_SetError PORT_SetError_Util
  ------------------
 8271|     12|        return SECFailure;
 8272|     12|    }
 8273|       |
 8274|  2.18k|    rv = ssl3_SendClientSecondRound(ss);
 8275|       |
 8276|  2.18k|    return rv;
 8277|  2.19k|}
ssl3con.c:ssl3_SendClientSecondRound:
 8285|  2.18k|{
 8286|  2.18k|    SECStatus rv;
 8287|  2.18k|    PRBool sendClientCert;
 8288|       |
 8289|  2.18k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  2.18k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.30k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.06k, False: 1.11k]
  |  |  |  |  |  Branch (208:7): [True: 1.11k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8290|  2.18k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  2.18k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.30k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.06k, False: 1.11k]
  |  |  |  |  |  Branch (208:7): [True: 1.11k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8291|       |
 8292|  2.18k|    sendClientCert = !ss->ssl3.sendEmptyCert &&
  ------------------
  |  Branch (8292:22): [True: 2.17k, False: 14]
  ------------------
 8293|  2.18k|                     ss->ssl3.clientCertChain != NULL &&
  ------------------
  |  Branch (8293:22): [True: 0, False: 2.17k]
  ------------------
 8294|  2.18k|                     ss->ssl3.clientPrivateKey != NULL;
  ------------------
  |  Branch (8294:22): [True: 0, False: 0]
  ------------------
 8295|       |
 8296|       |    /* We must wait for the server's certificate to be authenticated before
 8297|       |     * sending the client certificate in order to disclosing the client
 8298|       |     * certificate to an attacker that does not have a valid cert for the
 8299|       |     * domain we are connecting to.
 8300|       |     *
 8301|       |     * During the initial handshake on a connection, we never send/receive
 8302|       |     * application data until we have authenticated the server's certificate;
 8303|       |     * i.e. we have fully authenticated the handshake before using the cipher
 8304|       |     * specs agreed upon for that handshake. During a renegotiation, we may
 8305|       |     * continue sending and receiving application data during the handshake
 8306|       |     * interleaved with the handshake records. If we were to send the client's
 8307|       |     * second round for a renegotiation before the server's certificate was
 8308|       |     * authenticated, then the application data sent/received after this point
 8309|       |     * would be using cipher spec that hadn't been authenticated. By waiting
 8310|       |     * until the server's certificate has been authenticated during
 8311|       |     * renegotiations, we ensure that renegotiations have the same property
 8312|       |     * as initial handshakes; i.e. we have fully authenticated the handshake
 8313|       |     * before using the cipher specs agreed upon for that handshake for
 8314|       |     * application data.
 8315|       |     */
 8316|  2.18k|    if (ss->ssl3.hs.restartTarget) {
  ------------------
  |  Branch (8316:9): [True: 0, False: 2.18k]
  ------------------
 8317|      0|        PR_NOT_REACHED("unexpected ss->ssl3.hs.restartTarget");
  ------------------
  |  |  213|      0|    PR_Assert(_reasonStr,__FILE__,__LINE__)
  ------------------
 8318|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 8319|      0|        return SECFailure;
 8320|      0|    }
 8321|       |    /* Check whether waiting for client certificate selection OR
 8322|       |       waiting on server certificate verification AND
 8323|       |       going to send client cert */
 8324|  2.18k|    if ((ss->ssl3.hs.clientCertificatePending) ||
  ------------------
  |  Branch (8324:9): [True: 0, False: 2.18k]
  ------------------
 8325|  2.18k|        (ss->ssl3.hs.authCertificatePending && (sendClientCert || ss->ssl3.sendEmptyCert || ss->firstHsDone))) {
  ------------------
  |  Branch (8325:10): [True: 0, False: 2.18k]
  |  Branch (8325:49): [True: 0, False: 0]
  |  Branch (8325:67): [True: 0, False: 0]
  |  Branch (8325:93): [True: 0, False: 0]
  ------------------
 8326|      0|        SSL_TRC(3, ("%d: SSL3[%p]: deferring ssl3_SendClientSecondRound because"
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 8327|      0|                    " certificate authentication is still pending.",
 8328|      0|                    SSL_GETPID(), ss->fd));
 8329|      0|        ss->ssl3.hs.restartTarget = ssl3_SendClientSecondRound;
 8330|      0|        PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
 8331|      0|        return SECFailure;
 8332|      0|    }
 8333|       |
 8334|  2.18k|    ssl_GetXmitBufLock(ss); /*******************************/
  ------------------
  |  | 1466|  2.18k|    {                                           \
  |  | 1467|  2.18k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 1.11k, False: 1.06k]
  |  |  ------------------
  |  | 1468|  2.18k|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|  1.11k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|  2.18k|    }
  ------------------
 8335|       |
 8336|  2.18k|    if (ss->ssl3.sendEmptyCert) {
  ------------------
  |  Branch (8336:9): [True: 14, False: 2.17k]
  ------------------
 8337|     14|        ss->ssl3.sendEmptyCert = PR_FALSE;
  ------------------
  |  |  438|     14|#define PR_FALSE 0
  ------------------
 8338|     14|        rv = ssl3_SendEmptyCertificate(ss);
 8339|       |        /* Don't send verify */
 8340|     14|        if (rv != SECSuccess) {
  ------------------
  |  Branch (8340:13): [True: 0, False: 14]
  ------------------
 8341|      0|            goto loser; /* error code is set. */
 8342|      0|        }
 8343|  2.17k|    } else if (sendClientCert) {
  ------------------
  |  Branch (8343:16): [True: 0, False: 2.17k]
  ------------------
 8344|      0|        rv = ssl3_SendCertificate(ss);
 8345|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (8345:13): [True: 0, False: 0]
  ------------------
 8346|      0|            goto loser; /* error code is set. */
 8347|      0|        }
 8348|      0|    }
 8349|       |
 8350|  2.18k|    rv = ssl3_SendClientKeyExchange(ss);
 8351|  2.18k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (8351:9): [True: 426, False: 1.76k]
  ------------------
 8352|    426|        goto loser; /* err is set. */
 8353|    426|    }
 8354|       |
 8355|  1.76k|    if (sendClientCert) {
  ------------------
  |  Branch (8355:9): [True: 0, False: 1.76k]
  ------------------
 8356|      0|        rv = ssl3_SendCertificateVerify(ss, ss->ssl3.clientPrivateKey);
 8357|      0|        SECKEY_DestroyPrivateKey(ss->ssl3.clientPrivateKey);
 8358|      0|        ss->ssl3.clientPrivateKey = NULL;
 8359|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (8359:13): [True: 0, False: 0]
  ------------------
 8360|      0|            goto loser; /* err is set. */
 8361|      0|        }
 8362|      0|    }
 8363|       |
 8364|  1.76k|    rv = ssl3_SendChangeCipherSpecs(ss);
 8365|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (8365:9): [True: 0, False: 1.76k]
  ------------------
 8366|      0|        goto loser; /* err code was set. */
 8367|      0|    }
 8368|       |
 8369|       |    /* This must be done after we've set ss->ssl3.cwSpec in
 8370|       |     * ssl3_SendChangeCipherSpecs because SSL_GetChannelInfo uses information
 8371|       |     * from cwSpec. This must be done before we call ssl3_CheckFalseStart
 8372|       |     * because the false start callback (if any) may need the information from
 8373|       |     * the functions that depend on this being set.
 8374|       |     */
 8375|  1.76k|    ss->enoughFirstHsDone = PR_TRUE;
  ------------------
  |  |  437|  1.76k|#define PR_TRUE 1
  ------------------
 8376|       |
 8377|  1.76k|    if (!ss->firstHsDone) {
  ------------------
  |  Branch (8377:9): [True: 1.76k, False: 0]
  ------------------
 8378|  1.76k|        if (ss->opt.enableFalseStart) {
  ------------------
  |  Branch (8378:13): [True: 880, False: 880]
  ------------------
 8379|    880|            if (!ss->ssl3.hs.authCertificatePending) {
  ------------------
  |  Branch (8379:17): [True: 880, False: 0]
  ------------------
 8380|       |                /* When we fix bug 589047, we will need to know whether we are
 8381|       |                 * false starting before we try to flush the client second
 8382|       |                 * round to the network. With that in mind, we purposefully
 8383|       |                 * call ssl3_CheckFalseStart before calling ssl3_SendFinished,
 8384|       |                 * which includes a call to ssl3_FlushHandshake, so that
 8385|       |                 * no application develops a reliance on such flushing being
 8386|       |                 * done before its false start callback is called.
 8387|       |                 */
 8388|    880|                ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|    880|    {                                          \
  |  | 1472|    880|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 469, False: 411]
  |  |  ------------------
  |  | 1473|    880|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|    469|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|    880|    }
  ------------------
 8389|    880|                rv = ssl3_CheckFalseStart(ss);
 8390|    880|                ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|    880|    {                                           \
  |  | 1467|    880|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 469, False: 411]
  |  |  ------------------
  |  | 1468|    880|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|    469|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|    880|    }
  ------------------
 8391|    880|                if (rv != SECSuccess) {
  ------------------
  |  Branch (8391:21): [True: 0, False: 880]
  ------------------
 8392|      0|                    goto loser;
 8393|      0|                }
 8394|    880|            } else {
 8395|       |                /* The certificate authentication and the server's Finished
 8396|       |                 * message are racing each other. If the certificate
 8397|       |                 * authentication wins, then we will try to false start in
 8398|       |                 * ssl3_AuthCertificateComplete.
 8399|       |                 */
 8400|      0|                SSL_TRC(3, ("%d: SSL3[%p]: deferring false start check because"
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 8401|      0|                            " certificate authentication is still pending.",
 8402|      0|                            SSL_GETPID(), ss->fd));
 8403|      0|            }
 8404|    880|        }
 8405|  1.76k|    }
 8406|       |
 8407|  1.76k|    rv = ssl3_SendFinished(ss, 0);
 8408|  1.76k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (8408:9): [True: 0, False: 1.76k]
  ------------------
 8409|      0|        goto loser; /* err code was set. */
 8410|      0|    }
 8411|       |
 8412|  1.76k|    ssl_ReleaseXmitBufLock(ss); /*******************************/
  ------------------
  |  | 1471|  1.76k|    {                                          \
  |  | 1472|  1.76k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 900, False: 860]
  |  |  ------------------
  |  | 1473|  1.76k|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|    900|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|  1.76k|    }
  ------------------
 8413|       |
 8414|  1.76k|    if (ssl3_ExtensionNegotiated(ss, ssl_session_ticket_xtn))
  ------------------
  |  Branch (8414:9): [True: 25, False: 1.73k]
  ------------------
 8415|     25|        ss->ssl3.hs.ws = wait_new_session_ticket;
 8416|  1.73k|    else
 8417|  1.73k|        ss->ssl3.hs.ws = wait_change_cipher;
 8418|       |
 8419|  1.76k|    PORT_Assert(ssl3_WaitingForServerSecondRound(ss));
  ------------------
  |  |  120|  1.76k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.76k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.76k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8420|       |
 8421|  1.76k|    return SECSuccess;
 8422|       |
 8423|    426|loser:
 8424|    426|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|    426|    {                                          \
  |  | 1472|    426|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 218, False: 208]
  |  |  ------------------
  |  | 1473|    426|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|    218|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|    426|    }
  ------------------
 8425|    426|    return rv;
 8426|  1.76k|}
ssl3con.c:ssl3_SendClientKeyExchange:
 6554|  2.18k|{
 6555|  2.18k|    SECKEYPublicKey *serverKey = NULL;
 6556|  2.18k|    SECStatus rv = SECFailure;
 6557|       |
 6558|  2.18k|    SSL_TRC(3, ("%d: SSL3[%d]: send client_key_exchange handshake",
  ------------------
  |  |   71|  2.18k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 2.18k]
  |  |  ------------------
  |  |   72|  2.18k|    ssl_Trace b
  ------------------
 6559|  2.18k|                SSL_GETPID(), ss->fd));
 6560|       |
 6561|  2.18k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  2.18k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.30k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.06k, False: 1.11k]
  |  |  |  |  |  Branch (208:7): [True: 1.11k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6562|  2.18k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  2.18k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.30k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.06k, False: 1.11k]
  |  |  |  |  |  Branch (208:7): [True: 1.11k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6563|       |
 6564|  2.18k|    if (ss->sec.peerKey == NULL) {
  ------------------
  |  Branch (6564:9): [True: 1.39k, False: 795]
  ------------------
 6565|  1.39k|        serverKey = CERT_ExtractPublicKey(ss->sec.peerCert);
 6566|  1.39k|        if (serverKey == NULL) {
  ------------------
  |  Branch (6566:13): [True: 0, False: 1.39k]
  ------------------
 6567|      0|            ssl_MapLowLevelError(SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE);
 6568|      0|            return SECFailure;
 6569|      0|        }
 6570|  1.39k|    } else {
 6571|    795|        serverKey = ss->sec.peerKey;
 6572|    795|        ss->sec.peerKey = NULL; /* we're done with it now */
 6573|    795|    }
 6574|       |
 6575|  2.18k|    ss->sec.keaType = ss->ssl3.hs.kea_def->exchKeyType;
 6576|  2.18k|    ss->sec.keaKeyBits = SECKEY_PublicKeyStrengthInBits(serverKey);
 6577|       |
 6578|  2.18k|    switch (ss->ssl3.hs.kea_def->exchKeyType) {
 6579|  1.13k|        case ssl_kea_rsa:
  ------------------
  |  Branch (6579:9): [True: 1.13k, False: 1.05k]
  ------------------
 6580|  1.13k|            rv = ssl3_SendRSAClientKeyExchange(ss, serverKey);
 6581|  1.13k|            break;
 6582|       |
 6583|    721|        case ssl_kea_dh:
  ------------------
  |  Branch (6583:9): [True: 721, False: 1.46k]
  ------------------
 6584|    721|            rv = ssl3_SendDHClientKeyExchange(ss, serverKey);
 6585|    721|            break;
 6586|       |
 6587|    334|        case ssl_kea_ecdh:
  ------------------
  |  Branch (6587:9): [True: 334, False: 1.85k]
  ------------------
 6588|    334|            rv = ssl3_SendECDHClientKeyExchange(ss, serverKey);
 6589|    334|            break;
 6590|       |
 6591|      0|        default:
  ------------------
  |  Branch (6591:9): [True: 0, False: 2.18k]
  ------------------
 6592|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6593|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 6594|      0|            break;
 6595|  2.18k|    }
 6596|       |
 6597|  2.18k|    SSL_TRC(3, ("%d: SSL3[%d]: DONE sending client_key_exchange",
  ------------------
  |  |   71|  2.18k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 2.18k]
  |  |  ------------------
  |  |   72|  2.18k|    ssl_Trace b
  ------------------
 6598|  2.18k|                SSL_GETPID(), ss->fd));
 6599|       |
 6600|  2.18k|    SECKEY_DestroyPublicKey(serverKey);
 6601|  2.18k|    return rv; /* err code already set. */
 6602|  2.18k|}
ssl3con.c:ssl3_SendRSAClientKeyExchange:
 6319|  1.13k|{
 6320|  1.13k|    PK11SymKey *pms = NULL;
 6321|  1.13k|    SECStatus rv = SECFailure;
 6322|  1.13k|    SECItem enc_pms = { siBuffer, NULL, 0 };
 6323|  1.13k|    PRBool isTLS;
 6324|       |
 6325|  1.13k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  1.13k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.71k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 543, False: 588]
  |  |  |  |  |  Branch (208:7): [True: 588, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6326|  1.13k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  1.13k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.71k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 543, False: 588]
  |  |  |  |  |  Branch (208:7): [True: 588, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6327|       |
 6328|       |    /* Generate the pre-master secret ...  */
 6329|  1.13k|    ssl_GetSpecWriteLock(ss);
  ------------------
  |  | 1435|  1.13k|    {                                            \
  |  | 1436|  1.13k|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 588, False: 543]
  |  |  ------------------
  |  | 1437|  1.13k|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|    588|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|  1.13k|    }
  ------------------
 6330|  1.13k|    isTLS = (PRBool)(ss->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|  1.13k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
 6331|       |
 6332|  1.13k|    pms = ssl3_GenerateRSAPMS(ss, ss->ssl3.pwSpec, NULL);
 6333|  1.13k|    ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|  1.13k|    {                                              \
  |  | 1441|  1.13k|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 588, False: 543]
  |  |  ------------------
  |  | 1442|  1.13k|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|    588|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|  1.13k|    }
  ------------------
 6334|  1.13k|    if (pms == NULL) {
  ------------------
  |  Branch (6334:9): [True: 0, False: 1.13k]
  ------------------
 6335|      0|        ssl_MapLowLevelError(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE);
 6336|      0|        goto loser;
 6337|      0|    }
 6338|       |
 6339|       |    /* Get the wrapped (encrypted) pre-master secret, enc_pms */
 6340|  1.13k|    unsigned int svrPubKeyBits = SECKEY_PublicKeyStrengthInBits(svrPubKey);
 6341|  1.13k|    enc_pms.len = (svrPubKeyBits + 7) / 8;
 6342|       |    /* Check that the RSA key isn't larger than 8k bit. */
 6343|  1.13k|    if (svrPubKeyBits > SSL_MAX_RSA_KEY_BITS) {
  ------------------
  |  |  137|  1.13k|#define SSL_MAX_RSA_KEY_BITS 8192
  ------------------
  |  Branch (6343:9): [True: 1, False: 1.13k]
  ------------------
 6344|      1|        (void)SSL3_SendAlert(ss, alert_fatal, illegal_parameter);
 6345|      1|        ssl_MapLowLevelError(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE);
 6346|      1|        goto loser;
 6347|      1|    }
 6348|  1.13k|    enc_pms.data = (unsigned char *)PORT_Alloc(enc_pms.len);
  ------------------
  |  |   52|  1.13k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 6349|  1.13k|    if (enc_pms.data == NULL) {
  ------------------
  |  Branch (6349:9): [True: 0, False: 1.13k]
  ------------------
 6350|      0|        goto loser; /* err set by PORT_Alloc */
 6351|      0|    }
 6352|       |
 6353|       |    /* Wrap pre-master secret in server's public key. */
 6354|  1.13k|    rv = PK11_PubWrapSymKey(CKM_RSA_PKCS, svrPubKey, pms, &enc_pms);
  ------------------
  |  |  720|  1.13k|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
 6355|  1.13k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6355:9): [True: 48, False: 1.08k]
  ------------------
 6356|     48|        ssl_MapLowLevelError(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE);
 6357|     48|        goto loser;
 6358|     48|    }
 6359|       |
 6360|  1.08k|#ifdef TRACE
 6361|  1.08k|    if (ssl_trace >= 100) {
  ------------------
  |  Branch (6361:9): [True: 0, False: 1.08k]
  ------------------
 6362|      0|        SECStatus extractRV = PK11_ExtractKeyValue(pms);
 6363|      0|        if (extractRV == SECSuccess) {
  ------------------
  |  Branch (6363:13): [True: 0, False: 0]
  ------------------
 6364|      0|            SECItem *keyData = PK11_GetKeyData(pms);
 6365|      0|            if (keyData && keyData->data && keyData->len) {
  ------------------
  |  Branch (6365:17): [True: 0, False: 0]
  |  Branch (6365:28): [True: 0, False: 0]
  |  Branch (6365:45): [True: 0, False: 0]
  ------------------
 6366|      0|                ssl_PrintBuf(ss, "Pre-Master Secret",
 6367|      0|                             keyData->data, keyData->len);
 6368|      0|            }
 6369|      0|        }
 6370|      0|    }
 6371|  1.08k|#endif
 6372|       |
 6373|  1.08k|    rv = ssl3_AppendHandshakeHeader(ss, ssl_hs_client_key_exchange,
 6374|  1.08k|                                    isTLS ? enc_pms.len + 2
  ------------------
  |  Branch (6374:37): [True: 1.08k, False: 0]
  ------------------
 6375|  1.08k|                                          : enc_pms.len);
 6376|  1.08k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6376:9): [True: 0, False: 1.08k]
  ------------------
 6377|      0|        goto loser; /* err set by ssl3_AppendHandshake* */
 6378|      0|    }
 6379|  1.08k|    if (isTLS) {
  ------------------
  |  Branch (6379:9): [True: 1.08k, False: 0]
  ------------------
 6380|  1.08k|        rv = ssl3_AppendHandshakeVariable(ss, enc_pms.data, enc_pms.len, 2);
 6381|  1.08k|    } else {
 6382|      0|        rv = ssl3_AppendHandshake(ss, enc_pms.data, enc_pms.len);
 6383|      0|    }
 6384|  1.08k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6384:9): [True: 0, False: 1.08k]
  ------------------
 6385|      0|        goto loser; /* err set by ssl3_AppendHandshake* */
 6386|      0|    }
 6387|       |
 6388|  1.08k|    rv = ssl3_InitPendingCipherSpecs(ss, pms, PR_TRUE);
  ------------------
  |  |  437|  1.08k|#define PR_TRUE 1
  ------------------
 6389|  1.08k|    PK11_FreeSymKey(pms);
 6390|  1.08k|    pms = NULL;
 6391|       |
 6392|  1.08k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6392:9): [True: 0, False: 1.08k]
  ------------------
 6393|      0|        ssl_MapLowLevelError(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE);
 6394|      0|        goto loser;
 6395|      0|    }
 6396|       |
 6397|  1.08k|    rv = SECSuccess;
 6398|       |
 6399|  1.13k|loser:
 6400|  1.13k|    if (enc_pms.data != NULL) {
  ------------------
  |  Branch (6400:9): [True: 1.13k, False: 1]
  ------------------
 6401|  1.13k|        PORT_Free(enc_pms.data);
  ------------------
  |  |   60|  1.13k|#define PORT_Free PORT_Free_Util
  ------------------
 6402|  1.13k|    }
 6403|  1.13k|    if (pms != NULL) {
  ------------------
  |  Branch (6403:9): [True: 49, False: 1.08k]
  ------------------
 6404|     49|        PK11_FreeSymKey(pms);
 6405|     49|    }
 6406|  1.13k|    return rv;
 6407|  1.08k|}
ssl3con.c:ssl3_GenerateRSAPMS:
10675|  1.13k|{
10676|  1.13k|    PK11SymKey *pms = NULL;
10677|  1.13k|    PK11SlotInfo *slot = serverKeySlot;
10678|  1.13k|    void *pwArg = ss->pkcs11PinArg;
10679|  1.13k|    SECItem param;
10680|  1.13k|    CK_VERSION version;
10681|  1.13k|    CK_MECHANISM_TYPE mechanism_array[3];
10682|       |
10683|  1.13k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  1.13k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.71k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 543, False: 588]
  |  |  |  |  |  Branch (208:7): [True: 588, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10684|       |
10685|  1.13k|    if (slot == NULL) {
  ------------------
  |  Branch (10685:9): [True: 1.13k, False: 0]
  ------------------
10686|  1.13k|        SSLCipherAlgorithm calg;
10687|       |        /* The specReadLock would suffice here, but we cannot assert on
10688|       |        ** read locks.  Also, all the callers who call with a non-null
10689|       |        ** slot already hold the SpecWriteLock.
10690|       |        */
10691|  1.13k|        PORT_Assert(ss->opt.noLocks || ssl_HaveSpecWriteLock(ss));
  ------------------
  |  |  120|  1.13k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.71k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 543, False: 588]
  |  |  |  |  |  Branch (208:7): [True: 588, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10692|  1.13k|        PORT_Assert(ss->ssl3.prSpec->epoch == ss->ssl3.pwSpec->epoch);
  ------------------
  |  |  120|  1.13k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.13k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.13k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10693|       |
10694|  1.13k|        calg = spec->cipherDef->calg;
10695|       |
10696|       |        /* First get an appropriate slot.  */
10697|  1.13k|        mechanism_array[0] = CKM_SSL3_PRE_MASTER_KEY_GEN;
  ------------------
  |  |  959|  1.13k|#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL
  ------------------
10698|  1.13k|        mechanism_array[1] = CKM_RSA_PKCS;
  ------------------
  |  |  720|  1.13k|#define CKM_RSA_PKCS 0x00000001UL
  ------------------
10699|  1.13k|        mechanism_array[2] = ssl3_Alg2Mech(calg);
10700|       |
10701|  1.13k|        slot = PK11_GetBestSlotMultiple(mechanism_array, 3, pwArg);
10702|  1.13k|        if (slot == NULL) {
  ------------------
  |  Branch (10702:13): [True: 351, False: 780]
  ------------------
10703|       |            /* can't find a slot with all three, find a slot with the minimum */
10704|    351|            slot = PK11_GetBestSlotMultiple(mechanism_array, 2, pwArg);
10705|    351|            if (slot == NULL) {
  ------------------
  |  Branch (10705:17): [True: 0, False: 351]
  ------------------
10706|      0|                PORT_SetError(SSL_ERROR_TOKEN_SLOT_NOT_FOUND);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
10707|      0|                return pms; /* which is NULL */
10708|      0|            }
10709|    351|        }
10710|  1.13k|    }
10711|       |
10712|       |    /* Generate the pre-master secret ...  */
10713|  1.13k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  1.13k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 1.13k, False: 0]
  |  |  ------------------
  ------------------
10714|  1.13k|        SSL3ProtocolVersion temp;
10715|       |
10716|  1.13k|        temp = dtls_TLSVersionToDTLSVersion(ss->clientHelloVersion);
10717|  1.13k|        version.major = MSB(temp);
  ------------------
  |  |   94|  1.13k|#define MSB(x) ((unsigned char)(((unsigned)(x)) >> 8))
  ------------------
10718|  1.13k|        version.minor = LSB(temp);
  ------------------
  |  |   93|  1.13k|#define LSB(x) ((unsigned char)((x)&0xff))
  ------------------
10719|  1.13k|    } else {
10720|      0|        version.major = MSB(ss->clientHelloVersion);
  ------------------
  |  |   94|      0|#define MSB(x) ((unsigned char)(((unsigned)(x)) >> 8))
  ------------------
10721|      0|        version.minor = LSB(ss->clientHelloVersion);
  ------------------
  |  |   93|      0|#define LSB(x) ((unsigned char)((x)&0xff))
  ------------------
10722|      0|    }
10723|       |
10724|  1.13k|    param.data = (unsigned char *)&version;
10725|  1.13k|    param.len = sizeof version;
10726|       |
10727|  1.13k|    pms = PK11_KeyGen(slot, CKM_SSL3_PRE_MASTER_KEY_GEN, &param, 0, pwArg);
  ------------------
  |  |  959|  1.13k|#define CKM_SSL3_PRE_MASTER_KEY_GEN 0x00000370UL
  ------------------
10728|  1.13k|    if (!serverKeySlot)
  ------------------
  |  Branch (10728:9): [True: 1.13k, False: 0]
  ------------------
10729|  1.13k|        PK11_FreeSlot(slot);
10730|  1.13k|    if (pms == NULL) {
  ------------------
  |  Branch (10730:9): [True: 0, False: 1.13k]
  ------------------
10731|      0|        ssl_MapLowLevelError(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE);
10732|      0|    }
10733|  1.13k|    return pms;
10734|  1.13k|}
ssl3con.c:ssl3_SendDHClientKeyExchange:
 6442|    721|{
 6443|    721|    PK11SymKey *pms = NULL;
 6444|    721|    SECStatus rv;
 6445|    721|    PRBool isTLS;
 6446|    721|    CK_MECHANISM_TYPE target;
 6447|       |
 6448|    721|    const ssl3DHParams *params;
 6449|    721|    ssl3DHParams customParams;
 6450|    721|    const sslNamedGroupDef *groupDef;
 6451|    721|    static const sslNamedGroupDef customGroupDef = {
 6452|    721|        ssl_grp_ffdhe_custom, 0, ssl_kea_dh, SEC_OID_TLS_DHE_CUSTOM, PR_FALSE
  ------------------
  |  |  438|    721|#define PR_FALSE 0
  ------------------
 6453|    721|    };
 6454|    721|    sslEphemeralKeyPair *keyPair = NULL;
 6455|    721|    SECKEYPublicKey *pubKey;
 6456|    721|    PRUint8 dhData[SSL_MAX_DH_KEY_BITS / 8 + 2];
 6457|    721|    sslBuffer dhBuf = SSL_BUFFER(dhData);
  ------------------
  |  |   34|    721|#define SSL_BUFFER(b) SSL_BUFFER_FIXED(b, sizeof(b))
  |  |  ------------------
  |  |  |  |   27|    721|    {                               \
  |  |  |  |   28|    721|        b, 0, maxlen, PR_TRUE       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  437|    721|#define PR_TRUE 1
  |  |  |  |  ------------------
  |  |  |  |   29|    721|    }
  |  |  ------------------
  ------------------
 6458|       |
 6459|    721|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    721|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.07k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 364, False: 357]
  |  |  |  |  |  Branch (208:7): [True: 357, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6460|    721|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|    721|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.07k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 364, False: 357]
  |  |  |  |  |  Branch (208:7): [True: 357, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6461|       |
 6462|    721|    isTLS = (PRBool)(ss->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|    721|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
 6463|       |
 6464|       |    /* Copy DH parameters from server key */
 6465|       |
 6466|    721|    if (SECKEY_GetPublicKeyType(svrPubKey) != dhKey) {
  ------------------
  |  Branch (6466:9): [True: 0, False: 721]
  ------------------
 6467|      0|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 6468|      0|        return SECFailure;
 6469|      0|    }
 6470|       |
 6471|       |    /* Work out the parameters. */
 6472|    721|    rv = ssl_ValidateDHENamedGroup(ss, &svrPubKey->u.dh.prime,
 6473|    721|                                   &svrPubKey->u.dh.base,
 6474|    721|                                   &groupDef, &params);
 6475|    721|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6475:9): [True: 716, False: 5]
  ------------------
 6476|       |        /* If we require named groups, we will have already validated the group
 6477|       |         * in ssl_HandleDHServerKeyExchange() */
 6478|    716|        PORT_Assert(!ss->opt.requireDHENamedGroups &&
  ------------------
  |  |  120|    716|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.43k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 716, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 716, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6479|    716|                    !ss->xtnData.peerSupportsFfdheGroups);
 6480|       |
 6481|    716|        customParams.name = ssl_grp_ffdhe_custom;
 6482|    716|        customParams.prime.data = svrPubKey->u.dh.prime.data;
 6483|    716|        customParams.prime.len = svrPubKey->u.dh.prime.len;
 6484|    716|        customParams.base.data = svrPubKey->u.dh.base.data;
 6485|    716|        customParams.base.len = svrPubKey->u.dh.base.len;
 6486|    716|        params = &customParams;
 6487|    716|        groupDef = &customGroupDef;
 6488|    716|    }
 6489|    721|    ss->sec.keaGroup = groupDef;
 6490|       |
 6491|    721|    rv = ssl_CreateDHEKeyPair(groupDef, params, &keyPair);
 6492|    721|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6492:9): [True: 308, False: 413]
  ------------------
 6493|    308|        ssl_MapLowLevelError(SEC_ERROR_KEYGEN_FAIL);
 6494|    308|        goto loser;
 6495|    308|    }
 6496|    413|    pubKey = keyPair->keys->pubKey;
 6497|    413|    PRINT_BUF(50, (ss, "DH public value:",
  ------------------
  |  |   74|    413|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 413]
  |  |  ------------------
  |  |   75|    413|    ssl_PrintBuf b
  ------------------
 6498|    413|                   pubKey->u.dh.publicValue.data,
 6499|    413|                   pubKey->u.dh.publicValue.len));
 6500|       |
 6501|    413|    if (isTLS)
  ------------------
  |  Branch (6501:9): [True: 413, False: 0]
  ------------------
 6502|    413|        target = CKM_TLS_MASTER_KEY_DERIVE_DH;
  ------------------
  |  |  970|    413|#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL
  ------------------
 6503|      0|    else
 6504|      0|        target = CKM_SSL3_MASTER_KEY_DERIVE_DH;
  ------------------
  |  |  966|      0|#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL
  ------------------
 6505|       |
 6506|       |    /* Determine the PMS */
 6507|    413|    pms = PK11_PubDerive(keyPair->keys->privKey, svrPubKey,
 6508|    413|                         PR_FALSE, NULL, NULL, CKM_DH_PKCS_DERIVE,
  ------------------
  |  |  438|    413|#define PR_FALSE 0
  ------------------
                                       PR_FALSE, NULL, NULL, CKM_DH_PKCS_DERIVE,
  ------------------
  |  |  759|    413|#define CKM_DH_PKCS_DERIVE 0x00000021UL
  ------------------
 6509|    413|                         target, CKA_DERIVE, 0, NULL);
  ------------------
  |  |  555|    413|#define CKA_DERIVE 0x0000010CUL
  ------------------
 6510|       |
 6511|    413|    if (pms == NULL) {
  ------------------
  |  Branch (6511:9): [True: 2, False: 411]
  ------------------
 6512|      2|        ssl_MapLowLevelError(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE);
 6513|      2|        goto loser;
 6514|      2|    }
 6515|       |
 6516|       |    /* Note: send the DH share padded to avoid triggering bugs. */
 6517|    411|    rv = ssl3_AppendHandshakeHeader(ss, ssl_hs_client_key_exchange,
 6518|    411|                                    params->prime.len + 2);
 6519|    411|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6519:9): [True: 0, False: 411]
  ------------------
 6520|      0|        goto loser; /* err set by ssl3_AppendHandshake* */
 6521|      0|    }
 6522|    411|    rv = ssl_AppendPaddedDHKeyShare(&dhBuf, pubKey, PR_TRUE);
  ------------------
  |  |  437|    411|#define PR_TRUE 1
  ------------------
 6523|    411|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6523:9): [True: 0, False: 411]
  ------------------
 6524|      0|        goto loser; /* err set by ssl_AppendPaddedDHKeyShare */
 6525|      0|    }
 6526|    411|    rv = ssl3_AppendBufferToHandshake(ss, &dhBuf);
 6527|    411|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6527:9): [True: 0, False: 411]
  ------------------
 6528|      0|        goto loser; /* err set by ssl3_AppendBufferToHandshake */
 6529|      0|    }
 6530|       |
 6531|    411|    rv = ssl3_InitPendingCipherSpecs(ss, pms, PR_TRUE);
  ------------------
  |  |  437|    411|#define PR_TRUE 1
  ------------------
 6532|    411|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6532:9): [True: 0, False: 411]
  ------------------
 6533|      0|        ssl_MapLowLevelError(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE);
 6534|      0|        goto loser;
 6535|      0|    }
 6536|       |
 6537|    411|    sslBuffer_Clear(&dhBuf);
 6538|    411|    PK11_FreeSymKey(pms);
 6539|    411|    ssl_FreeEphemeralKeyPair(keyPair);
 6540|    411|    return SECSuccess;
 6541|       |
 6542|    310|loser:
 6543|    310|    if (pms)
  ------------------
  |  Branch (6543:9): [True: 0, False: 310]
  ------------------
 6544|      0|        PK11_FreeSymKey(pms);
 6545|    310|    if (keyPair)
  ------------------
  |  Branch (6545:9): [True: 2, False: 308]
  ------------------
 6546|      2|        ssl_FreeEphemeralKeyPair(keyPair);
 6547|    310|    sslBuffer_Clear(&dhBuf);
 6548|    310|    return SECFailure;
 6549|    411|}
ssl3con.c:ssl3_HandleNewSessionTicket:
11093|     21|{
11094|     21|    SECStatus rv;
11095|     21|    SECItem ticketData;
11096|     21|    PRUint32 temp;
11097|       |
11098|     21|    SSL_TRC(3, ("%d: SSL3[%d]: handle session_ticket handshake",
  ------------------
  |  |   71|     21|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 21]
  |  |  ------------------
  |  |   72|     21|    ssl_Trace b
  ------------------
11099|     21|                SSL_GETPID(), ss->fd));
11100|       |
11101|     21|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|     21|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     34|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8, False: 13]
  |  |  |  |  |  Branch (208:7): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11102|     21|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|     21|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     34|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8, False: 13]
  |  |  |  |  |  Branch (208:7): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11103|       |
11104|     21|    PORT_Assert(!ss->ssl3.hs.newSessionTicket.ticket.data);
  ------------------
  |  |  120|     21|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     21|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11105|     21|    PORT_Assert(!ss->ssl3.hs.receivedNewSessionTicket);
  ------------------
  |  |  120|     21|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     21|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 21, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11106|       |
11107|     21|    if (ss->ssl3.hs.ws != wait_new_session_ticket) {
  ------------------
  |  Branch (11107:9): [True: 5, False: 16]
  ------------------
11108|      5|        SSL3_SendAlert(ss, alert_fatal, unexpected_message);
11109|      5|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_NEW_SESSION_TICKET);
  ------------------
  |  |   65|      5|#define PORT_SetError PORT_SetError_Util
  ------------------
11110|      5|        return SECFailure;
11111|      5|    }
11112|       |
11113|       |    /* RFC5077 Section 3.3: "The client MUST NOT treat the ticket as valid
11114|       |     * until it has verified the server's Finished message." See the comment in
11115|       |     * ssl3_FinishHandshake for more details.
11116|       |     */
11117|     16|    ss->ssl3.hs.newSessionTicket.received_timestamp = ssl_Time(ss);
11118|     16|    if (length < 4) {
  ------------------
  |  Branch (11118:9): [True: 0, False: 16]
  ------------------
11119|      0|        (void)SSL3_SendAlert(ss, alert_fatal, decode_error);
11120|      0|        PORT_SetError(SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
11121|      0|        return SECFailure;
11122|      0|    }
11123|       |
11124|     16|    rv = ssl3_ConsumeHandshakeNumber(ss, &temp, 4, &b, &length);
11125|     16|    if (rv != SECSuccess) {
  ------------------
  |  Branch (11125:9): [True: 0, False: 16]
  ------------------
11126|      0|        PORT_SetError(SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
11127|      0|        return SECFailure;
11128|      0|    }
11129|     16|    ss->ssl3.hs.newSessionTicket.ticket_lifetime_hint = temp;
11130|       |
11131|     16|    rv = ssl3_ConsumeHandshakeVariable(ss, &ticketData, 2, &b, &length);
11132|     16|    if (rv != SECSuccess || length != 0) {
  ------------------
  |  Branch (11132:9): [True: 13, False: 3]
  |  Branch (11132:29): [True: 2, False: 1]
  ------------------
11133|     15|        (void)SSL3_SendAlert(ss, alert_fatal, decode_error);
11134|     15|        PORT_SetError(SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET);
  ------------------
  |  |   65|     15|#define PORT_SetError PORT_SetError_Util
  ------------------
11135|     15|        return SECFailure; /* malformed */
11136|     15|    }
11137|       |    /* If the server sent a zero-length ticket, ignore it and keep the
11138|       |     * existing ticket. */
11139|      1|    if (ticketData.len != 0) {
  ------------------
  |  Branch (11139:9): [True: 1, False: 0]
  ------------------
11140|      1|        rv = SECITEM_CopyItem(NULL, &ss->ssl3.hs.newSessionTicket.ticket,
  ------------------
  |  |  106|      1|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
11141|      1|                              &ticketData);
11142|      1|        if (rv != SECSuccess) {
  ------------------
  |  Branch (11142:13): [True: 0, False: 1]
  ------------------
11143|      0|            return rv;
11144|      0|        }
11145|      1|        ss->ssl3.hs.receivedNewSessionTicket = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
11146|      1|    }
11147|       |
11148|      1|    ss->ssl3.hs.ws = wait_change_cipher;
11149|      1|    return SECSuccess;
11150|      1|}
ssl3con.c:ssl3_HandleFinished:
12314|    141|{
12315|    141|    SECStatus rv = SECSuccess;
12316|    141|    PRBool isServer = ss->sec.isServer;
12317|    141|    PRBool isTLS;
12318|    141|    SSL3Hashes hashes;
12319|       |
12320|    141|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    141|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    210|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 72, False: 69]
  |  |  |  |  |  Branch (208:7): [True: 69, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12321|    141|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    141|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    210|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 72, False: 69]
  |  |  |  |  |  Branch (208:7): [True: 69, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12322|       |
12323|    141|    SSL_TRC(3, ("%d: SSL3[%d]: handle finished handshake",
  ------------------
  |  |   71|    141|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 141]
  |  |  ------------------
  |  |   72|    141|    ssl_Trace b
  ------------------
12324|    141|                SSL_GETPID(), ss->fd));
12325|       |
12326|    141|    if (ss->ssl3.hs.ws != wait_finished) {
  ------------------
  |  Branch (12326:9): [True: 4, False: 137]
  ------------------
12327|      4|        SSL3_SendAlert(ss, alert_fatal, unexpected_message);
12328|      4|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_FINISHED);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
12329|      4|        return SECFailure;
12330|      4|    }
12331|       |
12332|    137|    if (!ss->sec.isServer || !ss->opt.requestCertificate) {
  ------------------
  |  Branch (12332:9): [True: 137, False: 0]
  |  Branch (12332:30): [True: 0, False: 0]
  ------------------
12333|    137|        dtls_ReceivedFirstMessageInFlight(ss);
12334|    137|    }
12335|       |
12336|    137|    rv = ssl3_ComputeHandshakeHashes(ss, ss->ssl3.crSpec, &hashes,
12337|    137|                                     isServer ? sender_client : sender_server);
  ------------------
  |  Branch (12337:38): [True: 0, False: 137]
  ------------------
12338|    137|    if (rv != SECSuccess) {
  ------------------
  |  Branch (12338:9): [True: 0, False: 137]
  ------------------
12339|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12340|      0|        return SECFailure;
12341|      0|    }
12342|       |
12343|    137|    rv = ssl_HashHandshakeMessage(ss, ssl_hs_finished, b, length);
12344|    137|    if (rv != SECSuccess) {
  ------------------
  |  Branch (12344:9): [True: 0, False: 137]
  ------------------
12345|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12346|      0|        return rv;
12347|      0|    }
12348|       |
12349|    137|    isTLS = (PRBool)(ss->ssl3.crSpec->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|    137|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
12350|    137|    if (isTLS) {
  ------------------
  |  Branch (12350:9): [True: 137, False: 0]
  ------------------
12351|    137|        TLSFinished tlsFinished;
12352|       |
12353|    137|        if (length != sizeof(tlsFinished)) {
  ------------------
  |  Branch (12353:13): [True: 137, False: 0]
  ------------------
12354|       |#ifndef UNSAFE_FUZZER_MODE
12355|       |            (void)SSL3_SendAlert(ss, alert_fatal, decode_error);
12356|       |            PORT_SetError(SSL_ERROR_RX_MALFORMED_FINISHED);
12357|       |            return SECFailure;
12358|       |#endif
12359|    137|        }
12360|    137|        rv = ssl3_ComputeTLSFinished(ss, ss->ssl3.crSpec, !isServer,
12361|    137|                                     &hashes, &tlsFinished);
12362|    137|        if (!isServer)
  ------------------
  |  Branch (12362:13): [True: 137, False: 0]
  ------------------
12363|    137|            ss->ssl3.hs.finishedMsgs.tFinished[1] = tlsFinished;
12364|      0|        else
12365|      0|            ss->ssl3.hs.finishedMsgs.tFinished[0] = tlsFinished;
12366|    137|        ss->ssl3.hs.finishedBytes = sizeof(tlsFinished);
12367|    137|        if (rv != SECSuccess ||
  ------------------
  |  Branch (12367:13): [True: 0, False: 137]
  ------------------
12368|    137|            0 != NSS_SecureMemcmp(&tlsFinished, b,
  ------------------
  |  Branch (12368:13): [True: 0, False: 137]
  ------------------
12369|    137|                                  PR_MIN(length, ss->ssl3.hs.finishedBytes))) {
  ------------------
  |  |  158|    137|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 137, False: 0]
  |  |  ------------------
  ------------------
12370|       |#ifndef UNSAFE_FUZZER_MODE
12371|       |            (void)SSL3_SendAlert(ss, alert_fatal, decrypt_error);
12372|       |            PORT_SetError(SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE);
12373|       |            return SECFailure;
12374|       |#endif
12375|      0|        }
12376|    137|    } else {
12377|      0|        if (length != sizeof(SSL3Finished)) {
  ------------------
  |  Branch (12377:13): [True: 0, False: 0]
  ------------------
12378|      0|            (void)ssl3_IllegalParameter(ss);
12379|      0|            PORT_SetError(SSL_ERROR_RX_MALFORMED_FINISHED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12380|      0|            return SECFailure;
12381|      0|        }
12382|       |
12383|      0|        if (!isServer)
  ------------------
  |  Branch (12383:13): [True: 0, False: 0]
  ------------------
12384|      0|            ss->ssl3.hs.finishedMsgs.sFinished[1] = hashes.u.s;
12385|      0|        else
12386|      0|            ss->ssl3.hs.finishedMsgs.sFinished[0] = hashes.u.s;
12387|      0|        PORT_Assert(hashes.len == sizeof hashes.u.s);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
12388|      0|        ss->ssl3.hs.finishedBytes = sizeof hashes.u.s;
12389|      0|        if (0 != NSS_SecureMemcmp(&hashes.u.s, b, length)) {
  ------------------
  |  Branch (12389:13): [True: 0, False: 0]
  ------------------
12390|      0|            (void)ssl3_HandshakeFailure(ss);
12391|      0|            PORT_SetError(SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12392|      0|            return SECFailure;
12393|      0|        }
12394|      0|    }
12395|       |
12396|    137|    ssl_GetXmitBufLock(ss); /*************************************/
  ------------------
  |  | 1466|    137|    {                                           \
  |  | 1467|    137|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 67, False: 70]
  |  |  ------------------
  |  | 1468|    137|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|     67|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|    137|    }
  ------------------
12397|       |
12398|    137|    if ((isServer && !ss->ssl3.hs.isResuming) ||
  ------------------
  |  Branch (12398:10): [True: 0, False: 137]
  |  Branch (12398:22): [True: 0, False: 0]
  ------------------
12399|    137|        (!isServer && ss->ssl3.hs.isResuming)) {
  ------------------
  |  Branch (12399:10): [True: 137, False: 0]
  |  Branch (12399:23): [True: 0, False: 137]
  ------------------
12400|      0|        PRInt32 flags = 0;
12401|       |
12402|       |        /* Send a NewSessionTicket message if the client sent us
12403|       |         * either an empty session ticket, or one that did not verify.
12404|       |         * (Note that if either of these conditions was met, then the
12405|       |         * server has sent a SessionTicket extension in the
12406|       |         * ServerHello message.)
12407|       |         */
12408|      0|        if (isServer && !ss->ssl3.hs.isResuming &&
  ------------------
  |  Branch (12408:13): [True: 0, False: 0]
  |  Branch (12408:25): [True: 0, False: 0]
  ------------------
12409|      0|            ssl3_ExtensionNegotiated(ss, ssl_session_ticket_xtn) &&
  ------------------
  |  Branch (12409:13): [True: 0, False: 0]
  ------------------
12410|      0|            ssl3_KEASupportsTickets(ss->ssl3.hs.kea_def)) {
  ------------------
  |  Branch (12410:13): [True: 0, False: 0]
  ------------------
12411|       |            /* RFC 5077 Section 3.3: "In the case of a full handshake, the
12412|       |             * server MUST verify the client's Finished message before sending
12413|       |             * the ticket." Presumably, this also means that the client's
12414|       |             * certificate, if any, must be verified beforehand too.
12415|       |             */
12416|      0|            rv = ssl3_SendNewSessionTicket(ss);
12417|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (12417:17): [True: 0, False: 0]
  ------------------
12418|      0|                goto xmit_loser;
12419|      0|            }
12420|      0|        }
12421|       |
12422|      0|        rv = ssl3_SendChangeCipherSpecs(ss);
12423|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (12423:13): [True: 0, False: 0]
  ------------------
12424|      0|            goto xmit_loser; /* err is set. */
12425|      0|        }
12426|       |        /* If this thread is in SSL_SecureSend (trying to write some data)
12427|       |        ** then set the ssl_SEND_FLAG_FORCE_INTO_BUFFER flag, so that the
12428|       |        ** last two handshake messages (change cipher spec and finished)
12429|       |        ** will be sent in the same send/write call as the application data.
12430|       |        */
12431|      0|        if (ss->writerThread == PR_GetCurrentThread()) {
  ------------------
  |  Branch (12431:13): [True: 0, False: 0]
  ------------------
12432|      0|            flags = ssl_SEND_FLAG_FORCE_INTO_BUFFER;
  ------------------
  |  |  223|      0|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
12433|      0|        }
12434|       |
12435|      0|        if (!isServer && !ss->firstHsDone) {
  ------------------
  |  Branch (12435:13): [True: 0, False: 0]
  |  Branch (12435:26): [True: 0, False: 0]
  ------------------
12436|      0|            rv = ssl3_SendNextProto(ss);
12437|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (12437:17): [True: 0, False: 0]
  ------------------
12438|      0|                goto xmit_loser; /* err code was set. */
12439|      0|            }
12440|      0|        }
12441|       |
12442|      0|        if (IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
12443|      0|            flags |= ssl_SEND_FLAG_NO_RETRANSMIT;
  ------------------
  |  |  225|      0|#define ssl_SEND_FLAG_NO_RETRANSMIT 0x08000000 /* DTLS only */
  ------------------
12444|      0|        }
12445|       |
12446|      0|        rv = ssl3_SendFinished(ss, flags);
12447|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (12447:13): [True: 0, False: 0]
  ------------------
12448|      0|            goto xmit_loser; /* err is set. */
12449|      0|        }
12450|      0|    }
12451|       |
12452|    137|xmit_loser:
12453|    137|    ssl_ReleaseXmitBufLock(ss); /*************************************/
  ------------------
  |  | 1471|    137|    {                                          \
  |  | 1472|    137|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 67, False: 70]
  |  |  ------------------
  |  | 1473|    137|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|     67|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|    137|    }
  ------------------
12454|    137|    if (rv != SECSuccess) {
  ------------------
  |  Branch (12454:9): [True: 0, False: 137]
  ------------------
12455|      0|        return rv;
12456|      0|    }
12457|       |
12458|    137|    if (ss->ssl3.hs.authCertificatePending) {
  ------------------
  |  Branch (12458:9): [True: 0, False: 137]
  ------------------
12459|      0|        if (ss->ssl3.hs.restartTarget) {
  ------------------
  |  Branch (12459:13): [True: 0, False: 0]
  ------------------
12460|      0|            PR_NOT_REACHED("ssl3_HandleFinished: unexpected restartTarget");
  ------------------
  |  |  213|      0|    PR_Assert(_reasonStr,__FILE__,__LINE__)
  ------------------
12461|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
12462|      0|            return SECFailure;
12463|      0|        }
12464|       |
12465|      0|        ss->ssl3.hs.restartTarget = ssl3_FinishHandshake;
12466|      0|        PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
12467|      0|        return SECFailure;
12468|      0|    }
12469|       |
12470|    137|    rv = ssl3_FinishHandshake(ss);
12471|    137|    return rv;
12472|    137|}
ssl3con.c:ssl3_IllegalParameter:
 2965|      3|{
 2966|      3|    (void)SSL3_SendAlert(ss, alert_fatal, illegal_parameter);
 2967|      3|    PORT_SetError(ss->sec.isServer ? SSL_ERROR_BAD_CLIENT
  ------------------
  |  |   65|      3|#define PORT_SetError PORT_SetError_Util
  ------------------
  |  Branch (2967:19): [True: 0, False: 3]
  ------------------
 2968|      3|                                   : SSL_ERROR_BAD_SERVER);
 2969|      3|    return SECFailure;
 2970|      3|}
ssl3con.c:ssl3_HandleChangeCipherSpecs:
 3303|    371|{
 3304|    371|    SSL3WaitState ws = ss->ssl3.hs.ws;
 3305|    371|    SSL3ChangeCipherSpecChoice change;
 3306|       |
 3307|    371|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    371|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    569|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 173, False: 198]
  |  |  |  |  |  Branch (208:7): [True: 198, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3308|    371|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    371|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    569|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 173, False: 198]
  |  |  |  |  |  Branch (208:7): [True: 198, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3309|       |
 3310|    371|    SSL_TRC(3, ("%d: SSL3[%d]: handle change_cipher_spec record",
  ------------------
  |  |   71|    371|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 371]
  |  |  ------------------
  |  |   72|    371|    ssl_Trace b
  ------------------
 3311|    371|                SSL_GETPID(), ss->fd));
 3312|       |
 3313|       |    /* For DTLS: Ignore this if we aren't expecting it.  Don't kill a connection
 3314|       |     *           as a result of receiving trash.
 3315|       |     * For TLS: Maybe ignore, but only after checking format. */
 3316|    371|    if (ws != wait_change_cipher && IS_DTLS(ss)) {
  ------------------
  |  |  892|    186|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 186, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3316:9): [True: 186, False: 185]
  ------------------
 3317|       |        /* Ignore this because it's out of order. */
 3318|    186|        SSL_TRC(3, ("%d: SSL3[%d]: discard out of order "
  ------------------
  |  |   71|    186|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 186]
  |  |  ------------------
  |  |   72|    186|    ssl_Trace b
  ------------------
 3319|    186|                    "DTLS change_cipher_spec",
 3320|    186|                    SSL_GETPID(), ss->fd));
 3321|    186|        buf->len = 0;
 3322|    186|        return SECSuccess;
 3323|    186|    }
 3324|       |
 3325|       |    /* Handshake messages should not span ChangeCipherSpec. */
 3326|    185|    if (ss->ssl3.hs.header_bytes) {
  ------------------
  |  Branch (3326:9): [True: 0, False: 185]
  ------------------
 3327|      0|        (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
 3328|      0|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3329|      0|        return SECFailure;
 3330|      0|    }
 3331|    185|    if (buf->len != 1) {
  ------------------
  |  Branch (3331:9): [True: 5, False: 180]
  ------------------
 3332|      5|        (void)ssl3_DecodeError(ss);
 3333|      5|        PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
  ------------------
  |  |   65|      5|#define PORT_SetError PORT_SetError_Util
  ------------------
 3334|      5|        return SECFailure;
 3335|      5|    }
 3336|    180|    change = (SSL3ChangeCipherSpecChoice)buf->buf[0];
 3337|    180|    if (change != change_cipher_spec_choice) {
  ------------------
  |  Branch (3337:9): [True: 3, False: 177]
  ------------------
 3338|       |        /* illegal_parameter is correct here for both SSL3 and TLS. */
 3339|      3|        (void)ssl3_IllegalParameter(ss);
 3340|      3|        PORT_SetError(SSL_ERROR_RX_MALFORMED_CHANGE_CIPHER);
  ------------------
  |  |   65|      3|#define PORT_SetError PORT_SetError_Util
  ------------------
 3341|      3|        return SECFailure;
 3342|      3|    }
 3343|       |
 3344|    177|    buf->len = 0;
 3345|    177|    if (ws != wait_change_cipher) {
  ------------------
  |  Branch (3345:9): [True: 0, False: 177]
  ------------------
 3346|       |        /* Ignore a CCS for TLS 1.3. This only happens if the server sends a
 3347|       |         * HelloRetryRequest.  In other cases, the CCS will fail decryption and
 3348|       |         * will be discarded by ssl3_HandleRecord(). */
 3349|      0|        if (ws == wait_server_hello &&
  ------------------
  |  Branch (3349:13): [True: 0, False: 0]
  ------------------
 3350|      0|            ss->version >= SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (3350:13): [True: 0, False: 0]
  ------------------
 3351|      0|            ss->ssl3.hs.helloRetry) {
  ------------------
  |  Branch (3351:13): [True: 0, False: 0]
  ------------------
 3352|      0|            PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3353|      0|            return SECSuccess;
 3354|      0|        }
 3355|       |        /* Note: For a server, we can't test ss->ssl3.hs.helloRetry or
 3356|       |         * ss->version because the server might be stateless (and so it won't
 3357|       |         * have set either value yet). Set a flag so that at least we will
 3358|       |         * guarantee that the server will treat any ClientHello properly. */
 3359|      0|        if (ws == wait_client_hello &&
  ------------------
  |  Branch (3359:13): [True: 0, False: 0]
  ------------------
 3360|      0|            ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (3360:13): [True: 0, False: 0]
  ------------------
 3361|      0|            !ss->ssl3.hs.receivedCcs) {
  ------------------
  |  Branch (3361:13): [True: 0, False: 0]
  ------------------
 3362|      0|            PORT_Assert(ss->sec.isServer);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3363|      0|            ss->ssl3.hs.receivedCcs = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3364|      0|            return SECSuccess;
 3365|      0|        }
 3366|      0|        (void)SSL3_SendAlert(ss, alert_fatal, unexpected_message);
 3367|      0|        PORT_SetError(SSL_ERROR_RX_UNEXPECTED_CHANGE_CIPHER);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3368|      0|        return SECFailure;
 3369|      0|    }
 3370|       |
 3371|    177|    SSL_TRC(3, ("%d: SSL3[%d] Set Current Read Cipher Suite to Pending",
  ------------------
  |  |   71|    177|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 177]
  |  |  ------------------
  |  |   72|    177|    ssl_Trace b
  ------------------
 3372|    177|                SSL_GETPID(), ss->fd));
 3373|    177|    ssl_GetSpecWriteLock(ss); /*************************************/
  ------------------
  |  | 1435|    177|    {                                            \
  |  | 1436|    177|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 97, False: 80]
  |  |  ------------------
  |  | 1437|    177|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|     97|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|    177|    }
  ------------------
 3374|    177|    PORT_Assert(ss->ssl3.prSpec);
  ------------------
  |  |  120|    177|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    177|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 177, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3375|    177|    ssl_CipherSpecRelease(ss->ssl3.crSpec);
 3376|    177|    ss->ssl3.crSpec = ss->ssl3.prSpec;
 3377|    177|    ss->ssl3.prSpec = NULL;
 3378|    177|    ssl_ReleaseSpecWriteLock(ss); /*************************************/
  ------------------
  |  | 1440|    177|    {                                              \
  |  | 1441|    177|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 97, False: 80]
  |  |  ------------------
  |  | 1442|    177|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|     97|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|    177|    }
  ------------------
 3379|       |
 3380|    177|    ss->ssl3.hs.ws = wait_finished;
 3381|    177|    return SECSuccess;
 3382|    177|}
ssl3con.c:ssl3_HandleAlert:
 3048|    769|{
 3049|    769|    SSL3AlertLevel level;
 3050|    769|    SSL3AlertDescription desc;
 3051|    769|    int error;
 3052|       |
 3053|    769|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    769|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.13k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 406, False: 363]
  |  |  |  |  |  Branch (208:7): [True: 363, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3054|    769|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    769|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.13k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 406, False: 363]
  |  |  |  |  |  Branch (208:7): [True: 363, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3055|       |
 3056|    769|    SSL_TRC(3, ("%d: SSL3[%d]: handle alert record", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|    769|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 769]
  |  |  ------------------
  |  |   72|    769|    ssl_Trace b
  ------------------
 3057|       |
 3058|    769|    if (buf->len != 2) {
  ------------------
  |  Branch (3058:9): [True: 33, False: 736]
  ------------------
 3059|     33|        (void)ssl3_DecodeError(ss);
 3060|     33|        PORT_SetError(SSL_ERROR_RX_MALFORMED_ALERT);
  ------------------
  |  |   65|     33|#define PORT_SetError PORT_SetError_Util
  ------------------
 3061|     33|        return SECFailure;
 3062|     33|    }
 3063|    736|    level = (SSL3AlertLevel)buf->buf[0];
 3064|    736|    desc = (SSL3AlertDescription)buf->buf[1];
 3065|    736|    buf->len = 0;
 3066|    736|    SSL_TRC(5, ("%d: SSL3[%d] received alert, level = %d, description = %d",
  ------------------
  |  |   71|    736|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 736]
  |  |  ------------------
  |  |   72|    736|    ssl_Trace b
  ------------------
 3067|    736|                SSL_GETPID(), ss->fd, level, desc));
 3068|       |
 3069|    736|    if (ss->alertReceivedCallback) {
  ------------------
  |  Branch (3069:9): [True: 0, False: 736]
  ------------------
 3070|      0|        SSLAlert alert = { level, desc };
 3071|      0|        ss->alertReceivedCallback(ss->fd, ss->alertReceivedCallbackArg, &alert);
 3072|      0|    }
 3073|       |
 3074|    736|    switch (desc) {
 3075|      4|        case close_notify:
  ------------------
  |  Branch (3075:9): [True: 4, False: 732]
  ------------------
 3076|      4|            ss->recvdCloseNotify = 1;
 3077|      4|            error = SSL_ERROR_CLOSE_NOTIFY_ALERT;
 3078|      4|            break;
 3079|     20|        case unexpected_message:
  ------------------
  |  Branch (3079:9): [True: 20, False: 716]
  ------------------
 3080|     20|            error = SSL_ERROR_HANDSHAKE_UNEXPECTED_ALERT;
 3081|     20|            break;
 3082|     21|        case bad_record_mac:
  ------------------
  |  Branch (3082:9): [True: 21, False: 715]
  ------------------
 3083|     21|            error = SSL_ERROR_BAD_MAC_ALERT;
 3084|     21|            break;
 3085|     51|        case decryption_failed_RESERVED:
  ------------------
  |  Branch (3085:9): [True: 51, False: 685]
  ------------------
 3086|     51|            error = SSL_ERROR_DECRYPTION_FAILED_ALERT;
 3087|     51|            break;
 3088|     15|        case record_overflow:
  ------------------
  |  Branch (3088:9): [True: 15, False: 721]
  ------------------
 3089|     15|            error = SSL_ERROR_RECORD_OVERFLOW_ALERT;
 3090|     15|            break;
 3091|     19|        case decompression_failure:
  ------------------
  |  Branch (3091:9): [True: 19, False: 717]
  ------------------
 3092|     19|            error = SSL_ERROR_DECOMPRESSION_FAILURE_ALERT;
 3093|     19|            break;
 3094|     44|        case handshake_failure:
  ------------------
  |  Branch (3094:9): [True: 44, False: 692]
  ------------------
 3095|     44|            error = SSL_ERROR_HANDSHAKE_FAILURE_ALERT;
 3096|     44|            break;
 3097|     11|        case no_certificate:
  ------------------
  |  Branch (3097:9): [True: 11, False: 725]
  ------------------
 3098|     11|            error = SSL_ERROR_NO_CERTIFICATE;
 3099|     11|            break;
 3100|     19|        case certificate_required:
  ------------------
  |  Branch (3100:9): [True: 19, False: 717]
  ------------------
 3101|     19|            error = SSL_ERROR_RX_CERTIFICATE_REQUIRED_ALERT;
 3102|     19|            break;
 3103|     22|        case bad_certificate:
  ------------------
  |  Branch (3103:9): [True: 22, False: 714]
  ------------------
 3104|     22|            error = SSL_ERROR_BAD_CERT_ALERT;
 3105|     22|            break;
 3106|     18|        case unsupported_certificate:
  ------------------
  |  Branch (3106:9): [True: 18, False: 718]
  ------------------
 3107|     18|            error = SSL_ERROR_UNSUPPORTED_CERT_ALERT;
 3108|     18|            break;
 3109|     18|        case certificate_revoked:
  ------------------
  |  Branch (3109:9): [True: 18, False: 718]
  ------------------
 3110|     18|            error = SSL_ERROR_REVOKED_CERT_ALERT;
 3111|     18|            break;
 3112|     38|        case certificate_expired:
  ------------------
  |  Branch (3112:9): [True: 38, False: 698]
  ------------------
 3113|     38|            error = SSL_ERROR_EXPIRED_CERT_ALERT;
 3114|     38|            break;
 3115|     19|        case certificate_unknown:
  ------------------
  |  Branch (3115:9): [True: 19, False: 717]
  ------------------
 3116|     19|            error = SSL_ERROR_CERTIFICATE_UNKNOWN_ALERT;
 3117|     19|            break;
 3118|     18|        case illegal_parameter:
  ------------------
  |  Branch (3118:9): [True: 18, False: 718]
  ------------------
 3119|     18|            error = SSL_ERROR_ILLEGAL_PARAMETER_ALERT;
 3120|     18|            break;
 3121|     12|        case inappropriate_fallback:
  ------------------
  |  Branch (3121:9): [True: 12, False: 724]
  ------------------
 3122|     12|            error = SSL_ERROR_INAPPROPRIATE_FALLBACK_ALERT;
 3123|     12|            break;
 3124|       |
 3125|       |        /* All alerts below are TLS only. */
 3126|     22|        case unknown_ca:
  ------------------
  |  Branch (3126:9): [True: 22, False: 714]
  ------------------
 3127|     22|            error = SSL_ERROR_UNKNOWN_CA_ALERT;
 3128|     22|            break;
 3129|     12|        case access_denied:
  ------------------
  |  Branch (3129:9): [True: 12, False: 724]
  ------------------
 3130|     12|            error = SSL_ERROR_ACCESS_DENIED_ALERT;
 3131|     12|            break;
 3132|     23|        case decode_error:
  ------------------
  |  Branch (3132:9): [True: 23, False: 713]
  ------------------
 3133|     23|            error = SSL_ERROR_DECODE_ERROR_ALERT;
 3134|     23|            break;
 3135|     24|        case decrypt_error:
  ------------------
  |  Branch (3135:9): [True: 24, False: 712]
  ------------------
 3136|     24|            error = SSL_ERROR_DECRYPT_ERROR_ALERT;
 3137|     24|            break;
 3138|     18|        case export_restriction:
  ------------------
  |  Branch (3138:9): [True: 18, False: 718]
  ------------------
 3139|     18|            error = SSL_ERROR_EXPORT_RESTRICTION_ALERT;
 3140|     18|            break;
 3141|     18|        case protocol_version:
  ------------------
  |  Branch (3141:9): [True: 18, False: 718]
  ------------------
 3142|     18|            error = SSL_ERROR_PROTOCOL_VERSION_ALERT;
 3143|     18|            break;
 3144|     11|        case insufficient_security:
  ------------------
  |  Branch (3144:9): [True: 11, False: 725]
  ------------------
 3145|     11|            error = SSL_ERROR_INSUFFICIENT_SECURITY_ALERT;
 3146|     11|            break;
 3147|     19|        case internal_error:
  ------------------
  |  Branch (3147:9): [True: 19, False: 717]
  ------------------
 3148|     19|            error = SSL_ERROR_INTERNAL_ERROR_ALERT;
 3149|     19|            break;
 3150|     57|        case user_canceled:
  ------------------
  |  Branch (3150:9): [True: 57, False: 679]
  ------------------
 3151|     57|            error = SSL_ERROR_USER_CANCELED_ALERT;
 3152|     57|            break;
 3153|     10|        case no_renegotiation:
  ------------------
  |  Branch (3153:9): [True: 10, False: 726]
  ------------------
 3154|     10|            error = SSL_ERROR_NO_RENEGOTIATION_ALERT;
 3155|     10|            break;
 3156|       |
 3157|       |        /* Alerts for TLS client hello extensions */
 3158|     18|        case missing_extension:
  ------------------
  |  Branch (3158:9): [True: 18, False: 718]
  ------------------
 3159|     18|            error = SSL_ERROR_MISSING_EXTENSION_ALERT;
 3160|     18|            break;
 3161|     12|        case unsupported_extension:
  ------------------
  |  Branch (3161:9): [True: 12, False: 724]
  ------------------
 3162|     12|            error = SSL_ERROR_UNSUPPORTED_EXTENSION_ALERT;
 3163|     12|            break;
 3164|     18|        case certificate_unobtainable:
  ------------------
  |  Branch (3164:9): [True: 18, False: 718]
  ------------------
 3165|     18|            error = SSL_ERROR_CERTIFICATE_UNOBTAINABLE_ALERT;
 3166|     18|            break;
 3167|     24|        case unrecognized_name:
  ------------------
  |  Branch (3167:9): [True: 24, False: 712]
  ------------------
 3168|     24|            error = SSL_ERROR_UNRECOGNIZED_NAME_ALERT;
 3169|     24|            break;
 3170|     11|        case bad_certificate_status_response:
  ------------------
  |  Branch (3170:9): [True: 11, False: 725]
  ------------------
 3171|     11|            error = SSL_ERROR_BAD_CERT_STATUS_RESPONSE_ALERT;
 3172|     11|            break;
 3173|     22|        case bad_certificate_hash_value:
  ------------------
  |  Branch (3173:9): [True: 22, False: 714]
  ------------------
 3174|     22|            error = SSL_ERROR_BAD_CERT_HASH_VALUE_ALERT;
 3175|     22|            break;
 3176|     13|        case no_application_protocol:
  ------------------
  |  Branch (3176:9): [True: 13, False: 723]
  ------------------
 3177|     13|            error = SSL_ERROR_NEXT_PROTOCOL_NO_PROTOCOL;
 3178|     13|            break;
 3179|     10|        case ech_required:
  ------------------
  |  Branch (3179:9): [True: 10, False: 726]
  ------------------
 3180|     10|            error = SSL_ERROR_ECH_REQUIRED_ALERT;
 3181|     10|            break;
 3182|     45|        default:
  ------------------
  |  Branch (3182:9): [True: 45, False: 691]
  ------------------
 3183|     45|            error = SSL_ERROR_RX_UNKNOWN_ALERT;
 3184|     45|            break;
 3185|    736|    }
 3186|    736|    if ((ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) &&
  ------------------
  |  |   21|    736|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (3186:9): [True: 61, False: 675]
  ------------------
 3187|    736|        (ss->ssl3.hs.ws != wait_server_hello)) {
  ------------------
  |  Branch (3187:9): [True: 34, False: 27]
  ------------------
 3188|       |        /* TLS 1.3 requires all but "end of data" alerts to be
 3189|       |         * treated as fatal. */
 3190|     34|        switch (desc) {
 3191|      1|            case close_notify:
  ------------------
  |  Branch (3191:13): [True: 1, False: 33]
  ------------------
 3192|     33|            case user_canceled:
  ------------------
  |  Branch (3192:13): [True: 32, False: 2]
  ------------------
 3193|     33|                break;
 3194|      1|            default:
  ------------------
  |  Branch (3194:13): [True: 1, False: 33]
  ------------------
 3195|      1|                level = alert_fatal;
 3196|     34|        }
 3197|     34|    }
 3198|    736|    if (level == alert_fatal) {
  ------------------
  |  Branch (3198:9): [True: 12, False: 724]
  ------------------
 3199|     12|        ssl_UncacheSessionID(ss);
 3200|     12|        if ((ss->ssl3.hs.ws == wait_server_hello) &&
  ------------------
  |  Branch (3200:13): [True: 9, False: 3]
  ------------------
 3201|     12|            (desc == handshake_failure)) {
  ------------------
  |  Branch (3201:13): [True: 2, False: 7]
  ------------------
 3202|       |            /* XXX This is a hack.  We're assuming that any handshake failure
 3203|       |             * XXX on the client hello is a failure to match ciphers.
 3204|       |             */
 3205|      2|            error = SSL_ERROR_NO_CYPHER_OVERLAP;
 3206|      2|        }
 3207|     12|        PORT_SetError(error);
  ------------------
  |  |   65|     12|#define PORT_SetError PORT_SetError_Util
  ------------------
 3208|     12|        return SECFailure;
 3209|     12|    }
 3210|    724|    if ((desc == no_certificate) && (ss->ssl3.hs.ws == wait_client_cert)) {
  ------------------
  |  Branch (3210:9): [True: 11, False: 713]
  |  Branch (3210:37): [True: 0, False: 11]
  ------------------
 3211|       |        /* I'm a server. I've requested a client cert. He hasn't got one. */
 3212|      0|        SECStatus rv;
 3213|       |
 3214|      0|        PORT_Assert(ss->sec.isServer);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3215|      0|        ss->ssl3.hs.ws = wait_client_key;
 3216|      0|        rv = ssl3_HandleNoCertificate(ss);
 3217|      0|        return rv;
 3218|      0|    }
 3219|    724|    return SECSuccess;
 3220|    724|}
ssl3con.c:ssl3_GetCipherSpec:
13495|  1.45M|{
13496|  1.45M|    ssl3CipherSpec *crSpec = ss->ssl3.crSpec;
13497|  1.45M|    ssl3CipherSpec *newSpec = NULL;
13498|  1.45M|    DTLSEpoch epoch;
13499|       |
13500|  1.45M|    if (!IS_DTLS(ss)) {
  ------------------
  |  |  892|  1.45M|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (13500:9): [True: 0, False: 1.45M]
  ------------------
13501|      0|        return crSpec;
13502|      0|    }
13503|  1.45M|    epoch = dtls_ReadEpoch(crSpec->version, crSpec->epoch, cText->hdr);
13504|  1.45M|    if (crSpec->epoch == epoch) {
  ------------------
  |  Branch (13504:9): [True: 1.44M, False: 9.56k]
  ------------------
13505|  1.44M|        return crSpec;
13506|  1.44M|    }
13507|  9.56k|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  9.56k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (13507:9): [True: 3.76k, False: 5.80k]
  ------------------
13508|       |        /* Try to find the cipher spec. */
13509|  3.76k|        newSpec = ssl_FindCipherSpecByEpoch(ss, ssl_secret_read,
13510|  3.76k|                                            epoch);
13511|  3.76k|        if (newSpec != NULL) {
  ------------------
  |  Branch (13511:13): [True: 0, False: 3.76k]
  ------------------
13512|      0|            return newSpec;
13513|      0|        }
13514|  3.76k|    }
13515|  9.56k|    SSL_TRC(10, ("%d: DTLS[%d]: %s couldn't find cipherspec from epoch %d",
  ------------------
  |  |   71|  9.56k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 9.56k]
  |  |  ------------------
  |  |   72|  9.56k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
13516|  9.56k|                 SSL_GETPID(), ss->fd, SSL_ROLE(ss), epoch));
13517|  9.56k|    return NULL;
13518|  9.56k|}

ssl_NamedGroup2ECParams:
   37|  9.39k|{
   38|  9.39k|    SECOidData *oidData = NULL;
   39|       |
   40|  9.39k|    if (!params) {
  ------------------
  |  Branch (40:9): [True: 0, False: 9.39k]
  ------------------
   41|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   42|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   43|      0|        return SECFailure;
   44|      0|    }
   45|       |
   46|  9.39k|    if (!ecGroup || ecGroup->keaType != ssl_kea_ecdh ||
  ------------------
  |  Branch (46:9): [True: 0, False: 9.39k]
  |  Branch (46:21): [True: 0, False: 9.39k]
  ------------------
   47|  9.39k|        (oidData = SECOID_FindOIDByTag(ecGroup->oidTag)) == NULL) {
  ------------------
  |  |  116|  9.39k|#define SECOID_FindOIDByTag SECOID_FindOIDByTag_Util
  ------------------
  |  Branch (47:9): [True: 0, False: 9.39k]
  ------------------
   48|      0|        PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   49|      0|        return SECFailure;
   50|      0|    }
   51|       |
   52|  9.39k|    if (SECITEM_AllocItem(arena, params, (2 + oidData->oid.len)) == NULL) {
  ------------------
  |  |  103|  9.39k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  |  Branch (52:9): [True: 0, False: 9.39k]
  ------------------
   53|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   54|      0|        return SECFailure;
   55|      0|    }
   56|       |
   57|       |    /*
   58|       |     * params->data needs to contain the ASN encoding of an object ID (OID)
   59|       |     * representing the named curve. The actual OID is in
   60|       |     * oidData->oid.data so we simply prepend 0x06 and OID length
   61|       |     */
   62|  9.39k|    params->data[0] = SEC_ASN1_OBJECT_ID;
  ------------------
  |  |   82|  9.39k|#define SEC_ASN1_OBJECT_ID 0x06
  ------------------
   63|  9.39k|    params->data[1] = oidData->oid.len;
   64|  9.39k|    memcpy(params->data + 2, oidData->oid.data, oidData->oid.len);
   65|       |
   66|  9.39k|    return SECSuccess;
   67|  9.39k|}
ssl_ECPubKey2NamedGroup:
   71|    327|{
   72|    327|    SECItem oid = { siBuffer, NULL, 0 };
   73|    327|    SECOidData *oidData = NULL;
   74|    327|    PRUint32 policyFlags = 0;
   75|    327|    unsigned int i;
   76|    327|    const SECKEYECParams *params;
   77|       |
   78|    327|    if (pubKey->keyType != ecKey) {
  ------------------
  |  Branch (78:9): [True: 0, False: 327]
  ------------------
   79|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|      0|        return NULL;
   81|      0|    }
   82|       |
   83|    327|    params = &pubKey->u.ec.DEREncodedParams;
   84|       |
   85|       |    /*
   86|       |     * params->data needs to contain the ASN encoding of an object ID (OID)
   87|       |     * representing a named curve. Here, we strip away everything
   88|       |     * before the actual OID and use the OID to look up a named curve.
   89|       |     */
   90|    327|    if (params->data[0] != SEC_ASN1_OBJECT_ID)
  ------------------
  |  |   82|    327|#define SEC_ASN1_OBJECT_ID 0x06
  ------------------
  |  Branch (90:9): [True: 0, False: 327]
  ------------------
   91|      0|        return NULL;
   92|    327|    oid.len = params->len - 2;
   93|    327|    oid.data = params->data + 2;
   94|    327|    if ((oidData = SECOID_FindOID(&oid)) == NULL)
  ------------------
  |  |  115|    327|#define SECOID_FindOID SECOID_FindOID_Util
  ------------------
  |  Branch (94:9): [True: 0, False: 327]
  ------------------
   95|      0|        return NULL;
   96|    327|    if ((NSS_GetAlgorithmPolicy(oidData->offset, &policyFlags) ==
  ------------------
  |  Branch (96:9): [True: 327, False: 0]
  ------------------
   97|    327|         SECSuccess) &&
   98|    327|        !(policyFlags & NSS_USE_ALG_IN_SSL_KX)) {
  ------------------
  |  |  572|    327|#define NSS_USE_ALG_IN_SSL_KX 0x00000004           /* used in SSL key exchange */
  ------------------
  |  Branch (98:9): [True: 0, False: 327]
  ------------------
   99|      0|        return NULL;
  100|      0|    }
  101|  1.14k|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; ++i) {
  ------------------
  |  |  133|  1.14k|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (101:17): [True: 1.14k, False: 5]
  ------------------
  102|  1.14k|        if (ssl_named_groups[i].oidTag == oidData->offset) {
  ------------------
  |  Branch (102:13): [True: 322, False: 821]
  ------------------
  103|    322|            return &ssl_named_groups[i];
  104|    322|        }
  105|  1.14k|    }
  106|       |
  107|      5|    return NULL;
  108|    327|}
ssl3_SendECDHClientKeyExchange:
  166|    334|{
  167|    334|    PK11SymKey *pms = NULL;
  168|    334|    SECStatus rv = SECFailure;
  169|    334|    PRBool isTLS, isTLS12;
  170|    334|    CK_MECHANISM_TYPE target;
  171|    334|    const sslNamedGroupDef *groupDef;
  172|    334|    sslEphemeralKeyPair *keyPair = NULL;
  173|    334|    SECKEYPublicKey *pubKey;
  174|       |
  175|    334|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    334|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    507|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 161, False: 173]
  |  |  |  |  |  Branch (208:7): [True: 173, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  176|    334|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|    334|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    507|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 161, False: 173]
  |  |  |  |  |  Branch (208:7): [True: 173, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|       |
  178|    334|    isTLS = (PRBool)(ss->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|    334|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  179|    334|    isTLS12 = (PRBool)(ss->version >= SSL_LIBRARY_VERSION_TLS_1_2);
  ------------------
  |  |   20|    334|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  180|       |
  181|       |    /* Generate ephemeral EC keypair */
  182|    334|    if (svrPubKey->keyType != ecKey) {
  ------------------
  |  Branch (182:9): [True: 7, False: 327]
  ------------------
  183|      7|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      7|#define PORT_SetError PORT_SetError_Util
  ------------------
  184|      7|        goto loser;
  185|      7|    }
  186|    327|    groupDef = ssl_ECPubKey2NamedGroup(svrPubKey);
  187|    327|    if (!groupDef) {
  ------------------
  |  Branch (187:9): [True: 5, False: 322]
  ------------------
  188|      5|        PORT_SetError(SEC_ERROR_BAD_KEY);
  ------------------
  |  |   65|      5|#define PORT_SetError PORT_SetError_Util
  ------------------
  189|      5|        goto loser;
  190|      5|    }
  191|    322|    ss->sec.keaGroup = groupDef;
  192|    322|    rv = ssl_CreateECDHEphemeralKeyPair(ss, groupDef, &keyPair);
  193|    322|    if (rv != SECSuccess) {
  ------------------
  |  Branch (193:9): [True: 10, False: 312]
  ------------------
  194|     10|        ssl_MapLowLevelError(SEC_ERROR_KEYGEN_FAIL);
  195|     10|        goto loser;
  196|     10|    }
  197|       |
  198|    312|    pubKey = keyPair->keys->pubKey;
  199|    312|    PRINT_BUF(50, (ss, "ECDH public value:",
  ------------------
  |  |   74|    312|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 312]
  |  |  ------------------
  |  |   75|    312|    ssl_PrintBuf b
  ------------------
  200|    312|                   pubKey->u.ec.publicValue.data,
  201|    312|                   pubKey->u.ec.publicValue.len));
  202|       |
  203|    312|    if (isTLS12) {
  ------------------
  |  Branch (203:9): [True: 243, False: 69]
  ------------------
  204|    243|        target = CKM_TLS12_MASTER_KEY_DERIVE_DH;
  ------------------
  |  | 1028|    243|#define CKM_TLS12_MASTER_KEY_DERIVE_DH 0x000003E2UL
  ------------------
  205|    243|    } else if (isTLS) {
  ------------------
  |  Branch (205:16): [True: 69, False: 0]
  ------------------
  206|     69|        target = CKM_TLS_MASTER_KEY_DERIVE_DH;
  ------------------
  |  |  970|     69|#define CKM_TLS_MASTER_KEY_DERIVE_DH 0x00000377UL
  ------------------
  207|     69|    } else {
  208|      0|        target = CKM_SSL3_MASTER_KEY_DERIVE_DH;
  ------------------
  |  |  966|      0|#define CKM_SSL3_MASTER_KEY_DERIVE_DH 0x00000373UL
  ------------------
  209|      0|    }
  210|       |
  211|       |    /* Determine the PMS */
  212|    312|    pms = PK11_PubDeriveWithKDF(keyPair->keys->privKey, svrPubKey,
  213|    312|                                PR_FALSE, NULL, NULL, CKM_ECDH1_DERIVE, target,
  ------------------
  |  |  438|    312|#define PR_FALSE 0
  ------------------
                                              PR_FALSE, NULL, NULL, CKM_ECDH1_DERIVE, target,
  ------------------
  |  | 1086|    312|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
  214|    312|                                CKA_DERIVE, 0, CKD_NULL, NULL, NULL);
  ------------------
  |  |  555|    312|#define CKA_DERIVE 0x0000010CUL
  ------------------
                                              CKA_DERIVE, 0, CKD_NULL, NULL, NULL);
  ------------------
  |  | 1702|    312|#define CKD_NULL 0x00000001UL
  ------------------
  215|       |
  216|    312|    if (pms == NULL) {
  ------------------
  |  Branch (216:9): [True: 45, False: 267]
  ------------------
  217|     45|        (void)SSL3_SendAlert(ss, alert_fatal, illegal_parameter);
  218|     45|        ssl_MapLowLevelError(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE);
  219|     45|        goto loser;
  220|     45|    }
  221|       |
  222|    267|    rv = ssl3_AppendHandshakeHeader(ss, ssl_hs_client_key_exchange,
  223|    267|                                    pubKey->u.ec.publicValue.len + 1);
  224|    267|    if (rv != SECSuccess) {
  ------------------
  |  Branch (224:9): [True: 0, False: 267]
  ------------------
  225|      0|        goto loser; /* err set by ssl3_AppendHandshake* */
  226|      0|    }
  227|       |
  228|    267|    rv = ssl3_AppendHandshakeVariable(ss, pubKey->u.ec.publicValue.data,
  229|    267|                                      pubKey->u.ec.publicValue.len, 1);
  230|       |
  231|    267|    if (rv != SECSuccess) {
  ------------------
  |  Branch (231:9): [True: 0, False: 267]
  ------------------
  232|      0|        goto loser; /* err set by ssl3_AppendHandshake* */
  233|      0|    }
  234|       |
  235|    267|    rv = ssl3_InitPendingCipherSpecs(ss, pms, PR_TRUE);
  ------------------
  |  |  437|    267|#define PR_TRUE 1
  ------------------
  236|    267|    if (rv != SECSuccess) {
  ------------------
  |  Branch (236:9): [True: 0, False: 267]
  ------------------
  237|      0|        ssl_MapLowLevelError(SSL_ERROR_CLIENT_KEY_EXCHANGE_FAILURE);
  238|      0|        goto loser;
  239|      0|    }
  240|       |
  241|    267|    PK11_FreeSymKey(pms);
  242|    267|    ssl_FreeEphemeralKeyPair(keyPair);
  243|    267|    return SECSuccess;
  244|       |
  245|     67|loser:
  246|     67|    if (pms)
  ------------------
  |  Branch (246:9): [True: 0, False: 67]
  ------------------
  247|      0|        PK11_FreeSymKey(pms);
  248|     67|    if (keyPair)
  ------------------
  |  Branch (248:9): [True: 45, False: 22]
  ------------------
  249|     45|        ssl_FreeEphemeralKeyPair(keyPair);
  250|     67|    return SECFailure;
  251|    267|}
ssl_ImportECDHKeyShare:
  333|  1.46k|{
  334|  1.46k|    SECStatus rv;
  335|  1.46k|    SECItem ecPoint = { siBuffer, NULL, 0 };
  336|       |
  337|  1.46k|    if (!length) {
  ------------------
  |  Branch (337:9): [True: 0, False: 1.46k]
  ------------------
  338|      0|        PORT_SetError(SSL_ERROR_RX_MALFORMED_ECDHE_KEY_SHARE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  339|      0|        return SECFailure;
  340|      0|    }
  341|       |
  342|       |    /* Fail if the ec point uses compressed representation */
  343|  1.46k|    if (b[0] != EC_POINT_FORM_UNCOMPRESSED &&
  ------------------
  |  |   92|  2.92k|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (343:9): [True: 1.33k, False: 131]
  ------------------
  344|  1.46k|        ecGroup->name != ssl_grp_ec_curve25519) {
  ------------------
  |  Branch (344:9): [True: 1, False: 1.32k]
  ------------------
  345|      1|        PORT_SetError(SEC_ERROR_UNSUPPORTED_EC_POINT_FORM);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
  346|      1|        return SECFailure;
  347|      1|    }
  348|       |
  349|  1.46k|    peerKey->keyType = ecKey;
  350|       |    /* Set up the encoded params */
  351|  1.46k|    rv = ssl_NamedGroup2ECParams(peerKey->arena, ecGroup,
  352|  1.46k|                                 &peerKey->u.ec.DEREncodedParams);
  353|  1.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (353:9): [True: 0, False: 1.46k]
  ------------------
  354|      0|        ssl_MapLowLevelError(SSL_ERROR_RX_MALFORMED_ECDHE_KEY_SHARE);
  355|      0|        return SECFailure;
  356|      0|    }
  357|  1.46k|    peerKey->u.ec.encoding = ECPoint_Undefined;
  358|       |
  359|       |    /* copy publicValue in peerKey */
  360|  1.46k|    ecPoint.data = b;
  361|  1.46k|    ecPoint.len = length;
  362|       |
  363|  1.46k|    rv = SECITEM_CopyItem(peerKey->arena, &peerKey->u.ec.publicValue, &ecPoint);
  ------------------
  |  |  106|  1.46k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  364|  1.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (364:9): [True: 0, False: 1.46k]
  ------------------
  365|      0|        return SECFailure;
  366|      0|    }
  367|       |
  368|  1.46k|    return SECSuccess;
  369|  1.46k|}
ssl_CreateECDHEphemeralKeyPair:
  473|  7.93k|{
  474|  7.93k|    SECKEYPrivateKey *privKey = NULL;
  475|  7.93k|    SECKEYPublicKey *pubKey = NULL;
  476|  7.93k|    SECKEYECParams ecParams = { siBuffer, NULL, 0 };
  477|  7.93k|    sslEphemeralKeyPair *pair;
  478|       |
  479|  7.93k|    if (ssl_NamedGroup2ECParams(NULL, ecGroup, &ecParams) != SECSuccess) {
  ------------------
  |  Branch (479:9): [True: 0, False: 7.93k]
  ------------------
  480|      0|        return SECFailure;
  481|      0|    }
  482|  7.93k|    privKey = ssl_CreateECDHEPrivateKey(&ecParams, &pubKey, ss->pkcs11PinArg);
  483|  7.93k|    SECITEM_FreeItem(&ecParams, PR_FALSE);
  ------------------
  |  |  108|  7.93k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&ecParams, PR_FALSE);
  ------------------
  |  |  438|  7.93k|#define PR_FALSE 0
  ------------------
  484|       |
  485|  7.93k|    if (!privKey || !pubKey ||
  ------------------
  |  Branch (485:9): [True: 32, False: 7.90k]
  |  Branch (485:21): [True: 0, False: 7.90k]
  ------------------
  486|  7.93k|        !(pair = ssl_NewEphemeralKeyPair(ecGroup, privKey, pubKey))) {
  ------------------
  |  Branch (486:9): [True: 0, False: 7.90k]
  ------------------
  487|     32|        if (privKey) {
  ------------------
  |  Branch (487:13): [True: 0, False: 32]
  ------------------
  488|      0|            SECKEY_DestroyPrivateKey(privKey);
  489|      0|        }
  490|     32|        if (pubKey) {
  ------------------
  |  Branch (490:13): [True: 0, False: 32]
  ------------------
  491|      0|            SECKEY_DestroyPublicKey(pubKey);
  492|      0|        }
  493|     32|        ssl_MapLowLevelError(SEC_ERROR_KEYGEN_FAIL);
  494|     32|        return SECFailure;
  495|     32|    }
  496|       |
  497|  7.90k|    *keyPair = pair;
  498|  7.90k|    SSL_TRC(50, ("%d: SSL[%d]: Create ECDH ephemeral key %d",
  ------------------
  |  |   71|  7.90k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |   72|  7.90k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  499|  7.90k|                 SSL_GETPID(), ss ? ss->fd : NULL, ecGroup->name));
  500|  7.90k|    PRINT_BUF(50, (ss, "Public Key", pubKey->u.ec.publicValue.data,
  ------------------
  |  |   74|  7.90k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 7.90k]
  |  |  ------------------
  |  |   75|  7.90k|    ssl_PrintBuf b
  ------------------
  501|  7.90k|                   pubKey->u.ec.publicValue.len));
  502|  7.90k|#ifdef TRACE
  503|  7.90k|    if (ssl_trace >= 50) {
  ------------------
  |  Branch (503:9): [True: 0, False: 7.90k]
  ------------------
  504|      0|        SECItem d = { siBuffer, NULL, 0 };
  505|      0|        SECStatus rv = PK11_ReadRawAttribute(PK11_TypePrivKey, privKey,
  506|      0|                                             CKA_VALUE, &d);
  ------------------
  |  |  516|      0|#define CKA_VALUE 0x00000011UL
  ------------------
  507|      0|        if (rv == SECSuccess) {
  ------------------
  |  Branch (507:13): [True: 0, False: 0]
  ------------------
  508|      0|            PRINT_BUF(50, (ss, "Private Key", d.data, d.len));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
  509|      0|            SECITEM_FreeItem(&d, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                          SECITEM_FreeItem(&d, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  510|      0|        } else {
  511|      0|            SSL_TRC(50, ("Error extracting private key"));
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  512|      0|        }
  513|      0|    }
  514|  7.90k|#endif
  515|  7.90k|    return SECSuccess;
  516|  7.93k|}
ssl3_HandleECDHServerKeyExchange:
  520|  1.33k|{
  521|  1.33k|    PLArenaPool *arena = NULL;
  522|  1.33k|    SECKEYPublicKey *peerKey = NULL;
  523|  1.33k|    PRBool isTLS;
  524|  1.33k|    SECStatus rv;
  525|  1.33k|    int errCode = SSL_ERROR_RX_MALFORMED_SERVER_KEY_EXCH;
  526|  1.33k|    SSL3AlertDescription desc = illegal_parameter;
  527|  1.33k|    SSL3Hashes hashes;
  528|  1.33k|    SECItem signature = { siBuffer, NULL, 0 };
  529|  1.33k|    SSLHashType hashAlg;
  530|  1.33k|    SSLSignatureScheme sigScheme;
  531|       |
  532|  1.33k|    SECItem ec_params = { siBuffer, NULL, 0 };
  533|  1.33k|    SECItem ec_point = { siBuffer, NULL, 0 };
  534|  1.33k|    unsigned char paramBuf[3];
  535|  1.33k|    const sslNamedGroupDef *ecGroup;
  536|       |
  537|  1.33k|    isTLS = (PRBool)(ss->ssl3.prSpec->version > SSL_LIBRARY_VERSION_3_0);
  ------------------
  |  |   17|  1.33k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  538|       |
  539|  1.33k|    ec_params.len = sizeof paramBuf;
  540|  1.33k|    ec_params.data = paramBuf;
  541|  1.33k|    rv = ssl3_ConsumeHandshake(ss, ec_params.data, ec_params.len, &b, &length);
  542|  1.33k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (542:9): [True: 1, False: 1.32k]
  ------------------
  543|      1|        goto loser; /* malformed. */
  544|      1|    }
  545|       |
  546|       |    /* Fail if the curve is not a named curve */
  547|  1.32k|    if (ec_params.data[0] != ec_type_named) {
  ------------------
  |  Branch (547:9): [True: 3, False: 1.32k]
  ------------------
  548|      3|        errCode = SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE;
  549|      3|        desc = handshake_failure;
  550|      3|        goto alert_loser;
  551|      3|    }
  552|  1.32k|    ecGroup = ssl_LookupNamedGroup(ec_params.data[1] << 8 | ec_params.data[2]);
  553|  1.32k|    if (!ecGroup || ecGroup->keaType != ssl_kea_ecdh) {
  ------------------
  |  Branch (553:9): [True: 1, False: 1.32k]
  |  Branch (553:21): [True: 2, False: 1.32k]
  ------------------
  554|      3|        errCode = SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE;
  555|      3|        desc = handshake_failure;
  556|      3|        goto alert_loser;
  557|      3|    }
  558|       |
  559|  1.32k|    rv = ssl3_ConsumeHandshakeVariable(ss, &ec_point, 1, &b, &length);
  560|  1.32k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (560:9): [True: 2, False: 1.32k]
  ------------------
  561|      2|        goto loser; /* malformed. */
  562|      2|    }
  563|       |
  564|       |    /* Fail if the provided point has length 0. */
  565|  1.32k|    if (!ec_point.len) {
  ------------------
  |  Branch (565:9): [True: 1, False: 1.32k]
  ------------------
  566|       |        /* desc and errCode are initialized already */
  567|      1|        goto alert_loser;
  568|      1|    }
  569|       |
  570|       |    /* Fail if the ec point is not uncompressed for any curve that's not 25519. */
  571|  1.32k|    if (ecGroup->name != ssl_grp_ec_curve25519 &&
  ------------------
  |  Branch (571:9): [True: 79, False: 1.24k]
  ------------------
  572|  1.32k|        ec_point.data[0] != EC_POINT_FORM_UNCOMPRESSED) {
  ------------------
  |  |   92|     79|#define EC_POINT_FORM_UNCOMPRESSED 0x04
  ------------------
  |  Branch (572:9): [True: 2, False: 77]
  ------------------
  573|      2|        errCode = SEC_ERROR_UNSUPPORTED_EC_POINT_FORM;
  574|      2|        desc = handshake_failure;
  575|      2|        goto alert_loser;
  576|      2|    }
  577|       |
  578|  1.31k|    PORT_Assert(ss->ssl3.prSpec->version <= SSL_LIBRARY_VERSION_TLS_1_2);
  ------------------
  |  |  120|  1.31k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.31k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.31k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  579|  1.31k|    if (ss->ssl3.prSpec->version == SSL_LIBRARY_VERSION_TLS_1_2) {
  ------------------
  |  |   20|  1.31k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (579:9): [True: 1.25k, False: 65]
  ------------------
  580|  1.25k|        rv = ssl_ConsumeSignatureScheme(ss, &b, &length, &sigScheme);
  581|  1.25k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (581:13): [True: 8, False: 1.24k]
  ------------------
  582|      8|            errCode = PORT_GetError();
  ------------------
  |  |   62|      8|#define PORT_GetError PORT_GetError_Util
  ------------------
  583|      8|            goto alert_loser; /* malformed or unsupported. */
  584|      8|        }
  585|  1.24k|        rv = ssl_CheckSignatureSchemeConsistency(
  586|  1.24k|            ss, sigScheme, &ss->sec.peerCert->subjectPublicKeyInfo);
  587|  1.24k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (587:13): [True: 24, False: 1.22k]
  ------------------
  588|     24|            errCode = PORT_GetError();
  ------------------
  |  |   62|     24|#define PORT_GetError PORT_GetError_Util
  ------------------
  589|     24|            goto alert_loser;
  590|     24|        }
  591|  1.22k|        hashAlg = ssl_SignatureSchemeToHashType(sigScheme);
  592|  1.22k|    } else {
  593|       |        /* Use ssl_hash_none to represent the MD5+SHA1 combo. */
  594|     65|        hashAlg = ssl_hash_none;
  595|     65|        sigScheme = ssl_sig_none;
  596|     65|    }
  597|       |
  598|  1.28k|    rv = ssl3_ConsumeHandshakeVariable(ss, &signature, 2, &b, &length);
  599|  1.28k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (599:9): [True: 1, False: 1.28k]
  ------------------
  600|      1|        goto loser; /* malformed. */
  601|      1|    }
  602|       |
  603|  1.28k|    if (length != 0) {
  ------------------
  |  Branch (603:9): [True: 6, False: 1.27k]
  ------------------
  604|      6|        if (isTLS)
  ------------------
  |  Branch (604:13): [True: 6, False: 0]
  ------------------
  605|      6|            desc = decode_error;
  606|      6|        goto alert_loser; /* malformed. */
  607|      6|    }
  608|       |
  609|  1.27k|    PRINT_BUF(60, (NULL, "Server EC params", ec_params.data, ec_params.len));
  ------------------
  |  |   74|  1.27k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.27k]
  |  |  ------------------
  |  |   75|  1.27k|    ssl_PrintBuf b
  ------------------
  610|  1.27k|    PRINT_BUF(60, (NULL, "Server EC point", ec_point.data, ec_point.len));
  ------------------
  |  |   74|  1.27k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.27k]
  |  |  ------------------
  |  |   75|  1.27k|    ssl_PrintBuf b
  ------------------
  611|       |
  612|       |    /* failures after this point are not malformed handshakes. */
  613|       |    /* TLS: send decrypt_error if signature failed. */
  614|  1.27k|    desc = isTLS ? decrypt_error : handshake_failure;
  ------------------
  |  Branch (614:12): [True: 1.27k, False: 0]
  ------------------
  615|       |
  616|       |    /*
  617|       |     *  check to make sure the hash is signed by right guy
  618|       |     */
  619|  1.27k|    rv = ssl3_ComputeECDHKeyHash(hashAlg, ec_params, ec_point,
  620|  1.27k|                                 ss->ssl3.hs.client_random,
  621|  1.27k|                                 ss->ssl3.hs.server_random,
  622|  1.27k|                                 &hashes);
  623|       |
  624|  1.27k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (624:9): [True: 0, False: 1.27k]
  ------------------
  625|      0|        errCode =
  626|      0|            ssl_MapLowLevelError(SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE);
  627|      0|        goto alert_loser;
  628|      0|    }
  629|  1.27k|    rv = ssl3_VerifySignedHashes(ss, sigScheme, &hashes, &signature);
  630|  1.27k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (630:9): [True: 0, False: 1.27k]
  ------------------
  631|      0|        errCode =
  632|      0|            ssl_MapLowLevelError(SSL_ERROR_SERVER_KEY_EXCHANGE_FAILURE);
  633|      0|        goto alert_loser;
  634|      0|    }
  635|       |
  636|  1.27k|    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|  1.27k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|  1.27k|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  637|  1.27k|    if (arena == NULL) {
  ------------------
  |  Branch (637:9): [True: 0, False: 1.27k]
  ------------------
  638|      0|        errCode = SEC_ERROR_NO_MEMORY;
  639|      0|        goto loser;
  640|      0|    }
  641|       |
  642|  1.27k|    peerKey = PORT_ArenaZNew(arena, SECKEYPublicKey);
  ------------------
  |  |  155|  1.27k|    (type *)PORT_ArenaZAlloc(poolp, sizeof(type))
  |  |  ------------------
  |  |  |  |   59|  1.27k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  |  |  ------------------
  ------------------
  643|  1.27k|    if (peerKey == NULL) {
  ------------------
  |  Branch (643:9): [True: 0, False: 1.27k]
  ------------------
  644|      0|        errCode = SEC_ERROR_NO_MEMORY;
  645|      0|        goto loser;
  646|      0|    }
  647|  1.27k|    peerKey->arena = arena;
  648|       |
  649|       |    /* create public key from point data */
  650|  1.27k|    rv = ssl_ImportECDHKeyShare(peerKey, ec_point.data, ec_point.len,
  651|  1.27k|                                ecGroup);
  652|  1.27k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (652:9): [True: 0, False: 1.27k]
  ------------------
  653|       |        /* error code is set */
  654|      0|        desc = handshake_failure;
  655|      0|        errCode = PORT_GetError();
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
  656|      0|        goto alert_loser;
  657|      0|    }
  658|  1.27k|    peerKey->pkcs11Slot = NULL;
  659|  1.27k|    peerKey->pkcs11ID = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  1.27k|#define CK_INVALID_HANDLE 0
  ------------------
  660|       |
  661|  1.27k|    ss->sec.peerKey = peerKey;
  662|  1.27k|    return SECSuccess;
  663|       |
  664|     47|alert_loser:
  665|     47|    (void)SSL3_SendAlert(ss, alert_fatal, desc);
  666|     51|loser:
  667|     51|    if (arena) {
  ------------------
  |  Branch (667:9): [True: 0, False: 51]
  ------------------
  668|      0|        PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  669|      0|    }
  670|     51|    PORT_SetError(errCode);
  ------------------
  |  |   65|     51|#define PORT_SetError PORT_SetError_Util
  ------------------
  671|     51|    return SECFailure;
  672|     47|}
ssl_IsECCEnabled:
  872|  11.6k|{
  873|  11.6k|    PK11SlotInfo *slot;
  874|       |
  875|       |    /* make sure we can do ECC */
  876|  11.6k|    slot = PK11_GetBestSlot(CKM_ECDH1_DERIVE, ss->pkcs11PinArg);
  ------------------
  |  | 1086|  11.6k|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
  877|  11.6k|    if (!slot) {
  ------------------
  |  Branch (877:9): [True: 0, False: 11.6k]
  ------------------
  878|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  879|      0|    }
  880|  11.6k|    PK11_FreeSlot(slot);
  881|       |
  882|       |    /* make sure an ECC cipher is enabled */
  883|  11.6k|    return ssl_IsSuiteEnabled(ss, ssl_all_ec_suites);
  884|  11.6k|}
ssl_IsDHEEnabled:
  888|    571|{
  889|    571|    return ssl_IsSuiteEnabled(ss, ssl_dhe_suites);
  890|    571|}
ssl_SendSupportedGroupsXtn:
  896|  10.2k|{
  897|  10.2k|    unsigned int i;
  898|  10.2k|    PRBool ec;
  899|  10.2k|    PRBool ec_hybrid = PR_FALSE;
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
  900|  10.2k|    PRBool ff = PR_FALSE;
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
  901|  10.2k|    PRBool found = PR_FALSE;
  ------------------
  |  |  438|  10.2k|#define PR_FALSE 0
  ------------------
  902|  10.2k|    SECStatus rv;
  903|  10.2k|    unsigned int lengthOffset;
  904|       |
  905|       |    /* We only send FF supported groups if we require DH named groups
  906|       |     * or if TLS 1.3 is a possibility. */
  907|  10.2k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (907:9): [True: 1.40k, False: 8.81k]
  ------------------
  908|  1.40k|        ec = ssl_IsECCEnabled(ss);
  909|  1.40k|        if (ss->opt.requireDHENamedGroups) {
  ------------------
  |  Branch (909:13): [True: 571, False: 837]
  ------------------
  910|    571|            ff = ssl_IsDHEEnabled(ss);
  911|    571|        }
  912|  1.40k|        if (!ec && !ff) {
  ------------------
  |  Branch (912:13): [True: 0, False: 1.40k]
  |  Branch (912:20): [True: 0, False: 0]
  ------------------
  913|      0|            return SECSuccess;
  914|      0|        }
  915|  8.81k|    } else {
  916|  8.81k|        ec = ec_hybrid = ff = PR_TRUE;
  ------------------
  |  |  437|  8.81k|#define PR_TRUE 1
  ------------------
  917|  8.81k|    }
  918|       |
  919|       |    /* Mark the location of the length. */
  920|  10.2k|    rv = sslBuffer_Skip(buf, 2, &lengthOffset);
  921|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (921:9): [True: 0, False: 10.2k]
  ------------------
  922|      0|        return SECFailure;
  923|      0|    }
  924|       |
  925|   347k|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; ++i) {
  ------------------
  |  |  133|   347k|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (925:17): [True: 337k, False: 10.2k]
  ------------------
  926|   337k|        const sslNamedGroupDef *group = ss->namedGroupPreferences[i];
  927|   337k|        if (!group) {
  ------------------
  |  Branch (927:13): [True: 235k, False: 102k]
  ------------------
  928|   235k|            continue;
  929|   235k|        }
  930|   102k|        if (group->keaType == ssl_kea_ecdh && !ec) {
  ------------------
  |  Branch (930:13): [True: 40.8k, False: 61.3k]
  |  Branch (930:47): [True: 0, False: 40.8k]
  ------------------
  931|      0|            continue;
  932|      0|        }
  933|   102k|        if (group->keaType == ssl_kea_ecdh_hybrid && !ec_hybrid) {
  ------------------
  |  Branch (933:13): [True: 10.2k, False: 91.9k]
  |  Branch (933:54): [True: 1.40k, False: 8.81k]
  ------------------
  934|  1.40k|            continue;
  935|  1.40k|        }
  936|   100k|        if (group->keaType == ssl_kea_dh && !ff) {
  ------------------
  |  Branch (936:13): [True: 51.1k, False: 49.6k]
  |  Branch (936:45): [True: 4.18k, False: 46.9k]
  ------------------
  937|  4.18k|            continue;
  938|  4.18k|        }
  939|       |
  940|  96.6k|        found = PR_TRUE;
  ------------------
  |  |  437|  96.6k|#define PR_TRUE 1
  ------------------
  941|  96.6k|        rv = sslBuffer_AppendNumber(buf, group->name, 2);
  942|  96.6k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (942:13): [True: 0, False: 96.6k]
  ------------------
  943|      0|            return SECFailure;
  944|      0|        }
  945|  96.6k|    }
  946|       |
  947|       |    /* GREASE SupportedGroups:
  948|       |     * A client MAY select one or more GREASE named group values and advertise
  949|       |     * them in the "supported_groups" extension, if sent [RFC8701, Section 3.1].
  950|       |     */
  951|  10.2k|    if (!ss->sec.isServer &&
  ------------------
  |  Branch (951:9): [True: 10.2k, False: 0]
  ------------------
  952|  10.2k|        ss->opt.enableGrease &&
  ------------------
  |  Branch (952:9): [True: 5.05k, False: 5.16k]
  ------------------
  953|  10.2k|        ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  5.05k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (953:9): [True: 4.35k, False: 706]
  ------------------
  954|  4.35k|        rv = sslBuffer_AppendNumber(buf, ss->ssl3.hs.grease->idx[grease_group], 2);
  955|  4.35k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (955:13): [True: 0, False: 4.35k]
  ------------------
  956|      0|            return SECFailure;
  957|      0|        }
  958|  4.35k|        found = PR_TRUE;
  ------------------
  |  |  437|  4.35k|#define PR_TRUE 1
  ------------------
  959|  4.35k|    }
  960|       |
  961|  10.2k|    if (!found) {
  ------------------
  |  Branch (961:9): [True: 0, False: 10.2k]
  ------------------
  962|       |        /* We added nothing, don't send the extension. */
  963|      0|        return SECSuccess;
  964|      0|    }
  965|       |
  966|  10.2k|    rv = sslBuffer_InsertLength(buf, lengthOffset, 2);
  967|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (967:9): [True: 0, False: 10.2k]
  ------------------
  968|      0|        return SECFailure;
  969|      0|    }
  970|       |
  971|  10.2k|    *added = PR_TRUE;
  ------------------
  |  |  437|  10.2k|#define PR_TRUE 1
  ------------------
  972|  10.2k|    return SECSuccess;
  973|  10.2k|}
ssl3_SendSupportedPointFormatsXtn:
  981|  10.2k|{
  982|  10.2k|    SECStatus rv;
  983|       |
  984|       |    /* No point in doing this unless we have a socket that supports ECC.
  985|       |     * Similarly, no point if we are going to do TLS 1.3 only or we have already
  986|       |     * picked TLS 1.3 (server) given that it doesn't use point formats. */
  987|  10.2k|    if (!ss || !ssl_IsECCEnabled(ss) ||
  ------------------
  |  Branch (987:9): [True: 0, False: 10.2k]
  |  Branch (987:16): [True: 0, False: 10.2k]
  ------------------
  988|  10.2k|        ss->vrange.min >= SSL_LIBRARY_VERSION_TLS_1_3 ||
  ------------------
  |  |   21|  20.4k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (988:9): [True: 952, False: 9.26k]
  ------------------
  989|  10.2k|        (ss->sec.isServer && ss->version >= SSL_LIBRARY_VERSION_TLS_1_3)) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (989:10): [True: 0, False: 9.26k]
  |  Branch (989:30): [True: 0, False: 0]
  ------------------
  990|    952|        return SECSuccess;
  991|    952|    }
  992|  9.26k|    rv = sslBuffer_AppendNumber(buf, 1, 1); /* length */
  993|  9.26k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (993:9): [True: 0, False: 9.26k]
  ------------------
  994|      0|        return SECFailure;
  995|      0|    }
  996|  9.26k|    rv = sslBuffer_AppendNumber(buf, 0, 1); /* uncompressed type only */
  997|  9.26k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (997:9): [True: 0, False: 9.26k]
  ------------------
  998|      0|        return SECFailure;
  999|      0|    }
 1000|       |
 1001|  9.26k|    *added = PR_TRUE;
  ------------------
  |  |  437|  9.26k|#define PR_TRUE 1
  ------------------
 1002|  9.26k|    return SECSuccess;
 1003|  9.26k|}
ssl3ecc.c:ssl_CreateECDHEPrivateKey:
  443|  7.93k|{
  444|  7.93k|    SECKEYPrivateKey *privk = NULL;
  445|  7.93k|    CK_MECHANISM_TYPE type = CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN;
  ------------------
  |  |  274|  7.93k|#define CKM_NSS_ECDHE_NO_PAIRWISE_CHECK_KEY_PAIR_GEN (CKM_NSS + 47)
  |  |  ------------------
  |  |  |  |  162|  7.93k|#define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|  7.93k|#define CKM_VENDOR_DEFINED 0x80000000UL
  |  |  |  |  ------------------
  |  |  |  |               #define CKM_NSS (CKM_VENDOR_DEFINED | NSSCK_VENDOR_NSS)
  |  |  |  |  ------------------
  |  |  |  |  |  |   27|  7.93k|#define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  446|       |
  447|  7.93k|    PK11SlotInfo *slot = PK11_GetInternalSlot();
  448|  7.93k|    if (!slot || !PK11_DoesMechanism(slot, type) || PK11_IsFIPS()) {
  ------------------
  |  Branch (448:9): [True: 0, False: 7.93k]
  |  Branch (448:18): [True: 0, False: 7.93k]
  |  Branch (448:53): [True: 0, False: 7.93k]
  ------------------
  449|      0|        if (slot) {
  ------------------
  |  Branch (449:13): [True: 0, False: 0]
  ------------------
  450|      0|            PK11_FreeSlot(slot);
  451|      0|        }
  452|      0|        return SECKEY_CreateECPrivateKey(param, pubk, cx);
  453|      0|    }
  454|       |
  455|  7.93k|    privk = PK11_GenerateKeyPairWithOpFlags(slot, type, param, pubk,
  456|  7.93k|                                            PK11_ATTR_SESSION | PK11_ATTR_INSENSITIVE | PK11_ATTR_PUBLIC,
  ------------------
  |  |  195|  7.93k|#define PK11_ATTR_SESSION 0x00000002L
  ------------------
                                                          PK11_ATTR_SESSION | PK11_ATTR_INSENSITIVE | PK11_ATTR_PUBLIC,
  ------------------
  |  |  261|  7.93k|#define PK11_ATTR_INSENSITIVE 0x00000080L
  ------------------
                                                          PK11_ATTR_SESSION | PK11_ATTR_INSENSITIVE | PK11_ATTR_PUBLIC,
  ------------------
  |  |  217|  7.93k|#define PK11_ATTR_PUBLIC 0x00000008L
  ------------------
  457|  7.93k|                                            CKF_DERIVE, CKF_DERIVE, cx);
  ------------------
  |  | 1364|  7.93k|#define CKF_DERIVE 0x00080000UL
  ------------------
                                                          CKF_DERIVE, CKF_DERIVE, cx);
  ------------------
  |  | 1364|  7.93k|#define CKF_DERIVE 0x00080000UL
  ------------------
  458|  7.93k|    if (!privk) {
  ------------------
  |  Branch (458:9): [True: 32, False: 7.90k]
  ------------------
  459|     32|        privk = PK11_GenerateKeyPairWithOpFlags(slot, type, param, pubk,
  460|     32|                                                PK11_ATTR_SESSION | PK11_ATTR_SENSITIVE | PK11_ATTR_PRIVATE,
  ------------------
  |  |  195|     32|#define PK11_ATTR_SESSION 0x00000002L
  ------------------
                                                              PK11_ATTR_SESSION | PK11_ATTR_SENSITIVE | PK11_ATTR_PRIVATE,
  ------------------
  |  |  260|     32|#define PK11_ATTR_SENSITIVE 0x00000040L
  ------------------
                                                              PK11_ATTR_SESSION | PK11_ATTR_SENSITIVE | PK11_ATTR_PRIVATE,
  ------------------
  |  |  216|     32|#define PK11_ATTR_PRIVATE 0x00000004L
  ------------------
  461|     32|                                                CKF_DERIVE, CKF_DERIVE, cx);
  ------------------
  |  | 1364|     32|#define CKF_DERIVE 0x00080000UL
  ------------------
                                                              CKF_DERIVE, CKF_DERIVE, cx);
  ------------------
  |  | 1364|     32|#define CKF_DERIVE 0x00080000UL
  ------------------
  462|     32|    }
  463|       |
  464|  7.93k|    PK11_FreeSlot(slot);
  465|  7.93k|    return privk;
  466|  7.93k|}
ssl3ecc.c:ssl3_ComputeECDHKeyHash:
  116|  1.27k|{
  117|  1.27k|    PRUint8 *hashBuf;
  118|  1.27k|    PRUint8 *pBuf;
  119|  1.27k|    SECStatus rv = SECSuccess;
  120|  1.27k|    unsigned int bufLen;
  121|       |    /*
  122|       |     * We only support named curves (the appropriate checks are made before this
  123|       |     * method is called) so ec_params takes up only two bytes. ECPoint needs to
  124|       |     * fit in 256 bytes because the spec says the length must fit in one byte.
  125|       |     */
  126|  1.27k|    PRUint8 buf[2 * SSL3_RANDOM_LENGTH + 2 + 1 + 256];
  127|       |
  128|  1.27k|    bufLen = 2 * SSL3_RANDOM_LENGTH + ec_params.len + 1 + server_ecpoint.len;
  ------------------
  |  |   24|  1.27k|#define SSL3_RANDOM_LENGTH 32
  ------------------
  129|  1.27k|    if (bufLen <= sizeof buf) {
  ------------------
  |  Branch (129:9): [True: 1.27k, False: 0]
  ------------------
  130|  1.27k|        hashBuf = buf;
  131|  1.27k|    } else {
  132|      0|        hashBuf = PORT_Alloc(bufLen);
  ------------------
  |  |   52|      0|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  133|      0|        if (!hashBuf) {
  ------------------
  |  Branch (133:13): [True: 0, False: 0]
  ------------------
  134|      0|            return SECFailure;
  135|      0|        }
  136|      0|    }
  137|       |
  138|  1.27k|    memcpy(hashBuf, client_rand, SSL3_RANDOM_LENGTH);
  ------------------
  |  |   24|  1.27k|#define SSL3_RANDOM_LENGTH 32
  ------------------
  139|  1.27k|    pBuf = hashBuf + SSL3_RANDOM_LENGTH;
  ------------------
  |  |   24|  1.27k|#define SSL3_RANDOM_LENGTH 32
  ------------------
  140|  1.27k|    memcpy(pBuf, server_rand, SSL3_RANDOM_LENGTH);
  ------------------
  |  |   24|  1.27k|#define SSL3_RANDOM_LENGTH 32
  ------------------
  141|  1.27k|    pBuf += SSL3_RANDOM_LENGTH;
  ------------------
  |  |   24|  1.27k|#define SSL3_RANDOM_LENGTH 32
  ------------------
  142|  1.27k|    memcpy(pBuf, ec_params.data, ec_params.len);
  143|  1.27k|    pBuf += ec_params.len;
  144|  1.27k|    pBuf[0] = (PRUint8)(server_ecpoint.len);
  145|  1.27k|    pBuf += 1;
  146|  1.27k|    memcpy(pBuf, server_ecpoint.data, server_ecpoint.len);
  147|  1.27k|    pBuf += server_ecpoint.len;
  148|  1.27k|    PORT_Assert((unsigned int)(pBuf - hashBuf) == bufLen);
  ------------------
  |  |  120|  1.27k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.27k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.27k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|       |
  150|  1.27k|    rv = ssl3_ComputeCommonKeyHash(hashAlg, hashBuf, bufLen, hashes);
  151|       |
  152|  1.27k|    PRINT_BUF(95, (NULL, "ECDHkey hash: ", hashBuf, bufLen));
  ------------------
  |  |   74|  1.27k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.27k]
  |  |  ------------------
  |  |   75|  1.27k|    ssl_PrintBuf b
  ------------------
  153|  1.27k|    PRINT_BUF(95, (NULL, "ECDHkey hash: MD5 result",
  ------------------
  |  |   74|  1.27k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.27k]
  |  |  ------------------
  |  |   75|  1.27k|    ssl_PrintBuf b
  ------------------
  154|  1.27k|                   hashes->u.s.md5, MD5_LENGTH));
  155|  1.27k|    PRINT_BUF(95, (NULL, "ECDHkey hash: SHA1 result",
  ------------------
  |  |   74|  1.27k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.27k]
  |  |  ------------------
  |  |   75|  1.27k|    ssl_PrintBuf b
  ------------------
  156|  1.27k|                   hashes->u.s.sha, SHA1_LENGTH));
  157|       |
  158|  1.27k|    if (hashBuf != buf)
  ------------------
  |  Branch (158:9): [True: 0, False: 1.27k]
  ------------------
  159|      0|        PORT_Free(hashBuf);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  160|  1.27k|    return rv;
  161|  1.27k|}
ssl3ecc.c:ssl_IsSuiteEnabled:
  855|  12.1k|{
  856|  12.1k|    const ssl3CipherSuite *suite;
  857|       |
  858|  12.1k|    for (suite = list; *suite; ++suite) {
  ------------------
  |  Branch (858:24): [True: 12.1k, False: 0]
  ------------------
  859|  12.1k|        PRBool enabled = PR_FALSE;
  ------------------
  |  |  438|  12.1k|#define PR_FALSE 0
  ------------------
  860|  12.1k|        SECStatus rv = ssl3_CipherPrefGet(ss, *suite, &enabled);
  861|       |
  862|  12.1k|        PORT_Assert(rv == SECSuccess); /* else is coding error */
  ------------------
  |  |  120|  12.1k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  12.1k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 12.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  863|  12.1k|        if (rv == SECSuccess && enabled)
  ------------------
  |  Branch (863:13): [True: 12.1k, False: 0]
  |  Branch (863:33): [True: 12.1k, False: 0]
  ------------------
  864|  12.1k|            return PR_TRUE;
  ------------------
  |  |  437|  12.1k|#define PR_TRUE 1
  ------------------
  865|  12.1k|    }
  866|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  867|  12.1k|}

ssl_FindCustomExtensionHooks:
  294|   247k|{
  295|   247k|    PRCList *cursor;
  296|       |
  297|   247k|    for (cursor = PR_NEXT_LINK(&ss->extensionHooks);
  ------------------
  |  |   47|   247k|        ((_e)->next)
  ------------------
  298|   247k|         cursor != &ss->extensionHooks;
  ------------------
  |  Branch (298:10): [True: 0, False: 247k]
  ------------------
  299|   247k|         cursor = PR_NEXT_LINK(cursor)) {
  ------------------
  |  |   47|      0|        ((_e)->next)
  ------------------
  300|      0|        sslCustomExtensionHooks *hook = (sslCustomExtensionHooks *)cursor;
  301|      0|        if (hook->type == extension) {
  ------------------
  |  Branch (301:13): [True: 0, False: 0]
  ------------------
  302|      0|            return hook;
  303|      0|        }
  304|      0|    }
  305|       |
  306|   247k|    return NULL;
  307|   247k|}
ssl3_ExtensionNegotiated:
  322|  22.5k|{
  323|  22.5k|    const TLSExtensionData *xtnData = &ss->xtnData;
  324|  22.5k|    return arrayContainsExtension(xtnData->negotiated,
  325|  22.5k|                                  xtnData->numNegotiated, ex_type);
  326|  22.5k|}
ssl3_ExtensionAdvertised:
  333|  45.1k|{
  334|  45.1k|    const TLSExtensionData *xtnData = &ss->xtnData;
  335|  45.1k|    return arrayContainsExtension(xtnData->advertised,
  336|  45.1k|                                  xtnData->numAdvertised, ex_type);
  337|  45.1k|}
ssl3_ParseExtensions:
  356|  3.60k|{
  357|       |    /* Clean out the extensions list. */
  358|  3.60k|    ssl3_DestroyRemoteExtensions(&ss->ssl3.hs.remoteExtensions);
  359|       |
  360|  11.3k|    while (*length) {
  ------------------
  |  Branch (360:12): [True: 7.75k, False: 3.56k]
  ------------------
  361|  7.75k|        SECStatus rv;
  362|  7.75k|        PRUint32 extension_type;
  363|  7.75k|        SECItem extension_data = { siBuffer, NULL, 0 };
  364|  7.75k|        TLSExtension *extension;
  365|  7.75k|        PRCList *cursor;
  366|       |
  367|       |        /* Get the extension's type field */
  368|  7.75k|        rv = ssl3_ConsumeHandshakeNumber(ss, &extension_type, 2, b, length);
  369|  7.75k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (369:13): [True: 2, False: 7.75k]
  ------------------
  370|      2|            return SECFailure; /* alert already sent */
  371|      2|        }
  372|       |
  373|       |        /* Check whether an extension has been sent multiple times. */
  374|  7.75k|        for (cursor = PR_NEXT_LINK(&ss->ssl3.hs.remoteExtensions);
  ------------------
  |  |   47|  7.75k|        ((_e)->next)
  ------------------
  375|  13.8k|             cursor != &ss->ssl3.hs.remoteExtensions;
  ------------------
  |  Branch (375:14): [True: 6.13k, False: 7.75k]
  ------------------
  376|  7.75k|             cursor = PR_NEXT_LINK(cursor)) {
  ------------------
  |  |   47|  6.13k|        ((_e)->next)
  ------------------
  377|  6.13k|            if (((TLSExtension *)cursor)->type == extension_type) {
  ------------------
  |  Branch (377:17): [True: 3, False: 6.13k]
  ------------------
  378|      3|                (void)SSL3_SendAlert(ss, alert_fatal, illegal_parameter);
  379|      3|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_EXTENSION);
  ------------------
  |  |   65|      3|#define PORT_SetError PORT_SetError_Util
  ------------------
  380|      3|                return SECFailure;
  381|      3|            }
  382|  6.13k|        }
  383|       |
  384|       |        /* Get the data for this extension, so we can pass it or skip it. */
  385|  7.75k|        rv = ssl3_ConsumeHandshakeVariable(ss, &extension_data, 2, b, length);
  386|  7.75k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (386:13): [True: 27, False: 7.72k]
  ------------------
  387|     27|            return rv; /* alert already sent */
  388|     27|        }
  389|       |
  390|  7.72k|        SSL_TRC(10, ("%d: SSL3[%d]: parsed extension %d len=%u",
  ------------------
  |  |   71|  7.72k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 7.72k]
  |  |  ------------------
  |  |   72|  7.72k|    ssl_Trace b
  ------------------
  391|  7.72k|                     SSL_GETPID(), ss->fd, extension_type, extension_data.len));
  392|       |
  393|  7.72k|        extension = PORT_ZNew(TLSExtension);
  ------------------
  |  |  148|  7.72k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  7.72k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  394|  7.72k|        if (!extension) {
  ------------------
  |  Branch (394:13): [True: 0, False: 7.72k]
  ------------------
  395|      0|            return SECFailure;
  396|      0|        }
  397|       |
  398|  7.72k|        extension->type = (PRUint16)extension_type;
  399|  7.72k|        extension->data = extension_data;
  400|  7.72k|        PR_APPEND_LINK(&extension->link, &ss->ssl3.hs.remoteExtensions);
  ------------------
  |  |   57|  7.72k|#define PR_APPEND_LINK(_e,_l) PR_INSERT_BEFORE(_e,_l)
  |  |  ------------------
  |  |  |  |   25|  7.72k|    PR_BEGIN_MACRO       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  7.72k|#define PR_BEGIN_MACRO  do {
  |  |  |  |  ------------------
  |  |  |  |   26|  7.72k|    (_e)->next = (_l);   \
  |  |  |  |   27|  7.72k|    (_e)->prev = (_l)->prev; \
  |  |  |  |   28|  7.72k|    (_l)->prev->next = (_e); \
  |  |  |  |   29|  7.72k|    (_l)->prev = (_e);   \
  |  |  |  |   30|  7.72k|    PR_END_MACRO
  |  |  |  |  ------------------
  |  |  |  |  |  |  124|  7.72k|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  401|  7.72k|    }
  402|       |
  403|  3.56k|    return SECSuccess;
  404|  3.60k|}
ssl3_FindExtension:
  408|  7.70k|{
  409|  7.70k|    PRCList *cursor;
  410|       |
  411|  7.70k|    for (cursor = PR_NEXT_LINK(&ss->ssl3.hs.remoteExtensions);
  ------------------
  |  |   47|  7.70k|        ((_e)->next)
  ------------------
  412|  13.2k|         cursor != &ss->ssl3.hs.remoteExtensions;
  ------------------
  |  Branch (412:10): [True: 7.58k, False: 5.69k]
  ------------------
  413|  7.70k|         cursor = PR_NEXT_LINK(cursor)) {
  ------------------
  |  |   47|  5.57k|        ((_e)->next)
  ------------------
  414|  7.58k|        TLSExtension *extension = (TLSExtension *)cursor;
  415|       |
  416|  7.58k|        if (extension->type == extension_type) {
  ------------------
  |  Branch (416:13): [True: 2.01k, False: 5.57k]
  ------------------
  417|  2.01k|            return extension;
  418|  2.01k|        }
  419|  7.58k|    }
  420|       |
  421|  5.69k|    return NULL;
  422|  7.70k|}
ssl3_HandleParsedExtensions:
  475|  7.64k|{
  476|  7.64k|    const ssl3ExtensionHandler *handlers;
  477|       |    /* HelloRetryRequest doesn't set ss->version. It might be safe to
  478|       |     * do so, but we weren't entirely sure. TODO(ekr@rtfm.com). */
  479|  7.64k|    PRBool isTLS13 = (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) ||
  ------------------
  |  |   21|  7.64k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (479:22): [True: 1.98k, False: 5.65k]
  ------------------
  480|  7.64k|                     (message == ssl_hs_hello_retry_request);
  ------------------
  |  Branch (480:22): [True: 0, False: 5.65k]
  ------------------
  481|       |    /* The following messages can include extensions that were not included in
  482|       |     * the original ClientHello. */
  483|  7.64k|    PRBool allowNotOffered = (message == ssl_hs_client_hello) ||
  ------------------
  |  Branch (483:30): [True: 0, False: 7.64k]
  ------------------
  484|  7.64k|                             (message == ssl_hs_certificate_request) ||
  ------------------
  |  Branch (484:30): [True: 0, False: 7.64k]
  ------------------
  485|  7.64k|                             (message == ssl_hs_new_session_ticket);
  ------------------
  |  Branch (485:30): [True: 0, False: 7.64k]
  ------------------
  486|  7.64k|    PRCList *cursor;
  487|       |
  488|  7.64k|    switch (message) {
  489|      0|        case ssl_hs_client_hello:
  ------------------
  |  Branch (489:9): [True: 0, False: 7.64k]
  ------------------
  490|      0|            handlers = clientHelloHandlers;
  491|      0|            break;
  492|      0|        case ssl_hs_new_session_ticket:
  ------------------
  |  Branch (492:9): [True: 0, False: 7.64k]
  ------------------
  493|      0|            PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  494|      0|            handlers = newSessionTicketHandlers;
  495|      0|            break;
  496|    997|        case ssl_hs_hello_retry_request:
  ------------------
  |  Branch (496:9): [True: 997, False: 6.64k]
  ------------------
  497|    997|            handlers = helloRetryRequestHandlers;
  498|    997|            break;
  499|      0|        case ssl_hs_encrypted_extensions:
  ------------------
  |  Branch (499:9): [True: 0, False: 7.64k]
  ------------------
  500|      0|            PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  501|       |        /* fall through */
  502|  6.64k|        case ssl_hs_server_hello:
  ------------------
  |  Branch (502:9): [True: 6.64k, False: 997]
  ------------------
  503|  6.64k|            if (ss->version > SSL_LIBRARY_VERSION_3_0) {
  ------------------
  |  |   17|  6.64k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (503:17): [True: 6.64k, False: 0]
  ------------------
  504|  6.64k|                handlers = serverHelloHandlersTLS;
  505|  6.64k|            } else {
  506|      0|                handlers = serverHelloHandlersSSL3;
  507|      0|            }
  508|  6.64k|            break;
  509|      0|        case ssl_hs_certificate:
  ------------------
  |  Branch (509:9): [True: 0, False: 7.64k]
  ------------------
  510|      0|            PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  511|      0|            handlers = serverCertificateHandlers;
  512|      0|            break;
  513|      0|        case ssl_hs_certificate_request:
  ------------------
  |  Branch (513:9): [True: 0, False: 7.64k]
  ------------------
  514|      0|            PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  515|      0|            handlers = certificateRequestHandlers;
  516|      0|            break;
  517|      0|        default:
  ------------------
  |  Branch (517:9): [True: 0, False: 7.64k]
  ------------------
  518|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  519|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  520|      0|            return SECFailure;
  521|  7.64k|    }
  522|       |
  523|  7.64k|    for (cursor = PR_NEXT_LINK(&ss->ssl3.hs.remoteExtensions);
  ------------------
  |  |   47|  7.64k|        ((_e)->next)
  ------------------
  524|  14.9k|         cursor != &ss->ssl3.hs.remoteExtensions;
  ------------------
  |  Branch (524:10): [True: 7.43k, False: 7.48k]
  ------------------
  525|  7.64k|         cursor = PR_NEXT_LINK(cursor)) {
  ------------------
  |  |   47|  7.27k|        ((_e)->next)
  ------------------
  526|  7.43k|        TLSExtension *extension = (TLSExtension *)cursor;
  527|  7.43k|        SECStatus rv;
  528|       |
  529|       |        /* Check whether the server sent an extension which was not advertised
  530|       |         * in the ClientHello.
  531|       |         *
  532|       |         * Note that a TLS 1.3 server should check if CertificateRequest
  533|       |         * extensions were sent.  But the extensions used for CertificateRequest
  534|       |         * do not have any response, so we rely on
  535|       |         * ssl3_ExtensionAdvertised to return false on the server.  That
  536|       |         * results in the server only rejecting any extension. */
  537|  7.43k|        if (!allowNotOffered && (extension->type != ssl_tls13_cookie_xtn)) {
  ------------------
  |  Branch (537:13): [True: 7.43k, False: 0]
  |  Branch (537:33): [True: 6.48k, False: 947]
  ------------------
  538|  6.48k|            if (!ssl3_ExtensionAdvertised(ss, extension->type)) {
  ------------------
  |  Branch (538:17): [True: 31, False: 6.45k]
  ------------------
  539|     31|                SSL_TRC(10, ("Server sent xtn type=%d which is invalid for the CHO", extension->type));
  ------------------
  |  |   71|     31|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 31]
  |  |  ------------------
  |  |   72|     31|    ssl_Trace b
  ------------------
  540|     31|                (void)SSL3_SendAlert(ss, alert_fatal, unsupported_extension);
  541|     31|                PORT_SetError(SSL_ERROR_RX_UNEXPECTED_EXTENSION);
  ------------------
  |  |   65|     31|#define PORT_SetError PORT_SetError_Util
  ------------------
  542|     31|                return SECFailure;
  543|     31|            }
  544|       |            /* If we offered ECH, we also check whether the extension is compatible with
  545|       |             * the Client Hello Inner. We don't yet know whether the server accepted ECH,
  546|       |             * so we only store this for now. If we later accept, we check this boolean
  547|       |             * and reject with an unsupported_extension alert if it is set. */
  548|  6.45k|            if (ss->ssl3.hs.echHpkeCtx && !ssl3_ExtensionAdvertisedClientHelloInner(ss, extension->type)) {
  ------------------
  |  Branch (548:17): [True: 0, False: 6.45k]
  |  Branch (548:43): [True: 0, False: 0]
  ------------------
  549|      0|                SSL_TRC(10, ("Server sent xtn type=%d which is invalid for the CHI", extension->type));
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  550|      0|                ss->ssl3.hs.echInvalidExtension = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  551|      0|            }
  552|  6.45k|        }
  553|       |
  554|       |        /* Check that this is a legal extension in TLS 1.3 */
  555|  7.40k|        if (isTLS13 &&
  ------------------
  |  Branch (555:13): [True: 4.80k, False: 2.59k]
  ------------------
  556|  7.40k|            !ssl_FindCustomExtensionHooks(ss, extension->type)) {
  ------------------
  |  Branch (556:13): [True: 4.80k, False: 0]
  ------------------
  557|  4.80k|            switch (tls13_ExtensionStatus(extension->type, message)) {
  ------------------
  |  Branch (557:21): [True: 0, False: 4.80k]
  ------------------
  558|  4.79k|                case tls13_extension_allowed:
  ------------------
  |  Branch (558:17): [True: 4.79k, False: 10]
  ------------------
  559|  4.79k|                    break;
  560|      1|                case tls13_extension_unknown:
  ------------------
  |  Branch (560:17): [True: 1, False: 4.80k]
  ------------------
  561|      1|                    if (allowNotOffered) {
  ------------------
  |  Branch (561:25): [True: 0, False: 1]
  ------------------
  562|      0|                        continue; /* Skip over unknown extensions. */
  563|      0|                    }
  564|       |                    /* RFC8446 Section 4.2 - Implementations MUST NOT send extension responses if
  565|       |                     * the remote endpoint did not send the corresponding extension request ...
  566|       |                     * Upon receiving such an extension, an endpoint MUST abort the handshake with
  567|       |                     * an "unsupported_extension" alert. */
  568|      1|                    SSL_TRC(3, ("%d: TLS13: unknown extension %d in message %d",
  ------------------
  |  |   71|      1|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   72|      1|    ssl_Trace b
  ------------------
  569|      1|                                SSL_GETPID(), extension, message));
  570|      1|                    tls13_FatalError(ss, SSL_ERROR_RX_UNEXPECTED_EXTENSION,
  571|      1|                                     unsupported_extension);
  572|      1|                    return SECFailure;
  573|      9|                case tls13_extension_disallowed:
  ------------------
  |  Branch (573:17): [True: 9, False: 4.79k]
  ------------------
  574|       |                    /* RFC8446 Section 4.2 - If an implementation receives an extension which it
  575|       |                     * recognizes and which is not specified for the message in which it appears,
  576|       |                     * it MUST abort the handshake with an "illegal_parameter" alert. */
  577|      9|                    SSL_TRC(3, ("%d: TLS13: disallowed extension %d in message %d",
  ------------------
  |  |   71|      9|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 9]
  |  |  ------------------
  |  |   72|      9|    ssl_Trace b
  ------------------
  578|      9|                                SSL_GETPID(), extension, message));
  579|      9|                    tls13_FatalError(ss, SSL_ERROR_EXTENSION_DISALLOWED_FOR_VERSION,
  580|      9|                                     illegal_parameter);
  581|      9|                    return SECFailure;
  582|  4.80k|            }
  583|  4.80k|        }
  584|       |
  585|       |        /* Special check for this being the last extension if it's
  586|       |         * PreSharedKey */
  587|  7.39k|        if (ss->sec.isServer && isTLS13 &&
  ------------------
  |  Branch (587:13): [True: 0, False: 7.39k]
  |  Branch (587:33): [True: 0, False: 0]
  ------------------
  588|  7.39k|            (extension->type == ssl_tls13_pre_shared_key_xtn) &&
  ------------------
  |  Branch (588:13): [True: 0, False: 0]
  ------------------
  589|  7.39k|            (PR_NEXT_LINK(cursor) != &ss->ssl3.hs.remoteExtensions)) {
  ------------------
  |  |   47|      0|        ((_e)->next)
  ------------------
  |  Branch (589:13): [True: 0, False: 0]
  ------------------
  590|      0|            tls13_FatalError(ss,
  591|      0|                             SSL_ERROR_RX_MALFORMED_CLIENT_HELLO,
  592|      0|                             illegal_parameter);
  593|      0|            return SECFailure;
  594|      0|        }
  595|       |
  596|  7.39k|        rv = ssl_CallExtensionHandler(ss, message, extension, handlers);
  597|  7.39k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (597:13): [True: 120, False: 7.27k]
  ------------------
  598|    120|            return SECFailure;
  599|    120|        }
  600|  7.39k|    }
  601|  7.48k|    return SECSuccess;
  602|  7.64k|}
ssl_ConstructExtensions:
  760|  10.2k|{
  761|  10.2k|    const sslExtensionBuilder *sender;
  762|  10.2k|    SECStatus rv;
  763|       |
  764|  10.2k|    PORT_Assert(buf->len == 0);
  ------------------
  |  |  120|  10.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  765|       |
  766|       |    /* Clear out any extensions previously advertised */
  767|  10.2k|    ss->xtnData.numAdvertised = 0;
  768|  10.2k|    ss->xtnData.echNumAdvertised = 0;
  769|       |
  770|  10.2k|    switch (message) {
  771|  10.2k|        case ssl_hs_client_hello:
  ------------------
  |  Branch (771:9): [True: 10.2k, False: 0]
  ------------------
  772|  10.2k|            if (ss->vrange.max > SSL_LIBRARY_VERSION_3_0) {
  ------------------
  |  |   17|  10.2k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (772:17): [True: 10.2k, False: 0]
  ------------------
  773|       |                /* Use TLS ClientHello Extension Permutation? */
  774|  10.2k|                if (ss->opt.enableChXtnPermutation) {
  ------------------
  |  Branch (774:21): [True: 5.17k, False: 5.04k]
  ------------------
  775|  5.17k|                    sender = ss->ssl3.hs.chExtensionPermutation;
  776|  5.17k|                } else {
  777|  5.04k|                    sender = clientHelloSendersTLS;
  778|  5.04k|                }
  779|  10.2k|            } else {
  780|      0|                sender = clientHelloSendersSSL3;
  781|      0|            }
  782|  10.2k|            break;
  783|       |
  784|      0|        case ssl_hs_server_hello:
  ------------------
  |  Branch (784:9): [True: 0, False: 10.2k]
  ------------------
  785|      0|            sender = ss->xtnData.serverHelloSenders;
  786|      0|            break;
  787|       |
  788|      0|        case ssl_hs_certificate_request:
  ------------------
  |  Branch (788:9): [True: 0, False: 10.2k]
  ------------------
  789|      0|            PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  790|      0|            sender = tls13_cert_req_senders;
  791|      0|            break;
  792|       |
  793|      0|        case ssl_hs_certificate:
  ------------------
  |  Branch (793:9): [True: 0, False: 10.2k]
  ------------------
  794|      0|            PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  795|      0|            sender = ss->xtnData.certificateSenders;
  796|      0|            break;
  797|       |
  798|      0|        case ssl_hs_encrypted_extensions:
  ------------------
  |  Branch (798:9): [True: 0, False: 10.2k]
  ------------------
  799|      0|            PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  800|      0|            sender = ss->xtnData.encryptedExtensionsSenders;
  801|      0|            break;
  802|       |
  803|      0|        case ssl_hs_hello_retry_request:
  ------------------
  |  Branch (803:9): [True: 0, False: 10.2k]
  ------------------
  804|      0|            PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  805|      0|            sender = tls13_hrr_senders;
  806|      0|            break;
  807|       |
  808|      0|        default:
  ------------------
  |  Branch (808:9): [True: 0, False: 10.2k]
  ------------------
  809|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  810|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  811|      0|            return SECFailure;
  812|  10.2k|    }
  813|       |
  814|   245k|    for (; sender->ex_sender != NULL; ++sender) {
  ------------------
  |  Branch (814:12): [True: 235k, False: 10.2k]
  ------------------
  815|   235k|        PRUint16 ex_type = sender->ex_type;
  816|   235k|        PRBool append = PR_FALSE;
  ------------------
  |  |  438|   235k|#define PR_FALSE 0
  ------------------
  817|   235k|        unsigned int start = buf->len;
  818|   235k|        unsigned int length;
  819|       |
  820|   235k|        if (ssl_FindCustomExtensionHooks(ss, sender->ex_type)) {
  ------------------
  |  Branch (820:13): [True: 0, False: 235k]
  ------------------
  821|      0|            continue;
  822|      0|        }
  823|       |
  824|       |        /* Save space for the extension type and length. Note that we don't grow
  825|       |         * the buffer now; rely on sslBuffer_Append* to do that. */
  826|   235k|        buf->len += 4;
  827|   235k|        rv = (*sender->ex_sender)(ss, &ss->xtnData, buf, &append);
  828|   235k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (828:13): [True: 0, False: 235k]
  ------------------
  829|      0|            goto loser;
  830|      0|        }
  831|       |
  832|       |        /* Save the length and go back to the start. */
  833|   235k|        length = buf->len - start - 4;
  834|   235k|        buf->len = start;
  835|   235k|        if (!append) {
  ------------------
  |  Branch (835:13): [True: 114k, False: 120k]
  ------------------
  836|   114k|            continue;
  837|   114k|        }
  838|       |
  839|       |        /* If TLS 1.3 GREASE is enabled, replace ssl_tls13_grease_xtn dummy
  840|       |         * GREASE extension types with randomly generated GREASE value. */
  841|   120k|        rv = tls13_MaybeGreaseExtensionType(ss, message, &ex_type);
  842|   120k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (842:13): [True: 0, False: 120k]
  ------------------
  843|      0|            goto loser; /* Code already set. */
  844|      0|        }
  845|       |
  846|   120k|        rv = sslBuffer_AppendNumber(buf, ex_type, 2);
  847|   120k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (847:13): [True: 0, False: 120k]
  ------------------
  848|      0|            goto loser; /* Code already set. */
  849|      0|        }
  850|   120k|        rv = sslBuffer_AppendNumber(buf, length, 2);
  851|   120k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (851:13): [True: 0, False: 120k]
  ------------------
  852|      0|            goto loser; /* Code already set. */
  853|      0|        }
  854|       |        /* Skip over the extension body. */
  855|   120k|        buf->len += length;
  856|       |
  857|   120k|        if (message == ssl_hs_client_hello ||
  ------------------
  |  Branch (857:13): [True: 120k, False: 0]
  ------------------
  858|   120k|            message == ssl_hs_certificate_request) {
  ------------------
  |  Branch (858:13): [True: 0, False: 0]
  ------------------
  859|   120k|            ss->xtnData.advertised[ss->xtnData.numAdvertised++] =
  860|   120k|                ex_type;
  861|   120k|        }
  862|   120k|    }
  863|       |
  864|  10.2k|    if (!PR_CLIST_IS_EMPTY(&ss->extensionHooks)) {
  ------------------
  |  |   94|  10.2k|    ((_l)->next == (_l))
  ------------------
  |  Branch (864:9): [True: 0, False: 10.2k]
  ------------------
  865|      0|        if (message == ssl_hs_client_hello && ss->opt.callExtensionWriterOnEchInner) {
  ------------------
  |  Branch (865:13): [True: 0, False: 0]
  |  Branch (865:47): [True: 0, False: 0]
  ------------------
  866|      0|            message = ssl_hs_ech_outer_client_hello;
  867|      0|        }
  868|      0|        rv = ssl_CallCustomExtensionSenders(ss, buf, message);
  869|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (869:13): [True: 0, False: 0]
  ------------------
  870|      0|            goto loser;
  871|      0|        }
  872|      0|    }
  873|       |
  874|  10.2k|    if (buf->len > 0xffff) {
  ------------------
  |  Branch (874:9): [True: 0, False: 10.2k]
  ------------------
  875|      0|        PORT_SetError(SSL_ERROR_TX_RECORD_TOO_LONG);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  876|      0|        goto loser;
  877|      0|    }
  878|       |
  879|  10.2k|    return SECSuccess;
  880|       |
  881|      0|loser:
  882|      0|    sslBuffer_Clear(buf);
  883|      0|    return SECFailure;
  884|  10.2k|}
ssl_InsertPaddingExtension:
  993|  10.2k|{
  994|  10.2k|    static unsigned char padding[252] = { 0 };
  995|  10.2k|    unsigned int paddingLen;
  996|       |    /* Exit early if an application-provided extension hook
  997|       |     * already added padding. */
  998|  10.2k|    if (ssl3_ExtensionAdvertised(ss, ssl_padding_xtn)) {
  ------------------
  |  Branch (998:9): [True: 0, False: 10.2k]
  ------------------
  999|      0|        return SECSuccess;
 1000|      0|    }
 1001|       |
 1002|       |    /* Account for the size of the header, the length field of the extensions
 1003|       |     * block and the size of the existing extensions. */
 1004|  10.2k|    paddingLen = ssl_CalculatePaddingExtLen(ss, prefixLen + 2 + buf->len);
 1005|  10.2k|    if (!paddingLen) {
  ------------------
  |  Branch (1005:9): [True: 10.2k, False: 0]
  ------------------
 1006|  10.2k|        return SECSuccess;
 1007|  10.2k|    }
 1008|       |
 1009|      0|    return ssl3_EmplaceExtension(ss, buf, ssl_padding_xtn, padding, paddingLen, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1010|  10.2k|}
ssl3_DestroyRemoteExtensions:
 1025|  46.6k|{
 1026|  46.6k|    PRCList *cur_p;
 1027|       |
 1028|  54.3k|    while (!PR_CLIST_IS_EMPTY(list)) {
  ------------------
  |  |   94|  54.3k|    ((_l)->next == (_l))
  ------------------
  |  Branch (1028:12): [True: 7.72k, False: 46.6k]
  ------------------
 1029|  7.72k|        cur_p = PR_LIST_TAIL(list);
  ------------------
  |  |   66|  7.72k|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
 1030|  7.72k|        PR_REMOVE_LINK(cur_p);
  ------------------
  |  |   72|  7.72k|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|  7.72k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|  7.72k|    (_e)->prev->next = (_e)->next; \
  |  |   74|  7.72k|    (_e)->next->prev = (_e)->prev; \
  |  |   75|  7.72k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  7.72k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1031|  7.72k|        PORT_Free(cur_p);
  ------------------
  |  |   60|  7.72k|#define PORT_Free PORT_Free_Util
  ------------------
 1032|  7.72k|    }
 1033|  46.6k|}
ssl3_InitExtensionData:
 1038|  36.7k|{
 1039|  36.7k|    unsigned int advertisedMax;
 1040|  36.7k|    PRCList *cursor;
 1041|       |
 1042|       |    /* Set things up to the right starting state. */
 1043|  36.7k|    PORT_Memset(xtnData, 0, sizeof(*xtnData));
  ------------------
  |  |  182|  36.7k|#define PORT_Memset memset
  ------------------
 1044|  36.7k|    xtnData->peerSupportsFfdheGroups = PR_FALSE;
  ------------------
  |  |  438|  36.7k|#define PR_FALSE 0
  ------------------
 1045|  36.7k|    PR_INIT_CLIST(&xtnData->remoteKeyShares);
  ------------------
  |  |  100|  36.7k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  36.7k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  36.7k|    (_l)->next = (_l); \
  |  |  102|  36.7k|    (_l)->prev = (_l); \
  |  |  103|  36.7k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  36.7k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1046|       |
 1047|       |    /* Allocate enough to allow for native extensions, plus any custom ones. */
 1048|  36.7k|    if (ss->sec.isServer) {
  ------------------
  |  Branch (1048:9): [True: 0, False: 36.7k]
  ------------------
 1049|      0|        advertisedMax = PR_MAX(PR_ARRAY_SIZE(certificateRequestHandlers),
  ------------------
  |  |  159|      0|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1050|      0|                               PR_ARRAY_SIZE(tls13_cert_req_senders));
 1051|  36.7k|    } else {
 1052|  36.7k|        advertisedMax = PR_MAX(PR_ARRAY_SIZE(clientHelloHandlers),
  ------------------
  |  |  159|  36.7k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1053|  36.7k|                               PR_ARRAY_SIZE(clientHelloSendersTLS));
 1054|  36.7k|        ++advertisedMax; /* For the RI SCSV, which we also track. */
 1055|  36.7k|    }
 1056|  36.7k|    for (cursor = PR_NEXT_LINK(&ss->extensionHooks);
  ------------------
  |  |   47|  36.7k|        ((_e)->next)
  ------------------
 1057|  36.7k|         cursor != &ss->extensionHooks;
  ------------------
  |  Branch (1057:10): [True: 0, False: 36.7k]
  ------------------
 1058|  36.7k|         cursor = PR_NEXT_LINK(cursor)) {
  ------------------
  |  |   47|      0|        ((_e)->next)
  ------------------
 1059|      0|        ++advertisedMax;
 1060|      0|    }
 1061|  36.7k|    xtnData->advertised = PORT_ZNewArray(PRUint16, advertisedMax);
  ------------------
  |  |  159|  36.7k|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|  36.7k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 1062|  36.7k|    xtnData->echAdvertised = PORT_ZNewArray(PRUint16, advertisedMax);
  ------------------
  |  |  159|  36.7k|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|  36.7k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 1063|       |
 1064|  36.7k|    xtnData->peerDelegCred = NULL;
 1065|  36.7k|    xtnData->peerRequestedDelegCred = PR_FALSE;
  ------------------
  |  |  438|  36.7k|#define PR_FALSE 0
  ------------------
 1066|  36.7k|    xtnData->sendingDelegCredToPeer = PR_FALSE;
  ------------------
  |  |  438|  36.7k|#define PR_FALSE 0
  ------------------
 1067|  36.7k|    xtnData->selectedPsk = NULL;
 1068|  36.7k|}
ssl3_DestroyExtensionData:
 1072|  36.7k|{
 1073|  36.7k|    ssl3_FreeSniNameArray(xtnData);
 1074|  36.7k|    PORT_Free(xtnData->sigSchemes);
  ------------------
  |  |   60|  36.7k|#define PORT_Free PORT_Free_Util
  ------------------
 1075|  36.7k|    PORT_Free(xtnData->delegCredSigSchemes);
  ------------------
  |  |   60|  36.7k|#define PORT_Free PORT_Free_Util
  ------------------
 1076|  36.7k|    PORT_Free(xtnData->delegCredSigSchemesAdvertised);
  ------------------
  |  |   60|  36.7k|#define PORT_Free PORT_Free_Util
  ------------------
 1077|  36.7k|    SECITEM_FreeItem(&xtnData->nextProto, PR_FALSE);
  ------------------
  |  |  108|  36.7k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&xtnData->nextProto, PR_FALSE);
  ------------------
  |  |  438|  36.7k|#define PR_FALSE 0
  ------------------
 1078|  36.7k|    tls13_DestroyKeyShares(&xtnData->remoteKeyShares);
 1079|  36.7k|    SECITEM_FreeItem(&xtnData->certReqContext, PR_FALSE);
  ------------------
  |  |  108|  36.7k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&xtnData->certReqContext, PR_FALSE);
  ------------------
  |  |  438|  36.7k|#define PR_FALSE 0
  ------------------
 1080|  36.7k|    SECITEM_FreeItem(&xtnData->applicationToken, PR_FALSE);
  ------------------
  |  |  108|  36.7k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&xtnData->applicationToken, PR_FALSE);
  ------------------
  |  |  438|  36.7k|#define PR_FALSE 0
  ------------------
 1081|  36.7k|    if (xtnData->certReqAuthorities.arena) {
  ------------------
  |  Branch (1081:9): [True: 0, False: 36.7k]
  ------------------
 1082|      0|        PORT_FreeArena(xtnData->certReqAuthorities.arena, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(xtnData->certReqAuthorities.arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1083|      0|        xtnData->certReqAuthorities.arena = NULL;
 1084|      0|    }
 1085|  36.7k|    PORT_Free(xtnData->advertised);
  ------------------
  |  |   60|  36.7k|#define PORT_Free PORT_Free_Util
  ------------------
 1086|  36.7k|    PORT_Free(xtnData->echAdvertised);
  ------------------
  |  |   60|  36.7k|#define PORT_Free PORT_Free_Util
  ------------------
 1087|  36.7k|    tls13_DestroyDelegatedCredential(xtnData->peerDelegCred);
 1088|       |
 1089|  36.7k|    tls13_DestroyEchXtnState(xtnData->ech);
 1090|  36.7k|    xtnData->ech = NULL;
 1091|  36.7k|}
ssl3_ResetExtensionData:
 1097|  27.9k|{
 1098|  27.9k|    ssl3_DestroyExtensionData(xtnData);
 1099|  27.9k|    ssl3_InitExtensionData(xtnData, ss);
 1100|  27.9k|}
ssl3_ExtSendAlert:
 1106|     95|{
 1107|     95|    (void)SSL3_SendAlert((sslSocket *)ss, level, desc);
 1108|     95|}
ssl3_ExtDecodeError:
 1112|      5|{
 1113|      5|    (void)ssl3_DecodeError((sslSocket *)ss);
 1114|      5|}
ssl3_ExtConsumeHandshakeNumber:
 1126|  23.7k|{
 1127|  23.7k|    return ssl3_ConsumeHandshakeNumber((sslSocket *)ss, num, bytes, b, length);
 1128|  23.7k|}
ssl3_ExtConsumeHandshakeVariable:
 1134|  1.09k|{
 1135|  1.09k|    return ssl3_ConsumeHandshakeVariable((sslSocket *)ss, i, bytes, b, length);
 1136|  1.09k|}
tls_ClientHelloExtensionPermutationSetup:
 1140|  4.48k|{
 1141|  4.48k|    size_t buildersLen = PR_ARRAY_SIZE(clientHelloSendersTLS);
  ------------------
  |  |  167|  4.48k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
 1142|  4.48k|    const size_t buildersSize = (sizeof(sslExtensionBuilder) * buildersLen);
 1143|       |    /* Psk Extension and then NULL entry MUST be last. */
 1144|  4.48k|    const size_t permutationLen = buildersLen - 2;
 1145|       |
 1146|       |    /* There shouldn't already be a stored permutation. */
 1147|  4.48k|    PR_ASSERT(!ss->ssl3.hs.chExtensionPermutation);
  ------------------
  |  |  208|  4.48k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 4.48k, False: 0]
  |  |  ------------------
  ------------------
 1148|       |
 1149|       |    /* This shuffle handles up to 256 extensions. */
 1150|  4.48k|    PR_ASSERT(buildersLen < 256);
  ------------------
  |  |  208|  4.48k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 4.48k, False: 0]
  |  |  ------------------
  ------------------
 1151|  4.48k|    uint8_t permutation[256] = { 0 };
 1152|       |
 1153|  4.48k|    sslExtensionBuilder *builders = PORT_ZAlloc(buildersSize);
  ------------------
  |  |   72|  4.48k|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
 1154|  4.48k|    if (!builders) {
  ------------------
  |  Branch (1154:9): [True: 0, False: 4.48k]
  ------------------
 1155|      0|        return SECFailure;
 1156|      0|    }
 1157|       |
 1158|       |    /* Get a working copy of default builders. */
 1159|  4.48k|    PORT_Memcpy(builders, clientHelloSendersTLS, buildersSize);
  ------------------
  |  |  180|  4.48k|#define PORT_Memcpy memcpy
  ------------------
 1160|       |
 1161|       |    /* Get permutation randoms. */
 1162|  4.48k|    if (PK11_GenerateRandom(permutation, permutationLen) != SECSuccess) {
  ------------------
  |  Branch (1162:9): [True: 0, False: 4.48k]
  ------------------
 1163|      0|        PORT_Free(builders);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1164|      0|        return SECFailure;
 1165|      0|    }
 1166|       |
 1167|       |    /* Fisher-Yates Shuffle */
 1168|  98.6k|    for (size_t i = permutationLen - 1; i > 0; i--) {
  ------------------
  |  Branch (1168:41): [True: 94.1k, False: 4.48k]
  ------------------
 1169|  94.1k|        size_t idx = permutation[i - 1] % (i + 1);
 1170|  94.1k|        sslExtensionBuilder tmp = builders[i];
 1171|  94.1k|        builders[i] = builders[idx];
 1172|  94.1k|        builders[idx] = tmp;
 1173|  94.1k|    }
 1174|       |
 1175|       |    /* Make sure that Psk extension is penultimate (before NULL entry). */
 1176|  4.48k|    PR_ASSERT(builders[buildersLen - 2].ex_type == ssl_tls13_pre_shared_key_xtn);
  ------------------
  |  |  208|  4.48k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 4.48k, False: 0]
  |  |  ------------------
  ------------------
 1177|  4.48k|    PR_ASSERT(builders[buildersLen - 2].ex_sender == clientHelloSendersTLS[buildersLen - 2].ex_sender);
  ------------------
  |  |  208|  4.48k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 4.48k, False: 0]
  |  |  ------------------
  ------------------
 1178|       |
 1179|  4.48k|    ss->ssl3.hs.chExtensionPermutation = builders;
 1180|  4.48k|    return SECSuccess;
 1181|  4.48k|}
tls_ClientHelloExtensionPermutationDestroy:
 1185|  17.7k|{
 1186|  17.7k|    if (ss->ssl3.hs.chExtensionPermutation) {
  ------------------
  |  Branch (1186:9): [True: 4.48k, False: 13.2k]
  ------------------
 1187|  4.48k|        PORT_Free(ss->ssl3.hs.chExtensionPermutation);
  ------------------
  |  |   60|  4.48k|#define PORT_Free PORT_Free_Util
  ------------------
 1188|  4.48k|        ss->ssl3.hs.chExtensionPermutation = NULL;
 1189|  4.48k|    }
 1190|  17.7k|}
ssl3ext.c:arrayContainsExtension:
  311|  67.6k|{
  312|  67.6k|    unsigned int i;
  313|   468k|    for (i = 0; i < len; i++) {
  ------------------
  |  Branch (313:17): [True: 417k, False: 51.2k]
  ------------------
  314|   417k|        if (ex_type == array[i])
  ------------------
  |  Branch (314:13): [True: 16.4k, False: 401k]
  ------------------
  315|  16.4k|            return PR_TRUE;
  ------------------
  |  |  437|  16.4k|#define PR_TRUE 1
  ------------------
  316|   417k|    }
  317|  51.2k|    return PR_FALSE;
  ------------------
  |  |  438|  51.2k|#define PR_FALSE 0
  ------------------
  318|  67.6k|}
ssl3ext.c:ssl_CallExtensionHandler:
  428|  7.39k|{
  429|  7.39k|    SECStatus rv = SECSuccess;
  430|  7.39k|    SSLAlertDescription alert = handshake_failure;
  431|  7.39k|    sslCustomExtensionHooks *customHooks;
  432|       |
  433|  7.39k|    customHooks = ssl_FindCustomExtensionHooks(ss, extension->type);
  434|  7.39k|    if (customHooks) {
  ------------------
  |  Branch (434:9): [True: 0, False: 7.39k]
  ------------------
  435|      0|        if (customHooks->handler) {
  ------------------
  |  Branch (435:13): [True: 0, False: 0]
  ------------------
  436|      0|            rv = customHooks->handler(ss->fd, handshakeMessage,
  437|      0|                                      extension->data.data,
  438|      0|                                      extension->data.len,
  439|      0|                                      &alert, customHooks->handlerArg);
  440|      0|        }
  441|  7.39k|    } else {
  442|       |        /* Find extension_type in table of Hello Extension Handlers. */
  443|  41.0k|        for (; handler->ex_handler != NULL; ++handler) {
  ------------------
  |  Branch (443:16): [True: 38.8k, False: 2.22k]
  ------------------
  444|  38.8k|            if (handler->ex_type == extension->type) {
  ------------------
  |  Branch (444:17): [True: 5.16k, False: 33.6k]
  ------------------
  445|  5.16k|                SECItem tmp = extension->data;
  446|       |
  447|  5.16k|                rv = (*handler->ex_handler)(ss, &ss->xtnData, &tmp);
  448|  5.16k|                break;
  449|  5.16k|            }
  450|  38.8k|        }
  451|  7.39k|    }
  452|       |
  453|  7.39k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (453:9): [True: 120, False: 7.27k]
  ------------------
  454|    120|        if (!ss->ssl3.fatalAlertSent) {
  ------------------
  |  Branch (454:13): [True: 14, False: 106]
  ------------------
  455|       |            /* Send an alert if the handler didn't already. */
  456|     14|            (void)SSL3_SendAlert(ss, alert_fatal, alert);
  457|     14|        }
  458|    120|        return SECFailure;
  459|    120|    }
  460|       |
  461|  7.27k|    return SECSuccess;
  462|  7.39k|}
ssl3ext.c:ssl_CalculatePaddingExtLen:
  901|  10.2k|{
  902|  10.2k|    unsigned int extensionLen;
  903|       |
  904|       |    /* Don't pad for DTLS, for SSLv3, or for renegotiation. */
  905|  10.2k|    if (IS_DTLS(ss) ||
  ------------------
  |  |  892|  20.4k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
  906|  10.2k|        ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_0 ||
  ------------------
  |  |   18|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_0             0x0301
  ------------------
  |  Branch (906:9): [True: 0, False: 0]
  ------------------
  907|  10.2k|        ss->firstHsDone) {
  ------------------
  |  Branch (907:9): [True: 0, False: 0]
  ------------------
  908|  10.2k|        return 0;
  909|  10.2k|    }
  910|       |
  911|       |    /* A padding extension may be included to ensure that the record containing
  912|       |     * the ClientHello doesn't have a length between 256 and 511 bytes
  913|       |     * (inclusive). Initial ClientHello records with such lengths trigger bugs
  914|       |     * in F5 devices. */
  915|      0|    if (clientHelloLength < 256 || clientHelloLength >= 512) {
  ------------------
  |  Branch (915:9): [True: 0, False: 0]
  |  Branch (915:36): [True: 0, False: 0]
  ------------------
  916|      0|        return 0;
  917|      0|    }
  918|       |
  919|      0|    extensionLen = 512 - clientHelloLength;
  920|       |    /* Extensions take at least four bytes to encode. Always include at least
  921|       |     * one byte of data if we are padding. Some servers will time out or
  922|       |     * terminate the connection if the last ClientHello extension is empty. */
  923|      0|    if (extensionLen < 5) {
  ------------------
  |  Branch (923:9): [True: 0, False: 0]
  ------------------
  924|      0|        extensionLen = 5;
  925|      0|    }
  926|       |
  927|      0|    return extensionLen - 4;
  928|      0|}

ssl_ShouldSendSNIExtension:
   23|  10.2k|{
   24|  10.2k|    PRNetAddr netAddr;
   25|       |
   26|       |    /* must have a hostname */
   27|  10.2k|    if (!url || !url[0]) {
  ------------------
  |  Branch (27:9): [True: 0, False: 10.2k]
  |  Branch (27:17): [True: 0, False: 10.2k]
  ------------------
   28|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
   29|      0|    }
   30|       |    /* must not be an IPv4 or IPv6 address */
   31|  10.2k|    if (PR_SUCCESS == PR_StringToNetAddr(url, &netAddr)) {
  ------------------
  |  Branch (31:9): [True: 0, False: 10.2k]
  ------------------
   32|       |        /* is an IP address (v4 or v6) */
   33|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
   34|      0|    }
   35|       |
   36|  10.2k|    return PR_TRUE;
  ------------------
  |  |  437|  10.2k|#define PR_TRUE 1
  ------------------
   37|  10.2k|}
ssl3_ClientFormatServerNameXtn:
   47|  10.2k|{
   48|  10.2k|    SECStatus rv;
   49|       |
   50|       |    /* length of server_name_list */
   51|  10.2k|    rv = sslBuffer_AppendNumber(buf, len + 3, 2);
   52|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (52:9): [True: 0, False: 10.2k]
  ------------------
   53|      0|        return SECFailure;
   54|      0|    }
   55|       |    /* Name Type (sni_host_name) */
   56|  10.2k|    rv = sslBuffer_AppendNumber(buf, 0, 1);
   57|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (57:9): [True: 0, False: 10.2k]
  ------------------
   58|      0|        return SECFailure;
   59|      0|    }
   60|       |    /* HostName (length and value) */
   61|  10.2k|    rv = sslBuffer_AppendVariable(buf, (const PRUint8 *)url, len, 2);
   62|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (62:9): [True: 0, False: 10.2k]
  ------------------
   63|      0|        return SECFailure;
   64|      0|    }
   65|       |
   66|  10.2k|    return SECSuccess;
   67|  10.2k|}
ssl3_ClientSendServerNameXtn:
   72|  10.2k|{
   73|  10.2k|    SECStatus rv;
   74|       |
   75|  10.2k|    const char *url = ss->url;
   76|       |
   77|  10.2k|    if (!ssl_ShouldSendSNIExtension(ss, url)) {
  ------------------
  |  Branch (77:9): [True: 0, False: 10.2k]
  ------------------
   78|      0|        return SECSuccess;
   79|      0|    }
   80|       |
   81|       |    /* If ECH, write the public name. The real server name
   82|       |     * is emplaced while constructing CHInner extensions. */
   83|  10.2k|    sslEchConfig *cfg = (sslEchConfig *)PR_LIST_HEAD(&ss->echConfigs);
  ------------------
  |  |   65|  10.2k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
   84|  10.2k|    const char *sniContents = PR_CLIST_IS_EMPTY(&ss->echConfigs) ? url : cfg->contents.publicName;
  ------------------
  |  |   94|  10.2k|    ((_l)->next == (_l))
  |  |  ------------------
  |  |  |  Branch (94:5): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
   85|  10.2k|    rv = ssl3_ClientFormatServerNameXtn(ss, sniContents, strlen(sniContents), xtnData, buf);
   86|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (86:9): [True: 0, False: 10.2k]
  ------------------
   87|      0|        return SECFailure;
   88|      0|    }
   89|       |
   90|  10.2k|    *added = PR_TRUE;
  ------------------
  |  |  437|  10.2k|#define PR_TRUE 1
  ------------------
   91|  10.2k|    return SECSuccess;
   92|  10.2k|}
ssl3_HandleServerNameXtn:
   97|    463|{
   98|    463|    SECItem *names = NULL;
   99|    463|    PRUint32 listLenBytes = 0;
  100|    463|    SECStatus rv;
  101|       |
  102|    463|    if (!ss->sec.isServer) {
  ------------------
  |  Branch (102:9): [True: 463, False: 0]
  ------------------
  103|    463|        return SECSuccess; /* ignore extension */
  104|    463|    }
  105|       |
  106|       |    /* Server side - consume client data and register server sender. */
  107|       |    /* do not parse the data if don't have user extension handling function. */
  108|      0|    if (!ss->sniSocketConfig) {
  ------------------
  |  Branch (108:9): [True: 0, False: 0]
  ------------------
  109|      0|        return SECSuccess;
  110|      0|    }
  111|       |
  112|       |    /* length of server_name_list */
  113|      0|    rv = ssl3_ExtConsumeHandshakeNumber(ss, &listLenBytes, 2, &data->data, &data->len);
  114|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (114:9): [True: 0, False: 0]
  ------------------
  115|      0|        goto loser; /* alert already sent */
  116|      0|    }
  117|      0|    if (listLenBytes == 0 || listLenBytes != data->len) {
  ------------------
  |  Branch (117:9): [True: 0, False: 0]
  |  Branch (117:30): [True: 0, False: 0]
  ------------------
  118|      0|        goto alert_loser;
  119|      0|    }
  120|       |
  121|       |    /* Read ServerNameList. */
  122|      0|    while (data->len > 0) {
  ------------------
  |  Branch (122:12): [True: 0, False: 0]
  ------------------
  123|      0|        SECItem tmp;
  124|      0|        PRUint32 type;
  125|       |
  126|       |        /* Read Name Type. */
  127|      0|        rv = ssl3_ExtConsumeHandshakeNumber(ss, &type, 1, &data->data, &data->len);
  128|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (128:13): [True: 0, False: 0]
  ------------------
  129|       |            /* alert sent in ConsumeHandshakeNumber */
  130|      0|            goto loser;
  131|      0|        }
  132|       |
  133|       |        /* Read ServerName (length and value). */
  134|      0|        rv = ssl3_ExtConsumeHandshakeVariable(ss, &tmp, 2, &data->data, &data->len);
  135|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (135:13): [True: 0, False: 0]
  ------------------
  136|      0|            goto loser;
  137|      0|        }
  138|       |
  139|       |        /* Record the value for host_name(0). */
  140|      0|        if (type == sni_nametype_hostname) {
  ------------------
  |  Branch (140:13): [True: 0, False: 0]
  ------------------
  141|       |            /* Fail if we encounter a second host_name entry. */
  142|      0|            if (names) {
  ------------------
  |  Branch (142:17): [True: 0, False: 0]
  ------------------
  143|      0|                goto alert_loser;
  144|      0|            }
  145|       |
  146|       |            /* Create an array for the only supported NameType. */
  147|      0|            names = PORT_ZNewArray(SECItem, 1);
  ------------------
  |  |  159|      0|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  148|      0|            if (!names) {
  ------------------
  |  Branch (148:17): [True: 0, False: 0]
  ------------------
  149|      0|                goto loser;
  150|      0|            }
  151|       |
  152|       |            /* Copy ServerName into the array. */
  153|      0|            if (SECITEM_CopyItem(NULL, &names[0], &tmp) != SECSuccess) {
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  |  Branch (153:17): [True: 0, False: 0]
  ------------------
  154|      0|                goto loser;
  155|      0|            }
  156|      0|        }
  157|       |
  158|       |        /* Even if we don't support NameTypes other than host_name at the
  159|       |         * moment, we continue parsing the whole list to check its validity.
  160|       |         * We do not check for duplicate entries with NameType != host_name(0).
  161|       |         */
  162|      0|    }
  163|      0|    if (names) {
  ------------------
  |  Branch (163:9): [True: 0, False: 0]
  ------------------
  164|       |        /* Free old and set the new data. */
  165|      0|        ssl3_FreeSniNameArray(xtnData);
  166|      0|        xtnData->sniNameArr = names;
  167|      0|        xtnData->sniNameArrSize = 1;
  168|      0|        xtnData->negotiated[xtnData->numNegotiated++] = ssl_server_name_xtn;
  169|      0|    }
  170|      0|    return SECSuccess;
  171|       |
  172|      0|alert_loser:
  173|      0|    ssl3_ExtDecodeError(ss);
  174|      0|loser:
  175|      0|    if (names) {
  ------------------
  |  Branch (175:9): [True: 0, False: 0]
  ------------------
  176|      0|        PORT_Free(names);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  177|      0|    }
  178|      0|    return SECFailure;
  179|      0|}
ssl3_FreeSniNameArray:
  184|  45.6k|{
  185|  45.6k|    PRUint32 i;
  186|       |
  187|  45.6k|    if (!xtnData->sniNameArr) {
  ------------------
  |  Branch (187:9): [True: 45.6k, False: 0]
  ------------------
  188|  45.6k|        return;
  189|  45.6k|    }
  190|       |
  191|      0|    for (i = 0; i < xtnData->sniNameArrSize; i++) {
  ------------------
  |  Branch (191:17): [True: 0, False: 0]
  ------------------
  192|      0|        SECITEM_FreeItem(&xtnData->sniNameArr[i], PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(&xtnData->sniNameArr[i], PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  193|      0|    }
  194|       |
  195|      0|    PORT_Free(xtnData->sniNameArr);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  196|      0|    xtnData->sniNameArr = NULL;
  197|      0|    xtnData->sniNameArrSize = 0;
  198|      0|}
ssl3_ClientSendSessionTicketXtn:
  207|  10.2k|{
  208|  10.2k|    NewSessionTicket *session_ticket = NULL;
  209|  10.2k|    sslSessionID *sid = ss->sec.ci.sid;
  210|  10.2k|    SECStatus rv;
  211|       |
  212|  10.2k|    PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|  10.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  213|       |
  214|       |    /* Never send an extension with a ticket for TLS 1.3, but
  215|       |     * OK to send the empty one in case the server does 1.2. */
  216|  10.2k|    if ((sid->cached == in_client_cache || sid->cached == in_external_cache) &&
  ------------------
  |  Branch (216:10): [True: 0, False: 10.2k]
  |  Branch (216:44): [True: 0, False: 10.2k]
  ------------------
  217|  10.2k|        sid->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (217:9): [True: 0, False: 0]
  ------------------
  218|      0|        return SECSuccess;
  219|      0|    }
  220|       |
  221|       |    /* Ignore the SessionTicket extension if processing is disabled. */
  222|  10.2k|    if (!ss->opt.enableSessionTickets) {
  ------------------
  |  Branch (222:9): [True: 5.19k, False: 5.02k]
  ------------------
  223|  5.19k|        return SECSuccess;
  224|  5.19k|    }
  225|       |
  226|       |    /* Send a session ticket if one is available.
  227|       |     *
  228|       |     * The caller must be holding sid->u.ssl3.lock for reading. We cannot
  229|       |     * just acquire and release the lock within this function because the
  230|       |     * caller will call this function twice, and we need the inputs to be
  231|       |     * consistent between the two calls. Note that currently the caller
  232|       |     * will only be holding the lock when we are the client and when we're
  233|       |     * attempting to resume an existing session.
  234|       |     */
  235|  5.02k|    session_ticket = &sid->u.ssl3.locked.sessionTicket;
  236|  5.02k|    if (session_ticket->ticket.data &&
  ------------------
  |  Branch (236:9): [True: 0, False: 5.02k]
  ------------------
  237|  5.02k|        (xtnData->ticketTimestampVerified ||
  ------------------
  |  Branch (237:10): [True: 0, False: 0]
  ------------------
  238|      0|         ssl_TicketTimeValid(ss, session_ticket))) {
  ------------------
  |  Branch (238:10): [True: 0, False: 0]
  ------------------
  239|       |
  240|      0|        xtnData->ticketTimestampVerified = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  241|       |
  242|      0|        rv = sslBuffer_Append(buf, session_ticket->ticket.data,
  243|      0|                              session_ticket->ticket.len);
  244|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (244:13): [True: 0, False: 0]
  ------------------
  245|      0|            return SECFailure;
  246|      0|        }
  247|       |
  248|      0|        xtnData->sentSessionTicketInClientHello = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  249|      0|    }
  250|       |
  251|  5.02k|    *added = PR_TRUE;
  ------------------
  |  |  437|  5.02k|#define PR_TRUE 1
  ------------------
  252|  5.02k|    return SECSuccess;
  253|  5.02k|}
ssl3_ClientSendAppProtoXtn:
  457|  10.2k|{
  458|  10.2k|    SECStatus rv;
  459|       |
  460|       |    /* Renegotiations do not send this extension. */
  461|  10.2k|    if (!ss->opt.enableALPN || !ss->opt.nextProtoNego.len || ss->firstHsDone) {
  ------------------
  |  Branch (461:9): [True: 5.22k, False: 4.99k]
  |  Branch (461:32): [True: 4.99k, False: 0]
  |  Branch (461:62): [True: 0, False: 0]
  ------------------
  462|  10.2k|        PR_ASSERT(!ss->opt.nextProtoNego.data);
  ------------------
  |  |  208|  10.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
  463|  10.2k|        return SECSuccess;
  464|  10.2k|    }
  465|      0|    PRBool addGrease = ss->opt.enableGrease && ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (465:24): [True: 0, False: 0]
  |  Branch (465:48): [True: 0, False: 0]
  ------------------
  466|       |
  467|       |    /* The list of protocol strings is prefixed with a 2-byte length */
  468|      0|    rv = sslBuffer_AppendNumber(buf, ss->opt.nextProtoNego.len + (addGrease ? 3 : 0), 2);
  ------------------
  |  Branch (468:67): [True: 0, False: 0]
  ------------------
  469|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (469:9): [True: 0, False: 0]
  ------------------
  470|      0|        return SECFailure;
  471|      0|    }
  472|       |    /* The list of protocol strings */
  473|      0|    rv = sslBuffer_Append(buf, ss->opt.nextProtoNego.data, ss->opt.nextProtoNego.len);
  474|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (474:9): [True: 0, False: 0]
  ------------------
  475|      0|        return SECFailure;
  476|      0|    }
  477|       |    /* A client MAY select one or more GREASE ALPN identifiers and advertise
  478|       |     * them in the "application_layer_protocol_negotiation" extension, if sent
  479|       |     * [RFC8701, Section 3.1]. */
  480|      0|    if (addGrease) {
  ------------------
  |  Branch (480:9): [True: 0, False: 0]
  ------------------
  481|      0|        rv = sslBuffer_AppendNumber(buf, 2, 1);
  482|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (482:13): [True: 0, False: 0]
  ------------------
  483|      0|            return SECFailure;
  484|      0|        }
  485|      0|        rv = sslBuffer_AppendNumber(buf, ss->ssl3.hs.grease->idx[grease_alpn], 2);
  486|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (486:13): [True: 0, False: 0]
  ------------------
  487|      0|            return SECFailure;
  488|      0|        }
  489|      0|    }
  490|       |
  491|      0|    *added = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  492|      0|    return SECSuccess;
  493|      0|}
ssl3_ClientSendStatusRequestXtn:
  561|  10.2k|{
  562|  10.2k|    SECStatus rv;
  563|       |
  564|  10.2k|    if (!ss->opt.enableOCSPStapling) {
  ------------------
  |  Branch (564:9): [True: 5.15k, False: 5.06k]
  ------------------
  565|  5.15k|        return SECSuccess;
  566|  5.15k|    }
  567|       |
  568|  5.06k|    rv = sslBuffer_AppendNumber(buf, 1 /* status_type ocsp */, 1);
  569|  5.06k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (569:9): [True: 0, False: 5.06k]
  ------------------
  570|      0|        return SECFailure;
  571|      0|    }
  572|       |    /* A zero length responder_id_list means that the responders are
  573|       |     * implicitly known to the server. */
  574|  5.06k|    rv = sslBuffer_AppendNumber(buf, 0, 2);
  575|  5.06k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (575:9): [True: 0, False: 5.06k]
  ------------------
  576|      0|        return SECFailure;
  577|      0|    }
  578|       |    /* A zero length request_extensions means that there are no extensions.
  579|       |     * Specifically, we don't set the id-pkix-ocsp-nonce extension. This
  580|       |     * means that the server can replay a cached OCSP response to us. */
  581|  5.06k|    rv = sslBuffer_AppendNumber(buf, 0, 2);
  582|  5.06k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (582:9): [True: 0, False: 5.06k]
  ------------------
  583|      0|        return SECFailure;
  584|      0|    }
  585|       |
  586|  5.06k|    *added = PR_TRUE;
  ------------------
  |  |  437|  5.06k|#define PR_TRUE 1
  ------------------
  587|  5.06k|    return SECSuccess;
  588|  5.06k|}
ssl3_ClientHandleStatusRequestXtn:
  593|     39|{
  594|       |    /* In TLS 1.3, the extension carries the OCSP response. */
  595|     39|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|     39|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (595:9): [True: 0, False: 39]
  ------------------
  596|      0|        SECStatus rv;
  597|      0|        rv = ssl_ReadCertificateStatus(CONST_CAST(sslSocket, ss),
  ------------------
  |  |   96|      0|#define CONST_CAST(T, X) ((T *)(X))
  ------------------
  598|      0|                                       data->data, data->len);
  599|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (599:13): [True: 0, False: 0]
  ------------------
  600|      0|            return SECFailure; /* code already set */
  601|      0|        }
  602|     39|    } else if (data->len != 0) {
  ------------------
  |  Branch (602:16): [True: 1, False: 38]
  ------------------
  603|      1|        ssl3_ExtSendAlert(ss, alert_fatal, illegal_parameter);
  604|      1|        PORT_SetError(SSL_ERROR_RX_MALFORMED_SERVER_HELLO);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
  605|      1|        return SECFailure;
  606|      1|    }
  607|       |
  608|       |    /* Keep track of negotiated extensions. */
  609|     38|    xtnData->negotiated[xtnData->numNegotiated++] = ssl_cert_status_xtn;
  610|     38|    return SECSuccess;
  611|     39|}
ssl3_ClientHandleSessionTicketXtn:
  854|     31|{
  855|     31|    PORT_Assert(ss->version < SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|     31|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     31|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 31, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  856|       |
  857|     31|    if (data->len != 0) {
  ------------------
  |  Branch (857:9): [True: 1, False: 30]
  ------------------
  858|      1|        return SECSuccess; /* Ignore the extension. */
  859|      1|    }
  860|       |
  861|       |    /* Keep track of negotiated extensions. */
  862|     30|    xtnData->negotiated[xtnData->numNegotiated++] = ssl_session_ticket_xtn;
  863|     30|    return SECSuccess;
  864|     31|}
ssl3_SendRenegotiationInfoXtn:
 1337|  10.2k|{
 1338|  10.2k|    PRInt32 len = 0;
 1339|  10.2k|    SECStatus rv;
 1340|       |
 1341|       |    /* In RFC 5746, it is NOT RECOMMENDED to send both the SCSV and the empty
 1342|       |     * RI, so when we send SCSV in the initial handshake, we don't also send RI.
 1343|       |     */
 1344|  10.2k|    if (ss->ssl3.hs.sendingSCSV) {
  ------------------
  |  Branch (1344:9): [True: 0, False: 10.2k]
  ------------------
 1345|      0|        return 0;
 1346|      0|    }
 1347|  10.2k|    if (ss->firstHsDone) {
  ------------------
  |  Branch (1347:9): [True: 0, False: 10.2k]
  ------------------
 1348|      0|        len = ss->sec.isServer ? ss->ssl3.hs.finishedBytes * 2
  ------------------
  |  Branch (1348:15): [True: 0, False: 0]
  ------------------
 1349|      0|                               : ss->ssl3.hs.finishedBytes;
 1350|      0|    }
 1351|       |
 1352|       |    /* verify_Data from previous Finished message(s) */
 1353|  10.2k|    rv = sslBuffer_AppendVariable(buf,
 1354|  10.2k|                                  ss->ssl3.hs.finishedMsgs.data, len, 1);
 1355|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1355:9): [True: 0, False: 10.2k]
  ------------------
 1356|      0|        return SECFailure;
 1357|      0|    }
 1358|       |
 1359|  10.2k|    *added = PR_TRUE;
  ------------------
  |  |  437|  10.2k|#define PR_TRUE 1
  ------------------
 1360|  10.2k|    return SECSuccess;
 1361|  10.2k|}
ssl3_HandleRenegotiationInfoXtn:
 1367|  1.52k|{
 1368|  1.52k|    SECStatus rv = SECSuccess;
 1369|  1.52k|    PRUint32 len = 0;
 1370|       |
 1371|  1.52k|    PORT_Assert(ss->version < SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|  1.52k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1372|       |
 1373|  1.52k|    if (ss->firstHsDone) {
  ------------------
  |  Branch (1373:9): [True: 0, False: 1.52k]
  ------------------
 1374|      0|        len = ss->sec.isServer ? ss->ssl3.hs.finishedBytes
  ------------------
  |  Branch (1374:15): [True: 0, False: 0]
  ------------------
 1375|      0|                               : ss->ssl3.hs.finishedBytes * 2;
 1376|      0|    }
 1377|  1.52k|    if (data->len != 1 + len || data->data[0] != len) {
  ------------------
  |  Branch (1377:9): [True: 3, False: 1.51k]
  |  Branch (1377:33): [True: 2, False: 1.51k]
  ------------------
 1378|      5|        ssl3_ExtDecodeError(ss);
 1379|      5|        return SECFailure;
 1380|      5|    }
 1381|  1.51k|    if (len && NSS_SecureMemcmp(ss->ssl3.hs.finishedMsgs.data,
  ------------------
  |  Branch (1381:9): [True: 0, False: 1.51k]
  |  Branch (1381:16): [True: 0, False: 0]
  ------------------
 1382|      0|                                data->data + 1, len)) {
 1383|      0|        ssl3_ExtSendAlert(ss, alert_fatal, handshake_failure);
 1384|      0|        PORT_SetError(SSL_ERROR_BAD_HANDSHAKE_HASH_VALUE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1385|      0|        return SECFailure;
 1386|      0|    }
 1387|       |    /* remember that we got this extension and it was correct. */
 1388|  1.51k|    CONST_CAST(sslSocket, ss)
  ------------------
  |  |   96|  1.51k|#define CONST_CAST(T, X) ((T *)(X))
  ------------------
 1389|  1.51k|        ->peerRequestedProtection = 1;
 1390|  1.51k|    xtnData->negotiated[xtnData->numNegotiated++] = ssl_renegotiation_info_xtn;
 1391|  1.51k|    if (ss->sec.isServer) {
  ------------------
  |  Branch (1391:9): [True: 0, False: 1.51k]
  ------------------
 1392|       |        /* prepare to send back the appropriate response */
 1393|      0|        rv = ssl3_RegisterExtensionSender(ss, xtnData,
 1394|      0|                                          ssl_renegotiation_info_xtn,
 1395|      0|                                          ssl3_SendRenegotiationInfoXtn);
 1396|      0|    }
 1397|  1.51k|    return rv;
 1398|  1.51k|}
ssl3_ClientSendUseSRTPXtn:
 1403|  10.2k|{
 1404|  10.2k|    unsigned int i;
 1405|  10.2k|    SECStatus rv;
 1406|       |
 1407|  10.2k|    if (!IS_DTLS(ss) || !ss->ssl3.dtlsSRTPCipherCount) {
  ------------------
  |  |  892|  20.4k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (1407:9): [True: 0, False: 10.2k]
  |  Branch (1407:25): [True: 10.2k, False: 0]
  ------------------
 1408|  10.2k|        return SECSuccess; /* Not relevant */
 1409|  10.2k|    }
 1410|       |
 1411|       |    /* Length of the SRTP cipher list */
 1412|      0|    rv = sslBuffer_AppendNumber(buf, 2 * ss->ssl3.dtlsSRTPCipherCount, 2);
 1413|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1413:9): [True: 0, False: 0]
  ------------------
 1414|      0|        return SECFailure;
 1415|      0|    }
 1416|       |    /* The SRTP ciphers */
 1417|      0|    for (i = 0; i < ss->ssl3.dtlsSRTPCipherCount; i++) {
  ------------------
  |  Branch (1417:17): [True: 0, False: 0]
  ------------------
 1418|      0|        rv = sslBuffer_AppendNumber(buf, ss->ssl3.dtlsSRTPCiphers[i], 2);
 1419|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1419:13): [True: 0, False: 0]
  ------------------
 1420|      0|            return SECFailure;
 1421|      0|        }
 1422|      0|    }
 1423|       |    /* Empty MKI value */
 1424|      0|    rv = sslBuffer_AppendNumber(buf, 0, 1);
 1425|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1425:9): [True: 0, False: 0]
  ------------------
 1426|      0|        return SECFailure;
 1427|      0|    }
 1428|       |
 1429|      0|    *added = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1430|      0|    return SECSuccess;
 1431|      0|}
ssl3_SendSigAlgsXtn:
 1652|  10.2k|{
 1653|  10.2k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_2) {
  ------------------
  |  |   20|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (1653:9): [True: 177, False: 10.0k]
  ------------------
 1654|    177|        return SECSuccess;
 1655|    177|    }
 1656|       |
 1657|  10.0k|    PRUint16 minVersion;
 1658|  10.0k|    if (ss->sec.isServer) {
  ------------------
  |  Branch (1658:9): [True: 0, False: 10.0k]
  ------------------
 1659|      0|        minVersion = ss->version; /* CertificateRequest */
 1660|  10.0k|    } else {
 1661|  10.0k|        minVersion = ss->vrange.min; /* ClientHello */
 1662|  10.0k|    }
 1663|       |
 1664|  10.0k|    SECStatus rv = ssl3_EncodeSigAlgs(ss, minVersion, PR_TRUE /* forCert */,
  ------------------
  |  |  437|  10.0k|#define PR_TRUE 1
  ------------------
 1665|  10.0k|                                      ss->opt.enableGrease, buf);
 1666|  10.0k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1666:9): [True: 0, False: 10.0k]
  ------------------
 1667|      0|        return SECFailure;
 1668|      0|    }
 1669|       |
 1670|  10.0k|    *added = PR_TRUE;
  ------------------
  |  |  437|  10.0k|#define PR_TRUE 1
  ------------------
 1671|  10.0k|    return SECSuccess;
 1672|  10.0k|}
ssl3_SendExtendedMasterSecretXtn:
 1677|  10.2k|{
 1678|  10.2k|    if (!ss->opt.enableExtendedMS) {
  ------------------
  |  Branch (1678:9): [True: 5.07k, False: 5.14k]
  ------------------
 1679|  5.07k|        return SECSuccess;
 1680|  5.07k|    }
 1681|       |
 1682|       |    /* Always send the extension in this function, since the
 1683|       |     * client always sends it and this function is only called on
 1684|       |     * the server if we negotiated the extension. */
 1685|  5.14k|    *added = PR_TRUE;
  ------------------
  |  |  437|  5.14k|#define PR_TRUE 1
  ------------------
 1686|  5.14k|    return SECSuccess;
 1687|  10.2k|}
ssl3_HandleExtendedMasterSecretXtn:
 1692|     43|{
 1693|     43|    PORT_Assert(ss->version < SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|     43|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     43|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 43, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1694|       |
 1695|     43|    if (ss->version < SSL_LIBRARY_VERSION_TLS_1_0) {
  ------------------
  |  |   18|     43|#define SSL_LIBRARY_VERSION_TLS_1_0             0x0301
  ------------------
  |  Branch (1695:9): [True: 0, False: 43]
  ------------------
 1696|      0|        return SECSuccess;
 1697|      0|    }
 1698|       |
 1699|     43|    if (!ss->opt.enableExtendedMS) {
  ------------------
  |  Branch (1699:9): [True: 0, False: 43]
  ------------------
 1700|      0|        return SECSuccess;
 1701|      0|    }
 1702|       |
 1703|     43|    if (data->len != 0) {
  ------------------
  |  Branch (1703:9): [True: 1, False: 42]
  ------------------
 1704|      1|        SSL_TRC(30, ("%d: SSL3[%d]: Bogus extended master secret extension",
  ------------------
  |  |   71|      1|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   72|      1|    ssl_Trace b
  ------------------
 1705|      1|                     SSL_GETPID(), ss->fd));
 1706|      1|        ssl3_ExtSendAlert(ss, alert_fatal, decode_error);
 1707|      1|        return SECFailure;
 1708|      1|    }
 1709|       |
 1710|     42|    SSL_DBG(("%d: SSL[%d]: Negotiated extended master secret extension.",
  ------------------
  |  |   87|     42|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 42]
  |  |  ------------------
  |  |   88|     42|    ssl_Trace b
  ------------------
 1711|     42|             SSL_GETPID(), ss->fd));
 1712|       |
 1713|       |    /* Keep track of negotiated extensions. */
 1714|     42|    xtnData->negotiated[xtnData->numNegotiated++] = ssl_extended_master_secret_xtn;
 1715|       |
 1716|     42|    if (ss->sec.isServer) {
  ------------------
  |  Branch (1716:9): [True: 0, False: 42]
  ------------------
 1717|      0|        return ssl3_RegisterExtensionSender(ss, xtnData,
 1718|      0|                                            ssl_extended_master_secret_xtn,
 1719|      0|                                            ssl_SendEmptyExtension);
 1720|      0|    }
 1721|     42|    return SECSuccess;
 1722|     42|}
ssl3_ClientSendSignedCertTimestampXtn:
 1730|  10.2k|{
 1731|       |    /* Only send the extension if processing is enabled. */
 1732|  10.2k|    if (!ss->opt.enableSignedCertTimestamps) {
  ------------------
  |  Branch (1732:9): [True: 10.2k, False: 0]
  ------------------
 1733|  10.2k|        return SECSuccess;
 1734|  10.2k|    }
 1735|       |
 1736|      0|    *added = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1737|      0|    return SECSuccess;
 1738|  10.2k|}
ssl_HandleRecordSizeLimitXtn:
 1945|    192|{
 1946|    192|    SECStatus rv;
 1947|    192|    PRUint32 limit;
 1948|    192|    PRUint32 maxLimit = (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3)
  ------------------
  |  |   21|    192|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1948:25): [True: 0, False: 192]
  ------------------
 1949|    192|                            ? (MAX_FRAGMENT_LENGTH + 1)
  ------------------
  |  |   35|      0|#define MAX_FRAGMENT_LENGTH 16384
  ------------------
 1950|    192|                            : MAX_FRAGMENT_LENGTH;
  ------------------
  |  |   35|    384|#define MAX_FRAGMENT_LENGTH 16384
  ------------------
 1951|       |
 1952|    192|    rv = ssl3_ExtConsumeHandshakeNumber(ss, &limit, 2, &data->data, &data->len);
 1953|    192|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1953:9): [True: 1, False: 191]
  ------------------
 1954|      1|        return SECFailure;
 1955|      1|    }
 1956|    191|    if (data->len != 0 || limit < 64) {
  ------------------
  |  Branch (1956:9): [True: 2, False: 189]
  |  Branch (1956:27): [True: 9, False: 180]
  ------------------
 1957|     11|        ssl3_ExtSendAlert(ss, alert_fatal, decode_error);
 1958|     11|        PORT_SetError(SSL_ERROR_RX_MALFORMED_HANDSHAKE);
  ------------------
  |  |   65|     11|#define PORT_SetError PORT_SetError_Util
  ------------------
 1959|     11|        return SECFailure;
 1960|     11|    }
 1961|       |
 1962|    180|    if (ss->sec.isServer) {
  ------------------
  |  Branch (1962:9): [True: 0, False: 180]
  ------------------
 1963|      0|        rv = ssl3_RegisterExtensionSender(ss, xtnData, ssl_record_size_limit_xtn,
 1964|      0|                                          &ssl_SendRecordSizeLimitXtn);
 1965|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1965:13): [True: 0, False: 0]
  ------------------
 1966|      0|            return SECFailure; /* error already set. */
 1967|      0|        }
 1968|    180|    } else if (limit > maxLimit) {
  ------------------
  |  Branch (1968:16): [True: 21, False: 159]
  ------------------
 1969|       |        /* The client can sensibly check the maximum. */
 1970|     21|        ssl3_ExtSendAlert(ss, alert_fatal, illegal_parameter);
 1971|     21|        PORT_SetError(SSL_ERROR_RX_MALFORMED_HANDSHAKE);
  ------------------
  |  |   65|     21|#define PORT_SetError PORT_SetError_Util
  ------------------
 1972|     21|        return SECFailure;
 1973|     21|    }
 1974|       |
 1975|       |    /* We can't enforce the maximum on a server. But we do need to ensure
 1976|       |     * that we don't apply a limit that is too large. */
 1977|    159|    xtnData->recordSizeLimit = PR_MIN(maxLimit, limit);
  ------------------
  |  |  158|    159|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 159]
  |  |  ------------------
  ------------------
 1978|    159|    xtnData->negotiated[xtnData->numNegotiated++] = ssl_record_size_limit_xtn;
 1979|    159|    return SECSuccess;
 1980|    180|}
ssl_SendRecordSizeLimitXtn:
 1985|  10.2k|{
 1986|  10.2k|    PRUint32 maxLimit;
 1987|  10.2k|    if (ss->sec.isServer) {
  ------------------
  |  Branch (1987:9): [True: 0, False: 10.2k]
  ------------------
 1988|      0|        maxLimit = (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3)
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1988:20): [True: 0, False: 0]
  ------------------
 1989|      0|                       ? (MAX_FRAGMENT_LENGTH + 1)
  ------------------
  |  |   35|      0|#define MAX_FRAGMENT_LENGTH 16384
  ------------------
 1990|      0|                       : MAX_FRAGMENT_LENGTH;
  ------------------
  |  |   35|      0|#define MAX_FRAGMENT_LENGTH 16384
  ------------------
 1991|  10.2k|    } else {
 1992|  10.2k|        maxLimit = (ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3)
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1992:20): [True: 8.81k, False: 1.40k]
  ------------------
 1993|  10.2k|                       ? (MAX_FRAGMENT_LENGTH + 1)
  ------------------
  |  |   35|  8.81k|#define MAX_FRAGMENT_LENGTH 16384
  ------------------
 1994|  10.2k|                       : MAX_FRAGMENT_LENGTH;
  ------------------
  |  |   35|  11.6k|#define MAX_FRAGMENT_LENGTH 16384
  ------------------
 1995|  10.2k|    }
 1996|  10.2k|    PRUint32 limit = PR_MIN(ss->opt.recordSizeLimit, maxLimit);
  ------------------
  |  |  158|  10.2k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 10.2k]
  |  |  ------------------
  ------------------
 1997|  10.2k|    SECStatus rv = sslBuffer_AppendNumber(buf, limit, 2);
 1998|  10.2k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1998:9): [True: 0, False: 10.2k]
  ------------------
 1999|      0|        return SECFailure;
 2000|      0|    }
 2001|       |
 2002|  10.2k|    *added = PR_TRUE;
  ------------------
  |  |  437|  10.2k|#define PR_TRUE 1
  ------------------
 2003|  10.2k|    return SECSuccess;
 2004|  10.2k|}

ssl3_InitGather:
   28|  17.7k|{
   29|  17.7k|    gs->state = GS_INIT;
  ------------------
  |  |  381|  17.7k|#define GS_INIT 0
  ------------------
   30|  17.7k|    gs->writeOffset = 0;
   31|  17.7k|    gs->readOffset = 0;
   32|  17.7k|    gs->dtlsPacketOffset = 0;
   33|  17.7k|    gs->dtlsPacket.len = 0;
   34|  17.7k|    gs->rejectV2Records = PR_FALSE;
  ------------------
  |  |  438|  17.7k|#define PR_FALSE 0
  ------------------
   35|       |    /* Allocate plaintext buffer to maximum possibly needed size. It needs to
   36|       |     * be larger than recordSizeLimit for TLS 1.0 and 1.1 compatability.
   37|       |     * The TLS 1.2 ciphertext is larger than the TLS 1.3 ciphertext. */
   38|  17.7k|    return sslBuffer_Grow(&gs->buf, TLS_1_2_MAX_CTEXT_LENGTH);
  ------------------
  |  |   39|  17.7k|#define TLS_1_2_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_2_MAX_EXPANSION))
  |  |  ------------------
  |  |  |  |   35|  17.7k|#define MAX_FRAGMENT_LENGTH 16384
  |  |  ------------------
  |  |               #define TLS_1_2_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_2_MAX_EXPANSION))
  |  |  ------------------
  |  |  |  |   36|  17.7k|#define TLS_1_2_MAX_EXPANSION 2048
  |  |  ------------------
  ------------------
   39|  17.7k|}
ssl3_DestroyGather:
   44|  8.85k|{
   45|  8.85k|    if (gs) { /* the PORT_*Free functions check for NULL pointers. */
  ------------------
  |  Branch (45:9): [True: 8.85k, False: 0]
  ------------------
   46|  8.85k|        PORT_ZFree(gs->buf.buf, gs->buf.space);
  ------------------
  |  |   75|  8.85k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
   47|  8.85k|        PORT_Free(gs->inbuf.buf);
  ------------------
  |  |   60|  8.85k|#define PORT_Free PORT_Free_Util
  ------------------
   48|  8.85k|        PORT_Free(gs->dtlsPacket.buf);
  ------------------
  |  |   60|  8.85k|#define PORT_Free PORT_Free_Util
  ------------------
   49|  8.85k|    }
   50|  8.85k|}
ssl3_GatherCompleteHandshake:
  449|  15.8k|{
  450|  15.8k|    int rv;
  451|  15.8k|    SSL3Ciphertext cText;
  452|  15.8k|    PRBool keepGoing = PR_TRUE;
  ------------------
  |  |  437|  15.8k|#define PR_TRUE 1
  ------------------
  453|       |
  454|  15.8k|    if (ss->ssl3.fatalAlertSent) {
  ------------------
  |  Branch (454:9): [True: 0, False: 15.8k]
  ------------------
  455|      0|        SSL_TRC(3, ("%d: SSL3[%d] Cannot gather data; fatal alert already sent",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  456|      0|                    SSL_GETPID(), ss->fd));
  457|      0|        PORT_SetError(SSL_ERROR_HANDSHAKE_FAILED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  458|      0|        return -1;
  459|      0|    }
  460|       |
  461|  15.8k|    SSL_TRC(30, ("%d: SSL3[%d]: ssl3_GatherCompleteHandshake",
  ------------------
  |  |   71|  15.8k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 15.8k]
  |  |  ------------------
  |  |   72|  15.8k|    ssl_Trace b
  ------------------
  462|  15.8k|                 SSL_GETPID(), ss->fd));
  463|       |
  464|       |    /* ssl3_HandleRecord may end up eventually calling ssl_FinishHandshake,
  465|       |     * which requires the 1stHandshakeLock, which must be acquired before the
  466|       |     * RecvBufLock.
  467|       |     */
  468|  15.8k|    PORT_Assert(ss->opt.noLocks || ssl_Have1stHandshakeLock(ss));
  ------------------
  |  |  120|  15.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  24.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 7.33k, False: 8.48k]
  |  |  |  |  |  Branch (208:7): [True: 8.48k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  469|  15.8k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  15.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  24.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 7.33k, False: 8.48k]
  |  |  |  |  |  Branch (208:7): [True: 8.48k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  470|       |
  471|  1.46M|    do {
  472|  1.46M|        PRBool processingEarlyData;
  473|       |
  474|  1.46M|        ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  1.46M|    {                                                 \
  |  | 1408|  1.46M|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 1.02M, False: 440k]
  |  |  ------------------
  |  | 1409|  1.02M|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  1.02M|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  1.02M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 1.02M, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  1.02M|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  1.02M|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  1.02M|        }                                             \
  |  | 1412|  1.46M|    }
  ------------------
  475|       |
  476|  1.46M|        processingEarlyData = ss->ssl3.hs.zeroRttState == ssl_0rtt_accepted;
  477|       |
  478|       |        /* Without this, we may end up wrongly reporting
  479|       |         * SSL_ERROR_RX_UNEXPECTED_* errors if we receive any records from the
  480|       |         * peer while we are waiting to be restarted.
  481|       |         */
  482|  1.46M|        if (ss->ssl3.hs.restartTarget) {
  ------------------
  |  Branch (482:13): [True: 0, False: 1.46M]
  ------------------
  483|      0|            ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
  484|      0|            PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                          PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  485|      0|            return -1;
  486|      0|        }
  487|       |
  488|       |        /* If we have a detached record layer, don't ever gather. */
  489|  1.46M|        if (ss->recordWriteCallback) {
  ------------------
  |  Branch (489:13): [True: 0, False: 1.46M]
  ------------------
  490|      0|            PRBool done = ss->firstHsDone;
  491|      0|            ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
  492|      0|            if (done) {
  ------------------
  |  Branch (492:17): [True: 0, False: 0]
  ------------------
  493|      0|                return 1;
  494|      0|            }
  495|      0|            PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                          PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  496|      0|            return -1;
  497|      0|        }
  498|       |
  499|  1.46M|        ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  1.46M|    {                                                \
  |  | 1415|  1.46M|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 1.02M, False: 440k]
  |  |  ------------------
  |  | 1416|  1.46M|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  1.02M|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  1.46M|    }
  ------------------
  500|       |
  501|       |        /* State for SSLv2 client hello support. */
  502|  1.46M|        ssl2Gather ssl2gs = { PR_FALSE, 0 };
  ------------------
  |  |  438|  1.46M|#define PR_FALSE 0
  ------------------
  503|  1.46M|        ssl2Gather *ssl2gs_ptr = NULL;
  504|       |
  505|       |        /* If we're a server and waiting for a client hello, accept v2. */
  506|  1.46M|        if (ss->sec.isServer && ss->opt.enableV2CompatibleHello &&
  ------------------
  |  Branch (506:13): [True: 0, False: 1.46M]
  |  Branch (506:33): [True: 0, False: 0]
  ------------------
  507|  1.46M|            ss->ssl3.hs.ws == wait_client_hello) {
  ------------------
  |  Branch (507:13): [True: 0, False: 0]
  ------------------
  508|      0|            ssl2gs_ptr = &ssl2gs;
  509|      0|        }
  510|       |
  511|       |        /* bring in the next sslv3 record. */
  512|  1.46M|        if (ss->recvdCloseNotify) {
  ------------------
  |  Branch (512:13): [True: 3, False: 1.46M]
  ------------------
  513|       |            /* RFC 5246 Section 7.2.1:
  514|       |             *   Any data received after a closure alert is ignored.
  515|       |             */
  516|      3|            return 0;
  517|      3|        }
  518|       |
  519|  1.46M|        if (!IS_DTLS(ss)) {
  ------------------
  |  |  892|  1.46M|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (519:13): [True: 0, False: 1.46M]
  ------------------
  520|       |            /* If we're a server waiting for a ClientHello then pass
  521|       |             * ssl2gs to support SSLv2 ClientHello messages. */
  522|      0|            rv = ssl3_GatherData(ss, &ss->gs, flags, ssl2gs_ptr);
  523|  1.46M|        } else {
  524|  1.46M|            rv = dtls_GatherData(ss, &ss->gs, flags);
  525|       |
  526|       |            /* If we got a would block error, that means that no data was
  527|       |             * available, so we check the timer to see if it's time to
  528|       |             * retransmit */
  529|  1.46M|            if (rv == SECFailure &&
  ------------------
  |  Branch (529:17): [True: 3.49k, False: 1.46M]
  ------------------
  530|  1.46M|                (PORT_GetError() == PR_WOULD_BLOCK_ERROR)) {
  ------------------
  |  |   62|  3.49k|#define PORT_GetError PORT_GetError_Util
  ------------------
                              (PORT_GetError() == PR_WOULD_BLOCK_ERROR)) {
  ------------------
  |  |   22|  3.49k|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (530:17): [True: 3.49k, False: 0]
  ------------------
  531|  3.49k|                dtls_CheckTimer(ss);
  532|       |                /* Restore the error in case something succeeded */
  533|  3.49k|                PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|  3.49k|#define PORT_SetError PORT_SetError_Util
  ------------------
                              PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|  3.49k|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  534|  3.49k|            }
  535|  1.46M|        }
  536|       |
  537|  1.46M|        if (rv <= 0) {
  ------------------
  |  Branch (537:13): [True: 9.58k, False: 1.45M]
  ------------------
  538|  9.58k|            return rv;
  539|  9.58k|        }
  540|       |
  541|  1.45M|        if (ssl2gs.isV2) {
  ------------------
  |  Branch (541:13): [True: 0, False: 1.45M]
  ------------------
  542|      0|            rv = ssl3_HandleV2ClientHello(ss, ss->gs.inbuf.buf,
  543|      0|                                          ss->gs.inbuf.len,
  544|      0|                                          ssl2gs.padding);
  545|      0|            if (rv < 0) {
  ------------------
  |  Branch (545:17): [True: 0, False: 0]
  ------------------
  546|      0|                return rv;
  547|      0|            }
  548|  1.45M|        } else {
  549|       |            /* decipher it, and handle it if it's a handshake.
  550|       |             * If it's application data, ss->gs.buf will not be empty upon return.
  551|       |             * If it's a change cipher spec, alert, or handshake message,
  552|       |             * ss->gs.buf.len will be 0 when ssl3_HandleRecord returns SECSuccess.
  553|       |             *
  554|       |             * cText only needs to be valid for this next function call, so
  555|       |             * it can borrow gs.hdr.
  556|       |             */
  557|  1.45M|            cText.hdr = ss->gs.hdr;
  558|  1.45M|            cText.hdrLen = ss->gs.hdrLen;
  559|  1.45M|            cText.buf = &ss->gs.inbuf;
  560|  1.45M|            rv = ssl3_HandleRecord(ss, &cText);
  561|  1.45M|        }
  562|       |
  563|  1.45M|#ifdef DEBUG
  564|       |        /* In Debug builds free gather ciphertext buffer after each decryption
  565|       |         * for advanced ASAN coverage/utilization. The buffer content has been
  566|       |         * used at this point, ssl3_HandleRecord() and thereby the decryption
  567|       |         * functions are only called from this point of the implementation. */
  568|  1.45M|        sslBuffer_Clear(&ss->gs.inbuf);
  569|  1.45M|#endif
  570|       |
  571|  1.45M|        if (rv < 0) {
  ------------------
  |  Branch (571:13): [True: 2.66k, False: 1.45M]
  ------------------
  572|  2.66k|            return ss->recvdCloseNotify ? 0 : rv;
  ------------------
  |  Branch (572:20): [True: 1, False: 2.66k]
  ------------------
  573|  2.66k|        }
  574|  1.45M|        if (ss->gs.buf.len > 0) {
  ------------------
  |  Branch (574:13): [True: 425, False: 1.45M]
  ------------------
  575|       |            /* We have application data to return to the application. This
  576|       |             * prioritizes returning application data to the application over
  577|       |             * completing any renegotiation handshake we may be doing.
  578|       |             */
  579|    425|            PORT_Assert(ss->firstHsDone);
  ------------------
  |  |  120|    425|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    425|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 425, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  580|    425|            break;
  581|    425|        }
  582|       |
  583|  1.45M|        PORT_Assert(keepGoing);
  ------------------
  |  |  120|  1.45M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.45M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.45M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|  1.45M|        ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  1.45M|    {                                                 \
  |  | 1408|  1.45M|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 1.01M, False: 434k]
  |  |  ------------------
  |  | 1409|  1.01M|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  1.01M|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  1.01M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 1.01M, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  1.01M|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  1.01M|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  1.01M|        }                                             \
  |  | 1412|  1.45M|    }
  ------------------
  585|  1.45M|        if (ss->ssl3.hs.ws == idle_handshake) {
  ------------------
  |  Branch (585:13): [True: 1.25k, False: 1.45M]
  ------------------
  586|       |            /* We are done with the current handshake so stop trying to
  587|       |             * handshake. Note that it would be safe to test ss->firstHsDone
  588|       |             * instead of ss->ssl3.hs.ws. By testing ss->ssl3.hs.ws instead,
  589|       |             * we prioritize completing a renegotiation handshake over sending
  590|       |             * application data.
  591|       |             */
  592|  1.25k|            PORT_Assert(ss->firstHsDone);
  ------------------
  |  |  120|  1.25k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.25k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.25k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  593|  1.25k|            PORT_Assert(!ss->ssl3.hs.canFalseStart);
  ------------------
  |  |  120|  1.25k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.25k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.25k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|  1.25k|            keepGoing = PR_FALSE;
  ------------------
  |  |  438|  1.25k|#define PR_FALSE 0
  ------------------
  595|  1.45M|        } else if (ss->ssl3.hs.canFalseStart) {
  ------------------
  |  Branch (595:20): [True: 1.88k, False: 1.45M]
  ------------------
  596|       |            /* Prioritize sending application data over trying to complete
  597|       |             * the handshake if we're false starting.
  598|       |             *
  599|       |             * If we were to do this check at the beginning of the loop instead
  600|       |             * of here, then this function would become be a no-op after
  601|       |             * receiving the ServerHelloDone in the false start case, and we
  602|       |             * would never complete the handshake.
  603|       |             */
  604|  1.88k|            PORT_Assert(!ss->firstHsDone);
  ------------------
  |  |  120|  1.88k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.88k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.88k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  605|       |
  606|  1.88k|            if (ssl3_WaitingForServerSecondRound(ss)) {
  ------------------
  |  Branch (606:17): [True: 1.88k, False: 0]
  ------------------
  607|  1.88k|                keepGoing = PR_FALSE;
  ------------------
  |  |  438|  1.88k|#define PR_FALSE 0
  ------------------
  608|  1.88k|            } else {
  609|      0|                ss->ssl3.hs.canFalseStart = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  610|      0|            }
  611|  1.45M|        } else if (processingEarlyData &&
  ------------------
  |  Branch (611:20): [True: 0, False: 1.45M]
  ------------------
  612|  1.45M|                   ss->ssl3.hs.zeroRttState == ssl_0rtt_done &&
  ------------------
  |  Branch (612:20): [True: 0, False: 0]
  ------------------
  613|  1.45M|                   !PR_CLIST_IS_EMPTY(&ss->ssl3.hs.bufferedEarlyData)) {
  ------------------
  |  |   94|      0|    ((_l)->next == (_l))
  ------------------
  |  Branch (613:20): [True: 0, False: 0]
  ------------------
  614|       |            /* If we were processing early data and we are no longer, then force
  615|       |             * the handshake to block.  This ensures that early data is
  616|       |             * delivered to the application before the handshake completes. */
  617|      0|            ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
  618|      0|            PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                          PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  619|      0|            return -1;
  620|      0|        }
  621|  1.45M|        ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  1.45M|    {                                                \
  |  | 1415|  1.45M|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 1.01M, False: 434k]
  |  |  ------------------
  |  | 1416|  1.45M|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  1.01M|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  1.45M|    }
  ------------------
  622|  1.45M|    } while (keepGoing);
  ------------------
  |  Branch (622:14): [True: 1.45M, False: 3.13k]
  ------------------
  623|       |
  624|       |    /* Service the DTLS timer so that the post-handshake timers
  625|       |     * fire. */
  626|  3.56k|    if (IS_DTLS(ss) && (ss->ssl3.hs.ws == idle_handshake)) {
  ------------------
  |  |  892|  7.12k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 3.56k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (626:24): [True: 1.67k, False: 1.88k]
  ------------------
  627|  1.67k|        dtls_CheckTimer(ss);
  628|  1.67k|    }
  629|  3.56k|    ss->gs.readOffset = 0;
  630|  3.56k|    ss->gs.writeOffset = ss->gs.buf.len;
  631|  3.56k|    return 1;
  632|  15.8k|}
ssl3_GatherAppDataRecord:
  646|  1.10k|{
  647|  1.10k|    int rv;
  648|       |
  649|       |    /* ssl3_GatherCompleteHandshake requires both of these locks. */
  650|  1.10k|    PORT_Assert(ss->opt.noLocks || ssl_Have1stHandshakeLock(ss));
  ------------------
  |  |  120|  1.10k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.64k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 554, False: 547]
  |  |  |  |  |  Branch (208:7): [True: 547, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  651|  1.10k|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  1.10k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.64k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 554, False: 547]
  |  |  |  |  |  Branch (208:7): [True: 547, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  652|       |
  653|  3.55k|    do {
  654|  3.55k|        rv = ssl3_GatherCompleteHandshake(ss, flags);
  655|  3.55k|    } while (rv > 0 && ss->gs.buf.len == 0);
  ------------------
  |  Branch (655:14): [True: 2.87k, False: 676]
  |  Branch (655:24): [True: 2.45k, False: 425]
  ------------------
  656|       |
  657|  1.10k|    return rv;
  658|  1.10k|}
ssl3gthr.c:dtls_GatherData:
  279|  1.46M|{
  280|  1.46M|    int nb;
  281|  1.46M|    PRUint8 contentType;
  282|  1.46M|    unsigned int headerLen;
  283|  1.46M|    SECStatus rv = SECSuccess;
  284|  1.46M|    PRBool dtlsLengthPresent = PR_TRUE;
  ------------------
  |  |  437|  1.46M|#define PR_TRUE 1
  ------------------
  285|       |
  286|  1.46M|    SSL_TRC(30, ("dtls_GatherData"));
  ------------------
  |  |   71|  1.46M|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.46M]
  |  |  ------------------
  |  |   72|  1.46M|    ssl_Trace b
  ------------------
  287|       |
  288|  1.46M|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  1.46M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.49M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 440k, False: 1.02M]
  |  |  |  |  |  Branch (208:7): [True: 1.02M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  289|       |
  290|  1.46M|    gs->state = GS_HEADER;
  ------------------
  |  |  382|  1.46M|#define GS_HEADER 1
  ------------------
  291|  1.46M|    gs->offset = 0;
  292|       |
  293|  1.46M|    if (gs->dtlsPacketOffset == gs->dtlsPacket.len) { /* No data left */
  ------------------
  |  Branch (293:9): [True: 17.8k, False: 1.44M]
  ------------------
  294|  17.8k|        gs->dtlsPacketOffset = 0;
  295|  17.8k|        gs->dtlsPacket.len = 0;
  296|       |
  297|       |        /* Resize to the maximum possible size so we can fit a full datagram.
  298|       |         * This leads to record_overflow errors if records/ciphertexts greater
  299|       |         * than the buffer (= maximum record) size are to be received.
  300|       |         * DTLS Record errors are dropped silently. [RFC6347, Section 4.1.2.7].
  301|       |         * Checks for record size limit extension boundaries are performed in
  302|       |         * ssl3con.c/ssl3_HandleRecord() for tls and dtls records.
  303|       |         *
  304|       |         * -> For TLS 1.2 records MUST NOT be longer than 2^14 + 2048 bytes.
  305|       |         * -> For TLS 1.3 records MUST NOT exceed 2^14 + 256 bytes.
  306|       |         * -> For older versions this MAY be enforced, we do it.
  307|       |         * [RFC8446 Section 5.2, RFC5246 Section 6.2.3]. */
  308|  17.8k|        if (ss->version <= SSL_LIBRARY_VERSION_TLS_1_2) {
  ------------------
  |  |   20|  17.8k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (308:13): [True: 14.9k, False: 2.81k]
  ------------------
  309|  14.9k|            if (gs->dtlsPacket.space < DTLS_1_2_MAX_PACKET_LENGTH) {
  ------------------
  |  |   44|  14.9k|#define DTLS_1_2_MAX_PACKET_LENGTH ((TLS_1_2_MAX_CTEXT_LENGTH) + (DTLS_RECORD_HEADER_LENGTH))
  |  |  ------------------
  |  |  |  |   39|  14.9k|#define TLS_1_2_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_2_MAX_EXPANSION))
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|  14.9k|#define MAX_FRAGMENT_LENGTH 16384
  |  |  |  |  ------------------
  |  |  |  |               #define TLS_1_2_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_2_MAX_EXPANSION))
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  14.9k|#define TLS_1_2_MAX_EXPANSION 2048
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_1_2_MAX_PACKET_LENGTH ((TLS_1_2_MAX_CTEXT_LENGTH) + (DTLS_RECORD_HEADER_LENGTH))
  |  |  ------------------
  |  |  |  |   29|  14.9k|#define DTLS_RECORD_HEADER_LENGTH 13
  |  |  ------------------
  ------------------
  |  Branch (309:17): [True: 8.85k, False: 6.14k]
  ------------------
  310|  8.85k|                rv = sslBuffer_Grow(&gs->dtlsPacket, DTLS_1_2_MAX_PACKET_LENGTH);
  ------------------
  |  |   44|  8.85k|#define DTLS_1_2_MAX_PACKET_LENGTH ((TLS_1_2_MAX_CTEXT_LENGTH) + (DTLS_RECORD_HEADER_LENGTH))
  |  |  ------------------
  |  |  |  |   39|  8.85k|#define TLS_1_2_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_2_MAX_EXPANSION))
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|  8.85k|#define MAX_FRAGMENT_LENGTH 16384
  |  |  |  |  ------------------
  |  |  |  |               #define TLS_1_2_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_2_MAX_EXPANSION))
  |  |  |  |  ------------------
  |  |  |  |  |  |   36|  8.85k|#define TLS_1_2_MAX_EXPANSION 2048
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_1_2_MAX_PACKET_LENGTH ((TLS_1_2_MAX_CTEXT_LENGTH) + (DTLS_RECORD_HEADER_LENGTH))
  |  |  ------------------
  |  |  |  |   29|  8.85k|#define DTLS_RECORD_HEADER_LENGTH 13
  |  |  ------------------
  ------------------
  311|  8.85k|            }
  312|  14.9k|        } else { /* version >= TLS 1.3 */
  313|  2.81k|            if (gs->dtlsPacket.space != DTLS_1_3_MAX_PACKET_LENGTH) {
  ------------------
  |  |   43|  2.81k|#define DTLS_1_3_MAX_PACKET_LENGTH ((TLS_1_3_MAX_CTEXT_LENGTH) + (SSL3_RECORD_HEADER_LENGTH))
  |  |  ------------------
  |  |  |  |   38|  2.81k|#define TLS_1_3_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_3_MAX_EXPANSION))
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|  2.81k|#define MAX_FRAGMENT_LENGTH 16384
  |  |  |  |  ------------------
  |  |  |  |               #define TLS_1_3_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_3_MAX_EXPANSION))
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  2.81k|#define TLS_1_3_MAX_EXPANSION (255 + 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_1_3_MAX_PACKET_LENGTH ((TLS_1_3_MAX_CTEXT_LENGTH) + (SSL3_RECORD_HEADER_LENGTH))
  |  |  ------------------
  |  |  |  |   26|  2.81k|#define SSL3_RECORD_HEADER_LENGTH 5
  |  |  ------------------
  ------------------
  |  Branch (313:17): [True: 958, False: 1.85k]
  ------------------
  314|       |                /* During Hello and version negotiation older DTLS versions with
  315|       |                 * greater possible packets are used. The buffer must therefore
  316|       |                 * be "truncated" by clearing and reallocating it */
  317|    958|                sslBuffer_Clear(&gs->dtlsPacket);
  318|    958|                rv = sslBuffer_Grow(&gs->dtlsPacket, DTLS_1_3_MAX_PACKET_LENGTH);
  ------------------
  |  |   43|    958|#define DTLS_1_3_MAX_PACKET_LENGTH ((TLS_1_3_MAX_CTEXT_LENGTH) + (SSL3_RECORD_HEADER_LENGTH))
  |  |  ------------------
  |  |  |  |   38|    958|#define TLS_1_3_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_3_MAX_EXPANSION))
  |  |  |  |  ------------------
  |  |  |  |  |  |   35|    958|#define MAX_FRAGMENT_LENGTH 16384
  |  |  |  |  ------------------
  |  |  |  |               #define TLS_1_3_MAX_CTEXT_LENGTH ((MAX_FRAGMENT_LENGTH) + (TLS_1_3_MAX_EXPANSION))
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    958|#define TLS_1_3_MAX_EXPANSION (255 + 1)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define DTLS_1_3_MAX_PACKET_LENGTH ((TLS_1_3_MAX_CTEXT_LENGTH) + (SSL3_RECORD_HEADER_LENGTH))
  |  |  ------------------
  |  |  |  |   26|    958|#define SSL3_RECORD_HEADER_LENGTH 5
  |  |  ------------------
  ------------------
  319|    958|            }
  320|  2.81k|        }
  321|       |
  322|  17.8k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (322:13): [True: 0, False: 17.8k]
  ------------------
  323|      0|            return -1; /* Code already set. */
  324|      0|        }
  325|       |
  326|       |        /* recv() needs to read a full datagram at a time */
  327|  17.8k|        nb = ssl_DefRecv(ss, gs->dtlsPacket.buf, gs->dtlsPacket.space, flags);
  328|  17.8k|        if (nb > 0) {
  ------------------
  |  Branch (328:13): [True: 11.7k, False: 6.08k]
  ------------------
  329|  11.7k|            PRINT_BUF(60, (ss, "raw gather data:", gs->dtlsPacket.buf, nb));
  ------------------
  |  |   74|  11.7k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 11.7k]
  |  |  ------------------
  |  |   75|  11.7k|    ssl_PrintBuf b
  ------------------
  330|  11.7k|        } else if (nb == 0) {
  ------------------
  |  Branch (330:20): [True: 6.08k, False: 0]
  ------------------
  331|       |            /* EOF */
  332|  6.08k|            SSL_TRC(30, ("%d: SSL3[%d]: EOF", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|  6.08k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 6.08k]
  |  |  ------------------
  |  |   72|  6.08k|    ssl_Trace b
  ------------------
  333|  6.08k|            return 0;
  334|  6.08k|        } else /* if (nb < 0) */ {
  335|      0|            SSL_DBG(("%d: SSL3[%d]: recv error %d", SSL_GETPID(), ss->fd,
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
  336|      0|                     PR_GetError()));
  337|       |            /* DTLS Record Errors, including overlong records, are silently
  338|       |             * dropped [RFC6347, Section 4.1.2.7]. */
  339|      0|            return -1;
  340|      0|        }
  341|       |
  342|  11.7k|        gs->dtlsPacket.len = nb;
  343|  11.7k|    }
  344|       |
  345|  1.46M|    contentType = gs->dtlsPacket.buf[gs->dtlsPacketOffset];
  346|  1.46M|    if (dtls_IsLongHeader(ss->version, contentType)) {
  ------------------
  |  Branch (346:9): [True: 1.46M, False: 0]
  ------------------
  347|  1.46M|        headerLen = 13;
  348|  1.46M|    } else if (contentType == ssl_ct_application_data) {
  ------------------
  |  Branch (348:16): [True: 0, False: 0]
  ------------------
  349|      0|        headerLen = 7;
  350|      0|    } else if (dtls_IsDtls13Ciphertext(ss->version, contentType)) {
  ------------------
  |  Branch (350:16): [True: 0, False: 0]
  ------------------
  351|       |        /* We don't support CIDs.
  352|       |         *
  353|       |         * This condition is met on all invalid outer content types.
  354|       |         * For lower DTLS versions as well as the inner content types,
  355|       |         * this is checked in ssl3con.c/ssl3_HandleNonApplicationData().
  356|       |         *
  357|       |         * In DTLS generally invalid records SHOULD be silently discarded,
  358|       |         * no alert is sent [RFC6347, Section 4.1.2.7].
  359|       |         */
  360|      0|        if (contentType & 0x10) {
  ------------------
  |  Branch (360:13): [True: 0, False: 0]
  ------------------
  361|      0|            PORT_SetError(SSL_ERROR_RX_UNKNOWN_RECORD_TYPE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  362|      0|            gs->dtlsPacketOffset = 0;
  363|      0|            gs->dtlsPacket.len = 0;
  364|      0|            return -1;
  365|      0|        }
  366|       |
  367|      0|        dtlsLengthPresent = (contentType & 0x04) == 0x04;
  368|      0|        PRUint8 dtlsSeqNoSize = (contentType & 0x08) ? 2 : 1;
  ------------------
  |  Branch (368:33): [True: 0, False: 0]
  ------------------
  369|      0|        PRUint8 dtlsLengthBytes = dtlsLengthPresent ? 2 : 0;
  ------------------
  |  Branch (369:35): [True: 0, False: 0]
  ------------------
  370|      0|        headerLen = 1 + dtlsSeqNoSize + dtlsLengthBytes;
  371|      0|    } else {
  372|      0|        SSL_DBG(("%d: SSL3[%d]: invalid first octet (%d) for DTLS",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
  373|      0|                 SSL_GETPID(), ss->fd, contentType));
  374|      0|        PORT_SetError(SSL_ERROR_RX_UNKNOWN_RECORD_TYPE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  375|      0|        gs->dtlsPacketOffset = 0;
  376|      0|        gs->dtlsPacket.len = 0;
  377|      0|        return -1;
  378|      0|    }
  379|       |
  380|       |    /* At this point we should have >=1 complete records lined up in
  381|       |     * dtlsPacket. Read off the header.
  382|       |     */
  383|  1.46M|    if ((gs->dtlsPacket.len - gs->dtlsPacketOffset) < headerLen) {
  ------------------
  |  Branch (383:9): [True: 1.32k, False: 1.45M]
  ------------------
  384|  1.32k|        SSL_DBG(("%d: SSL3[%d]: rest of DTLS packet "
  ------------------
  |  |   87|  1.32k|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 1.32k]
  |  |  ------------------
  |  |   88|  1.32k|    ssl_Trace b
  ------------------
  385|  1.32k|                 "too short to contain header",
  386|  1.32k|                 SSL_GETPID(), ss->fd));
  387|  1.32k|        PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|  1.32k|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|  1.32k|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  388|  1.32k|        gs->dtlsPacketOffset = 0;
  389|  1.32k|        gs->dtlsPacket.len = 0;
  390|  1.32k|        return -1;
  391|  1.32k|    }
  392|  1.45M|    memcpy(gs->hdr, SSL_BUFFER_BASE(&gs->dtlsPacket) + gs->dtlsPacketOffset,
  ------------------
  |  |   35|  1.45M|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
  393|  1.45M|           headerLen);
  394|  1.45M|    gs->hdrLen = headerLen;
  395|  1.45M|    gs->dtlsPacketOffset += headerLen;
  396|       |
  397|       |    /* Have received SSL3 record header in gs->hdr. */
  398|  1.45M|    if (dtlsLengthPresent) {
  ------------------
  |  Branch (398:9): [True: 1.45M, False: 0]
  ------------------
  399|  1.45M|        gs->remainder = (gs->hdr[headerLen - 2] << 8) |
  400|  1.45M|                        gs->hdr[headerLen - 1];
  401|  1.45M|    } else {
  402|      0|        gs->remainder = gs->dtlsPacket.len - gs->dtlsPacketOffset;
  403|      0|    }
  404|       |
  405|  1.45M|    if ((gs->dtlsPacket.len - gs->dtlsPacketOffset) < gs->remainder) {
  ------------------
  |  Branch (405:9): [True: 2.17k, False: 1.45M]
  ------------------
  406|  2.17k|        SSL_DBG(("%d: SSL3[%d]: rest of DTLS packet too short "
  ------------------
  |  |   87|  2.17k|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 2.17k]
  |  |  ------------------
  |  |   88|  2.17k|    ssl_Trace b
  ------------------
  407|  2.17k|                 "to contain rest of body",
  408|  2.17k|                 SSL_GETPID(), ss->fd));
  409|  2.17k|        PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|  2.17k|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|  2.17k|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  410|  2.17k|        gs->dtlsPacketOffset = 0;
  411|  2.17k|        gs->dtlsPacket.len = 0;
  412|  2.17k|        return -1;
  413|  2.17k|    }
  414|       |
  415|       |    /* OK, we have at least one complete packet, copy into inbuf */
  416|  1.45M|    gs->inbuf.len = 0;
  417|  1.45M|    rv = sslBuffer_Append(&gs->inbuf,
  418|  1.45M|                          SSL_BUFFER_BASE(&gs->dtlsPacket) + gs->dtlsPacketOffset,
  ------------------
  |  |   35|  1.45M|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
  419|  1.45M|                          gs->remainder);
  420|  1.45M|    if (rv != SECSuccess) {
  ------------------
  |  Branch (420:9): [True: 0, False: 1.45M]
  ------------------
  421|      0|        return -1; /* code already set. */
  422|      0|    }
  423|  1.45M|    gs->offset = gs->remainder;
  424|  1.45M|    gs->dtlsPacketOffset += gs->remainder;
  425|  1.45M|    gs->state = GS_INIT;
  ------------------
  |  |  381|  1.45M|#define GS_INIT 0
  ------------------
  426|       |
  427|  1.45M|    SSL_TRC(20, ("%d: SSL3[%d]: dtls gathered record type=%d len=%d",
  ------------------
  |  |   71|  1.45M|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.45M]
  |  |  ------------------
  |  |   72|  1.45M|    ssl_Trace b
  ------------------
  428|  1.45M|                 SSL_GETPID(), ss->fd, contentType, gs->inbuf.len));
  429|  1.45M|    return 1;
  430|  1.45M|}

SSL_AuthCertificateHook:
  238|  8.85k|{
  239|  8.85k|    sslSocket *ss;
  240|       |
  241|  8.85k|    ss = ssl_FindSocket(s);
  242|  8.85k|    if (!ss) {
  ------------------
  |  Branch (242:9): [True: 0, False: 8.85k]
  ------------------
  243|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in AuthCertificateHook",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
  244|      0|                 SSL_GETPID(), s));
  245|      0|        return SECFailure;
  246|      0|    }
  247|       |
  248|  8.85k|    ss->authCertificate = func;
  249|  8.85k|    ss->authCertificateArg = arg;
  250|       |
  251|  8.85k|    return SECSuccess;
  252|  8.85k|}

ssl_GatherRecord1stHandshake:
   65|  8.85k|{
   66|  8.85k|    int rv;
   67|       |
   68|  8.85k|    PORT_Assert(ss->opt.noLocks || ssl_Have1stHandshakeLock(ss));
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.33k, False: 4.52k]
  |  |  |  |  |  Branch (208:7): [True: 4.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   69|       |
   70|  8.85k|    ssl_GetRecvBufLock(ss);
  ------------------
  |  | 1449|  8.85k|    {                                                    \
  |  | 1450|  8.85k|        if (!ss->opt.noLocks) {                          \
  |  |  ------------------
  |  |  |  Branch (1450:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1451|  4.52k|            PORT_Assert(!ssl_HaveSSL3HandshakeLock(ss)); \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1452|  4.52k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));       \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1453|  4.52k|            PZ_EnterMonitor((ss)->recvBufLock);          \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1454|  4.52k|        }                                                \
  |  | 1455|  8.85k|    }
  ------------------
   71|       |
   72|       |    /* Wait for handshake to complete, or application data to arrive.  */
   73|  8.85k|    rv = ssl3_GatherCompleteHandshake(ss, 0);
   74|  8.85k|    SSL_TRC(10, ("%d: SSL[%d]: handshake gathering, rv=%d",
  ------------------
  |  |   71|  8.85k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 8.85k]
  |  |  ------------------
  |  |   72|  8.85k|    ssl_Trace b
  ------------------
   75|  8.85k|                 SSL_GETPID(), ss->fd, rv));
   76|       |
   77|  8.85k|    ssl_ReleaseRecvBufLock(ss);
  ------------------
  |  | 1457|  8.85k|    {                                          \
  |  | 1458|  8.85k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1458:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1459|  8.85k|            PZ_ExitMonitor((ss)->recvBufLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1460|  8.85k|    }
  ------------------
   78|       |
   79|  8.85k|    if (rv <= 0) {
  ------------------
  |  Branch (79:9): [True: 8.17k, False: 682]
  ------------------
   80|  8.17k|        if (rv == 0) {
  ------------------
  |  Branch (80:13): [True: 4.95k, False: 3.22k]
  ------------------
   81|       |            /* EOF. Loser  */
   82|  4.95k|            PORT_SetError(PR_END_OF_FILE_ERROR);
  ------------------
  |  |   65|  4.95k|#define PORT_SetError PORT_SetError_Util
  ------------------
                          PORT_SetError(PR_END_OF_FILE_ERROR);
  ------------------
  |  |  202|  4.95k|#define PR_END_OF_FILE_ERROR                     (-5938L)
  ------------------
   83|  4.95k|        }
   84|  8.17k|        if (PORT_GetError() == PR_WOULD_BLOCK_ERROR) {
  ------------------
  |  |   62|  8.17k|#define PORT_GetError PORT_GetError_Util
  ------------------
                      if (PORT_GetError() == PR_WOULD_BLOCK_ERROR) {
  ------------------
  |  |   22|  8.17k|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (84:13): [True: 612, False: 7.56k]
  ------------------
   85|    612|            SSL_TRC(10, ("%d: SSL[%d]: handshake blocked (need %d)",
  ------------------
  |  |   71|    612|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 612]
  |  |  ------------------
  |  |   72|    612|    ssl_Trace b
  ------------------
   86|    612|                         SSL_GETPID(), ss->fd, ss->gs.remainder));
   87|    612|        }
   88|  8.17k|        return SECFailure; /* rv is < 0 here. */
   89|  8.17k|    }
   90|       |
   91|    682|    ss->handshake = NULL;
   92|    682|    return SECSuccess;
   93|  8.85k|}
ssl_BeginClientHandshake:
  114|  8.85k|{
  115|  8.85k|    sslSessionID *sid = NULL;
  116|  8.85k|    SECStatus rv;
  117|       |
  118|  8.85k|    PORT_Assert(ss->opt.noLocks || ssl_Have1stHandshakeLock(ss));
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.33k, False: 4.52k]
  |  |  |  |  |  Branch (208:7): [True: 4.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|       |
  120|  8.85k|    ss->sec.isServer = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
  121|       |
  122|  8.85k|    rv = ssl_CheckConfigSanity(ss);
  123|  8.85k|    if (rv != SECSuccess)
  ------------------
  |  Branch (123:9): [True: 0, False: 8.85k]
  ------------------
  124|      0|        goto loser;
  125|       |
  126|       |    /* Get peer name of server */
  127|  8.85k|    rv = ssl_GetPeerInfo(ss);
  128|  8.85k|    if (rv < 0) {
  ------------------
  |  Branch (128:9): [True: 0, False: 8.85k]
  ------------------
  129|       |#ifdef HPUX11
  130|       |        /*
  131|       |         * On some HP-UX B.11.00 systems, getpeername() occasionally
  132|       |         * fails with ENOTCONN after a successful completion of
  133|       |         * non-blocking connect.  I found that if we do a write()
  134|       |         * and then retry getpeername(), it will work.
  135|       |         */
  136|       |        if (PR_GetError() == PR_NOT_CONNECTED_ERROR) {
  137|       |            char dummy;
  138|       |            (void)PR_Write(ss->fd->lower, &dummy, 0);
  139|       |            rv = ssl_GetPeerInfo(ss);
  140|       |            if (rv < 0) {
  141|       |                goto loser;
  142|       |            }
  143|       |        }
  144|       |#else
  145|      0|        goto loser;
  146|      0|#endif
  147|      0|    }
  148|       |
  149|  8.85k|    SSL_TRC(3, ("%d: SSL[%d]: sending client-hello", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|  8.85k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 8.85k]
  |  |  ------------------
  |  |   72|  8.85k|    ssl_Trace b
  ------------------
  150|       |
  151|       |    /* If there's an sid set from an external cache, use it. */
  152|  8.85k|    if (ss->sec.ci.sid && ss->sec.ci.sid->cached == in_external_cache) {
  ------------------
  |  Branch (152:9): [True: 0, False: 8.85k]
  |  Branch (152:27): [True: 0, False: 0]
  ------------------
  153|      0|        sid = ss->sec.ci.sid;
  154|      0|        SSL_TRC(3, ("%d: SSL[%d]: using external token", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  155|  8.85k|    } else if (!ss->opt.noCache) {
  ------------------
  |  Branch (155:16): [True: 4.59k, False: 4.25k]
  ------------------
  156|       |        /* Try to find server in our session-id cache */
  157|  4.59k|        sid = ssl_LookupSID(ssl_Time(ss), &ss->sec.ci.peer,
  158|  4.59k|                            ss->sec.ci.port, ss->peerID, ss->url);
  159|  4.59k|    }
  160|       |
  161|  8.85k|    if (sid) {
  ------------------
  |  Branch (161:9): [True: 0, False: 8.85k]
  ------------------
  162|      0|        if (sid->version >= ss->vrange.min && sid->version <= ss->vrange.max) {
  ------------------
  |  Branch (162:13): [True: 0, False: 0]
  |  Branch (162:47): [True: 0, False: 0]
  ------------------
  163|      0|            PORT_Assert(!ss->sec.localCert);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  164|      0|            ss->sec.localCert = CERT_DupCertificate(sid->localCert);
  165|      0|        } else {
  166|      0|            ssl_UncacheSessionID(ss);
  167|      0|            ssl_FreeSID(sid);
  168|      0|            sid = NULL;
  169|      0|        }
  170|      0|    }
  171|  8.85k|    if (!sid) {
  ------------------
  |  Branch (171:9): [True: 8.85k, False: 0]
  ------------------
  172|  8.85k|        sid = ssl3_NewSessionID(ss, PR_FALSE);
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
  173|  8.85k|        if (!sid) {
  ------------------
  |  Branch (173:13): [True: 0, False: 8.85k]
  ------------------
  174|      0|            goto loser;
  175|      0|        }
  176|       |        /* This session is a dummy, which we don't want to resume. */
  177|  8.85k|        sid->u.ssl3.keys.resumable = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
  178|  8.85k|    }
  179|  8.85k|    ss->sec.ci.sid = sid;
  180|       |
  181|  8.85k|    ss->gs.state = GS_INIT;
  ------------------
  |  |  381|  8.85k|#define GS_INIT 0
  ------------------
  182|  8.85k|    ss->handshake = ssl_GatherRecord1stHandshake;
  183|       |
  184|       |    /* ssl3_SendClientHello will override this if it succeeds. */
  185|  8.85k|    ss->version = SSL_LIBRARY_VERSION_3_0;
  ------------------
  |  |   17|  8.85k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  186|       |
  187|  8.85k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  8.85k|    {                                                 \
  |  | 1408|  8.85k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1409|  4.52k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  4.52k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  4.52k|        }                                             \
  |  | 1412|  8.85k|    }
  ------------------
  188|  8.85k|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|  8.85k|    {                                           \
  |  | 1467|  8.85k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1468|  8.85k|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|  8.85k|    }
  ------------------
  189|  8.85k|    rv = ssl3_SendClientHello(ss, client_hello_initial);
  190|  8.85k|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|  8.85k|    {                                          \
  |  | 1472|  8.85k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1473|  8.85k|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|  8.85k|    }
  ------------------
  191|  8.85k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  8.85k|    {                                                \
  |  | 1415|  8.85k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1416|  8.85k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  8.85k|    }
  ------------------
  192|       |
  193|  8.85k|    return rv;
  194|       |
  195|      0|loser:
  196|      0|    return SECFailure;
  197|  8.85k|}
sslcon.c:ssl_CheckConfigSanity:
   99|  8.85k|{
  100|  8.85k|    if (SSL_ALL_VERSIONS_DISABLED(&ss->vrange)) {
  ------------------
  |  | 1503|  8.85k|    ((vrange)->min == SSL_LIBRARY_VERSION_NONE)
  |  |  ------------------
  |  |  |  | 1481|  8.85k|#define SSL_LIBRARY_VERSION_NONE 0
  |  |  ------------------
  |  |  |  Branch (1503:5): [True: 0, False: 8.85k]
  |  |  ------------------
  ------------------
  101|      0|        SSL_DBG(("%d: SSL[%d]: Can't handshake! all versions disabled.",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
  102|      0|                 SSL_GETPID(), ss->fd));
  103|      0|        PORT_SetError(SSL_ERROR_SSL_DISABLED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  104|      0|        return SECFailure;
  105|      0|    }
  106|  8.85k|    return SECSuccess;
  107|  8.85k|}

ssl_DefRecv:
   65|  17.8k|{
   66|  17.8k|    PRFileDesc *lower = ss->fd->lower;
   67|  17.8k|    int rv;
   68|       |
   69|  17.8k|    PORT_Assert(buf && len > 0);
  ------------------
  |  |  120|  17.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  35.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 17.8k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 17.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   70|       |
   71|  17.8k|    rv = lower->methods->recv(lower, (void *)buf, len, flags, ss->rTimeout);
   72|  17.8k|    if (rv < 0) {
  ------------------
  |  Branch (72:9): [True: 0, False: 17.8k]
  ------------------
   73|      0|        DEFINE_ERROR
   74|      0|        MAP_ERROR(PR_SOCKET_SHUTDOWN_ERROR, PR_CONNECT_RESET_ERROR)
   75|  17.8k|    } else if (rv > len) {
  ------------------
  |  Branch (75:16): [True: 0, False: 17.8k]
  ------------------
   76|      0|        PORT_Assert(rv <= len);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   77|      0|        PORT_SetError(PR_BUFFER_OVERFLOW_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_BUFFER_OVERFLOW_ERROR);
  ------------------
  |  |  130|      0|#define PR_BUFFER_OVERFLOW_ERROR                 (-5962L)
  ------------------
   78|      0|        rv = SECFailure;
   79|      0|    }
   80|  17.8k|    return rv;
   81|  17.8k|}
ssl_DefSend:
   91|  15.3k|{
   92|  15.3k|    PRFileDesc *lower = ss->fd->lower;
   93|  15.3k|    int sent = 0;
   94|       |
   95|       |#if NSS_DISABLE_NAGLE_DELAYS
   96|       |    /* Although this is overkill, we disable Nagle delays completely for
   97|       |    ** SSL sockets.
   98|       |    */
   99|       |    if (ss->opt.useSecurity && !ss->delayDisabled) {
  100|       |        ssl_EnableNagleDelay(ss, PR_FALSE); /* ignore error */
  101|       |        ss->delayDisabled = 1;
  102|       |    }
  103|       |#endif
  104|  15.3k|    do {
  105|  15.3k|        int rv = lower->methods->send(lower, (const void *)(buf + sent),
  106|  15.3k|                                      len - sent, flags, ss->wTimeout);
  107|  15.3k|        if (rv < 0) {
  ------------------
  |  Branch (107:13): [True: 0, False: 15.3k]
  ------------------
  108|      0|            PRErrorCode err = PR_GetError();
  109|      0|            if (err == PR_WOULD_BLOCK_ERROR) {
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (109:17): [True: 0, False: 0]
  ------------------
  110|      0|                ss->lastWriteBlocked = 1;
  111|      0|                return sent ? sent : SECFailure;
  ------------------
  |  Branch (111:24): [True: 0, False: 0]
  ------------------
  112|      0|            }
  113|      0|            ss->lastWriteBlocked = 0;
  114|      0|            MAP_ERROR(PR_CONNECT_ABORTED_ERROR, PR_CONNECT_RESET_ERROR)
  115|       |            /* Loser */
  116|      0|            return rv;
  117|      0|        }
  118|  15.3k|        sent += rv;
  119|       |
  120|  15.3k|        if (IS_DTLS(ss) && (len > sent)) {
  ------------------
  |  |  892|  30.6k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 15.3k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (120:28): [True: 0, False: 15.3k]
  ------------------
  121|       |            /* We got a partial write so just return it */
  122|      0|            return sent;
  123|      0|        }
  124|  15.3k|    } while (len > sent);
  ------------------
  |  Branch (124:14): [True: 0, False: 15.3k]
  ------------------
  125|  15.3k|    ss->lastWriteBlocked = 0;
  126|  15.3k|    return sent;
  127|  15.3k|}
ssl_DefGetpeername:
  171|  8.85k|{
  172|  8.85k|    PRFileDesc *lower = ss->fd->lower;
  173|  8.85k|    int rv;
  174|       |
  175|  8.85k|    rv = lower->methods->getpeername(lower, name);
  176|  8.85k|    return rv;
  177|  8.85k|}
ssl_DefClose:
  191|  8.85k|{
  192|  8.85k|    PRFileDesc *fd;
  193|  8.85k|    PRFileDesc *popped;
  194|  8.85k|    int rv;
  195|       |
  196|  8.85k|    fd = ss->fd;
  197|       |
  198|       |    /* First, remove the SSL layer PRFileDesc from the socket's stack,
  199|       |    ** then invoke the SSL layer's PRFileDesc destructor.
  200|       |    ** This must happen before the next layer down is closed.
  201|       |    */
  202|  8.85k|    PORT_Assert(fd->higher == NULL);
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  203|  8.85k|    if (fd->higher) {
  ------------------
  |  Branch (203:9): [True: 0, False: 8.85k]
  ------------------
  204|      0|        PORT_SetError(PR_BAD_DESCRIPTOR_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_BAD_DESCRIPTOR_ERROR);
  ------------------
  |  |   19|      0|#define PR_BAD_DESCRIPTOR_ERROR                  (-5999L)
  ------------------
  205|      0|        return SECFailure;
  206|      0|    }
  207|  8.85k|    ss->fd = NULL;
  208|       |
  209|       |    /* PR_PopIOLayer will swap the contents of the top two PRFileDescs on
  210|       |    ** the stack, and then remove the second one.  This way, the address
  211|       |    ** of the PRFileDesc on the top of the stack doesn't change.
  212|       |    */
  213|  8.85k|    popped = PR_PopIOLayer(fd, PR_TOP_IO_LAYER);
  ------------------
  |  |  453|  8.85k|#define PR_TOP_IO_LAYER (PRDescIdentity)-2
  ------------------
  214|  8.85k|    popped->dtor(popped);
  215|       |
  216|       |    /* fd is now the PRFileDesc for the next layer down.
  217|       |    ** Now close the underlying socket.
  218|       |    */
  219|  8.85k|    rv = fd->methods->close(fd);
  220|       |
  221|  8.85k|    ssl_FreeSocket(ss);
  222|       |
  223|  8.85k|    SSL_TRC(5, ("%d: SSL[%d]: closing, rv=%d errno=%d",
  ------------------
  |  |   71|  8.85k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 8.85k]
  |  |  ------------------
  |  |   72|  8.85k|    ssl_Trace b
  ------------------
  224|  8.85k|                SSL_GETPID(), fd, rv, PORT_GetError()));
  225|  8.85k|    return rv;
  226|  8.85k|}

sslBuffer_Grow:
   32|  3.36M|{
   33|  3.36M|    PORT_Assert(b);
  ------------------
  |  |  120|  3.36M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.36M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.36M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   34|  3.36M|    if (b->fixed) {
  ------------------
  |  Branch (34:9): [True: 95.8k, False: 3.27M]
  ------------------
   35|  95.8k|        PORT_Assert(newLen <= b->space);
  ------------------
  |  |  120|  95.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  95.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 95.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   36|  95.8k|        if (newLen > b->space) {
  ------------------
  |  Branch (36:13): [True: 0, False: 95.8k]
  ------------------
   37|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   38|      0|            return SECFailure;
   39|      0|        }
   40|  95.8k|        return SECSuccess;
   41|  95.8k|    }
   42|       |
   43|       |    /* If buf is non-NULL, space must be non-zero;
   44|       |     * if buf is NULL, space must be zero. */
   45|  3.27M|    PORT_Assert((b->buf && b->space) || (!b->buf && !b->space));
  ------------------
  |  |  120|  3.27M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  12.9M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.70M, False: 1.56M]
  |  |  |  |  |  Branch (208:7): [True: 1.70M, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1.56M, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1.56M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   46|  3.27M|    if (newLen > b->space) {
  ------------------
  |  Branch (46:9): [True: 138k, False: 3.13M]
  ------------------
   47|   138k|        newLen = PR_MAX(newLen, b->space + 2048);
  ------------------
  |  |  159|   138k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 57.8k, False: 81.0k]
  |  |  ------------------
  ------------------
   48|   138k|        unsigned char *newBuf;
   49|   138k|        if (b->buf) {
  ------------------
  |  Branch (49:13): [True: 1.04k, False: 137k]
  ------------------
   50|  1.04k|            newBuf = (unsigned char *)PORT_Realloc(b->buf, newLen);
  ------------------
  |  |   64|  1.04k|#define PORT_Realloc PORT_Realloc_Util
  ------------------
   51|   137k|        } else {
   52|   137k|            newBuf = (unsigned char *)PORT_Alloc(newLen);
  ------------------
  |  |   52|   137k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
   53|   137k|        }
   54|   138k|        if (!newBuf) {
  ------------------
  |  Branch (54:13): [True: 0, False: 138k]
  ------------------
   55|      0|            return SECFailure;
   56|      0|        }
   57|   138k|        b->buf = newBuf;
   58|   138k|        b->space = newLen;
   59|   138k|    }
   60|  3.27M|    return SECSuccess;
   61|  3.27M|}
sslBuffer_Append:
   81|  1.63M|{
   82|  1.63M|    SECStatus rv = sslBuffer_Grow(b, b->len + len);
   83|  1.63M|    if (rv != SECSuccess) {
  ------------------
  |  Branch (83:9): [True: 0, False: 1.63M]
  ------------------
   84|      0|        return SECFailure; /* Code already set. */
   85|      0|    }
   86|  1.63M|    if (len > 0) {
  ------------------
  |  Branch (86:9): [True: 206k, False: 1.42M]
  ------------------
   87|   206k|        PORT_Assert(data);
  ------------------
  |  |  120|   206k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   206k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 206k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   88|   206k|        PORT_Memcpy(SSL_BUFFER_NEXT(b), data, len);
  ------------------
  |  |  180|   206k|#define PORT_Memcpy memcpy
  ------------------
                      PORT_Memcpy(SSL_BUFFER_NEXT(b), data, len);
  ------------------
  |  |   37|   206k|#define SSL_BUFFER_NEXT(b) ((b)->buf + (b)->len)
  ------------------
   89|   206k|    }
   90|  1.63M|    b->len += len;
   91|  1.63M|    return SECSuccess;
   92|  1.63M|}
sslBuffer_AppendNumber:
   96|  1.46M|{
   97|  1.46M|    SECStatus rv = sslBuffer_Grow(b, b->len + size);
   98|  1.46M|    if (rv != SECSuccess) {
  ------------------
  |  Branch (98:9): [True: 0, False: 1.46M]
  ------------------
   99|      0|        return SECFailure;
  100|      0|    }
  101|  1.46M|    ssl_EncodeUintX(SSL_BUFFER_NEXT(b), v, size);
  ------------------
  |  |   37|  1.46M|#define SSL_BUFFER_NEXT(b) ((b)->buf + (b)->len)
  ------------------
  102|  1.46M|    b->len += size;
  103|  1.46M|    return SECSuccess;
  104|  1.46M|}
sslBuffer_AppendVariable:
  109|  68.7k|{
  110|  68.7k|    PORT_Assert(size <= 4 && size > 0);
  ------------------
  |  |  120|  68.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   137k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 68.7k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 68.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  111|  68.7k|    PORT_Assert(b);
  ------------------
  |  |  120|  68.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  68.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 68.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|  68.7k|    if (len >= (1ULL << (8 * size))) {
  ------------------
  |  Branch (112:9): [True: 0, False: 68.7k]
  ------------------
  113|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  114|      0|        return SECFailure;
  115|      0|    }
  116|       |
  117|  68.7k|    if (sslBuffer_Grow(b, b->len + len + size) != SECSuccess) {
  ------------------
  |  Branch (117:9): [True: 0, False: 68.7k]
  ------------------
  118|      0|        return SECFailure;
  119|      0|    }
  120|       |
  121|  68.7k|    ssl_EncodeUintX(SSL_BUFFER_NEXT(b), len, size);
  ------------------
  |  |   37|  68.7k|#define SSL_BUFFER_NEXT(b) ((b)->buf + (b)->len)
  ------------------
  122|  68.7k|    b->len += size;
  123|  68.7k|    if (len != 0) {
  ------------------
  |  Branch (123:9): [True: 39.8k, False: 28.8k]
  ------------------
  124|  39.8k|        PORT_Assert(data);
  ------------------
  |  |  120|  39.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  39.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 39.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  125|       |        /* We sometimes pass NULL, 0 and memcpy() doesn't want NULL. */
  126|  39.8k|        PORT_Memcpy(SSL_BUFFER_NEXT(b), data, len);
  ------------------
  |  |  180|  39.8k|#define PORT_Memcpy memcpy
  ------------------
                      PORT_Memcpy(SSL_BUFFER_NEXT(b), data, len);
  ------------------
  |  |   37|  39.8k|#define SSL_BUFFER_NEXT(b) ((b)->buf + (b)->len)
  ------------------
  127|  39.8k|    }
  128|  68.7k|    b->len += len;
  129|  68.7k|    return SECSuccess;
  130|  68.7k|}
sslBuffer_AppendBuffer:
  134|  5.75k|{
  135|  5.75k|    return sslBuffer_Append(b, append->buf, append->len);
  136|  5.75k|}
sslBuffer_Skip:
  147|   110k|{
  148|   110k|    if (sslBuffer_Grow(b, b->len + size) != SECSuccess) {
  ------------------
  |  Branch (148:9): [True: 0, False: 110k]
  ------------------
  149|      0|        return SECFailure;
  150|      0|    }
  151|       |
  152|   110k|    if (savedOffset) {
  ------------------
  |  Branch (152:9): [True: 71.0k, False: 39.2k]
  ------------------
  153|  71.0k|        *savedOffset = b->len;
  154|  71.0k|    }
  155|   110k|    b->len += size;
  156|   110k|    return SECSuccess;
  157|   110k|}
sslBuffer_InsertLength:
  170|  71.0k|{
  171|  71.0k|    unsigned int len;
  172|       |
  173|  71.0k|    PORT_Assert(b->len >= at + size);
  ------------------
  |  |  120|  71.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  71.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 71.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  174|  71.0k|    PORT_Assert(b->space >= at + size);
  ------------------
  |  |  120|  71.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  71.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 71.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  175|  71.0k|    len = b->len - (at + size);
  176|       |
  177|  71.0k|    PORT_Assert(size <= 4 && size > 0);
  ------------------
  |  |  120|  71.0k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   142k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 71.0k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 71.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  178|  71.0k|    if (len >= (1ULL << (8 * size))) {
  ------------------
  |  Branch (178:9): [True: 0, False: 71.0k]
  ------------------
  179|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  180|      0|        return SECFailure;
  181|      0|    }
  182|       |
  183|  71.0k|    ssl_EncodeUintX(SSL_BUFFER_BASE(b) + at, len, size);
  ------------------
  |  |   35|  71.0k|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
  184|  71.0k|    return SECSuccess;
  185|  71.0k|}
sslBuffer_InsertNumber:
  190|  40.8k|{
  191|  40.8k|    PORT_Assert(b->len >= at + size);
  ------------------
  |  |  120|  40.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  40.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 40.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  192|  40.8k|    PORT_Assert(b->space >= at + size);
  ------------------
  |  |  120|  40.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  40.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 40.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|       |
  194|  40.8k|    PORT_Assert(size <= 4 && size > 0);
  ------------------
  |  |  120|  40.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  81.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 40.8k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 40.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  40.8k|    if (v >= (1ULL << (8 * size))) {
  ------------------
  |  Branch (195:9): [True: 0, False: 40.8k]
  ------------------
  196|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  197|      0|        return SECFailure;
  198|      0|    }
  199|       |
  200|  40.8k|    ssl_EncodeUintX(SSL_BUFFER_BASE(b) + at, v, size);
  ------------------
  |  |   35|  40.8k|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
  201|  40.8k|    return SECSuccess;
  202|  40.8k|}
sslBuffer_Clear:
  206|  1.54M|{
  207|  1.54M|    if (!b->fixed) {
  ------------------
  |  Branch (207:9): [True: 1.54M, False: 721]
  ------------------
  208|  1.54M|        if (b->buf) {
  ------------------
  |  Branch (208:13): [True: 100k, False: 1.44M]
  ------------------
  209|   100k|            PORT_Free(b->buf);
  ------------------
  |  |   60|   100k|#define PORT_Free PORT_Free_Util
  ------------------
  210|   100k|            b->buf = NULL;
  211|   100k|        }
  212|  1.54M|        b->space = 0;
  213|  1.54M|    }
  214|  1.54M|    b->len = 0;
  215|  1.54M|}
sslRead_Read:
  219|    934|{
  220|    934|    if (!reader || !out) {
  ------------------
  |  Branch (220:9): [True: 0, False: 934]
  |  Branch (220:20): [True: 0, False: 934]
  ------------------
  221|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  222|      0|        return SECFailure;
  223|      0|    }
  224|    934|    if (reader->buf.len < reader->offset ||
  ------------------
  |  Branch (224:9): [True: 0, False: 934]
  ------------------
  225|    934|        count > SSL_READER_REMAINING(reader)) {
  ------------------
  |  |   91|    934|    ((r)->buf.len - (r)->offset)
  ------------------
  |  Branch (225:9): [True: 19, False: 915]
  ------------------
  226|     19|        PORT_SetError(SEC_ERROR_BAD_DATA);
  ------------------
  |  |   65|     19|#define PORT_SetError PORT_SetError_Util
  ------------------
  227|     19|        return SECFailure;
  228|     19|    }
  229|       |
  230|    915|    out->buf = SSL_READER_CURRENT(reader);
  ------------------
  |  |   89|    915|    ((r)->buf.buf + (r)->offset)
  ------------------
  231|    915|    out->len = count;
  232|    915|    reader->offset += count;
  233|       |
  234|    915|    return SECSuccess;
  235|    934|}
sslRead_ReadVariable:
  239|    947|{
  240|    947|    PRUint64 variableLen = 0;
  241|    947|    SECStatus rv = sslRead_ReadNumber(reader, sizeLen, &variableLen);
  242|    947|    if (rv != SECSuccess) {
  ------------------
  |  Branch (242:9): [True: 8, False: 939]
  ------------------
  243|      8|        PORT_SetError(SEC_ERROR_BAD_DATA);
  ------------------
  |  |   65|      8|#define PORT_SetError PORT_SetError_Util
  ------------------
  244|      8|        return SECFailure;
  245|      8|    }
  246|    939|    if (!variableLen) {
  ------------------
  |  Branch (246:9): [True: 5, False: 934]
  ------------------
  247|       |        // It is ok to have an empty variable.
  248|      5|        out->len = variableLen;
  249|      5|        return SECSuccess;
  250|      5|    }
  251|    934|    return sslRead_Read(reader, variableLen, out);
  252|    939|}
sslRead_ReadNumber:
  256|  1.44M|{
  257|  1.44M|    if (!reader || !num) {
  ------------------
  |  Branch (257:9): [True: 0, False: 1.44M]
  |  Branch (257:20): [True: 0, False: 1.44M]
  ------------------
  258|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  259|      0|        return SECFailure;
  260|      0|    }
  261|  1.44M|    if (reader->buf.len < reader->offset ||
  ------------------
  |  Branch (261:9): [True: 0, False: 1.44M]
  ------------------
  262|  1.44M|        bytes > SSL_READER_REMAINING(reader) ||
  ------------------
  |  |   91|  2.89M|    ((r)->buf.len - (r)->offset)
  ------------------
  |  Branch (262:9): [True: 10, False: 1.44M]
  ------------------
  263|  1.44M|        bytes > 8) {
  ------------------
  |  Branch (263:9): [True: 0, False: 1.44M]
  ------------------
  264|     10|        PORT_SetError(SEC_ERROR_BAD_DATA);
  ------------------
  |  |   65|     10|#define PORT_SetError PORT_SetError_Util
  ------------------
  265|     10|        return SECFailure;
  266|     10|    }
  267|  1.44M|    unsigned int i;
  268|  1.44M|    PRUint64 number = 0;
  269|  10.1M|    for (i = 0; i < bytes; i++) {
  ------------------
  |  Branch (269:17): [True: 8.68M, False: 1.44M]
  ------------------
  270|  8.68M|        number = (number << 8) + reader->buf.buf[i + reader->offset];
  271|  8.68M|    }
  272|       |
  273|  1.44M|    reader->offset = reader->offset + bytes;
  274|  1.44M|    *num = number;
  275|  1.44M|    return SECSuccess;
  276|  1.44M|}
ssl3_AppendHandshakeSuppressHash:
  334|  8.81k|{
  335|  8.81k|    return ssl3_AppendHandshakeInternal(ss, void_src, bytes, PR_TRUE);
  ------------------
  |  |  437|  8.81k|#define PR_TRUE 1
  ------------------
  336|  8.81k|}
ssl3_AppendHandshake:
  340|  4.92k|{
  341|  4.92k|    return ssl3_AppendHandshakeInternal(ss, void_src, bytes, PR_FALSE);
  ------------------
  |  |  438|  4.92k|#define PR_FALSE 0
  ------------------
  342|  4.92k|}
ssl3_AppendHandshakeNumberSuppressHash:
  346|  19.0k|{
  347|  19.0k|    if ((lenSize > 8) || ((lenSize < 8) && (num >= (1ULL << (8 * lenSize))))) {
  ------------------
  |  Branch (347:9): [True: 0, False: 19.0k]
  |  Branch (347:27): [True: 19.0k, False: 0]
  |  Branch (347:44): [True: 0, False: 19.0k]
  ------------------
  348|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  349|      0|        return SECFailure;
  350|      0|    }
  351|       |
  352|  19.0k|    PRUint8 b[sizeof(num)];
  353|  19.0k|    SSL_TRC(60, ("%d: number:", SSL_GETPID()));
  ------------------
  |  |   71|  19.0k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 19.0k]
  |  |  ------------------
  |  |   72|  19.0k|    ssl_Trace b
  ------------------
  354|  19.0k|    ssl_EncodeUintX(b, num, lenSize);
  355|  19.0k|    return ssl3_AppendHandshakeInternal(ss, b, lenSize, suppressHash);
  356|  19.0k|}
ssl3_AppendHandshakeNumber:
  360|  8.43k|{
  361|  8.43k|    return ssl3_AppendHandshakeNumberSuppressHash(ss, num, lenSize, PR_FALSE);
  ------------------
  |  |  438|  8.43k|#define PR_FALSE 0
  ------------------
  362|  8.43k|}
ssl3_AppendHandshakeVariable:
  367|  1.34k|{
  368|  1.34k|    SECStatus rv;
  369|       |
  370|  1.34k|    PORT_Assert((bytes < (1 << 8) && lenSize == 1) ||
  ------------------
  |  |  120|  1.34k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.60k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.31k, False: 34]
  |  |  |  |  |  Branch (208:7): [True: 267, False: 1.04k]
  |  |  |  |  |  Branch (208:7): [True: 1.08k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1.08k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  371|  1.34k|                (bytes < (1L << 16) && lenSize == 2) ||
  372|  1.34k|                (bytes < (1L << 24) && lenSize == 3));
  373|       |
  374|  1.34k|    SSL_TRC(60, ("%d: append variable:", SSL_GETPID()));
  ------------------
  |  |   71|  1.34k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.34k]
  |  |  ------------------
  |  |   72|  1.34k|    ssl_Trace b
  ------------------
  375|  1.34k|    rv = ssl3_AppendHandshakeNumber(ss, bytes, lenSize);
  376|  1.34k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (376:9): [True: 0, False: 1.34k]
  ------------------
  377|      0|        return SECFailure; /* error code set by AppendHandshake. */
  378|      0|    }
  379|  1.34k|    SSL_TRC(60, ("data:"));
  ------------------
  |  |   71|  1.34k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.34k]
  |  |  ------------------
  |  |   72|  1.34k|    ssl_Trace b
  ------------------
  380|  1.34k|    return ssl3_AppendHandshake(ss, src, bytes);
  381|  1.34k|}
ssl3_AppendBufferToHandshake:
  385|    411|{
  386|    411|    return ssl3_AppendHandshake(ss, buf->buf, buf->len);
  387|    411|}
ssl3_MaybeUpdateHashWithSavedRecord:
  398|  7.69k|{
  399|  7.69k|    SECStatus rv;
  400|       |    /* dtls13ClientMessageBuffer is not empty if ClientHello has sent DTLS1.3 */
  401|  7.69k|    if (ss->ssl3.hs.dtls13ClientMessageBuffer.len == 0) {
  ------------------
  |  Branch (401:9): [True: 1.01k, False: 6.67k]
  ------------------
  402|  1.01k|        return SECSuccess;
  403|  1.01k|    }
  404|       |
  405|  6.67k|    size_t offset = 0;
  406|       |
  407|       |    /* the first clause checks the version that was received in ServerHello:
  408|       |     * only if it's DTLS1.3, we remove the necessary fields.
  409|       |     * the second clause checks if we send 0rtt (see TestTls13ZeroRttDowngrade).
  410|       |     */
  411|  6.67k|    if ((ss->version == ss->ssl3.cwSpec->version || ss->ssl3.hs.zeroRttState == ssl_0rtt_sent)) {
  ------------------
  |  Branch (411:10): [True: 1.99k, False: 4.67k]
  |  Branch (411:53): [True: 0, False: 4.67k]
  ------------------
  412|  1.99k|        if (ss->ssl3.hs.dtls13ClientMessageBuffer.len < 12) {
  ------------------
  |  Branch (412:13): [True: 0, False: 1.99k]
  ------------------
  413|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  414|      0|            return SECFailure;
  415|      0|        }
  416|       |
  417|  1.99k|        rv = ssl3_UpdateHandshakeHashes(ss, ss->ssl3.hs.dtls13ClientMessageBuffer.buf, 4);
  418|  1.99k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (418:13): [True: 0, False: 1.99k]
  ------------------
  419|      0|            return SECFailure;
  420|      0|        }
  421|  1.99k|        offset = 12;
  422|  1.99k|    }
  423|       |
  424|  6.67k|    PORT_Assert(offset < ss->ssl3.hs.dtls13ClientMessageBuffer.len);
  ------------------
  |  |  120|  6.67k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  6.67k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6.67k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  425|  6.67k|    rv = ssl3_UpdateHandshakeHashes(ss, ss->ssl3.hs.dtls13ClientMessageBuffer.buf + offset,
  426|  6.67k|                                    ss->ssl3.hs.dtls13ClientMessageBuffer.len - offset);
  427|  6.67k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (427:9): [True: 0, False: 6.67k]
  ------------------
  428|      0|        return SECFailure;
  429|      0|    }
  430|       |
  431|  6.67k|    sslBuffer_Clear(&ss->ssl3.hs.dtls13ClientMessageBuffer);
  432|  6.67k|    ss->ssl3.hs.dtls13ClientMessageBuffer.len = 0;
  433|  6.67k|    return SECSuccess;
  434|  6.67k|}
sslencode.c:ssl_EncodeUintX:
   18|  1.66M|{
   19|  1.66M|    PRUint64 encoded;
   20|       |
   21|  1.66M|    PORT_Assert(bytes > 0 && bytes <= sizeof(encoded));
  ------------------
  |  |  120|  1.66M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.33M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1.66M, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1.66M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   22|       |
   23|  1.66M|    encoded = PR_htonll(value);
   24|  1.66M|    PORT_Memcpy(to, ((unsigned char *)(&encoded)) + (sizeof(encoded) - bytes),
  ------------------
  |  |  180|  1.66M|#define PORT_Memcpy memcpy
  ------------------
   25|  1.66M|                bytes);
   26|  1.66M|}
sslencode.c:ssl3_AppendHandshakeInternal:
  288|  32.7k|{
  289|  32.7k|    unsigned char *src = (unsigned char *)void_src;
  290|  32.7k|    int room = ss->sec.ci.sendBuf.space - ss->sec.ci.sendBuf.len;
  291|  32.7k|    SECStatus rv;
  292|       |
  293|  32.7k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss)); /* protects sendBuf. */
  ------------------
  |  |  120|  32.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  49.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 16.0k, False: 16.7k]
  |  |  |  |  |  Branch (208:7): [True: 16.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  294|       |
  295|  32.7k|    if (!bytes)
  ------------------
  |  Branch (295:9): [True: 0, False: 32.7k]
  ------------------
  296|      0|        return SECSuccess;
  297|  32.7k|    if (ss->sec.ci.sendBuf.space < MAX_SEND_BUF_LENGTH && room < bytes) {
  ------------------
  |  |  283|  65.5k|#define MAX_SEND_BUF_LENGTH 32000 /* watch for 16-bit integer overflow */
  ------------------
  |  Branch (297:9): [True: 32.7k, False: 0]
  |  Branch (297:59): [True: 8.85k, False: 23.9k]
  ------------------
  298|  8.85k|        rv = sslBuffer_Grow(&ss->sec.ci.sendBuf, PR_MAX(MIN_SEND_BUF_LENGTH,
  ------------------
  |  |  159|  17.7k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 8.85k, False: 0]
  |  |  |  Branch (159:31): [True: 0, False: 8.85k]
  |  |  |  Branch (159:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  299|  8.85k|                                                        PR_MIN(MAX_SEND_BUF_LENGTH, ss->sec.ci.sendBuf.len + bytes)));
  300|  8.85k|        if (rv != SECSuccess)
  ------------------
  |  Branch (300:13): [True: 0, False: 8.85k]
  ------------------
  301|      0|            return SECFailure; /* sslBuffer_Grow sets a memory error code. */
  302|  8.85k|        room = ss->sec.ci.sendBuf.space - ss->sec.ci.sendBuf.len;
  303|  8.85k|    }
  304|       |
  305|  32.7k|    PRINT_BUF(60, (ss, "Append to Handshake", (unsigned char *)void_src, bytes));
  ------------------
  |  |   74|  32.7k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 32.7k]
  |  |  ------------------
  |  |   75|  32.7k|    ssl_PrintBuf b
  ------------------
  306|       |    // TODO: Move firstHsDone and version check into callers as a suppression.
  307|  32.7k|    if (!suppressHash && (!ss->firstHsDone || ss->version < SSL_LIBRARY_VERSION_TLS_1_3)) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (307:9): [True: 23.9k, False: 8.81k]
  |  Branch (307:27): [True: 23.9k, False: 0]
  |  Branch (307:47): [True: 0, False: 0]
  ------------------
  308|  23.9k|        rv = ssl3_UpdateHandshakeHashes(ss, src, bytes);
  309|  23.9k|        if (rv != SECSuccess)
  ------------------
  |  Branch (309:13): [True: 0, False: 23.9k]
  ------------------
  310|      0|            return SECFailure; /* error code set by ssl3_UpdateHandshakeHashes */
  311|  23.9k|    }
  312|       |
  313|  32.7k|    while (bytes > room) {
  ------------------
  |  Branch (313:12): [True: 0, False: 32.7k]
  ------------------
  314|      0|        if (room > 0)
  ------------------
  |  Branch (314:13): [True: 0, False: 0]
  ------------------
  315|      0|            PORT_Memcpy(ss->sec.ci.sendBuf.buf + ss->sec.ci.sendBuf.len, src,
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  316|      0|                        room);
  317|      0|        ss->sec.ci.sendBuf.len += room;
  318|      0|        rv = ssl3_FlushHandshake(ss, ssl_SEND_FLAG_FORCE_INTO_BUFFER);
  ------------------
  |  |  223|      0|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
  319|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (319:13): [True: 0, False: 0]
  ------------------
  320|      0|            return SECFailure; /* error code set by ssl3_FlushHandshake */
  321|      0|        }
  322|      0|        bytes -= room;
  323|      0|        src += room;
  324|      0|        room = ss->sec.ci.sendBuf.space;
  325|      0|        PORT_Assert(ss->sec.ci.sendBuf.len == 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  326|      0|    }
  327|  32.7k|    PORT_Memcpy(ss->sec.ci.sendBuf.buf + ss->sec.ci.sendBuf.len, src, bytes);
  ------------------
  |  |  180|  32.7k|#define PORT_Memcpy memcpy
  ------------------
  328|  32.7k|    ss->sec.ci.sendBuf.len += bytes;
  329|  32.7k|    return SECSuccess;
  330|  32.7k|}

ssl_MapLowLevelError:
   21|  5.13k|{
   22|  5.13k|    int oldErr = PORT_GetError();
  ------------------
  |  |   62|  5.13k|#define PORT_GetError PORT_GetError_Util
  ------------------
   23|       |
   24|  5.13k|    switch (oldErr) {
   25|       |
   26|    236|        case 0:
  ------------------
  |  Branch (26:9): [True: 236, False: 4.90k]
  ------------------
   27|    236|        case PR_IO_ERROR:
  ------------------
  |  |   43|    236|#define PR_IO_ERROR                              (-5991L)
  ------------------
  |  Branch (27:9): [True: 0, False: 5.13k]
  ------------------
   28|    236|        case SEC_ERROR_IO:
  ------------------
  |  Branch (28:9): [True: 0, False: 5.13k]
  ------------------
   29|    262|        case SEC_ERROR_BAD_DATA:
  ------------------
  |  Branch (29:9): [True: 26, False: 5.11k]
  ------------------
   30|    303|        case SEC_ERROR_LIBRARY_FAILURE:
  ------------------
  |  Branch (30:9): [True: 41, False: 5.09k]
  ------------------
   31|    328|        case SEC_ERROR_EXTENSION_NOT_FOUND:
  ------------------
  |  Branch (31:9): [True: 25, False: 5.11k]
  ------------------
   32|    328|        case SSL_ERROR_BAD_CLIENT:
  ------------------
  |  Branch (32:9): [True: 0, False: 5.13k]
  ------------------
   33|    538|        case SSL_ERROR_BAD_SERVER:
  ------------------
  |  Branch (33:9): [True: 210, False: 4.92k]
  ------------------
   34|    538|        case SSL_ERROR_SESSION_NOT_FOUND:
  ------------------
  |  Branch (34:9): [True: 0, False: 5.13k]
  ------------------
   35|    538|            PORT_SetError(hiLevelError);
  ------------------
  |  |   65|    538|#define PORT_SetError PORT_SetError_Util
  ------------------
   36|    538|            return hiLevelError;
   37|       |
   38|  4.59k|        default: /* leave the majority of error codes alone. */
  ------------------
  |  Branch (38:9): [True: 4.59k, False: 538]
  ------------------
   39|  4.59k|            return oldErr;
   40|  5.13k|    }
   41|  5.13k|}

ssl_InitializePRErrorTable:
   32|      1|{
   33|      1|    return (PR_SUCCESS == PR_CallOnce(&once, ssl_InitializePRErrorTableOnce))
  ------------------
  |  Branch (33:12): [True: 1, False: 0]
  ------------------
   34|      1|               ? SECSuccess
   35|      1|               : SECFailure;
   36|      1|}
sslerrstrs.c:ssl_InitializePRErrorTableOnce:
   24|      1|{
   25|      1|    return PR_ErrorInstallTable(&ssl_et);
   26|      1|}

ssl_FilterSupportedGroups:
   77|  17.8k|{
   78|  17.8k|    unsigned int i;
   79|  17.8k|    PRStatus prv;
   80|  17.8k|    sslSocketAndGroupArg arg = { NULL, ss };
   81|       |
   82|  17.8k|    prv = PR_CallOnce(&cleanupECDHEKeysOnce, ssl_SetupCleanupECDHEKeysOnce);
   83|  17.8k|    PORT_Assert(prv == PR_SUCCESS);
  ------------------
  |  |  120|  17.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  17.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 17.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|  17.8k|    if (prv != PR_SUCCESS) {
  ------------------
  |  Branch (84:9): [True: 0, False: 17.8k]
  ------------------
   85|      0|        return;
   86|      0|    }
   87|       |
   88|   608k|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; ++i) {
  ------------------
  |  |  133|   608k|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (88:17): [True: 590k, False: 17.8k]
  ------------------
   89|   590k|        PRUint32 policy;
   90|   590k|        SECStatus srv;
   91|   590k|        unsigned int index;
   92|   590k|        const sslNamedGroupDef *group = ss->namedGroupPreferences[i];
   93|   590k|        if (!group) {
  ------------------
  |  Branch (93:13): [True: 207k, False: 382k]
  ------------------
   94|   207k|            continue;
   95|   207k|        }
   96|       |
   97|   382k|        srv = NSS_GetAlgorithmPolicy(group->oidTag, &policy);
   98|   382k|        if (srv == SECSuccess && !(policy & NSS_USE_ALG_IN_SSL_KX)) {
  ------------------
  |  |  572|   382k|#define NSS_USE_ALG_IN_SSL_KX 0x00000004           /* used in SSL key exchange */
  ------------------
  |  Branch (98:13): [True: 382k, False: 0]
  |  Branch (98:34): [True: 8.85k, False: 373k]
  ------------------
   99|  8.85k|            ss->namedGroupPreferences[i] = NULL;
  100|  8.85k|            continue;
  101|  8.85k|        }
  102|       |
  103|   373k|        if (group->assumeSupported) {
  ------------------
  |  Branch (103:13): [True: 178k, False: 194k]
  ------------------
  104|   178k|            continue;
  105|   178k|        }
  106|       |
  107|       |        /* For EC groups, we have to test that a key pair can be created. This
  108|       |         * is gross, and expensive, so only do it once. */
  109|   194k|        index = group - ssl_named_groups;
  110|   194k|        PORT_Assert(index < SSL_NAMED_GROUP_COUNT);
  ------------------
  |  |  120|   194k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   194k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 194k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  111|       |
  112|   194k|        arg.group = group;
  113|   194k|        prv = PR_CallOnceWithArg(&gECDHEKeyPairs[index].once,
  114|   194k|                                 ssl_CreateStaticECDHEKeyPair,
  115|   194k|                                 (void *)&arg);
  116|   194k|        PORT_Assert(prv == PR_SUCCESS);
  ------------------
  |  |  120|   194k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   194k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 194k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  117|   194k|        if (prv != PR_SUCCESS) {
  ------------------
  |  Branch (117:13): [True: 0, False: 194k]
  ------------------
  118|      0|            continue;
  119|      0|        }
  120|       |
  121|   194k|        if (!gECDHEKeyPairs[index].keyPair) {
  ------------------
  |  Branch (121:13): [True: 194k, False: 0]
  ------------------
  122|   194k|            ss->namedGroupPreferences[i] = NULL;
  123|   194k|        }
  124|   194k|    }
  125|  17.8k|}
sslgrp.c:ssl_SetupCleanupECDHEKeysOnce:
   43|      1|{
   44|      1|    SECStatus rv = NSS_RegisterShutdown(ssl_CleanupECDHEKeys, NULL);
   45|      1|    return (rv != SECSuccess) ? PR_FAILURE : PR_SUCCESS;
  ------------------
  |  Branch (45:12): [True: 0, False: 1]
  ------------------
   46|      1|}
sslgrp.c:ssl_CleanupECDHEKeys:
   27|      1|{
   28|      1|    unsigned int i;
   29|       |
   30|     34|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; i++) {
  ------------------
  |  |  133|     34|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (30:17): [True: 33, False: 1]
  ------------------
   31|     33|        if (gECDHEKeyPairs[i].keyPair) {
  ------------------
  |  Branch (31:13): [True: 0, False: 33]
  ------------------
   32|      0|            ssl_FreeEphemeralKeyPair(gECDHEKeyPairs[i].keyPair);
   33|      0|        }
   34|     33|    }
   35|      1|    memset(gECDHEKeyPairs, 0, sizeof(gECDHEKeyPairs));
   36|      1|    return SECSuccess;
   37|      1|}
sslgrp.c:ssl_CreateStaticECDHEKeyPair:
   55|     22|{
   56|     22|    const sslSocketAndGroupArg *typed_arg = (sslSocketAndGroupArg *)arg;
   57|     22|    const sslNamedGroupDef *group = typed_arg->group;
   58|     22|    const sslSocket *ss = typed_arg->ss;
   59|     22|    unsigned int i = group - ssl_named_groups;
   60|     22|    SECStatus rv;
   61|       |
   62|     22|    PORT_Assert(group->keaType == ssl_kea_ecdh);
  ------------------
  |  |  120|     22|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     22|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 22, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   63|     22|    PORT_Assert(i < SSL_NAMED_GROUP_COUNT);
  ------------------
  |  |  120|     22|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     22|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 22, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   64|     22|    rv = ssl_CreateECDHEphemeralKeyPair(ss, group,
   65|     22|                                        &gECDHEKeyPairs[i].keyPair);
   66|     22|    if (rv != SECSuccess) {
  ------------------
  |  Branch (66:9): [True: 22, False: 0]
  ------------------
   67|     22|        gECDHEKeyPairs[i].keyPair = NULL;
   68|     22|        SSL_TRC(5, ("%d: SSL[-]: disabling group %d",
  ------------------
  |  |   71|     22|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 22]
  |  |  ------------------
  |  |   72|     22|    ssl_Trace b
  ------------------
   69|     22|                    SSL_GETPID(), group->name));
   70|     22|    }
   71|       |
   72|     22|    return PR_SUCCESS;
   73|     22|}

ssl_InitCallOnce:
   29|      1|{
   30|      1|    int *error = (int *)arg;
   31|      1|    SECStatus rv;
   32|       |
   33|      1|    rv = ssl_InitializePRErrorTable();
   34|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (34:9): [True: 0, False: 1]
  ------------------
   35|      0|        *error = SEC_ERROR_NO_MEMORY;
   36|      0|        return PR_FAILURE;
   37|      0|    }
   38|      1|#ifdef DEBUG
   39|      1|    ssl3_CheckCipherSuiteOrderConsistency();
   40|      1|#endif
   41|       |
   42|      1|    rv = ssl3_ApplyNSSPolicy();
   43|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (43:9): [True: 0, False: 1]
  ------------------
   44|      0|        *error = PORT_GetError();
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
   45|      0|        return PR_FAILURE;
   46|      0|    }
   47|       |
   48|      1|    rv = NSS_RegisterShutdown(ssl_InitShutdown, NULL);
   49|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (49:9): [True: 0, False: 1]
  ------------------
   50|      0|        *error = PORT_GetError();
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
   51|      0|        return PR_FAILURE;
   52|      0|    }
   53|      1|    return PR_SUCCESS;
   54|      1|}
ssl_Init:
   58|  8.85k|{
   59|  8.85k|    int error;
   60|  8.85k|    PRStatus nrv = PR_CallOnceWithArg(&ssl_init, ssl_InitCallOnce, &error);
   61|  8.85k|    if (nrv != PR_SUCCESS) {
  ------------------
  |  Branch (61:9): [True: 0, False: 8.85k]
  ------------------
   62|      0|        PORT_SetError(error);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   63|      0|        return SECFailure;
   64|      0|    }
   65|  8.85k|    return SECSuccess;
   66|  8.85k|}
sslinit.c:ssl_InitShutdown:
   22|      1|{
   23|      1|    memset(&ssl_init, 0, sizeof(ssl_init));
   24|      1|    return SECSuccess;
   25|      1|}

ssl_InitSessionCacheLocks:
  137|  48.1k|{
  138|  48.1k|    if (LocksInitializedEarly) {
  ------------------
  |  Branch (138:9): [True: 0, False: 48.1k]
  ------------------
  139|      0|        return SECSuccess;
  140|      0|    }
  141|       |
  142|  48.1k|    if (lazyInit) {
  ------------------
  |  Branch (142:9): [True: 48.1k, False: 0]
  ------------------
  143|  48.1k|        return (PR_SUCCESS ==
  ------------------
  |  Branch (143:16): [True: 48.1k, False: 0]
  ------------------
  144|  48.1k|                PR_CallOnce(&lockOnce, initSessionCacheLocksLazily))
  145|  48.1k|                   ? SECSuccess
  146|  48.1k|                   : SECFailure;
  147|  48.1k|    }
  148|       |
  149|      0|    if (SECSuccess == InitSessionCacheLocks()) {
  ------------------
  |  Branch (149:9): [True: 0, False: 0]
  ------------------
  150|      0|        LocksInitializedEarly = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  151|      0|        return SECSuccess;
  152|      0|    }
  153|       |
  154|      0|    return SECFailure;
  155|      0|}
ssl_DestroySID:
  169|  25.5k|{
  170|  25.5k|    SSL_TRC(8, ("SSL: destroy sid: sid=0x%x cached=%d", sid, sid->cached));
  ------------------
  |  |   71|  25.5k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 25.5k]
  |  |  ------------------
  |  |   72|  25.5k|    ssl_Trace b
  ------------------
  171|  25.5k|    PORT_Assert(sid->references == 0);
  ------------------
  |  |  120|  25.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  25.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 25.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|  25.5k|    PORT_Assert(sid->cached != in_client_cache);
  ------------------
  |  |  120|  25.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  25.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 25.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|       |
  174|  25.5k|    if (sid->u.ssl3.locked.sessionTicket.ticket.data) {
  ------------------
  |  Branch (174:9): [True: 0, False: 25.5k]
  ------------------
  175|      0|        SECITEM_FreeItem(&sid->u.ssl3.locked.sessionTicket.ticket,
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
  176|      0|                         PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  177|      0|    }
  178|  25.5k|    if (sid->u.ssl3.srvName.data) {
  ------------------
  |  Branch (178:9): [True: 0, False: 25.5k]
  ------------------
  179|      0|        SECITEM_FreeItem(&sid->u.ssl3.srvName, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(&sid->u.ssl3.srvName, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  180|      0|    }
  181|  25.5k|    if (sid->u.ssl3.signedCertTimestamps.data) {
  ------------------
  |  Branch (181:9): [True: 0, False: 25.5k]
  ------------------
  182|      0|        SECITEM_FreeItem(&sid->u.ssl3.signedCertTimestamps, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(&sid->u.ssl3.signedCertTimestamps, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  183|      0|    }
  184|       |
  185|  25.5k|    if (sid->u.ssl3.lock) {
  ------------------
  |  Branch (185:9): [True: 66, False: 25.4k]
  ------------------
  186|     66|        PR_DestroyRWLock(sid->u.ssl3.lock);
  187|     66|    }
  188|       |
  189|  25.5k|    PORT_Free((void *)sid->peerID);
  ------------------
  |  |   60|  25.5k|#define PORT_Free PORT_Free_Util
  ------------------
  190|  25.5k|    PORT_Free((void *)sid->urlSvrName);
  ------------------
  |  |   60|  25.5k|#define PORT_Free PORT_Free_Util
  ------------------
  191|       |
  192|  25.5k|    if (sid->peerCert) {
  ------------------
  |  Branch (192:9): [True: 4.66k, False: 20.8k]
  ------------------
  193|  4.66k|        CERT_DestroyCertificate(sid->peerCert);
  194|  4.66k|    }
  195|  25.5k|    if (sid->peerCertStatus.items) {
  ------------------
  |  Branch (195:9): [True: 8, False: 25.5k]
  ------------------
  196|      8|        SECITEM_FreeArray(&sid->peerCertStatus, PR_FALSE);
  ------------------
  |  |  438|      8|#define PR_FALSE 0
  ------------------
  197|      8|    }
  198|       |
  199|  25.5k|    if (sid->localCert) {
  ------------------
  |  Branch (199:9): [True: 0, False: 25.5k]
  ------------------
  200|      0|        CERT_DestroyCertificate(sid->localCert);
  201|      0|    }
  202|       |
  203|  25.5k|    SECITEM_FreeItem(&sid->u.ssl3.alpnSelection, PR_FALSE);
  ------------------
  |  |  108|  25.5k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&sid->u.ssl3.alpnSelection, PR_FALSE);
  ------------------
  |  |  438|  25.5k|#define PR_FALSE 0
  ------------------
  204|       |
  205|  25.5k|    if (freeIt) {
  ------------------
  |  Branch (205:9): [True: 25.5k, False: 0]
  ------------------
  206|  25.5k|        PORT_ZFree(sid, sizeof(sslSessionID));
  ------------------
  |  |   75|  25.5k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  207|  25.5k|    }
  208|  25.5k|}
ssl_FreeSID:
  234|  25.5k|{
  235|  25.5k|    if (sid) {
  ------------------
  |  Branch (235:9): [True: 25.5k, False: 0]
  ------------------
  236|  25.5k|        LOCK_CACHE;
  ------------------
  |  |   35|  25.5k|#define LOCK_CACHE lock_cache()
  ------------------
  237|  25.5k|        ssl_FreeLockedSID(sid);
  238|  25.5k|        UNLOCK_CACHE;
  ------------------
  |  |   36|  25.5k|#define UNLOCK_CACHE PZ_Unlock(cacheLock)
  |  |  ------------------
  |  |  |  |  246|  25.5k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  239|  25.5k|    }
  240|  25.5k|}
ssl_LookupSID:
  262|  9.84k|{
  263|  9.84k|    sslSessionID **sidp;
  264|  9.84k|    sslSessionID *sid;
  265|       |
  266|  9.84k|    if (!urlSvrName)
  ------------------
  |  Branch (266:9): [True: 0, False: 9.84k]
  ------------------
  267|      0|        return NULL;
  268|  9.84k|    LOCK_CACHE;
  ------------------
  |  |   35|  9.84k|#define LOCK_CACHE lock_cache()
  ------------------
  269|  9.84k|    sidp = &cache;
  270|  9.84k|    while ((sid = *sidp) != 0) {
  ------------------
  |  Branch (270:12): [True: 0, False: 9.84k]
  ------------------
  271|      0|        PORT_Assert(sid->cached == in_client_cache);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  272|      0|        PORT_Assert(sid->references >= 1);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|       |
  274|      0|        SSL_TRC(8, ("SSL: lookup: sid=0x%x", sid));
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  275|       |
  276|      0|        if (sid->expirationTime < now) {
  ------------------
  |  Branch (276:13): [True: 0, False: 0]
  ------------------
  277|       |            /*
  278|       |            ** This session-id timed out.
  279|       |            ** Don't even care who it belongs to, blow it out of our cache.
  280|       |            */
  281|      0|            SSL_TRC(7, ("SSL: lookup, throwing sid out, age=%d refs=%d",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  282|      0|                        now - sid->creationTime, sid->references));
  283|       |
  284|      0|            *sidp = sid->next;                                      /* delink it from the list. */
  285|      0|            sid->cached = invalid_cache;                            /* mark not on list. */
  286|      0|            ssl_FreeLockedSID(sid);                                 /* drop ref count, free. */
  287|      0|        } else if (!memcmp(&sid->addr, addr, sizeof(PRIPv6Addr)) && /* server IP addr matches */
  ------------------
  |  Branch (287:20): [True: 0, False: 0]
  ------------------
  288|      0|                   (sid->port == port) &&                           /* server port matches */
  ------------------
  |  Branch (288:20): [True: 0, False: 0]
  ------------------
  289|       |                   /* proxy (peerID) matches */
  290|      0|                   (((peerID == NULL) && (sid->peerID == NULL)) ||
  ------------------
  |  Branch (290:22): [True: 0, False: 0]
  |  Branch (290:42): [True: 0, False: 0]
  ------------------
  291|      0|                    ((peerID != NULL) && (sid->peerID != NULL) &&
  ------------------
  |  Branch (291:22): [True: 0, False: 0]
  |  Branch (291:42): [True: 0, False: 0]
  ------------------
  292|      0|                     PORT_Strcmp(sid->peerID, peerID) == 0)) &&
  ------------------
  |  |  188|      0|#define PORT_Strcmp strcmp
  ------------------
  |  Branch (292:22): [True: 0, False: 0]
  ------------------
  293|       |                   /* is cacheable */
  294|      0|                   (sid->u.ssl3.keys.resumable) &&
  ------------------
  |  Branch (294:20): [True: 0, False: 0]
  ------------------
  295|       |                   /* server hostname matches. */
  296|      0|                   (sid->urlSvrName != NULL) &&
  ------------------
  |  Branch (296:20): [True: 0, False: 0]
  ------------------
  297|      0|                   (0 == PORT_Strcmp(urlSvrName, sid->urlSvrName))) {
  ------------------
  |  |  188|      0|#define PORT_Strcmp strcmp
  ------------------
  |  Branch (297:20): [True: 0, False: 0]
  ------------------
  298|       |            /* Hit */
  299|      0|            sid->lastAccessTime = now;
  300|      0|            sid->references++;
  301|      0|            break;
  302|      0|        } else {
  303|      0|            sidp = &sid->next;
  304|      0|        }
  305|      0|    }
  306|  9.84k|    UNLOCK_CACHE;
  ------------------
  |  |   36|  9.84k|#define UNLOCK_CACHE PZ_Unlock(cacheLock)
  |  |  ------------------
  |  |  |  |  246|  9.84k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  307|  9.84k|    return sid;
  308|  9.84k|}
ssl_CacheSessionID:
 1123|     89|{
 1124|     89|    sslSecurityInfo *sec = &ss->sec;
 1125|     89|    PORT_Assert(sec);
  ------------------
  |  |  120|     89|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     89|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1126|     89|    PORT_Assert(sec->ci.sid->cached == never_cached);
  ------------------
  |  |  120|     89|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     89|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1127|       |
 1128|     89|    if (sec->ci.sid && !sec->ci.sid->u.ssl3.keys.resumable) {
  ------------------
  |  Branch (1128:9): [True: 89, False: 0]
  |  Branch (1128:24): [True: 0, False: 89]
  ------------------
 1129|      0|        return;
 1130|      0|    }
 1131|       |
 1132|     89|    if (!sec->isServer && ss->resumptionTokenCallback) {
  ------------------
  |  Branch (1132:9): [True: 89, False: 0]
  |  Branch (1132:27): [True: 0, False: 89]
  ------------------
 1133|      0|        ssl_CacheExternalToken(ss);
 1134|      0|        return;
 1135|      0|    }
 1136|       |
 1137|     89|    PORT_Assert(!ss->resumptionTokenCallback);
  ------------------
  |  |  120|     89|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     89|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1138|     89|    if (sec->isServer) {
  ------------------
  |  Branch (1138:9): [True: 0, False: 89]
  ------------------
 1139|      0|        ssl_ServerCacheSessionID(sec->ci.sid, ssl_Time(ss));
 1140|      0|        return;
 1141|      0|    }
 1142|       |
 1143|     89|    CacheSID(sec->ci.sid, ssl_Time(ss));
 1144|     89|}
ssl_UncacheSessionID:
 1148|  7.51k|{
 1149|  7.51k|    if (ss->opt.noCache) {
  ------------------
  |  Branch (1149:9): [True: 3.71k, False: 3.80k]
  ------------------
 1150|  3.71k|        return;
 1151|  3.71k|    }
 1152|       |
 1153|  3.80k|    sslSecurityInfo *sec = &ss->sec;
 1154|  3.80k|    PORT_Assert(sec);
  ------------------
  |  |  120|  3.80k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.80k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.80k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1155|       |
 1156|  3.80k|    if (sec->ci.sid) {
  ------------------
  |  Branch (1156:9): [True: 3.80k, False: 0]
  ------------------
 1157|  3.80k|        if (sec->isServer) {
  ------------------
  |  Branch (1157:13): [True: 0, False: 3.80k]
  ------------------
 1158|      0|            ssl_ServerUncacheSessionID(sec->ci.sid);
 1159|  3.80k|        } else if (!ss->resumptionTokenCallback) {
  ------------------
  |  Branch (1159:20): [True: 3.80k, False: 0]
  ------------------
 1160|  3.80k|            LockAndUncacheSID(sec->ci.sid);
 1161|  3.80k|        }
 1162|  3.80k|    }
 1163|  3.80k|}
SSL_ClearSessionCache:
 1168|  8.85k|{
 1169|  8.85k|    LOCK_CACHE;
  ------------------
  |  |   35|  8.85k|#define LOCK_CACHE lock_cache()
  ------------------
 1170|  8.91k|    while (cache != NULL)
  ------------------
  |  Branch (1170:12): [True: 64, False: 8.85k]
  ------------------
 1171|     64|        UncacheSID(cache);
 1172|  8.85k|    UNLOCK_CACHE;
  ------------------
  |  |   36|  8.85k|#define UNLOCK_CACHE PZ_Unlock(cacheLock)
  |  |  ------------------
  |  |  |  |  246|  8.85k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
 1173|  8.85k|}
sslnonce.c:FreeSessionCacheLocks:
   61|      1|{
   62|      1|    SECStatus rv1, rv2;
   63|      1|    rv1 = ssl_FreeSymWrapKeysLock();
   64|      1|    rv2 = ssl_FreeClientSessionCacheLock();
   65|      1|    if ((SECSuccess == rv1) && (SECSuccess == rv2)) {
  ------------------
  |  Branch (65:9): [True: 1, False: 0]
  |  Branch (65:32): [True: 1, False: 0]
  ------------------
   66|      1|        return SECSuccess;
   67|      1|    }
   68|      0|    return SECFailure;
   69|      1|}
sslnonce.c:ssl_FreeClientSessionCacheLock:
   47|      1|{
   48|      1|    if (cacheLock) {
  ------------------
  |  Branch (48:9): [True: 1, False: 0]
  ------------------
   49|      1|        PZ_DestroyLock(cacheLock);
  ------------------
  |  |  244|      1|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
   50|      1|        cacheLock = NULL;
   51|      1|        return SECSuccess;
   52|      1|    }
   53|      0|    PORT_SetError(SEC_ERROR_NOT_INITIALIZED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   54|      0|    return SECFailure;
   55|      1|}
sslnonce.c:initSessionCacheLocksLazily:
  119|      1|{
  120|      1|    SECStatus rv = InitSessionCacheLocks();
  121|      1|    if (SECSuccess != rv) {
  ------------------
  |  Branch (121:9): [True: 0, False: 1]
  ------------------
  122|      0|        return PR_FAILURE;
  123|      0|    }
  124|      1|    rv = NSS_RegisterShutdown(ssl_ShutdownLocks, NULL);
  125|      1|    PORT_Assert(SECSuccess == rv);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  126|      1|    if (SECSuccess != rv) {
  ------------------
  |  Branch (126:9): [True: 0, False: 1]
  ------------------
  127|      0|        return PR_FAILURE;
  128|      0|    }
  129|      1|    return PR_SUCCESS;
  130|      1|}
sslnonce.c:ssl_ShutdownLocks:
  106|      1|{
  107|      1|    PORT_Assert(PR_FALSE == LocksInitializedEarly);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  108|      1|    if (LocksInitializedEarly) {
  ------------------
  |  Branch (108:9): [True: 0, False: 1]
  ------------------
  109|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  110|      0|        return SECFailure;
  111|      0|    }
  112|      1|    FreeSessionCacheLocks();
  113|      1|    memset(&lockOnce, 0, sizeof(lockOnce));
  114|      1|    return SECSuccess;
  115|      1|}
sslnonce.c:InitSessionCacheLocks:
   73|      1|{
   74|      1|    SECStatus rv1, rv2;
   75|      1|    PRErrorCode rc;
   76|      1|    rv1 = ssl_InitSymWrapKeysLock();
   77|      1|    rv2 = ssl_InitClientSessionCacheLock();
   78|      1|    if ((SECSuccess == rv1) && (SECSuccess == rv2)) {
  ------------------
  |  Branch (78:9): [True: 1, False: 0]
  |  Branch (78:32): [True: 1, False: 0]
  ------------------
   79|      1|        return SECSuccess;
   80|      1|    }
   81|      0|    rc = PORT_GetError();
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
   82|      0|    FreeSessionCacheLocks();
   83|      0|    PORT_SetError(rc);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   84|      0|    return SECFailure;
   85|      1|}
sslnonce.c:ssl_InitClientSessionCacheLock:
   40|      1|{
   41|      1|    cacheLock = PZ_NewLock(nssILockCache);
  ------------------
  |  |  243|      1|#define PZ_NewLock(t) PR_NewLock()
  ------------------
   42|      1|    return cacheLock ? SECSuccess : SECFailure;
  ------------------
  |  Branch (42:12): [True: 1, False: 0]
  ------------------
   43|      1|}
sslnonce.c:lock_cache:
  159|  48.1k|{
  160|  48.1k|    ssl_InitSessionCacheLocks(PR_TRUE);
  ------------------
  |  |  437|  48.1k|#define PR_TRUE 1
  ------------------
  161|  48.1k|    PZ_Lock(cacheLock);
  ------------------
  |  |  245|  48.1k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  162|  48.1k|}
sslnonce.c:ssl_FreeLockedSID:
  219|  25.6k|{
  220|  25.6k|    PORT_Assert(sid->references >= 1);
  ------------------
  |  |  120|  25.6k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  25.6k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 25.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  221|  25.6k|    if (--sid->references == 0) {
  ------------------
  |  Branch (221:9): [True: 25.5k, False: 66]
  ------------------
  222|  25.5k|        ssl_DestroySID(sid, PR_TRUE);
  ------------------
  |  |  437|  25.5k|#define PR_TRUE 1
  ------------------
  223|  25.5k|    }
  224|  25.6k|}
sslnonce.c:CacheSID:
  316|     89|{
  317|     89|    PORT_Assert(sid);
  ------------------
  |  |  120|     89|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     89|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|     89|    PORT_Assert(sid->cached == never_cached);
  ------------------
  |  |  120|     89|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     89|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 89, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  319|       |
  320|     89|    SSL_TRC(8, ("SSL: Cache: sid=0x%x cached=%d addr=0x%08x%08x%08x%08x port=0x%04x "
  ------------------
  |  |   71|     89|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 89]
  |  |  ------------------
  |  |   72|     89|    ssl_Trace b
  ------------------
  321|     89|                "time=%x cached=%d",
  322|     89|                sid, sid->cached, sid->addr.pr_s6_addr32[0],
  323|     89|                sid->addr.pr_s6_addr32[1], sid->addr.pr_s6_addr32[2],
  324|     89|                sid->addr.pr_s6_addr32[3], sid->port, sid->creationTime,
  325|     89|                sid->cached));
  326|       |
  327|     89|    if (!sid->urlSvrName) {
  ------------------
  |  Branch (327:9): [True: 0, False: 89]
  ------------------
  328|       |        /* don't cache this SID because it can never be matched */
  329|      0|        return;
  330|      0|    }
  331|       |
  332|     89|    if (sid->u.ssl3.sessionIDLength == 0 &&
  ------------------
  |  Branch (332:9): [True: 23, False: 66]
  ------------------
  333|     89|        sid->u.ssl3.locked.sessionTicket.ticket.data == NULL)
  ------------------
  |  Branch (333:9): [True: 23, False: 0]
  ------------------
  334|     23|        return;
  335|       |
  336|       |    /* Client generates the SessionID if this was a stateless resume. */
  337|     66|    if (sid->u.ssl3.sessionIDLength == 0) {
  ------------------
  |  Branch (337:9): [True: 0, False: 66]
  ------------------
  338|      0|        SECStatus rv;
  339|      0|        rv = PK11_GenerateRandom(sid->u.ssl3.sessionID,
  340|      0|                                 SSL3_SESSIONID_BYTES);
  ------------------
  |  |  107|      0|#define SSL3_SESSIONID_BYTES 32
  ------------------
  341|      0|        if (rv != SECSuccess)
  ------------------
  |  Branch (341:13): [True: 0, False: 0]
  ------------------
  342|      0|            return;
  343|      0|        sid->u.ssl3.sessionIDLength = SSL3_SESSIONID_BYTES;
  ------------------
  |  |  107|      0|#define SSL3_SESSIONID_BYTES 32
  ------------------
  344|      0|    }
  345|     66|    PRINT_BUF(8, (0, "sessionID:",
  ------------------
  |  |   74|     66|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 66]
  |  |  ------------------
  |  |   75|     66|    ssl_PrintBuf b
  ------------------
  346|     66|                  sid->u.ssl3.sessionID, sid->u.ssl3.sessionIDLength));
  347|       |
  348|     66|    sid->u.ssl3.lock = PR_NewRWLock(PR_RWLOCK_RANK_NONE, NULL);
  ------------------
  |  |   29|     66|#define PR_RWLOCK_RANK_NONE 0
  ------------------
  349|     66|    if (!sid->u.ssl3.lock) {
  ------------------
  |  Branch (349:9): [True: 0, False: 66]
  ------------------
  350|      0|        return;
  351|      0|    }
  352|     66|    PORT_Assert(sid->creationTime != 0);
  ------------------
  |  |  120|     66|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     66|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 66, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  353|     66|    if (!sid->creationTime) {
  ------------------
  |  Branch (353:9): [True: 0, False: 66]
  ------------------
  354|      0|        sid->lastAccessTime = sid->creationTime = creationTime;
  355|      0|    }
  356|     66|    PORT_Assert(sid->expirationTime != 0);
  ------------------
  |  |  120|     66|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     66|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 66, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|     66|    if (!sid->expirationTime) {
  ------------------
  |  Branch (357:9): [True: 0, False: 66]
  ------------------
  358|      0|        sid->expirationTime = sid->creationTime + (PR_MIN(ssl_ticket_lifetime,
  ------------------
  |  |  158|      0|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  359|      0|                                                          sid->u.ssl3.locked.sessionTicket.ticket_lifetime_hint) *
  360|      0|                                                   PR_USEC_PER_SEC);
  ------------------
  |  |   28|      0|#define PR_USEC_PER_SEC     1000000L
  ------------------
  361|      0|    }
  362|       |
  363|       |    /*
  364|       |     * Put sid into the cache.  Bump reference count to indicate that
  365|       |     * cache is holding a reference. Uncache will reduce the cache
  366|       |     * reference.
  367|       |     */
  368|     66|    LOCK_CACHE;
  ------------------
  |  |   35|     66|#define LOCK_CACHE lock_cache()
  ------------------
  369|     66|    sid->references++;
  370|     66|    sid->cached = in_client_cache;
  371|     66|    sid->next = cache;
  372|     66|    cache = sid;
  373|     66|    UNLOCK_CACHE;
  ------------------
  |  |   36|     66|#define UNLOCK_CACHE PZ_Unlock(cacheLock)
  |  |  ------------------
  |  |  |  |  246|     66|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  374|     66|}
sslnonce.c:LockAndUncacheSID:
  421|  3.80k|{
  422|  3.80k|    LOCK_CACHE;
  ------------------
  |  |   35|  3.80k|#define LOCK_CACHE lock_cache()
  ------------------
  423|  3.80k|    UncacheSID(zap);
  424|  3.80k|    UNLOCK_CACHE;
  ------------------
  |  |   36|  3.80k|#define UNLOCK_CACHE PZ_Unlock(cacheLock)
  |  |  ------------------
  |  |  |  |  246|  3.80k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  425|  3.80k|}
sslnonce.c:UncacheSID:
  383|  3.87k|{
  384|  3.87k|    sslSessionID **sidp = &cache;
  385|  3.87k|    sslSessionID *sid;
  386|       |
  387|  3.87k|    if (zap->cached != in_client_cache) {
  ------------------
  |  Branch (387:9): [True: 3.80k, False: 66]
  ------------------
  388|  3.80k|        return;
  389|  3.80k|    }
  390|       |
  391|     66|    SSL_TRC(8, ("SSL: Uncache: zap=0x%x cached=%d addr=0x%08x%08x%08x%08x port=0x%04x "
  ------------------
  |  |   71|     66|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 66]
  |  |  ------------------
  |  |   72|     66|    ssl_Trace b
  ------------------
  392|     66|                "time=%x cipherSuite=%d",
  393|     66|                zap, zap->cached, zap->addr.pr_s6_addr32[0],
  394|     66|                zap->addr.pr_s6_addr32[1], zap->addr.pr_s6_addr32[2],
  395|     66|                zap->addr.pr_s6_addr32[3], zap->port, zap->creationTime,
  396|     66|                zap->u.ssl3.cipherSuite));
  397|       |
  398|       |    /* See if it's in the cache, if so nuke it */
  399|     66|    while ((sid = *sidp) != 0) {
  ------------------
  |  Branch (399:12): [True: 66, False: 0]
  ------------------
  400|     66|        if (sid == zap) {
  ------------------
  |  Branch (400:13): [True: 66, False: 0]
  ------------------
  401|       |            /*
  402|       |            ** Bingo. Reduce reference count by one so that when
  403|       |            ** everyone is done with the sid we can free it up.
  404|       |            */
  405|     66|            *sidp = zap->next;
  406|     66|            zap->cached = invalid_cache;
  407|     66|            ssl_FreeLockedSID(zap);
  408|     66|            return;
  409|     66|        }
  410|      0|        sidp = &sid->next;
  411|      0|    }
  412|     66|}

ssl_CreateMaskingContextInner:
  297|    897|{
  298|    897|    if (!secret || !ctx || (!label && labelLen)) {
  ------------------
  |  Branch (298:9): [True: 0, False: 897]
  |  Branch (298:20): [True: 0, False: 897]
  |  Branch (298:29): [True: 0, False: 897]
  |  Branch (298:39): [True: 0, False: 0]
  ------------------
  299|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  300|      0|        return SECFailure;
  301|      0|    }
  302|       |
  303|    897|    SSLMaskingContext *out = PORT_ZNew(SSLMaskingContext);
  ------------------
  |  |  148|    897|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|    897|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  304|    897|    if (out == NULL) {
  ------------------
  |  Branch (304:9): [True: 0, False: 897]
  ------------------
  305|      0|        goto loser;
  306|      0|    }
  307|       |
  308|    897|    SSLHashType hash;
  309|    897|    const ssl3BulkCipherDef *cipher;
  310|    897|    SECStatus rv = tls13_GetHashAndCipher(version, cipherSuite,
  311|    897|                                          &hash, &cipher);
  312|    897|    if (rv != SECSuccess) {
  ------------------
  |  Branch (312:9): [True: 0, False: 897]
  ------------------
  313|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  314|      0|        goto loser; /* Code already set. */
  315|      0|    }
  316|       |
  317|    897|    out->mech = tls13_SequenceNumberEncryptionMechanism(cipher->calg);
  318|    897|    if (out->mech == CKM_INVALID_MECHANISM) {
  ------------------
  |  |  155|    897|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  |  Branch (318:9): [True: 0, False: 897]
  ------------------
  319|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  320|      0|        goto loser;
  321|      0|    }
  322|       |
  323|       |    // Derive the masking key
  324|    897|    rv = tls13_HkdfExpandLabel(secret, hash,
  325|    897|                               NULL, 0, // Handshake hash.
  326|    897|                               label, labelLen,
  327|    897|                               out->mech,
  328|    897|                               cipher->key_size, variant,
  329|    897|                               &out->secret);
  330|    897|    if (rv != SECSuccess) {
  ------------------
  |  Branch (330:9): [True: 0, False: 897]
  ------------------
  331|      0|        goto loser;
  332|      0|    }
  333|       |
  334|    897|    out->version = version;
  335|    897|    out->cipherSuite = cipherSuite;
  336|       |
  337|    897|    *ctx = out;
  338|    897|    return SECSuccess;
  339|      0|loser:
  340|      0|    SSLExp_DestroyMaskingContext(out);
  341|      0|    return SECFailure;
  342|    897|}
ssl_DestroyMaskingContextInner:
  439|  29.7k|{
  440|  29.7k|    if (!ctx) {
  ------------------
  |  Branch (440:9): [True: 28.8k, False: 897]
  ------------------
  441|  28.8k|        return SECSuccess;
  442|  28.8k|    }
  443|       |
  444|    897|    PK11_FreeSymKey(ctx->secret);
  445|    897|    PORT_ZFree(ctx, sizeof(*ctx));
  ------------------
  |  |   75|    897|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  446|    897|    return SECSuccess;
  447|  29.7k|}

ssl_Do1stHandshake:
   34|  8.85k|{
   35|  8.85k|    SECStatus rv = SECSuccess;
   36|       |
   37|  26.5k|    while (ss->handshake && rv == SECSuccess) {
  ------------------
  |  Branch (37:12): [True: 25.8k, False: 682]
  |  Branch (37:29): [True: 17.7k, False: 8.17k]
  ------------------
   38|  17.7k|        PORT_Assert(ss->opt.noLocks || ssl_Have1stHandshakeLock(ss));
  ------------------
  |  |  120|  17.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  26.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8.66k, False: 9.04k]
  |  |  |  |  |  Branch (208:7): [True: 9.04k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   39|  17.7k|        PORT_Assert(ss->opt.noLocks || !ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  17.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  26.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8.66k, False: 9.04k]
  |  |  |  |  |  Branch (208:7): [True: 9.04k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   40|  17.7k|        PORT_Assert(ss->opt.noLocks || !ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  17.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  26.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8.66k, False: 9.04k]
  |  |  |  |  |  Branch (208:7): [True: 9.04k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   41|  17.7k|        PORT_Assert(ss->opt.noLocks || !ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  17.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  26.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8.66k, False: 9.04k]
  |  |  |  |  |  Branch (208:7): [True: 9.04k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   42|       |
   43|  17.7k|        rv = (*ss->handshake)(ss);
   44|  17.7k|    };
   45|       |
   46|  8.85k|    PORT_Assert(ss->opt.noLocks || !ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.33k, False: 4.52k]
  |  |  |  |  |  Branch (208:7): [True: 4.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   47|  8.85k|    PORT_Assert(ss->opt.noLocks || !ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.33k, False: 4.52k]
  |  |  |  |  |  Branch (208:7): [True: 4.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|  8.85k|    PORT_Assert(ss->opt.noLocks || !ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.33k, False: 4.52k]
  |  |  |  |  |  Branch (208:7): [True: 4.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   49|       |
   50|  8.85k|    return rv;
   51|  8.85k|}
ssl_FinishHandshake:
   55|    137|{
   56|    137|    PORT_Assert(ss->opt.noLocks || ssl_Have1stHandshakeLock(ss));
  ------------------
  |  |  120|    137|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    204|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 70, False: 67]
  |  |  |  |  |  Branch (208:7): [True: 67, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|    137|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    137|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    204|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 70, False: 67]
  |  |  |  |  |  Branch (208:7): [True: 67, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   58|    137|    PORT_Assert(ss->ssl3.hs.echAccepted ||
  ------------------
  |  |  120|    137|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    548|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 137]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 137]
  |  |  |  |  |  Branch (208:7): [True: 137, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   59|    137|                (ss->opt.enableTls13BackendEch &&
   60|    137|                 ss->xtnData.ech &&
   61|    137|                 ss->xtnData.ech->receivedInnerXtn) ==
   62|    137|                    ssl3_ExtensionNegotiated(ss, ssl_tls13_encrypted_client_hello_xtn));
   63|       |
   64|       |    /* If ECH was OFFERED to (echHpkeCtx is set on the client) DISABLED by the
   65|       |     * server through negotiation of a TLS version < 1.3, an 'ech_required'
   66|       |     * alert MUST be sent to inform the server about the intention / possible
   67|       |     * misconfiguration. */
   68|    137|    if (!ss->sec.isServer && ss->ssl3.hs.echHpkeCtx && !ss->ssl3.hs.echAccepted) {
  ------------------
  |  Branch (68:9): [True: 137, False: 0]
  |  Branch (68:30): [True: 0, False: 137]
  |  Branch (68:56): [True: 0, False: 0]
  ------------------
   69|      0|        SSL3_SendAlert(ss, alert_fatal, ech_required);
   70|       |        /* "If [one, none] of the retry_configs contains a supported version,
   71|       |         * the client can regard ECH as securely [replaced, disabled] by the
   72|       |         * server." */
   73|      0|        if (ss->xtnData.ech && ss->xtnData.ech->retryConfigs.len) {
  ------------------
  |  Branch (73:13): [True: 0, False: 0]
  |  Branch (73:32): [True: 0, False: 0]
  ------------------
   74|      0|            PORT_SetError(SSL_ERROR_ECH_RETRY_WITH_ECH);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   75|      0|            ss->xtnData.ech->retryConfigsValid = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
   76|      0|        } else {
   77|      0|            PORT_SetError(SSL_ERROR_ECH_RETRY_WITHOUT_ECH);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   78|      0|        }
   79|      0|        return SECFailure;
   80|      0|    }
   81|       |
   82|    137|    SSL_TRC(3, ("%d: SSL[%d]: handshake is completed", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|    137|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 137]
  |  |  ------------------
  |  |   72|    137|    ssl_Trace b
  ------------------
   83|       |
   84|    137|    ss->firstHsDone = PR_TRUE;
  ------------------
  |  |  437|    137|#define PR_TRUE 1
  ------------------
   85|    137|    ss->enoughFirstHsDone = PR_TRUE;
  ------------------
  |  |  437|    137|#define PR_TRUE 1
  ------------------
   86|    137|    ss->gs.writeOffset = 0;
   87|    137|    ss->gs.readOffset = 0;
   88|       |
   89|    137|    if (ss->handshakeCallback) {
  ------------------
  |  Branch (89:9): [True: 0, False: 137]
  ------------------
   90|      0|        PORT_Assert((ss->ssl3.hs.preliminaryInfo & ssl_preinfo_all) ==
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   91|      0|                    ssl_preinfo_all);
   92|      0|        (ss->handshakeCallback)(ss->fd, ss->handshakeCallbackData);
   93|      0|    }
   94|       |
   95|    137|    ssl_FreeEphemeralKeyPairs(ss);
   96|       |
   97|    137|    return SECSuccess;
   98|    137|}
SSL_ResetHandshake:
  149|  8.85k|{
  150|  8.85k|    sslSocket *ss;
  151|  8.85k|    SECStatus status;
  152|  8.85k|    PRNetAddr addr;
  153|       |
  154|  8.85k|    ss = ssl_FindSocket(s);
  155|  8.85k|    if (!ss) {
  ------------------
  |  Branch (155:9): [True: 0, False: 8.85k]
  ------------------
  156|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in ResetHandshake", SSL_GETPID(), s));
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
  157|      0|        return SECFailure;
  158|      0|    }
  159|       |
  160|       |    /* Don't waste my time */
  161|  8.85k|    if (!ss->opt.useSecurity)
  ------------------
  |  Branch (161:9): [True: 0, False: 8.85k]
  ------------------
  162|      0|        return SECSuccess;
  163|       |
  164|  8.85k|    SSL_LOCK_READER(ss);
  ------------------
  |  | 1376|  8.85k|    if (ss->recvLock)       \
  |  |  ------------------
  |  |  |  Branch (1376:9): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1377|  8.85k|    PZ_Lock(ss->recvLock)
  |  |  ------------------
  |  |  |  |  245|  8.85k|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
  165|  8.85k|    SSL_LOCK_WRITER(ss);
  ------------------
  |  | 1382|  8.85k|    if (ss->sendLock)       \
  |  |  ------------------
  |  |  |  Branch (1382:9): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1383|  8.85k|    PZ_Lock(ss->sendLock)
  |  |  ------------------
  |  |  |  |  245|  8.85k|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
  166|       |
  167|       |    /* Reset handshake state */
  168|  8.85k|    ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|  8.85k|    {                                                             \
  |  | 1391|  8.85k|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1392|  4.52k|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  9.04k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 4.52k]
  |  |  |  |  |  |  |  Branch (208:7): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|  4.52k|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|  4.52k|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|  4.52k|        }                                                         \
  |  | 1396|  8.85k|    }
  ------------------
  169|       |
  170|  8.85k|    ss->firstHsDone = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
  171|  8.85k|    ss->enoughFirstHsDone = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
  172|  8.85k|    if (asServer) {
  ------------------
  |  Branch (172:9): [True: 0, False: 8.85k]
  ------------------
  173|      0|        ss->handshake = ssl_BeginServerHandshake;
  174|      0|        ss->handshaking = sslHandshakingAsServer;
  175|  8.85k|    } else {
  176|  8.85k|        ss->handshake = ssl_BeginClientHandshake;
  177|  8.85k|        ss->handshaking = sslHandshakingAsClient;
  178|  8.85k|    }
  179|       |
  180|  8.85k|    ssl_GetRecvBufLock(ss);
  ------------------
  |  | 1449|  8.85k|    {                                                    \
  |  | 1450|  8.85k|        if (!ss->opt.noLocks) {                          \
  |  |  ------------------
  |  |  |  Branch (1450:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1451|  4.52k|            PORT_Assert(!ssl_HaveSSL3HandshakeLock(ss)); \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1452|  4.52k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));       \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1453|  4.52k|            PZ_EnterMonitor((ss)->recvBufLock);          \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1454|  4.52k|        }                                                \
  |  | 1455|  8.85k|    }
  ------------------
  181|  8.85k|    status = ssl3_InitGather(&ss->gs);
  182|  8.85k|    ssl_ReleaseRecvBufLock(ss);
  ------------------
  |  | 1457|  8.85k|    {                                          \
  |  | 1458|  8.85k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1458:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1459|  8.85k|            PZ_ExitMonitor((ss)->recvBufLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1460|  8.85k|    }
  ------------------
  183|  8.85k|    if (status != SECSuccess)
  ------------------
  |  Branch (183:9): [True: 0, False: 8.85k]
  ------------------
  184|      0|        goto loser;
  185|       |
  186|  8.85k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  8.85k|    {                                                 \
  |  | 1408|  8.85k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1409|  4.52k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  4.52k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  4.52k|        }                                             \
  |  | 1412|  8.85k|    }
  ------------------
  187|  8.85k|    ss->ssl3.hs.canFalseStart = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
  188|  8.85k|    ss->ssl3.hs.restartTarget = NULL;
  189|       |
  190|       |    /*
  191|       |    ** Blow away old security state and get a fresh setup.
  192|       |    */
  193|  8.85k|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|  8.85k|    {                                           \
  |  | 1467|  8.85k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1468|  8.85k|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|  8.85k|    }
  ------------------
  194|  8.85k|    ssl_ResetSecurityInfo(&ss->sec, PR_TRUE);
  ------------------
  |  |  437|  8.85k|#define PR_TRUE 1
  ------------------
  195|  8.85k|    status = ssl_CreateSecurityInfo(ss);
  196|  8.85k|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|  8.85k|    {                                          \
  |  | 1472|  8.85k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1473|  8.85k|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|  8.85k|    }
  ------------------
  197|       |
  198|  8.85k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  8.85k|    {                                                \
  |  | 1415|  8.85k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1416|  8.85k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  8.85k|    }
  ------------------
  199|  8.85k|    ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|  8.85k|    {                                                 \
  |  | 1399|  8.85k|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1400|  8.85k|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|  8.85k|    }
  ------------------
  200|       |
  201|  8.85k|    ssl3_DestroyRemoteExtensions(&ss->ssl3.hs.remoteExtensions);
  202|  8.85k|    ssl3_DestroyRemoteExtensions(&ss->ssl3.hs.echOuterExtensions);
  203|  8.85k|    ssl3_ResetExtensionData(&ss->xtnData, ss);
  204|  8.85k|    tls13_ResetHandshakePsks(ss, &ss->ssl3.hs.psks);
  205|       |
  206|  8.85k|    if (ss->ssl3.hs.echHpkeCtx) {
  ------------------
  |  Branch (206:9): [True: 0, False: 8.85k]
  ------------------
  207|      0|        PK11_HPKE_DestroyContext(ss->ssl3.hs.echHpkeCtx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  208|      0|        ss->ssl3.hs.echHpkeCtx = NULL;
  209|      0|        PORT_Assert(ss->ssl3.hs.echPublicName);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|      0|        PORT_Free((void *)ss->ssl3.hs.echPublicName); /* CONST */
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  211|      0|        ss->ssl3.hs.echPublicName = NULL;
  212|      0|    }
  213|       |    /* Make sure greaseEchBuf is freed in ECH setups without echHpkeCtx. */
  214|  8.85k|    if (ss->ssl3.hs.echHpkeCtx ||
  ------------------
  |  Branch (214:9): [True: 0, False: 8.85k]
  ------------------
  215|  8.85k|        ss->opt.enableTls13BackendEch ||
  ------------------
  |  Branch (215:9): [True: 0, False: 8.85k]
  ------------------
  216|  8.85k|        ss->opt.enableTls13GreaseEch) {
  ------------------
  |  Branch (216:9): [True: 4.39k, False: 4.45k]
  ------------------
  217|  4.39k|        sslBuffer_Clear(&ss->ssl3.hs.greaseEchBuf);
  218|  4.39k|    }
  219|       |
  220|  8.85k|    tls13_ClientGreaseDestroy(ss);
  221|       |
  222|  8.85k|    tls_ClientHelloExtensionPermutationDestroy(ss);
  223|       |
  224|  8.85k|    if (!ss->TCPconnected)
  ------------------
  |  Branch (224:9): [True: 0, False: 8.85k]
  ------------------
  225|      0|        ss->TCPconnected = (PR_SUCCESS == ssl_DefGetpeername(ss, &addr));
  226|       |
  227|  8.85k|loser:
  228|  8.85k|    SSL_UNLOCK_WRITER(ss);
  ------------------
  |  | 1385|  8.85k|    if (ss->sendLock)         \
  |  |  ------------------
  |  |  |  Branch (1385:9): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1386|  8.85k|    PZ_Unlock(ss->sendLock)
  |  |  ------------------
  |  |  |  |  246|  8.85k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  229|  8.85k|    SSL_UNLOCK_READER(ss);
  ------------------
  |  | 1379|  8.85k|    if (ss->recvLock)         \
  |  |  ------------------
  |  |  |  Branch (1379:9): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1380|  8.85k|    PZ_Unlock(ss->recvLock)
  |  |  ------------------
  |  |  |  |  246|  8.85k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  230|       |
  231|  8.85k|    return status;
  232|  8.85k|}
SSL_SetCanFalseStartCallback:
  324|  8.85k|{
  325|  8.85k|    sslSocket *ss;
  326|       |
  327|  8.85k|    ss = ssl_FindSocket(fd);
  328|  8.85k|    if (!ss) {
  ------------------
  |  Branch (328:9): [True: 0, False: 8.85k]
  ------------------
  329|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in SSL_SetCanFalseStartCallback",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
  330|      0|                 SSL_GETPID(), fd));
  331|      0|        return SECFailure;
  332|      0|    }
  333|       |
  334|  8.85k|    if (!ss->opt.useSecurity) {
  ------------------
  |  Branch (334:9): [True: 0, False: 8.85k]
  ------------------
  335|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  336|      0|        return SECFailure;
  337|      0|    }
  338|       |
  339|  8.85k|    ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|  8.85k|    {                                                             \
  |  | 1391|  8.85k|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1392|  8.85k|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  17.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 8.85k]
  |  |  |  |  |  |  |  Branch (208:7): [True: 8.85k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|  8.85k|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|  8.85k|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|  8.85k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|  8.85k|        }                                                         \
  |  | 1396|  8.85k|    }
  ------------------
  340|  8.85k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  8.85k|    {                                                 \
  |  | 1408|  8.85k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1409|  8.85k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  8.85k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  8.85k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  8.85k|        }                                             \
  |  | 1412|  8.85k|    }
  ------------------
  341|       |
  342|  8.85k|    ss->canFalseStartCallback = cb;
  343|  8.85k|    ss->canFalseStartCallbackData = arg;
  344|       |
  345|  8.85k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  8.85k|    {                                                \
  |  | 1415|  8.85k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1416|  8.85k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  8.85k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  8.85k|    }
  ------------------
  346|  8.85k|    ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|  8.85k|    {                                                 \
  |  | 1399|  8.85k|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1400|  8.85k|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  8.85k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|  8.85k|    }
  ------------------
  347|       |
  348|  8.85k|    return SECSuccess;
  349|  8.85k|}
SSL_ForceHandshake:
  384|  12.2k|{
  385|  12.2k|    sslSocket *ss;
  386|  12.2k|    SECStatus rv = SECFailure;
  387|       |
  388|  12.2k|    ss = ssl_FindSocket(fd);
  389|  12.2k|    if (!ss) {
  ------------------
  |  Branch (389:9): [True: 0, False: 12.2k]
  ------------------
  390|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in ForceHandshake",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
  391|      0|                 SSL_GETPID(), fd));
  392|      0|        return rv;
  393|      0|    }
  394|       |
  395|       |    /* Don't waste my time */
  396|  12.2k|    if (!ss->opt.useSecurity)
  ------------------
  |  Branch (396:9): [True: 0, False: 12.2k]
  ------------------
  397|      0|        return SECSuccess;
  398|       |
  399|  12.2k|    if (!ssl_SocketIsBlocking(ss)) {
  ------------------
  |  Branch (399:9): [True: 12.2k, False: 0]
  ------------------
  400|  12.2k|        ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|  12.2k|    {                                           \
  |  | 1467|  12.2k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 6.54k, False: 5.72k]
  |  |  ------------------
  |  | 1468|  12.2k|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|  6.54k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|  12.2k|    }
  ------------------
  401|  12.2k|        if (ss->pendingBuf.len != 0) {
  ------------------
  |  Branch (401:13): [True: 0, False: 12.2k]
  ------------------
  402|      0|            int sent = ssl_SendSavedWriteData(ss);
  403|      0|            if ((sent < 0) && (PORT_GetError() != PR_WOULD_BLOCK_ERROR)) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
                          if ((sent < 0) && (PORT_GetError() != PR_WOULD_BLOCK_ERROR)) {
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (403:17): [True: 0, False: 0]
  |  Branch (403:31): [True: 0, False: 0]
  ------------------
  404|      0|                ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|      0|    {                                          \
  |  | 1472|      0|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1473|      0|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|      0|    }
  ------------------
  405|      0|                return SECFailure;
  406|      0|            }
  407|      0|        }
  408|  12.2k|        ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|  12.2k|    {                                          \
  |  | 1472|  12.2k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 6.54k, False: 5.72k]
  |  |  ------------------
  |  | 1473|  12.2k|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|  6.54k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|  12.2k|    }
  ------------------
  409|  12.2k|    }
  410|       |
  411|  12.2k|    ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|  12.2k|    {                                                             \
  |  | 1391|  12.2k|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 6.54k, False: 5.72k]
  |  |  ------------------
  |  | 1392|  6.54k|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|  6.54k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  13.0k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 6.54k]
  |  |  |  |  |  |  |  Branch (208:7): [True: 6.54k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|  6.54k|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|  6.54k|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|  6.54k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|  6.54k|        }                                                         \
  |  | 1396|  12.2k|    }
  ------------------
  412|       |
  413|  12.2k|    if (ss->version >= SSL_LIBRARY_VERSION_3_0) {
  ------------------
  |  |   17|  12.2k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (413:9): [True: 3.40k, False: 8.85k]
  ------------------
  414|  3.40k|        int gatherResult;
  415|       |
  416|  3.40k|        ssl_GetRecvBufLock(ss);
  ------------------
  |  | 1449|  3.40k|    {                                                    \
  |  | 1450|  3.40k|        if (!ss->opt.noLocks) {                          \
  |  |  ------------------
  |  |  |  Branch (1450:13): [True: 2.02k, False: 1.38k]
  |  |  ------------------
  |  | 1451|  2.02k|            PORT_Assert(!ssl_HaveSSL3HandshakeLock(ss)); \
  |  |  ------------------
  |  |  |  |  120|  2.02k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  2.02k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 2.02k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1452|  2.02k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));       \
  |  |  ------------------
  |  |  |  |  120|  2.02k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  2.02k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 2.02k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1453|  2.02k|            PZ_EnterMonitor((ss)->recvBufLock);          \
  |  |  ------------------
  |  |  |  |  256|  2.02k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1454|  2.02k|        }                                                \
  |  | 1455|  3.40k|    }
  ------------------
  417|  3.40k|        gatherResult = ssl3_GatherCompleteHandshake(ss, 0);
  418|  3.40k|        ssl_ReleaseRecvBufLock(ss);
  ------------------
  |  | 1457|  3.40k|    {                                          \
  |  | 1458|  3.40k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1458:13): [True: 2.02k, False: 1.38k]
  |  |  ------------------
  |  | 1459|  3.40k|            PZ_ExitMonitor((ss)->recvBufLock); \
  |  |  ------------------
  |  |  |  |  257|  2.02k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1460|  3.40k|    }
  ------------------
  419|  3.40k|        if (gatherResult > 0) {
  ------------------
  |  Branch (419:13): [True: 4, False: 3.40k]
  ------------------
  420|      4|            rv = SECSuccess;
  421|  3.40k|        } else {
  422|  3.40k|            if (gatherResult == 0) {
  ------------------
  |  Branch (422:17): [True: 577, False: 2.82k]
  ------------------
  423|    577|                PORT_SetError(PR_END_OF_FILE_ERROR);
  ------------------
  |  |   65|    577|#define PORT_SetError PORT_SetError_Util
  ------------------
                              PORT_SetError(PR_END_OF_FILE_ERROR);
  ------------------
  |  |  202|    577|#define PR_END_OF_FILE_ERROR                     (-5938L)
  ------------------
  424|    577|            }
  425|       |            /* We can rely on ssl3_GatherCompleteHandshake to set
  426|       |             * PR_WOULD_BLOCK_ERROR as needed here. */
  427|  3.40k|            rv = SECFailure;
  428|  3.40k|        }
  429|  8.85k|    } else {
  430|  8.85k|        PORT_Assert(!ss->firstHsDone);
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  431|  8.85k|        rv = ssl_Do1stHandshake(ss);
  432|  8.85k|    }
  433|       |
  434|  12.2k|    ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|  12.2k|    {                                                 \
  |  | 1399|  12.2k|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 6.54k, False: 5.72k]
  |  |  ------------------
  |  | 1400|  12.2k|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  6.54k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|  12.2k|    }
  ------------------
  435|       |
  436|  12.2k|    return rv;
  437|  12.2k|}
ssl_SaveWriteData:
  462|  16.2k|{
  463|  16.2k|    SECStatus rv;
  464|       |
  465|  16.2k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  16.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  24.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 7.96k, False: 8.30k]
  |  |  |  |  |  Branch (208:7): [True: 8.30k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|  16.2k|    rv = sslBuffer_Append(&ss->pendingBuf, data, len);
  467|  16.2k|    SSL_TRC(5, ("%d: SSL[%d]: saving %u bytes of data (%u total saved so far)",
  ------------------
  |  |   71|  16.2k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 16.2k]
  |  |  ------------------
  |  |   72|  16.2k|    ssl_Trace b
  ------------------
  468|  16.2k|                SSL_GETPID(), ss->fd, len, ss->pendingBuf.len));
  469|  16.2k|    return rv;
  470|  16.2k|}
ssl_SendSavedWriteData:
  480|  12.8k|{
  481|  12.8k|    int rv = 0;
  482|       |
  483|  12.8k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  12.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  19.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 6.30k, False: 6.55k]
  |  |  |  |  |  Branch (208:7): [True: 6.55k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  484|  12.8k|    if (ss->pendingBuf.len != 0) {
  ------------------
  |  Branch (484:9): [True: 12.7k, False: 132]
  ------------------
  485|  12.7k|        SSL_TRC(5, ("%d: SSL[%d]: sending %d bytes of saved data",
  ------------------
  |  |   71|  12.7k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 12.7k]
  |  |  ------------------
  |  |   72|  12.7k|    ssl_Trace b
  ------------------
  486|  12.7k|                    SSL_GETPID(), ss->fd, ss->pendingBuf.len));
  487|  12.7k|        rv = ssl_DefSend(ss, ss->pendingBuf.buf, ss->pendingBuf.len, 0);
  488|  12.7k|        if (rv < 0) {
  ------------------
  |  Branch (488:13): [True: 0, False: 12.7k]
  ------------------
  489|      0|            return rv;
  490|      0|        }
  491|  12.7k|        if (rv > ss->pendingBuf.len) {
  ------------------
  |  Branch (491:13): [True: 0, False: 12.7k]
  ------------------
  492|      0|            PORT_Assert(0); /* This shouldn't happen */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  493|      0|            ss->pendingBuf.len = 0;
  494|  12.7k|        } else {
  495|  12.7k|            ss->pendingBuf.len -= rv;
  496|  12.7k|        }
  497|  12.7k|        if (ss->pendingBuf.len > 0 && rv > 0) {
  ------------------
  |  Branch (497:13): [True: 0, False: 12.7k]
  |  Branch (497:39): [True: 0, False: 0]
  ------------------
  498|       |            /* UGH !! This shifts the whole buffer down by copying it */
  499|      0|            PORT_Memmove(ss->pendingBuf.buf, ss->pendingBuf.buf + rv,
  ------------------
  |  |  181|      0|#define PORT_Memmove memmove
  ------------------
  500|      0|                         ss->pendingBuf.len);
  501|      0|        }
  502|  12.7k|    }
  503|  12.8k|    return rv;
  504|  12.8k|}
ssl_CreateSecurityInfo:
  619|  17.7k|{
  620|  17.7k|    SECStatus status;
  621|       |
  622|  17.7k|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|  17.7k|    {                                           \
  |  | 1467|  17.7k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 13.3k, False: 4.33k]
  |  |  ------------------
  |  | 1468|  17.7k|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|  13.3k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|  17.7k|    }
  ------------------
  623|  17.7k|    status = sslBuffer_Grow(&ss->sec.writeBuf, 4096);
  624|  17.7k|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|  17.7k|    {                                          \
  |  | 1472|  17.7k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 13.3k, False: 4.33k]
  |  |  ------------------
  |  | 1473|  17.7k|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|  13.3k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|  17.7k|    }
  ------------------
  625|       |
  626|  17.7k|    return status;
  627|  17.7k|}
ssl_ResetSecurityInfo:
  649|  17.7k|{
  650|  17.7k|    if (sec->localCert) {
  ------------------
  |  Branch (650:9): [True: 0, False: 17.7k]
  ------------------
  651|      0|        CERT_DestroyCertificate(sec->localCert);
  652|      0|        sec->localCert = NULL;
  653|      0|    }
  654|  17.7k|    if (sec->peerCert) {
  ------------------
  |  Branch (654:9): [True: 5.21k, False: 12.4k]
  ------------------
  655|  5.21k|        CERT_DestroyCertificate(sec->peerCert);
  656|  5.21k|        sec->peerCert = NULL;
  657|  5.21k|    }
  658|  17.7k|    if (sec->peerKey) {
  ------------------
  |  Branch (658:9): [True: 2.11k, False: 15.5k]
  ------------------
  659|  2.11k|        SECKEY_DestroyPublicKey(sec->peerKey);
  660|  2.11k|        sec->peerKey = NULL;
  661|  2.11k|    }
  662|       |
  663|       |    /* cleanup the ci */
  664|  17.7k|    if (sec->ci.sid != NULL) {
  ------------------
  |  Branch (664:9): [True: 8.85k, False: 8.85k]
  ------------------
  665|  8.85k|        ssl_FreeSID(sec->ci.sid);
  666|  8.85k|    }
  667|  17.7k|    PORT_ZFree(sec->ci.sendBuf.buf, sec->ci.sendBuf.space);
  ------------------
  |  |   75|  17.7k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  668|  17.7k|    if (doMemset) {
  ------------------
  |  Branch (668:9): [True: 8.85k, False: 8.85k]
  ------------------
  669|  8.85k|        memset(&sec->ci, 0, sizeof sec->ci);
  670|  8.85k|    }
  671|  17.7k|}
ssl_DestroySecurityInfo:
  680|  8.85k|{
  681|  8.85k|    ssl_ResetSecurityInfo(sec, PR_FALSE);
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
  682|       |
  683|  8.85k|    PORT_ZFree(sec->writeBuf.buf, sec->writeBuf.space);
  ------------------
  |  |   75|  8.85k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  684|  8.85k|    sec->writeBuf.buf = 0;
  685|       |
  686|  8.85k|    memset(sec, 0, sizeof *sec);
  687|  8.85k|}
ssl_SecureClose:
  732|  8.85k|{
  733|  8.85k|    int rv;
  734|       |
  735|  8.85k|    if (!(ss->shutdownHow & ssl_SHUTDOWN_SEND) &&
  ------------------
  |  |  316|  8.85k|#define ssl_SHUTDOWN_SEND 2 /* PR_SHUTDOWN_SEND +1 */
  ------------------
  |  Branch (735:9): [True: 8.85k, False: 0]
  ------------------
  736|  8.85k|        ss->firstHsDone) {
  ------------------
  |  Branch (736:9): [True: 137, False: 8.71k]
  ------------------
  737|       |
  738|       |        /* We don't want the final alert to be Nagle delayed. */
  739|    137|        if (!ss->delayDisabled) {
  ------------------
  |  Branch (739:13): [True: 137, False: 0]
  ------------------
  740|    137|            ssl_EnableNagleDelay(ss, PR_FALSE);
  ------------------
  |  |  438|    137|#define PR_FALSE 0
  ------------------
  741|    137|            ss->delayDisabled = 1;
  742|    137|        }
  743|       |
  744|    137|        (void)SSL3_SendAlert(ss, alert_warning, close_notify);
  745|    137|    }
  746|  8.85k|    rv = ssl_DefClose(ss);
  747|  8.85k|    return rv;
  748|  8.85k|}
ssl_SecureRecv:
  836|  1.10k|{
  837|  1.10k|    int rv = 0;
  838|       |
  839|  1.10k|    if (ss->shutdownHow & ssl_SHUTDOWN_RCV) {
  ------------------
  |  |  315|  1.10k|#define ssl_SHUTDOWN_RCV 1  /* PR_SHUTDOWN_RCV  +1 */
  ------------------
  |  Branch (839:9): [True: 0, False: 1.10k]
  ------------------
  840|      0|        PORT_SetError(PR_SOCKET_SHUTDOWN_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_SOCKET_SHUTDOWN_ERROR);
  ------------------
  |  |  229|      0|#define PR_SOCKET_SHUTDOWN_ERROR                 (-5929L)
  ------------------
  841|      0|        return PR_FAILURE;
  842|      0|    }
  843|  1.10k|    if (flags & ~PR_MSG_PEEK) {
  ------------------
  |  | 1441|  1.10k|#define PR_MSG_PEEK 0x2
  ------------------
  |  Branch (843:9): [True: 0, False: 1.10k]
  ------------------
  844|      0|        PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
  845|      0|        return PR_FAILURE;
  846|      0|    }
  847|       |
  848|  1.10k|    if (!ssl_SocketIsBlocking(ss) && !ss->opt.fdx) {
  ------------------
  |  Branch (848:9): [True: 1.10k, False: 0]
  |  Branch (848:38): [True: 1.10k, False: 0]
  ------------------
  849|  1.10k|        ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|  1.10k|    {                                           \
  |  | 1467|  1.10k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 548, False: 557]
  |  |  ------------------
  |  | 1468|  1.10k|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|    548|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|  1.10k|    }
  ------------------
  850|  1.10k|        if (ss->pendingBuf.len != 0) {
  ------------------
  |  Branch (850:13): [True: 0, False: 1.10k]
  ------------------
  851|      0|            rv = ssl_SendSavedWriteData(ss);
  852|      0|            if ((rv < 0) && (PORT_GetError() != PR_WOULD_BLOCK_ERROR)) {
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
                          if ((rv < 0) && (PORT_GetError() != PR_WOULD_BLOCK_ERROR)) {
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (852:17): [True: 0, False: 0]
  |  Branch (852:29): [True: 0, False: 0]
  ------------------
  853|      0|                ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|      0|    {                                          \
  |  | 1472|      0|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1473|      0|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|      0|    }
  ------------------
  854|      0|                return SECFailure;
  855|      0|            }
  856|      0|        }
  857|  1.10k|        ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|  1.10k|    {                                          \
  |  | 1472|  1.10k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 548, False: 557]
  |  |  ------------------
  |  | 1473|  1.10k|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|    548|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|  1.10k|    }
  ------------------
  858|  1.10k|    }
  859|       |
  860|  1.10k|    rv = 0;
  861|  1.10k|    if (!PR_CLIST_IS_EMPTY(&ss->ssl3.hs.bufferedEarlyData)) {
  ------------------
  |  |   94|  1.10k|    ((_l)->next == (_l))
  ------------------
  |  Branch (861:9): [True: 0, False: 1.10k]
  ------------------
  862|      0|        PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  863|      0|        return tls13_Read0RttData(ss, buf, len);
  864|      0|    }
  865|       |
  866|       |    /* If any of these is non-zero, the initial handshake is not done. */
  867|  1.10k|    if (!ss->firstHsDone) {
  ------------------
  |  Branch (867:9): [True: 600, False: 505]
  ------------------
  868|    600|        ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|    600|    {                                                             \
  |  | 1391|    600|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 289, False: 311]
  |  |  ------------------
  |  | 1392|    289|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|    289|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|    578|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 289]
  |  |  |  |  |  |  |  Branch (208:7): [True: 289, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|    289|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|    289|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|    289|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|    289|        }                                                         \
  |  | 1396|    600|    }
  ------------------
  869|    600|        if (ss->handshake) {
  ------------------
  |  Branch (869:13): [True: 4, False: 596]
  ------------------
  870|      4|            rv = ssl_Do1stHandshake(ss);
  871|      4|        }
  872|    600|        ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|    600|    {                                                 \
  |  | 1399|    600|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 289, False: 311]
  |  |  ------------------
  |  | 1400|    600|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|    289|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|    600|    }
  ------------------
  873|    600|    } else {
  874|    505|        if (tls13_CheckKeyUpdate(ss, ssl_secret_read) != SECSuccess) {
  ------------------
  |  Branch (874:13): [True: 0, False: 505]
  ------------------
  875|      0|            rv = PR_FAILURE;
  876|      0|        }
  877|    505|    }
  878|  1.10k|    if (rv < 0) {
  ------------------
  |  Branch (878:9): [True: 4, False: 1.10k]
  ------------------
  879|      4|        if (PORT_GetError() == PR_WOULD_BLOCK_ERROR &&
  ------------------
  |  |   62|      4|#define PORT_GetError PORT_GetError_Util
  ------------------
                      if (PORT_GetError() == PR_WOULD_BLOCK_ERROR &&
  ------------------
  |  |   22|      8|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (879:13): [True: 1, False: 3]
  ------------------
  880|      4|            !PR_CLIST_IS_EMPTY(&ss->ssl3.hs.bufferedEarlyData)) {
  ------------------
  |  |   94|      1|    ((_l)->next == (_l))
  ------------------
  |  Branch (880:13): [True: 0, False: 1]
  ------------------
  881|      0|            PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  882|      0|            return tls13_Read0RttData(ss, buf, len);
  883|      0|        }
  884|      4|        return rv;
  885|      4|    }
  886|       |
  887|  1.10k|    if (len == 0)
  ------------------
  |  Branch (887:9): [True: 0, False: 1.10k]
  ------------------
  888|      0|        return 0;
  889|       |
  890|  1.10k|    rv = DoRecv(ss, (unsigned char *)buf, len, flags);
  891|  1.10k|    SSL_TRC(2, ("%d: SSL[%d]: recving %d bytes securely (errno=%d)",
  ------------------
  |  |   71|  1.10k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.10k]
  |  |  ------------------
  |  |   72|  1.10k|    ssl_Trace b
  ------------------
  892|  1.10k|                SSL_GETPID(), ss->fd, rv, PORT_GetError()));
  893|  1.10k|    return rv;
  894|  1.10k|}
ssl_SecureRead:
  898|  1.10k|{
  899|  1.10k|    return ssl_SecureRecv(ss, buf, len, 0);
  900|  1.10k|}
ssl_SecureSend:
  905|    419|{
  906|    419|    int rv = 0;
  907|    419|    PRBool zeroRtt = PR_FALSE;
  ------------------
  |  |  438|    419|#define PR_FALSE 0
  ------------------
  908|       |
  909|    419|    SSL_TRC(2, ("%d: SSL[%d]: SecureSend: sending %d bytes",
  ------------------
  |  |   71|    419|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 419]
  |  |  ------------------
  |  |   72|    419|    ssl_Trace b
  ------------------
  910|    419|                SSL_GETPID(), ss->fd, len));
  911|       |
  912|    419|    if (ss->shutdownHow & ssl_SHUTDOWN_SEND) {
  ------------------
  |  |  316|    419|#define ssl_SHUTDOWN_SEND 2 /* PR_SHUTDOWN_SEND +1 */
  ------------------
  |  Branch (912:9): [True: 0, False: 419]
  ------------------
  913|      0|        PORT_SetError(PR_SOCKET_SHUTDOWN_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_SOCKET_SHUTDOWN_ERROR);
  ------------------
  |  |  229|      0|#define PR_SOCKET_SHUTDOWN_ERROR                 (-5929L)
  ------------------
  914|      0|        rv = PR_FAILURE;
  915|      0|        goto done;
  916|      0|    }
  917|    419|    if (flags) {
  ------------------
  |  Branch (917:9): [True: 0, False: 419]
  ------------------
  918|      0|        PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
  919|      0|        rv = PR_FAILURE;
  920|      0|        goto done;
  921|      0|    }
  922|       |
  923|    419|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|    419|    {                                           \
  |  | 1467|    419|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 220, False: 199]
  |  |  ------------------
  |  | 1468|    419|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|    220|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|    419|    }
  ------------------
  924|    419|    if (ss->pendingBuf.len != 0) {
  ------------------
  |  Branch (924:9): [True: 0, False: 419]
  ------------------
  925|      0|        PORT_Assert(ss->pendingBuf.len > 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  926|      0|        rv = ssl_SendSavedWriteData(ss);
  927|      0|        if (rv >= 0 && ss->pendingBuf.len != 0) {
  ------------------
  |  Branch (927:13): [True: 0, False: 0]
  |  Branch (927:24): [True: 0, False: 0]
  ------------------
  928|      0|            PORT_Assert(ss->pendingBuf.len > 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  929|      0|            PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                          PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|      0|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  930|      0|            rv = SECFailure;
  931|      0|        }
  932|      0|    }
  933|    419|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|    419|    {                                          \
  |  | 1472|    419|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 220, False: 199]
  |  |  ------------------
  |  | 1473|    419|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|    220|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|    419|    }
  ------------------
  934|    419|    if (rv < 0) {
  ------------------
  |  Branch (934:9): [True: 0, False: 419]
  ------------------
  935|      0|        goto done;
  936|      0|    }
  937|       |
  938|    419|    if (len > 0)
  ------------------
  |  Branch (938:9): [True: 419, False: 0]
  ------------------
  939|    419|        ss->writerThread = PR_GetCurrentThread();
  940|       |
  941|       |    /* Check to see if we can write even though we're not finished.
  942|       |     *
  943|       |     * Case 1: False start
  944|       |     * Case 2: TLS 1.3 0-RTT
  945|       |     */
  946|    419|    if (!ss->firstHsDone) {
  ------------------
  |  Branch (946:9): [True: 0, False: 419]
  ------------------
  947|      0|        PRBool allowEarlySend = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  948|      0|        PRBool firstClientWrite = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  949|       |
  950|      0|        ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|      0|    {                                                             \
  |  | 1391|      0|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1392|      0|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|      0|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|      0|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|      0|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|      0|        }                                                         \
  |  | 1396|      0|    }
  ------------------
  951|       |        /* The client can sometimes send before the handshake is fully
  952|       |         * complete. In TLS 1.2: false start; in TLS 1.3: 0-RTT. */
  953|      0|        if (!ss->sec.isServer &&
  ------------------
  |  Branch (953:13): [True: 0, False: 0]
  ------------------
  954|      0|            (ss->opt.enableFalseStart || ss->opt.enable0RttData)) {
  ------------------
  |  Branch (954:14): [True: 0, False: 0]
  |  Branch (954:42): [True: 0, False: 0]
  ------------------
  955|      0|            ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|      0|    {                                                 \
  |  | 1408|      0|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1409|      0|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|      0|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|      0|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|      0|        }                                             \
  |  | 1412|      0|    }
  ------------------
  956|      0|            zeroRtt = ss->ssl3.hs.zeroRttState == ssl_0rtt_sent ||
  ------------------
  |  Branch (956:23): [True: 0, False: 0]
  ------------------
  957|      0|                      ss->ssl3.hs.zeroRttState == ssl_0rtt_accepted;
  ------------------
  |  Branch (957:23): [True: 0, False: 0]
  ------------------
  958|      0|            allowEarlySend = ss->ssl3.hs.canFalseStart || zeroRtt;
  ------------------
  |  Branch (958:30): [True: 0, False: 0]
  |  Branch (958:59): [True: 0, False: 0]
  ------------------
  959|      0|            firstClientWrite = ss->ssl3.hs.ws == idle_handshake;
  960|      0|            ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
  961|      0|        }
  962|       |        /* Allow the server to send 0.5 RTT data in TLS 1.3. Requesting a
  963|       |         * certificate implies that the server might condition its sending on
  964|       |         * client authentication, so force servers that do that to wait.
  965|       |         *
  966|       |         * What might not be obvious here is that this allows 0.5 RTT when doing
  967|       |         * PSK-based resumption.  As a result, 0.5 RTT is always enabled when
  968|       |         * early data is accepted.
  969|       |         *
  970|       |         * This check might be more conservative than absolutely necessary.
  971|       |         * It's possible that allowing 0.5 RTT data when the server requests,
  972|       |         * but does not require client authentication is safe because we can
  973|       |         * expect the server to check for a client certificate properly. */
  974|      0|        if (ss->sec.isServer &&
  ------------------
  |  Branch (974:13): [True: 0, False: 0]
  ------------------
  975|      0|            ss->version >= SSL_LIBRARY_VERSION_TLS_1_3 &&
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (975:13): [True: 0, False: 0]
  ------------------
  976|      0|            !tls13_ShouldRequestClientAuth(ss)) {
  ------------------
  |  Branch (976:13): [True: 0, False: 0]
  ------------------
  977|      0|            ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|      0|    {                                                 \
  |  | 1408|      0|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1409|      0|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|      0|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|      0|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|      0|        }                                             \
  |  | 1412|      0|    }
  ------------------
  978|      0|            allowEarlySend = TLS13_IN_HS_STATE(ss, wait_finished);
  ------------------
  |  |   44|      0|    tls13_InHsState(ss, __VA_ARGS__, wait_invalid)
  ------------------
  979|      0|            ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
  980|      0|        }
  981|      0|        if (!allowEarlySend && ss->handshake) {
  ------------------
  |  Branch (981:13): [True: 0, False: 0]
  |  Branch (981:32): [True: 0, False: 0]
  ------------------
  982|      0|            rv = ssl_Do1stHandshake(ss);
  983|      0|        }
  984|      0|        if (firstClientWrite) {
  ------------------
  |  Branch (984:13): [True: 0, False: 0]
  ------------------
  985|       |            /* Wait until after sending ClientHello and double-check 0-RTT. */
  986|      0|            ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|      0|    {                                                 \
  |  | 1408|      0|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1409|      0|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|      0|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|      0|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|      0|        }                                             \
  |  | 1412|      0|    }
  ------------------
  987|      0|            zeroRtt = ss->ssl3.hs.zeroRttState == ssl_0rtt_sent ||
  ------------------
  |  Branch (987:23): [True: 0, False: 0]
  ------------------
  988|      0|                      ss->ssl3.hs.zeroRttState == ssl_0rtt_accepted;
  ------------------
  |  Branch (988:23): [True: 0, False: 0]
  ------------------
  989|      0|            ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
  990|      0|        }
  991|      0|        ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|      0|    {                                                 \
  |  | 1399|      0|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1400|      0|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|      0|    }
  ------------------
  992|      0|    }
  993|       |
  994|    419|    if (rv < 0) {
  ------------------
  |  Branch (994:9): [True: 0, False: 419]
  ------------------
  995|      0|        ss->writerThread = NULL;
  996|      0|        goto done;
  997|      0|    }
  998|       |
  999|    419|    if (ss->firstHsDone) {
  ------------------
  |  Branch (999:9): [True: 419, False: 0]
  ------------------
 1000|    419|        if (tls13_CheckKeyUpdate(ss, ssl_secret_write) != SECSuccess) {
  ------------------
  |  Branch (1000:13): [True: 0, False: 419]
  ------------------
 1001|      0|            rv = PR_FAILURE;
 1002|      0|            goto done;
 1003|      0|        }
 1004|    419|    }
 1005|       |
 1006|    419|    if (zeroRtt) {
  ------------------
  |  Branch (1006:9): [True: 0, False: 419]
  ------------------
 1007|       |        /* There's a limit to the number of early data octets we can send.
 1008|       |         *
 1009|       |         * Note that taking this lock doesn't prevent the cipher specs from
 1010|       |         * being changed out between here and when records are ultimately
 1011|       |         * encrypted.  The only effect of that is to occasionally do an
 1012|       |         * unnecessary short write when data is identified as 0-RTT here but
 1013|       |         * 1-RTT later.
 1014|       |         */
 1015|      0|        ssl_GetSpecReadLock(ss);
  ------------------
  |  | 1422|      0|    {                                           \
  |  | 1423|      0|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1424|      0|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|      0|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|      0|    }
  ------------------
 1016|      0|        len = tls13_LimitEarlyData(ss, ssl_ct_application_data, len);
 1017|      0|        ssl_ReleaseSpecReadLock(ss);
  ------------------
  |  | 1427|      0|    {                                             \
  |  | 1428|      0|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1429|      0|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|      0|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|      0|    }
  ------------------
 1018|      0|    }
 1019|       |
 1020|       |    /* Check for zero length writes after we do housekeeping so we make forward
 1021|       |     * progress.
 1022|       |     */
 1023|    419|    if (len == 0) {
  ------------------
  |  Branch (1023:9): [True: 0, False: 419]
  ------------------
 1024|      0|        rv = 0;
 1025|      0|        goto done;
 1026|      0|    }
 1027|    419|    PORT_Assert(buf != NULL);
  ------------------
  |  |  120|    419|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    419|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 419, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1028|    419|    if (!buf) {
  ------------------
  |  Branch (1028:9): [True: 0, False: 419]
  ------------------
 1029|      0|        PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
 1030|      0|        rv = PR_FAILURE;
 1031|      0|        goto done;
 1032|      0|    }
 1033|       |
 1034|    419|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|    419|    {                                           \
  |  | 1467|    419|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 220, False: 199]
  |  |  ------------------
  |  | 1468|    419|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|    220|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|    419|    }
  ------------------
 1035|    419|    rv = ssl3_SendApplicationData(ss, buf, len, flags);
 1036|    419|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|    419|    {                                          \
  |  | 1472|    419|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 220, False: 199]
  |  |  ------------------
  |  | 1473|    419|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|    220|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|    419|    }
  ------------------
 1037|    419|    ss->writerThread = NULL;
 1038|    419|done:
 1039|    419|    if (rv < 0) {
  ------------------
  |  Branch (1039:9): [True: 0, False: 419]
  ------------------
 1040|      0|        SSL_TRC(2, ("%d: SSL[%d]: SecureSend: returning %d count, error %d",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 1041|      0|                    SSL_GETPID(), ss->fd, rv, PORT_GetError()));
 1042|    419|    } else {
 1043|    419|        SSL_TRC(2, ("%d: SSL[%d]: SecureSend: returning %d count",
  ------------------
  |  |   71|    419|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 419]
  |  |  ------------------
  |  |   72|    419|    ssl_Trace b
  ------------------
 1044|    419|                    SSL_GETPID(), ss->fd, rv));
 1045|    419|    }
 1046|    419|    return rv;
 1047|    419|}
ssl_SecureWrite:
 1051|    419|{
 1052|    419|    return ssl_SecureSend(ss, buf, len, 0);
 1053|    419|}
SSL_SetURL:
 1145|  8.85k|{
 1146|  8.85k|    sslSocket *ss = ssl_FindSocket(fd);
 1147|  8.85k|    SECStatus rv = SECSuccess;
 1148|       |
 1149|  8.85k|    if (!ss) {
  ------------------
  |  Branch (1149:9): [True: 0, False: 8.85k]
  ------------------
 1150|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in SSLSetURL",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
 1151|      0|                 SSL_GETPID(), fd));
 1152|      0|        return SECFailure;
 1153|      0|    }
 1154|  8.85k|    ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|  8.85k|    {                                                             \
  |  | 1391|  8.85k|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1392|  8.85k|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  17.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 8.85k]
  |  |  |  |  |  |  |  Branch (208:7): [True: 8.85k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|  8.85k|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|  8.85k|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|  8.85k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|  8.85k|        }                                                         \
  |  | 1396|  8.85k|    }
  ------------------
 1155|  8.85k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  8.85k|    {                                                 \
  |  | 1408|  8.85k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1409|  8.85k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  8.85k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  8.85k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  8.85k|        }                                             \
  |  | 1412|  8.85k|    }
  ------------------
 1156|       |
 1157|  8.85k|    if (ss->url) {
  ------------------
  |  Branch (1157:9): [True: 0, False: 8.85k]
  ------------------
 1158|      0|        PORT_Free((void *)ss->url); /* CONST */
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1159|      0|    }
 1160|       |
 1161|  8.85k|    ss->url = (const char *)PORT_Strdup(url);
  ------------------
  |  |   69|  8.85k|#define PORT_Strdup PORT_Strdup_Util
  ------------------
 1162|  8.85k|    if (ss->url == NULL) {
  ------------------
  |  Branch (1162:9): [True: 0, False: 8.85k]
  ------------------
 1163|      0|        rv = SECFailure;
 1164|      0|    }
 1165|       |
 1166|  8.85k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  8.85k|    {                                                \
  |  | 1415|  8.85k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1416|  8.85k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  8.85k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  8.85k|    }
  ------------------
 1167|  8.85k|    ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|  8.85k|    {                                                 \
  |  | 1399|  8.85k|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1400|  8.85k|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  8.85k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|  8.85k|    }
  ------------------
 1168|       |
 1169|  8.85k|    return rv;
 1170|  8.85k|}
sslsecur.c:tls13_CheckKeyUpdate:
  781|    924|{
  782|    924|    PRBool keyUpdate;
  783|    924|    ssl3CipherSpec *spec;
  784|    924|    sslSequenceNumber seqNum;
  785|    924|    sslSequenceNumber margin;
  786|    924|    tls13KeyUpdateRequest keyUpdateRequest;
  787|    924|    SECStatus rv = SECSuccess;
  788|       |
  789|    924|    if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|    924|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (789:9): [True: 924, False: 0]
  ------------------
  790|    924|        return SECSuccess;
  791|    924|    }
  792|       |
  793|       |    /* If both sides update at the same number, then this will cause two updates
  794|       |     * to happen at once. The problem is that the KeyUpdate itself consumes a
  795|       |     * sequence number, and that will trigger the reading side to request an
  796|       |     * update.
  797|       |     *
  798|       |     * If we have the writing side update first, the writer will be the one that
  799|       |     * drives the update.  An update by the writer doesn't need a response, so
  800|       |     * it is more efficient overall.  The margins here are pretty arbitrary, but
  801|       |     * having the write margin larger reduces the number of times that a
  802|       |     * KeyUpdate is sent by a reader. */
  803|      0|    ssl_GetSpecReadLock(ss);
  ------------------
  |  | 1422|      0|    {                                           \
  |  | 1423|      0|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1424|      0|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|      0|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|      0|    }
  ------------------
  804|      0|    if (dir == ssl_secret_read) {
  ------------------
  |  Branch (804:9): [True: 0, False: 0]
  ------------------
  805|      0|        spec = ss->ssl3.crSpec;
  806|      0|        margin = spec->cipherDef->max_records / 8;
  807|      0|    } else {
  808|      0|        spec = ss->ssl3.cwSpec;
  809|      0|        margin = spec->cipherDef->max_records / 4;
  810|      0|    }
  811|      0|    seqNum = spec->nextSeqNum;
  812|      0|    keyUpdate = seqNum > spec->cipherDef->max_records - margin;
  813|      0|    ssl_ReleaseSpecReadLock(ss);
  ------------------
  |  | 1427|      0|    {                                             \
  |  | 1428|      0|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1429|      0|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|      0|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|      0|    }
  ------------------
  814|      0|    if (!keyUpdate) {
  ------------------
  |  Branch (814:9): [True: 0, False: 0]
  ------------------
  815|      0|        return SECSuccess;
  816|      0|    }
  817|       |
  818|      0|    SSL_TRC(5, ("%d: SSL[%d]: automatic key update at %llx for %s cipher spec",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  819|      0|                SSL_GETPID(), ss->fd, seqNum,
  820|      0|                (dir == ssl_secret_read) ? "read" : "write"));
  821|      0|    keyUpdateRequest = (dir == ssl_secret_read) ? update_requested : update_not_requested;
  ------------------
  |  Branch (821:24): [True: 0, False: 0]
  ------------------
  822|      0|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|      0|    {                                                 \
  |  | 1408|      0|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1409|      0|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|      0|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|      0|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|      0|        }                                             \
  |  | 1412|      0|    }
  ------------------
  823|      0|    if (ss->ssl3.clientCertRequested) {
  ------------------
  |  Branch (823:9): [True: 0, False: 0]
  ------------------
  824|      0|        ss->ssl3.hs.keyUpdateDeferred = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  825|      0|        ss->ssl3.hs.deferredKeyUpdateRequest = keyUpdateRequest;
  826|      0|    } else {
  827|      0|        rv = tls13_SendKeyUpdate(ss, keyUpdateRequest,
  828|      0|                                 dir == ssl_secret_write /* buffer */);
  829|      0|    }
  830|      0|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
  831|      0|    return rv;
  832|      0|}
sslsecur.c:DoRecv:
  523|  1.10k|{
  524|  1.10k|    int rv;
  525|  1.10k|    int amount;
  526|  1.10k|    int available;
  527|       |
  528|       |    /* ssl3_GatherAppDataRecord may call ssl_FinishHandshake, which needs the
  529|       |     * 1stHandshakeLock. */
  530|  1.10k|    ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|  1.10k|    {                                                             \
  |  | 1391|  1.10k|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 547, False: 554]
  |  |  ------------------
  |  | 1392|    547|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|    547|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  1.09k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 547]
  |  |  |  |  |  |  |  Branch (208:7): [True: 547, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|    547|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|    547|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|    547|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|    547|        }                                                         \
  |  | 1396|  1.10k|    }
  ------------------
  531|  1.10k|    ssl_GetRecvBufLock(ss);
  ------------------
  |  | 1449|  1.10k|    {                                                    \
  |  | 1450|  1.10k|        if (!ss->opt.noLocks) {                          \
  |  |  ------------------
  |  |  |  Branch (1450:13): [True: 547, False: 554]
  |  |  ------------------
  |  | 1451|    547|            PORT_Assert(!ssl_HaveSSL3HandshakeLock(ss)); \
  |  |  ------------------
  |  |  |  |  120|    547|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|    547|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 547, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1452|    547|            PORT_Assert(!ssl_HaveXmitBufLock(ss));       \
  |  |  ------------------
  |  |  |  |  120|    547|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|    547|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 547, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1453|    547|            PZ_EnterMonitor((ss)->recvBufLock);          \
  |  |  ------------------
  |  |  |  |  256|    547|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1454|    547|        }                                                \
  |  | 1455|  1.10k|    }
  ------------------
  532|       |
  533|  1.10k|    available = ss->gs.writeOffset - ss->gs.readOffset;
  534|  1.10k|    if (available == 0) {
  ------------------
  |  Branch (534:9): [True: 1.10k, False: 0]
  ------------------
  535|       |        /* Wait for application data to arrive.  */
  536|  1.10k|        rv = ssl3_GatherAppDataRecord(ss, 0);
  537|  1.10k|        if (rv <= 0) {
  ------------------
  |  Branch (537:13): [True: 676, False: 425]
  ------------------
  538|    676|            if (rv == 0) {
  ------------------
  |  Branch (538:17): [True: 562, False: 114]
  ------------------
  539|       |                /* EOF */
  540|    562|                SSL_TRC(10, ("%d: SSL[%d]: ssl_recv EOF",
  ------------------
  |  |   71|    562|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 562]
  |  |  ------------------
  |  |   72|    562|    ssl_Trace b
  ------------------
  541|    562|                             SSL_GETPID(), ss->fd));
  542|    562|                goto done;
  543|    562|            }
  544|    114|            if (PR_GetError() != PR_WOULD_BLOCK_ERROR) {
  ------------------
  |  |   22|    114|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  |  Branch (544:17): [True: 26, False: 88]
  ------------------
  545|       |                /* Some random error */
  546|     26|                goto done;
  547|     26|            }
  548|       |
  549|       |            /*
  550|       |            ** Gather record is blocked waiting for more record data to
  551|       |            ** arrive. Try to process what we have already received
  552|       |            */
  553|    425|        } else {
  554|       |            /* Gather record has finished getting a complete record */
  555|    425|        }
  556|       |
  557|       |        /* See if any clear data is now available */
  558|    513|        available = ss->gs.writeOffset - ss->gs.readOffset;
  559|    513|        if (available == 0) {
  ------------------
  |  Branch (559:13): [True: 88, False: 425]
  ------------------
  560|       |            /*
  561|       |            ** No partial data is available. Force error code to
  562|       |            ** EWOULDBLOCK so that caller will try again later. Note
  563|       |            ** that the error code is probably EWOULDBLOCK already,
  564|       |            ** but if it isn't (for example, if we received a zero
  565|       |            ** length record) then this will force it to be correct.
  566|       |            */
  567|     88|            PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   65|     88|#define PORT_SetError PORT_SetError_Util
  ------------------
                          PORT_SetError(PR_WOULD_BLOCK_ERROR);
  ------------------
  |  |   22|     88|#define PR_WOULD_BLOCK_ERROR                     (-5998L)
  ------------------
  568|     88|            rv = SECFailure;
  569|     88|            goto done;
  570|     88|        }
  571|    425|        SSL_TRC(30, ("%d: SSL[%d]: partial data ready, available=%d",
  ------------------
  |  |   71|    425|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 425]
  |  |  ------------------
  |  |   72|    425|    ssl_Trace b
  ------------------
  572|    425|                     SSL_GETPID(), ss->fd, available));
  573|    425|    }
  574|       |
  575|    425|    if (IS_DTLS(ss) && (len < available)) {
  ------------------
  |  |  892|    850|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 425, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (575:24): [True: 6, False: 419]
  ------------------
  576|       |        /* DTLS does not allow you to do partial reads */
  577|      6|        SSL_TRC(30, ("%d: SSL[%d]: DTLS short read. len=%d available=%d",
  ------------------
  |  |   71|      6|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 6]
  |  |  ------------------
  |  |   72|      6|    ssl_Trace b
  ------------------
  578|      6|                     SSL_GETPID(), ss->fd, len, available));
  579|      6|        ss->gs.readOffset += available;
  580|      6|        PORT_SetError(SSL_ERROR_RX_SHORT_DTLS_READ);
  ------------------
  |  |   65|      6|#define PORT_SetError PORT_SetError_Util
  ------------------
  581|      6|        rv = SECFailure;
  582|      6|        goto done;
  583|      6|    }
  584|       |
  585|       |    /* Dole out clear data to reader */
  586|    419|    amount = PR_MIN(len, available);
  ------------------
  |  |  158|    419|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 419]
  |  |  ------------------
  ------------------
  587|    419|    PORT_Memcpy(out, ss->gs.buf.buf + ss->gs.readOffset, amount);
  ------------------
  |  |  180|    419|#define PORT_Memcpy memcpy
  ------------------
  588|    419|    if (!(flags & PR_MSG_PEEK)) {
  ------------------
  |  | 1441|    419|#define PR_MSG_PEEK 0x2
  ------------------
  |  Branch (588:9): [True: 419, False: 0]
  ------------------
  589|    419|        ss->gs.readOffset += amount;
  590|    419|    }
  591|    419|    PORT_Assert(ss->gs.readOffset <= ss->gs.writeOffset);
  ------------------
  |  |  120|    419|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    419|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 419, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  592|    419|    rv = amount;
  593|       |
  594|    419|#ifdef DEBUG
  595|       |    /* In Debug builds free and zero gather plaintext buffer after its content
  596|       |     * has been used/copied for advanced ASAN coverage/utilization.
  597|       |     * This frees the buffer after reception of application data,
  598|       |     * non-application data is freed at the end of
  599|       |     * ssl3con.c/ssl3_HandleRecord(). */
  600|    419|    if (ss->gs.writeOffset == ss->gs.readOffset) {
  ------------------
  |  Branch (600:9): [True: 419, False: 0]
  ------------------
  601|    419|        sslBuffer_Clear(&ss->gs.buf);
  602|    419|    }
  603|    419|#endif
  604|       |
  605|    419|    SSL_TRC(30, ("%d: SSL[%d]: amount=%d available=%d",
  ------------------
  |  |   71|    419|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 419]
  |  |  ------------------
  |  |   72|    419|    ssl_Trace b
  ------------------
  606|    419|                 SSL_GETPID(), ss->fd, amount, available));
  607|    419|    PRINT_BUF(4, (ss, "DoRecv receiving plaintext:", out, amount));
  ------------------
  |  |   74|    419|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 419]
  |  |  ------------------
  |  |   75|    419|    ssl_PrintBuf b
  ------------------
  608|       |
  609|  1.10k|done:
  610|  1.10k|    ssl_ReleaseRecvBufLock(ss);
  ------------------
  |  | 1457|  1.10k|    {                                          \
  |  | 1458|  1.10k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1458:13): [True: 547, False: 554]
  |  |  ------------------
  |  | 1459|  1.10k|            PZ_ExitMonitor((ss)->recvBufLock); \
  |  |  ------------------
  |  |  |  |  257|    547|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1460|  1.10k|    }
  ------------------
  611|  1.10k|    ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|  1.10k|    {                                                 \
  |  | 1399|  1.10k|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 547, False: 554]
  |  |  ------------------
  |  | 1400|  1.10k|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|    547|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|  1.10k|    }
  ------------------
  612|  1.10k|    return rv;
  613|    419|}

ssl_FindSocket:
  250|   892k|{
  251|   892k|    PRFileDesc *layer;
  252|   892k|    sslSocket *ss;
  253|       |
  254|   892k|    PORT_Assert(fd != NULL);
  ------------------
  |  |  120|   892k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   892k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 892k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  255|   892k|    PORT_Assert(ssl_layer_id != 0);
  ------------------
  |  |  120|   892k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   892k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 892k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|       |
  257|   892k|    layer = PR_GetIdentitiesLayer(fd, ssl_layer_id);
  258|   892k|    if (layer == NULL) {
  ------------------
  |  Branch (258:9): [True: 0, False: 892k]
  ------------------
  259|      0|        PORT_SetError(PR_BAD_DESCRIPTOR_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_BAD_DESCRIPTOR_ERROR);
  ------------------
  |  |   19|      0|#define PR_BAD_DESCRIPTOR_ERROR                  (-5999L)
  ------------------
  260|      0|        return NULL;
  261|      0|    }
  262|       |
  263|   892k|    ss = (sslSocket *)layer->secret;
  264|       |    /* Set ss->fd lazily. We can't rely on the value of ss->fd set by
  265|       |     * ssl_PushIOLayer because another PR_PushIOLayer call will switch the
  266|       |     * contents of the PRFileDesc pointed by ss->fd and the new layer.
  267|       |     * See bug 807250.
  268|       |     */
  269|   892k|    ss->fd = layer;
  270|   892k|    return ss;
  271|   892k|}
ssl_FreeSocket:
  514|  8.85k|{
  515|       |    /* Get every lock you can imagine!
  516|       |    ** Caller already holds these:
  517|       |    **  SSL_LOCK_READER(ss);
  518|       |    **  SSL_LOCK_WRITER(ss);
  519|       |    */
  520|  8.85k|    ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|  8.85k|    {                                                             \
  |  | 1391|  8.85k|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1392|  4.52k|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  9.04k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 4.52k]
  |  |  |  |  |  |  |  Branch (208:7): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|  4.52k|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|  4.52k|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|  4.52k|        }                                                         \
  |  | 1396|  8.85k|    }
  ------------------
  521|  8.85k|    ssl_GetRecvBufLock(ss);
  ------------------
  |  | 1449|  8.85k|    {                                                    \
  |  | 1450|  8.85k|        if (!ss->opt.noLocks) {                          \
  |  |  ------------------
  |  |  |  Branch (1450:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1451|  4.52k|            PORT_Assert(!ssl_HaveSSL3HandshakeLock(ss)); \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1452|  4.52k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));       \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1453|  4.52k|            PZ_EnterMonitor((ss)->recvBufLock);          \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1454|  4.52k|        }                                                \
  |  | 1455|  8.85k|    }
  ------------------
  522|  8.85k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  8.85k|    {                                                 \
  |  | 1408|  8.85k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1409|  4.52k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  4.52k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.52k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  4.52k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  4.52k|        }                                             \
  |  | 1412|  8.85k|    }
  ------------------
  523|  8.85k|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|  8.85k|    {                                           \
  |  | 1467|  8.85k|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1468|  8.85k|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|  4.52k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|  8.85k|    }
  ------------------
  524|  8.85k|    ssl_GetSpecWriteLock(ss);
  ------------------
  |  | 1435|  8.85k|    {                                            \
  |  | 1436|  8.85k|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1437|  8.85k|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|  4.52k|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|  8.85k|    }
  ------------------
  525|       |
  526|  8.85k|    ssl_DestroySocketContents(ss);
  527|       |
  528|       |    /* Release all the locks acquired above.  */
  529|  8.85k|    SSL_UNLOCK_READER(ss);
  ------------------
  |  | 1379|  8.85k|    if (ss->recvLock)         \
  |  |  ------------------
  |  |  |  Branch (1379:9): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1380|  8.85k|    PZ_Unlock(ss->recvLock)
  |  |  ------------------
  |  |  |  |  246|  8.85k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  530|  8.85k|    SSL_UNLOCK_WRITER(ss);
  ------------------
  |  | 1385|  8.85k|    if (ss->sendLock)         \
  |  |  ------------------
  |  |  |  Branch (1385:9): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1386|  8.85k|    PZ_Unlock(ss->sendLock)
  |  |  ------------------
  |  |  |  |  246|  8.85k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
  531|  8.85k|    ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|  8.85k|    {                                                 \
  |  | 1399|  8.85k|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1400|  8.85k|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|  8.85k|    }
  ------------------
  532|  8.85k|    ssl_ReleaseRecvBufLock(ss);
  ------------------
  |  | 1457|  8.85k|    {                                          \
  |  | 1458|  8.85k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1458:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1459|  8.85k|            PZ_ExitMonitor((ss)->recvBufLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1460|  8.85k|    }
  ------------------
  533|  8.85k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  8.85k|    {                                                \
  |  | 1415|  8.85k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1416|  8.85k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  8.85k|    }
  ------------------
  534|  8.85k|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|  8.85k|    {                                          \
  |  | 1472|  8.85k|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1473|  8.85k|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|  4.52k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|  8.85k|    }
  ------------------
  535|  8.85k|    ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|  8.85k|    {                                              \
  |  | 1441|  8.85k|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 4.52k, False: 4.33k]
  |  |  ------------------
  |  | 1442|  8.85k|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|  4.52k|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|  8.85k|    }
  ------------------
  536|       |
  537|  8.85k|    ssl_DestroyLocks(ss);
  538|       |
  539|  8.85k|#ifdef DEBUG
  540|  8.85k|    PORT_Memset(ss, 0x1f, sizeof *ss);
  ------------------
  |  |  182|  8.85k|#define PORT_Memset memset
  ------------------
  541|  8.85k|#endif
  542|  8.85k|    PORT_Free(ss);
  ------------------
  |  |   60|  8.85k|#define PORT_Free PORT_Free_Util
  ------------------
  543|  8.85k|    return;
  544|  8.85k|}
ssl_EnableNagleDelay:
  549|    137|{
  550|    137|    PRFileDesc *osfd = ss->fd->lower;
  551|    137|    SECStatus rv = SECFailure;
  552|    137|    PRSocketOptionData opt;
  553|       |
  554|    137|    opt.option = PR_SockOpt_NoDelay;
  555|    137|    opt.value.no_delay = (PRBool)!enabled;
  556|       |
  557|    137|    if (osfd->methods->setsocketoption) {
  ------------------
  |  Branch (557:9): [True: 137, False: 0]
  ------------------
  558|    137|        rv = (SECStatus)osfd->methods->setsocketoption(osfd, &opt);
  559|    137|    } else {
  560|      0|        PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
  ------------------
  |  |   40|      0|#define PR_NOT_IMPLEMENTED_ERROR                 (-5992L)
  ------------------
  561|      0|    }
  562|       |
  563|    137|    return rv;
  564|    137|}
SSL_OptionSet:
  669|   168k|{
  670|   168k|    sslSocket *ss = ssl_FindSocket(fd);
  671|   168k|    SECStatus rv = SECSuccess;
  672|   168k|    PRBool holdingLocks;
  673|       |
  674|   168k|    if (!ss) {
  ------------------
  |  Branch (674:9): [True: 0, False: 168k]
  ------------------
  675|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in Enable", SSL_GETPID(), fd));
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
  676|      0|        return SECFailure;
  677|      0|    }
  678|       |
  679|   168k|    holdingLocks = (!ss->opt.noLocks);
  680|   168k|    ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|   168k|    {                                                             \
  |  | 1391|   168k|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 159k, False: 8.66k]
  |  |  ------------------
  |  | 1392|   159k|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|   159k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|   319k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 159k]
  |  |  |  |  |  |  |  Branch (208:7): [True: 159k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|   159k|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|   159k|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|   159k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|   159k|        }                                                         \
  |  | 1396|   168k|    }
  ------------------
  681|   168k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|   168k|    {                                                 \
  |  | 1408|   168k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 159k, False: 8.66k]
  |  |  ------------------
  |  | 1409|   159k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|   159k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|   159k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 159k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|   159k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|   159k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|   159k|        }                                             \
  |  | 1412|   168k|    }
  ------------------
  682|       |
  683|   168k|    switch (which) {
  684|      0|        case SSL_SOCKS:
  ------------------
  |  |   70|      0|#define SSL_SOCKS 2               /* (off by default) */
  ------------------
  |  Branch (684:9): [True: 0, False: 168k]
  ------------------
  685|      0|            ss->opt.useSocks = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  686|      0|            rv = PrepareSocket(ss);
  687|      0|            if (val) {
  ------------------
  |  Branch (687:17): [True: 0, False: 0]
  ------------------
  688|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  689|      0|                rv = SECFailure;
  690|      0|            }
  691|      0|            break;
  692|       |
  693|      0|        case SSL_SECURITY:
  ------------------
  |  |   69|      0|#define SSL_SECURITY 1            /* (on by default) */
  ------------------
  |  Branch (693:9): [True: 0, False: 168k]
  ------------------
  694|      0|            ss->opt.useSecurity = val;
  695|      0|            rv = PrepareSocket(ss);
  696|      0|            break;
  697|       |
  698|      0|        case SSL_REQUEST_CERTIFICATE:
  ------------------
  |  |   71|      0|#define SSL_REQUEST_CERTIFICATE 3 /* (off by default) */
  ------------------
  |  Branch (698:9): [True: 0, False: 168k]
  ------------------
  699|      0|            ss->opt.requestCertificate = val;
  700|      0|            break;
  701|       |
  702|      0|        case SSL_REQUIRE_CERTIFICATE:
  ------------------
  |  |   87|      0|#define SSL_REQUIRE_CERTIFICATE 10 /* (SSL_REQUIRE_FIRST_HANDSHAKE */
  ------------------
  |  Branch (702:9): [True: 0, False: 168k]
  ------------------
  703|      0|            ss->opt.requireCertificate = val;
  704|      0|            break;
  705|       |
  706|      0|        case SSL_HANDSHAKE_AS_CLIENT:
  ------------------
  |  |   72|      0|#define SSL_HANDSHAKE_AS_CLIENT 5 /* force accept to hs as client */
  ------------------
  |  Branch (706:9): [True: 0, False: 168k]
  ------------------
  707|      0|            if (ss->opt.handshakeAsServer && val) {
  ------------------
  |  Branch (707:17): [True: 0, False: 0]
  |  Branch (707:46): [True: 0, False: 0]
  ------------------
  708|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  709|      0|                rv = SECFailure;
  710|      0|                break;
  711|      0|            }
  712|      0|            ss->opt.handshakeAsClient = val;
  713|      0|            break;
  714|       |
  715|      0|        case SSL_HANDSHAKE_AS_SERVER:
  ------------------
  |  |   74|      0|#define SSL_HANDSHAKE_AS_SERVER 6 /* force connect to hs as server */
  ------------------
  |  Branch (715:9): [True: 0, False: 168k]
  ------------------
  716|      0|            if (ss->opt.handshakeAsClient && val) {
  ------------------
  |  Branch (716:17): [True: 0, False: 0]
  |  Branch (716:46): [True: 0, False: 0]
  ------------------
  717|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  718|      0|                rv = SECFailure;
  719|      0|                break;
  720|      0|            }
  721|      0|            ss->opt.handshakeAsServer = val;
  722|      0|            break;
  723|       |
  724|      0|        case SSL_ENABLE_TLS:
  ------------------
  |  |  102|      0|#define SSL_ENABLE_TLS 13 /* enable TLS (on by default) */
  ------------------
  |  Branch (724:9): [True: 0, False: 168k]
  ------------------
  725|      0|            if (IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  726|      0|                if (val) {
  ------------------
  |  Branch (726:21): [True: 0, False: 0]
  ------------------
  727|      0|                    PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  728|      0|                    rv = SECFailure; /* not allowed */
  729|      0|                }
  730|      0|                break;
  731|      0|            }
  732|      0|            ssl_EnableTLS(&ss->vrange, val);
  733|      0|            break;
  734|       |
  735|      0|        case SSL_ENABLE_SSL3:
  ------------------
  |  |   83|      0|#define SSL_ENABLE_SSL3 8 /* enable ssl v3 (on by default) */
  ------------------
  |  Branch (735:9): [True: 0, False: 168k]
  ------------------
  736|      0|            if (IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  737|      0|                if (val) {
  ------------------
  |  Branch (737:21): [True: 0, False: 0]
  ------------------
  738|      0|                    PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  739|      0|                    rv = SECFailure; /* not allowed */
  740|      0|                }
  741|      0|                break;
  742|      0|            }
  743|      0|            ssl_EnableSSL3(&ss->vrange, val);
  744|      0|            break;
  745|       |
  746|      0|        case SSL_ENABLE_SSL2:
  ------------------
  |  |   78|      0|#define SSL_ENABLE_SSL2 7 /* enable ssl v2 (off by default) */
  ------------------
  |  Branch (746:9): [True: 0, False: 168k]
  ------------------
  747|      0|        case SSL_V2_COMPATIBLE_HELLO:
  ------------------
  |  |   96|      0|#define SSL_V2_COMPATIBLE_HELLO 12 /* send v3 client hello in v2 fmt */
  ------------------
  |  Branch (747:9): [True: 0, False: 168k]
  ------------------
  748|       |            /* We no longer support SSL v2.
  749|       |             * However, if an old application requests to disable SSL v2,
  750|       |             * we shouldn't fail.
  751|       |             */
  752|      0|            if (val) {
  ------------------
  |  Branch (752:17): [True: 0, False: 0]
  ------------------
  753|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  754|      0|                rv = SECFailure;
  755|      0|            }
  756|      0|            break;
  757|       |
  758|  8.85k|        case SSL_NO_CACHE:
  ------------------
  |  |   85|  8.85k|#define SSL_NO_CACHE 9             /* don't use the session cache */
  ------------------
  |  Branch (758:9): [True: 8.85k, False: 159k]
  ------------------
  759|  8.85k|            ss->opt.noCache = val;
  760|  8.85k|            break;
  761|       |
  762|      0|        case SSL_ENABLE_FDX:
  ------------------
  |  |   89|      0|#define SSL_ENABLE_FDX 11          /* permit simultaneous read/write */
  ------------------
  |  Branch (762:9): [True: 0, False: 168k]
  ------------------
  763|      0|            if (val && ss->opt.noLocks) {
  ------------------
  |  Branch (763:17): [True: 0, False: 0]
  |  Branch (763:24): [True: 0, False: 0]
  ------------------
  764|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  765|      0|                rv = SECFailure;
  766|      0|            }
  767|      0|            ss->opt.fdx = val;
  768|      0|            break;
  769|       |
  770|      0|        case SSL_ROLLBACK_DETECTION:
  ------------------
  |  |  104|      0|#define SSL_ROLLBACK_DETECTION 14       /* for compatibility, default: on */
  ------------------
  |  Branch (770:9): [True: 0, False: 168k]
  ------------------
  771|      0|            ss->opt.detectRollBack = val;
  772|      0|            break;
  773|       |
  774|      0|        case SSL_NO_STEP_DOWN:
  ------------------
  |  |  105|      0|#define SSL_NO_STEP_DOWN 15             /* (unsupported, deprecated, off) */
  ------------------
  |  Branch (774:9): [True: 0, False: 168k]
  ------------------
  775|      0|            break;
  776|       |
  777|      0|        case SSL_BYPASS_PKCS11:
  ------------------
  |  |  106|      0|#define SSL_BYPASS_PKCS11 16            /* (unsupported, deprecated, off) */
  ------------------
  |  Branch (777:9): [True: 0, False: 168k]
  ------------------
  778|      0|            break;
  779|       |
  780|  8.85k|        case SSL_NO_LOCKS:
  ------------------
  |  |  107|  8.85k|#define SSL_NO_LOCKS 17                 /* Don't use locks for protection */
  ------------------
  |  Branch (780:9): [True: 8.85k, False: 159k]
  ------------------
  781|  8.85k|            if (val && ss->opt.fdx) {
  ------------------
  |  Branch (781:17): [True: 4.33k, False: 4.52k]
  |  Branch (781:24): [True: 0, False: 4.33k]
  ------------------
  782|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  783|      0|                rv = SECFailure;
  784|      0|            }
  785|  8.85k|            if (val && ssl_force_locks)
  ------------------
  |  Branch (785:17): [True: 4.33k, False: 4.52k]
  |  Branch (785:24): [True: 0, False: 4.33k]
  ------------------
  786|      0|                val = PR_FALSE; /* silent override */
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  787|  8.85k|            ss->opt.noLocks = val;
  788|  8.85k|            if (!val && !holdingLocks) {
  ------------------
  |  Branch (788:17): [True: 4.52k, False: 4.33k]
  |  Branch (788:25): [True: 0, False: 4.52k]
  ------------------
  789|      0|                rv = ssl_MakeLocks(ss);
  790|      0|                if (rv != SECSuccess) {
  ------------------
  |  Branch (790:21): [True: 0, False: 0]
  ------------------
  791|      0|                    ss->opt.noLocks = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  792|      0|                }
  793|      0|            }
  794|  8.85k|            break;
  795|       |
  796|  8.85k|        case SSL_ENABLE_SESSION_TICKETS:
  ------------------
  |  |  108|  8.85k|#define SSL_ENABLE_SESSION_TICKETS 18   /* Enable TLS SessionTicket       */
  ------------------
  |  Branch (796:9): [True: 8.85k, False: 159k]
  ------------------
  797|  8.85k|            ss->opt.enableSessionTickets = val;
  798|  8.85k|            break;
  799|       |
  800|  8.85k|        case SSL_ENABLE_DEFLATE:
  ------------------
  |  |  110|  8.85k|#define SSL_ENABLE_DEFLATE 19           /* (unsupported, deprecated, off) */
  ------------------
  |  Branch (800:9): [True: 8.85k, False: 159k]
  ------------------
  801|  8.85k|            ss->opt.enableDeflate = val;
  802|  8.85k|            break;
  803|       |
  804|      0|        case SSL_ENABLE_RENEGOTIATION:
  ------------------
  |  |  111|      0|#define SSL_ENABLE_RENEGOTIATION 20     /* Values below (default: never)  */
  ------------------
  |  Branch (804:9): [True: 0, False: 168k]
  ------------------
  805|      0|            if (IS_DTLS(ss) && val != SSL_RENEGOTIATE_NEVER) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                          if (IS_DTLS(ss) && val != SSL_RENEGOTIATE_NEVER) {
  ------------------
  |  |  711|      0|#define SSL_RENEGOTIATE_NEVER ((PRBool)0)
  ------------------
  |  Branch (805:32): [True: 0, False: 0]
  ------------------
  806|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  807|      0|                rv = SECFailure;
  808|      0|                break;
  809|      0|            }
  810|      0|            ss->opt.enableRenegotiation = val;
  811|      0|            break;
  812|       |
  813|  8.85k|        case SSL_REQUIRE_SAFE_NEGOTIATION:
  ------------------
  |  |  112|  8.85k|#define SSL_REQUIRE_SAFE_NEGOTIATION 21 /* Peer must send Signaling       */
  ------------------
  |  Branch (813:9): [True: 8.85k, False: 159k]
  ------------------
  814|  8.85k|            ss->opt.requireSafeNegotiation = val;
  815|  8.85k|            break;
  816|       |
  817|  8.85k|        case SSL_ENABLE_FALSE_START:
  ------------------
  |  |  117|  8.85k|#define SSL_ENABLE_FALSE_START 22       /* Enable SSL false start (off by */
  ------------------
  |  Branch (817:9): [True: 8.85k, False: 159k]
  ------------------
  818|  8.85k|            ss->opt.enableFalseStart = val;
  819|  8.85k|            break;
  820|       |
  821|  8.85k|        case SSL_CBC_RANDOM_IV:
  ------------------
  |  |  158|  8.85k|#define SSL_CBC_RANDOM_IV 23
  ------------------
  |  Branch (821:9): [True: 8.85k, False: 159k]
  ------------------
  822|  8.85k|            ss->opt.cbcRandomIV = val;
  823|  8.85k|            break;
  824|       |
  825|  8.85k|        case SSL_ENABLE_OCSP_STAPLING:
  ------------------
  |  |  159|  8.85k|#define SSL_ENABLE_OCSP_STAPLING 24 /* Request OCSP stapling (client) */
  ------------------
  |  Branch (825:9): [True: 8.85k, False: 159k]
  ------------------
  826|  8.85k|            ss->opt.enableOCSPStapling = val;
  827|  8.85k|            break;
  828|       |
  829|  8.85k|        case SSL_ENABLE_DELEGATED_CREDENTIALS:
  ------------------
  |  |  328|  8.85k|#define SSL_ENABLE_DELEGATED_CREDENTIALS 40
  ------------------
  |  Branch (829:9): [True: 8.85k, False: 159k]
  ------------------
  830|  8.85k|            ss->opt.enableDelegatedCredentials = val;
  831|  8.85k|            break;
  832|       |
  833|      0|        case SSL_ENABLE_NPN:
  ------------------
  |  |  163|      0|#define SSL_ENABLE_NPN 25
  ------------------
  |  Branch (833:9): [True: 0, False: 168k]
  ------------------
  834|      0|            break;
  835|       |
  836|  8.85k|        case SSL_ENABLE_ALPN:
  ------------------
  |  |  174|  8.85k|#define SSL_ENABLE_ALPN 26
  ------------------
  |  Branch (836:9): [True: 8.85k, False: 159k]
  ------------------
  837|  8.85k|            ss->opt.enableALPN = val;
  838|  8.85k|            break;
  839|       |
  840|      0|        case SSL_REUSE_SERVER_ECDHE_KEY:
  ------------------
  |  |  181|      0|#define SSL_REUSE_SERVER_ECDHE_KEY 27
  ------------------
  |  Branch (840:9): [True: 0, False: 168k]
  ------------------
  841|      0|            ss->opt.reuseServerECDHEKey = val;
  842|      0|            break;
  843|       |
  844|  8.85k|        case SSL_ENABLE_FALLBACK_SCSV:
  ------------------
  |  |  183|  8.85k|#define SSL_ENABLE_FALLBACK_SCSV 28 /* Send fallback SCSV in \
  ------------------
  |  Branch (844:9): [True: 8.85k, False: 159k]
  ------------------
  845|  8.85k|            ss->opt.enableFallbackSCSV = val;
  846|  8.85k|            break;
  847|       |
  848|      0|        case SSL_ENABLE_SERVER_DHE:
  ------------------
  |  |  188|      0|#define SSL_ENABLE_SERVER_DHE 29
  ------------------
  |  Branch (848:9): [True: 0, False: 168k]
  ------------------
  849|      0|            ss->opt.enableServerDhe = val;
  850|      0|            break;
  851|       |
  852|  8.85k|        case SSL_ENABLE_EXTENDED_MASTER_SECRET:
  ------------------
  |  |  195|  8.85k|#define SSL_ENABLE_EXTENDED_MASTER_SECRET 30
  ------------------
  |  Branch (852:9): [True: 8.85k, False: 159k]
  ------------------
  853|  8.85k|            ss->opt.enableExtendedMS = val;
  854|  8.85k|            break;
  855|       |
  856|      0|        case SSL_ENABLE_SIGNED_CERT_TIMESTAMPS:
  ------------------
  |  |  198|      0|#define SSL_ENABLE_SIGNED_CERT_TIMESTAMPS 31
  ------------------
  |  Branch (856:9): [True: 0, False: 168k]
  ------------------
  857|      0|            ss->opt.enableSignedCertTimestamps = val;
  858|      0|            break;
  859|       |
  860|  8.85k|        case SSL_REQUIRE_DH_NAMED_GROUPS:
  ------------------
  |  |  214|  8.85k|#define SSL_REQUIRE_DH_NAMED_GROUPS 32
  ------------------
  |  Branch (860:9): [True: 8.85k, False: 159k]
  ------------------
  861|  8.85k|            ss->opt.requireDHENamedGroups = val;
  862|  8.85k|            break;
  863|       |
  864|  8.85k|        case SSL_ENABLE_0RTT_DATA:
  ------------------
  |  |  244|  8.85k|#define SSL_ENABLE_0RTT_DATA 33
  ------------------
  |  Branch (864:9): [True: 8.85k, False: 159k]
  ------------------
  865|  8.85k|            ss->opt.enable0RttData = val;
  866|  8.85k|            break;
  867|       |
  868|      0|        case SSL_RECORD_SIZE_LIMIT:
  ------------------
  |  |  266|      0|#define SSL_RECORD_SIZE_LIMIT 34
  ------------------
  |  Branch (868:9): [True: 0, False: 168k]
  ------------------
  869|      0|            if (val < 64 || val > (MAX_FRAGMENT_LENGTH + 1)) {
  ------------------
  |  |   35|      0|#define MAX_FRAGMENT_LENGTH 16384
  ------------------
  |  Branch (869:17): [True: 0, False: 0]
  |  Branch (869:29): [True: 0, False: 0]
  ------------------
  870|      0|                PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  871|      0|                rv = SECFailure;
  872|      0|            } else {
  873|      0|                ss->opt.recordSizeLimit = val;
  874|      0|            }
  875|      0|            break;
  876|       |
  877|  8.85k|        case SSL_ENABLE_TLS13_COMPAT_MODE:
  ------------------
  |  |  272|  8.85k|#define SSL_ENABLE_TLS13_COMPAT_MODE 35
  ------------------
  |  Branch (877:9): [True: 8.85k, False: 159k]
  ------------------
  878|  8.85k|            ss->opt.enableTls13CompatMode = val;
  879|  8.85k|            break;
  880|       |
  881|  8.85k|        case SSL_ENABLE_DTLS_SHORT_HEADER:
  ------------------
  |  |  283|  8.85k|#define SSL_ENABLE_DTLS_SHORT_HEADER 36
  ------------------
  |  Branch (881:9): [True: 8.85k, False: 159k]
  ------------------
  882|  8.85k|            ss->opt.enableDtlsShortHeader = val;
  883|  8.85k|            break;
  884|       |
  885|      0|        case SSL_ENABLE_HELLO_DOWNGRADE_CHECK:
  ------------------
  |  |  292|      0|#define SSL_ENABLE_HELLO_DOWNGRADE_CHECK 37
  ------------------
  |  Branch (885:9): [True: 0, False: 168k]
  ------------------
  886|      0|            ss->opt.enableHelloDowngradeCheck = val;
  887|      0|            break;
  888|       |
  889|      0|        case SSL_ENABLE_V2_COMPATIBLE_HELLO:
  ------------------
  |  |  300|      0|#define SSL_ENABLE_V2_COMPATIBLE_HELLO 38
  ------------------
  |  Branch (889:9): [True: 0, False: 168k]
  ------------------
  890|      0|            ss->opt.enableV2CompatibleHello = val;
  891|      0|            break;
  892|       |
  893|  8.85k|        case SSL_ENABLE_POST_HANDSHAKE_AUTH:
  ------------------
  |  |  311|  8.85k|#define SSL_ENABLE_POST_HANDSHAKE_AUTH 39
  ------------------
  |  Branch (893:9): [True: 8.85k, False: 159k]
  ------------------
  894|  8.85k|            ss->opt.enablePostHandshakeAuth = val;
  895|  8.85k|            break;
  896|       |
  897|      0|        case SSL_SUPPRESS_END_OF_EARLY_DATA:
  ------------------
  |  |  347|      0|#define SSL_SUPPRESS_END_OF_EARLY_DATA 41
  ------------------
  |  Branch (897:9): [True: 0, False: 168k]
  ------------------
  898|      0|            ss->opt.suppressEndOfEarlyData = val;
  899|      0|            break;
  900|       |
  901|  8.85k|        case SSL_ENABLE_GREASE:
  ------------------
  |  |  374|  8.85k|#define SSL_ENABLE_GREASE 42
  ------------------
  |  Branch (901:9): [True: 8.85k, False: 159k]
  ------------------
  902|  8.85k|            ss->opt.enableGrease = val;
  903|  8.85k|            break;
  904|       |
  905|  8.85k|        case SSL_ENABLE_CH_EXTENSION_PERMUTATION:
  ------------------
  |  |  381|  8.85k|#define SSL_ENABLE_CH_EXTENSION_PERMUTATION 43
  ------------------
  |  Branch (905:9): [True: 8.85k, False: 159k]
  ------------------
  906|  8.85k|            ss->opt.enableChXtnPermutation = val;
  907|  8.85k|            break;
  908|       |
  909|      0|        default:
  ------------------
  |  Branch (909:9): [True: 0, False: 168k]
  ------------------
  910|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  911|      0|            rv = SECFailure;
  912|   168k|    }
  913|       |
  914|       |    /* We can't use the macros for releasing the locks here,
  915|       |     * because ss->opt.noLocks might have changed just above.
  916|       |     * We must release these locks (monitors) here, if we aquired them above,
  917|       |     * regardless of the current value of ss->opt.noLocks.
  918|       |     */
  919|   168k|    if (holdingLocks) {
  ------------------
  |  Branch (919:9): [True: 159k, False: 8.66k]
  ------------------
  920|   159k|        PZ_ExitMonitor((ss)->ssl3HandshakeLock);
  ------------------
  |  |  257|   159k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  ------------------
  921|   159k|        PZ_ExitMonitor((ss)->firstHandshakeLock);
  ------------------
  |  |  257|   159k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  ------------------
  922|   159k|    }
  923|       |
  924|   168k|    return rv;
  925|   168k|}
SSL_CipherPrefSet:
 1565|   628k|{
 1566|   628k|    sslSocket *ss = ssl_FindSocket(fd);
 1567|   628k|    PRInt32 locks;
 1568|   628k|    SECStatus rv;
 1569|       |
 1570|   628k|    if (!ss) {
  ------------------
  |  Branch (1570:9): [True: 0, False: 628k]
  ------------------
 1571|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in CipherPrefSet", SSL_GETPID(), fd));
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
 1572|      0|        return SECFailure;
 1573|      0|    }
 1574|   628k|    rv = NSS_OptionGet(NSS_DEFAULT_LOCKS, &locks);
  ------------------
  |  |  302|   628k|#define NSS_DEFAULT_LOCKS 0x00d /* lock default values */
  ------------------
 1575|   628k|    if ((rv == SECSuccess) && (locks & NSS_DEFAULT_SSL_LOCK)) {
  ------------------
  |  |  303|   628k|#define NSS_DEFAULT_SSL_LOCK 1  /* lock the ssl default values */
  ------------------
  |  Branch (1575:9): [True: 628k, False: 0]
  |  Branch (1575:31): [True: 0, False: 628k]
  ------------------
 1576|      0|        return SECSuccess;
 1577|      0|    }
 1578|   628k|    if (ssl_IsRemovedCipherSuite(which))
  ------------------
  |  Branch (1578:9): [True: 0, False: 628k]
  ------------------
 1579|      0|        return SECSuccess;
 1580|   628k|    return ssl3_CipherPrefSet(ss, (ssl3CipherSuite)which, enabled);
 1581|   628k|}
ssl_GetDHEParams:
 1991|  4.53k|{
 1992|  4.53k|    switch (groupDef->name) {
 1993|  1.03k|        case ssl_grp_ffdhe_2048:
  ------------------
  |  Branch (1993:9): [True: 1.03k, False: 3.50k]
  ------------------
 1994|  1.03k|            return &ff_dhe_2048_params;
 1995|    739|        case ssl_grp_ffdhe_3072:
  ------------------
  |  Branch (1995:9): [True: 739, False: 3.79k]
  ------------------
 1996|    739|            return &ff_dhe_3072_params;
 1997|  1.20k|        case ssl_grp_ffdhe_4096:
  ------------------
  |  Branch (1997:9): [True: 1.20k, False: 3.33k]
  ------------------
 1998|  1.20k|            return &ff_dhe_4096_params;
 1999|    734|        case ssl_grp_ffdhe_6144:
  ------------------
  |  Branch (1999:9): [True: 734, False: 3.80k]
  ------------------
 2000|    734|            return &ff_dhe_6144_params;
 2001|    826|        case ssl_grp_ffdhe_8192:
  ------------------
  |  Branch (2001:9): [True: 826, False: 3.71k]
  ------------------
 2002|    826|            return &ff_dhe_8192_params;
 2003|      0|        case ssl_grp_ffdhe_custom:
  ------------------
  |  Branch (2003:9): [True: 0, False: 4.53k]
  ------------------
 2004|      0|            PORT_Assert(gWeakDHParams);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2005|      0|            return gWeakDHParams;
 2006|      0|        default:
  ------------------
  |  Branch (2006:9): [True: 0, False: 4.53k]
  ------------------
 2007|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2008|  4.53k|    }
 2009|      0|    return NULL;
 2010|  4.53k|}
ssl_IsValidDHEShare:
 2015|  2.35k|{
 2016|  2.35k|    unsigned int size_p = SECKEY_BigIntegerBitLength(dh_p);
 2017|  2.35k|    unsigned int size_y = SECKEY_BigIntegerBitLength(dh_Ys);
 2018|  2.35k|    unsigned int commonPart;
 2019|  2.35k|    int cmp;
 2020|       |
 2021|  2.35k|    if (dh_p->len == 0 || dh_Ys->len == 0) {
  ------------------
  |  Branch (2021:9): [True: 0, False: 2.35k]
  |  Branch (2021:27): [True: 1, False: 2.35k]
  ------------------
 2022|      1|        return PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 2023|      1|    }
 2024|       |    /* Check that the prime is at least odd. */
 2025|  2.35k|    if ((dh_p->data[dh_p->len - 1] & 0x01) == 0) {
  ------------------
  |  Branch (2025:9): [True: 2, False: 2.35k]
  ------------------
 2026|      2|        return PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 2027|      2|    }
 2028|       |    /* dh_Ys can't be 1, or bigger than dh_p. */
 2029|  2.35k|    if (size_y <= 1 || size_y > size_p) {
  ------------------
  |  Branch (2029:9): [True: 1, False: 2.35k]
  |  Branch (2029:24): [True: 3, False: 2.35k]
  ------------------
 2030|      4|        return PR_FALSE;
  ------------------
  |  |  438|      4|#define PR_FALSE 0
  ------------------
 2031|      4|    }
 2032|       |    /* If dh_Ys is shorter, then it's definitely smaller than p-1. */
 2033|  2.35k|    if (size_y < size_p) {
  ------------------
  |  Branch (2033:9): [True: 2.05k, False: 301]
  ------------------
 2034|  2.05k|        return PR_TRUE;
  ------------------
  |  |  437|  2.05k|#define PR_TRUE 1
  ------------------
 2035|  2.05k|    }
 2036|       |
 2037|       |    /* Compare the common part of each, minus the final octet. */
 2038|    301|    commonPart = (size_p + 7) / 8;
 2039|    301|    PORT_Assert(commonPart <= dh_Ys->len);
  ------------------
  |  |  120|    301|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    301|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 301, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2040|    301|    PORT_Assert(commonPart <= dh_p->len);
  ------------------
  |  |  120|    301|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    301|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 301, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2041|    301|    cmp = PORT_Memcmp(dh_Ys->data + dh_Ys->len - commonPart,
  ------------------
  |  |  179|    301|#define PORT_Memcmp memcmp
  ------------------
 2042|    301|                      dh_p->data + dh_p->len - commonPart, commonPart - 1);
 2043|    301|    if (cmp < 0) {
  ------------------
  |  Branch (2043:9): [True: 290, False: 11]
  ------------------
 2044|    290|        return PR_TRUE;
  ------------------
  |  |  437|    290|#define PR_TRUE 1
  ------------------
 2045|    290|    }
 2046|     11|    if (cmp > 0) {
  ------------------
  |  Branch (2046:9): [True: 8, False: 3]
  ------------------
 2047|      8|        return PR_FALSE;
  ------------------
  |  |  438|      8|#define PR_FALSE 0
  ------------------
 2048|      8|    }
 2049|       |
 2050|       |    /* The last octet of the prime is the only thing that is different and that
 2051|       |     * has to be two greater than the share, otherwise we have Ys == p - 1,
 2052|       |     * and that means small subgroups. */
 2053|      3|    if (dh_Ys->data[dh_Ys->len - 1] >= (dh_p->data[dh_p->len - 1] - 1)) {
  ------------------
  |  Branch (2053:9): [True: 1, False: 2]
  ------------------
 2054|      1|        return PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 2055|      1|    }
 2056|       |
 2057|      2|    return PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 2058|      3|}
ssl_ValidateDHENamedGroup:
 2072|    752|{
 2073|    752|    unsigned int i;
 2074|       |
 2075|  24.8k|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; ++i) {
  ------------------
  |  |  133|  24.8k|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (2075:17): [True: 24.0k, False: 724]
  ------------------
 2076|  24.0k|        const ssl3DHParams *params;
 2077|  24.0k|        if (!ss->namedGroupPreferences[i]) {
  ------------------
  |  Branch (2077:13): [True: 16.6k, False: 7.41k]
  ------------------
 2078|  16.6k|            continue;
 2079|  16.6k|        }
 2080|  7.41k|        if (ss->namedGroupPreferences[i]->keaType != ssl_kea_dh) {
  ------------------
  |  Branch (2080:13): [True: 3.76k, False: 3.65k]
  ------------------
 2081|  3.76k|            continue;
 2082|  3.76k|        }
 2083|       |
 2084|  3.65k|        params = ssl_GetDHEParams(ss->namedGroupPreferences[i]);
 2085|  3.65k|        PORT_Assert(params);
  ------------------
  |  |  120|  3.65k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.65k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.65k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2086|  3.65k|        if (SECITEM_ItemsAreEqual(&params->prime, dh_p)) {
  ------------------
  |  |  109|  3.65k|#define SECITEM_ItemsAreEqual SECITEM_ItemsAreEqual_Util
  ------------------
  |  Branch (2086:13): [True: 28, False: 3.62k]
  ------------------
 2087|     28|            if (!SECITEM_ItemsAreEqual(&params->base, dh_g)) {
  ------------------
  |  |  109|     28|#define SECITEM_ItemsAreEqual SECITEM_ItemsAreEqual_Util
  ------------------
  |  Branch (2087:17): [True: 3, False: 25]
  ------------------
 2088|      3|                return SECFailure;
 2089|      3|            }
 2090|     25|            if (groupDef)
  ------------------
  |  Branch (2090:17): [True: 5, False: 20]
  ------------------
 2091|      5|                *groupDef = ss->namedGroupPreferences[i];
 2092|     25|            if (dhParams)
  ------------------
  |  Branch (2092:17): [True: 5, False: 20]
  ------------------
 2093|      5|                *dhParams = params;
 2094|     25|            return SECSuccess;
 2095|     28|        }
 2096|  3.65k|    }
 2097|       |
 2098|    724|    return SECFailure;
 2099|    752|}
DTLS_ImportFD:
 2202|  8.85k|{
 2203|  8.85k|    return ssl_ImportFD(model, fd, ssl_variant_datagram);
 2204|  8.85k|}
ssl3_GetEffectiveVersionPolicy:
 2585|  47.5k|{
 2586|  47.5k|    SECStatus rv;
 2587|  47.5k|    PRUint32 policyFlag;
 2588|  47.5k|    PRInt32 minPolicy, maxPolicy;
 2589|       |
 2590|  47.5k|    if (variant == ssl_variant_stream) {
  ------------------
  |  Branch (2590:9): [True: 17.7k, False: 29.8k]
  ------------------
 2591|  17.7k|        effectivePolicy->min = SSL_LIBRARY_VERSION_MIN_SUPPORTED_STREAM;
  ------------------
  |  | 1489|  17.7k|#define SSL_LIBRARY_VERSION_MIN_SUPPORTED_STREAM SSL_LIBRARY_VERSION_3_0
  |  |  ------------------
  |  |  |  |   17|  17.7k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  |  |  ------------------
  ------------------
 2592|  17.7k|        effectivePolicy->max = SSL_LIBRARY_VERSION_MAX_SUPPORTED;
  ------------------
  |  | 1497|  17.7k|#define SSL_LIBRARY_VERSION_MAX_SUPPORTED SSL_LIBRARY_VERSION_TLS_1_3
  |  |  ------------------
  |  |  |  |   21|  17.7k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  |  |  ------------------
  ------------------
 2593|  29.8k|    } else {
 2594|  29.8k|        effectivePolicy->min = SSL_LIBRARY_VERSION_MIN_SUPPORTED_DATAGRAM;
  ------------------
  |  | 1488|  29.8k|#define SSL_LIBRARY_VERSION_MIN_SUPPORTED_DATAGRAM SSL_LIBRARY_VERSION_TLS_1_1
  |  |  ------------------
  |  |  |  |   19|  29.8k|#define SSL_LIBRARY_VERSION_TLS_1_1             0x0302
  |  |  ------------------
  ------------------
 2595|  29.8k|        effectivePolicy->max = SSL_LIBRARY_VERSION_MAX_SUPPORTED;
  ------------------
  |  | 1497|  29.8k|#define SSL_LIBRARY_VERSION_MAX_SUPPORTED SSL_LIBRARY_VERSION_TLS_1_3
  |  |  ------------------
  |  |  |  |   21|  29.8k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  |  |  ------------------
  ------------------
 2596|  29.8k|    }
 2597|       |
 2598|  47.5k|    rv = NSS_GetAlgorithmPolicy(SEC_OID_APPLY_SSL_POLICY, &policyFlag);
 2599|  47.5k|    if ((rv != SECSuccess) || !(policyFlag & NSS_USE_POLICY_IN_SSL)) {
  ------------------
  |  |  574|  47.5k|#define NSS_USE_POLICY_IN_SSL 0x00000010           /* enable policy in SSL protocol */
  ------------------
  |  Branch (2599:9): [True: 0, False: 47.5k]
  |  Branch (2599:31): [True: 47.5k, False: 0]
  ------------------
 2600|       |        /* Policy is not active, report library extents. */
 2601|  47.5k|        return SECSuccess;
 2602|  47.5k|    }
 2603|       |
 2604|      0|    rv = NSS_OptionGet(VERSIONS_POLICY_MIN(variant), &minPolicy);
  ------------------
  |  |  119|      0|    (variant == ssl_variant_stream ? NSS_TLS_VERSION_MIN_POLICY : NSS_DTLS_VERSION_MIN_POLICY)
  |  |  ------------------
  |  |  |  |  289|      0|#define NSS_TLS_VERSION_MIN_POLICY 0x008
  |  |  ------------------
  |  |                   (variant == ssl_variant_stream ? NSS_TLS_VERSION_MIN_POLICY : NSS_DTLS_VERSION_MIN_POLICY)
  |  |  ------------------
  |  |  |  |  291|      0|#define NSS_DTLS_VERSION_MIN_POLICY 0x00a
  |  |  ------------------
  |  |  |  Branch (119:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2605|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2605:9): [True: 0, False: 0]
  ------------------
 2606|      0|        return SECFailure;
 2607|      0|    }
 2608|      0|    rv = NSS_OptionGet(VERSIONS_POLICY_MAX(variant), &maxPolicy);
  ------------------
  |  |  121|      0|    (variant == ssl_variant_stream ? NSS_TLS_VERSION_MAX_POLICY : NSS_DTLS_VERSION_MAX_POLICY)
  |  |  ------------------
  |  |  |  |  290|      0|#define NSS_TLS_VERSION_MAX_POLICY 0x009
  |  |  ------------------
  |  |                   (variant == ssl_variant_stream ? NSS_TLS_VERSION_MAX_POLICY : NSS_DTLS_VERSION_MAX_POLICY)
  |  |  ------------------
  |  |  |  |  292|      0|#define NSS_DTLS_VERSION_MAX_POLICY 0x00b
  |  |  ------------------
  |  |  |  Branch (121:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2609|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2609:9): [True: 0, False: 0]
  ------------------
 2610|      0|        return SECFailure;
 2611|      0|    }
 2612|       |
 2613|      0|    if (minPolicy > effectivePolicy->max ||
  ------------------
  |  Branch (2613:9): [True: 0, False: 0]
  ------------------
 2614|      0|        maxPolicy < effectivePolicy->min ||
  ------------------
  |  Branch (2614:9): [True: 0, False: 0]
  ------------------
 2615|      0|        minPolicy > maxPolicy) {
  ------------------
  |  Branch (2615:9): [True: 0, False: 0]
  ------------------
 2616|      0|        return SECFailure;
 2617|      0|    }
 2618|      0|    effectivePolicy->min = PR_MAX(effectivePolicy->min, minPolicy);
  ------------------
  |  |  159|      0|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2619|      0|    effectivePolicy->max = PR_MIN(effectivePolicy->max, maxPolicy);
  ------------------
  |  |  158|      0|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2620|      0|    return SECSuccess;
 2621|      0|}
ssl3_VersionIsSupportedByCode:
 2700|  41.9k|{
 2701|  41.9k|    switch (protocolVariant) {
  ------------------
  |  Branch (2701:13): [True: 0, False: 41.9k]
  ------------------
 2702|  17.7k|        case ssl_variant_stream:
  ------------------
  |  Branch (2702:9): [True: 17.7k, False: 24.2k]
  ------------------
 2703|  17.7k|            return (version >= SSL_LIBRARY_VERSION_MIN_SUPPORTED_STREAM &&
  ------------------
  |  | 1489|  17.7k|#define SSL_LIBRARY_VERSION_MIN_SUPPORTED_STREAM SSL_LIBRARY_VERSION_3_0
  |  |  ------------------
  |  |  |  |   17|  35.4k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  |  |  ------------------
  ------------------
  |  Branch (2703:21): [True: 17.7k, False: 0]
  ------------------
 2704|  17.7k|                    version <= SSL_LIBRARY_VERSION_MAX_SUPPORTED);
  ------------------
  |  | 1497|  17.7k|#define SSL_LIBRARY_VERSION_MAX_SUPPORTED SSL_LIBRARY_VERSION_TLS_1_3
  |  |  ------------------
  |  |  |  |   21|  17.7k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  |  |  ------------------
  ------------------
  |  Branch (2704:21): [True: 17.7k, False: 0]
  ------------------
 2705|  24.2k|        case ssl_variant_datagram:
  ------------------
  |  Branch (2705:9): [True: 24.2k, False: 17.7k]
  ------------------
 2706|  24.2k|            return (version >= SSL_LIBRARY_VERSION_MIN_SUPPORTED_DATAGRAM &&
  ------------------
  |  | 1488|  24.2k|#define SSL_LIBRARY_VERSION_MIN_SUPPORTED_DATAGRAM SSL_LIBRARY_VERSION_TLS_1_1
  |  |  ------------------
  |  |  |  |   19|  48.4k|#define SSL_LIBRARY_VERSION_TLS_1_1             0x0302
  |  |  ------------------
  ------------------
  |  Branch (2706:21): [True: 24.2k, False: 0]
  ------------------
 2707|  24.2k|                    version <= SSL_LIBRARY_VERSION_MAX_SUPPORTED);
  ------------------
  |  | 1497|  24.2k|#define SSL_LIBRARY_VERSION_MAX_SUPPORTED SSL_LIBRARY_VERSION_TLS_1_3
  |  |  ------------------
  |  |  |  |   21|  24.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  |  |  ------------------
  ------------------
  |  Branch (2707:21): [True: 24.2k, False: 0]
  ------------------
 2708|  41.9k|    }
 2709|       |
 2710|       |    /* Can't get here */
 2711|      0|    PORT_Assert(PR_FALSE);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2712|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 2713|  41.9k|}
SSL_VersionRangeGetSupported:
 2747|  17.7k|{
 2748|  17.7k|    SECStatus rv;
 2749|       |
 2750|  17.7k|    if (!vrange) {
  ------------------
  |  Branch (2750:9): [True: 0, False: 17.7k]
  ------------------
 2751|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2752|      0|        return SECFailure;
 2753|      0|    }
 2754|       |
 2755|  17.7k|    switch (protocolVariant) {
 2756|  8.85k|        case ssl_variant_stream:
  ------------------
  |  Branch (2756:9): [True: 8.85k, False: 8.85k]
  ------------------
 2757|  8.85k|            vrange->min = SSL_LIBRARY_VERSION_MIN_SUPPORTED_STREAM;
  ------------------
  |  | 1489|  8.85k|#define SSL_LIBRARY_VERSION_MIN_SUPPORTED_STREAM SSL_LIBRARY_VERSION_3_0
  |  |  ------------------
  |  |  |  |   17|  8.85k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  |  |  ------------------
  ------------------
 2758|  8.85k|            vrange->max = SSL_LIBRARY_VERSION_MAX_SUPPORTED;
  ------------------
  |  | 1497|  8.85k|#define SSL_LIBRARY_VERSION_MAX_SUPPORTED SSL_LIBRARY_VERSION_TLS_1_3
  |  |  ------------------
  |  |  |  |   21|  8.85k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  |  |  ------------------
  ------------------
 2759|       |            /* We don't allow SSLv3 and TLSv1.3 together.
 2760|       |             * However, don't check yet, apply the policy first.
 2761|       |             * Because if the effective supported range doesn't use TLS 1.3,
 2762|       |             * then we don't need to increase the minimum. */
 2763|  8.85k|            break;
 2764|  8.85k|        case ssl_variant_datagram:
  ------------------
  |  Branch (2764:9): [True: 8.85k, False: 8.85k]
  ------------------
 2765|  8.85k|            vrange->min = SSL_LIBRARY_VERSION_MIN_SUPPORTED_DATAGRAM;
  ------------------
  |  | 1488|  8.85k|#define SSL_LIBRARY_VERSION_MIN_SUPPORTED_DATAGRAM SSL_LIBRARY_VERSION_TLS_1_1
  |  |  ------------------
  |  |  |  |   19|  8.85k|#define SSL_LIBRARY_VERSION_TLS_1_1             0x0302
  |  |  ------------------
  ------------------
 2766|  8.85k|            vrange->max = SSL_LIBRARY_VERSION_MAX_SUPPORTED;
  ------------------
  |  | 1497|  8.85k|#define SSL_LIBRARY_VERSION_MAX_SUPPORTED SSL_LIBRARY_VERSION_TLS_1_3
  |  |  ------------------
  |  |  |  |   21|  8.85k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  |  |  ------------------
  ------------------
 2767|  8.85k|            break;
 2768|      0|        default:
  ------------------
  |  Branch (2768:9): [True: 0, False: 17.7k]
  ------------------
 2769|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2770|      0|            return SECFailure;
 2771|  17.7k|    }
 2772|       |
 2773|  17.7k|    rv = ssl3_CreateOverlapWithPolicy(protocolVariant, vrange, vrange);
 2774|  17.7k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2774:9): [True: 0, False: 17.7k]
  ------------------
 2775|       |        /* Library default and policy don't overlap. */
 2776|      0|        return rv;
 2777|      0|    }
 2778|       |
 2779|       |    /* We don't allow SSLv3 and TLSv1.3 together */
 2780|  17.7k|    if (vrange->max >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  17.7k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (2780:9): [True: 17.7k, False: 0]
  ------------------
 2781|  17.7k|        vrange->min = PR_MAX(vrange->min, SSL_LIBRARY_VERSION_TLS_1_0);
  ------------------
  |  |  159|  17.7k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 8.85k, False: 8.85k]
  |  |  ------------------
  ------------------
 2782|  17.7k|    }
 2783|       |
 2784|  17.7k|    return SECSuccess;
 2785|  17.7k|}
SSL_VersionRangeSetDefault:
 2843|  17.7k|{
 2844|  17.7k|    SSLVersionRange constrainedRange;
 2845|  17.7k|    SECStatus rv;
 2846|       |
 2847|  17.7k|    if (!vrange) {
  ------------------
  |  Branch (2847:9): [True: 0, False: 17.7k]
  ------------------
 2848|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2849|      0|        return SECFailure;
 2850|      0|    }
 2851|       |
 2852|  17.7k|    constrainedRange = *vrange;
 2853|  17.7k|    rv = ssl3_CheckRangeValidAndConstrainByPolicy(protocolVariant,
 2854|  17.7k|                                                  &constrainedRange);
 2855|  17.7k|    if (rv != SECSuccess)
  ------------------
  |  Branch (2855:9): [True: 0, False: 17.7k]
  ------------------
 2856|      0|        return rv;
 2857|       |
 2858|  17.7k|    *VERSIONS_DEFAULTS(protocolVariant) = constrainedRange;
  ------------------
  |  |  117|  17.7k|    (variant == ssl_variant_stream ? &versions_defaults_stream : &versions_defaults_datagram)
  |  |  ------------------
  |  |  |  Branch (117:6): [True: 8.85k, False: 8.85k]
  |  |  ------------------
  ------------------
 2859|  17.7k|    return SECSuccess;
 2860|  17.7k|}
SSL_VersionRangeSet:
 2891|  3.25k|{
 2892|  3.25k|    SSLVersionRange constrainedRange;
 2893|  3.25k|    sslSocket *ss;
 2894|  3.25k|    SECStatus rv;
 2895|       |
 2896|  3.25k|    if (!vrange) {
  ------------------
  |  Branch (2896:9): [True: 0, False: 3.25k]
  ------------------
 2897|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2898|      0|        return SECFailure;
 2899|      0|    }
 2900|       |
 2901|  3.25k|    ss = ssl_FindSocket(fd);
 2902|  3.25k|    if (!ss) {
  ------------------
  |  Branch (2902:9): [True: 0, False: 3.25k]
  ------------------
 2903|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in SSL_VersionRangeSet",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
 2904|      0|                 SSL_GETPID(), fd));
 2905|      0|        return SECFailure;
 2906|      0|    }
 2907|       |
 2908|  3.25k|    constrainedRange = *vrange;
 2909|  3.25k|    rv = ssl3_CheckRangeValidAndConstrainByPolicy(ss->protocolVariant,
 2910|  3.25k|                                                  &constrainedRange);
 2911|  3.25k|    if (rv != SECSuccess)
  ------------------
  |  Branch (2911:9): [True: 0, False: 3.25k]
  ------------------
 2912|      0|        return rv;
 2913|       |
 2914|  3.25k|    ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|  3.25k|    {                                                             \
  |  | 1391|  3.25k|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 3.25k, False: 0]
  |  |  ------------------
  |  | 1392|  3.25k|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|  3.25k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  6.50k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 3.25k]
  |  |  |  |  |  |  |  Branch (208:7): [True: 3.25k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|  3.25k|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|  3.25k|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|  3.25k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|  3.25k|        }                                                         \
  |  | 1396|  3.25k|    }
  ------------------
 2915|  3.25k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  3.25k|    {                                                 \
  |  | 1408|  3.25k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 3.25k, False: 0]
  |  |  ------------------
  |  | 1409|  3.25k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  3.25k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  3.25k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 3.25k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  3.25k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  3.25k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  3.25k|        }                                             \
  |  | 1412|  3.25k|    }
  ------------------
 2916|       |
 2917|  3.25k|    if (ss->ssl3.downgradeCheckVersion &&
  ------------------
  |  Branch (2917:9): [True: 0, False: 3.25k]
  ------------------
 2918|  3.25k|        ss->vrange.max > ss->ssl3.downgradeCheckVersion) {
  ------------------
  |  Branch (2918:9): [True: 0, False: 0]
  ------------------
 2919|      0|        PORT_SetError(SSL_ERROR_INVALID_VERSION_RANGE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2920|      0|        ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
 2921|      0|        ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|      0|    {                                                 \
  |  | 1399|      0|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1400|      0|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|      0|    }
  ------------------
 2922|      0|        return SECFailure;
 2923|      0|    }
 2924|       |
 2925|  3.25k|    ss->vrange = constrainedRange;
 2926|       |
 2927|  3.25k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  3.25k|    {                                                \
  |  | 1415|  3.25k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 3.25k, False: 0]
  |  |  ------------------
  |  | 1416|  3.25k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  3.25k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  3.25k|    }
  ------------------
 2928|  3.25k|    ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|  3.25k|    {                                                 \
  |  | 1399|  3.25k|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 3.25k, False: 0]
  |  |  ------------------
  |  | 1400|  3.25k|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  3.25k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|  3.25k|    }
  ------------------
 2929|       |
 2930|  3.25k|    return SECSuccess;
 2931|  3.25k|}
ssl_GetPeerInfo:
 3281|  8.85k|{
 3282|  8.85k|    PRFileDesc *osfd;
 3283|  8.85k|    int rv;
 3284|  8.85k|    PRNetAddr sin;
 3285|       |
 3286|  8.85k|    osfd = ss->fd->lower;
 3287|       |
 3288|  8.85k|    PORT_Memset(&sin, 0, sizeof(sin));
  ------------------
  |  |  182|  8.85k|#define PORT_Memset memset
  ------------------
 3289|  8.85k|    rv = osfd->methods->getpeername(osfd, &sin);
 3290|  8.85k|    if (rv < 0) {
  ------------------
  |  Branch (3290:9): [True: 0, False: 8.85k]
  ------------------
 3291|      0|        return SECFailure;
 3292|      0|    }
 3293|  8.85k|    ss->TCPconnected = 1;
 3294|  8.85k|    if (sin.inet.family == PR_AF_INET) {
  ------------------
  |  |   96|  8.85k|#define PR_AF_INET AF_INET
  ------------------
  |  Branch (3294:9): [True: 8.85k, False: 0]
  ------------------
 3295|  8.85k|        PR_ConvertIPv4AddrToIPv6(sin.inet.ip, &ss->sec.ci.peer);
 3296|  8.85k|        ss->sec.ci.port = sin.inet.port;
 3297|  8.85k|    } else if (sin.ipv6.family == PR_AF_INET6) {
  ------------------
  |  |   27|      0|#define PR_AF_INET6 10  /* same as AF_INET6 */
  ------------------
  |  Branch (3297:16): [True: 0, False: 0]
  ------------------
 3298|      0|        ss->sec.ci.peer = sin.ipv6.ip;
 3299|      0|        ss->sec.ci.port = sin.ipv6.port;
 3300|      0|    } else {
 3301|      0|        PORT_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_ADDRESS_NOT_SUPPORTED_ERROR);
  ------------------
  |  |   61|      0|#define PR_ADDRESS_NOT_SUPPORTED_ERROR           (-5985L)
  ------------------
 3302|      0|        return SECFailure;
 3303|      0|    }
 3304|  8.85k|    return SECSuccess;
 3305|  8.85k|}
ssl_FdIsBlocking:
 3485|  13.3k|{
 3486|  13.3k|    PRSocketOptionData opt;
 3487|  13.3k|    PRStatus status;
 3488|       |
 3489|  13.3k|    opt.option = PR_SockOpt_Nonblocking;
 3490|  13.3k|    opt.value.non_blocking = PR_FALSE;
  ------------------
  |  |  438|  13.3k|#define PR_FALSE 0
  ------------------
 3491|  13.3k|    status = PR_GetSocketOption(fd, &opt);
 3492|  13.3k|    if (status != PR_SUCCESS)
  ------------------
  |  Branch (3492:9): [True: 0, False: 13.3k]
  ------------------
 3493|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 3494|  13.3k|    return (PRBool)!opt.value.non_blocking;
 3495|  13.3k|}
ssl_SocketIsBlocking:
 3499|  13.3k|{
 3500|  13.3k|    return ssl_FdIsBlocking(ss->fd);
 3501|  13.3k|}
ssl_LookupNamedGroup:
 4001|  18.2k|{
 4002|  18.2k|    unsigned int i;
 4003|       |
 4004|  99.3k|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; ++i) {
  ------------------
  |  |  133|  99.3k|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (4004:17): [True: 99.3k, False: 21]
  ------------------
 4005|  99.3k|        if (ssl_named_groups[i].name == group) {
  ------------------
  |  Branch (4005:13): [True: 18.2k, False: 81.0k]
  ------------------
 4006|  18.2k|            return &ssl_named_groups[i];
 4007|  18.2k|        }
 4008|  99.3k|    }
 4009|     21|    return NULL;
 4010|  18.2k|}
ssl_NamedGroupEnabled:
 4014|  1.85k|{
 4015|  1.85k|    unsigned int i;
 4016|       |
 4017|  1.85k|    if (!groupDef) {
  ------------------
  |  Branch (4017:9): [True: 3, False: 1.85k]
  ------------------
 4018|      3|        return PR_FALSE;
  ------------------
  |  |  438|      3|#define PR_FALSE 0
  ------------------
 4019|      3|    }
 4020|       |
 4021|  14.0k|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; ++i) {
  ------------------
  |  |  133|  14.0k|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (4021:17): [True: 14.0k, False: 2]
  ------------------
 4022|  14.0k|        if (ss->namedGroupPreferences[i] &&
  ------------------
  |  Branch (4022:13): [True: 12.4k, False: 1.63k]
  ------------------
 4023|  14.0k|            ss->namedGroupPreferences[i] == groupDef) {
  ------------------
  |  Branch (4023:13): [True: 1.85k, False: 10.5k]
  ------------------
 4024|  1.85k|            return PR_TRUE;
  ------------------
  |  |  437|  1.85k|#define PR_TRUE 1
  ------------------
 4025|  1.85k|        }
 4026|  14.0k|    }
 4027|      2|    return PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 4028|  1.85k|}
ssl_NewKeyPair:
 4036|  9.19k|{
 4037|  9.19k|    sslKeyPair *pair;
 4038|       |
 4039|  9.19k|    if (!privKey || !pubKey) {
  ------------------
  |  Branch (4039:9): [True: 0, False: 9.19k]
  |  Branch (4039:21): [True: 0, False: 9.19k]
  ------------------
 4040|      0|        PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
 4041|      0|        return NULL;
 4042|      0|    }
 4043|  9.19k|    pair = PORT_ZNew(sslKeyPair);
  ------------------
  |  |  148|  9.19k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  9.19k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 4044|  9.19k|    if (!pair)
  ------------------
  |  Branch (4044:9): [True: 0, False: 9.19k]
  ------------------
 4045|      0|        return NULL; /* error code is set. */
 4046|  9.19k|    pair->privKey = privKey;
 4047|  9.19k|    pair->pubKey = pubKey;
 4048|  9.19k|    pair->refCount = 1;
 4049|  9.19k|    return pair; /* success */
 4050|  9.19k|}
ssl_FreeKeyPair:
 4061|  18.3k|{
 4062|  18.3k|    if (!keyPair) {
  ------------------
  |  Branch (4062:9): [True: 9.19k, False: 9.19k]
  ------------------
 4063|  9.19k|        return;
 4064|  9.19k|    }
 4065|       |
 4066|  9.19k|    PRInt32 newCount = PR_ATOMIC_DECREMENT(&keyPair->refCount);
  ------------------
  |  |  123|  9.19k|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
 4067|  9.19k|    if (!newCount) {
  ------------------
  |  Branch (4067:9): [True: 9.19k, False: 0]
  ------------------
 4068|  9.19k|        SECKEY_DestroyPrivateKey(keyPair->privKey);
 4069|  9.19k|        SECKEY_DestroyPublicKey(keyPair->pubKey);
 4070|  9.19k|        PORT_Free(keyPair);
  ------------------
  |  |   60|  9.19k|#define PORT_Free PORT_Free_Util
  ------------------
 4071|  9.19k|    }
 4072|  9.19k|}
ssl_NewEphemeralKeyPair:
 4078|  9.19k|{
 4079|  9.19k|    sslKeyPair *keys;
 4080|  9.19k|    sslEphemeralKeyPair *pair;
 4081|       |
 4082|  9.19k|    if (!group) {
  ------------------
  |  Branch (4082:9): [True: 0, False: 9.19k]
  ------------------
 4083|      0|        PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_INVALID_ARGUMENT_ERROR);
  ------------------
  |  |   55|      0|#define PR_INVALID_ARGUMENT_ERROR                (-5987L)
  ------------------
 4084|      0|        return NULL;
 4085|      0|    }
 4086|       |
 4087|  9.19k|    keys = ssl_NewKeyPair(privKey, pubKey);
 4088|  9.19k|    if (!keys) {
  ------------------
  |  Branch (4088:9): [True: 0, False: 9.19k]
  ------------------
 4089|      0|        return NULL;
 4090|      0|    }
 4091|       |
 4092|  9.19k|    pair = PORT_ZNew(sslEphemeralKeyPair);
  ------------------
  |  |  148|  9.19k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  9.19k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 4093|  9.19k|    if (!pair) {
  ------------------
  |  Branch (4093:9): [True: 0, False: 9.19k]
  ------------------
 4094|      0|        ssl_FreeKeyPair(keys);
 4095|      0|        return NULL; /* error already set */
 4096|      0|    }
 4097|       |
 4098|  9.19k|    PR_INIT_CLIST(&pair->link);
  ------------------
  |  |  100|  18.3k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  9.19k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  18.3k|    (_l)->next = (_l); \
  |  |  102|  18.3k|    (_l)->prev = (_l); \
  |  |  103|  18.3k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  9.19k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4099|  9.19k|    pair->group = group;
 4100|  9.19k|    pair->keys = keys;
 4101|  9.19k|    pair->kemKeys = NULL;
 4102|  9.19k|    pair->kemCt = NULL;
 4103|       |
 4104|  9.19k|    return pair;
 4105|  9.19k|}
ssl_FreeEphemeralKeyPair:
 4136|  9.19k|{
 4137|  9.19k|    if (!keyPair) {
  ------------------
  |  Branch (4137:9): [True: 0, False: 9.19k]
  ------------------
 4138|      0|        return;
 4139|      0|    }
 4140|       |
 4141|  9.19k|    ssl_FreeKeyPair(keyPair->keys);
 4142|  9.19k|    ssl_FreeKeyPair(keyPair->kemKeys);
 4143|  9.19k|    SECITEM_FreeItem(keyPair->kemCt, PR_TRUE);
  ------------------
  |  |  108|  9.19k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(keyPair->kemCt, PR_TRUE);
  ------------------
  |  |  437|  9.19k|#define PR_TRUE 1
  ------------------
 4144|  9.19k|    PR_REMOVE_LINK(&keyPair->link);
  ------------------
  |  |   72|  9.19k|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|  9.19k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|  9.19k|    (_e)->prev->next = (_e)->next; \
  |  |   74|  9.19k|    (_e)->next->prev = (_e)->prev; \
  |  |   75|  9.19k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  9.19k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4145|  9.19k|    PORT_Free(keyPair);
  ------------------
  |  |   60|  9.19k|#define PORT_Free PORT_Free_Util
  ------------------
 4146|  9.19k|}
ssl_HaveEphemeralKeyPair:
 4150|    961|{
 4151|    961|    return ssl_LookupEphemeralKeyPair((sslSocket *)ss, groupDef) != NULL;
 4152|    961|}
ssl_LookupEphemeralKeyPair:
 4156|  16.8k|{
 4157|  16.8k|    PRCList *cursor;
 4158|  16.8k|    for (cursor = PR_NEXT_LINK(&ss->ephemeralKeyPairs);
  ------------------
  |  |   47|  16.8k|        ((_e)->next)
  ------------------
 4159|  17.8k|         cursor != &ss->ephemeralKeyPairs;
  ------------------
  |  Branch (4159:10): [True: 1.86k, False: 15.9k]
  ------------------
 4160|  16.8k|         cursor = PR_NEXT_LINK(cursor)) {
  ------------------
  |  |   47|    973|        ((_e)->next)
  ------------------
 4161|  1.86k|        sslEphemeralKeyPair *keyPair = (sslEphemeralKeyPair *)cursor;
 4162|  1.86k|        if (keyPair->group == groupDef) {
  ------------------
  |  Branch (4162:13): [True: 894, False: 973]
  ------------------
 4163|    894|            return keyPair;
 4164|    894|        }
 4165|  1.86k|    }
 4166|  15.9k|    return NULL;
 4167|  16.8k|}
ssl_FreeEphemeralKeyPairs:
 4171|  9.95k|{
 4172|  18.4k|    while (!PR_CLIST_IS_EMPTY(&ss->ephemeralKeyPairs)) {
  ------------------
  |  |   94|  18.4k|    ((_l)->next == (_l))
  ------------------
  |  Branch (4172:12): [True: 8.47k, False: 9.95k]
  ------------------
 4173|  8.47k|        PRCList *cursor = PR_LIST_TAIL(&ss->ephemeralKeyPairs);
  ------------------
  |  |   66|  8.47k|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
 4174|  8.47k|        ssl_FreeEphemeralKeyPair((sslEphemeralKeyPair *)cursor);
 4175|  8.47k|    }
 4176|  9.95k|}
ssl_Time:
 4180|  10.0k|{
 4181|  10.0k|    if (!ss->now) {
  ------------------
  |  Branch (4181:9): [True: 0, False: 10.0k]
  ------------------
 4182|      0|        return PR_Now();
 4183|      0|    }
 4184|  10.0k|    return ss->now(ss->nowArg);
 4185|  10.0k|}
SSL_GetExperimentalAPI:
 4390|  71.2k|{
 4391|  71.2k|    unsigned int i;
 4392|  2.40M|    for (i = 0; i < PR_ARRAY_SIZE(ssl_experimental_functions); ++i) {
  ------------------
  |  |  167|  2.40M|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (4392:17): [True: 2.40M, False: 0]
  ------------------
 4393|  2.40M|        if (strcmp(name, ssl_experimental_functions[i].name) == 0) {
  ------------------
  |  Branch (4393:13): [True: 71.2k, False: 2.33M]
  ------------------
 4394|  71.2k|            return ssl_experimental_functions[i].function;
 4395|  71.2k|        }
 4396|  2.40M|    }
 4397|      0|    PORT_SetError(SSL_ERROR_UNSUPPORTED_EXPERIMENTAL_API);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4398|      0|    return NULL;
 4399|  71.2k|}
ssl_ClearPRCList:
 4403|  34.8k|{
 4404|  34.8k|    PRCList *cursor;
 4405|       |
 4406|  50.7k|    while (!PR_CLIST_IS_EMPTY(list)) {
  ------------------
  |  |   94|  50.7k|    ((_l)->next == (_l))
  ------------------
  |  Branch (4406:12): [True: 15.8k, False: 34.8k]
  ------------------
 4407|  15.8k|        cursor = PR_LIST_TAIL(list);
  ------------------
  |  |   66|  15.8k|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
 4408|       |
 4409|  15.8k|        PR_REMOVE_LINK(cursor);
  ------------------
  |  |   72|  15.8k|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|  15.8k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|  15.8k|    (_e)->prev->next = (_e)->next; \
  |  |   74|  15.8k|    (_e)->next->prev = (_e)->prev; \
  |  |   75|  15.8k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  15.8k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4410|  15.8k|        if (f) {
  ------------------
  |  Branch (4410:13): [True: 0, False: 15.8k]
  ------------------
 4411|      0|            f(cursor);
 4412|      0|        }
 4413|  15.8k|        PORT_Free(cursor);
  ------------------
  |  |   60|  15.8k|#define PORT_Free PORT_Free_Util
  ------------------
 4414|  15.8k|    }
 4415|  34.8k|}
SSLExp_EnableTls13GreaseEch:
 4419|  8.85k|{
 4420|  8.85k|    sslSocket *ss = ssl_FindSocket(fd);
 4421|  8.85k|    if (!ss) {
  ------------------
  |  Branch (4421:9): [True: 0, False: 8.85k]
  ------------------
 4422|      0|        return SECFailure;
 4423|      0|    }
 4424|  8.85k|    ss->opt.enableTls13GreaseEch = enabled;
 4425|  8.85k|    return SECSuccess;
 4426|  8.85k|}
SSLExp_SetDtls13VersionWorkaround:
 4470|  8.85k|{
 4471|  8.85k|    sslSocket *ss = ssl_FindSocket(fd);
 4472|  8.85k|    if (!ss) {
  ------------------
  |  Branch (4472:9): [True: 0, False: 8.85k]
  ------------------
 4473|      0|        return SECFailure;
 4474|      0|    }
 4475|  8.85k|    ss->opt.enableDtls13VersionCompat = enabled;
 4476|  8.85k|    return SECSuccess;
 4477|  8.85k|}
SSLExp_SetTimeFunc:
 4481|  8.85k|{
 4482|  8.85k|    sslSocket *ss = ssl_FindSocket(fd);
 4483|       |
 4484|  8.85k|    if (!ss) {
  ------------------
  |  Branch (4484:9): [True: 0, False: 8.85k]
  ------------------
 4485|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in SSL_SetTimeFunc",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
 4486|      0|                 SSL_GETPID(), fd));
 4487|      0|        return SECFailure;
 4488|      0|    }
 4489|  8.85k|    ss->now = f;
 4490|  8.85k|    ss->nowArg = arg;
 4491|  8.85k|    return SECSuccess;
 4492|  8.85k|}
sslsock.c:ssl_DestroySocketContents:
  465|  8.85k|{
  466|  8.85k|    PRCList *cursor;
  467|       |
  468|       |    /* Free up socket */
  469|  8.85k|    ssl_DestroySecurityInfo(&ss->sec);
  470|       |
  471|  8.85k|    ssl3_DestroySSL3Info(ss);
  472|       |
  473|  8.85k|    PORT_Free(ss->saveBuf.buf);
  ------------------
  |  |   60|  8.85k|#define PORT_Free PORT_Free_Util
  ------------------
  474|  8.85k|    PORT_Free(ss->pendingBuf.buf);
  ------------------
  |  |   60|  8.85k|#define PORT_Free PORT_Free_Util
  ------------------
  475|  8.85k|    ssl3_DestroyGather(&ss->gs);
  476|       |
  477|  8.85k|    if (ss->peerID != NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 8.85k]
  ------------------
  478|      0|        PORT_Free(ss->peerID);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  479|  8.85k|    if (ss->url != NULL)
  ------------------
  |  Branch (479:9): [True: 8.85k, False: 0]
  ------------------
  480|  8.85k|        PORT_Free((void *)ss->url); /* CONST */
  ------------------
  |  |   60|  8.85k|#define PORT_Free PORT_Free_Util
  ------------------
  481|       |
  482|       |    /* Clean up server certificates and sundries. */
  483|  8.85k|    while (!PR_CLIST_IS_EMPTY(&ss->serverCerts)) {
  ------------------
  |  |   94|  8.85k|    ((_l)->next == (_l))
  ------------------
  |  Branch (483:12): [True: 0, False: 8.85k]
  ------------------
  484|      0|        cursor = PR_LIST_TAIL(&ss->serverCerts);
  ------------------
  |  |   66|      0|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
  485|      0|        PR_REMOVE_LINK(cursor);
  ------------------
  |  |   72|      0|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|      0|    (_e)->prev->next = (_e)->next; \
  |  |   74|      0|    (_e)->next->prev = (_e)->prev; \
  |  |   75|      0|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  486|      0|        ssl_FreeServerCert((sslServerCert *)cursor);
  487|      0|    }
  488|       |
  489|       |    /* Remove extension handlers. */
  490|  8.85k|    ssl_ClearPRCList(&ss->extensionHooks, NULL);
  491|       |
  492|  8.85k|    ssl_FreeEphemeralKeyPairs(ss);
  493|  8.85k|    SECITEM_FreeItem(&ss->opt.nextProtoNego, PR_FALSE);
  ------------------
  |  |  108|  8.85k|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&ss->opt.nextProtoNego, PR_FALSE);
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
  494|  8.85k|    ssl3_FreeSniNameArray(&ss->xtnData);
  495|       |
  496|  8.85k|    ssl_ClearPRCList(&ss->ssl3.hs.dtlsSentHandshake, NULL);
  497|  8.85k|    ssl_ClearPRCList(&ss->ssl3.hs.dtlsRcvdHandshake, NULL);
  498|  8.85k|    tls13_DestroyPskList(&ss->ssl3.hs.psks);
  499|       |
  500|  8.85k|    tls13_ReleaseAntiReplayContext(ss->antiReplay);
  501|       |
  502|  8.85k|    tls13_DestroyPsk(ss->psk);
  503|       |
  504|  8.85k|    tls13_DestroyEchConfigs(&ss->echConfigs);
  505|  8.85k|    SECKEY_DestroyPrivateKey(ss->echPrivKey);
  506|  8.85k|    SECKEY_DestroyPublicKey(ss->echPubKey);
  507|  8.85k|}
sslsock.c:ssl_DestroyLocks:
  429|  8.85k|{
  430|       |    /* Destroy locks. */
  431|  8.85k|    if (ss->firstHandshakeLock) {
  ------------------
  |  Branch (431:9): [True: 8.85k, False: 0]
  ------------------
  432|  8.85k|        PZ_DestroyMonitor(ss->firstHandshakeLock);
  ------------------
  |  |  255|  8.85k|#define PZ_DestroyMonitor(m) PR_DestroyMonitor((m))
  ------------------
  433|  8.85k|        ss->firstHandshakeLock = NULL;
  434|  8.85k|    }
  435|  8.85k|    if (ss->ssl3HandshakeLock) {
  ------------------
  |  Branch (435:9): [True: 8.85k, False: 0]
  ------------------
  436|  8.85k|        PZ_DestroyMonitor(ss->ssl3HandshakeLock);
  ------------------
  |  |  255|  8.85k|#define PZ_DestroyMonitor(m) PR_DestroyMonitor((m))
  ------------------
  437|  8.85k|        ss->ssl3HandshakeLock = NULL;
  438|  8.85k|    }
  439|  8.85k|    if (ss->specLock) {
  ------------------
  |  Branch (439:9): [True: 8.85k, False: 0]
  ------------------
  440|  8.85k|        NSSRWLock_Destroy(ss->specLock);
  ------------------
  |  |   45|  8.85k|#define NSSRWLock_Destroy NSSRWLock_Destroy_Util
  ------------------
  441|  8.85k|        ss->specLock = NULL;
  442|  8.85k|    }
  443|       |
  444|  8.85k|    if (ss->recvLock) {
  ------------------
  |  Branch (444:9): [True: 8.85k, False: 0]
  ------------------
  445|  8.85k|        PZ_DestroyLock(ss->recvLock);
  ------------------
  |  |  244|  8.85k|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  446|  8.85k|        ss->recvLock = NULL;
  447|  8.85k|    }
  448|  8.85k|    if (ss->sendLock) {
  ------------------
  |  Branch (448:9): [True: 8.85k, False: 0]
  ------------------
  449|  8.85k|        PZ_DestroyLock(ss->sendLock);
  ------------------
  |  |  244|  8.85k|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  450|  8.85k|        ss->sendLock = NULL;
  451|  8.85k|    }
  452|  8.85k|    if (ss->xmitBufLock) {
  ------------------
  |  Branch (452:9): [True: 8.85k, False: 0]
  ------------------
  453|  8.85k|        PZ_DestroyMonitor(ss->xmitBufLock);
  ------------------
  |  |  255|  8.85k|#define PZ_DestroyMonitor(m) PR_DestroyMonitor((m))
  ------------------
  454|  8.85k|        ss->xmitBufLock = NULL;
  455|  8.85k|    }
  456|  8.85k|    if (ss->recvBufLock) {
  ------------------
  |  Branch (456:9): [True: 8.85k, False: 0]
  ------------------
  457|  8.85k|        PZ_DestroyMonitor(ss->recvBufLock);
  ------------------
  |  |  255|  8.85k|#define PZ_DestroyMonitor(m) PR_DestroyMonitor((m))
  ------------------
  458|  8.85k|        ss->recvBufLock = NULL;
  459|  8.85k|    }
  460|  8.85k|}
sslsock.c:ssl_ChooseOps:
  568|  8.85k|{
  569|  8.85k|    ss->ops = ss->opt.useSecurity ? &ssl_secure_ops : &ssl_default_ops;
  ------------------
  |  Branch (569:15): [True: 8.85k, False: 0]
  ------------------
  570|  8.85k|}
sslsock.c:ssl_IsRemovedCipherSuite:
 1440|   628k|{
 1441|   628k|    switch (suite) {
 1442|      0|        case SSL_FORTEZZA_DMS_WITH_NULL_SHA:
  ------------------
  |  |  275|      0|#define SSL_FORTEZZA_DMS_WITH_NULL_SHA          0x001c
  ------------------
  |  Branch (1442:9): [True: 0, False: 628k]
  ------------------
 1443|      0|        case SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA:
  ------------------
  |  |  276|      0|#define SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA  0x001d
  ------------------
  |  Branch (1443:9): [True: 0, False: 628k]
  ------------------
 1444|      0|        case SSL_FORTEZZA_DMS_WITH_RC4_128_SHA:
  ------------------
  |  |  277|      0|#define SSL_FORTEZZA_DMS_WITH_RC4_128_SHA       0x001e
  ------------------
  |  Branch (1444:9): [True: 0, False: 628k]
  ------------------
 1445|      0|            return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1446|   628k|        default:
  ------------------
  |  Branch (1446:9): [True: 628k, False: 0]
  ------------------
 1447|   628k|            return PR_FALSE;
  ------------------
  |  |  438|   628k|#define PR_FALSE 0
  ------------------
 1448|   628k|    }
 1449|   628k|}
sslsock.c:ssl_ImportFD:
 2153|  8.85k|{
 2154|  8.85k|    sslSocket *ns = NULL;
 2155|  8.85k|    PRStatus rv;
 2156|  8.85k|    PRNetAddr addr;
 2157|  8.85k|    SECStatus status = ssl_Init();
 2158|       |
 2159|  8.85k|    if (status != SECSuccess) {
  ------------------
  |  Branch (2159:9): [True: 0, False: 8.85k]
  ------------------
 2160|      0|        return NULL;
 2161|      0|    }
 2162|       |
 2163|  8.85k|    if (model == NULL) {
  ------------------
  |  Branch (2163:9): [True: 8.85k, False: 0]
  ------------------
 2164|       |        /* Just create a default socket if we're given NULL for the model */
 2165|  8.85k|        ns = ssl_NewSocket((PRBool)(!ssl_defaults.noLocks), variant);
 2166|  8.85k|    } else {
 2167|      0|        sslSocket *ss = ssl_FindSocket(model);
 2168|      0|        if (ss == NULL || ss->protocolVariant != variant) {
  ------------------
  |  Branch (2168:13): [True: 0, False: 0]
  |  Branch (2168:27): [True: 0, False: 0]
  ------------------
 2169|      0|            SSL_DBG(("%d: SSL[%d]: bad model socket in ssl_ImportFD",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
 2170|      0|                     SSL_GETPID(), model));
 2171|      0|            return NULL;
 2172|      0|        }
 2173|      0|        ns = ssl_DupSocket(ss);
 2174|      0|    }
 2175|  8.85k|    if (ns == NULL)
  ------------------
  |  Branch (2175:9): [True: 0, False: 8.85k]
  ------------------
 2176|      0|        return NULL;
 2177|       |
 2178|  8.85k|    rv = ssl_PushIOLayer(ns, fd, PR_TOP_IO_LAYER);
  ------------------
  |  |  453|  8.85k|#define PR_TOP_IO_LAYER (PRDescIdentity)-2
  ------------------
 2179|  8.85k|    if (rv != PR_SUCCESS) {
  ------------------
  |  Branch (2179:9): [True: 0, False: 8.85k]
  ------------------
 2180|      0|        ssl_FreeSocket(ns);
 2181|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2182|      0|        return NULL;
 2183|      0|    }
 2184|  8.85k|#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
 2185|  8.85k|    {
 2186|  8.85k|        sslSocket *ss = ssl_FindSocket(fd);
 2187|  8.85k|        PORT_Assert(ss == ns);
  ------------------
  |  |  120|  8.85k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2188|  8.85k|    }
 2189|  8.85k|#endif
 2190|  8.85k|    ns->TCPconnected = (PR_SUCCESS == ssl_DefGetpeername(ns, &addr));
 2191|  8.85k|    return fd;
 2192|  8.85k|}
sslsock.c:ssl_NewSocket:
 4192|  8.85k|{
 4193|  8.85k|    SECStatus rv;
 4194|  8.85k|    sslSocket *ss;
 4195|  8.85k|    int i;
 4196|  8.85k|    ssl_SetDefaultsFromEnvironment();
 4197|       |
 4198|  8.85k|    if (ssl_force_locks)
  ------------------
  |  Branch (4198:9): [True: 0, False: 8.85k]
  ------------------
 4199|      0|        makeLocks = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 4200|       |
 4201|       |    /* Make a new socket and get it ready */
 4202|  8.85k|    ss = PORT_ZNew(sslSocket);
  ------------------
  |  |  148|  8.85k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  8.85k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 4203|  8.85k|    if (!ss) {
  ------------------
  |  Branch (4203:9): [True: 0, False: 8.85k]
  ------------------
 4204|      0|        return NULL;
 4205|      0|    }
 4206|  8.85k|    ss->opt = ssl_defaults;
 4207|  8.85k|    if (protocolVariant == ssl_variant_datagram) {
  ------------------
  |  Branch (4207:9): [True: 8.85k, False: 0]
  ------------------
 4208|  8.85k|        ss->opt.enableRenegotiation = SSL_RENEGOTIATE_NEVER;
  ------------------
  |  |  711|  8.85k|#define SSL_RENEGOTIATE_NEVER ((PRBool)0)
  ------------------
 4209|  8.85k|    }
 4210|  8.85k|    ss->opt.useSocks = PR_FALSE;
  ------------------
  |  |  438|  8.85k|#define PR_FALSE 0
  ------------------
 4211|  8.85k|    ss->opt.noLocks = !makeLocks;
 4212|  8.85k|    ss->vrange = *VERSIONS_DEFAULTS(protocolVariant);
  ------------------
  |  |  117|  8.85k|    (variant == ssl_variant_stream ? &versions_defaults_stream : &versions_defaults_datagram)
  |  |  ------------------
  |  |  |  Branch (117:6): [True: 0, False: 8.85k]
  |  |  ------------------
  ------------------
 4213|  8.85k|    ss->protocolVariant = protocolVariant;
 4214|       |    /* Ignore overlap failures, because returning NULL would trigger assertion
 4215|       |     * failures elsewhere. We don't want this scenario to be fatal, it's just
 4216|       |     * a state where no SSL connectivity is possible. */
 4217|  8.85k|    ssl3_CreateOverlapWithPolicy(ss->protocolVariant, &ss->vrange, &ss->vrange);
 4218|  8.85k|    ss->peerID = NULL;
 4219|  8.85k|    ss->rTimeout = PR_INTERVAL_NO_TIMEOUT;
  ------------------
  |  |   54|  8.85k|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
 4220|  8.85k|    ss->wTimeout = PR_INTERVAL_NO_TIMEOUT;
  ------------------
  |  |   54|  8.85k|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
 4221|  8.85k|    ss->cTimeout = PR_INTERVAL_NO_TIMEOUT;
  ------------------
  |  |   54|  8.85k|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
 4222|  8.85k|    ss->url = NULL;
 4223|       |
 4224|  8.85k|    PR_INIT_CLIST(&ss->serverCerts);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4225|  8.85k|    PR_INIT_CLIST(&ss->ephemeralKeyPairs);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4226|  8.85k|    PR_INIT_CLIST(&ss->extensionHooks);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4227|  8.85k|    PR_INIT_CLIST(&ss->echConfigs);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4228|       |
 4229|  8.85k|    ss->dbHandle = CERT_GetDefaultCertDB();
 4230|       |
 4231|       |    /* Provide default implementation of hooks */
 4232|  8.85k|    ss->authCertificate = SSL_AuthCertificate;
 4233|  8.85k|    ss->authCertificateArg = (void *)ss->dbHandle;
 4234|  8.85k|    ss->sniSocketConfig = NULL;
 4235|  8.85k|    ss->sniSocketConfigArg = NULL;
 4236|  8.85k|    ss->getClientAuthData = NULL;
 4237|  8.85k|    ss->alertReceivedCallback = NULL;
 4238|  8.85k|    ss->alertReceivedCallbackArg = NULL;
 4239|  8.85k|    ss->alertSentCallback = NULL;
 4240|  8.85k|    ss->alertSentCallbackArg = NULL;
 4241|  8.85k|    ss->handleBadCert = NULL;
 4242|  8.85k|    ss->badCertArg = NULL;
 4243|  8.85k|    ss->pkcs11PinArg = NULL;
 4244|       |
 4245|  8.85k|    ssl_ChooseOps(ss);
 4246|  8.85k|    ssl3_InitSocketPolicy(ss);
 4247|   301k|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; ++i) {
  ------------------
  |  |  133|   301k|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (4247:17): [True: 292k, False: 8.85k]
  ------------------
 4248|   292k|        ss->namedGroupPreferences[i] = &ssl_named_groups[i];
 4249|   292k|    }
 4250|  8.85k|    ss->additionalShares = 0;
 4251|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.remoteExtensions);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4252|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.lastMessageFlight);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4253|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.cipherSpecs);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4254|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.bufferedEarlyData);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4255|  8.85k|    ssl3_InitExtensionData(&ss->xtnData, ss);
 4256|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.dtlsSentHandshake);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4257|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.dtlsRcvdHandshake);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4258|  8.85k|    PR_INIT_CLIST(&ss->ssl3.hs.psks);
  ------------------
  |  |  100|  8.85k|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|  8.85k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|  8.85k|    (_l)->next = (_l); \
  |  |  102|  8.85k|    (_l)->prev = (_l); \
  |  |  103|  8.85k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  8.85k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4259|  8.85k|    dtls_InitTimers(ss);
 4260|       |
 4261|  8.85k|    ss->echPrivKey = NULL;
 4262|  8.85k|    ss->echPubKey = NULL;
 4263|  8.85k|    ss->antiReplay = NULL;
 4264|  8.85k|    ss->psk = NULL;
 4265|       |
 4266|  8.85k|    if (makeLocks) {
  ------------------
  |  Branch (4266:9): [True: 8.85k, False: 0]
  ------------------
 4267|  8.85k|        rv = ssl_MakeLocks(ss);
 4268|  8.85k|        if (rv != SECSuccess)
  ------------------
  |  Branch (4268:13): [True: 0, False: 8.85k]
  ------------------
 4269|      0|            goto loser;
 4270|  8.85k|    }
 4271|  8.85k|    rv = ssl_CreateSecurityInfo(ss);
 4272|  8.85k|    if (rv != SECSuccess)
  ------------------
  |  Branch (4272:9): [True: 0, False: 8.85k]
  ------------------
 4273|      0|        goto loser;
 4274|  8.85k|    rv = ssl3_InitGather(&ss->gs);
 4275|  8.85k|    if (rv != SECSuccess)
  ------------------
  |  Branch (4275:9): [True: 0, False: 8.85k]
  ------------------
 4276|      0|        goto loser;
 4277|  8.85k|    rv = ssl3_InitState(ss);
 4278|  8.85k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4278:9): [True: 0, False: 8.85k]
  ------------------
 4279|      0|        goto loser;
 4280|      0|    }
 4281|  8.85k|    return ss;
 4282|       |
 4283|      0|loser:
 4284|      0|    ssl_DestroySocketContents(ss);
 4285|      0|    ssl_DestroyLocks(ss);
 4286|      0|    PORT_Free(ss);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 4287|      0|    return NULL;
 4288|  8.85k|}
sslsock.c:ssl_PushIOLayer:
 3829|  8.85k|{
 3830|  8.85k|    PRFileDesc *layer = NULL;
 3831|  8.85k|    PRStatus status;
 3832|       |
 3833|  8.85k|    status = PR_CallOnce(&initIoLayerOnce, &ssl_InitIOLayer);
 3834|  8.85k|    if (status != PR_SUCCESS) {
  ------------------
  |  Branch (3834:9): [True: 0, False: 8.85k]
  ------------------
 3835|      0|        goto loser;
 3836|      0|    }
 3837|  8.85k|    if (ns == NULL) {
  ------------------
  |  Branch (3837:9): [True: 0, False: 8.85k]
  ------------------
 3838|      0|        goto loser;
 3839|      0|    }
 3840|  8.85k|    layer = PR_CreateIOLayerStub(ssl_layer_id, &combined_methods);
 3841|  8.85k|    if (layer == NULL)
  ------------------
  |  Branch (3841:9): [True: 0, False: 8.85k]
  ------------------
 3842|      0|        goto loser;
 3843|  8.85k|    layer->secret = (PRFilePrivate *)ns;
 3844|       |
 3845|       |    /* Here, "stack" points to the PRFileDesc on the top of the stack.
 3846|       |    ** "layer" points to a new FD that is to be inserted into the stack.
 3847|       |    ** If layer is being pushed onto the top of the stack, then
 3848|       |    ** PR_PushIOLayer switches the contents of stack and layer, and then
 3849|       |    ** puts stack on top of layer, so that after it is done, the top of
 3850|       |    ** stack is the same "stack" as it was before, and layer is now the
 3851|       |    ** FD for the former top of stack.
 3852|       |    ** After this call, stack always points to the top PRFD on the stack.
 3853|       |    ** If this function fails, the contents of stack and layer are as
 3854|       |    ** they were before the call.
 3855|       |    */
 3856|  8.85k|    status = PR_PushIOLayer(stack, id, layer);
 3857|  8.85k|    if (status != PR_SUCCESS)
  ------------------
  |  Branch (3857:9): [True: 0, False: 8.85k]
  ------------------
 3858|      0|        goto loser;
 3859|       |
 3860|  8.85k|    ns->fd = (id == PR_TOP_IO_LAYER) ? stack : layer;
  ------------------
  |  |  453|  8.85k|#define PR_TOP_IO_LAYER (PRDescIdentity)-2
  ------------------
  |  Branch (3860:14): [True: 8.85k, False: 0]
  ------------------
 3861|  8.85k|    return PR_SUCCESS;
 3862|       |
 3863|      0|loser:
 3864|      0|    if (layer) {
  ------------------
  |  Branch (3864:9): [True: 0, False: 0]
  ------------------
 3865|      0|        layer->dtor(layer); /* free layer */
 3866|      0|    }
 3867|      0|    return PR_FAILURE;
 3868|  8.85k|}
sslsock.c:ssl_InitIOLayer:
 3821|      1|{
 3822|      1|    ssl_layer_id = PR_GetUniqueIdentity("SSL");
 3823|      1|    ssl_SetupIOMethods();
 3824|      1|    return PR_SUCCESS;
 3825|      1|}
sslsock.c:ssl_SetupIOMethods:
 3779|      1|{
 3780|      1|    PRIOMethods *new_methods = &combined_methods;
 3781|      1|    const PRIOMethods *nspr_methods = PR_GetDefaultIOMethods();
 3782|      1|    const PRIOMethods *my_methods = &ssl_methods;
 3783|       |
 3784|      1|    *new_methods = *nspr_methods;
 3785|       |
 3786|      1|    new_methods->file_type = my_methods->file_type;
 3787|      1|    new_methods->close = my_methods->close;
 3788|      1|    new_methods->read = my_methods->read;
 3789|      1|    new_methods->write = my_methods->write;
 3790|      1|    new_methods->available = my_methods->available;
 3791|      1|    new_methods->available64 = my_methods->available64;
 3792|      1|    new_methods->fsync = my_methods->fsync;
 3793|      1|    new_methods->seek = my_methods->seek;
 3794|      1|    new_methods->seek64 = my_methods->seek64;
 3795|      1|    new_methods->fileInfo = my_methods->fileInfo;
 3796|      1|    new_methods->fileInfo64 = my_methods->fileInfo64;
 3797|      1|    new_methods->writev = my_methods->writev;
 3798|      1|    new_methods->connect = my_methods->connect;
 3799|      1|    new_methods->accept = my_methods->accept;
 3800|      1|    new_methods->bind = my_methods->bind;
 3801|      1|    new_methods->listen = my_methods->listen;
 3802|      1|    new_methods->shutdown = my_methods->shutdown;
 3803|      1|    new_methods->recv = my_methods->recv;
 3804|      1|    new_methods->send = my_methods->send;
 3805|      1|    new_methods->recvfrom = my_methods->recvfrom;
 3806|      1|    new_methods->sendto = my_methods->sendto;
 3807|      1|    new_methods->poll = my_methods->poll;
 3808|      1|    new_methods->acceptread = my_methods->acceptread;
 3809|      1|    new_methods->transmitfile = my_methods->transmitfile;
 3810|      1|    new_methods->getsockname = my_methods->getsockname;
 3811|      1|    new_methods->getpeername = my_methods->getpeername;
 3812|       |    /*  new_methods->getsocketoption   = my_methods->getsocketoption;       */
 3813|       |    /*  new_methods->setsocketoption   = my_methods->setsocketoption;       */
 3814|      1|    new_methods->sendfile = my_methods->sendfile;
 3815|      1|}
sslsock.c:ssl_Close:
 3157|  8.85k|{
 3158|  8.85k|    sslSocket *ss;
 3159|  8.85k|    PRStatus rv;
 3160|       |
 3161|  8.85k|    ss = ssl_GetPrivate(fd);
 3162|  8.85k|    if (!ss) {
  ------------------
  |  Branch (3162:9): [True: 0, False: 8.85k]
  ------------------
 3163|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in close", SSL_GETPID(), fd));
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
 3164|      0|        return PR_FAILURE;
 3165|      0|    }
 3166|       |
 3167|       |    /* There must not be any I/O going on */
 3168|  8.85k|    SSL_LOCK_READER(ss);
  ------------------
  |  | 1376|  8.85k|    if (ss->recvLock)       \
  |  |  ------------------
  |  |  |  Branch (1376:9): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1377|  8.85k|    PZ_Lock(ss->recvLock)
  |  |  ------------------
  |  |  |  |  245|  8.85k|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
 3169|  8.85k|    SSL_LOCK_WRITER(ss);
  ------------------
  |  | 1382|  8.85k|    if (ss->sendLock)       \
  |  |  ------------------
  |  |  |  Branch (1382:9): [True: 8.85k, False: 0]
  |  |  ------------------
  |  | 1383|  8.85k|    PZ_Lock(ss->sendLock)
  |  |  ------------------
  |  |  |  |  245|  8.85k|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
 3170|       |
 3171|       |    /* By the time this function returns,
 3172|       |    ** ss is an invalid pointer, and the locks to which it points have
 3173|       |    ** been unlocked and freed.  So, this is the ONE PLACE in all of SSL
 3174|       |    ** where the LOCK calls and the corresponding UNLOCK calls are not in
 3175|       |    ** the same function scope.  The unlock calls are in ssl_FreeSocket().
 3176|       |    */
 3177|  8.85k|    rv = (PRStatus)(*ss->ops->close)(ss);
 3178|       |
 3179|  8.85k|    return rv;
 3180|  8.85k|}
sslsock.c:ssl_GetPrivate:
  220|  10.3k|{
  221|  10.3k|    sslSocket *ss;
  222|       |
  223|  10.3k|    PORT_Assert(fd != NULL);
  ------------------
  |  |  120|  10.3k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|  10.3k|    PORT_Assert(fd->methods->file_type == PR_DESC_LAYERED);
  ------------------
  |  |  120|  10.3k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  225|  10.3k|    PORT_Assert(fd->identity == ssl_layer_id);
  ------------------
  |  |  120|  10.3k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  10.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 10.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  226|       |
  227|  10.3k|    if (fd->methods->file_type != PR_DESC_LAYERED ||
  ------------------
  |  Branch (227:9): [True: 0, False: 10.3k]
  ------------------
  228|  10.3k|        fd->identity != ssl_layer_id) {
  ------------------
  |  Branch (228:9): [True: 0, False: 10.3k]
  ------------------
  229|      0|        PORT_SetError(PR_BAD_DESCRIPTOR_ERROR);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
                      PORT_SetError(PR_BAD_DESCRIPTOR_ERROR);
  ------------------
  |  |   19|      0|#define PR_BAD_DESCRIPTOR_ERROR                  (-5999L)
  ------------------
  230|      0|        return NULL;
  231|      0|    }
  232|       |
  233|  10.3k|    ss = (sslSocket *)fd->secret;
  234|       |    /* Set ss->fd lazily. We can't rely on the value of ss->fd set by
  235|       |     * ssl_PushIOLayer because another PR_PushIOLayer call will switch the
  236|       |     * contents of the PRFileDesc pointed by ss->fd and the new layer.
  237|       |     * See bug 807250.
  238|       |     */
  239|  10.3k|    ss->fd = fd;
  240|  10.3k|    return ss;
  241|  10.3k|}
sslsock.c:ssl_Read:
 3226|  1.10k|{
 3227|  1.10k|    sslSocket *ss;
 3228|  1.10k|    int rv;
 3229|       |
 3230|  1.10k|    ss = ssl_GetPrivate(fd);
 3231|  1.10k|    if (!ss) {
  ------------------
  |  Branch (3231:9): [True: 0, False: 1.10k]
  ------------------
 3232|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in read", SSL_GETPID(), fd));
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
 3233|      0|        return SECFailure;
 3234|      0|    }
 3235|  1.10k|    SSL_LOCK_READER(ss);
  ------------------
  |  | 1376|  1.10k|    if (ss->recvLock)       \
  |  |  ------------------
  |  |  |  Branch (1376:9): [True: 1.10k, False: 0]
  |  |  ------------------
  |  | 1377|  1.10k|    PZ_Lock(ss->recvLock)
  |  |  ------------------
  |  |  |  |  245|  1.10k|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
 3236|  1.10k|    ss->rTimeout = PR_INTERVAL_NO_TIMEOUT;
  ------------------
  |  |   54|  1.10k|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
 3237|  1.10k|    if (!ss->opt.fdx)
  ------------------
  |  Branch (3237:9): [True: 1.10k, False: 0]
  ------------------
 3238|  1.10k|        ss->wTimeout = PR_INTERVAL_NO_TIMEOUT;
  ------------------
  |  |   54|  1.10k|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
 3239|  1.10k|    rv = (*ss->ops->read)(ss, (unsigned char *)buf, len);
 3240|  1.10k|    SSL_UNLOCK_READER(ss);
  ------------------
  |  | 1379|  1.10k|    if (ss->recvLock)         \
  |  |  ------------------
  |  |  |  Branch (1379:9): [True: 1.10k, False: 0]
  |  |  ------------------
  |  | 1380|  1.10k|    PZ_Unlock(ss->recvLock)
  |  |  ------------------
  |  |  |  |  246|  1.10k|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
 3241|  1.10k|    return rv;
 3242|  1.10k|}
sslsock.c:ssl_Write:
 3246|    419|{
 3247|    419|    sslSocket *ss;
 3248|    419|    int rv;
 3249|       |
 3250|    419|    ss = ssl_GetPrivate(fd);
 3251|    419|    if (!ss) {
  ------------------
  |  Branch (3251:9): [True: 0, False: 419]
  ------------------
 3252|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in write", SSL_GETPID(), fd));
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
 3253|      0|        return SECFailure;
 3254|      0|    }
 3255|    419|    SSL_LOCK_WRITER(ss);
  ------------------
  |  | 1382|    419|    if (ss->sendLock)       \
  |  |  ------------------
  |  |  |  Branch (1382:9): [True: 419, False: 0]
  |  |  ------------------
  |  | 1383|    419|    PZ_Lock(ss->sendLock)
  |  |  ------------------
  |  |  |  |  245|    419|#define PZ_Lock(k) PR_Lock((k))
  |  |  ------------------
  ------------------
 3256|    419|    ss->wTimeout = PR_INTERVAL_NO_TIMEOUT;
  ------------------
  |  |   54|    419|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
 3257|    419|    if (!ss->opt.fdx)
  ------------------
  |  Branch (3257:9): [True: 419, False: 0]
  ------------------
 3258|    419|        ss->rTimeout = PR_INTERVAL_NO_TIMEOUT;
  ------------------
  |  |   54|    419|#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL
  ------------------
 3259|    419|    rv = (*ss->ops->write)(ss, (const unsigned char *)buf, len);
 3260|    419|    SSL_UNLOCK_WRITER(ss);
  ------------------
  |  | 1385|    419|    if (ss->sendLock)         \
  |  |  ------------------
  |  |  |  Branch (1385:9): [True: 419, False: 0]
  |  |  ------------------
  |  | 1386|    419|    PZ_Unlock(ss->sendLock)
  |  |  ------------------
  |  |  |  |  246|    419|#define PZ_Unlock(k) PR_Unlock((k))
  |  |  ------------------
  ------------------
 3261|    419|    return rv;
 3262|    419|}
sslsock.c:ssl3_CreateOverlapWithPolicy:
 2633|  47.5k|{
 2634|  47.5k|    SECStatus rv;
 2635|  47.5k|    SSLVersionRange effectivePolicyBoundary;
 2636|  47.5k|    SSLVersionRange vrange;
 2637|       |
 2638|  47.5k|    PORT_Assert(input != NULL);
  ------------------
  |  |  120|  47.5k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  47.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 47.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2639|       |
 2640|  47.5k|    rv = ssl3_GetEffectiveVersionPolicy(protocolVariant,
 2641|  47.5k|                                        &effectivePolicyBoundary);
 2642|  47.5k|    if (rv == SECFailure) {
  ------------------
  |  Branch (2642:9): [True: 0, False: 47.5k]
  ------------------
 2643|       |        /* SECFailure means internal failure or invalid configuration. */
 2644|      0|        overlap->min = overlap->max = SSL_LIBRARY_VERSION_NONE;
  ------------------
  |  | 1481|      0|#define SSL_LIBRARY_VERSION_NONE 0
  ------------------
 2645|      0|        return SECFailure;
 2646|      0|    }
 2647|       |
 2648|  47.5k|    vrange.min = PR_MAX(input->min, effectivePolicyBoundary.min);
  ------------------
  |  |  159|  47.5k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 10.9k, False: 36.5k]
  |  |  ------------------
  ------------------
 2649|  47.5k|    vrange.max = PR_MIN(input->max, effectivePolicyBoundary.max);
  ------------------
  |  |  158|  47.5k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 1.34k, False: 46.1k]
  |  |  ------------------
  ------------------
 2650|       |
 2651|  47.5k|    if (vrange.max < vrange.min) {
  ------------------
  |  Branch (2651:9): [True: 0, False: 47.5k]
  ------------------
 2652|       |        /* there was no overlap, turn off range altogether */
 2653|      0|        overlap->min = overlap->max = SSL_LIBRARY_VERSION_NONE;
  ------------------
  |  | 1481|      0|#define SSL_LIBRARY_VERSION_NONE 0
  ------------------
 2654|      0|        return SECFailure;
 2655|      0|    }
 2656|       |
 2657|  47.5k|    *overlap = vrange;
 2658|  47.5k|    return SECSuccess;
 2659|  47.5k|}
sslsock.c:ssl3_CheckRangeValidAndConstrainByPolicy:
 2812|  20.9k|{
 2813|  20.9k|    SECStatus rv;
 2814|       |
 2815|  20.9k|    if (vrange->min > vrange->max ||
  ------------------
  |  Branch (2815:9): [True: 0, False: 20.9k]
  ------------------
 2816|  20.9k|        !ssl3_VersionIsSupportedByCode(protocolVariant, vrange->min) ||
  ------------------
  |  Branch (2816:9): [True: 0, False: 20.9k]
  ------------------
 2817|  20.9k|        !ssl3_VersionIsSupportedByCode(protocolVariant, vrange->max) ||
  ------------------
  |  Branch (2817:9): [True: 0, False: 20.9k]
  ------------------
 2818|  20.9k|        ssl3_HasConflictingSSLVersions(vrange)) {
  ------------------
  |  Branch (2818:9): [True: 0, False: 20.9k]
  ------------------
 2819|      0|        PORT_SetError(SSL_ERROR_INVALID_VERSION_RANGE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2820|      0|        return SECFailure;
 2821|      0|    }
 2822|       |
 2823|       |    /* Try to adjust the received range using our policy.
 2824|       |     * If there's overlap, we'll use the (possibly reduced) range.
 2825|       |     * If there isn't overlap, it's failure. */
 2826|       |
 2827|  20.9k|    rv = ssl3_CreateOverlapWithPolicy(protocolVariant, vrange, vrange);
 2828|  20.9k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2828:9): [True: 0, False: 20.9k]
  ------------------
 2829|      0|        return rv;
 2830|      0|    }
 2831|       |
 2832|       |    /* We don't allow SSLv3 and TLSv1.3 together */
 2833|  20.9k|    if (vrange->max >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  20.9k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (2833:9): [True: 19.6k, False: 1.34k]
  ------------------
 2834|  19.6k|        vrange->min = PR_MAX(vrange->min, SSL_LIBRARY_VERSION_TLS_1_0);
  ------------------
  |  |  159|  19.6k|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 10.7k, False: 8.85k]
  |  |  ------------------
  ------------------
 2835|  19.6k|    }
 2836|       |
 2837|  20.9k|    return SECSuccess;
 2838|  20.9k|}
sslsock.c:ssl3_HasConflictingSSLVersions:
 2804|  20.9k|{
 2805|  20.9k|    return (vrange->min <= SSL_LIBRARY_VERSION_3_0 &&
  ------------------
  |  |   17|  41.9k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (2805:13): [True: 0, False: 20.9k]
  ------------------
 2806|  20.9k|            vrange->max >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (2806:13): [True: 0, False: 0]
  ------------------
 2807|  20.9k|}
sslsock.c:ssl_MakeLocks:
 3873|  8.85k|{
 3874|  8.85k|    ss->firstHandshakeLock = PZ_NewMonitor(nssILockSSL);
  ------------------
  |  |  254|  8.85k|#define PZ_NewMonitor(t) PR_NewMonitor()
  ------------------
 3875|  8.85k|    if (!ss->firstHandshakeLock)
  ------------------
  |  Branch (3875:9): [True: 0, False: 8.85k]
  ------------------
 3876|      0|        goto loser;
 3877|  8.85k|    ss->ssl3HandshakeLock = PZ_NewMonitor(nssILockSSL);
  ------------------
  |  |  254|  8.85k|#define PZ_NewMonitor(t) PR_NewMonitor()
  ------------------
 3878|  8.85k|    if (!ss->ssl3HandshakeLock)
  ------------------
  |  Branch (3878:9): [True: 0, False: 8.85k]
  ------------------
 3879|      0|        goto loser;
 3880|  8.85k|    ss->specLock = NSSRWLock_New(SSL_LOCK_RANK_SPEC, NULL);
  ------------------
  |  |   49|  8.85k|#define NSSRWLock_New NSSRWLock_New_Util
  ------------------
                  ss->specLock = NSSRWLock_New(SSL_LOCK_RANK_SPEC, NULL);
  ------------------
  |  |  306|  8.85k|#define SSL_LOCK_RANK_SPEC 255
  ------------------
 3881|  8.85k|    if (!ss->specLock)
  ------------------
  |  Branch (3881:9): [True: 0, False: 8.85k]
  ------------------
 3882|      0|        goto loser;
 3883|  8.85k|    ss->recvBufLock = PZ_NewMonitor(nssILockSSL);
  ------------------
  |  |  254|  8.85k|#define PZ_NewMonitor(t) PR_NewMonitor()
  ------------------
 3884|  8.85k|    if (!ss->recvBufLock)
  ------------------
  |  Branch (3884:9): [True: 0, False: 8.85k]
  ------------------
 3885|      0|        goto loser;
 3886|  8.85k|    ss->xmitBufLock = PZ_NewMonitor(nssILockSSL);
  ------------------
  |  |  254|  8.85k|#define PZ_NewMonitor(t) PR_NewMonitor()
  ------------------
 3887|  8.85k|    if (!ss->xmitBufLock)
  ------------------
  |  Branch (3887:9): [True: 0, False: 8.85k]
  ------------------
 3888|      0|        goto loser;
 3889|  8.85k|    ss->writerThread = NULL;
 3890|  8.85k|    if (ssl_lock_readers) {
  ------------------
  |  Branch (3890:9): [True: 8.85k, False: 0]
  ------------------
 3891|  8.85k|        ss->recvLock = PZ_NewLock(nssILockSSL);
  ------------------
  |  |  243|  8.85k|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 3892|  8.85k|        if (!ss->recvLock)
  ------------------
  |  Branch (3892:13): [True: 0, False: 8.85k]
  ------------------
 3893|      0|            goto loser;
 3894|  8.85k|        ss->sendLock = PZ_NewLock(nssILockSSL);
  ------------------
  |  |  243|  8.85k|#define PZ_NewLock(t) PR_NewLock()
  ------------------
 3895|  8.85k|        if (!ss->sendLock)
  ------------------
  |  Branch (3895:13): [True: 0, False: 8.85k]
  ------------------
 3896|      0|            goto loser;
 3897|  8.85k|    }
 3898|  8.85k|    return SECSuccess;
 3899|      0|loser:
 3900|      0|    ssl_DestroyLocks(ss);
 3901|      0|    return SECFailure;
 3902|  8.85k|}
sslsock.c:ssl_SetDefaultsFromEnvironment:
 3995|  8.85k|{
 3996|  8.85k|    PR_CallOnce(&ssl_setDefaultsFromEnvironment, ssl_SetDefaultsFromEnvironmentCallOnce);
 3997|  8.85k|}
sslsock.c:ssl_SetDefaultsFromEnvironmentCallOnce:
 3912|      1|{
 3913|      1|#if defined(NSS_HAVE_GETENV)
 3914|      1|    char *ev;
 3915|      1|#ifdef DEBUG
 3916|      1|    ssl_trace_iob = NULL;
 3917|      1|    ev = PR_GetEnvSecure("SSLDEBUGFILE");
 3918|      1|    if (ev && ev[0]) {
  ------------------
  |  Branch (3918:9): [True: 0, False: 1]
  |  Branch (3918:15): [True: 0, False: 0]
  ------------------
 3919|      0|        ssl_trace_iob = fopen(ev, "w");
 3920|      0|    }
 3921|      1|    if (!ssl_trace_iob) {
  ------------------
  |  Branch (3921:9): [True: 1, False: 0]
  ------------------
 3922|      1|        ssl_trace_iob = stderr;
 3923|      1|    }
 3924|      1|#ifdef TRACE
 3925|      1|    ev = PR_GetEnvSecure("SSLTRACE");
 3926|      1|    if (ev && ev[0]) {
  ------------------
  |  Branch (3926:9): [True: 0, False: 1]
  |  Branch (3926:15): [True: 0, False: 0]
  ------------------
 3927|      0|        ssl_trace = atoi(ev);
 3928|      0|        SSL_TRACE(("SSL: tracing set to %d", ssl_trace));
  ------------------
  |  | 1900|      0|#define SSL_TRACE(msg) ssl_Trace msg
  ------------------
 3929|      0|    }
 3930|      1|#endif /* TRACE */
 3931|      1|    ev = PR_GetEnvSecure("SSLDEBUG");
 3932|      1|    if (ev && ev[0]) {
  ------------------
  |  Branch (3932:9): [True: 0, False: 1]
  |  Branch (3932:15): [True: 0, False: 0]
  ------------------
 3933|      0|        ssl_debug = atoi(ev);
 3934|      0|        SSL_TRACE(("SSL: debugging set to %d", ssl_debug));
  ------------------
  |  | 1900|      0|#define SSL_TRACE(msg) ssl_Trace msg
  ------------------
 3935|      0|    }
 3936|      1|#endif /* DEBUG */
 3937|      1|#ifdef NSS_ALLOW_SSLKEYLOGFILE
 3938|      1|    ssl_keylog_iob = NULL;
 3939|      1|    ev = PR_GetEnvSecure("SSLKEYLOGFILE");
 3940|      1|    if (ev && ev[0]) {
  ------------------
  |  Branch (3940:9): [True: 0, False: 1]
  |  Branch (3940:15): [True: 0, False: 0]
  ------------------
 3941|      0|        ssl_keylog_iob = fopen(ev, "a");
 3942|      0|        if (!ssl_keylog_iob) {
  ------------------
  |  Branch (3942:13): [True: 0, False: 0]
  ------------------
 3943|      0|            SSL_TRACE(("SSL: failed to open key log file"));
  ------------------
  |  | 1900|      0|#define SSL_TRACE(msg) ssl_Trace msg
  ------------------
 3944|      0|        } else {
 3945|      0|            if (ftell(ssl_keylog_iob) == 0) {
  ------------------
  |  Branch (3945:17): [True: 0, False: 0]
  ------------------
 3946|      0|                fputs("# SSL/TLS secrets log file, generated by NSS\n",
 3947|      0|                      ssl_keylog_iob);
 3948|      0|            }
 3949|      0|            SSL_TRACE(("SSL: logging SSL/TLS secrets to %s", ev));
  ------------------
  |  | 1900|      0|#define SSL_TRACE(msg) ssl_Trace msg
  ------------------
 3950|      0|            ssl_keylog_lock = PR_NewLock();
 3951|      0|            if (!ssl_keylog_lock) {
  ------------------
  |  Branch (3951:17): [True: 0, False: 0]
  ------------------
 3952|      0|                SSL_TRACE(("SSL: failed to create key log lock"));
  ------------------
  |  | 1900|      0|#define SSL_TRACE(msg) ssl_Trace msg
  ------------------
 3953|      0|                fclose(ssl_keylog_iob);
 3954|      0|                ssl_keylog_iob = NULL;
 3955|      0|            }
 3956|      0|        }
 3957|      0|    }
 3958|      1|#endif
 3959|      1|    ev = PR_GetEnvSecure("SSLFORCELOCKS");
 3960|      1|    if (ev && ev[0] == '1') {
  ------------------
  |  Branch (3960:9): [True: 0, False: 1]
  |  Branch (3960:15): [True: 0, False: 0]
  ------------------
 3961|      0|        ssl_force_locks = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3962|      0|        ssl_defaults.noLocks = 0;
 3963|      0|        SSL_TRACE(("SSL: force_locks set to %d", ssl_force_locks));
  ------------------
  |  | 1900|      0|#define SSL_TRACE(msg) ssl_Trace msg
  ------------------
 3964|      0|    }
 3965|      1|    ev = PR_GetEnvSecure("NSS_SSL_ENABLE_RENEGOTIATION");
 3966|      1|    if (ev) {
  ------------------
  |  Branch (3966:9): [True: 0, False: 1]
  ------------------
 3967|      0|        if (ev[0] == '1' || LOWER(ev[0]) == 'u')
  ------------------
  |  | 3908|      0|#define LOWER(x) (x | 0x20) /* cheap ToLower function ignores LOCALE */
  ------------------
  |  Branch (3967:13): [True: 0, False: 0]
  |  Branch (3967:29): [True: 0, False: 0]
  ------------------
 3968|      0|            ssl_defaults.enableRenegotiation = SSL_RENEGOTIATE_UNRESTRICTED;
  ------------------
  |  |  714|      0|#define SSL_RENEGOTIATE_UNRESTRICTED ((PRBool)1)
  ------------------
 3969|      0|        else if (ev[0] == '0' || LOWER(ev[0]) == 'n')
  ------------------
  |  | 3908|      0|#define LOWER(x) (x | 0x20) /* cheap ToLower function ignores LOCALE */
  ------------------
  |  Branch (3969:18): [True: 0, False: 0]
  |  Branch (3969:34): [True: 0, False: 0]
  ------------------
 3970|      0|            ssl_defaults.enableRenegotiation = SSL_RENEGOTIATE_NEVER;
  ------------------
  |  |  711|      0|#define SSL_RENEGOTIATE_NEVER ((PRBool)0)
  ------------------
 3971|      0|        else if (ev[0] == '2' || LOWER(ev[0]) == 'r')
  ------------------
  |  | 3908|      0|#define LOWER(x) (x | 0x20) /* cheap ToLower function ignores LOCALE */
  ------------------
  |  Branch (3971:18): [True: 0, False: 0]
  |  Branch (3971:34): [True: 0, False: 0]
  ------------------
 3972|      0|            ssl_defaults.enableRenegotiation = SSL_RENEGOTIATE_REQUIRES_XTN;
  ------------------
  |  |  717|      0|#define SSL_RENEGOTIATE_REQUIRES_XTN ((PRBool)2)
  ------------------
 3973|      0|        else if (ev[0] == '3' || LOWER(ev[0]) == 't')
  ------------------
  |  | 3908|      0|#define LOWER(x) (x | 0x20) /* cheap ToLower function ignores LOCALE */
  ------------------
  |  Branch (3973:18): [True: 0, False: 0]
  |  Branch (3973:34): [True: 0, False: 0]
  ------------------
 3974|      0|            ssl_defaults.enableRenegotiation = SSL_RENEGOTIATE_TRANSITIONAL;
  ------------------
  |  |  722|      0|#define SSL_RENEGOTIATE_TRANSITIONAL ((PRBool)3)
  ------------------
 3975|      0|        SSL_TRACE(("SSL: enableRenegotiation set to %d",
  ------------------
  |  | 1900|      0|#define SSL_TRACE(msg) ssl_Trace msg
  ------------------
 3976|      0|                   ssl_defaults.enableRenegotiation));
 3977|      0|    }
 3978|      1|    ev = PR_GetEnvSecure("NSS_SSL_REQUIRE_SAFE_NEGOTIATION");
 3979|      1|    if (ev && ev[0] == '1') {
  ------------------
  |  Branch (3979:9): [True: 0, False: 1]
  |  Branch (3979:15): [True: 0, False: 0]
  ------------------
 3980|      0|        ssl_defaults.requireSafeNegotiation = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3981|      0|        SSL_TRACE(("SSL: requireSafeNegotiation set to %d",
  ------------------
  |  | 1900|      0|#define SSL_TRACE(msg) ssl_Trace msg
  ------------------
 3982|      0|                   PR_TRUE));
 3983|      0|    }
 3984|      1|    ev = PR_GetEnvSecure("NSS_SSL_CBC_RANDOM_IV");
 3985|      1|    if (ev && ev[0] == '0') {
  ------------------
  |  Branch (3985:9): [True: 0, False: 1]
  |  Branch (3985:15): [True: 0, False: 0]
  ------------------
 3986|      0|        ssl_defaults.cbcRandomIV = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 3987|      0|        SSL_TRACE(("SSL: cbcRandomIV set to 0"));
  ------------------
  |  | 1900|      0|#define SSL_TRACE(msg) ssl_Trace msg
  ------------------
 3988|      0|    }
 3989|      1|#endif /* NSS_HAVE_GETENV */
 3990|      1|    return PR_SUCCESS;
 3991|      1|}

ssl_GetBulkCipherDef:
   68|  1.22M|{
   69|  1.22M|    SSL3BulkCipher bulkCipher = suiteDef->bulk_cipher_alg;
   70|  1.22M|    PORT_Assert(bulkCipher < PR_ARRAY_SIZE(ssl_bulk_cipher_defs));
  ------------------
  |  |  120|  1.22M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.22M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.22M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   71|  1.22M|    PORT_Assert(ssl_bulk_cipher_defs[bulkCipher].cipher == bulkCipher);
  ------------------
  |  |  120|  1.22M|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.22M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.22M, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   72|  1.22M|    return &ssl_bulk_cipher_defs[bulkCipher];
   73|  1.22M|}
ssl_GetMacDefByAlg:
   91|  11.4k|{
   92|       |    /* Cast here for clang: https://bugs.llvm.org/show_bug.cgi?id=16154 */
   93|  11.4k|    PORT_Assert((size_t)mac < PR_ARRAY_SIZE(ssl_mac_defs));
  ------------------
  |  |  120|  11.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  11.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 11.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   94|  11.4k|    PORT_Assert(ssl_mac_defs[mac].mac == mac);
  ------------------
  |  |  120|  11.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  11.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 11.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   95|  11.4k|    return &ssl_mac_defs[mac];
   96|  11.4k|}
ssl_GetMacDef:
  100|  11.1k|{
  101|  11.1k|    SSL3MACAlgorithm mac = suiteDef->mac_alg;
  102|  11.1k|    if (ss->version > SSL_LIBRARY_VERSION_3_0) {
  ------------------
  |  |   17|  11.1k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (102:9): [True: 11.1k, False: 0]
  ------------------
  103|  11.1k|        switch (mac) {
  104|    294|            case ssl_mac_md5:
  ------------------
  |  Branch (104:13): [True: 294, False: 10.8k]
  ------------------
  105|    294|                mac = ssl_hmac_md5;
  106|    294|                break;
  107|  4.65k|            case ssl_mac_sha:
  ------------------
  |  Branch (107:13): [True: 4.65k, False: 6.47k]
  ------------------
  108|  4.65k|                mac = ssl_hmac_sha;
  109|  4.65k|                break;
  110|  6.17k|            default:
  ------------------
  |  Branch (110:13): [True: 6.17k, False: 4.95k]
  ------------------
  111|  6.17k|                break;
  112|  11.1k|        }
  113|  11.1k|    }
  114|  11.1k|    return ssl_GetMacDefByAlg(mac);
  115|  11.1k|}
ssl_FindCipherSpecByEpoch:
  120|  3.76k|{
  121|  3.76k|    PRCList *cur_p;
  122|  3.76k|    for (cur_p = PR_LIST_HEAD(&ss->ssl3.hs.cipherSpecs);
  ------------------
  |  |   65|  3.76k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
  123|  11.2k|         cur_p != &ss->ssl3.hs.cipherSpecs;
  ------------------
  |  Branch (123:10): [True: 7.52k, False: 3.76k]
  ------------------
  124|  7.52k|         cur_p = PR_NEXT_LINK(cur_p)) {
  ------------------
  |  |   47|  7.52k|        ((_e)->next)
  ------------------
  125|  7.52k|        ssl3CipherSpec *spec = (ssl3CipherSpec *)cur_p;
  126|  7.52k|        if (spec->epoch != epoch) {
  ------------------
  |  Branch (126:13): [True: 6.17k, False: 1.34k]
  ------------------
  127|  6.17k|            continue;
  128|  6.17k|        }
  129|  1.34k|        if (direction != spec->direction) {
  ------------------
  |  Branch (129:13): [True: 1.34k, False: 0]
  ------------------
  130|  1.34k|            continue;
  131|  1.34k|        }
  132|      0|        return spec;
  133|  1.34k|    }
  134|  3.76k|    return NULL;
  135|  3.76k|}
ssl_CreateCipherSpec:
  139|  29.7k|{
  140|  29.7k|    ssl3CipherSpec *spec = PORT_ZNew(ssl3CipherSpec);
  ------------------
  |  |  148|  29.7k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  29.7k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  141|  29.7k|    if (!spec) {
  ------------------
  |  Branch (141:9): [True: 0, False: 29.7k]
  ------------------
  142|      0|        return NULL;
  143|      0|    }
  144|  29.7k|    spec->refCt = 1;
  145|  29.7k|    spec->version = ss->version;
  146|  29.7k|    spec->direction = direction;
  147|  29.7k|    spec->recordSizeLimit = MAX_FRAGMENT_LENGTH;
  ------------------
  |  |   35|  29.7k|#define MAX_FRAGMENT_LENGTH 16384
  ------------------
  148|  29.7k|    SSL_TRC(10, ("%d: SSL[%d]: new %s spec %d ct=%d",
  ------------------
  |  |   71|  29.7k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 29.7k]
  |  |  ------------------
  |  |   72|  29.7k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  149|  29.7k|                 SSL_GETPID(), ss->fd, SPEC_DIR(spec), spec,
  150|  29.7k|                 spec->refCt));
  151|  29.7k|    return spec;
  152|  29.7k|}
ssl_SaveCipherSpec:
  156|  29.7k|{
  157|  29.7k|    PR_APPEND_LINK(&spec->link, &ss->ssl3.hs.cipherSpecs);
  ------------------
  |  |   57|  29.7k|#define PR_APPEND_LINK(_e,_l) PR_INSERT_BEFORE(_e,_l)
  |  |  ------------------
  |  |  |  |   25|  29.7k|    PR_BEGIN_MACRO       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  29.7k|#define PR_BEGIN_MACRO  do {
  |  |  |  |  ------------------
  |  |  |  |   26|  29.7k|    (_e)->next = (_l);   \
  |  |  |  |   27|  29.7k|    (_e)->prev = (_l)->prev; \
  |  |  |  |   28|  29.7k|    (_l)->prev->next = (_e); \
  |  |  |  |   29|  29.7k|    (_l)->prev = (_e);   \
  |  |  |  |   30|  29.7k|    PR_END_MACRO
  |  |  |  |  ------------------
  |  |  |  |  |  |  124|  29.7k|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  158|  29.7k|}
ssl_SetupNullCipherSpec:
  164|  17.7k|{
  165|  17.7k|    ssl3CipherSpec *spec;
  166|       |
  167|  17.7k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSpecWriteLock(ss));
  ------------------
  |  |  120|  17.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  35.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 17.7k]
  |  |  |  |  |  Branch (208:7): [True: 17.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  168|       |
  169|  17.7k|    spec = ssl_CreateCipherSpec(ss, dir);
  170|  17.7k|    if (!spec) {
  ------------------
  |  Branch (170:9): [True: 0, False: 17.7k]
  ------------------
  171|      0|        return SECFailure;
  172|      0|    }
  173|       |
  174|       |    /* Set default versions.  This value will be used to generate and send
  175|       |     * alerts if a version is not negotiated.  These values are overridden when
  176|       |     * sending a ClientHello and when a version is negotiated. */
  177|  17.7k|    spec->version = SSL_LIBRARY_VERSION_TLS_1_0;
  ------------------
  |  |   18|  17.7k|#define SSL_LIBRARY_VERSION_TLS_1_0             0x0301
  ------------------
  178|  17.7k|    spec->recordVersion = IS_DTLS(ss)
  ------------------
  |  |  892|  17.7k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 17.7k, False: 0]
  |  |  ------------------
  ------------------
  179|  17.7k|                              ? SSL_LIBRARY_VERSION_DTLS_1_0_WIRE
  ------------------
  |  |   32|  17.7k|#define SSL_LIBRARY_VERSION_DTLS_1_0_WIRE       ((~0x0100) & 0xffff)
  ------------------
  180|  17.7k|                              : SSL_LIBRARY_VERSION_TLS_1_0;
  ------------------
  |  |   18|  17.7k|#define SSL_LIBRARY_VERSION_TLS_1_0             0x0301
  ------------------
  181|  17.7k|    spec->cipherDef = &ssl_bulk_cipher_defs[cipher_null];
  182|  17.7k|    PORT_Assert(spec->cipherDef->cipher == cipher_null);
  ------------------
  |  |  120|  17.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  17.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 17.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|  17.7k|    spec->macDef = &ssl_mac_defs[ssl_mac_null];
  184|  17.7k|    PORT_Assert(spec->macDef->mac == ssl_mac_null);
  ------------------
  |  |  120|  17.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  17.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 17.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  17.7k|    spec->cipher = Null_Cipher;
  186|       |
  187|  17.7k|    spec->phase = "cleartext";
  188|  17.7k|    dtls_InitRecvdRecords(&spec->recvdRecords);
  189|       |
  190|  17.7k|    ssl_SaveCipherSpec(ss, spec);
  191|  17.7k|    if (dir == ssl_secret_read) {
  ------------------
  |  Branch (191:9): [True: 8.85k, False: 8.85k]
  ------------------
  192|  8.85k|        ss->ssl3.crSpec = spec;
  193|  8.85k|    } else {
  194|  8.85k|        ss->ssl3.cwSpec = spec;
  195|  8.85k|    }
  196|  17.7k|    return SECSuccess;
  197|  17.7k|}
ssl_CipherSpecAddRef:
  201|  16.3k|{
  202|  16.3k|    ++spec->refCt;
  203|  16.3k|    SSL_TRC(10, ("%d: SSL[-]: Increment ref ct for %s spec %d. new ct = %d",
  ------------------
  |  |   71|  16.3k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 16.3k]
  |  |  ------------------
  |  |   72|  16.3k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  204|  16.3k|                 SSL_GETPID(), SPEC_DIR(spec), spec, spec->refCt));
  205|  16.3k|}
ssl_DestroyKeyMaterial:
  209|  29.7k|{
  210|  29.7k|    PK11_FreeSymKey(keyMaterial->key);
  211|  29.7k|    PK11_FreeSymKey(keyMaterial->macKey);
  212|  29.7k|    if (keyMaterial->macContext != NULL) {
  ------------------
  |  Branch (212:9): [True: 3.15k, False: 26.5k]
  ------------------
  213|  3.15k|        PK11_DestroyContext(keyMaterial->macContext, PR_TRUE);
  ------------------
  |  |  437|  3.15k|#define PR_TRUE 1
  ------------------
  214|  3.15k|    }
  215|  29.7k|}
ssl_CipherSpecRelease:
  240|  18.3k|{
  241|  18.3k|    if (!spec) {
  ------------------
  |  Branch (241:9): [True: 0, False: 18.3k]
  ------------------
  242|      0|        return;
  243|      0|    }
  244|       |
  245|  18.3k|    PORT_Assert(spec->refCt > 0);
  ------------------
  |  |  120|  18.3k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  18.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 18.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  246|  18.3k|    --spec->refCt;
  247|  18.3k|    SSL_TRC(10, ("%d: SSL[-]: decrement refct for %s spec %d. epoch=%d new ct = %d",
  ------------------
  |  |   71|  18.3k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 18.3k]
  |  |  ------------------
  |  |   72|  18.3k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  248|  18.3k|                 SSL_GETPID(), SPEC_DIR(spec), spec, spec->epoch, spec->refCt));
  249|  18.3k|    if (!spec->refCt) {
  ------------------
  |  Branch (249:9): [True: 2.83k, False: 15.5k]
  ------------------
  250|  2.83k|        ssl_FreeCipherSpec(spec);
  251|  2.83k|    }
  252|  18.3k|}
ssl_DestroyCipherSpecs:
  256|  8.85k|{
  257|  35.7k|    while (!PR_CLIST_IS_EMPTY(list)) {
  ------------------
  |  |   94|  35.7k|    ((_l)->next == (_l))
  ------------------
  |  Branch (257:12): [True: 26.8k, False: 8.85k]
  ------------------
  258|  26.8k|        ssl3CipherSpec *spec = (ssl3CipherSpec *)PR_LIST_TAIL(list);
  ------------------
  |  |   66|  26.8k|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
  259|  26.8k|        ssl_FreeCipherSpec(spec);
  260|  26.8k|    }
  261|  8.85k|}
sslspec.c:ssl_FreeCipherSpec:
  219|  29.7k|{
  220|  29.7k|    SSL_TRC(10, ("%d: SSL[-]: Freeing %s spec %d. epoch=%d",
  ------------------
  |  |   71|  29.7k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 29.7k]
  |  |  ------------------
  |  |   72|  29.7k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  221|  29.7k|                 SSL_GETPID(), SPEC_DIR(spec), spec, spec->epoch));
  222|       |
  223|  29.7k|    PR_REMOVE_LINK(&spec->link);
  ------------------
  |  |   72|  29.7k|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|  29.7k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|  29.7k|    (_e)->prev->next = (_e)->next; \
  |  |   74|  29.7k|    (_e)->next->prev = (_e)->prev; \
  |  |   75|  29.7k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  29.7k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  224|       |
  225|       |    /*  PORT_Assert( ss->opt.noLocks || ssl_HaveSpecWriteLock(ss)); Don't have ss! */
  226|  29.7k|    if (spec->cipherContext) {
  ------------------
  |  Branch (226:9): [True: 3.66k, False: 26.0k]
  ------------------
  227|  3.66k|        PK11_DestroyContext(spec->cipherContext, PR_TRUE);
  ------------------
  |  |  437|  3.66k|#define PR_TRUE 1
  ------------------
  228|  3.66k|    }
  229|  29.7k|    PK11_FreeSymKey(spec->masterSecret);
  230|  29.7k|    ssl_DestroyKeyMaterial(&spec->keyMaterial);
  231|  29.7k|    ssl_DestroyMaskingContextInner(spec->maskContext);
  232|       |
  233|  29.7k|    PORT_ZFree(spec, sizeof(*spec));
  ------------------
  |  |   75|  29.7k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  234|  29.7k|}

tls13_FatalError:
  138|    290|{
  139|    290|    PORT_Assert(desc != internal_error); /* These should never happen */
  ------------------
  |  |  120|    290|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    290|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 290, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  140|    290|    (void)SSL3_SendAlert(ss, alert_fatal, desc);
  141|    290|    PORT_SetError(prError);
  ------------------
  |  |   65|    290|#define PORT_SetError PORT_SetError_Util
  ------------------
  142|    290|}
tls13_SetHsState:
  188|    846|{
  189|    846|#ifdef TRACE
  190|    846|    const char *new_state_name =
  191|    846|        tls13_HandshakeState(ws);
  192|       |
  193|    846|    SSL_TRC(3, ("%d: TLS13[%d]: %s state change from %s->%s in %s (%s:%d)",
  ------------------
  |  |   71|    846|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 846]
  |  |  ------------------
  |  |   72|    846|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  194|    846|                SSL_GETPID(), ss->fd, SSL_ROLE(ss),
  195|    846|                tls13_HandshakeState(TLS13_BASE_WAIT_STATE(ss->ssl3.hs.ws)),
  196|    846|                new_state_name,
  197|    846|                func, file, line));
  198|    846|#endif
  199|       |
  200|    846|    ss->ssl3.hs.ws = TLS13_WAIT_STATE(ws);
  ------------------
  |  |  180|    846|#define TLS13_WAIT_STATE(ws) (((ws == idle_handshake) || (ws == wait_server_hello)) ? ws : ws | TLS13_WAIT_STATE_MASK)
  |  |  ------------------
  |  |  |  |  176|  1.69k|#define TLS13_WAIT_STATE_MASK 0x80
  |  |  ------------------
  |  |  |  Branch (180:32): [True: 0, False: 846]
  |  |  |  Branch (180:58): [True: 0, False: 846]
  |  |  ------------------
  ------------------
  201|    846|}
tls13_InHsState:
  218|    313|{
  219|    313|    PRBool found;
  220|    313|    va_list ap;
  221|       |
  222|    313|    va_start(ap, ss);
  223|    313|    found = tls13_InHsStateV(ss, ap);
  224|    313|    va_end(ap);
  225|       |
  226|    313|    return found;
  227|    313|}
tls13_IsPostHandshake:
  253|  11.0k|{
  254|  11.0k|    return ss->version >= SSL_LIBRARY_VERSION_TLS_1_3 && ss->firstHsDone;
  ------------------
  |  |   21|  22.0k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (254:12): [True: 38, False: 10.9k]
  |  Branch (254:58): [True: 0, False: 38]
  ------------------
  255|  11.0k|}
tls13_GetHashForCipherSuite:
  259|      8|{
  260|      8|    const ssl3CipherSuiteDef *cipherDef =
  261|      8|        ssl_LookupCipherSuiteDef(suite);
  262|      8|    PORT_Assert(cipherDef);
  ------------------
  |  |  120|      8|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      8|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  263|      8|    if (!cipherDef) {
  ------------------
  |  Branch (263:9): [True: 0, False: 8]
  ------------------
  264|      0|        return ssl_hash_none;
  265|      0|    }
  266|      8|    return cipherDef->prf_hash;
  267|      8|}
tls13_GetHash:
  271|  11.2k|{
  272|       |    /* suite_def may not be set yet when doing EPSK 0-Rtt. */
  273|  11.2k|    if (!ss->ssl3.hs.suite_def) {
  ------------------
  |  Branch (273:9): [True: 0, False: 11.2k]
  ------------------
  274|      0|        if (ss->xtnData.selectedPsk) {
  ------------------
  |  Branch (274:13): [True: 0, False: 0]
  ------------------
  275|      0|            return ss->xtnData.selectedPsk->hash;
  276|      0|        }
  277|       |        /* This should never happen. */
  278|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|      0|        return ssl_hash_none;
  280|      0|    }
  281|       |
  282|       |    /* All TLS 1.3 cipher suites must have an explict PRF hash. */
  283|  11.2k|    PORT_Assert(ss->ssl3.hs.suite_def->prf_hash != ssl_hash_none);
  ------------------
  |  |  120|  11.2k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  11.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 11.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  284|  11.2k|    return ss->ssl3.hs.suite_def->prf_hash;
  285|  11.2k|}
tls13_GetHashAndCipher:
  290|    897|{
  291|    897|    if (version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|    897|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (291:9): [True: 0, False: 897]
  ------------------
  292|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  293|      0|        return SECFailure;
  294|      0|    }
  295|       |
  296|       |    // Lookup and check the suite.
  297|    897|    SSLVersionRange vrange = { version, version };
  298|    897|    if (!ssl3_CipherSuiteAllowedForVersionRange(cipherSuite, &vrange)) {
  ------------------
  |  Branch (298:9): [True: 0, False: 897]
  ------------------
  299|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  300|      0|        return SECFailure;
  301|      0|    }
  302|    897|    const ssl3CipherSuiteDef *suiteDef = ssl_LookupCipherSuiteDef(cipherSuite);
  303|    897|    const ssl3BulkCipherDef *cipherDef = ssl_GetBulkCipherDef(suiteDef);
  304|    897|    if (cipherDef->type != type_aead) {
  ------------------
  |  Branch (304:9): [True: 0, False: 897]
  ------------------
  305|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  306|      0|        return SECFailure;
  307|      0|    }
  308|    897|    *hash = suiteDef->prf_hash;
  309|    897|    if (cipher != NULL) {
  ------------------
  |  Branch (309:9): [True: 897, False: 0]
  ------------------
  310|    897|        *cipher = cipherDef;
  311|    897|    }
  312|    897|    return SECSuccess;
  313|    897|}
tls13_GetHashSizeForHash:
  317|  37.9k|{
  318|  37.9k|    switch (hash) {
  319|  15.9k|        case ssl_hash_sha256:
  ------------------
  |  Branch (319:9): [True: 15.9k, False: 21.9k]
  ------------------
  320|  15.9k|            return 32;
  321|  21.9k|        case ssl_hash_sha384:
  ------------------
  |  Branch (321:9): [True: 21.9k, False: 15.9k]
  ------------------
  322|  21.9k|            return 48;
  323|      0|        default:
  ------------------
  |  Branch (323:9): [True: 0, False: 37.9k]
  ------------------
  324|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  325|  37.9k|    }
  326|      0|    return 32;
  327|  37.9k|}
tls13_GetHashSize:
  331|  1.69k|{
  332|  1.69k|    return tls13_GetHashSizeForHash(tls13_GetHash(ss));
  333|  1.69k|}
tls13_ComputeHash:
  359|  6.59k|{
  360|  6.59k|    SECStatus rv;
  361|       |
  362|  6.59k|    rv = PK11_HashBuf(ssl3_HashTypeToOID(hash), hashes->u.raw, buf, len);
  363|  6.59k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (363:9): [True: 0, False: 6.59k]
  ------------------
  364|      0|        FATAL_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  365|      0|        return SECFailure;
  366|      0|    }
  367|  6.59k|    hashes->len = tls13_GetHashSizeForHash(hash);
  368|       |
  369|  6.59k|    return SECSuccess;
  370|  6.59k|}
tls13_CreateKeyShare:
  454|  8.47k|{
  455|  8.47k|    SECStatus rv;
  456|  8.47k|    const ssl3DHParams *params;
  457|  8.47k|    sslEphemeralKeyPair *keyPair = NULL;
  458|       |
  459|  8.47k|    PORT_Assert(groupDef);
  ------------------
  |  |  120|  8.47k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.47k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 8.47k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  460|  8.47k|    switch (groupDef->keaType) {
  461|      0|        case ssl_kea_ecdh_hybrid:
  ------------------
  |  Branch (461:9): [True: 0, False: 8.47k]
  ------------------
  462|      0|            if (groupDef->name != ssl_grp_kem_xyber768d00 && groupDef->name != ssl_grp_kem_mlkem768x25519) {
  ------------------
  |  Branch (462:17): [True: 0, False: 0]
  |  Branch (462:62): [True: 0, False: 0]
  ------------------
  463|      0|                PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  464|      0|                return SECFailure;
  465|      0|            }
  466|      0|            const sslNamedGroupDef *x25519 = ssl_LookupNamedGroup(ssl_grp_ec_curve25519);
  467|      0|            sslEphemeralKeyPair *x25519Pair = ssl_LookupEphemeralKeyPair(ss, x25519);
  468|      0|            if (x25519Pair) {
  ------------------
  |  Branch (468:17): [True: 0, False: 0]
  ------------------
  469|      0|                keyPair = ssl_CopyEphemeralKeyPair(x25519Pair);
  470|      0|            }
  471|      0|            if (!keyPair) {
  ------------------
  |  Branch (471:17): [True: 0, False: 0]
  ------------------
  472|      0|                rv = ssl_CreateECDHEphemeralKeyPair(ss, x25519, &keyPair);
  473|      0|                if (rv != SECSuccess) {
  ------------------
  |  Branch (473:21): [True: 0, False: 0]
  ------------------
  474|      0|                    return SECFailure;
  475|      0|                }
  476|      0|            }
  477|      0|            keyPair->group = groupDef;
  478|      0|            break;
  479|  7.58k|        case ssl_kea_ecdh:
  ------------------
  |  Branch (479:9): [True: 7.58k, False: 881]
  ------------------
  480|  7.58k|            if (groupDef->name == ssl_grp_ec_curve25519) {
  ------------------
  |  Branch (480:17): [True: 7.51k, False: 79]
  ------------------
  481|  7.51k|                sslEphemeralKeyPair *hybridPair = ssl_LookupEphemeralKeyPair(ss, ssl_LookupNamedGroup(ssl_grp_kem_mlkem768x25519));
  482|  7.51k|                if (!hybridPair) {
  ------------------
  |  Branch (482:21): [True: 7.51k, False: 0]
  ------------------
  483|  7.51k|                    hybridPair = ssl_LookupEphemeralKeyPair(ss, ssl_LookupNamedGroup(ssl_grp_kem_xyber768d00));
  484|  7.51k|                }
  485|  7.51k|                if (hybridPair) {
  ------------------
  |  Branch (485:21): [True: 0, False: 7.51k]
  ------------------
  486|       |                    // We could use ssl_CopyEphemeralKeyPair here, but we would need to free
  487|       |                    // the KEM components. We should pull this out into a utility function when
  488|       |                    // we refactor to support multiple hybrid mechanisms.
  489|      0|                    keyPair = PORT_ZNew(sslEphemeralKeyPair);
  ------------------
  |  |  148|      0|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  490|      0|                    if (!keyPair) {
  ------------------
  |  Branch (490:25): [True: 0, False: 0]
  ------------------
  491|      0|                        return SECFailure;
  492|      0|                    }
  493|      0|                    PR_INIT_CLIST(&keyPair->link);
  ------------------
  |  |  100|      0|    PR_BEGIN_MACRO     \
  |  |  ------------------
  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  101|      0|    (_l)->next = (_l); \
  |  |  102|      0|    (_l)->prev = (_l); \
  |  |  103|      0|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  494|      0|                    keyPair->group = groupDef;
  495|      0|                    keyPair->keys = ssl_GetKeyPairRef(hybridPair->keys);
  496|      0|                }
  497|  7.51k|            }
  498|  7.58k|            if (!keyPair) {
  ------------------
  |  Branch (498:17): [True: 7.58k, False: 0]
  ------------------
  499|  7.58k|                rv = ssl_CreateECDHEphemeralKeyPair(ss, groupDef, &keyPair);
  500|  7.58k|                if (rv != SECSuccess) {
  ------------------
  |  Branch (500:21): [True: 0, False: 7.58k]
  ------------------
  501|      0|                    return SECFailure;
  502|      0|                }
  503|  7.58k|            }
  504|  7.58k|            break;
  505|  7.58k|        case ssl_kea_dh:
  ------------------
  |  Branch (505:9): [True: 881, False: 7.58k]
  ------------------
  506|    881|            params = ssl_GetDHEParams(groupDef);
  507|    881|            PORT_Assert(params->name != ssl_grp_ffdhe_custom);
  ------------------
  |  |  120|    881|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    881|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 881, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  508|    881|            rv = ssl_CreateDHEKeyPair(groupDef, params, &keyPair);
  509|    881|            if (rv != SECSuccess) {
  ------------------
  |  Branch (509:17): [True: 0, False: 881]
  ------------------
  510|      0|                return SECFailure;
  511|      0|            }
  512|    881|            break;
  513|    881|        default:
  ------------------
  |  Branch (513:9): [True: 0, False: 8.47k]
  ------------------
  514|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  515|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  516|      0|            return SECFailure;
  517|  8.47k|    }
  518|       |
  519|       |    // If we're creating an ECDH + KEM hybrid share and we're the client, then
  520|       |    // we still need to generate the KEM key pair. Otherwise we're done.
  521|  8.47k|    if (groupDef->keaType == ssl_kea_ecdh_hybrid && !ss->sec.isServer) {
  ------------------
  |  Branch (521:9): [True: 0, False: 8.47k]
  |  Branch (521:53): [True: 0, False: 0]
  ------------------
  522|      0|        rv = tls13_CreateKEMKeyPair(ss, groupDef, &keyPair->kemKeys);
  523|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (523:13): [True: 0, False: 0]
  ------------------
  524|      0|            ssl_FreeEphemeralKeyPair(keyPair);
  525|      0|            return SECFailure;
  526|      0|        }
  527|      0|    }
  528|       |
  529|  8.47k|    *outKeyPair = keyPair;
  530|  8.47k|    return SECSuccess;
  531|  8.47k|}
tls13_AddKeyShare:
  535|  8.47k|{
  536|  8.47k|    sslEphemeralKeyPair *keyPair = NULL;
  537|  8.47k|    SECStatus rv;
  538|       |
  539|  8.47k|    rv = tls13_CreateKeyShare(ss, groupDef, &keyPair);
  540|  8.47k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (540:9): [True: 0, False: 8.47k]
  ------------------
  541|      0|        return SECFailure;
  542|      0|    }
  543|  8.47k|    PR_APPEND_LINK(&keyPair->link, &ss->ephemeralKeyPairs);
  ------------------
  |  |   57|  8.47k|#define PR_APPEND_LINK(_e,_l) PR_INSERT_BEFORE(_e,_l)
  |  |  ------------------
  |  |  |  |   25|  16.9k|    PR_BEGIN_MACRO       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  8.47k|#define PR_BEGIN_MACRO  do {
  |  |  |  |  ------------------
  |  |  |  |   26|  16.9k|    (_e)->next = (_l);   \
  |  |  |  |   27|  16.9k|    (_e)->prev = (_l)->prev; \
  |  |  |  |   28|  16.9k|    (_l)->prev->next = (_e); \
  |  |  |  |   29|  16.9k|    (_l)->prev = (_e);   \
  |  |  |  |   30|  16.9k|    PR_END_MACRO
  |  |  |  |  ------------------
  |  |  |  |  |  |  124|  8.47k|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  544|  8.47k|    return SECSuccess;
  545|  8.47k|}
tls13_SetupClientHello:
  568|  8.81k|{
  569|  8.81k|    unsigned int i;
  570|  8.81k|    SSL3Statistics *ssl3stats = SSL_GetStatistics();
  571|  8.81k|    NewSessionTicket *session_ticket = NULL;
  572|  8.81k|    sslSessionID *sid = ss->sec.ci.sid;
  573|  8.81k|    unsigned int numShares = 0;
  574|  8.81k|    SECStatus rv;
  575|       |
  576|  8.81k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  8.81k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.27k, False: 4.53k]
  |  |  |  |  |  Branch (208:7): [True: 4.53k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  577|  8.81k|    PORT_Assert(ss->opt.noLocks || ssl_HaveXmitBufLock(ss));
  ------------------
  |  |  120|  8.81k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 4.27k, False: 4.53k]
  |  |  |  |  |  Branch (208:7): [True: 4.53k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  578|       |
  579|  8.81k|    rv = tls13_ClientSetupEch(ss, chType);
  580|  8.81k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (580:9): [True: 0, False: 8.81k]
  ------------------
  581|      0|        return SECFailure;
  582|      0|    }
  583|       |
  584|       |    /* Everything below here is only run on the first CH. */
  585|  8.81k|    if (chType != client_hello_initial) {
  ------------------
  |  Branch (585:9): [True: 1.30k, False: 7.51k]
  ------------------
  586|  1.30k|        return SECSuccess;
  587|  1.30k|    }
  588|       |
  589|  7.51k|    rv = tls13_ClientGreaseSetup(ss);
  590|  7.51k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (590:9): [True: 0, False: 7.51k]
  ------------------
  591|      0|        return SECFailure;
  592|      0|    }
  593|       |
  594|       |    /* Select the first enabled group.
  595|       |     * TODO(ekr@rtfm.com): be smarter about offering the group
  596|       |     * that the other side negotiated if we are resuming. */
  597|  7.51k|    PORT_Assert(PR_CLIST_IS_EMPTY(&ss->ephemeralKeyPairs));
  ------------------
  |  |  120|  7.51k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  7.51k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 7.51k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  598|  7.51k|    for (i = 0; i < SSL_NAMED_GROUP_COUNT; ++i) {
  ------------------
  |  |  133|  7.51k|#define SSL_NAMED_GROUP_COUNT 33
  ------------------
  |  Branch (598:17): [True: 7.51k, False: 0]
  ------------------
  599|  7.51k|        if (!ss->namedGroupPreferences[i]) {
  ------------------
  |  Branch (599:13): [True: 0, False: 7.51k]
  ------------------
  600|      0|            continue;
  601|      0|        }
  602|  7.51k|        rv = tls13_AddKeyShare(ss, ss->namedGroupPreferences[i]);
  603|  7.51k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (603:13): [True: 0, False: 7.51k]
  ------------------
  604|      0|            return SECFailure;
  605|      0|        }
  606|  7.51k|        if (++numShares > ss->additionalShares) {
  ------------------
  |  Branch (606:13): [True: 7.51k, False: 0]
  ------------------
  607|  7.51k|            break;
  608|  7.51k|        }
  609|  7.51k|    }
  610|       |
  611|  7.51k|    if (PR_CLIST_IS_EMPTY(&ss->ephemeralKeyPairs)) {
  ------------------
  |  |   94|  7.51k|    ((_l)->next == (_l))
  |  |  ------------------
  |  |  |  Branch (94:5): [True: 0, False: 7.51k]
  |  |  ------------------
  ------------------
  612|      0|        PORT_SetError(SSL_ERROR_NO_CIPHERS_SUPPORTED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  613|      0|        return SECFailure;
  614|      0|    }
  615|       |
  616|       |    /* Try to do stateless resumption, if we can. */
  617|  7.51k|    if (sid->cached != never_cached &&
  ------------------
  |  Branch (617:9): [True: 0, False: 7.51k]
  ------------------
  618|  7.51k|        sid->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (618:9): [True: 0, False: 0]
  ------------------
  619|       |        /* The caller must be holding sid->u.ssl3.lock for reading. */
  620|      0|        session_ticket = &sid->u.ssl3.locked.sessionTicket;
  621|      0|        PORT_Assert(session_ticket && session_ticket->ticket.data);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  622|       |
  623|      0|        if (ssl_TicketTimeValid(ss, session_ticket)) {
  ------------------
  |  Branch (623:13): [True: 0, False: 0]
  ------------------
  624|      0|            ss->statelessResume = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  625|      0|        }
  626|       |
  627|      0|        if (ss->statelessResume) {
  ------------------
  |  Branch (627:13): [True: 0, False: 0]
  ------------------
  628|      0|            PORT_Assert(ss->sec.ci.sid);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  629|      0|            rv = tls13_RecoverWrappedSharedSecret(ss, ss->sec.ci.sid);
  630|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (630:17): [True: 0, False: 0]
  ------------------
  631|      0|                FATAL_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  632|      0|                SSL_AtomicIncrementLong(&ssl3stats->sch_sid_cache_not_ok);
  633|      0|                ssl_UncacheSessionID(ss);
  634|      0|                ssl_FreeSID(ss->sec.ci.sid);
  635|      0|                ss->sec.ci.sid = NULL;
  636|      0|                return SECFailure;
  637|      0|            }
  638|       |
  639|      0|            ss->ssl3.hs.cipher_suite = ss->sec.ci.sid->u.ssl3.cipherSuite;
  640|      0|            rv = ssl3_SetupCipherSuite(ss, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  641|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (641:17): [True: 0, False: 0]
  ------------------
  642|      0|                FATAL_ERROR(ss, PORT_GetError(), internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  643|      0|                return SECFailure;
  644|      0|            }
  645|      0|            PORT_Assert(!PR_CLIST_IS_EMPTY(&ss->ssl3.hs.psks));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  646|      0|        }
  647|      0|    }
  648|       |
  649|       |    /* Derive the binder keys if any PSKs. */
  650|  7.51k|    if (!PR_CLIST_IS_EMPTY(&ss->ssl3.hs.psks)) {
  ------------------
  |  |   94|  7.51k|    ((_l)->next == (_l))
  ------------------
  |  Branch (650:9): [True: 3.92k, False: 3.58k]
  ------------------
  651|       |        /* If an External PSK specified a suite, use that. */
  652|  3.92k|        sslPsk *psk = (sslPsk *)PR_LIST_HEAD(&ss->ssl3.hs.psks);
  ------------------
  |  |   65|  3.92k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
  653|  3.92k|        if (!ss->statelessResume &&
  ------------------
  |  Branch (653:13): [True: 3.92k, False: 0]
  ------------------
  654|  3.92k|            psk->type == ssl_psk_external &&
  ------------------
  |  Branch (654:13): [True: 3.92k, False: 0]
  ------------------
  655|  3.92k|            psk->zeroRttSuite != TLS_NULL_WITH_NULL_NULL) {
  ------------------
  |  |   76|  3.92k|#define TLS_NULL_WITH_NULL_NULL                 0x0000
  ------------------
  |  Branch (655:13): [True: 0, False: 3.92k]
  ------------------
  656|      0|            ss->ssl3.hs.cipher_suite = psk->zeroRttSuite;
  657|      0|        }
  658|       |
  659|  3.92k|        rv = tls13_ComputeEarlySecretsWithPsk(ss);
  660|  3.92k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (660:13): [True: 0, False: 3.92k]
  ------------------
  661|      0|            FATAL_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  662|      0|            return SECFailure;
  663|      0|        }
  664|  3.92k|    }
  665|       |
  666|  7.51k|    return SECSuccess;
  667|  7.51k|}
tls13_HandleKeyShare:
  850|    893|{
  851|    893|    PORTCheapArenaPool arena;
  852|    893|    SECKEYPublicKey *peerKey;
  853|    893|    CK_MECHANISM_TYPE mechanism;
  854|    893|    PK11SymKey *key;
  855|    893|    unsigned char *ec_data;
  856|    893|    SECStatus rv;
  857|    893|    int keySize = 0;
  858|       |
  859|    893|    PORT_InitCheapArena(&arena, DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|    893|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
  860|    893|    peerKey = PORT_ArenaZNew(&arena.arena, SECKEYPublicKey);
  ------------------
  |  |  155|    893|    (type *)PORT_ArenaZAlloc(poolp, sizeof(type))
  |  |  ------------------
  |  |  |  |   59|    893|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  |  |  ------------------
  ------------------
  861|    893|    if (peerKey == NULL) {
  ------------------
  |  Branch (861:9): [True: 0, False: 893]
  ------------------
  862|      0|        goto loser;
  863|      0|    }
  864|    893|    peerKey->arena = &arena.arena;
  865|    893|    peerKey->pkcs11Slot = NULL;
  866|    893|    peerKey->pkcs11ID = CK_INVALID_HANDLE;
  ------------------
  |  |   78|    893|#define CK_INVALID_HANDLE 0
  ------------------
  867|       |
  868|    893|    switch (entry->group->keaType) {
  869|      0|        case ssl_kea_ecdh_hybrid:
  ------------------
  |  Branch (869:9): [True: 0, False: 893]
  ------------------
  870|      0|            switch (entry->group->name) {
  871|      0|                case ssl_grp_kem_xyber768d00:
  ------------------
  |  Branch (871:17): [True: 0, False: 0]
  ------------------
  872|       |                    // x25519 share is at the beginning
  873|      0|                    ec_data = entry->key_exchange.len < X25519_PUBLIC_KEY_BYTES
  ------------------
  |  |    8|      0|#define X25519_PUBLIC_KEY_BYTES 32U
  ------------------
  |  Branch (873:31): [True: 0, False: 0]
  ------------------
  874|      0|                                  ? NULL
  875|      0|                                  : entry->key_exchange.data;
  876|      0|                    break;
  877|      0|                case ssl_grp_kem_mlkem768x25519:
  ------------------
  |  Branch (877:17): [True: 0, False: 0]
  ------------------
  878|       |                    // x25519 share is at the end
  879|      0|                    ec_data = entry->key_exchange.len < X25519_PUBLIC_KEY_BYTES
  ------------------
  |  |    8|      0|#define X25519_PUBLIC_KEY_BYTES 32U
  ------------------
  |  Branch (879:31): [True: 0, False: 0]
  ------------------
  880|      0|                                  ? NULL
  881|      0|                                  : entry->key_exchange.data + entry->key_exchange.len - X25519_PUBLIC_KEY_BYTES;
  ------------------
  |  |    8|      0|#define X25519_PUBLIC_KEY_BYTES 32U
  ------------------
  882|      0|                    break;
  883|      0|                default:
  ------------------
  |  Branch (883:17): [True: 0, False: 0]
  ------------------
  884|      0|                    ec_data = NULL;
  885|      0|                    break;
  886|      0|            }
  887|      0|            if (!ec_data) {
  ------------------
  |  Branch (887:17): [True: 0, False: 0]
  ------------------
  888|      0|                PORT_SetError(SSL_ERROR_RX_MALFORMED_HYBRID_KEY_SHARE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  889|      0|                goto loser;
  890|      0|            }
  891|      0|            rv = ssl_ImportECDHKeyShare(peerKey,
  892|      0|                                        ec_data,
  893|      0|                                        X25519_PUBLIC_KEY_BYTES,
  ------------------
  |  |    8|      0|#define X25519_PUBLIC_KEY_BYTES 32U
  ------------------
  894|      0|                                        ssl_LookupNamedGroup(ssl_grp_ec_curve25519));
  895|      0|            mechanism = CKM_ECDH1_DERIVE;
  ------------------
  |  | 1086|      0|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
  896|      0|            break;
  897|    182|        case ssl_kea_ecdh:
  ------------------
  |  Branch (897:9): [True: 182, False: 711]
  ------------------
  898|    182|            rv = ssl_ImportECDHKeyShare(peerKey,
  899|    182|                                        entry->key_exchange.data,
  900|    182|                                        entry->key_exchange.len,
  901|    182|                                        entry->group);
  902|    182|            mechanism = CKM_ECDH1_DERIVE;
  ------------------
  |  | 1086|    182|#define CKM_ECDH1_DERIVE 0x00001050UL
  ------------------
  903|    182|            break;
  904|    711|        case ssl_kea_dh:
  ------------------
  |  Branch (904:9): [True: 711, False: 182]
  ------------------
  905|    711|            rv = tls13_ImportDHEKeyShare(peerKey,
  906|    711|                                         entry->key_exchange.data,
  907|    711|                                         entry->key_exchange.len,
  908|    711|                                         keyPair->pubKey);
  909|    711|            mechanism = CKM_DH_PKCS_DERIVE;
  ------------------
  |  |  759|    711|#define CKM_DH_PKCS_DERIVE 0x00000021UL
  ------------------
  910|    711|            keySize = peerKey->u.dh.publicValue.len;
  911|    711|            break;
  912|      0|        default:
  ------------------
  |  Branch (912:9): [True: 0, False: 893]
  ------------------
  913|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  914|      0|            goto loser;
  915|    893|    }
  916|    893|    if (rv != SECSuccess) {
  ------------------
  |  Branch (916:9): [True: 9, False: 884]
  ------------------
  917|      9|        goto loser;
  918|      9|    }
  919|       |
  920|    884|    key = PK11_PubDeriveWithKDF(
  921|    884|        keyPair->privKey, peerKey, PR_FALSE, NULL, NULL, mechanism,
  ------------------
  |  |  438|    884|#define PR_FALSE 0
  ------------------
  922|    884|        CKM_HKDF_DERIVE, CKA_DERIVE, keySize, CKD_NULL, NULL, NULL);
  ------------------
  |  | 1296|    884|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
                      CKM_HKDF_DERIVE, CKA_DERIVE, keySize, CKD_NULL, NULL, NULL);
  ------------------
  |  |  555|    884|#define CKA_DERIVE 0x0000010CUL
  ------------------
                      CKM_HKDF_DERIVE, CKA_DERIVE, keySize, CKD_NULL, NULL, NULL);
  ------------------
  |  | 1702|    884|#define CKD_NULL 0x00000001UL
  ------------------
  923|    884|    if (!key) {
  ------------------
  |  Branch (923:9): [True: 38, False: 846]
  ------------------
  924|     38|        ssl_MapLowLevelError(SSL_ERROR_KEY_EXCHANGE_FAILURE);
  925|     38|        goto loser;
  926|     38|    }
  927|       |
  928|    846|    *out = key;
  929|    846|    PORT_DestroyCheapArena(&arena);
  930|    846|    return SECSuccess;
  931|       |
  932|     47|loser:
  933|     47|    PORT_DestroyCheapArena(&arena);
  934|     47|    return SECFailure;
  935|    884|}
SSLExp_SetCertificateCompressionAlgorithm:
 1107|  4.46k|{
 1108|  4.46k|    sslSocket *ss = ssl_FindSocket(fd);
 1109|  4.46k|    if (!ss) {
  ------------------
  |  Branch (1109:9): [True: 0, False: 4.46k]
  ------------------
 1110|      0|        return SECFailure; /* Code already set. */
 1111|      0|    }
 1112|       |
 1113|  4.46k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  4.46k|    {                                                 \
  |  | 1408|  4.46k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 4.46k, False: 0]
  |  |  ------------------
  |  | 1409|  4.46k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  4.46k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  4.46k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  4.46k|        }                                             \
  |  | 1412|  4.46k|    }
  ------------------
 1114|  4.46k|    if (ss->ssl3.supportedCertCompressionAlgorithmsCount == MAX_SUPPORTED_CERTIFICATE_COMPRESSION_ALGS) {
  ------------------
  |  |  252|  4.46k|#define MAX_SUPPORTED_CERTIFICATE_COMPRESSION_ALGS 32
  ------------------
  |  Branch (1114:9): [True: 0, False: 4.46k]
  ------------------
 1115|      0|        goto loser;
 1116|      0|    }
 1117|       |
 1118|       |    /* Reserved ID */
 1119|  4.46k|    if (alg.id == 0) {
  ------------------
  |  Branch (1119:9): [True: 0, False: 4.46k]
  ------------------
 1120|      0|        goto loser;
 1121|      0|    }
 1122|       |
 1123|  4.46k|    if (alg.encode == NULL && alg.decode == NULL) {
  ------------------
  |  Branch (1123:9): [True: 0, False: 4.46k]
  |  Branch (1123:31): [True: 0, False: 0]
  ------------------
 1124|      0|        goto loser;
 1125|      0|    }
 1126|       |
 1127|       |    /* Checking that we have not yet registed an algorithm with the same ID. */
 1128|  4.46k|    for (int i = 0; i < ss->ssl3.supportedCertCompressionAlgorithmsCount; i++) {
  ------------------
  |  Branch (1128:21): [True: 0, False: 4.46k]
  ------------------
 1129|      0|        if (ss->ssl3.supportedCertCompressionAlgorithms[i].id == alg.id) {
  ------------------
  |  Branch (1129:13): [True: 0, False: 0]
  ------------------
 1130|      0|            goto loser;
 1131|      0|        }
 1132|      0|    }
 1133|       |
 1134|  4.46k|    PORT_Memcpy(&ss->ssl3.supportedCertCompressionAlgorithms
  ------------------
  |  |  180|  4.46k|#define PORT_Memcpy memcpy
  ------------------
 1135|  4.46k|                     [ss->ssl3.supportedCertCompressionAlgorithmsCount],
 1136|  4.46k|                &alg, sizeof(alg));
 1137|  4.46k|    ss->ssl3.supportedCertCompressionAlgorithmsCount += 1;
 1138|  4.46k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  4.46k|    {                                                \
  |  | 1415|  4.46k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 4.46k, False: 0]
  |  |  ------------------
  |  | 1416|  4.46k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  4.46k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  4.46k|    }
  ------------------
 1139|  4.46k|    return SECSuccess;
 1140|       |
 1141|      0|loser:
 1142|      0|    PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 1143|      0|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|      0|    {                                                \
  |  | 1415|      0|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1416|      0|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|      0|    }
  ------------------
 1144|      0|    return SECFailure;
 1145|  4.46k|}
tls13_HandlePostHelloHandshakeMessage:
 1293|     39|{
 1294|     39|    if (ss->sec.isServer && ss->ssl3.hs.zeroRttIgnore != ssl_0rtt_ignore_none) {
  ------------------
  |  Branch (1294:9): [True: 0, False: 39]
  |  Branch (1294:29): [True: 0, False: 0]
  ------------------
 1295|      0|        SSL_TRC(3, ("%d: TLS13[%d]: successfully decrypted handshake after "
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 1296|      0|                    "failed 0-RTT",
 1297|      0|                    SSL_GETPID(), ss->fd));
 1298|      0|        ss->ssl3.hs.zeroRttIgnore = ssl_0rtt_ignore_none;
 1299|      0|    }
 1300|       |
 1301|       |    /* TODO(ekr@rtfm.com): Would it be better to check all the states here? */
 1302|     39|    switch (ss->ssl3.hs.msg_type) {
 1303|      3|        case ssl_hs_certificate:
  ------------------
  |  Branch (1303:9): [True: 3, False: 36]
  ------------------
 1304|      3|            return tls13_HandleCertificate(ss, b, length, PR_FALSE);
  ------------------
  |  |  438|      3|#define PR_FALSE 0
  ------------------
 1305|      5|        case ssl_hs_compressed_certificate:
  ------------------
  |  Branch (1305:9): [True: 5, False: 34]
  ------------------
 1306|      5|            return tls13_HandleCertificateDecode(ss, b, length);
 1307|      3|        case ssl_hs_certificate_request:
  ------------------
  |  Branch (1307:9): [True: 3, False: 36]
  ------------------
 1308|      3|            return tls13_HandleCertificateRequest(ss, b, length);
 1309|       |
 1310|      2|        case ssl_hs_certificate_verify:
  ------------------
  |  Branch (1310:9): [True: 2, False: 37]
  ------------------
 1311|      2|            return tls13_HandleCertificateVerify(ss, b, length);
 1312|       |
 1313|     14|        case ssl_hs_encrypted_extensions:
  ------------------
  |  Branch (1313:9): [True: 14, False: 25]
  ------------------
 1314|     14|            return tls13_HandleEncryptedExtensions(ss, b, length);
 1315|       |
 1316|      1|        case ssl_hs_new_session_ticket:
  ------------------
  |  Branch (1316:9): [True: 1, False: 38]
  ------------------
 1317|      1|            return tls13_HandleNewSessionTicket(ss, b, length);
 1318|       |
 1319|      2|        case ssl_hs_finished:
  ------------------
  |  Branch (1319:9): [True: 2, False: 37]
  ------------------
 1320|      2|            if (ss->sec.isServer) {
  ------------------
  |  Branch (1320:17): [True: 0, False: 2]
  ------------------
 1321|      0|                return tls13_ServerHandleFinished(ss, b, length);
 1322|      2|            } else {
 1323|      2|                return tls13_ClientHandleFinished(ss, b, length);
 1324|      2|            }
 1325|       |
 1326|      1|        case ssl_hs_end_of_early_data:
  ------------------
  |  Branch (1326:9): [True: 1, False: 38]
  ------------------
 1327|      1|            return tls13_HandleEndOfEarlyData(ss, b, length);
 1328|       |
 1329|      3|        case ssl_hs_key_update:
  ------------------
  |  Branch (1329:9): [True: 3, False: 36]
  ------------------
 1330|      3|            return tls13_HandleKeyUpdate(ss, b, length);
 1331|       |
 1332|      5|        default:
  ------------------
  |  Branch (1332:9): [True: 5, False: 34]
  ------------------
 1333|      5|            FATAL_ERROR(ss, SSL_ERROR_RX_UNKNOWN_HANDSHAKE, unexpected_message);
  ------------------
  |  |   22|      5|    do {                                     \
  |  |   23|      5|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      5|    do {                                                                           \
  |  |  |  |   15|      5|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      5|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      5|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      5|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      5|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      5|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      5|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      5|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      5|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1334|      5|            return SECFailure;
 1335|     39|    }
 1336|       |
 1337|      0|    PORT_Assert(0); /* Unreached */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1338|      0|    return SECFailure;
 1339|     39|}
tls13_HandleHelloRetryRequest:
 2984|    998|{
 2985|    998|    SECStatus rv;
 2986|       |
 2987|    998|    SSL_TRC(3, ("%d: TLS13[%d]: handle hello retry request",
  ------------------
  |  |   71|    998|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 998]
  |  |  ------------------
  |  |   72|    998|    ssl_Trace b
  ------------------
 2988|    998|                SSL_GETPID(), ss->fd));
 2989|       |
 2990|    998|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    998|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.50k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 495, False: 503]
  |  |  |  |  |  Branch (208:7): [True: 503, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2991|    998|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    998|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.50k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 495, False: 503]
  |  |  |  |  |  Branch (208:7): [True: 503, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2992|       |
 2993|    998|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|    998|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (2993:9): [True: 0, False: 998]
  ------------------
 2994|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_UNEXPECTED_HELLO_RETRY_REQUEST,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2995|      0|                    unexpected_message);
 2996|      0|        return SECFailure;
 2997|      0|    }
 2998|    998|    PORT_Assert(ss->ssl3.hs.ws == wait_server_hello);
  ------------------
  |  |  120|    998|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    998|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 998, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2999|       |
 3000|    998|    if (ss->ssl3.hs.zeroRttState == ssl_0rtt_sent) {
  ------------------
  |  Branch (3000:9): [True: 0, False: 998]
  ------------------
 3001|      0|        ss->ssl3.hs.zeroRttState = ssl_0rtt_ignored;
 3002|       |        /* Restore the null cipher spec for writing. */
 3003|      0|        ssl_GetSpecWriteLock(ss);
  ------------------
  |  | 1435|      0|    {                                            \
  |  | 1436|      0|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1437|      0|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|      0|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|      0|    }
  ------------------
 3004|      0|        ssl_CipherSpecRelease(ss->ssl3.cwSpec);
 3005|      0|        ss->ssl3.cwSpec = ssl_FindCipherSpecByEpoch(ss, ssl_secret_write,
 3006|      0|                                                    TrafficKeyClearText);
 3007|      0|        PORT_Assert(ss->ssl3.cwSpec);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3008|      0|        ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|      0|    {                                              \
  |  | 1441|      0|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1442|      0|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|      0|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|      0|    }
  ------------------
 3009|    998|    } else {
 3010|    998|        PORT_Assert(ss->ssl3.hs.zeroRttState == ssl_0rtt_none);
  ------------------
  |  |  120|    998|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    998|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 998, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3011|    998|    }
 3012|       |    /* Set the spec version, because we want to send CH now with 0303 */
 3013|    998|    tls13_SetSpecRecordVersion(ss, ss->ssl3.cwSpec);
 3014|       |
 3015|       |    /* Extensions must contain more than just supported_versions.  This will
 3016|       |     * ensure that a HelloRetryRequest isn't a no-op: we must have at least two
 3017|       |     * extensions, supported_versions plus one other.  That other must be one
 3018|       |     * that we understand and recognize as being valid for HelloRetryRequest,
 3019|       |     * and should alter our next Client Hello. */
 3020|    998|    unsigned int requiredExtensions = 1;
 3021|       |    /* The ECH HRR extension is a no-op from the client's perspective. */
 3022|    998|    if (ss->xtnData.ech) {
  ------------------
  |  Branch (3022:9): [True: 0, False: 998]
  ------------------
 3023|      0|        requiredExtensions++;
 3024|      0|    }
 3025|    998|    if (ssl_ListCount(&ss->ssl3.hs.remoteExtensions) <= requiredExtensions) {
  ------------------
  |  Branch (3025:9): [True: 1, False: 997]
  ------------------
 3026|      1|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_HELLO_RETRY_REQUEST,
  ------------------
  |  |   22|      1|    do {                                     \
  |  |   23|      1|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      1|    do {                                                                           \
  |  |  |  |   15|      1|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      1|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      1|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      1|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      1|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      1|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3027|      1|                    decode_error);
 3028|      1|        return SECFailure;
 3029|      1|    }
 3030|       |
 3031|    997|    rv = ssl3_HandleParsedExtensions(ss, ssl_hs_hello_retry_request);
 3032|    997|    ssl3_DestroyRemoteExtensions(&ss->ssl3.hs.remoteExtensions);
 3033|    997|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3033:9): [True: 25, False: 972]
  ------------------
 3034|     25|        return SECFailure; /* Error code set below */
 3035|     25|    }
 3036|    972|    rv = tls13_MaybeHandleEchSignal(ss, savedMsg, savedLength, PR_TRUE);
  ------------------
  |  |  437|    972|#define PR_TRUE 1
  ------------------
 3037|    972|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3037:9): [True: 0, False: 972]
  ------------------
 3038|      0|        return SECFailure;
 3039|      0|    }
 3040|    972|    ss->ssl3.hs.helloRetry = PR_TRUE;
  ------------------
  |  |  437|    972|#define PR_TRUE 1
  ------------------
 3041|    972|    rv = tls13_ReinjectHandshakeTranscript(ss);
 3042|    972|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3042:9): [True: 0, False: 972]
  ------------------
 3043|      0|        return rv;
 3044|      0|    }
 3045|       |
 3046|    972|    rv = ssl_HashHandshakeMessage(ss, ssl_hs_server_hello,
 3047|    972|                                  savedMsg, savedLength);
 3048|    972|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3048:9): [True: 0, False: 972]
  ------------------
 3049|      0|        return SECFailure;
 3050|      0|    }
 3051|       |
 3052|    972|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|    972|    {                                           \
  |  | 1467|    972|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 485, False: 487]
  |  |  ------------------
  |  | 1468|    972|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|    485|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|    972|    }
  ------------------
 3053|    972|    if (ss->opt.enableTls13CompatMode && !IS_DTLS(ss) &&
  ------------------
  |  |  892|  1.48k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (3053:9): [True: 513, False: 459]
  |  Branch (3053:42): [True: 0, False: 513]
  ------------------
 3054|    972|        ss->ssl3.hs.zeroRttState == ssl_0rtt_none) {
  ------------------
  |  Branch (3054:9): [True: 0, False: 0]
  ------------------
 3055|      0|        rv = ssl3_SendChangeCipherSpecsInt(ss);
 3056|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (3056:13): [True: 0, False: 0]
  ------------------
 3057|      0|            goto loser;
 3058|      0|        }
 3059|      0|    }
 3060|       |
 3061|    972|    rv = ssl3_SendClientHello(ss, client_hello_retry);
 3062|    972|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3062:9): [True: 0, False: 972]
  ------------------
 3063|      0|        goto loser;
 3064|      0|    }
 3065|       |
 3066|    972|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|    972|    {                                          \
  |  | 1472|    972|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 485, False: 487]
  |  |  ------------------
  |  | 1473|    972|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|    485|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|    972|    }
  ------------------
 3067|    972|    return SECSuccess;
 3068|       |
 3069|      0|loser:
 3070|      0|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|      0|    {                                          \
  |  | 1472|      0|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1473|      0|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|      0|    }
  ------------------
 3071|      0|    return SECFailure;
 3072|    972|}
tls13_HandleServerHelloPart2:
 3428|    922|{
 3429|    922|    SECStatus rv;
 3430|    922|    sslSessionID *sid = ss->sec.ci.sid;
 3431|    922|    SSL3Statistics *ssl3stats = SSL_GetStatistics();
 3432|       |
 3433|    922|    if (ssl3_ExtensionNegotiated(ss, ssl_tls13_pre_shared_key_xtn)) {
  ------------------
  |  Branch (3433:9): [True: 6, False: 916]
  ------------------
 3434|      6|        PORT_Assert(!PR_CLIST_IS_EMPTY(&ss->ssl3.hs.psks));
  ------------------
  |  |  120|      6|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      6|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3435|      6|        PORT_Assert(ss->xtnData.selectedPsk);
  ------------------
  |  |  120|      6|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      6|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3436|       |
 3437|      6|        if (ss->xtnData.selectedPsk->type != ssl_psk_resume) {
  ------------------
  |  Branch (3437:13): [True: 6, False: 0]
  ------------------
 3438|      6|            ss->statelessResume = PR_FALSE;
  ------------------
  |  |  438|      6|#define PR_FALSE 0
  ------------------
 3439|      6|        }
 3440|    916|    } else {
 3441|       |        /* We may have offered a PSK. If the server didn't negotiate
 3442|       |         * it, clear this state to re-extract the Early Secret. */
 3443|    916|        if (ss->ssl3.hs.currentSecret) {
  ------------------
  |  Branch (3443:13): [True: 509, False: 407]
  ------------------
 3444|       |            /* We might have dropped incompatible PSKs on HRR
 3445|       |             * (see RFC8466, Section 4.1.4). */
 3446|    509|            PORT_Assert(ss->ssl3.hs.helloRetry ||
  ------------------
  |  |  120|    509|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    603|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 415, False: 94]
  |  |  |  |  |  Branch (208:7): [True: 94, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3447|    509|                        ssl3_ExtensionAdvertised(ss, ssl_tls13_pre_shared_key_xtn));
 3448|    509|            PK11_FreeSymKey(ss->ssl3.hs.currentSecret);
 3449|    509|            ss->ssl3.hs.currentSecret = NULL;
 3450|    509|        }
 3451|    916|        ss->statelessResume = PR_FALSE;
  ------------------
  |  |  438|    916|#define PR_FALSE 0
  ------------------
 3452|    916|        ss->xtnData.selectedPsk = NULL;
 3453|    916|    }
 3454|       |
 3455|    922|    if (ss->statelessResume) {
  ------------------
  |  Branch (3455:9): [True: 0, False: 922]
  ------------------
 3456|      0|        PORT_Assert(sid->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3457|      0|        if (tls13_GetHash(ss) !=
  ------------------
  |  Branch (3457:13): [True: 0, False: 0]
  ------------------
 3458|      0|            tls13_GetHashForCipherSuite(sid->u.ssl3.cipherSuite)) {
 3459|      0|            FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_SERVER_HELLO,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3460|      0|                        illegal_parameter);
 3461|      0|            return SECFailure;
 3462|      0|        }
 3463|      0|    }
 3464|       |
 3465|       |    /* Now create a synthetic kea_def that we can tweak. */
 3466|    922|    ss->ssl3.hs.kea_def_mutable = *ss->ssl3.hs.kea_def;
 3467|    922|    ss->ssl3.hs.kea_def = &ss->ssl3.hs.kea_def_mutable;
 3468|       |
 3469|    922|    if (ss->xtnData.selectedPsk) {
  ------------------
  |  Branch (3469:9): [True: 6, False: 916]
  ------------------
 3470|      6|        ss->ssl3.hs.kea_def_mutable.authKeyType = ssl_auth_psk;
 3471|      6|        if (ss->statelessResume) {
  ------------------
  |  Branch (3471:13): [True: 0, False: 6]
  ------------------
 3472|      0|            tls13_RestoreCipherInfo(ss, sid);
 3473|      0|            if (sid->peerCert) {
  ------------------
  |  Branch (3473:17): [True: 0, False: 0]
  ------------------
 3474|      0|                ss->sec.peerCert = CERT_DupCertificate(sid->peerCert);
 3475|      0|            }
 3476|       |
 3477|      0|            SSL_AtomicIncrementLong(&ssl3stats->hsh_sid_cache_hits);
 3478|      0|            SSL_AtomicIncrementLong(&ssl3stats->hsh_sid_stateless_resumes);
 3479|      6|        } else {
 3480|      6|            ss->sec.authType = ssl_auth_psk;
 3481|      6|        }
 3482|    916|    } else {
 3483|    916|        if (ss->statelessResume &&
  ------------------
  |  Branch (3483:13): [True: 0, False: 916]
  ------------------
 3484|    916|            ssl3_ExtensionAdvertised(ss, ssl_tls13_pre_shared_key_xtn)) {
  ------------------
  |  Branch (3484:13): [True: 0, False: 0]
  ------------------
 3485|      0|            SSL_AtomicIncrementLong(&ssl3stats->hsh_sid_cache_misses);
 3486|      0|        }
 3487|    916|        if (sid->cached == in_client_cache) {
  ------------------
  |  Branch (3487:13): [True: 0, False: 916]
  ------------------
 3488|       |            /* If we tried to resume and failed, let's not try again. */
 3489|      0|            ssl_UncacheSessionID(ss);
 3490|      0|        }
 3491|    916|    }
 3492|       |
 3493|       |    /* Discard current SID and make a new one, though it may eventually
 3494|       |     * end up looking a lot like the old one.
 3495|       |     */
 3496|    922|    ssl_FreeSID(sid);
 3497|    922|    ss->sec.ci.sid = sid = ssl3_NewSessionID(ss, PR_FALSE);
  ------------------
  |  |  438|    922|#define PR_FALSE 0
  ------------------
 3498|    922|    if (sid == NULL) {
  ------------------
  |  Branch (3498:9): [True: 0, False: 922]
  ------------------
 3499|      0|        FATAL_ERROR(ss, PORT_GetError(), internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3500|      0|        return SECFailure;
 3501|      0|    }
 3502|    922|    if (ss->statelessResume) {
  ------------------
  |  Branch (3502:9): [True: 0, False: 922]
  ------------------
 3503|      0|        PORT_Assert(ss->sec.peerCert);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3504|      0|        sid->peerCert = CERT_DupCertificate(ss->sec.peerCert);
 3505|      0|    }
 3506|    922|    sid->version = ss->version;
 3507|       |
 3508|    922|    rv = tls13_HandleServerKeyShare(ss);
 3509|    922|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3509:9): [True: 76, False: 846]
  ------------------
 3510|     76|        return SECFailure;
 3511|     76|    }
 3512|       |
 3513|    846|    rv = tls13_ComputeHandshakeSecret(ss);
 3514|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3514:9): [True: 0, False: 846]
  ------------------
 3515|      0|        return SECFailure; /* error code is set. */
 3516|      0|    }
 3517|       |
 3518|    846|    rv = tls13_MaybeHandleEchSignal(ss, savedMsg, savedLength, PR_FALSE);
  ------------------
  |  |  438|    846|#define PR_FALSE 0
  ------------------
 3519|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3519:9): [True: 0, False: 846]
  ------------------
 3520|      0|        return SECFailure; /* error code is set. */
 3521|      0|    }
 3522|       |
 3523|    846|    rv = tls13_ComputeHandshakeSecrets(ss);
 3524|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3524:9): [True: 0, False: 846]
  ------------------
 3525|      0|        return SECFailure; /* error code is set. */
 3526|      0|    }
 3527|       |
 3528|    846|    if (ss->ssl3.hs.zeroRttState == ssl_0rtt_sent) {
  ------------------
  |  Branch (3528:9): [True: 0, False: 846]
  ------------------
 3529|       |        /* When we send 0-RTT, we saved the null spec in case we needed it to
 3530|       |         * send another ClientHello in response to a HelloRetryRequest.  Now
 3531|       |         * that we won't be receiving a HelloRetryRequest, release the spec. */
 3532|      0|        ssl_CipherSpecReleaseByEpoch(ss, ssl_secret_write, TrafficKeyClearText);
 3533|      0|    }
 3534|       |
 3535|    846|    rv = tls13_SetCipherSpec(ss, TrafficKeyHandshake,
 3536|    846|                             ssl_secret_read, PR_FALSE);
  ------------------
  |  |  438|    846|#define PR_FALSE 0
  ------------------
 3537|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3537:9): [True: 0, False: 846]
  ------------------
 3538|      0|        FATAL_ERROR(ss, SSL_ERROR_INIT_CIPHER_SUITE_FAILURE, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3539|      0|        return SECFailure;
 3540|      0|    }
 3541|    846|    TLS13_SET_HS_STATE(ss, wait_encrypted_extensions);
  ------------------
  |  |   37|    846|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
 3542|       |
 3543|    846|    return SECSuccess;
 3544|    846|}
tls13_DeriveSecret:
 4367|  7.31k|{
 4368|  7.31k|    SECStatus rv;
 4369|       |
 4370|  7.31k|    rv = tls13_HkdfExpandLabel(key, hash, hashes->u.raw, hashes->len,
 4371|  7.31k|                               label, labelLen, CKM_HKDF_DERIVE,
  ------------------
  |  | 1296|  7.31k|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
 4372|  7.31k|                               tls13_GetHashSizeForHash(hash),
 4373|  7.31k|                               ss->protocolVariant, dest);
 4374|  7.31k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4374:9): [True: 0, False: 7.31k]
  ------------------
 4375|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4376|      0|        return SECFailure;
 4377|      0|    }
 4378|  7.31k|    return SECSuccess;
 4379|  7.31k|}
tls13_DeriveSecretNullHash:
 4388|  5.62k|{
 4389|  5.62k|    SSL3Hashes hashes;
 4390|  5.62k|    SECStatus rv;
 4391|  5.62k|    PRUint8 buf[] = { 0 };
 4392|       |
 4393|  5.62k|    rv = tls13_ComputeHash(ss, &hashes, buf, 0, hash);
 4394|  5.62k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4394:9): [True: 0, False: 5.62k]
  ------------------
 4395|      0|        return SECFailure;
 4396|      0|    }
 4397|       |
 4398|  5.62k|    return tls13_DeriveSecret(ss, key, label, labelLen, &hashes, dest, hash);
 4399|  5.62k|}
tls13_SetSpecRecordVersion:
 4565|  2.89k|{
 4566|       |    /* Set the record version to pretend to be (D)TLS 1.2. */
 4567|  2.89k|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|  2.89k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 2.89k, False: 0]
  |  |  ------------------
  ------------------
 4568|  2.89k|        spec->recordVersion = SSL_LIBRARY_VERSION_DTLS_1_2_WIRE;
  ------------------
  |  |   33|  2.89k|#define SSL_LIBRARY_VERSION_DTLS_1_2_WIRE       ((~0x0102) & 0xffff)
  ------------------
 4569|  2.89k|    } else {
 4570|      0|        spec->recordVersion = SSL_LIBRARY_VERSION_TLS_1_2;
  ------------------
  |  |   20|      0|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
 4571|      0|    }
 4572|  2.89k|    SSL_TRC(10, ("%d: TLS13[%d]: set spec=%d record version to 0x%04x",
  ------------------
  |  |   71|  2.89k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 2.89k]
  |  |  ------------------
  |  |   72|  2.89k|    ssl_Trace b
  ------------------
 4573|  2.89k|                 SSL_GETPID(), ss->fd, spec, spec->recordVersion));
 4574|  2.89k|}
tls13_SetAlertCipherSpec:
 4662|  2.08k|{
 4663|  2.08k|    SECStatus rv;
 4664|       |
 4665|  2.08k|    if (ss->sec.isServer) {
  ------------------
  |  Branch (4665:9): [True: 0, False: 2.08k]
  ------------------
 4666|      0|        return SECSuccess;
 4667|      0|    }
 4668|  2.08k|    if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  2.08k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (4668:9): [True: 1.76k, False: 313]
  ------------------
 4669|  1.76k|        return SECSuccess;
 4670|  1.76k|    }
 4671|    313|    if (TLS13_IN_HS_STATE(ss, wait_server_hello)) {
  ------------------
  |  |   44|    313|    tls13_InHsState(ss, __VA_ARGS__, wait_invalid)
  |  |  ------------------
  |  |  |  Branch (44:5): [True: 262, False: 51]
  |  |  ------------------
  ------------------
 4672|    262|        return SECSuccess;
 4673|    262|    }
 4674|     51|    if ((ss->ssl3.cwSpec->epoch != TrafficKeyClearText) &&
  ------------------
  |  Branch (4674:9): [True: 0, False: 51]
  ------------------
 4675|     51|        (ss->ssl3.cwSpec->epoch != TrafficKeyEarlyApplicationData)) {
  ------------------
  |  Branch (4675:9): [True: 0, False: 0]
  ------------------
 4676|      0|        return SECSuccess;
 4677|      0|    }
 4678|       |
 4679|     51|    rv = tls13_SetCipherSpec(ss, TrafficKeyHandshake,
 4680|     51|                             ssl_secret_write, PR_FALSE);
  ------------------
  |  |  438|     51|#define PR_FALSE 0
  ------------------
 4681|     51|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4681:9): [True: 0, False: 51]
  ------------------
 4682|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4683|      0|        return SECFailure;
 4684|      0|    }
 4685|     51|    return SECSuccess;
 4686|     51|}
tls13_ComputeHandshakeHashes:
 4757|  1.69k|{
 4758|  1.69k|    SECStatus rv;
 4759|  1.69k|    PK11Context *ctx = NULL;
 4760|  1.69k|    PRBool useEchInner;
 4761|  1.69k|    sslBuffer *transcript;
 4762|       |
 4763|  1.69k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  1.69k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.52k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 856, False: 836]
  |  |  |  |  |  Branch (208:7): [True: 836, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4764|  1.69k|    if (ss->ssl3.hs.hashType == handshake_hash_unknown) {
  ------------------
  |  Branch (4764:9): [True: 0, False: 1.69k]
  ------------------
 4765|       |        /* Backup: if we haven't done any hashing, then hash now.
 4766|       |         * This happens when we are doing 0-RTT on the client. */
 4767|      0|        ctx = PK11_CreateDigestContext(ssl3_HashTypeToOID(tls13_GetHash(ss)));
 4768|      0|        if (!ctx) {
  ------------------
  |  Branch (4768:13): [True: 0, False: 0]
  ------------------
 4769|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 4770|      0|            return SECFailure;
 4771|      0|        }
 4772|       |
 4773|      0|        if (PK11_DigestBegin(ctx) != SECSuccess) {
  ------------------
  |  Branch (4773:13): [True: 0, False: 0]
  ------------------
 4774|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 4775|      0|            goto loser;
 4776|      0|        }
 4777|       |
 4778|       |        /* One might expect this to use ss->ssl3.hs.echAccepted,
 4779|       |         * but with 0-RTT we don't know that yet. */
 4780|      0|        useEchInner = ss->sec.isServer ? PR_FALSE : !!ss->ssl3.hs.echHpkeCtx;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (4780:23): [True: 0, False: 0]
  ------------------
 4781|      0|        transcript = useEchInner ? &ss->ssl3.hs.echInnerMessages : &ss->ssl3.hs.messages;
  ------------------
  |  Branch (4781:22): [True: 0, False: 0]
  ------------------
 4782|       |
 4783|      0|        PRINT_BUF(10, (ss, "Handshake hash computed over saved messages",
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4784|      0|                       transcript->buf,
 4785|      0|                       transcript->len));
 4786|       |
 4787|      0|        if (PK11_DigestOp(ctx,
  ------------------
  |  Branch (4787:13): [True: 0, False: 0]
  ------------------
 4788|      0|                          transcript->buf,
 4789|      0|                          transcript->len) != SECSuccess) {
 4790|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 4791|      0|            goto loser;
 4792|      0|        }
 4793|  1.69k|    } else {
 4794|  1.69k|        if (ss->firstHsDone) {
  ------------------
  |  Branch (4794:13): [True: 0, False: 1.69k]
  ------------------
 4795|      0|            ctx = PK11_CloneContext(ss->ssl3.hs.shaPostHandshake);
 4796|  1.69k|        } else {
 4797|  1.69k|            ctx = PK11_CloneContext(ss->ssl3.hs.sha);
 4798|  1.69k|        }
 4799|  1.69k|        if (!ctx) {
  ------------------
  |  Branch (4799:13): [True: 0, False: 1.69k]
  ------------------
 4800|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 4801|      0|            return SECFailure;
 4802|      0|        }
 4803|  1.69k|    }
 4804|       |
 4805|  1.69k|    rv = PK11_DigestFinal(ctx, hashes->u.raw,
 4806|  1.69k|                          &hashes->len,
 4807|  1.69k|                          sizeof(hashes->u.raw));
 4808|  1.69k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4808:9): [True: 0, False: 1.69k]
  ------------------
 4809|      0|        ssl_MapLowLevelError(SSL_ERROR_DIGEST_FAILURE);
 4810|      0|        goto loser;
 4811|      0|    }
 4812|       |
 4813|  1.69k|    PRINT_BUF(10, (ss, "Handshake hash", hashes->u.raw, hashes->len));
  ------------------
  |  |   74|  1.69k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 1.69k]
  |  |  ------------------
  |  |   75|  1.69k|    ssl_PrintBuf b
  ------------------
 4814|  1.69k|    PORT_Assert(hashes->len == tls13_GetHashSize(ss));
  ------------------
  |  |  120|  1.69k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.69k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.69k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4815|  1.69k|    PK11_DestroyContext(ctx, PR_TRUE);
  ------------------
  |  |  437|  1.69k|#define PR_TRUE 1
  ------------------
 4816|       |
 4817|  1.69k|    return SECSuccess;
 4818|       |
 4819|      0|loser:
 4820|      0|    PK11_DestroyContext(ctx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 4821|      0|    return SECFailure;
 4822|  1.69k|}
tls13_DestroyKeyShareEntry:
 4845|    946|{
 4846|    946|    if (!offer) {
  ------------------
  |  Branch (4846:9): [True: 29, False: 917]
  ------------------
 4847|     29|        return;
 4848|     29|    }
 4849|    917|    SECITEM_ZfreeItem(&offer->key_exchange, PR_FALSE);
  ------------------
  |  |  110|    917|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                  SECITEM_ZfreeItem(&offer->key_exchange, PR_FALSE);
  ------------------
  |  |  438|    917|#define PR_FALSE 0
  ------------------
 4850|    917|    PORT_ZFree(offer, sizeof(*offer));
  ------------------
  |  |   75|    917|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 4851|    917|}
tls13_DestroyKeyShares:
 4855|  36.7k|{
 4856|  36.7k|    PRCList *cur_p;
 4857|       |
 4858|       |    /* The list must be initialized. */
 4859|  36.7k|    PORT_Assert(PR_LIST_HEAD(list));
  ------------------
  |  |  120|  36.7k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  36.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 36.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4860|       |
 4861|  37.6k|    while (!PR_CLIST_IS_EMPTY(list)) {
  ------------------
  |  |   94|  37.6k|    ((_l)->next == (_l))
  ------------------
  |  Branch (4861:12): [True: 906, False: 36.7k]
  ------------------
 4862|    906|        cur_p = PR_LIST_TAIL(list);
  ------------------
  |  |   66|    906|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
 4863|    906|        PR_REMOVE_LINK(cur_p);
  ------------------
  |  |   72|    906|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|    906|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|    906|    (_e)->prev->next = (_e)->next; \
  |  |   74|    906|    (_e)->next->prev = (_e)->prev; \
  |  |   75|    906|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|    906|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4864|    906|        tls13_DestroyKeyShareEntry((TLS13KeyShareEntry *)cur_p);
 4865|    906|    }
 4866|  36.7k|}
tls13_DestroyEarlyData:
 4870|  8.85k|{
 4871|  8.85k|    PRCList *cur_p;
 4872|       |
 4873|  8.85k|    while (!PR_CLIST_IS_EMPTY(list)) {
  ------------------
  |  |   94|  8.85k|    ((_l)->next == (_l))
  ------------------
  |  Branch (4873:12): [True: 0, False: 8.85k]
  ------------------
 4874|      0|        TLS13EarlyData *msg;
 4875|       |
 4876|      0|        cur_p = PR_LIST_TAIL(list);
  ------------------
  |  |   66|      0|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
 4877|      0|        msg = (TLS13EarlyData *)cur_p;
 4878|       |
 4879|      0|        PR_REMOVE_LINK(cur_p);
  ------------------
  |  |   72|      0|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|      0|    (_e)->prev->next = (_e)->next; \
  |  |   74|      0|    (_e)->next->prev = (_e)->prev; \
  |  |   75|      0|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4880|      0|        SECITEM_ZfreeItem(&msg->data, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                      SECITEM_ZfreeItem(&msg->data, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4881|      0|        PORT_ZFree(msg, sizeof(*msg));
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
 4882|      0|    }
 4883|  8.85k|}
tls13_WriteExtensionsWithBinder:
 5471|  4.46k|{
 5472|  4.46k|    SSL3Hashes hashes;
 5473|  4.46k|    SECStatus rv;
 5474|       |
 5475|  4.46k|    PORT_Assert(!PR_CLIST_IS_EMPTY(&ss->ssl3.hs.psks));
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5476|  4.46k|    sslPsk *psk = (sslPsk *)PR_LIST_HEAD(&ss->ssl3.hs.psks);
  ------------------
  |  |   65|  4.46k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
 5477|  4.46k|    unsigned int size = tls13_GetHashSizeForHash(psk->hash);
 5478|  4.46k|    unsigned int prefixLen = extensions->len - size - 3;
 5479|  4.46k|    unsigned int finishedLen;
 5480|       |
 5481|  4.46k|    PORT_Assert(extensions->len >= size + 3);
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5482|       |
 5483|  4.46k|    rv = sslBuffer_AppendNumber(chBuf, extensions->len, 2);
 5484|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5484:9): [True: 0, False: 4.46k]
  ------------------
 5485|      0|        return SECFailure;
 5486|      0|    }
 5487|       |
 5488|       |    /* Only write the extension up to the point before the binders.  Assume that
 5489|       |     * the pre_shared_key extension is at the end of the buffer.  Don't write
 5490|       |     * the binder, or the lengths that precede it (a 2 octet length for the list
 5491|       |     * of all binders, plus a 1 octet length for the binder length). */
 5492|  4.46k|    rv = sslBuffer_Append(chBuf, extensions->buf, prefixLen);
 5493|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5493:9): [True: 0, False: 4.46k]
  ------------------
 5494|      0|        return SECFailure;
 5495|      0|    }
 5496|       |
 5497|       |    /* Calculate the binder based on what has been written out. */
 5498|  4.46k|    rv = tls13_ComputePskBinderHash(ss, chBuf->buf, chBuf->len, &hashes, psk->hash);
 5499|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5499:9): [True: 0, False: 4.46k]
  ------------------
 5500|      0|        return SECFailure;
 5501|      0|    }
 5502|       |
 5503|       |    /* Write the binder into the extensions buffer, over the zeros we reserved
 5504|       |     * previously. This avoids an allocation and means that we don't need a
 5505|       |     * separate write for the extra bits that precede the binder. */
 5506|  4.46k|    PORT_Assert(psk->binderKey);
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5507|  4.46k|    rv = tls13_ComputeFinished(ss, psk->binderKey,
 5508|  4.46k|                               psk->hash, &hashes, PR_TRUE,
  ------------------
  |  |  437|  4.46k|#define PR_TRUE 1
  ------------------
 5509|  4.46k|                               extensions->buf + extensions->len - size,
 5510|  4.46k|                               &finishedLen, size);
 5511|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5511:9): [True: 0, False: 4.46k]
  ------------------
 5512|      0|        return SECFailure;
 5513|      0|    }
 5514|  4.46k|    PORT_Assert(finishedLen == size);
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5515|       |
 5516|       |    /* Write out the remainder of the extension. */
 5517|  4.46k|    rv = sslBuffer_Append(chBuf, extensions->buf + prefixLen,
 5518|  4.46k|                          extensions->len - prefixLen);
 5519|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5519:9): [True: 0, False: 4.46k]
  ------------------
 5520|      0|        return SECFailure;
 5521|      0|    }
 5522|       |
 5523|  4.46k|    return SECSuccess;
 5524|  4.46k|}
tls13_ExtensionStatus:
 6432|  4.80k|{
 6433|  4.80k|    unsigned int i;
 6434|       |
 6435|  4.80k|    PORT_Assert((message == ssl_hs_client_hello) ||
  ------------------
  |  |  120|  4.80k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  36.5k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 4.80k]
  |  |  |  |  |  Branch (208:7): [True: 1.91k, False: 2.89k]
  |  |  |  |  |  Branch (208:7): [True: 2.89k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6436|  4.80k|                (message == ssl_hs_server_hello) ||
 6437|  4.80k|                (message == ssl_hs_hello_retry_request) ||
 6438|  4.80k|                (message == ssl_hs_encrypted_extensions) ||
 6439|  4.80k|                (message == ssl_hs_new_session_ticket) ||
 6440|  4.80k|                (message == ssl_hs_certificate) ||
 6441|  4.80k|                (message == ssl_hs_certificate_request));
 6442|       |
 6443|  62.3k|    for (i = 0; i < PR_ARRAY_SIZE(KnownExtensions); i++) {
  ------------------
  |  |  167|  62.3k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (6443:17): [True: 62.3k, False: 1]
  ------------------
 6444|       |        /* Hacky check for message numbers > 30. */
 6445|  62.3k|        PORT_Assert(!(KnownExtensions[i].messages & (1U << 31)));
  ------------------
  |  |  120|  62.3k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  62.3k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 62.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6446|  62.3k|        if (KnownExtensions[i].ex_value == extension) {
  ------------------
  |  Branch (6446:13): [True: 4.80k, False: 57.5k]
  ------------------
 6447|  4.80k|            break;
 6448|  4.80k|        }
 6449|  62.3k|    }
 6450|  4.80k|    if (i >= PR_ARRAY_SIZE(KnownExtensions)) {
  ------------------
  |  |  167|  4.80k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (6450:9): [True: 1, False: 4.80k]
  ------------------
 6451|      1|        return tls13_extension_unknown;
 6452|      1|    }
 6453|       |
 6454|       |    /* Return "disallowed" if the message mask bit isn't set. */
 6455|  4.80k|    if (!(_M(message) & KnownExtensions[i].messages)) {
  ------------------
  |  | 6391|  4.80k|#define _M(a) (1 << PR_MIN(a, 31))
  |  |  ------------------
  |  |  |  |  158|  4.80k|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (158:26): [True: 4.80k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6455:9): [True: 9, False: 4.79k]
  ------------------
 6456|      9|        return tls13_extension_disallowed;
 6457|      9|    }
 6458|       |
 6459|  4.79k|    return tls13_extension_allowed;
 6460|  4.80k|}
tls13_ClientAllow0Rtt:
 6826|  10.2k|{
 6827|       |    /* We checked that the cipher suite was still allowed back in
 6828|       |     * ssl3_SendClientHello. */
 6829|  10.2k|    if (sid->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (6829:9): [True: 1.40k, False: 8.81k]
  ------------------
 6830|  1.40k|        return PR_FALSE;
  ------------------
  |  |  438|  1.40k|#define PR_FALSE 0
  ------------------
 6831|  1.40k|    }
 6832|  8.81k|    if (ss->ssl3.hs.helloRetry) {
  ------------------
  |  Branch (6832:9): [True: 972, False: 7.84k]
  ------------------
 6833|    972|        return PR_FALSE;
  ------------------
  |  |  438|    972|#define PR_FALSE 0
  ------------------
 6834|    972|    }
 6835|  7.84k|    if (!ss->opt.enable0RttData) {
  ------------------
  |  Branch (6835:9): [True: 3.91k, False: 3.92k]
  ------------------
 6836|  3.91k|        return PR_FALSE;
  ------------------
  |  |  438|  3.91k|#define PR_FALSE 0
  ------------------
 6837|  3.91k|    }
 6838|  3.92k|    if (PR_CLIST_IS_EMPTY(&ss->ssl3.hs.psks)) {
  ------------------
  |  |   94|  3.92k|    ((_l)->next == (_l))
  |  |  ------------------
  |  |  |  Branch (94:5): [True: 1.77k, False: 2.15k]
  |  |  ------------------
  ------------------
 6839|  1.77k|        return PR_FALSE;
  ------------------
  |  |  438|  1.77k|#define PR_FALSE 0
  ------------------
 6840|  1.77k|    }
 6841|  2.15k|    sslPsk *psk = (sslPsk *)PR_LIST_HEAD(&ss->ssl3.hs.psks);
  ------------------
  |  |   65|  2.15k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
 6842|       |
 6843|  2.15k|    if (psk->zeroRttSuite == TLS_NULL_WITH_NULL_NULL) {
  ------------------
  |  |   76|  2.15k|#define TLS_NULL_WITH_NULL_NULL                 0x0000
  ------------------
  |  Branch (6843:9): [True: 2.15k, False: 0]
  ------------------
 6844|  2.15k|        return PR_FALSE;
  ------------------
  |  |  438|  2.15k|#define PR_FALSE 0
  ------------------
 6845|  2.15k|    }
 6846|      0|    if (!psk->maxEarlyData) {
  ------------------
  |  Branch (6846:9): [True: 0, False: 0]
  ------------------
 6847|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 6848|      0|    }
 6849|       |
 6850|      0|    if (psk->type == ssl_psk_external) {
  ------------------
  |  Branch (6850:9): [True: 0, False: 0]
  ------------------
 6851|      0|        return psk->hash == tls13_GetHashForCipherSuite(psk->zeroRttSuite);
 6852|      0|    }
 6853|      0|    if (psk->type == ssl_psk_resume) {
  ------------------
  |  Branch (6853:9): [True: 0, False: 0]
  ------------------
 6854|      0|        if (!ss->statelessResume)
  ------------------
  |  Branch (6854:13): [True: 0, False: 0]
  ------------------
 6855|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 6856|      0|        if ((sid->u.ssl3.locked.sessionTicket.flags & ticket_allow_early_data) == 0)
  ------------------
  |  Branch (6856:13): [True: 0, False: 0]
  ------------------
 6857|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 6858|      0|        return ssl_AlpnTagAllowed(ss, &sid->u.ssl3.alpnSelection);
 6859|      0|    }
 6860|      0|    PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6861|      0|    return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 6862|      0|}
tls13_MaybeDo0RTTHandshake:
 6866|  8.81k|{
 6867|  8.81k|    SECStatus rv;
 6868|       |
 6869|       |    /* Don't do anything if there is no early_data xtn, which means we're
 6870|       |     * not doing early data. */
 6871|  8.81k|    if (!ssl3_ExtensionAdvertised(ss, ssl_tls13_early_data_xtn)) {
  ------------------
  |  Branch (6871:9): [True: 8.81k, False: 0]
  ------------------
 6872|  8.81k|        return SECSuccess;
 6873|  8.81k|    }
 6874|       |
 6875|      0|    ss->ssl3.hs.zeroRttState = ssl_0rtt_sent;
 6876|      0|    ss->ssl3.hs.zeroRttSuite = ss->ssl3.hs.cipher_suite;
 6877|       |    /* Note: Reset the preliminary info here rather than just add 0-RTT.  We are
 6878|       |     * only guessing what might happen at this point.*/
 6879|      0|    ss->ssl3.hs.preliminaryInfo = ssl_preinfo_0rtt_cipher_suite;
  ------------------
  |  |  394|      0|#define ssl_preinfo_0rtt_cipher_suite (1U << 2)
  ------------------
 6880|       |
 6881|      0|    SSL_TRC(3, ("%d: TLS13[%d]: in 0-RTT mode", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 6882|       |
 6883|       |    /* Set the ALPN data as if it was negotiated. We check in the ServerHello
 6884|       |     * handler that the server negotiates the same value. */
 6885|      0|    if (ss->sec.ci.sid->u.ssl3.alpnSelection.len) {
  ------------------
  |  Branch (6885:9): [True: 0, False: 0]
  ------------------
 6886|      0|        ss->xtnData.nextProtoState = SSL_NEXT_PROTO_EARLY_VALUE;
 6887|      0|        rv = SECITEM_CopyItem(NULL, &ss->xtnData.nextProto,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 6888|      0|                              &ss->sec.ci.sid->u.ssl3.alpnSelection);
 6889|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (6889:13): [True: 0, False: 0]
  ------------------
 6890|      0|            return SECFailure;
 6891|      0|        }
 6892|      0|    }
 6893|       |
 6894|      0|    if (ss->opt.enableTls13CompatMode && !IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (6894:9): [True: 0, False: 0]
  |  Branch (6894:42): [True: 0, False: 0]
  ------------------
 6895|       |        /* Pretend that this is a proper ChangeCipherSpec even though it is sent
 6896|       |         * before receiving the ServerHello. */
 6897|      0|        ssl_GetSpecWriteLock(ss);
  ------------------
  |  | 1435|      0|    {                                            \
  |  | 1436|      0|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1437|      0|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|      0|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|      0|    }
  ------------------
 6898|      0|        tls13_SetSpecRecordVersion(ss, ss->ssl3.cwSpec);
 6899|      0|        ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|      0|    {                                              \
  |  | 1441|      0|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1442|      0|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|      0|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|      0|    }
  ------------------
 6900|      0|        ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|      0|    {                                           \
  |  | 1467|      0|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1468|      0|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|      0|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|      0|    }
  ------------------
 6901|      0|        rv = ssl3_SendChangeCipherSpecsInt(ss);
 6902|      0|        ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|      0|    {                                          \
  |  | 1472|      0|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1473|      0|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|      0|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|      0|    }
  ------------------
 6903|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (6903:13): [True: 0, False: 0]
  ------------------
 6904|      0|            return SECFailure;
 6905|      0|        }
 6906|      0|    }
 6907|       |
 6908|       |    /* If we have any message that was saved for later hashing.
 6909|       |     * The updated hash is then used in tls13_DeriveEarlySecrets. */
 6910|      0|    rv = ssl3_MaybeUpdateHashWithSavedRecord(ss);
 6911|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6911:9): [True: 0, False: 0]
  ------------------
 6912|      0|        return SECFailure;
 6913|      0|    }
 6914|       |
 6915|       |    /* If we're trying 0-RTT, derive from the first PSK */
 6916|      0|    PORT_Assert(!PR_CLIST_IS_EMPTY(&ss->ssl3.hs.psks) && !ss->xtnData.selectedPsk);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6917|      0|    ss->xtnData.selectedPsk = (sslPsk *)PR_LIST_HEAD(&ss->ssl3.hs.psks);
  ------------------
  |  |   65|      0|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
 6918|      0|    rv = tls13_DeriveEarlySecrets(ss);
 6919|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6919:9): [True: 0, False: 0]
  ------------------
 6920|      0|        return SECFailure;
 6921|      0|    }
 6922|       |
 6923|       |    /* Save cwSpec in case we get a HelloRetryRequest and have to send another
 6924|       |     * ClientHello. */
 6925|      0|    ssl_CipherSpecAddRef(ss->ssl3.cwSpec);
 6926|       |
 6927|      0|    rv = tls13_SetCipherSpec(ss, TrafficKeyEarlyApplicationData,
 6928|      0|                             ssl_secret_write, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 6929|      0|    ss->xtnData.selectedPsk = NULL;
 6930|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6930:9): [True: 0, False: 0]
  ------------------
 6931|      0|        return SECFailure;
 6932|      0|    }
 6933|       |
 6934|      0|    return SECSuccess;
 6935|      0|}
tls13_EncodeVersion:
 7090|  25.6k|{
 7091|  25.6k|    if (variant == ssl_variant_datagram) {
  ------------------
  |  Branch (7091:9): [True: 25.6k, False: 0]
  ------------------
 7092|  25.6k|        return dtls_TLSVersionToDTLSVersion(version);
 7093|  25.6k|    }
 7094|       |    /* Stream-variant encodings do not change. */
 7095|      0|    return (PRUint16)version;
 7096|  25.6k|}
tls13_ClientReadSupportedVersion:
 7100|  7.70k|{
 7101|  7.70k|    PRUint32 temp;
 7102|  7.70k|    TLSExtension *versionExtension;
 7103|  7.70k|    SECItem it;
 7104|  7.70k|    SECStatus rv;
 7105|       |
 7106|       |    /* Update the version based on the extension, as necessary. */
 7107|  7.70k|    versionExtension = ssl3_FindExtension(ss, ssl_tls13_supported_versions_xtn);
 7108|  7.70k|    if (!versionExtension) {
  ------------------
  |  Branch (7108:9): [True: 5.69k, False: 2.01k]
  ------------------
 7109|  5.69k|        return SECSuccess;
 7110|  5.69k|    }
 7111|       |
 7112|       |    /* Struct copy so we don't damage the extension. */
 7113|  2.01k|    it = versionExtension->data;
 7114|       |
 7115|  2.01k|    rv = ssl3_ConsumeHandshakeNumber(ss, &temp, 2, &it.data, &it.len);
 7116|  2.01k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7116:9): [True: 1, False: 2.00k]
  ------------------
 7117|      1|        return SECFailure;
 7118|      1|    }
 7119|  2.00k|    if (it.len) {
  ------------------
  |  Branch (7119:9): [True: 1, False: 2.00k]
  ------------------
 7120|      1|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_SERVER_HELLO, illegal_parameter);
  ------------------
  |  |   22|      1|    do {                                     \
  |  |   23|      1|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      1|    do {                                                                           \
  |  |  |  |   15|      1|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      1|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      1|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      1|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      1|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      1|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      1|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 7121|      1|        return SECFailure;
 7122|      1|    }
 7123|       |
 7124|  2.00k|    if (temp != tls13_EncodeVersion(SSL_LIBRARY_VERSION_TLS_1_3,
  ------------------
  |  |   21|  2.00k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (7124:9): [True: 13, False: 1.99k]
  ------------------
 7125|  2.00k|                                    ss->protocolVariant)) {
 7126|       |        /* You cannot negotiate < TLS 1.3 with supported_versions. */
 7127|     13|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_SERVER_HELLO, illegal_parameter);
  ------------------
  |  |   22|     13|    do {                                     \
  |  |   23|     13|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|     13|    do {                                                                           \
  |  |  |  |   15|     13|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|     13|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|     13|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|     13|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|     13|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|     13|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|     13|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|     13|        tls13_FatalError(ss, prError, desc); \
  |  |   25|     13|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 7128|     13|        return SECFailure;
 7129|     13|    }
 7130|       |
 7131|       |    /* Any endpoint receiving a Hello message with...ServerHello.legacy_version
 7132|       |     * set to 0x0300 (SSL3) MUST abort the handshake with a "protocol_version"
 7133|       |     * alert. [RFC8446, Section D.5]
 7134|       |     *
 7135|       |     * The ServerHello.legacy_version is read into the ss->version field by
 7136|       |     * ssl_ClientReadVersion(). */
 7137|  1.99k|    if (ss->version == SSL_LIBRARY_VERSION_3_0) {
  ------------------
  |  |   17|  1.99k|#define SSL_LIBRARY_VERSION_3_0                 0x0300
  ------------------
  |  Branch (7137:9): [True: 0, False: 1.99k]
  ------------------
 7138|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_SERVER_HELLO, protocol_version);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 7139|      0|        return SECFailure;
 7140|      0|    }
 7141|       |
 7142|  1.99k|    ss->version = SSL_LIBRARY_VERSION_TLS_1_3;
  ------------------
  |  |   21|  1.99k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
 7143|  1.99k|    return SECSuccess;
 7144|  1.99k|}
tls13_MaybeTls13:
 7197|  61.3k|{
 7198|  61.3k|    if (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  61.3k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (7198:9): [True: 7.59k, False: 53.7k]
  ------------------
 7199|  7.59k|        return PR_TRUE;
  ------------------
  |  |  437|  7.59k|#define PR_TRUE 1
  ------------------
 7200|  7.59k|    }
 7201|       |
 7202|  53.7k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  53.7k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (7202:9): [True: 7.70k, False: 46.0k]
  ------------------
 7203|  7.70k|        return PR_FALSE;
  ------------------
  |  |  438|  7.70k|#define PR_FALSE 0
  ------------------
 7204|  7.70k|    }
 7205|       |
 7206|  46.0k|    if (!(ss->ssl3.hs.preliminaryInfo & ssl_preinfo_version)) {
  ------------------
  |  |  392|  46.0k|#define ssl_preinfo_version (1U << 0)
  ------------------
  |  Branch (7206:9): [True: 25.6k, False: 20.3k]
  ------------------
 7207|  25.6k|        return PR_TRUE;
  ------------------
  |  |  437|  25.6k|#define PR_TRUE 1
  ------------------
 7208|  25.6k|    }
 7209|       |
 7210|  20.3k|    return PR_FALSE;
  ------------------
  |  |  438|  20.3k|#define PR_FALSE 0
  ------------------
 7211|  46.0k|}
tls13_ClientGreaseSetup:
 7217|  7.51k|{
 7218|  7.51k|    if (!ss->opt.enableGrease) {
  ------------------
  |  Branch (7218:9): [True: 3.80k, False: 3.70k]
  ------------------
 7219|  3.80k|        return SECSuccess;
 7220|  3.80k|    }
 7221|       |
 7222|  3.70k|    PORT_Assert(ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|  3.70k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.70k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.70k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7223|       |
 7224|  3.70k|    if (ss->ssl3.hs.grease) {
  ------------------
  |  Branch (7224:9): [True: 0, False: 3.70k]
  ------------------
 7225|      0|        return SECFailure;
 7226|      0|    }
 7227|  3.70k|    ss->ssl3.hs.grease = PORT_Alloc(sizeof(tls13ClientGrease));
  ------------------
  |  |   52|  3.70k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 7228|  3.70k|    if (!ss->ssl3.hs.grease) {
  ------------------
  |  Branch (7228:9): [True: 0, False: 3.70k]
  ------------------
 7229|      0|        return SECFailure;
 7230|      0|    }
 7231|       |
 7232|  3.70k|    tls13ClientGrease *grease = ss->ssl3.hs.grease;
 7233|       |    /* We require eight GREASE values and randoms. */
 7234|  3.70k|    PRUint8 random[8];
 7235|       |
 7236|       |    /* Generate random GREASE values. */
 7237|  3.70k|    if (PK11_GenerateRandom(random, sizeof(random)) != SECSuccess) {
  ------------------
  |  Branch (7237:9): [True: 0, False: 3.70k]
  ------------------
 7238|      0|        return SECFailure;
 7239|      0|    }
 7240|  29.6k|    for (size_t i = 0; i < PR_ARRAY_SIZE(grease->idx); i++) {
  ------------------
  |  |  167|  29.6k|#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
  ------------------
  |  Branch (7240:24): [True: 25.9k, False: 3.70k]
  ------------------
 7241|  25.9k|        random[i] = ((random[i] & 0xf0) | 0x0a);
 7242|  25.9k|        grease->idx[i] = ((random[i] << 8) | random[i]);
 7243|  25.9k|    }
 7244|       |    /* Specific PskKeyExchangeMode GREASE value. */
 7245|  3.70k|    grease->pskKem = 0x0b + ((random[8 - 1] >> 5) * 0x1f);
 7246|       |
 7247|       |    /* Duplicate extensions are not allowed. */
 7248|  3.70k|    if (grease->idx[grease_extension1] == grease->idx[grease_extension2]) {
  ------------------
  |  Branch (7248:9): [True: 0, False: 3.70k]
  ------------------
 7249|      0|        grease->idx[grease_extension2] ^= 0x1010;
 7250|      0|    }
 7251|       |
 7252|  3.70k|    return SECSuccess;
 7253|  3.70k|}
tls13_ClientGreaseDestroy:
 7258|  17.7k|{
 7259|  17.7k|    if (ss->ssl3.hs.grease) {
  ------------------
  |  Branch (7259:9): [True: 3.70k, False: 13.9k]
  ------------------
 7260|  3.70k|        PORT_Free(ss->ssl3.hs.grease);
  ------------------
  |  |   60|  3.70k|#define PORT_Free PORT_Free_Util
  ------------------
 7261|  3.70k|        ss->ssl3.hs.grease = NULL;
 7262|  3.70k|    }
 7263|  17.7k|}
tls13_MaybeGreaseExtensionType:
 7287|   120k|{
 7288|   120k|    if (*exType != ssl_tls13_grease_xtn) {
  ------------------
  |  Branch (7288:9): [True: 111k, False: 8.70k]
  ------------------
 7289|   111k|        return SECSuccess;
 7290|   111k|    }
 7291|       |
 7292|  8.70k|    PR_ASSERT(ss->opt.enableGrease);
  ------------------
  |  |  208|  8.70k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.70k, False: 0]
  |  |  ------------------
  ------------------
 7293|  8.70k|    PR_ASSERT(message == ssl_hs_client_hello ||
  ------------------
  |  |  208|  8.70k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:7): [True: 8.70k, False: 0]
  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 7294|  8.70k|              message == ssl_hs_certificate_request);
 7295|       |
 7296|       |    /* GREASE ClientHello:
 7297|       |     * A client MAY select one or more GREASE extension values and
 7298|       |     * advertise them as extensions with varying length and contents
 7299|       |     * [RFC8701, Section 3.1]. */
 7300|  8.70k|    if (message == ssl_hs_client_hello) {
  ------------------
  |  Branch (7300:9): [True: 8.70k, False: 0]
  ------------------
 7301|  8.70k|        PR_ASSERT(ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  208|  8.70k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.70k, False: 0]
  |  |  ------------------
  ------------------
 7302|       |        /* Check if the first GREASE extension was already added. */
 7303|  8.70k|        if (!ssl3_ExtensionAdvertised(ss, ss->ssl3.hs.grease->idx[grease_extension1])) {
  ------------------
  |  Branch (7303:13): [True: 4.35k, False: 4.35k]
  ------------------
 7304|  4.35k|            *exType = ss->ssl3.hs.grease->idx[grease_extension1];
 7305|  4.35k|        } else {
 7306|  4.35k|            *exType = ss->ssl3.hs.grease->idx[grease_extension2];
 7307|  4.35k|        }
 7308|  8.70k|    }
 7309|       |    /* GREASE CertificateRequest:
 7310|       |     * When sending a CertificateRequest in TLS 1.3, a server MAY behave as
 7311|       |     * follows: A server MAY select one or more GREASE extension values and
 7312|       |     * advertise them as extensions with varying length and contents
 7313|       |     * [RFC8701, Section 4.1]. */
 7314|      0|    else if (message == ssl_hs_certificate_request) {
  ------------------
  |  Branch (7314:14): [True: 0, False: 0]
  ------------------
 7315|      0|        PR_ASSERT(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 7316|       |        /* Get random grease extension type. */
 7317|      0|        SECStatus rv = tls13_RandomGreaseValue(exType);
 7318|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (7318:13): [True: 0, False: 0]
  ------------------
 7319|      0|            return SECFailure;
 7320|      0|        }
 7321|      0|    }
 7322|       |
 7323|  8.70k|    return SECSuccess;
 7324|  8.70k|}
tls13con.c:tls13_HandshakeState:
  150|    846|{
  151|    846|    switch (st) {
  152|      0|        STATE_CASE(idle_handshake);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  153|      0|        STATE_CASE(wait_client_hello);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  154|      0|        STATE_CASE(wait_end_of_early_data);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  155|      0|        STATE_CASE(wait_client_cert);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  156|      0|        STATE_CASE(wait_client_key);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  157|      0|        STATE_CASE(wait_cert_verify);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  158|      0|        STATE_CASE(wait_change_cipher);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  159|      0|        STATE_CASE(wait_finished);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  160|      0|        STATE_CASE(wait_server_hello);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  161|      0|        STATE_CASE(wait_certificate_status);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  162|      0|        STATE_CASE(wait_server_cert);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  163|      0|        STATE_CASE(wait_server_key);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  164|      0|        STATE_CASE(wait_cert_request);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  165|      0|        STATE_CASE(wait_hello_done);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  166|      0|        STATE_CASE(wait_new_session_ticket);
  ------------------
  |  |  146|      0|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 0, False: 846]
  |  |  ------------------
  |  |  147|      0|        return #a
  ------------------
  167|    846|        STATE_CASE(wait_encrypted_extensions);
  ------------------
  |  |  146|    846|    case a:           \
  |  |  ------------------
  |  |  |  Branch (146:5): [True: 846, False: 0]
  |  |  ------------------
  |  |  147|    846|        return #a
  ------------------
  168|      0|        default:
  ------------------
  |  Branch (168:9): [True: 0, False: 846]
  ------------------
  169|      0|            break;
  170|    846|    }
  171|      0|    PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  172|      0|    return "unknown";
  173|    846|}
tls13con.c:tls13_InHsStateV:
  205|    341|{
  206|    341|    SSL3WaitState ws;
  207|       |
  208|    413|    while ((ws = va_arg(ap, SSL3WaitState)) != wait_invalid) {
  ------------------
  |  Branch (208:12): [True: 347, False: 66]
  ------------------
  209|    347|        if (TLS13_WAIT_STATE(ws) == ss->ssl3.hs.ws) {
  ------------------
  |  |  180|    347|#define TLS13_WAIT_STATE(ws) (((ws == idle_handshake) || (ws == wait_server_hello)) ? ws : ws | TLS13_WAIT_STATE_MASK)
  |  |  ------------------
  |  |  |  |  176|    379|#define TLS13_WAIT_STATE_MASK 0x80
  |  |  ------------------
  |  |  |  Branch (180:32): [True: 2, False: 345]
  |  |  |  Branch (180:58): [True: 313, False: 32]
  |  |  ------------------
  ------------------
  |  Branch (209:13): [True: 275, False: 72]
  ------------------
  210|    275|            return PR_TRUE;
  ------------------
  |  |  437|    275|#define PR_TRUE 1
  ------------------
  211|    275|        }
  212|    347|    }
  213|     66|    return PR_FALSE;
  ------------------
  |  |  438|     66|#define PR_FALSE 0
  ------------------
  214|    341|}
tls13con.c:tls13_ImportDHEKeyShare:
  673|    711|{
  674|    711|    SECStatus rv;
  675|    711|    SECItem publicValue = { siBuffer, NULL, 0 };
  676|       |
  677|    711|    publicValue.data = b;
  678|    711|    publicValue.len = length;
  679|    711|    if (!ssl_IsValidDHEShare(&pubKey->u.dh.prime, &publicValue)) {
  ------------------
  |  Branch (679:9): [True: 8, False: 703]
  ------------------
  680|      8|        PORT_SetError(SSL_ERROR_RX_MALFORMED_DHE_KEY_SHARE);
  ------------------
  |  |   65|      8|#define PORT_SetError PORT_SetError_Util
  ------------------
  681|      8|        return SECFailure;
  682|      8|    }
  683|       |
  684|    703|    peerKey->keyType = dhKey;
  685|    703|    rv = SECITEM_CopyItem(peerKey->arena, &peerKey->u.dh.prime,
  ------------------
  |  |  106|    703|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  686|    703|                          &pubKey->u.dh.prime);
  687|    703|    if (rv != SECSuccess)
  ------------------
  |  Branch (687:9): [True: 0, False: 703]
  ------------------
  688|      0|        return SECFailure;
  689|    703|    rv = SECITEM_CopyItem(peerKey->arena, &peerKey->u.dh.base,
  ------------------
  |  |  106|    703|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  690|    703|                          &pubKey->u.dh.base);
  691|    703|    if (rv != SECSuccess)
  ------------------
  |  Branch (691:9): [True: 0, False: 703]
  ------------------
  692|      0|        return SECFailure;
  693|    703|    rv = SECITEM_CopyItem(peerKey->arena, &peerKey->u.dh.publicValue,
  ------------------
  |  |  106|    703|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  694|    703|                          &publicValue);
  695|    703|    if (rv != SECSuccess)
  ------------------
  |  Branch (695:9): [True: 0, False: 703]
  ------------------
  696|      0|        return SECFailure;
  697|       |
  698|    703|    return SECSuccess;
  699|    703|}
tls13con.c:tls13_UseServerSecret:
  939|    897|{
  940|    897|    return ss->sec.isServer == (direction == ssl_secret_write);
  941|    897|}
tls13con.c:tls13_GetHmacMechanismFromHash:
  337|  8.93k|{
  338|  8.93k|    switch (hashType) {
  339|  2.77k|        case ssl_hash_sha256:
  ------------------
  |  Branch (339:9): [True: 2.77k, False: 6.15k]
  ------------------
  340|  2.77k|            return CKM_SHA256_HMAC;
  ------------------
  |  |  877|  2.77k|#define CKM_SHA256_HMAC 0x00000251UL
  ------------------
  341|  6.15k|        case ssl_hash_sha384:
  ------------------
  |  Branch (341:9): [True: 6.15k, False: 2.77k]
  ------------------
  342|  6.15k|            return CKM_SHA384_HMAC;
  ------------------
  |  |  880|  6.15k|#define CKM_SHA384_HMAC 0x00000261UL
  ------------------
  343|      0|        default:
  ------------------
  |  Branch (343:9): [True: 0, False: 8.93k]
  ------------------
  344|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  345|  8.93k|    }
  346|      0|    return CKM_SHA256_HMAC;
  ------------------
  |  |  877|      0|#define CKM_SHA256_HMAC 0x00000251UL
  ------------------
  347|  8.93k|}
tls13con.c:tls13_CheckHsState:
  233|     28|{
  234|     28|    va_list ap;
  235|     28|    va_start(ap, line);
  236|     28|    if (tls13_InHsStateV(ss, ap)) {
  ------------------
  |  Branch (236:9): [True: 13, False: 15]
  ------------------
  237|     13|        va_end(ap);
  238|     13|        return SECSuccess;
  239|     13|    }
  240|     15|    va_end(ap);
  241|       |
  242|     15|    SSL_TRC(3, ("%d: TLS13[%d]: error %s state is (%s) at %s (%s:%d)",
  ------------------
  |  |   71|     15|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 15]
  |  |  ------------------
  |  |   72|     15|    ssl_Trace b
  ------------------
  243|     15|                SSL_GETPID(), ss->fd,
  244|     15|                error_name,
  245|     15|                tls13_HandshakeState(TLS13_BASE_WAIT_STATE(ss->ssl3.hs.ws)),
  246|     15|                func, file, line));
  247|     15|    tls13_FatalError(ss, err, unexpected_message);
  248|     15|    return SECFailure;
  249|     28|}
tls13con.c:tls13_HandleKeyUpdate:
 1160|      3|{
 1161|      3|    SECStatus rv;
 1162|      3|    PRUint32 update;
 1163|       |
 1164|      3|    SSL_TRC(3, ("%d: TLS13[%d]: %s handle key update",
  ------------------
  |  |   71|      3|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 3]
  |  |  ------------------
  |  |   72|      3|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1165|      3|                SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
 1166|       |
 1167|      3|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|      3|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      4|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1168|      3|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|      3|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      4|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1169|       |
 1170|      3|    if (!tls13_IsPostHandshake(ss)) {
  ------------------
  |  Branch (1170:9): [True: 3, False: 0]
  ------------------
 1171|      3|        FATAL_ERROR(ss, SSL_ERROR_RX_UNEXPECTED_KEY_UPDATE, unexpected_message);
  ------------------
  |  |   22|      3|    do {                                     \
  |  |   23|      3|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      3|    do {                                                                           \
  |  |  |  |   15|      3|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      3|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      3|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      3|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      3|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      3|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      3|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1172|      3|        return SECFailure;
 1173|      3|    }
 1174|       |
 1175|      0|    rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_KEY_UPDATE,
  ------------------
  |  |  182|      0|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      0|                       __VA_ARGS__,                                 \
  |  |  184|      0|                       wait_invalid)
  ------------------
 1176|      0|                              idle_handshake);
 1177|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1177:9): [True: 0, False: 0]
  ------------------
 1178|       |        /* We should never be idle_handshake prior to firstHsDone. */
 1179|      0|        FATAL_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1180|      0|        return SECFailure;
 1181|      0|    }
 1182|       |
 1183|      0|    rv = ssl3_ConsumeHandshakeNumber(ss, &update, 1, &b, &length);
 1184|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1184:9): [True: 0, False: 0]
  ------------------
 1185|      0|        return SECFailure; /* Error code set already. */
 1186|      0|    }
 1187|      0|    if (length != 0) {
  ------------------
  |  Branch (1187:9): [True: 0, False: 0]
  ------------------
 1188|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_KEY_UPDATE, decode_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1189|      0|        return SECFailure;
 1190|      0|    }
 1191|      0|    if (!(update == update_requested ||
  ------------------
  |  Branch (1191:11): [True: 0, False: 0]
  ------------------
 1192|      0|          update == update_not_requested)) {
  ------------------
  |  Branch (1192:11): [True: 0, False: 0]
  ------------------
 1193|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_KEY_UPDATE, decode_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1194|      0|        return SECFailure;
 1195|      0|    }
 1196|       |
 1197|      0|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1198|      0|        return dtls13_HandleKeyUpdate(ss, b, length, update);
 1199|      0|    }
 1200|       |
 1201|      0|    rv = tls13_UpdateTrafficKeys(ss, ssl_secret_read);
 1202|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1202:9): [True: 0, False: 0]
  ------------------
 1203|      0|        return SECFailure; /* Error code set by tls13_UpdateTrafficKeys. */
 1204|      0|    }
 1205|       |
 1206|      0|    if (update == update_requested) {
  ------------------
  |  Branch (1206:9): [True: 0, False: 0]
  ------------------
 1207|      0|        PRBool sendUpdate;
 1208|      0|        if (ss->ssl3.clientCertRequested) {
  ------------------
  |  Branch (1208:13): [True: 0, False: 0]
  ------------------
 1209|       |            /* Post-handshake auth is in progress; defer sending a key update. */
 1210|      0|            ss->ssl3.hs.keyUpdateDeferred = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1211|      0|            ss->ssl3.hs.deferredKeyUpdateRequest = update_not_requested;
 1212|      0|            sendUpdate = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1213|      0|        } else if (ss->ssl3.peerRequestedKeyUpdate) {
  ------------------
  |  Branch (1213:20): [True: 0, False: 0]
  ------------------
 1214|       |            /* Only send an update if we have sent with the current spec.  This
 1215|       |             * prevents us from being forced to crank forward pointlessly. */
 1216|      0|            ssl_GetSpecReadLock(ss);
  ------------------
  |  | 1422|      0|    {                                           \
  |  | 1423|      0|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1423:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1424|      0|            NSSRWLock_LockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   47|      0|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  |  |  ------------------
  |  | 1425|      0|    }
  ------------------
 1217|      0|            sendUpdate = ss->ssl3.cwSpec->nextSeqNum > 0;
 1218|      0|            ssl_ReleaseSpecReadLock(ss);
  ------------------
  |  | 1427|      0|    {                                             \
  |  | 1428|      0|        if (!ss->opt.noLocks)                     \
  |  |  ------------------
  |  |  |  Branch (1428:13): [True: 0, False: 0]
  |  |  ------------------
  |  | 1429|      0|            NSSRWLock_UnlockRead((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   50|      0|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  |  |  ------------------
  |  | 1430|      0|    }
  ------------------
 1219|      0|        } else {
 1220|      0|            sendUpdate = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1221|      0|        }
 1222|      0|        if (sendUpdate) {
  ------------------
  |  Branch (1222:13): [True: 0, False: 0]
  ------------------
 1223|       |            /* Respond immediately (don't buffer). */
 1224|      0|            rv = tls13_SendKeyUpdate(ss, update_not_requested, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1225|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (1225:17): [True: 0, False: 0]
  ------------------
 1226|      0|                return SECFailure; /* Error already set. */
 1227|      0|            }
 1228|      0|        }
 1229|      0|        ss->ssl3.peerRequestedKeyUpdate = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1230|      0|    }
 1231|       |
 1232|      0|    return SECSuccess;
 1233|      0|}
tls13con.c:tls13_ComputeEarlySecretsWithPsk:
 1467|  3.92k|{
 1468|  3.92k|    SECStatus rv;
 1469|       |
 1470|  3.92k|    SSL_TRC(5, ("%d: TLS13[%d]: compute early secrets (%s)",
  ------------------
  |  |   71|  3.92k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 3.92k]
  |  |  ------------------
  |  |   72|  3.92k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1471|  3.92k|                SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
 1472|       |
 1473|  3.92k|    PORT_Assert(!ss->ssl3.hs.currentSecret);
  ------------------
  |  |  120|  3.92k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.92k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.92k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1474|  3.92k|    sslPsk *psk = NULL;
 1475|       |
 1476|  3.92k|    if (ss->sec.isServer) {
  ------------------
  |  Branch (1476:9): [True: 0, False: 3.92k]
  ------------------
 1477|      0|        psk = ss->xtnData.selectedPsk;
 1478|  3.92k|    } else {
 1479|       |        /* Client to use the first PSK for early secrets. */
 1480|  3.92k|        PORT_Assert(!PR_CLIST_IS_EMPTY(&ss->ssl3.hs.psks));
  ------------------
  |  |  120|  3.92k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.92k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.92k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1481|  3.92k|        psk = (sslPsk *)PR_LIST_HEAD(&ss->ssl3.hs.psks);
  ------------------
  |  |   65|  3.92k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
 1482|  3.92k|    }
 1483|  3.92k|    PORT_Assert(psk && psk->key);
  ------------------
  |  |  120|  3.92k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  7.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 3.92k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 3.92k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1484|  3.92k|    PORT_Assert(psk->hash != ssl_hash_none);
  ------------------
  |  |  120|  3.92k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.92k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.92k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1485|       |
 1486|  3.92k|    PK11SymKey *earlySecret = NULL;
 1487|  3.92k|    rv = tls13_HkdfExtract(NULL, psk->key, psk->hash, &earlySecret);
 1488|  3.92k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1488:9): [True: 0, False: 3.92k]
  ------------------
 1489|      0|        return SECFailure;
 1490|      0|    }
 1491|       |
 1492|       |    /* No longer need the raw input key */
 1493|  3.92k|    PK11_FreeSymKey(psk->key);
 1494|  3.92k|    psk->key = NULL;
 1495|  3.92k|    const char *label = (psk->type == ssl_psk_resume) ? kHkdfLabelResPskBinderKey : kHkdfLabelExtPskBinderKey;
  ------------------
  |  Branch (1495:25): [True: 0, False: 3.92k]
  ------------------
 1496|  3.92k|    rv = tls13_DeriveSecretNullHash(ss, earlySecret,
 1497|  3.92k|                                    label, strlen(label),
 1498|  3.92k|                                    &psk->binderKey, psk->hash);
 1499|  3.92k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1499:9): [True: 0, False: 3.92k]
  ------------------
 1500|      0|        PK11_FreeSymKey(earlySecret);
 1501|      0|        return SECFailure;
 1502|      0|    }
 1503|  3.92k|    ss->ssl3.hs.currentSecret = earlySecret;
 1504|       |
 1505|  3.92k|    return SECSuccess;
 1506|  3.92k|}
tls13con.c:tls13_DeriveSecretWrap:
 4408|  1.69k|{
 4409|  1.69k|    SECStatus rv;
 4410|  1.69k|    SSL3Hashes hashes;
 4411|  1.69k|    char buf[100];
 4412|  1.69k|    const char *label;
 4413|       |
 4414|  1.69k|    if (prefix) {
  ------------------
  |  Branch (4414:9): [True: 1.69k, False: 0]
  ------------------
 4415|  1.69k|        if ((strlen(prefix) + strlen(suffix) + 2) > sizeof(buf)) {
  ------------------
  |  Branch (4415:13): [True: 0, False: 1.69k]
  ------------------
 4416|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4417|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4418|      0|            return SECFailure;
 4419|      0|        }
 4420|  1.69k|        (void)PR_snprintf(buf, sizeof(buf), "%s %s",
 4421|  1.69k|                          prefix, suffix);
 4422|  1.69k|        label = buf;
 4423|  1.69k|    } else {
 4424|      0|        label = suffix;
 4425|      0|    }
 4426|       |
 4427|  1.69k|    SSL_TRC(3, ("%d: TLS13[%d]: deriving secret '%s'",
  ------------------
  |  |   71|  1.69k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.69k]
  |  |  ------------------
  |  |   72|  1.69k|    ssl_Trace b
  ------------------
 4428|  1.69k|                SSL_GETPID(), ss->fd, label));
 4429|  1.69k|    rv = tls13_ComputeHandshakeHashes(ss, &hashes);
 4430|  1.69k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4430:9): [True: 0, False: 1.69k]
  ------------------
 4431|      0|        PORT_Assert(0); /* Should never fail */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4432|      0|        ssl_MapLowLevelError(SEC_ERROR_LIBRARY_FAILURE);
 4433|      0|        return SECFailure;
 4434|      0|    }
 4435|       |
 4436|  1.69k|    rv = tls13_DeriveSecret(ss, key, label, strlen(label),
 4437|  1.69k|                            &hashes, dest, tls13_GetHash(ss));
 4438|  1.69k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4438:9): [True: 0, False: 1.69k]
  ------------------
 4439|      0|        return SECFailure;
 4440|      0|    }
 4441|       |
 4442|  1.69k|    if (keylogLabel) {
  ------------------
  |  Branch (4442:9): [True: 1.69k, False: 0]
  ------------------
 4443|  1.69k|        ssl3_RecordKeyLog(ss, keylogLabel, *dest);
 4444|  1.69k|    }
 4445|  1.69k|    return SECSuccess;
 4446|  1.69k|}
tls13con.c:tls13_SetKeyExchangeType:
 3548|    846|{
 3549|    846|    ss->sec.keaGroup = group;
 3550|    846|    switch (group->keaType) {
 3551|       |        /* Note: These overwrite on resumption.... so if you start with ECDH
 3552|       |         * and resume with DH, we report DH. That's fine, since no answer
 3553|       |         * is really right. */
 3554|    143|        case ssl_kea_ecdh:
  ------------------
  |  Branch (3554:9): [True: 143, False: 703]
  ------------------
 3555|    143|            ss->ssl3.hs.kea_def_mutable.exchKeyType =
 3556|    143|                ss->statelessResume ? ssl_kea_ecdh_psk : ssl_kea_ecdh;
  ------------------
  |  Branch (3556:17): [True: 0, False: 143]
  ------------------
 3557|    143|            ss->sec.keaType = ssl_kea_ecdh;
 3558|    143|            break;
 3559|      0|        case ssl_kea_ecdh_hybrid:
  ------------------
  |  Branch (3559:9): [True: 0, False: 846]
  ------------------
 3560|      0|            ss->ssl3.hs.kea_def_mutable.exchKeyType =
 3561|      0|                ss->statelessResume ? ssl_kea_ecdh_hybrid_psk : ssl_kea_ecdh_hybrid;
  ------------------
  |  Branch (3561:17): [True: 0, False: 0]
  ------------------
 3562|      0|            ss->sec.keaType = ssl_kea_ecdh_hybrid;
 3563|      0|            break;
 3564|    703|        case ssl_kea_dh:
  ------------------
  |  Branch (3564:9): [True: 703, False: 143]
  ------------------
 3565|    703|            ss->ssl3.hs.kea_def_mutable.exchKeyType =
 3566|    703|                ss->statelessResume ? ssl_kea_dh_psk : ssl_kea_dh;
  ------------------
  |  Branch (3566:17): [True: 0, False: 703]
  ------------------
 3567|    703|            ss->sec.keaType = ssl_kea_dh;
 3568|    703|            break;
 3569|      0|        default:
  ------------------
  |  Branch (3569:9): [True: 0, False: 846]
  ------------------
 3570|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3571|    846|    }
 3572|    846|}
tls13con.c:ssl_ListCount:
 2960|    998|{
 2961|    998|    unsigned int c = 0;
 2962|    998|    PRCList *cur;
 2963|  3.91k|    for (cur = PR_NEXT_LINK(list); cur != list; cur = PR_NEXT_LINK(cur)) {
  ------------------
  |  |   47|    998|        ((_e)->next)
  ------------------
                  for (cur = PR_NEXT_LINK(list); cur != list; cur = PR_NEXT_LINK(cur)) {
  ------------------
  |  |   47|  2.91k|        ((_e)->next)
  ------------------
  |  Branch (2963:36): [True: 2.91k, False: 998]
  ------------------
 2964|  2.91k|        ++c;
 2965|  2.91k|    }
 2966|    998|    return c;
 2967|    998|}
tls13con.c:tls13_ReinjectHandshakeTranscript:
 2913|    972|{
 2914|    972|    SSL3Hashes hashes = { 0 };
 2915|    972|    SSL3Hashes echInnerHashes = { 0 };
 2916|    972|    SECStatus rv;
 2917|       |
 2918|       |    /* First compute the hash. */
 2919|    972|    rv = tls13_ComputeHash(ss, &hashes,
 2920|    972|                           ss->ssl3.hs.messages.buf,
 2921|    972|                           ss->ssl3.hs.messages.len,
 2922|    972|                           tls13_GetHash(ss));
 2923|    972|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2923:9): [True: 0, False: 972]
  ------------------
 2924|      0|        return SECFailure;
 2925|      0|    }
 2926|       |
 2927|    972|    if (ss->ssl3.hs.echHpkeCtx) {
  ------------------
  |  Branch (2927:9): [True: 0, False: 972]
  ------------------
 2928|      0|        rv = tls13_ComputeHash(ss, &echInnerHashes,
 2929|      0|                               ss->ssl3.hs.echInnerMessages.buf,
 2930|      0|                               ss->ssl3.hs.echInnerMessages.len,
 2931|      0|                               tls13_GetHash(ss));
 2932|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2932:13): [True: 0, False: 0]
  ------------------
 2933|      0|            return SECFailure;
 2934|      0|        }
 2935|      0|    }
 2936|       |
 2937|    972|    ssl3_RestartHandshakeHashes(ss);
 2938|       |
 2939|       |    /* Reinject the message. The Default context variant updates
 2940|       |     * the default hash state. Use it for both non-ECH and ECH Outer. */
 2941|    972|    rv = ssl_HashHandshakeMessageDefault(ss, ssl_hs_message_hash,
 2942|    972|                                         hashes.u.raw, hashes.len);
 2943|    972|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2943:9): [True: 0, False: 972]
  ------------------
 2944|      0|        return SECFailure;
 2945|      0|    }
 2946|       |
 2947|    972|    if (ss->ssl3.hs.echHpkeCtx) {
  ------------------
  |  Branch (2947:9): [True: 0, False: 972]
  ------------------
 2948|      0|        rv = ssl_HashHandshakeMessageEchInner(ss, ssl_hs_message_hash,
 2949|      0|                                              echInnerHashes.u.raw,
 2950|      0|                                              echInnerHashes.len);
 2951|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2951:13): [True: 0, False: 0]
  ------------------
 2952|      0|            return SECFailure;
 2953|      0|        }
 2954|      0|    }
 2955|       |
 2956|    972|    return SECSuccess;
 2957|    972|}
tls13con.c:tls13_HandleCertificateRequest:
 3108|      3|{
 3109|      3|    SECStatus rv;
 3110|      3|    SECItem context = { siBuffer, NULL, 0 };
 3111|      3|    SECItem extensionsData = { siBuffer, NULL, 0 };
 3112|       |
 3113|      3|    SSL_TRC(3, ("%d: TLS13[%d]: handle certificate_request sequence",
  ------------------
  |  |   71|      3|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 3]
  |  |  ------------------
  |  |   72|      3|    ssl_Trace b
  ------------------
 3114|      3|                SSL_GETPID(), ss->fd));
 3115|       |
 3116|      3|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|      3|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      4|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3117|      3|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|      3|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      4|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3118|       |
 3119|       |    /* Client */
 3120|      3|    if (ss->opt.enablePostHandshakeAuth) {
  ------------------
  |  Branch (3120:9): [True: 1, False: 2]
  ------------------
 3121|      1|        rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST,
  ------------------
  |  |  182|      1|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      1|                       __VA_ARGS__,                                 \
  |  |  184|      1|                       wait_invalid)
  ------------------
 3122|      1|                                  wait_cert_request, idle_handshake);
 3123|      2|    } else {
 3124|      2|        rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST,
  ------------------
  |  |  182|      2|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      2|                       __VA_ARGS__,                                 \
  |  |  184|      2|                       wait_invalid)
  ------------------
 3125|      2|                                  wait_cert_request);
 3126|      2|    }
 3127|      3|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3127:9): [True: 3, False: 0]
  ------------------
 3128|      3|        return SECFailure;
 3129|      3|    }
 3130|       |
 3131|       |    /*  MUST NOT combine external PSKs with certificate authentication. */
 3132|      0|    if (ss->sec.authType == ssl_auth_psk) {
  ------------------
  |  Branch (3132:9): [True: 0, False: 0]
  ------------------
 3133|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_UNEXPECTED_CERT_REQUEST, unexpected_message);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3134|      0|        return SECFailure;
 3135|      0|    }
 3136|       |
 3137|      0|    if (tls13_IsPostHandshake(ss)) {
  ------------------
  |  Branch (3137:9): [True: 0, False: 0]
  ------------------
 3138|      0|        PORT_Assert(ss->ssl3.hs.shaPostHandshake == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3139|      0|        ss->ssl3.hs.shaPostHandshake = PK11_CloneContext(ss->ssl3.hs.sha);
 3140|      0|        if (ss->ssl3.hs.shaPostHandshake == NULL) {
  ------------------
  |  Branch (3140:13): [True: 0, False: 0]
  ------------------
 3141|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 3142|      0|            return SECFailure;
 3143|      0|        }
 3144|      0|        rv = ssl_HashPostHandshakeMessage(ss, ssl_hs_certificate_request, b, length);
 3145|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (3145:13): [True: 0, False: 0]
  ------------------
 3146|      0|            FATAL_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3147|      0|            return SECFailure;
 3148|      0|        }
 3149|       |
 3150|       |        /* clean up anything left from previous handshake. */
 3151|      0|        if (ss->ssl3.clientCertChain != NULL) {
  ------------------
  |  Branch (3151:13): [True: 0, False: 0]
  ------------------
 3152|      0|            CERT_DestroyCertificateList(ss->ssl3.clientCertChain);
 3153|      0|            ss->ssl3.clientCertChain = NULL;
 3154|      0|        }
 3155|      0|        if (ss->ssl3.clientCertificate != NULL) {
  ------------------
  |  Branch (3155:13): [True: 0, False: 0]
  ------------------
 3156|      0|            CERT_DestroyCertificate(ss->ssl3.clientCertificate);
 3157|      0|            ss->ssl3.clientCertificate = NULL;
 3158|      0|        }
 3159|      0|        if (ss->ssl3.clientPrivateKey != NULL) {
  ------------------
  |  Branch (3159:13): [True: 0, False: 0]
  ------------------
 3160|      0|            SECKEY_DestroyPrivateKey(ss->ssl3.clientPrivateKey);
 3161|      0|            ss->ssl3.clientPrivateKey = NULL;
 3162|      0|        }
 3163|      0|        if (ss->ssl3.hs.clientAuthSignatureSchemes != NULL) {
  ------------------
  |  Branch (3163:13): [True: 0, False: 0]
  ------------------
 3164|      0|            PORT_Free(ss->ssl3.hs.clientAuthSignatureSchemes);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 3165|      0|            ss->ssl3.hs.clientAuthSignatureSchemes = NULL;
 3166|      0|            ss->ssl3.hs.clientAuthSignatureSchemesLen = 0;
 3167|      0|        }
 3168|      0|        SECITEM_FreeItem(&ss->xtnData.certReqContext, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                      SECITEM_FreeItem(&ss->xtnData.certReqContext, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 3169|      0|        ss->xtnData.certReqContext.data = NULL;
 3170|      0|    } else {
 3171|      0|        PORT_Assert(ss->ssl3.clientCertChain == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3172|      0|        PORT_Assert(ss->ssl3.clientCertificate == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3173|      0|        PORT_Assert(ss->ssl3.clientPrivateKey == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3174|      0|        PORT_Assert(ss->ssl3.hs.clientAuthSignatureSchemes == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3175|      0|        PORT_Assert(ss->ssl3.hs.clientAuthSignatureSchemesLen == 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3176|      0|        PORT_Assert(!ss->ssl3.hs.clientCertRequested);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3177|      0|        PORT_Assert(ss->xtnData.certReqContext.data == NULL);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3178|      0|    }
 3179|       |
 3180|      0|    rv = ssl3_ConsumeHandshakeVariable(ss, &context, 1, &b, &length);
 3181|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3181:9): [True: 0, False: 0]
  ------------------
 3182|      0|        return SECFailure;
 3183|      0|    }
 3184|       |
 3185|       |    /* Unless it is a post-handshake client auth, the certificate
 3186|       |     * request context must be empty. */
 3187|      0|    if (!tls13_IsPostHandshake(ss) && context.len > 0) {
  ------------------
  |  Branch (3187:9): [True: 0, False: 0]
  |  Branch (3187:39): [True: 0, False: 0]
  ------------------
 3188|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERT_REQUEST, illegal_parameter);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3189|      0|        return SECFailure;
 3190|      0|    }
 3191|       |
 3192|      0|    rv = ssl3_ConsumeHandshakeVariable(ss, &extensionsData, 2, &b, &length);
 3193|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3193:9): [True: 0, False: 0]
  ------------------
 3194|      0|        return SECFailure;
 3195|      0|    }
 3196|       |
 3197|      0|    if (length) {
  ------------------
  |  Branch (3197:9): [True: 0, False: 0]
  ------------------
 3198|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERT_REQUEST, decode_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3199|      0|        return SECFailure;
 3200|      0|    }
 3201|       |
 3202|       |    /* Process all the extensions. */
 3203|      0|    rv = ssl3_HandleExtensions(ss, &extensionsData.data, &extensionsData.len,
 3204|      0|                               ssl_hs_certificate_request);
 3205|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3205:9): [True: 0, False: 0]
  ------------------
 3206|      0|        return SECFailure;
 3207|      0|    }
 3208|       |
 3209|      0|    if (!ss->xtnData.numSigSchemes) {
  ------------------
  |  Branch (3209:9): [True: 0, False: 0]
  ------------------
 3210|      0|        FATAL_ERROR(ss, SSL_ERROR_MISSING_SIGNATURE_ALGORITHMS_EXTENSION,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3211|      0|                    missing_extension);
 3212|      0|        return SECFailure;
 3213|      0|    }
 3214|       |
 3215|      0|    rv = SECITEM_CopyItem(NULL, &ss->xtnData.certReqContext, &context);
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 3216|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3216:9): [True: 0, False: 0]
  ------------------
 3217|      0|        return SECFailure;
 3218|      0|    }
 3219|       |
 3220|      0|    ss->ssl3.hs.clientCertRequested = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 3221|       |
 3222|      0|    if (ss->firstHsDone) {
  ------------------
  |  Branch (3222:9): [True: 0, False: 0]
  ------------------
 3223|       |
 3224|       |        /* Request a client certificate. */
 3225|      0|        rv = ssl3_BeginHandleCertificateRequest(
 3226|      0|            ss, ss->xtnData.sigSchemes, ss->xtnData.numSigSchemes,
 3227|      0|            &ss->xtnData.certReqAuthorities);
 3228|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (3228:13): [True: 0, False: 0]
  ------------------
 3229|      0|            FATAL_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3230|      0|            return rv;
 3231|      0|        }
 3232|      0|        rv = tls13_SendPostHandshakeCertificate(ss);
 3233|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (3233:13): [True: 0, False: 0]
  ------------------
 3234|      0|            return rv; /* error code is set. */
 3235|      0|        }
 3236|      0|    } else {
 3237|      0|        TLS13_SET_HS_STATE(ss, wait_server_cert);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
 3238|      0|    }
 3239|      0|    return SECSuccess;
 3240|      0|}
tls13con.c:tls13_ComputeHandshakeSecret:
 1543|    846|{
 1544|    846|    SECStatus rv;
 1545|    846|    PK11SymKey *derivedSecret = NULL;
 1546|    846|    PK11SymKey *newSecret = NULL;
 1547|    846|    SSL_TRC(5, ("%d: TLS13[%d]: compute handshake secret (%s)",
  ------------------
  |  |   71|    846|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 846]
  |  |  ------------------
  |  |   72|    846|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1548|    846|                SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
 1549|       |
 1550|       |    /* If no PSK, generate the default early secret. */
 1551|    846|    if (!ss->ssl3.hs.currentSecret) {
  ------------------
  |  Branch (1551:9): [True: 840, False: 6]
  ------------------
 1552|    840|        PORT_Assert(!ss->xtnData.selectedPsk);
  ------------------
  |  |  120|    840|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    840|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 840, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1553|    840|        rv = tls13_HkdfExtract(NULL, NULL,
 1554|    840|                               tls13_GetHash(ss), &ss->ssl3.hs.currentSecret);
 1555|    840|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1555:13): [True: 0, False: 840]
  ------------------
 1556|      0|            return SECFailure;
 1557|      0|        }
 1558|    840|    }
 1559|    846|    PORT_Assert(ss->ssl3.hs.currentSecret);
  ------------------
  |  |  120|    846|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    846|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 846, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1560|    846|    PORT_Assert(ss->ssl3.hs.dheSecret);
  ------------------
  |  |  120|    846|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    846|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 846, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1561|       |
 1562|       |    /* Derive-Secret(., "derived", "") */
 1563|    846|    rv = tls13_DeriveSecretNullHash(ss, ss->ssl3.hs.currentSecret,
 1564|    846|                                    kHkdfLabelDerivedSecret,
 1565|    846|                                    strlen(kHkdfLabelDerivedSecret),
 1566|    846|                                    &derivedSecret, tls13_GetHash(ss));
 1567|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1567:9): [True: 0, False: 846]
  ------------------
 1568|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1569|      0|        return rv;
 1570|      0|    }
 1571|       |
 1572|       |    /* HKDF-Extract(ECDHE, .) = Handshake Secret */
 1573|    846|    rv = tls13_HkdfExtract(derivedSecret, ss->ssl3.hs.dheSecret,
 1574|    846|                           tls13_GetHash(ss), &newSecret);
 1575|    846|    PK11_FreeSymKey(derivedSecret);
 1576|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1576:9): [True: 0, False: 846]
  ------------------
 1577|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1578|      0|        return rv;
 1579|      0|    }
 1580|       |
 1581|    846|    PK11_FreeSymKey(ss->ssl3.hs.currentSecret);
 1582|    846|    ss->ssl3.hs.currentSecret = newSecret;
 1583|    846|    return SECSuccess;
 1584|    846|}
tls13con.c:tls13_ComputeHandshakeSecrets:
 1588|    846|{
 1589|    846|    SECStatus rv;
 1590|    846|    PK11SymKey *derivedSecret = NULL;
 1591|    846|    PK11SymKey *newSecret = NULL;
 1592|       |
 1593|    846|    PK11_FreeSymKey(ss->ssl3.hs.dheSecret);
 1594|    846|    ss->ssl3.hs.dheSecret = NULL;
 1595|       |
 1596|    846|    SSL_TRC(5, ("%d: TLS13[%d]: compute handshake secrets (%s)",
  ------------------
  |  |   71|    846|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 846]
  |  |  ------------------
  |  |   72|    846|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1597|    846|                SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
 1598|       |
 1599|       |    /* Now compute |*HsTrafficSecret| */
 1600|    846|    rv = tls13_DeriveSecretWrap(ss, ss->ssl3.hs.currentSecret,
 1601|    846|                                kHkdfLabelClient,
 1602|    846|                                kHkdfLabelHandshakeTrafficSecret,
 1603|    846|                                keylogLabelClientHsTrafficSecret,
 1604|    846|                                &ss->ssl3.hs.clientHsTrafficSecret);
 1605|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1605:9): [True: 0, False: 846]
  ------------------
 1606|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1607|      0|        return rv;
 1608|      0|    }
 1609|    846|    rv = tls13_DeriveSecretWrap(ss, ss->ssl3.hs.currentSecret,
 1610|    846|                                kHkdfLabelServer,
 1611|    846|                                kHkdfLabelHandshakeTrafficSecret,
 1612|    846|                                keylogLabelServerHsTrafficSecret,
 1613|    846|                                &ss->ssl3.hs.serverHsTrafficSecret);
 1614|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1614:9): [True: 0, False: 846]
  ------------------
 1615|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1616|      0|        return rv;
 1617|      0|    }
 1618|       |
 1619|    846|    if (ss->secretCallback) {
  ------------------
  |  Branch (1619:9): [True: 0, False: 846]
  ------------------
 1620|      0|        SSLSecretDirection dir =
 1621|      0|            ss->sec.isServer ? ssl_secret_read : ssl_secret_write;
  ------------------
  |  Branch (1621:13): [True: 0, False: 0]
  ------------------
 1622|      0|        ss->secretCallback(ss->fd, (PRUint16)TrafficKeyHandshake, dir,
 1623|      0|                           ss->ssl3.hs.clientHsTrafficSecret,
 1624|      0|                           ss->secretCallbackArg);
 1625|      0|        dir = ss->sec.isServer ? ssl_secret_write : ssl_secret_read;
  ------------------
  |  Branch (1625:15): [True: 0, False: 0]
  ------------------
 1626|      0|        ss->secretCallback(ss->fd, (PRUint16)TrafficKeyHandshake, dir,
 1627|      0|                           ss->ssl3.hs.serverHsTrafficSecret,
 1628|      0|                           ss->secretCallbackArg);
 1629|      0|    }
 1630|       |
 1631|    846|    SSL_TRC(5, ("%d: TLS13[%d]: compute master secret (%s)",
  ------------------
  |  |   71|    846|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 846]
  |  |  ------------------
  |  |   72|    846|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1632|    846|                SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
 1633|       |
 1634|       |    /* Crank HKDF forward to make master secret, which we
 1635|       |     * stuff in current secret. */
 1636|    846|    rv = tls13_DeriveSecretNullHash(ss, ss->ssl3.hs.currentSecret,
 1637|    846|                                    kHkdfLabelDerivedSecret,
 1638|    846|                                    strlen(kHkdfLabelDerivedSecret),
 1639|    846|                                    &derivedSecret, tls13_GetHash(ss));
 1640|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1640:9): [True: 0, False: 846]
  ------------------
 1641|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1642|      0|        return rv;
 1643|      0|    }
 1644|    846|    rv = tls13_HkdfExtract(derivedSecret,
 1645|    846|                           NULL,
 1646|    846|                           tls13_GetHash(ss),
 1647|    846|                           &newSecret);
 1648|    846|    PK11_FreeSymKey(derivedSecret);
 1649|    846|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1649:9): [True: 0, False: 846]
  ------------------
 1650|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 1651|      0|        return SECFailure;
 1652|      0|    }
 1653|    846|    PK11_FreeSymKey(ss->ssl3.hs.currentSecret);
 1654|    846|    ss->ssl3.hs.currentSecret = newSecret;
 1655|       |
 1656|    846|    return SECSuccess;
 1657|    846|}
tls13con.c:tls13_HandleServerKeyShare:
 3581|    922|{
 3582|    922|    SECStatus rv;
 3583|    922|    TLS13KeyShareEntry *entry;
 3584|    922|    sslEphemeralKeyPair *keyPair;
 3585|    922|    PK11SymKey *dheSecret = NULL;
 3586|    922|    PK11SymKey *kemSecret = NULL;
 3587|       |
 3588|    922|    SSL_TRC(3, ("%d: TLS13[%d]: handle server_key_share handshake",
  ------------------
  |  |   71|    922|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 922]
  |  |  ------------------
  |  |   72|    922|    ssl_Trace b
  ------------------
 3589|    922|                SSL_GETPID(), ss->fd));
 3590|    922|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|    922|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.37k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 465, False: 457]
  |  |  |  |  |  Branch (208:7): [True: 457, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3591|    922|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    922|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.37k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 465, False: 457]
  |  |  |  |  |  Branch (208:7): [True: 457, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3592|       |
 3593|       |    /* This list should have one entry. */
 3594|    922|    if (PR_CLIST_IS_EMPTY(&ss->xtnData.remoteKeyShares)) {
  ------------------
  |  |   94|    922|    ((_l)->next == (_l))
  |  |  ------------------
  |  |  |  Branch (94:5): [True: 16, False: 906]
  |  |  ------------------
  ------------------
 3595|     16|        FATAL_ERROR(ss, SSL_ERROR_MISSING_KEY_SHARE, missing_extension);
  ------------------
  |  |   22|     16|    do {                                     \
  |  |   23|     16|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|     16|    do {                                                                           \
  |  |  |  |   15|     16|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|     16|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 16]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|     16|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|     16|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|     16|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|     16|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|     16|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|     16|        tls13_FatalError(ss, prError, desc); \
  |  |   25|     16|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3596|     16|        return SECFailure;
 3597|     16|    }
 3598|       |
 3599|    906|    entry = (TLS13KeyShareEntry *)PR_NEXT_LINK(&ss->xtnData.remoteKeyShares);
  ------------------
  |  |   47|    906|        ((_e)->next)
  ------------------
 3600|    906|    PORT_Assert(PR_NEXT_LINK(&entry->link) == &ss->xtnData.remoteKeyShares);
  ------------------
  |  |  120|    906|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    906|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 906, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3601|       |
 3602|       |    /* Now get our matching key. */
 3603|    906|    keyPair = ssl_LookupEphemeralKeyPair(ss, entry->group);
 3604|    906|    if (!keyPair) {
  ------------------
  |  Branch (3604:9): [True: 13, False: 893]
  ------------------
 3605|     13|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_KEY_SHARE, illegal_parameter);
  ------------------
  |  |   22|     13|    do {                                     \
  |  |   23|     13|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|     13|    do {                                                                           \
  |  |  |  |   15|     13|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|     13|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|     13|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|     13|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|     13|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|     13|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|     13|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|     13|        tls13_FatalError(ss, prError, desc); \
  |  |   25|     13|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3606|     13|        return SECFailure;
 3607|     13|    }
 3608|       |
 3609|    893|    PORT_Assert(ssl_NamedGroupEnabled(ss, entry->group));
  ------------------
  |  |  120|    893|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    893|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 893, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3610|       |
 3611|    893|    rv = tls13_HandleKeyShare(ss, entry, keyPair->keys,
 3612|    893|                              tls13_GetHash(ss),
 3613|    893|                              &dheSecret);
 3614|    893|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3614:9): [True: 47, False: 846]
  ------------------
 3615|     47|        goto loser; /* Error code already set. */
 3616|     47|    }
 3617|       |
 3618|    846|    if (entry->group->keaType == ssl_kea_ecdh_hybrid) {
  ------------------
  |  Branch (3618:9): [True: 0, False: 846]
  ------------------
 3619|      0|        rv = tls13_HandleKEMCiphertext(ss, entry, keyPair->kemKeys, &kemSecret);
 3620|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (3620:13): [True: 0, False: 0]
  ------------------
 3621|      0|            goto loser; /* Error set by tls13_HandleKEMCiphertext */
 3622|      0|        }
 3623|      0|        switch (entry->group->name) {
 3624|      0|            case ssl_grp_kem_xyber768d00:
  ------------------
  |  Branch (3624:13): [True: 0, False: 0]
  ------------------
 3625|      0|                ss->ssl3.hs.dheSecret = PK11_ConcatSymKeys(dheSecret, kemSecret, CKM_HKDF_DERIVE, CKA_DERIVE);
  ------------------
  |  | 1296|      0|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
                              ss->ssl3.hs.dheSecret = PK11_ConcatSymKeys(dheSecret, kemSecret, CKM_HKDF_DERIVE, CKA_DERIVE);
  ------------------
  |  |  555|      0|#define CKA_DERIVE 0x0000010CUL
  ------------------
 3626|      0|                break;
 3627|      0|            case ssl_grp_kem_mlkem768x25519:
  ------------------
  |  Branch (3627:13): [True: 0, False: 0]
  ------------------
 3628|      0|                ss->ssl3.hs.dheSecret = PK11_ConcatSymKeys(kemSecret, dheSecret, CKM_HKDF_DERIVE, CKA_DERIVE);
  ------------------
  |  | 1296|      0|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
                              ss->ssl3.hs.dheSecret = PK11_ConcatSymKeys(kemSecret, dheSecret, CKM_HKDF_DERIVE, CKA_DERIVE);
  ------------------
  |  |  555|      0|#define CKA_DERIVE 0x0000010CUL
  ------------------
 3629|      0|                break;
 3630|      0|            default:
  ------------------
  |  Branch (3630:13): [True: 0, False: 0]
  ------------------
 3631|      0|                PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3632|      0|                PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 3633|      0|                ss->ssl3.hs.dheSecret = NULL;
 3634|      0|                break;
 3635|      0|        }
 3636|      0|        if (!ss->ssl3.hs.dheSecret) {
  ------------------
  |  Branch (3636:13): [True: 0, False: 0]
  ------------------
 3637|      0|            goto loser; /* Error set by PK11_ConcatSymKeys */
 3638|      0|        }
 3639|      0|        PK11_FreeSymKey(dheSecret);
 3640|      0|        PK11_FreeSymKey(kemSecret);
 3641|    846|    } else {
 3642|    846|        ss->ssl3.hs.dheSecret = dheSecret;
 3643|    846|    }
 3644|       |
 3645|    846|    tls13_SetKeyExchangeType(ss, entry->group);
 3646|    846|    ss->sec.keaKeyBits = SECKEY_PublicKeyStrengthInBits(keyPair->keys->pubKey);
 3647|       |
 3648|    846|    return SECSuccess;
 3649|       |
 3650|     47|loser:
 3651|     47|    PK11_FreeSymKey(dheSecret);
 3652|     47|    PK11_FreeSymKey(kemSecret);
 3653|     47|    FATAL_ERROR(ss, PORT_GetError(), illegal_parameter);
  ------------------
  |  |   22|     47|    do {                                     \
  |  |   23|     47|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|     47|    do {                                                                           \
  |  |  |  |   15|     47|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|     47|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 47]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|     47|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|     47|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|     47|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|     47|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|     47|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|     47|        tls13_FatalError(ss, prError, desc); \
  |  |   25|     47|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3654|     47|    return SECFailure;
 3655|    846|}
tls13con.c:tls13_HandleCertificateDecode:
 3985|      5|{
 3986|      5|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|      5|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      7|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 3, False: 2]
  |  |  |  |  |  Branch (208:7): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3987|      5|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|      5|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      7|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 3, False: 2]
  |  |  |  |  |  Branch (208:7): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3988|       |
 3989|      5|    SECStatus rv = SECFailure;
 3990|       |
 3991|      5|    if (!ss->xtnData.certificateCompressionAdvertised) {
  ------------------
  |  Branch (3991:9): [True: 3, False: 2]
  ------------------
 3992|      3|        FATAL_ERROR(ss, SEC_ERROR_UNEXPECTED_COMPRESSED_CERTIFICATE, decode_error);
  ------------------
  |  |   22|      3|    do {                                     \
  |  |   23|      3|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      3|    do {                                                                           \
  |  |  |  |   15|      3|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      3|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      3|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      3|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      3|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      3|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      3|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      3|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 3993|      3|        return SECFailure;
 3994|      3|    }
 3995|       |
 3996|      2|    rv = tls13_EnsureCerticateExpected(ss);
 3997|      2|    if (rv != SECSuccess) {
  ------------------
  |  Branch (3997:9): [True: 2, False: 0]
  ------------------
 3998|      2|        return SECFailure; /* Code already set. */
 3999|      2|    }
 4000|       |
 4001|      0|    if (ss->firstHsDone) {
  ------------------
  |  Branch (4001:9): [True: 0, False: 0]
  ------------------
 4002|      0|        rv = ssl_HashPostHandshakeMessage(ss, ssl_hs_compressed_certificate, b, length);
 4003|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4003:13): [True: 0, False: 0]
  ------------------
 4004|      0|            return rv;
 4005|      0|        }
 4006|      0|    }
 4007|       |
 4008|      0|    SSL_TRC(30, ("%d: TLS1.3[%d]: %s handles certificate compression handshake",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4009|      0|                 SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
 4010|       |
 4011|      0|    PRINT_BUF(50, (NULL, "The certificate before decoding:", b, length));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4012|       |    /* Reading CertificateCompressionAlgorithm. */
 4013|      0|    PRUint32 compressionAlg = 0;
 4014|      0|    rv = ssl3_ConsumeHandshakeNumber(ss, &compressionAlg, 2, &b, &length);
 4015|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4015:9): [True: 0, False: 0]
  ------------------
 4016|      0|        return SECFailure; /* Alert already sent. */
 4017|      0|    }
 4018|       |
 4019|      0|    PRBool compressionAlgorithmIsSupported = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4020|      0|    SECStatus (*certificateDecodingFunc)(const SECItem *,
 4021|      0|                                         unsigned char *output, size_t outputLen, size_t *usedLen) = NULL;
 4022|      0|    for (int i = 0; i < ss->ssl3.supportedCertCompressionAlgorithmsCount; i++) {
  ------------------
  |  Branch (4022:21): [True: 0, False: 0]
  ------------------
 4023|      0|        if (ss->ssl3.supportedCertCompressionAlgorithms[i].id == compressionAlg) {
  ------------------
  |  Branch (4023:13): [True: 0, False: 0]
  ------------------
 4024|      0|            compressionAlgorithmIsSupported = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 4025|      0|            certificateDecodingFunc = ss->ssl3.supportedCertCompressionAlgorithms[i].decode;
 4026|      0|        }
 4027|      0|    }
 4028|       |
 4029|       |    /* Peer selected a compression algorithm we do not support (and did not advertise). */
 4030|      0|    if (!compressionAlgorithmIsSupported) {
  ------------------
  |  Branch (4030:9): [True: 0, False: 0]
  ------------------
 4031|      0|        PORT_SetError(SEC_ERROR_CERTIFICATE_COMPRESSION_ALGORITHM_NOT_SUPPORTED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4032|      0|        FATAL_ERROR(ss, PORT_GetError(), illegal_parameter);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4033|      0|        return SECFailure;
 4034|      0|    }
 4035|       |
 4036|       |    /* The algorithm does not support decoding. */
 4037|      0|    if (certificateDecodingFunc == NULL) {
  ------------------
  |  Branch (4037:9): [True: 0, False: 0]
  ------------------
 4038|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4039|      0|        FATAL_ERROR(ss, PORT_GetError(), illegal_parameter);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4040|      0|        return SECFailure;
 4041|      0|    }
 4042|       |
 4043|      0|    SSL_TRC(30, ("%d: TLS13[%d]: %s is decoding the certificate using the %s compression algorithm",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4044|      0|                 SSL_GETPID(), ss->fd, SSL_ROLE(ss),
 4045|      0|                 ssl3_mapCertificateCompressionAlgorithmToName(ss, compressionAlg)));
 4046|      0|    PRUint32 decodedCertLen = 0;
 4047|      0|    rv = ssl3_ConsumeHandshakeNumber(ss, &decodedCertLen, 3, &b, &length);
 4048|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4048:9): [True: 0, False: 0]
  ------------------
 4049|      0|        return SECFailure; /* alert has been sent */
 4050|      0|    }
 4051|       |
 4052|       |    /*  If the received CompressedCertificate message cannot be decompressed,
 4053|       |     *  he connection MUST be terminated with the "bad_certificate" alert.
 4054|       |     */
 4055|      0|    if (decodedCertLen == 0) {
  ------------------
  |  Branch (4055:9): [True: 0, False: 0]
  ------------------
 4056|      0|        SSL_TRC(50, ("%d: TLS13[%d]: %s decoded certificate length is incorrect",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4057|      0|                     SSL_GETPID(), ss->fd, SSL_ROLE(ss),
 4058|      0|                     ssl3_mapCertificateCompressionAlgorithmToName(ss, compressionAlg)));
 4059|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERTIFICATE, bad_certificate);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4060|      0|        return SECFailure;
 4061|      0|    }
 4062|       |
 4063|       |    /* opaque compressed_certificate_message<1..2^24-1>; */
 4064|      0|    PRUint32 compressedCertLen = 0;
 4065|      0|    rv = ssl3_ConsumeHandshakeNumber(ss, &compressedCertLen, 3, &b, &length);
 4066|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4066:9): [True: 0, False: 0]
  ------------------
 4067|      0|        return SECFailure; /* alert has been sent */
 4068|      0|    }
 4069|       |
 4070|      0|    if (compressedCertLen == 0 || compressedCertLen != length) {
  ------------------
  |  Branch (4070:9): [True: 0, False: 0]
  |  Branch (4070:35): [True: 0, False: 0]
  ------------------
 4071|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERTIFICATE, bad_certificate);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4072|      0|        return SECFailure;
 4073|      0|    }
 4074|       |
 4075|       |    /* Decoding received certificate. */
 4076|      0|    PRUint8 *decodedCert = PORT_ZAlloc(decodedCertLen);
  ------------------
  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
 4077|      0|    if (!decodedCert) {
  ------------------
  |  Branch (4077:9): [True: 0, False: 0]
  ------------------
 4078|      0|        return SECFailure;
 4079|      0|    }
 4080|       |
 4081|      0|    size_t actualCertLen = 0;
 4082|       |
 4083|      0|    SECItem encodedCertAsSecItem = { siBuffer, b, compressedCertLen };
 4084|      0|    rv = certificateDecodingFunc(&encodedCertAsSecItem,
 4085|      0|                                 decodedCert, decodedCertLen, &actualCertLen);
 4086|       |
 4087|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4087:9): [True: 0, False: 0]
  ------------------
 4088|      0|        SSL_TRC(50, ("%d: TLS13[%d]: %s decoding of the certificate has failed",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4089|      0|                     SSL_GETPID(), ss->fd, SSL_ROLE(ss),
 4090|      0|                     ssl3_mapCertificateCompressionAlgorithmToName(ss, compressionAlg)));
 4091|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERTIFICATE, bad_certificate);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4092|      0|        goto loser;
 4093|      0|    }
 4094|      0|    PRINT_BUF(60, (ss, "consume bytes:", b, compressedCertLen));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4095|      0|    *b += compressedCertLen;
 4096|      0|    length -= compressedCertLen;
 4097|       |
 4098|       |    /*  If, after decompression, the specified length does not match the actual length,
 4099|       |     *  the party receiving the invalid message MUST abort the connection
 4100|       |     *  with the "bad_certificate" alert.
 4101|       |     */
 4102|      0|    if (actualCertLen != decodedCertLen) {
  ------------------
  |  Branch (4102:9): [True: 0, False: 0]
  ------------------
 4103|      0|        SSL_TRC(50, ("%d: TLS13[%d]: %s certificate length does not correspond to extension length",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4104|      0|                     SSL_GETPID(), ss->fd, SSL_ROLE(ss),
 4105|      0|                     ssl3_mapCertificateCompressionAlgorithmToName(ss, compressionAlg)));
 4106|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERTIFICATE, bad_certificate);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4107|      0|        goto loser;
 4108|      0|    }
 4109|       |
 4110|      0|    PRINT_BUF(50, (NULL, "Decoded certificate",
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 4111|      0|                   decodedCert, decodedCertLen));
 4112|       |
 4113|       |    /* compressed_certificate_message:  The result of applying the indicated
 4114|       |     * compression algorithm to the encoded Certificate message that
 4115|       |     *  would have been sent if certificate compression was not in use.
 4116|       |     *
 4117|       |     * After decompression, the Certificate message MUST be processed as if
 4118|       |     * it were encoded without being compressed.  This way, the parsing and
 4119|       |     * the verification have the same security properties as they would have
 4120|       |     * in TLS normally.
 4121|       |     */
 4122|      0|    rv = tls13_HandleCertificate(ss, decodedCert, decodedCertLen, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 4123|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4123:9): [True: 0, False: 0]
  ------------------
 4124|      0|        goto loser;
 4125|      0|    }
 4126|       |    /* We allow only one compressed certificate to be handled after each
 4127|       |       certificate compression advertisement.
 4128|       |       See test CertificateCompression_TwoEncodedCertificateRequests. */
 4129|      0|    ss->xtnData.certificateCompressionAdvertised = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4130|      0|    PORT_Free(decodedCert);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 4131|      0|    return SECSuccess;
 4132|       |
 4133|      0|loser:
 4134|      0|    PORT_Free(decodedCert);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 4135|      0|    return SECFailure;
 4136|      0|}
tls13con.c:tls13_EnsureCerticateExpected:
 3949|      5|{
 3950|      5|    SECStatus rv = SECFailure;
 3951|      5|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|      5|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      7|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 3, False: 2]
  |  |  |  |  |  Branch (208:7): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3952|      5|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|      5|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      7|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 3, False: 2]
  |  |  |  |  |  Branch (208:7): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3953|       |
 3954|      5|    if (ss->sec.isServer) {
  ------------------
  |  Branch (3954:9): [True: 0, False: 5]
  ------------------
 3955|       |        /* Receiving this message might be the first sign we have that
 3956|       |         * early data is over, so pretend we received EOED. */
 3957|      0|        rv = tls13_MaybeHandleSuppressedEndOfEarlyData(ss);
 3958|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (3958:13): [True: 0, False: 0]
  ------------------
 3959|      0|            return SECFailure; /* Code already set. */
 3960|      0|        }
 3961|       |
 3962|      0|        if (ss->ssl3.clientCertRequested) {
  ------------------
  |  Branch (3962:13): [True: 0, False: 0]
  ------------------
 3963|      0|            rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_CERTIFICATE,
  ------------------
  |  |  182|      0|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      0|                       __VA_ARGS__,                                 \
  |  |  184|      0|                       wait_invalid)
  ------------------
 3964|      0|                                      idle_handshake);
 3965|      0|        } else {
 3966|      0|            rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_CERTIFICATE,
  ------------------
  |  |  182|      0|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      0|                       __VA_ARGS__,                                 \
  |  |  184|      0|                       wait_invalid)
  ------------------
 3967|      0|                                      wait_client_cert);
 3968|      0|        }
 3969|      5|    } else {
 3970|      5|        rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_CERTIFICATE,
  ------------------
  |  |  182|      5|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      5|                       __VA_ARGS__,                                 \
  |  |  184|      5|                       wait_invalid)
  ------------------
 3971|      5|                                  wait_cert_request, wait_server_cert);
 3972|      5|    }
 3973|      5|    return rv;
 3974|      5|}
tls13con.c:tls13_HandleCertificate:
 4144|      3|{
 4145|      3|    SECStatus rv;
 4146|      3|    SECItem context = { siBuffer, NULL, 0 };
 4147|      3|    SECItem certList;
 4148|      3|    PRBool first = PR_TRUE;
  ------------------
  |  |  437|      3|#define PR_TRUE 1
  ------------------
 4149|      3|    ssl3CertNode *lastCert = NULL;
 4150|       |
 4151|      3|    SSL_TRC(3, ("%d: TLS13[%d]: handle certificate handshake",
  ------------------
  |  |   71|      3|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 3]
  |  |  ------------------
  |  |   72|      3|    ssl_Trace b
  ------------------
 4152|      3|                SSL_GETPID(), ss->fd));
 4153|      3|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|      3|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      4|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4154|      3|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|      3|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      4|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4155|       |
 4156|      3|    rv = tls13_EnsureCerticateExpected(ss);
 4157|      3|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4157:9): [True: 3, False: 0]
  ------------------
 4158|      3|        return SECFailure; /* Code already set. */
 4159|      3|    }
 4160|       |
 4161|       |    /* We can ignore any other cleartext from the client. */
 4162|      0|    if (ss->sec.isServer && IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (4162:9): [True: 0, False: 0]
  ------------------
 4163|      0|        ssl_CipherSpecReleaseByEpoch(ss, ssl_secret_read, TrafficKeyClearText);
 4164|      0|        dtls_ReceivedFirstMessageInFlight(ss);
 4165|      0|    }
 4166|       |
 4167|       |    /* AlreadyHashed is true only when Certificate Compression is used. */
 4168|      0|    if (ss->firstHsDone && !alreadyHashed) {
  ------------------
  |  Branch (4168:9): [True: 0, False: 0]
  |  Branch (4168:28): [True: 0, False: 0]
  ------------------
 4169|      0|        rv = ssl_HashPostHandshakeMessage(ss, ssl_hs_certificate, b, length);
 4170|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4170:13): [True: 0, False: 0]
  ------------------
 4171|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 4172|      0|            return SECFailure;
 4173|      0|        }
 4174|      0|    }
 4175|       |
 4176|      0|    if (!ss->firstHsDone && ss->sec.isServer) {
  ------------------
  |  Branch (4176:9): [True: 0, False: 0]
  |  Branch (4176:29): [True: 0, False: 0]
  ------------------
 4177|       |        /* Our first shot an getting an RTT estimate.  If the client took extra
 4178|       |         * time to fetch a certificate, this will be bad, but we can't do much
 4179|       |         * about that. */
 4180|      0|        ss->ssl3.hs.rttEstimate = ssl_Time(ss) - ss->ssl3.hs.rttEstimate;
 4181|      0|    }
 4182|       |
 4183|       |    /* Process the context string */
 4184|      0|    rv = ssl3_ConsumeHandshakeVariable(ss, &context, 1, &b, &length);
 4185|      0|    if (rv != SECSuccess)
  ------------------
  |  Branch (4185:9): [True: 0, False: 0]
  ------------------
 4186|      0|        return SECFailure;
 4187|       |
 4188|      0|    if (ss->ssl3.clientCertRequested) {
  ------------------
  |  Branch (4188:9): [True: 0, False: 0]
  ------------------
 4189|      0|        PORT_Assert(ss->sec.isServer);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4190|      0|        if (SECITEM_CompareItem(&context, &ss->xtnData.certReqContext) != 0) {
  ------------------
  |  |  105|      0|#define SECITEM_CompareItem SECITEM_CompareItem_Util
  ------------------
  |  Branch (4190:13): [True: 0, False: 0]
  ------------------
 4191|      0|            FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERTIFICATE, illegal_parameter);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4192|      0|            return SECFailure;
 4193|      0|        }
 4194|      0|    }
 4195|      0|    rv = ssl3_ConsumeHandshakeVariable(ss, &certList, 3, &b, &length);
 4196|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4196:9): [True: 0, False: 0]
  ------------------
 4197|      0|        return SECFailure;
 4198|      0|    }
 4199|      0|    if (length) {
  ------------------
  |  Branch (4199:9): [True: 0, False: 0]
  ------------------
 4200|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERTIFICATE, illegal_parameter);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4201|      0|        return SECFailure;
 4202|      0|    }
 4203|       |
 4204|      0|    if (!certList.len) {
  ------------------
  |  Branch (4204:9): [True: 0, False: 0]
  ------------------
 4205|      0|        if (!ss->sec.isServer) {
  ------------------
  |  Branch (4205:13): [True: 0, False: 0]
  ------------------
 4206|       |            /* Servers always need to send some cert. */
 4207|      0|            FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERTIFICATE, bad_certificate);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4208|      0|            return SECFailure;
 4209|      0|        } else {
 4210|       |            /* This is TLS's version of a no_certificate alert. */
 4211|       |            /* I'm a server. I've requested a client cert. He hasn't got one. */
 4212|      0|            rv = ssl3_HandleNoCertificate(ss);
 4213|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (4213:17): [True: 0, False: 0]
  ------------------
 4214|      0|                return SECFailure;
 4215|      0|            }
 4216|       |
 4217|      0|            TLS13_SET_HS_STATE(ss, wait_finished);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
 4218|      0|            return SECSuccess;
 4219|      0|        }
 4220|      0|    }
 4221|       |
 4222|       |    /* Now clean up. */
 4223|      0|    ssl3_CleanupPeerCerts(ss);
 4224|      0|    ss->ssl3.peerCertArena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   63|      0|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  ss->ssl3.peerCertArena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
  ------------------
  |  |   60|      0|#define DER_DEFAULT_CHUNKSIZE (2048)
  ------------------
 4225|      0|    if (ss->ssl3.peerCertArena == NULL) {
  ------------------
  |  Branch (4225:9): [True: 0, False: 0]
  ------------------
 4226|      0|        FATAL_ERROR(ss, SEC_ERROR_NO_MEMORY, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4227|      0|        return SECFailure;
 4228|      0|    }
 4229|       |
 4230|      0|    while (certList.len) {
  ------------------
  |  Branch (4230:12): [True: 0, False: 0]
  ------------------
 4231|      0|        SECItem derCert; // will hold a weak reference into certList
 4232|      0|        rv = tls13_HandleCertificateEntry(ss, &certList, first,
 4233|      0|                                          &derCert);
 4234|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4234:13): [True: 0, False: 0]
  ------------------
 4235|      0|            ss->xtnData.signedCertTimestamps.len = 0;
 4236|      0|            return SECFailure;
 4237|      0|        }
 4238|       |
 4239|      0|        if (first) {
  ------------------
  |  Branch (4239:13): [True: 0, False: 0]
  ------------------
 4240|      0|            ss->sec.peerCert = CERT_NewTempCertificate(ss->dbHandle, &derCert,
 4241|      0|                                                       NULL, PR_FALSE, PR_TRUE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
                                                                     NULL, PR_FALSE, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 4242|      0|            if (!ss->sec.peerCert) {
  ------------------
  |  Branch (4242:17): [True: 0, False: 0]
  ------------------
 4243|      0|                PRErrorCode errCode = PORT_GetError();
  ------------------
  |  |   62|      0|#define PORT_GetError PORT_GetError_Util
  ------------------
 4244|      0|                switch (errCode) {
 4245|      0|                    case PR_OUT_OF_MEMORY_ERROR:
  ------------------
  |  |   16|      0|#define PR_OUT_OF_MEMORY_ERROR                   (-6000L)
  ------------------
  |  Branch (4245:21): [True: 0, False: 0]
  ------------------
 4246|      0|                    case SEC_ERROR_BAD_DATABASE:
  ------------------
  |  Branch (4246:21): [True: 0, False: 0]
  ------------------
 4247|      0|                    case SEC_ERROR_NO_MEMORY:
  ------------------
  |  Branch (4247:21): [True: 0, False: 0]
  ------------------
 4248|      0|                        FATAL_ERROR(ss, errCode, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4249|      0|                        return SECFailure;
 4250|      0|                    default:
  ------------------
  |  Branch (4250:21): [True: 0, False: 0]
  ------------------
 4251|      0|                        ssl3_SendAlertForCertError(ss, errCode);
 4252|      0|                        return SECFailure;
 4253|      0|                }
 4254|      0|            }
 4255|       |
 4256|      0|            if (ss->xtnData.signedCertTimestamps.len) {
  ------------------
  |  Branch (4256:17): [True: 0, False: 0]
  ------------------
 4257|      0|                sslSessionID *sid = ss->sec.ci.sid;
 4258|      0|                rv = SECITEM_CopyItem(NULL, &sid->u.ssl3.signedCertTimestamps,
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 4259|      0|                                      &ss->xtnData.signedCertTimestamps);
 4260|      0|                ss->xtnData.signedCertTimestamps.len = 0;
 4261|      0|                if (rv != SECSuccess) {
  ------------------
  |  Branch (4261:21): [True: 0, False: 0]
  ------------------
 4262|      0|                    FATAL_ERROR(ss, SEC_ERROR_NO_MEMORY, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4263|      0|                    return SECFailure;
 4264|      0|                }
 4265|      0|            }
 4266|      0|        } else {
 4267|      0|            ssl3CertNode *c = PORT_ArenaNew(ss->ssl3.peerCertArena,
  ------------------
  |  |  153|      0|    (type *)PORT_ArenaAlloc(poolp, sizeof(type))
  |  |  ------------------
  |  |  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  |  |  ------------------
  ------------------
 4268|      0|                                            ssl3CertNode);
 4269|      0|            if (!c) {
  ------------------
  |  Branch (4269:17): [True: 0, False: 0]
  ------------------
 4270|      0|                FATAL_ERROR(ss, SEC_ERROR_NO_MEMORY, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4271|      0|                return SECFailure;
 4272|      0|            }
 4273|      0|            c->derCert = SECITEM_ArenaDupItem(ss->ssl3.peerCertArena,
  ------------------
  |  |  104|      0|#define SECITEM_ArenaDupItem SECITEM_ArenaDupItem_Util
  ------------------
 4274|      0|                                              &derCert);
 4275|      0|            c->next = NULL;
 4276|       |
 4277|      0|            if (lastCert) {
  ------------------
  |  Branch (4277:17): [True: 0, False: 0]
  ------------------
 4278|      0|                lastCert->next = c;
 4279|      0|            } else {
 4280|      0|                ss->ssl3.peerCertChain = c;
 4281|      0|            }
 4282|      0|            lastCert = c;
 4283|      0|        }
 4284|       |
 4285|      0|        first = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 4286|      0|    }
 4287|      0|    SECKEY_UpdateCertPQG(ss->sec.peerCert);
 4288|       |
 4289|      0|    return ssl3_AuthCertificate(ss); /* sets ss->ssl3.hs.ws */
 4290|      0|}
tls13con.c:tls13_SetCipherSpec:
 4696|    897|{
 4697|    897|    TrafficKeyType type;
 4698|    897|    SECStatus rv;
 4699|    897|    ssl3CipherSpec *spec = NULL;
 4700|    897|    ssl3CipherSpec **specp;
 4701|       |
 4702|       |    /* Flush out old handshake data. */
 4703|    897|    ssl_GetXmitBufLock(ss);
  ------------------
  |  | 1466|    897|    {                                           \
  |  | 1467|    897|        if (!ss->opt.noLocks)                   \
  |  |  ------------------
  |  |  |  Branch (1467:13): [True: 442, False: 455]
  |  |  ------------------
  |  | 1468|    897|            PZ_EnterMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  256|    442|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1469|    897|    }
  ------------------
 4704|    897|    rv = ssl3_FlushHandshake(ss, ssl_SEND_FLAG_FORCE_INTO_BUFFER);
  ------------------
  |  |  223|    897|#define ssl_SEND_FLAG_FORCE_INTO_BUFFER 0x40000000
  ------------------
 4705|    897|    ssl_ReleaseXmitBufLock(ss);
  ------------------
  |  | 1471|    897|    {                                          \
  |  | 1472|    897|        if (!ss->opt.noLocks)                  \
  |  |  ------------------
  |  |  |  Branch (1472:13): [True: 442, False: 455]
  |  |  ------------------
  |  | 1473|    897|            PZ_ExitMonitor((ss)->xmitBufLock); \
  |  |  ------------------
  |  |  |  |  257|    442|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1474|    897|    }
  ------------------
 4706|    897|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4706:9): [True: 0, False: 897]
  ------------------
 4707|      0|        return SECFailure;
 4708|      0|    }
 4709|       |
 4710|       |    /* Create the new spec. */
 4711|    897|    spec = ssl_CreateCipherSpec(ss, direction);
 4712|    897|    if (!spec) {
  ------------------
  |  Branch (4712:9): [True: 0, False: 897]
  ------------------
 4713|      0|        return SECFailure;
 4714|      0|    }
 4715|    897|    spec->epoch = epoch;
 4716|    897|    spec->nextSeqNum = 0;
 4717|    897|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|    897|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 897, False: 0]
  |  |  ------------------
  ------------------
 4718|    897|        dtls_InitRecvdRecords(&spec->recvdRecords);
 4719|    897|    }
 4720|       |
 4721|       |    /* This depends on spec having a valid direction and epoch. */
 4722|    897|    rv = tls13_SetupPendingCipherSpec(ss, spec);
 4723|    897|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4723:9): [True: 0, False: 897]
  ------------------
 4724|      0|        goto loser;
 4725|      0|    }
 4726|       |
 4727|    897|    type = (TrafficKeyType)PR_MIN(TrafficKeyApplicationData, epoch);
  ------------------
  |  |  158|    897|#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (158:26): [True: 0, False: 897]
  |  |  ------------------
  ------------------
 4728|    897|    rv = tls13_DeriveTrafficKeys(ss, spec, type, deleteSecret);
 4729|    897|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4729:9): [True: 0, False: 897]
  ------------------
 4730|      0|        goto loser;
 4731|      0|    }
 4732|       |
 4733|    897|    rv = tls13_InitPendingContext(ss, spec);
 4734|    897|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4734:9): [True: 0, False: 897]
  ------------------
 4735|      0|        goto loser;
 4736|      0|    }
 4737|       |
 4738|       |    /* Now that we've set almost everything up, finally cut over. */
 4739|    897|    specp = (direction == ssl_secret_read) ? &ss->ssl3.crSpec : &ss->ssl3.cwSpec;
  ------------------
  |  Branch (4739:13): [True: 846, False: 51]
  ------------------
 4740|    897|    ssl_GetSpecWriteLock(ss);
  ------------------
  |  | 1435|    897|    {                                            \
  |  | 1436|    897|        if (!ss->opt.noLocks)                    \
  |  |  ------------------
  |  |  |  Branch (1436:13): [True: 442, False: 455]
  |  |  ------------------
  |  | 1437|    897|            NSSRWLock_LockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   48|    442|#define NSSRWLock_LockWrite NSSRWLock_LockWrite_Util
  |  |  ------------------
  |  | 1438|    897|    }
  ------------------
 4741|    897|    ssl_CipherSpecRelease(*specp); /* May delete old cipher. */
 4742|    897|    *specp = spec;                 /* Overwrite. */
 4743|    897|    ssl_ReleaseSpecWriteLock(ss);
  ------------------
  |  | 1440|    897|    {                                              \
  |  | 1441|    897|        if (!ss->opt.noLocks)                      \
  |  |  ------------------
  |  |  |  Branch (1441:13): [True: 442, False: 455]
  |  |  ------------------
  |  | 1442|    897|            NSSRWLock_UnlockWrite((ss)->specLock); \
  |  |  ------------------
  |  |  |  |   51|    442|#define NSSRWLock_UnlockWrite NSSRWLock_UnlockWrite_Util
  |  |  ------------------
  |  | 1443|    897|    }
  ------------------
 4744|       |
 4745|    897|    SSL_TRC(3, ("%d: TLS13[%d]: %s installed key for epoch=%d (%s) dir=%s",
  ------------------
  |  |   71|    897|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 897]
  |  |  ------------------
  |  |   72|    897|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4746|    897|                SSL_GETPID(), ss->fd, SSL_ROLE(ss), spec->epoch,
 4747|    897|                spec->phase, SPEC_DIR(spec)));
 4748|    897|    return SECSuccess;
 4749|       |
 4750|      0|loser:
 4751|      0|    ssl_CipherSpecRelease(spec);
 4752|      0|    return SECFailure;
 4753|    897|}
tls13con.c:tls13_SetupPendingCipherSpec:
 4578|    897|{
 4579|    897|    ssl3CipherSuite suite = ss->ssl3.hs.cipher_suite;
 4580|       |
 4581|    897|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    897|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.33k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 455, False: 442]
  |  |  |  |  |  Branch (208:7): [True: 442, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4582|    897|    PORT_Assert(spec->epoch);
  ------------------
  |  |  120|    897|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    897|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 897, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4583|       |
 4584|       |    /* Version isn't set when we send 0-RTT data. */
 4585|    897|    spec->version = PR_MAX(SSL_LIBRARY_VERSION_TLS_1_3, ss->version);
  ------------------
  |  |  159|    897|#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
  |  |  ------------------
  |  |  |  Branch (159:26): [True: 0, False: 897]
  |  |  ------------------
  ------------------
 4586|       |
 4587|    897|    ssl_SaveCipherSpec(ss, spec);
 4588|       |    /* We want to keep read cipher specs around longer because
 4589|       |     * there are cases where we might get either epoch N or
 4590|       |     * epoch N+1. */
 4591|    897|    if (IS_DTLS(ss) && spec->direction == ssl_secret_read) {
  ------------------
  |  |  892|  1.79k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 897, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (4591:24): [True: 846, False: 51]
  ------------------
 4592|    846|        ssl_CipherSpecAddRef(spec);
 4593|    846|    }
 4594|       |
 4595|    897|    SSL_TRC(3, ("%d: TLS13[%d]: Set Pending Cipher Suite to 0x%04x",
  ------------------
  |  |   71|    897|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 897]
  |  |  ------------------
  |  |   72|    897|    ssl_Trace b
  ------------------
 4596|    897|                SSL_GETPID(), ss->fd, suite));
 4597|       |
 4598|    897|    spec->cipherDef = ssl_GetBulkCipherDef(ssl_LookupCipherSuiteDef(suite));
 4599|       |
 4600|    897|    if (spec->epoch == TrafficKeyEarlyApplicationData) {
  ------------------
  |  Branch (4600:9): [True: 0, False: 897]
  ------------------
 4601|      0|        if (ss->xtnData.selectedPsk &&
  ------------------
  |  Branch (4601:13): [True: 0, False: 0]
  ------------------
 4602|      0|            ss->xtnData.selectedPsk->zeroRttSuite != TLS_NULL_WITH_NULL_NULL) {
  ------------------
  |  |   76|      0|#define TLS_NULL_WITH_NULL_NULL                 0x0000
  ------------------
  |  Branch (4602:13): [True: 0, False: 0]
  ------------------
 4603|      0|            spec->earlyDataRemaining = ss->xtnData.selectedPsk->maxEarlyData;
 4604|      0|        }
 4605|      0|    }
 4606|       |
 4607|    897|    tls13_SetSpecRecordVersion(ss, spec);
 4608|       |
 4609|       |    /* The record size limit is reduced by one so that the remainder of the
 4610|       |     * record handling code can use the same checks for all versions. */
 4611|    897|    if (ssl3_ExtensionNegotiated(ss, ssl_record_size_limit_xtn)) {
  ------------------
  |  Branch (4611:9): [True: 0, False: 897]
  ------------------
 4612|      0|        spec->recordSizeLimit = ((spec->direction == ssl_secret_read)
  ------------------
  |  Branch (4612:34): [True: 0, False: 0]
  ------------------
 4613|      0|                                     ? ss->opt.recordSizeLimit
 4614|      0|                                     : ss->xtnData.recordSizeLimit) -
 4615|      0|                                1;
 4616|    897|    } else {
 4617|    897|        spec->recordSizeLimit = MAX_FRAGMENT_LENGTH;
  ------------------
  |  |   35|    897|#define MAX_FRAGMENT_LENGTH 16384
  ------------------
 4618|    897|    }
 4619|    897|    return SECSuccess;
 4620|    897|}
tls13con.c:tls13_DeriveTrafficKeys:
 4472|    897|{
 4473|    897|    size_t keySize = spec->cipherDef->key_size;
 4474|    897|    size_t ivSize = spec->cipherDef->iv_size +
 4475|    897|                    spec->cipherDef->explicit_nonce_size; /* This isn't always going to
 4476|       |                                                           * work, but it does for
 4477|       |                                                           * AES-GCM */
 4478|    897|    CK_MECHANISM_TYPE bulkAlgorithm = ssl3_Alg2Mech(spec->cipherDef->calg);
 4479|    897|    PK11SymKey **prkp = NULL;
 4480|    897|    PK11SymKey *prk = NULL;
 4481|    897|    PRBool clientSecret;
 4482|    897|    SECStatus rv;
 4483|       |    /* These labels are just used for debugging. */
 4484|    897|    static const char kHkdfPhaseEarlyApplicationDataKeys[] = "early application data";
 4485|    897|    static const char kHkdfPhaseHandshakeKeys[] = "handshake data";
 4486|    897|    static const char kHkdfPhaseApplicationDataKeys[] = "application data";
 4487|       |
 4488|    897|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|    897|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.33k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 455, False: 442]
  |  |  |  |  |  Branch (208:7): [True: 442, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4489|       |
 4490|    897|    clientSecret = !tls13_UseServerSecret(ss, spec->direction);
 4491|    897|    switch (type) {
 4492|      0|        case TrafficKeyEarlyApplicationData:
  ------------------
  |  Branch (4492:9): [True: 0, False: 897]
  ------------------
 4493|      0|            PORT_Assert(clientSecret);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4494|      0|            prkp = &ss->ssl3.hs.clientEarlyTrafficSecret;
 4495|      0|            spec->phase = kHkdfPhaseEarlyApplicationDataKeys;
 4496|      0|            break;
 4497|    897|        case TrafficKeyHandshake:
  ------------------
  |  Branch (4497:9): [True: 897, False: 0]
  ------------------
 4498|    897|            prkp = clientSecret ? &ss->ssl3.hs.clientHsTrafficSecret
  ------------------
  |  Branch (4498:20): [True: 51, False: 846]
  ------------------
 4499|    897|                                : &ss->ssl3.hs.serverHsTrafficSecret;
 4500|    897|            spec->phase = kHkdfPhaseHandshakeKeys;
 4501|    897|            break;
 4502|      0|        case TrafficKeyApplicationData:
  ------------------
  |  Branch (4502:9): [True: 0, False: 897]
  ------------------
 4503|      0|            prkp = clientSecret ? &ss->ssl3.hs.clientTrafficSecret
  ------------------
  |  Branch (4503:20): [True: 0, False: 0]
  ------------------
 4504|      0|                                : &ss->ssl3.hs.serverTrafficSecret;
 4505|      0|            spec->phase = kHkdfPhaseApplicationDataKeys;
 4506|      0|            break;
 4507|      0|        default:
  ------------------
  |  Branch (4507:9): [True: 0, False: 897]
  ------------------
 4508|      0|            LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4509|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4510|      0|            return SECFailure;
 4511|    897|    }
 4512|    897|    PORT_Assert(prkp != NULL);
  ------------------
  |  |  120|    897|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    897|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 897, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4513|    897|    prk = *prkp;
 4514|       |
 4515|    897|    SSL_TRC(3, ("%d: TLS13[%d]: deriving %s traffic keys epoch=%d (%s)",
  ------------------
  |  |   71|    897|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 897]
  |  |  ------------------
  |  |   72|    897|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4516|    897|                SSL_GETPID(), ss->fd, SPEC_DIR(spec),
 4517|    897|                spec->epoch, spec->phase));
 4518|       |
 4519|    897|    rv = tls13_HkdfExpandLabel(prk, tls13_GetHash(ss),
 4520|    897|                               NULL, 0,
 4521|    897|                               kHkdfPurposeKey, strlen(kHkdfPurposeKey),
 4522|    897|                               bulkAlgorithm, keySize,
 4523|    897|                               ss->protocolVariant,
 4524|    897|                               &spec->keyMaterial.key);
 4525|    897|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4525:9): [True: 0, False: 897]
  ------------------
 4526|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4527|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4528|      0|        goto loser;
 4529|      0|    }
 4530|       |
 4531|    897|    if (IS_DTLS(ss) && spec->epoch > 0) {
  ------------------
  |  |  892|  1.79k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 897, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (4531:24): [True: 897, False: 0]
  ------------------
 4532|    897|        rv = ssl_CreateMaskingContextInner(spec->version, ss->ssl3.hs.cipher_suite,
 4533|    897|                                           ss->protocolVariant, prk, kHkdfPurposeSn,
 4534|    897|                                           strlen(kHkdfPurposeSn), &spec->maskContext);
 4535|    897|        if (rv != SECSuccess) {
  ------------------
  |  Branch (4535:13): [True: 0, False: 897]
  ------------------
 4536|      0|            LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4537|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4538|      0|            goto loser;
 4539|      0|        }
 4540|    897|    }
 4541|       |
 4542|    897|    rv = tls13_HkdfExpandLabelRaw(prk, tls13_GetHash(ss),
 4543|    897|                                  NULL, 0,
 4544|    897|                                  kHkdfPurposeIv, strlen(kHkdfPurposeIv),
 4545|    897|                                  ss->protocolVariant,
 4546|    897|                                  spec->keyMaterial.iv, ivSize);
 4547|    897|    if (rv != SECSuccess) {
  ------------------
  |  Branch (4547:9): [True: 0, False: 897]
  ------------------
 4548|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 4549|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4550|      0|        goto loser;
 4551|      0|    }
 4552|       |
 4553|    897|    if (deleteSecret) {
  ------------------
  |  Branch (4553:9): [True: 0, False: 897]
  ------------------
 4554|      0|        PK11_FreeSymKey(prk);
 4555|      0|        *prkp = NULL;
 4556|      0|    }
 4557|    897|    return SECSuccess;
 4558|       |
 4559|      0|loser:
 4560|      0|    return SECFailure;
 4561|    897|}
tls13con.c:tls13_InitPendingContext:
 4628|    897|{
 4629|    897|    CK_MECHANISM_TYPE encMechanism;
 4630|    897|    CK_ATTRIBUTE_TYPE encMode;
 4631|    897|    SECItem iv;
 4632|    897|    SSLCipherAlgorithm calg;
 4633|       |
 4634|    897|    calg = spec->cipherDef->calg;
 4635|       |
 4636|    897|    encMechanism = ssl3_Alg2Mech(calg);
 4637|    897|    encMode = CKA_NSS_MESSAGE | ((spec->direction == ssl_secret_write) ? CKA_ENCRYPT : CKA_DECRYPT);
  ------------------
  |  |   69|    897|#define CKA_NSS_MESSAGE 0x82000000L
  ------------------
                  encMode = CKA_NSS_MESSAGE | ((spec->direction == ssl_secret_write) ? CKA_ENCRYPT : CKA_DECRYPT);
  ------------------
  |  |  547|     51|#define CKA_ENCRYPT 0x00000104UL
  ------------------
                  encMode = CKA_NSS_MESSAGE | ((spec->direction == ssl_secret_write) ? CKA_ENCRYPT : CKA_DECRYPT);
  ------------------
  |  |  548|    846|#define CKA_DECRYPT 0x00000105UL
  ------------------
  |  Branch (4637:34): [True: 51, False: 846]
  ------------------
 4638|    897|    iv.data = NULL;
 4639|    897|    iv.len = 0;
 4640|       |
 4641|       |    /*
 4642|       |     * build the context
 4643|       |     */
 4644|    897|    spec->cipherContext = PK11_CreateContextBySymKey(encMechanism, encMode,
 4645|    897|                                                     spec->keyMaterial.key,
 4646|    897|                                                     &iv);
 4647|    897|    if (!spec->cipherContext) {
  ------------------
  |  Branch (4647:9): [True: 0, False: 897]
  ------------------
 4648|      0|        ssl_MapLowLevelError(SSL_ERROR_SYM_KEY_CONTEXT_FAILURE);
 4649|      0|        return SECFailure;
 4650|      0|    }
 4651|    897|    return SECSuccess;
 4652|    897|}
tls13con.c:tls13_HandleEncryptedExtensions:
 5019|     14|{
 5020|     14|    SECStatus rv;
 5021|     14|    PRUint32 innerLength;
 5022|     14|    SECItem oldAlpn = { siBuffer, NULL, 0 };
 5023|       |
 5024|     14|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|     14|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     21|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 7, False: 7]
  |  |  |  |  |  Branch (208:7): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5025|     14|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|     14|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     21|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 7, False: 7]
  |  |  |  |  |  Branch (208:7): [True: 7, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5026|       |
 5027|     14|    SSL_TRC(3, ("%d: TLS13[%d]: handle encrypted extensions",
  ------------------
  |  |   71|     14|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 14]
  |  |  ------------------
  |  |   72|     14|    ssl_Trace b
  ------------------
 5028|     14|                SSL_GETPID(), ss->fd));
 5029|       |
 5030|     14|    rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_ENCRYPTED_EXTENSIONS,
  ------------------
  |  |  182|     14|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|     14|                       __VA_ARGS__,                                 \
  |  |  184|     14|                       wait_invalid)
  ------------------
 5031|     14|                              wait_encrypted_extensions);
 5032|     14|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5032:9): [True: 1, False: 13]
  ------------------
 5033|      1|        return SECFailure;
 5034|      1|    }
 5035|       |
 5036|     13|    rv = ssl3_ConsumeHandshakeNumber(ss, &innerLength, 2, &b, &length);
 5037|     13|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5037:9): [True: 1, False: 12]
  ------------------
 5038|      1|        return SECFailure; /* Alert already sent. */
 5039|      1|    }
 5040|     12|    if (innerLength != length) {
  ------------------
  |  Branch (5040:9): [True: 11, False: 1]
  ------------------
 5041|     11|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_ENCRYPTED_EXTENSIONS,
  ------------------
  |  |   22|     11|    do {                                     \
  |  |   23|     11|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|     11|    do {                                                                           \
  |  |  |  |   15|     11|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|     11|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|     11|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|     11|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|     11|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|     11|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|     11|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|     11|        tls13_FatalError(ss, prError, desc); \
  |  |   25|     11|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5042|     11|                    illegal_parameter);
 5043|     11|        return SECFailure;
 5044|     11|    }
 5045|       |
 5046|       |    /* If we are doing 0-RTT, then we already have an ALPN value. Stash
 5047|       |     * it for comparison. */
 5048|      1|    if (ss->ssl3.hs.zeroRttState == ssl_0rtt_sent &&
  ------------------
  |  Branch (5048:9): [True: 0, False: 1]
  ------------------
 5049|      1|        ss->xtnData.nextProtoState == SSL_NEXT_PROTO_EARLY_VALUE) {
  ------------------
  |  Branch (5049:9): [True: 0, False: 0]
  ------------------
 5050|      0|        oldAlpn = ss->xtnData.nextProto;
 5051|      0|        ss->xtnData.nextProto.data = NULL;
 5052|      0|        ss->xtnData.nextProtoState = SSL_NEXT_PROTO_NO_SUPPORT;
 5053|      0|    }
 5054|       |
 5055|      1|    rv = ssl3_ParseExtensions(ss, &b, &length);
 5056|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5056:9): [True: 1, False: 0]
  ------------------
 5057|      1|        return SECFailure; /* Error code set below */
 5058|      1|    }
 5059|       |
 5060|       |    /* Handle the rest of the extensions. */
 5061|      0|    rv = ssl3_HandleParsedExtensions(ss, ssl_hs_encrypted_extensions);
 5062|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5062:9): [True: 0, False: 0]
  ------------------
 5063|      0|        return SECFailure; /* Error code set below */
 5064|      0|    }
 5065|       |
 5066|       |    /* We can only get here if we offered 0-RTT. */
 5067|      0|    if (ssl3_ExtensionNegotiated(ss, ssl_tls13_early_data_xtn)) {
  ------------------
  |  Branch (5067:9): [True: 0, False: 0]
  ------------------
 5068|      0|        PORT_Assert(ss->ssl3.hs.zeroRttState == ssl_0rtt_sent);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5069|      0|        if (!ss->xtnData.selectedPsk) {
  ------------------
  |  Branch (5069:13): [True: 0, False: 0]
  ------------------
 5070|       |            /* Illegal to accept 0-RTT without also accepting PSK. */
 5071|      0|            FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_ENCRYPTED_EXTENSIONS,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5072|      0|                        illegal_parameter);
 5073|      0|        }
 5074|      0|        ss->ssl3.hs.zeroRttState = ssl_0rtt_accepted;
 5075|       |
 5076|       |        /* Check that the server negotiated the same ALPN (if any). */
 5077|      0|        if (SECITEM_CompareItem(&oldAlpn, &ss->xtnData.nextProto)) {
  ------------------
  |  |  105|      0|#define SECITEM_CompareItem SECITEM_CompareItem_Util
  ------------------
  |  Branch (5077:13): [True: 0, False: 0]
  ------------------
 5078|      0|            SECITEM_FreeItem(&oldAlpn, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                          SECITEM_FreeItem(&oldAlpn, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5079|      0|            FATAL_ERROR(ss, SSL_ERROR_NEXT_PROTOCOL_DATA_INVALID,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5080|      0|                        illegal_parameter);
 5081|      0|            return SECFailure;
 5082|      0|        }
 5083|       |        /* Check that the server negotiated the same cipher suite. */
 5084|      0|        if (ss->ssl3.hs.cipher_suite != ss->ssl3.hs.zeroRttSuite) {
  ------------------
  |  Branch (5084:13): [True: 0, False: 0]
  ------------------
 5085|      0|            FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_ENCRYPTED_EXTENSIONS,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5086|      0|                        illegal_parameter);
 5087|      0|            return SECFailure;
 5088|      0|        }
 5089|      0|    } else if (ss->ssl3.hs.zeroRttState == ssl_0rtt_sent) {
  ------------------
  |  Branch (5089:16): [True: 0, False: 0]
  ------------------
 5090|       |        /* Though we sent 0-RTT, the early_data extension wasn't present so the
 5091|       |         * state is unmodified; the server must have rejected 0-RTT. */
 5092|      0|        ss->ssl3.hs.zeroRttState = ssl_0rtt_ignored;
 5093|      0|        ss->ssl3.hs.zeroRttIgnore = ssl_0rtt_ignore_trial;
 5094|      0|    } else {
 5095|      0|        PORT_Assert(ss->ssl3.hs.zeroRttState == ssl_0rtt_none ||
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5096|      0|                    (ss->ssl3.hs.helloRetry &&
 5097|      0|                     ss->ssl3.hs.zeroRttState == ssl_0rtt_ignored));
 5098|      0|    }
 5099|       |
 5100|      0|    SECITEM_FreeItem(&oldAlpn, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&oldAlpn, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5101|      0|    if (ss->ssl3.hs.kea_def->authKeyType == ssl_auth_psk) {
  ------------------
  |  Branch (5101:9): [True: 0, False: 0]
  ------------------
 5102|      0|        TLS13_SET_HS_STATE(ss, wait_finished);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
 5103|      0|    } else {
 5104|      0|        TLS13_SET_HS_STATE(ss, wait_cert_request);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
 5105|      0|    }
 5106|       |
 5107|       |    /* Client is done with any PSKs */
 5108|      0|    tls13_DestroyPskList(&ss->ssl3.hs.psks);
 5109|      0|    ss->xtnData.selectedPsk = NULL;
 5110|       |
 5111|      0|    return SECSuccess;
 5112|      0|}
tls13con.c:tls13_HandleCertificateVerify:
 5237|      2|{
 5238|      2|    sslDelegatedCredential *dc = ss->xtnData.peerDelegCred;
 5239|      2|    CERTSubjectPublicKeyInfo *spki;
 5240|      2|    SECKEYPublicKey *pubKey = NULL;
 5241|      2|    SECItem signed_hash = { siBuffer, NULL, 0 };
 5242|      2|    SECStatus rv;
 5243|      2|    SSLSignatureScheme sigScheme;
 5244|      2|    SSLHashType hashAlg;
 5245|      2|    SSL3Hashes tbsHash;
 5246|      2|    SSL3Hashes hashes;
 5247|       |
 5248|      2|    SSL_TRC(3, ("%d: TLS13[%d]: handle certificate_verify handshake",
  ------------------
  |  |   71|      2|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   72|      2|    ssl_Trace b
  ------------------
 5249|      2|                SSL_GETPID(), ss->fd));
 5250|      2|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      3|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5251|      2|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      3|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5252|       |
 5253|      2|    rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_CERT_VERIFY,
  ------------------
  |  |  182|      2|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      2|                       __VA_ARGS__,                                 \
  |  |  184|      2|                       wait_invalid)
  ------------------
 5254|      2|                              wait_cert_verify);
 5255|      2|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5255:9): [True: 2, False: 0]
  ------------------
 5256|      2|        return SECFailure;
 5257|      2|    }
 5258|       |
 5259|      0|    rv = tls13_ComputeHandshakeHashes(ss, &hashes);
 5260|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5260:9): [True: 0, False: 0]
  ------------------
 5261|      0|        return SECFailure;
 5262|      0|    }
 5263|       |
 5264|      0|    if (ss->firstHsDone) {
  ------------------
  |  Branch (5264:9): [True: 0, False: 0]
  ------------------
 5265|      0|        rv = ssl_HashPostHandshakeMessage(ss, ssl_hs_certificate_verify, b, length);
 5266|      0|    } else {
 5267|      0|        rv = ssl_HashHandshakeMessage(ss, ssl_hs_certificate_verify, b, length);
 5268|      0|    }
 5269|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5269:9): [True: 0, False: 0]
  ------------------
 5270|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5271|      0|        return SECFailure;
 5272|      0|    }
 5273|       |
 5274|      0|    rv = ssl_ConsumeSignatureScheme(ss, &b, &length, &sigScheme);
 5275|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5275:9): [True: 0, False: 0]
  ------------------
 5276|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERT_VERIFY, illegal_parameter);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5277|      0|        return SECFailure;
 5278|      0|    }
 5279|       |
 5280|       |    /* Set the |spki| used to verify the handshake. When verifying with a
 5281|       |     * delegated credential (DC), this corresponds to the DC public key;
 5282|       |     * otherwise it correspond to the public key of the peer's end-entity
 5283|       |     * certificate.
 5284|       |     */
 5285|      0|    if (tls13_IsVerifyingWithDelegatedCredential(ss)) {
  ------------------
  |  Branch (5285:9): [True: 0, False: 0]
  ------------------
 5286|       |        /* DelegatedCredential.cred.expected_cert_verify_algorithm is expected
 5287|       |         * to match CertificateVerify.scheme.
 5288|       |         * DelegatedCredential.cred.expected_cert_verify_algorithm must also be
 5289|       |         * the same as was reported in ssl3_AuthCertificate.
 5290|       |         */
 5291|      0|        if (sigScheme != dc->expectedCertVerifyAlg || sigScheme != ss->sec.signatureScheme) {
  ------------------
  |  Branch (5291:13): [True: 0, False: 0]
  |  Branch (5291:55): [True: 0, False: 0]
  ------------------
 5292|      0|            FATAL_ERROR(ss, SSL_ERROR_DC_CERT_VERIFY_ALG_MISMATCH, illegal_parameter);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5293|      0|            return SECFailure;
 5294|      0|        }
 5295|       |
 5296|       |        /* Verify the DC has three steps: (1) use the peer's end-entity
 5297|       |         * certificate to verify DelegatedCredential.signature, (2) check that
 5298|       |         * the certificate has the correct key usage, and (3) check that the DC
 5299|       |         * hasn't expired.
 5300|       |         */
 5301|      0|        rv = tls13_VerifyDelegatedCredential(ss, dc);
 5302|      0|        if (rv != SECSuccess) { /* Calls FATAL_ERROR() */
  ------------------
  |  Branch (5302:13): [True: 0, False: 0]
  ------------------
 5303|      0|            return SECFailure;
 5304|      0|        }
 5305|       |
 5306|      0|        SSL_TRC(3, ("%d: TLS13[%d]: Verifying with delegated credential",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 5307|      0|                    SSL_GETPID(), ss->fd));
 5308|      0|        spki = dc->spki;
 5309|      0|    } else {
 5310|      0|        spki = &ss->sec.peerCert->subjectPublicKeyInfo;
 5311|      0|    }
 5312|       |
 5313|      0|    rv = ssl_CheckSignatureSchemeConsistency(ss, sigScheme, spki);
 5314|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5314:9): [True: 0, False: 0]
  ------------------
 5315|       |        /* Error set already */
 5316|      0|        FATAL_ERROR(ss, PORT_GetError(), illegal_parameter);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5317|      0|        return SECFailure;
 5318|      0|    }
 5319|      0|    hashAlg = ssl_SignatureSchemeToHashType(sigScheme);
 5320|       |
 5321|      0|    rv = tls13_AddContextToHashes(ss, &hashes, hashAlg, PR_FALSE, &tbsHash);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 5322|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5322:9): [True: 0, False: 0]
  ------------------
 5323|      0|        FATAL_ERROR(ss, SSL_ERROR_DIGEST_FAILURE, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5324|      0|        return SECFailure;
 5325|      0|    }
 5326|       |
 5327|      0|    rv = ssl3_ConsumeHandshakeVariable(ss, &signed_hash, 2, &b, &length);
 5328|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5328:9): [True: 0, False: 0]
  ------------------
 5329|      0|        PORT_SetError(SSL_ERROR_RX_MALFORMED_CERT_VERIFY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5330|      0|        return SECFailure;
 5331|      0|    }
 5332|       |
 5333|      0|    if (length != 0) {
  ------------------
  |  Branch (5333:9): [True: 0, False: 0]
  ------------------
 5334|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_CERT_VERIFY, decode_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5335|      0|        return SECFailure;
 5336|      0|    }
 5337|       |
 5338|      0|    pubKey = SECKEY_ExtractPublicKey(spki);
 5339|      0|    if (pubKey == NULL) {
  ------------------
  |  Branch (5339:9): [True: 0, False: 0]
  ------------------
 5340|      0|        ssl_MapLowLevelError(SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE);
 5341|      0|        return SECFailure;
 5342|      0|    }
 5343|       |
 5344|      0|    rv = ssl_VerifySignedHashesWithPubKey(ss, pubKey, sigScheme,
 5345|      0|                                          &tbsHash, &signed_hash);
 5346|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5346:9): [True: 0, False: 0]
  ------------------
 5347|      0|        FATAL_ERROR(ss, PORT_GetError(), decrypt_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5348|      0|        goto loser;
 5349|      0|    }
 5350|       |
 5351|       |    /* Set the auth type and verify it is what we captured in ssl3_AuthCertificate */
 5352|      0|    if (!ss->sec.isServer) {
  ------------------
  |  Branch (5352:9): [True: 0, False: 0]
  ------------------
 5353|      0|        ss->sec.authType = ssl_SignatureSchemeToAuthType(sigScheme);
 5354|       |
 5355|      0|        uint32_t prelimAuthKeyBits = ss->sec.authKeyBits;
 5356|      0|        rv = ssl_SetAuthKeyBits(ss, pubKey);
 5357|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5357:13): [True: 0, False: 0]
  ------------------
 5358|      0|            goto loser; /* Alert sent and code set. */
 5359|      0|        }
 5360|       |
 5361|      0|        if (prelimAuthKeyBits != ss->sec.authKeyBits) {
  ------------------
  |  Branch (5361:13): [True: 0, False: 0]
  ------------------
 5362|      0|            FATAL_ERROR(ss, SSL_ERROR_DC_CERT_VERIFY_ALG_MISMATCH, illegal_parameter);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5363|      0|            goto loser;
 5364|      0|        }
 5365|      0|    }
 5366|       |
 5367|       |    /* Request a client certificate now if one was requested. */
 5368|      0|    if (ss->ssl3.hs.clientCertRequested) {
  ------------------
  |  Branch (5368:9): [True: 0, False: 0]
  ------------------
 5369|      0|        PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5370|      0|        rv = ssl3_BeginHandleCertificateRequest(
 5371|      0|            ss, ss->xtnData.sigSchemes, ss->xtnData.numSigSchemes,
 5372|      0|            &ss->xtnData.certReqAuthorities);
 5373|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5373:13): [True: 0, False: 0]
  ------------------
 5374|      0|            FATAL_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5375|      0|            goto loser;
 5376|      0|        }
 5377|      0|    }
 5378|       |
 5379|      0|    SECKEY_DestroyPublicKey(pubKey);
 5380|      0|    TLS13_SET_HS_STATE(ss, wait_finished);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
 5381|      0|    return SECSuccess;
 5382|       |
 5383|      0|loser:
 5384|      0|    SECKEY_DestroyPublicKey(pubKey);
 5385|      0|    return SECFailure;
 5386|      0|}
tls13con.c:tls13_ComputePskBinderHash:
 5394|  4.46k|{
 5395|  4.46k|    SECStatus rv;
 5396|  4.46k|    PK11Context *ctx = NULL;
 5397|  4.46k|    sslBuffer *clientResidual = NULL;
 5398|  4.46k|    if (!ss->sec.isServer) {
  ------------------
  |  Branch (5398:9): [True: 4.46k, False: 0]
  ------------------
 5399|       |        /* On the server, HRR residual is already buffered. */
 5400|  4.46k|        clientResidual = ss->ssl3.hs.echHpkeCtx ? &ss->ssl3.hs.echInnerMessages : &ss->ssl3.hs.messages;
  ------------------
  |  Branch (5400:26): [True: 0, False: 4.46k]
  ------------------
 5401|  4.46k|    }
 5402|  4.46k|    PORT_Assert(ss->ssl3.hs.hashType == handshake_hash_unknown);
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5403|  4.46k|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  6.74k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 2.18k, False: 2.27k]
  |  |  |  |  |  Branch (208:7): [True: 2.27k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5404|       |
 5405|  4.46k|    PRINT_BUF(10, (NULL, "Binder computed over ClientHello",
  ------------------
  |  |   74|  4.46k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 4.46k]
  |  |  ------------------
  |  |   75|  4.46k|    ssl_PrintBuf b
  ------------------
 5406|  4.46k|                   b, length));
 5407|       |
 5408|  4.46k|    ctx = PK11_CreateDigestContext(ssl3_HashTypeToOID(hashType));
 5409|  4.46k|    if (!ctx) {
  ------------------
  |  Branch (5409:9): [True: 0, False: 4.46k]
  ------------------
 5410|      0|        goto loser;
 5411|      0|    }
 5412|  4.46k|    rv = PK11_DigestBegin(ctx);
 5413|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5413:9): [True: 0, False: 4.46k]
  ------------------
 5414|      0|        ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 5415|      0|        goto loser;
 5416|      0|    }
 5417|       |
 5418|  4.46k|    if (clientResidual && clientResidual->len) {
  ------------------
  |  Branch (5418:9): [True: 4.46k, False: 0]
  |  Branch (5418:27): [True: 310, False: 4.15k]
  ------------------
 5419|    310|        PRINT_BUF(10, (NULL, " with HRR prefix", clientResidual->buf,
  ------------------
  |  |   74|    310|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 310]
  |  |  ------------------
  |  |   75|    310|    ssl_PrintBuf b
  ------------------
 5420|    310|                       clientResidual->len));
 5421|    310|        rv = PK11_DigestOp(ctx, clientResidual->buf, clientResidual->len);
 5422|    310|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5422:13): [True: 0, False: 310]
  ------------------
 5423|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 5424|      0|            goto loser;
 5425|      0|        }
 5426|    310|    }
 5427|       |
 5428|  4.46k|    if (IS_DTLS(ss) && !ss->sec.isServer) {
  ------------------
  |  |  892|  8.93k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 4.46k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5428:24): [True: 4.46k, False: 0]
  ------------------
 5429|       |        /* Removing the unnecessary header fields.
 5430|       |         * See ssl3_AppendHandshakeHeader.*/
 5431|  4.46k|        PORT_Assert(length >= 12);
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5432|  4.46k|        rv = PK11_DigestOp(ctx, b, 4);
 5433|  4.46k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (5433:13): [True: 0, False: 4.46k]
  ------------------
 5434|      0|            ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 5435|      0|            goto loser;
 5436|      0|        }
 5437|  4.46k|        rv = PK11_DigestOp(ctx, b + 12, length - 12);
 5438|  4.46k|    } else {
 5439|      0|        rv = PK11_DigestOp(ctx, b, length);
 5440|      0|    }
 5441|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5441:9): [True: 0, False: 4.46k]
  ------------------
 5442|      0|        ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 5443|      0|        goto loser;
 5444|      0|    }
 5445|  4.46k|    rv = PK11_DigestFinal(ctx, hashes->u.raw, &hashes->len, sizeof(hashes->u.raw));
 5446|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5446:9): [True: 0, False: 4.46k]
  ------------------
 5447|      0|        ssl_MapLowLevelError(SSL_ERROR_SHA_DIGEST_FAILURE);
 5448|      0|        goto loser;
 5449|      0|    }
 5450|       |
 5451|  4.46k|    PK11_DestroyContext(ctx, PR_TRUE);
  ------------------
  |  |  437|  4.46k|#define PR_TRUE 1
  ------------------
 5452|  4.46k|    PRINT_BUF(10, (NULL, "PSK Binder hash", hashes->u.raw, hashes->len));
  ------------------
  |  |   74|  4.46k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 4.46k]
  |  |  ------------------
  |  |   75|  4.46k|    ssl_PrintBuf b
  ------------------
 5453|  4.46k|    return SECSuccess;
 5454|       |
 5455|      0|loser:
 5456|      0|    if (ctx) {
  ------------------
  |  Branch (5456:9): [True: 0, False: 0]
  ------------------
 5457|      0|        PK11_DestroyContext(ctx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5458|      0|    }
 5459|      0|    return SECFailure;
 5460|  4.46k|}
tls13con.c:tls13_ComputeFinished:
 5531|  4.46k|{
 5532|  4.46k|    SECStatus rv;
 5533|  4.46k|    PK11Context *hmacCtx = NULL;
 5534|  4.46k|    CK_MECHANISM_TYPE macAlg = tls13_GetHmacMechanismFromHash(hashType);
 5535|  4.46k|    SECItem param = { siBuffer, NULL, 0 };
 5536|  4.46k|    unsigned int outputLenUint;
 5537|  4.46k|    const char *label = kHkdfLabelFinishedSecret;
 5538|  4.46k|    PK11SymKey *secret = NULL;
 5539|       |
 5540|  4.46k|    PORT_Assert(baseKey);
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5541|  4.46k|    SSL_TRC(3, ("%d: TLS13[%d]: %s calculate finished",
  ------------------
  |  |   71|  4.46k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 4.46k]
  |  |  ------------------
  |  |   72|  4.46k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5542|  4.46k|                SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
 5543|  4.46k|    PRINT_BUF(50, (ss, "Handshake hash", hashes->u.raw, hashes->len));
  ------------------
  |  |   74|  4.46k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 4.46k]
  |  |  ------------------
  |  |   75|  4.46k|    ssl_PrintBuf b
  ------------------
 5544|       |
 5545|       |    /* Now derive the appropriate finished secret from the base secret. */
 5546|  4.46k|    rv = tls13_HkdfExpandLabel(baseKey, hashType,
 5547|  4.46k|                               NULL, 0, label, strlen(label),
 5548|  4.46k|                               tls13_GetHmacMechanismFromHash(hashType),
 5549|  4.46k|                               tls13_GetHashSizeForHash(hashType),
 5550|  4.46k|                               ss->protocolVariant, &secret);
 5551|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5551:9): [True: 0, False: 4.46k]
  ------------------
 5552|      0|        goto abort;
 5553|      0|    }
 5554|       |
 5555|  4.46k|    PORT_Assert(hashes->len == tls13_GetHashSizeForHash(hashType));
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5556|  4.46k|    hmacCtx = PK11_CreateContextBySymKey(macAlg, CKA_SIGN,
  ------------------
  |  |  551|  4.46k|#define CKA_SIGN 0x00000108UL
  ------------------
 5557|  4.46k|                                         secret, &param);
 5558|  4.46k|    if (!hmacCtx) {
  ------------------
  |  Branch (5558:9): [True: 0, False: 4.46k]
  ------------------
 5559|      0|        goto abort;
 5560|      0|    }
 5561|       |
 5562|  4.46k|    rv = PK11_DigestBegin(hmacCtx);
 5563|  4.46k|    if (rv != SECSuccess)
  ------------------
  |  Branch (5563:9): [True: 0, False: 4.46k]
  ------------------
 5564|      0|        goto abort;
 5565|       |
 5566|  4.46k|    rv = PK11_DigestOp(hmacCtx, hashes->u.raw, hashes->len);
 5567|  4.46k|    if (rv != SECSuccess)
  ------------------
  |  Branch (5567:9): [True: 0, False: 4.46k]
  ------------------
 5568|      0|        goto abort;
 5569|       |
 5570|  4.46k|    PORT_Assert(maxOutputLen >= tls13_GetHashSizeForHash(hashType));
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5571|  4.46k|    rv = PK11_DigestFinal(hmacCtx, output, &outputLenUint, maxOutputLen);
 5572|  4.46k|    if (rv != SECSuccess)
  ------------------
  |  Branch (5572:9): [True: 0, False: 4.46k]
  ------------------
 5573|      0|        goto abort;
 5574|  4.46k|    *outputLen = outputLenUint;
 5575|       |
 5576|  4.46k|    PK11_FreeSymKey(secret);
 5577|  4.46k|    PK11_DestroyContext(hmacCtx, PR_TRUE);
  ------------------
  |  |  437|  4.46k|#define PR_TRUE 1
  ------------------
 5578|  4.46k|    PRINT_BUF(50, (ss, "finished value", output, outputLenUint));
  ------------------
  |  |   74|  4.46k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 4.46k]
  |  |  ------------------
  |  |   75|  4.46k|    ssl_PrintBuf b
  ------------------
 5579|  4.46k|    return SECSuccess;
 5580|       |
 5581|      0|abort:
 5582|      0|    if (secret) {
  ------------------
  |  Branch (5582:9): [True: 0, False: 0]
  ------------------
 5583|      0|        PK11_FreeSymKey(secret);
 5584|      0|    }
 5585|       |
 5586|      0|    if (hmacCtx) {
  ------------------
  |  Branch (5586:9): [True: 0, False: 0]
  ------------------
 5587|      0|        PK11_DestroyContext(hmacCtx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5588|      0|    }
 5589|       |
 5590|      0|    PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5591|      0|    return SECFailure;
 5592|  4.46k|}
tls13con.c:tls13_ClientHandleFinished:
 5712|      2|{
 5713|      2|    SECStatus rv;
 5714|       |
 5715|      2|    PORT_Assert(ss->opt.noLocks || ssl_HaveRecvBufLock(ss));
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      3|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5716|      2|    PORT_Assert(ss->opt.noLocks || ssl_HaveSSL3HandshakeLock(ss));
  ------------------
  |  |  120|      2|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      3|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1, False: 1]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5717|       |
 5718|      2|    SSL_TRC(3, ("%d: TLS13[%d]: client handle finished handshake",
  ------------------
  |  |   71|      2|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 2]
  |  |  ------------------
  |  |   72|      2|    ssl_Trace b
  ------------------
 5719|      2|                SSL_GETPID(), ss->fd));
 5720|       |
 5721|      2|    rv = tls13_CommonHandleFinished(ss, ss->ssl3.hs.serverHsTrafficSecret,
 5722|      2|                                    b, length);
 5723|      2|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5723:9): [True: 2, False: 0]
  ------------------
 5724|      2|        return SECFailure;
 5725|      2|    }
 5726|       |
 5727|      0|    return tls13_SendClientSecondRound(ss);
 5728|      2|}
tls13con.c:tls13_CommonHandleFinished:
 5679|      2|{
 5680|      2|    SECStatus rv;
 5681|      2|    SSL3Hashes hashes;
 5682|       |
 5683|      2|    rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_FINISHED,
  ------------------
  |  |  182|      2|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      2|                       __VA_ARGS__,                                 \
  |  |  184|      2|                       wait_invalid)
  ------------------
 5684|      2|                              wait_finished);
 5685|      2|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5685:9): [True: 2, False: 0]
  ------------------
 5686|      2|        return SECFailure;
 5687|      2|    }
 5688|      0|    ss->ssl3.hs.endOfFlight = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 5689|       |
 5690|      0|    rv = tls13_ComputeHandshakeHashes(ss, &hashes);
 5691|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5691:9): [True: 0, False: 0]
  ------------------
 5692|      0|        LOG_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   14|      0|    do {                                                                           \
  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  ------------------
  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  ------------------
  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  ------------------
  |  |   18|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 5693|      0|        return SECFailure;
 5694|      0|    }
 5695|       |
 5696|      0|    if (ss->firstHsDone) {
  ------------------
  |  Branch (5696:9): [True: 0, False: 0]
  ------------------
 5697|      0|        rv = ssl_HashPostHandshakeMessage(ss, ssl_hs_finished, b, length);
 5698|      0|    } else {
 5699|      0|        rv = ssl_HashHandshakeMessage(ss, ssl_hs_finished, b, length);
 5700|      0|    }
 5701|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (5701:9): [True: 0, False: 0]
  ------------------
 5702|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 5703|      0|        return SECFailure;
 5704|      0|    }
 5705|       |
 5706|      0|    return tls13_VerifyFinished(ss, ssl_hs_finished,
 5707|      0|                                key, b, length, &hashes);
 5708|      0|}
tls13con.c:tls13_HandleNewSessionTicket:
 6249|      1|{
 6250|      1|    SECStatus rv;
 6251|      1|    PRUint32 utmp;
 6252|      1|    NewSessionTicket ticket = { 0 };
 6253|      1|    SECItem data;
 6254|      1|    SECItem ticket_nonce;
 6255|      1|    SECItem ticket_data;
 6256|       |
 6257|      1|    SSL_TRC(3, ("%d: TLS13[%d]: handle new session ticket message",
  ------------------
  |  |   71|      1|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1]
  |  |  ------------------
  |  |   72|      1|    ssl_Trace b
  ------------------
 6258|      1|                SSL_GETPID(), ss->fd));
 6259|       |
 6260|      1|    rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_NEW_SESSION_TICKET,
  ------------------
  |  |  182|      1|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      1|                       __VA_ARGS__,                                 \
  |  |  184|      1|                       wait_invalid)
  ------------------
 6261|      1|                              idle_handshake);
 6262|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6262:9): [True: 1, False: 0]
  ------------------
 6263|      1|        return SECFailure;
 6264|      1|    }
 6265|      0|    if (!tls13_IsPostHandshake(ss) || ss->sec.isServer) {
  ------------------
  |  Branch (6265:9): [True: 0, False: 0]
  |  Branch (6265:39): [True: 0, False: 0]
  ------------------
 6266|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_UNEXPECTED_NEW_SESSION_TICKET,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6267|      0|                    unexpected_message);
 6268|      0|        return SECFailure;
 6269|      0|    }
 6270|       |
 6271|      0|    ticket.received_timestamp = ssl_Time(ss);
 6272|      0|    rv = ssl3_ConsumeHandshakeNumber(ss, &ticket.ticket_lifetime_hint, 4, &b,
 6273|      0|                                     &length);
 6274|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6274:9): [True: 0, False: 0]
  ------------------
 6275|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6276|      0|                    decode_error);
 6277|      0|        return SECFailure;
 6278|      0|    }
 6279|      0|    ticket.ticket.type = siBuffer;
 6280|       |
 6281|      0|    rv = ssl3_ConsumeHandshake(ss, &utmp, sizeof(utmp),
 6282|      0|                               &b, &length);
 6283|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6283:9): [True: 0, False: 0]
  ------------------
 6284|      0|        PORT_SetError(SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 6285|      0|        return SECFailure;
 6286|      0|    }
 6287|      0|    ticket.ticket_age_add = PR_ntohl(utmp);
 6288|       |
 6289|       |    /* The nonce. */
 6290|      0|    rv = ssl3_ConsumeHandshakeVariable(ss, &ticket_nonce, 1, &b, &length);
 6291|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6291:9): [True: 0, False: 0]
  ------------------
 6292|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6293|      0|                    decode_error);
 6294|      0|        return SECFailure;
 6295|      0|    }
 6296|       |
 6297|       |    /* Get the ticket value. */
 6298|      0|    rv = ssl3_ConsumeHandshakeVariable(ss, &ticket_data, 2, &b, &length);
 6299|      0|    if (rv != SECSuccess || !ticket_data.len) {
  ------------------
  |  Branch (6299:9): [True: 0, False: 0]
  |  Branch (6299:29): [True: 0, False: 0]
  ------------------
 6300|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6301|      0|                    decode_error);
 6302|      0|        return SECFailure;
 6303|      0|    }
 6304|       |
 6305|       |    /* Parse extensions. */
 6306|      0|    rv = ssl3_ConsumeHandshakeVariable(ss, &data, 2, &b, &length);
 6307|      0|    if (rv != SECSuccess || length) {
  ------------------
  |  Branch (6307:9): [True: 0, False: 0]
  |  Branch (6307:29): [True: 0, False: 0]
  ------------------
 6308|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6309|      0|                    decode_error);
 6310|      0|        return SECFailure;
 6311|      0|    }
 6312|       |
 6313|      0|    rv = ssl3_HandleExtensions(ss, &data.data,
 6314|      0|                               &data.len, ssl_hs_new_session_ticket);
 6315|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (6315:9): [True: 0, False: 0]
  ------------------
 6316|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_NEW_SESSION_TICKET,
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6317|      0|                    decode_error);
 6318|      0|        return SECFailure;
 6319|      0|    }
 6320|      0|    if (ss->xtnData.max_early_data_size) {
  ------------------
  |  Branch (6320:9): [True: 0, False: 0]
  ------------------
 6321|      0|        ticket.flags |= ticket_allow_early_data;
 6322|      0|        ticket.max_early_data_size = ss->xtnData.max_early_data_size;
 6323|      0|    }
 6324|       |
 6325|      0|    if (!ss->opt.noCache) {
  ------------------
  |  Branch (6325:9): [True: 0, False: 0]
  ------------------
 6326|      0|        PK11SymKey *secret;
 6327|       |
 6328|      0|        PORT_Assert(ss->sec.ci.sid);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6329|      0|        rv = SECITEM_CopyItem(NULL, &ticket.ticket, &ticket_data);
  ------------------
  |  |  106|      0|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
 6330|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (6330:13): [True: 0, False: 0]
  ------------------
 6331|      0|            FATAL_ERROR(ss, SEC_ERROR_NO_MEMORY, internal_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 6332|      0|            return SECFailure;
 6333|      0|        }
 6334|      0|        PRINT_BUF(50, (ss, "Caching session ticket",
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 6335|      0|                       ticket.ticket.data,
 6336|      0|                       ticket.ticket.len));
 6337|       |
 6338|       |        /* Replace a previous session ticket when
 6339|       |         * we receive a second NewSessionTicket message. */
 6340|      0|        if (ss->sec.ci.sid->cached == in_client_cache ||
  ------------------
  |  Branch (6340:13): [True: 0, False: 0]
  ------------------
 6341|      0|            ss->sec.ci.sid->cached == in_external_cache) {
  ------------------
  |  Branch (6341:13): [True: 0, False: 0]
  ------------------
 6342|       |            /* Create a new session ID. */
 6343|      0|            sslSessionID *sid = ssl3_NewSessionID(ss, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 6344|      0|            if (!sid) {
  ------------------
  |  Branch (6344:17): [True: 0, False: 0]
  ------------------
 6345|      0|                return SECFailure;
 6346|      0|            }
 6347|       |
 6348|       |            /* Copy over the peerCert. */
 6349|      0|            PORT_Assert(ss->sec.ci.sid->peerCert);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6350|      0|            sid->peerCert = CERT_DupCertificate(ss->sec.ci.sid->peerCert);
 6351|      0|            if (!sid->peerCert) {
  ------------------
  |  Branch (6351:17): [True: 0, False: 0]
  ------------------
 6352|      0|                ssl_FreeSID(sid);
 6353|      0|                return SECFailure;
 6354|      0|            }
 6355|       |
 6356|       |            /* Destroy the old SID. */
 6357|      0|            ssl_UncacheSessionID(ss);
 6358|      0|            ssl_FreeSID(ss->sec.ci.sid);
 6359|      0|            ss->sec.ci.sid = sid;
 6360|      0|        }
 6361|       |
 6362|      0|        ssl3_SetSIDSessionTicket(ss->sec.ci.sid, &ticket);
 6363|      0|        PORT_Assert(!ticket.ticket.data);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6364|       |
 6365|      0|        rv = tls13_HkdfExpandLabel(ss->ssl3.hs.resumptionMasterSecret,
 6366|      0|                                   tls13_GetHash(ss),
 6367|      0|                                   ticket_nonce.data, ticket_nonce.len,
 6368|      0|                                   kHkdfLabelResumption,
 6369|      0|                                   strlen(kHkdfLabelResumption),
 6370|      0|                                   CKM_HKDF_DERIVE,
  ------------------
  |  | 1296|      0|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
 6371|      0|                                   tls13_GetHashSize(ss),
 6372|      0|                                   ss->protocolVariant, &secret);
 6373|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (6373:13): [True: 0, False: 0]
  ------------------
 6374|      0|            return SECFailure;
 6375|      0|        }
 6376|       |
 6377|      0|        rv = ssl3_FillInCachedSID(ss, ss->sec.ci.sid, secret);
 6378|      0|        PK11_FreeSymKey(secret);
 6379|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (6379:13): [True: 0, False: 0]
  ------------------
 6380|      0|            return SECFailure;
 6381|      0|        }
 6382|       |
 6383|       |        /* Cache the session. */
 6384|      0|        ssl_CacheSessionID(ss);
 6385|      0|    }
 6386|       |
 6387|      0|    return SECSuccess;
 6388|      0|}
tls13con.c:tls13_HandleEndOfEarlyData:
 7000|      1|{
 7001|      1|    SECStatus rv;
 7002|       |
 7003|      1|    PORT_Assert(ss->version >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7004|       |
 7005|      1|    rv = TLS13_CHECK_HS_STATE(ss, SSL_ERROR_RX_UNEXPECTED_END_OF_EARLY_DATA,
  ------------------
  |  |  182|      1|    tls13_CheckHsState(ss, err, #err, __func__, __FILE__, __LINE__, \
  |  |  183|      1|                       __VA_ARGS__,                                 \
  |  |  184|      1|                       wait_invalid)
  ------------------
 7006|      1|                              wait_end_of_early_data);
 7007|      1|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7007:9): [True: 1, False: 0]
  ------------------
 7008|      1|        return SECFailure;
 7009|      1|    }
 7010|       |
 7011|       |    /* We shouldn't be getting any more early data, and if we do,
 7012|       |     * it is because of reordering and we drop it. */
 7013|      0|    if (IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 7014|      0|        ssl_CipherSpecReleaseByEpoch(ss, ssl_secret_read,
 7015|      0|                                     TrafficKeyEarlyApplicationData);
 7016|      0|        dtls_ReceivedFirstMessageInFlight(ss);
 7017|      0|    }
 7018|       |
 7019|      0|    PORT_Assert(ss->ssl3.hs.zeroRttState == ssl_0rtt_accepted);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7020|       |
 7021|      0|    if (length) {
  ------------------
  |  Branch (7021:9): [True: 0, False: 0]
  ------------------
 7022|      0|        FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_END_OF_EARLY_DATA, decode_error);
  ------------------
  |  |   22|      0|    do {                                     \
  |  |   23|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |   14|      0|    do {                                                                           \
  |  |  |  |   15|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |   16|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |   17|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |   18|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (18:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|      0|        tls13_FatalError(ss, prError, desc); \
  |  |   25|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (25:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 7023|      0|        return SECFailure;
 7024|      0|    }
 7025|       |
 7026|      0|    rv = tls13_SetCipherSpec(ss, TrafficKeyHandshake,
 7027|      0|                             ssl_secret_read, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 7028|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (7028:9): [True: 0, False: 0]
  ------------------
 7029|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 7030|      0|        return SECFailure;
 7031|      0|    }
 7032|       |
 7033|      0|    ss->ssl3.hs.zeroRttState = ssl_0rtt_done;
 7034|      0|    if (tls13_ShouldRequestClientAuth(ss)) {
  ------------------
  |  Branch (7034:9): [True: 0, False: 0]
  ------------------
 7035|      0|        TLS13_SET_HS_STATE(ss, wait_client_cert);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
 7036|      0|    } else {
 7037|      0|        TLS13_SET_HS_STATE(ss, wait_finished);
  ------------------
  |  |   37|      0|    tls13_SetHsState(ss, ws, __func__, __FILE__, __LINE__)
  ------------------
 7038|      0|    }
 7039|      0|    return SECSuccess;
 7040|      0|}

tls13_DestroyEchConfigs:
   64|  8.85k|{
   65|  8.85k|    PRCList *cur_p;
   66|  8.85k|    while (!PR_CLIST_IS_EMPTY(list)) {
  ------------------
  |  |   94|  8.85k|    ((_l)->next == (_l))
  ------------------
  |  Branch (66:12): [True: 0, False: 8.85k]
  ------------------
   67|      0|        cur_p = PR_LIST_TAIL(list);
  ------------------
  |  |   66|      0|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
   68|      0|        PR_REMOVE_LINK(cur_p);
  ------------------
  |  |   72|      0|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|      0|    (_e)->prev->next = (_e)->next; \
  |  |   74|      0|    (_e)->next->prev = (_e)->prev; \
  |  |   75|      0|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   69|      0|        tls13_DestroyEchConfig((sslEchConfig *)cur_p);
   70|      0|    }
   71|  8.85k|}
tls13_DestroyEchXtnState:
   75|  36.7k|{
   76|  36.7k|    if (!state) {
  ------------------
  |  Branch (76:9): [True: 36.7k, False: 0]
  ------------------
   77|  36.7k|        return;
   78|  36.7k|    }
   79|      0|    SECITEM_FreeItem(&state->innerCh, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&state->innerCh, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
   80|      0|    SECITEM_FreeItem(&state->senderPubKey, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&state->senderPubKey, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
   81|      0|    SECITEM_FreeItem(&state->retryConfigs, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&state->retryConfigs, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
   82|      0|    PORT_ZFree(state, sizeof(*state));
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
   83|      0|}
tls13_ClientSetupEch:
  755|  8.81k|{
  756|  8.81k|    SECStatus rv;
  757|  8.81k|    HpkeContext *cx = NULL;
  758|  8.81k|    SECKEYPublicKey *pkR = NULL;
  759|  8.81k|    SECItem hpkeInfo = { siBuffer, NULL, 0 };
  760|  8.81k|    sslEchConfig *cfg = NULL;
  761|       |
  762|  8.81k|    if (PR_CLIST_IS_EMPTY(&ss->echConfigs) ||
  ------------------
  |  |   94|  17.6k|    ((_l)->next == (_l))
  |  |  ------------------
  |  |  |  Branch (94:5): [True: 8.81k, False: 0]
  |  |  ------------------
  ------------------
  763|  8.81k|        !ssl_ShouldSendSNIExtension(ss, ss->url) ||
  ------------------
  |  Branch (763:9): [True: 0, False: 0]
  ------------------
  764|  8.81k|        IS_DTLS(ss)) {
  ------------------
  |  |  892|      0|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  765|  8.81k|        return SECSuccess;
  766|  8.81k|    }
  767|       |
  768|       |    /* Maybe apply our own priority if >1. For now, we only support
  769|       |     * one version and one KEM. Each ECHConfig can specify multiple
  770|       |     * KDF/AEADs, so just use the first. */
  771|      0|    cfg = (sslEchConfig *)PR_LIST_HEAD(&ss->echConfigs);
  ------------------
  |  |   65|      0|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
  772|       |
  773|      0|    SSL_TRC(50, ("%d: TLS13[%d]: Setup client ECH",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  774|      0|                 SSL_GETPID(), ss->fd));
  775|       |
  776|      0|    switch (type) {
  777|      0|        case client_hello_initial:
  ------------------
  |  Branch (777:9): [True: 0, False: 0]
  ------------------
  778|      0|            PORT_Assert(!ss->ssl3.hs.echHpkeCtx && !ss->ssl3.hs.echPublicName);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  779|      0|            cx = PK11_HPKE_NewContext(cfg->contents.kemId, cfg->contents.kdfId,
  780|      0|                                      cfg->contents.aeadId, NULL, NULL);
  781|      0|            break;
  782|      0|        case client_hello_retry:
  ------------------
  |  Branch (782:9): [True: 0, False: 0]
  ------------------
  783|      0|            if (!ss->ssl3.hs.echHpkeCtx || !ss->ssl3.hs.echPublicName) {
  ------------------
  |  Branch (783:17): [True: 0, False: 0]
  |  Branch (783:44): [True: 0, False: 0]
  ------------------
  784|      0|                FATAL_ERROR(ss, SEC_ERROR_LIBRARY_FAILURE, internal_error);
  ------------------
  |  |  175|      0|    do {                                     \
  |  |  176|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |  167|      0|    do {                                                                           \
  |  |  |  |  168|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |  169|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |  170|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |  171|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  177|      0|        tls13_FatalError(ss, prError, desc); \
  |  |  178|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (178:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
  785|      0|                return SECFailure;
  786|      0|            }
  787|       |            /* Nothing else to do. */
  788|      0|            return SECSuccess;
  789|      0|        default:
  ------------------
  |  Branch (789:9): [True: 0, False: 0]
  ------------------
  790|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  791|      0|            goto loser;
  792|      0|    }
  793|      0|    if (!cx) {
  ------------------
  |  Branch (793:9): [True: 0, False: 0]
  ------------------
  794|      0|        goto loser;
  795|      0|    }
  796|       |
  797|      0|    rv = PK11_HPKE_Deserialize(cx, cfg->contents.publicKey.data, cfg->contents.publicKey.len, &pkR);
  798|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (798:9): [True: 0, False: 0]
  ------------------
  799|      0|        goto loser;
  800|      0|    }
  801|       |
  802|      0|    if (!SECITEM_AllocItem(NULL, &hpkeInfo, strlen(kHpkeInfoEch) + 1 + cfg->raw.len)) {
  ------------------
  |  |  103|      0|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  |  Branch (802:9): [True: 0, False: 0]
  ------------------
  803|      0|        goto loser;
  804|      0|    }
  805|      0|    PORT_Memcpy(&hpkeInfo.data[0], kHpkeInfoEch, strlen(kHpkeInfoEch));
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  806|      0|    PORT_Memset(&hpkeInfo.data[strlen(kHpkeInfoEch)], 0, 1);
  ------------------
  |  |  182|      0|#define PORT_Memset memset
  ------------------
  807|      0|    PORT_Memcpy(&hpkeInfo.data[strlen(kHpkeInfoEch) + 1], cfg->raw.data, cfg->raw.len);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  808|       |
  809|      0|    PRINT_BUF(50, (ss, "Info", hpkeInfo.data, hpkeInfo.len));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
  810|       |
  811|       |    /* Setup with an ephemeral sender keypair. */
  812|      0|    rv = PK11_HPKE_SetupS(cx, NULL, NULL, pkR, &hpkeInfo);
  813|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (813:9): [True: 0, False: 0]
  ------------------
  814|      0|        goto loser;
  815|      0|    }
  816|       |
  817|      0|    rv = ssl3_GetNewRandom(ss->ssl3.hs.client_inner_random);
  818|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (818:9): [True: 0, False: 0]
  ------------------
  819|      0|        goto loser; /* code set */
  820|      0|    }
  821|       |
  822|       |    /* If ECH is rejected, the application will use SSLChannelInfo
  823|       |     * to fetch this field and perform cert chain verification. */
  824|      0|    ss->ssl3.hs.echPublicName = PORT_Strdup(cfg->contents.publicName);
  ------------------
  |  |   69|      0|#define PORT_Strdup PORT_Strdup_Util
  ------------------
  825|      0|    if (!ss->ssl3.hs.echPublicName) {
  ------------------
  |  Branch (825:9): [True: 0, False: 0]
  ------------------
  826|      0|        goto loser;
  827|      0|    }
  828|       |
  829|      0|    ss->ssl3.hs.echHpkeCtx = cx;
  830|      0|    SECKEY_DestroyPublicKey(pkR);
  831|      0|    SECITEM_FreeItem(&hpkeInfo, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&hpkeInfo, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  832|      0|    return SECSuccess;
  833|       |
  834|      0|loser:
  835|      0|    PK11_HPKE_DestroyContext(cx, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  836|      0|    SECKEY_DestroyPublicKey(pkR);
  837|      0|    SECITEM_FreeItem(&hpkeInfo, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&hpkeInfo, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  838|      0|    PORT_Assert(PORT_GetError() != 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  839|      0|    return SECFailure;
  840|      0|}
tls13_MaybeGreaseEch:
 2134|  10.2k|{
 2135|  10.2k|    SECStatus rv;
 2136|  10.2k|    sslBuffer chInnerXtns = SSL_BUFFER_EMPTY;
  ------------------
  |  |   23|  10.2k|    {                        \
  |  |   24|  10.2k|        NULL, 0, 0, PR_FALSE \
  |  |  ------------------
  |  |  |  |  438|  10.2k|#define PR_FALSE 0
  |  |  ------------------
  |  |   25|  10.2k|    }
  ------------------
 2137|  10.2k|    sslBuffer encodedCh = SSL_BUFFER_EMPTY;
  ------------------
  |  |   23|  10.2k|    {                        \
  |  |   24|  10.2k|        NULL, 0, 0, PR_FALSE \
  |  |  ------------------
  |  |  |  |  438|  10.2k|#define PR_FALSE 0
  |  |  ------------------
  |  |   25|  10.2k|    }
  ------------------
 2138|  10.2k|    sslBuffer greaseBuf = SSL_BUFFER_EMPTY;
  ------------------
  |  |   23|  10.2k|    {                        \
  |  |   24|  10.2k|        NULL, 0, 0, PR_FALSE \
  |  |  ------------------
  |  |  |  |  438|  10.2k|#define PR_FALSE 0
  |  |  ------------------
  |  |   25|  10.2k|    }
  ------------------
 2139|  10.2k|    unsigned int payloadLen;
 2140|  10.2k|    HpkeAeadId aead;
 2141|  10.2k|    PK11SlotInfo *slot = NULL;
 2142|  10.2k|    PK11SymKey *hmacPrk = NULL;
 2143|  10.2k|    PK11SymKey *derivedData = NULL;
 2144|  10.2k|    SECItem *rawData;
 2145|  10.2k|    CK_HKDF_PARAMS params;
 2146|  10.2k|    SECItem paramsi;
 2147|       |    /* 1B aead determinant (don't send), 1B config_id, 32B enc, payload */
 2148|  10.2k|    PR_ASSERT(!ss->sec.isServer);
  ------------------
  |  |  208|  10.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 10.2k, False: 0]
  |  |  ------------------
  ------------------
 2149|  10.2k|    const int kNonPayloadLen = 34;
 2150|       |
 2151|  10.2k|    if (!ss->opt.enableTls13GreaseEch || ss->ssl3.hs.echHpkeCtx) {
  ------------------
  |  Branch (2151:9): [True: 5.07k, False: 5.14k]
  |  Branch (2151:42): [True: 0, False: 5.14k]
  ------------------
 2152|  5.07k|        return SECSuccess;
 2153|  5.07k|    }
 2154|       |
 2155|  5.14k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3 ||
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (2155:9): [True: 699, False: 4.44k]
  ------------------
 2156|  5.14k|        IS_DTLS(ss)) {
  ------------------
  |  |  892|  4.44k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  |  |  ------------------
  |  |  |  Branch (892:21): [True: 4.44k, False: 0]
  |  |  ------------------
  ------------------
 2157|  5.14k|        return SECSuccess;
 2158|  5.14k|    }
 2159|       |
 2160|       |    /* In draft-09, CH2 sends exactly the same GREASE ECH extension. */
 2161|      0|    if (ss->ssl3.hs.helloRetry) {
  ------------------
  |  Branch (2161:9): [True: 0, False: 0]
  ------------------
 2162|      0|        return ssl3_EmplaceExtension(ss, buf, ssl_tls13_encrypted_client_hello_xtn,
 2163|      0|                                     ss->ssl3.hs.greaseEchBuf.buf,
 2164|      0|                                     ss->ssl3.hs.greaseEchBuf.len, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2165|      0|    }
 2166|       |
 2167|       |    /* Compress the extensions for payload length. */
 2168|      0|    rv = tls13_ConstructInnerExtensionsFromOuter(ss, buf, &chInnerXtns,
 2169|      0|                                                 NULL, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2170|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2170:9): [True: 0, False: 0]
  ------------------
 2171|      0|        goto loser; /* Code set */
 2172|      0|    }
 2173|      0|    rv = tls13_EncodeClientHelloInner(ss, preamble, &chInnerXtns, &encodedCh);
 2174|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2174:9): [True: 0, False: 0]
  ------------------
 2175|      0|        goto loser; /* Code set */
 2176|      0|    }
 2177|      0|    rv = tls13_PadChInner(&encodedCh, ss->ssl3.hs.greaseEchSize, strlen(ss->url));
 2178|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2178:9): [True: 0, False: 0]
  ------------------
 2179|      0|        goto loser; /* Code set */
 2180|      0|    }
 2181|       |
 2182|      0|    payloadLen = encodedCh.len;
 2183|      0|    payloadLen += TLS13_ECH_AEAD_TAG_LEN; /* Aead tag */
  ------------------
  |  |   26|      0|#define TLS13_ECH_AEAD_TAG_LEN 16
  ------------------
 2184|       |
 2185|       |    /* HMAC-Expand to get something that will pass for ciphertext. */
 2186|      0|    slot = PK11_GetBestSlot(CKM_HKDF_DERIVE, NULL);
  ------------------
  |  | 1296|      0|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
 2187|      0|    if (!slot) {
  ------------------
  |  Branch (2187:9): [True: 0, False: 0]
  ------------------
 2188|      0|        goto loser;
 2189|      0|    }
 2190|       |
 2191|      0|    hmacPrk = PK11_KeyGen(slot, CKM_HKDF_DATA, NULL, SHA256_LENGTH, NULL);
  ------------------
  |  | 1297|      0|#define CKM_HKDF_DATA 0x0000402bUL
  ------------------
                  hmacPrk = PK11_KeyGen(slot, CKM_HKDF_DATA, NULL, SHA256_LENGTH, NULL);
  ------------------
  |  |   41|      0|#define SHA256_LENGTH 32
  ------------------
 2192|      0|    if (!hmacPrk) {
  ------------------
  |  Branch (2192:9): [True: 0, False: 0]
  ------------------
 2193|      0|        goto loser;
 2194|      0|    }
 2195|       |
 2196|      0|    params.bExtract = CK_FALSE;
  ------------------
  |  |   23|      0|#define CK_FALSE 0
  ------------------
 2197|      0|    params.bExpand = CK_TRUE;
  ------------------
  |  |   22|      0|#define CK_TRUE 1
  ------------------
 2198|      0|    params.prfHashMechanism = CKM_SHA256;
  ------------------
  |  |  876|      0|#define CKM_SHA256 0x00000250UL
  ------------------
 2199|      0|    params.pInfo = NULL;
 2200|      0|    params.ulInfoLen = 0;
 2201|      0|    paramsi.data = (unsigned char *)&params;
 2202|      0|    paramsi.len = sizeof(params);
 2203|      0|    derivedData = PK11_DeriveWithFlags(hmacPrk, CKM_HKDF_DATA,
  ------------------
  |  | 1297|      0|#define CKM_HKDF_DATA 0x0000402bUL
  ------------------
 2204|      0|                                       &paramsi, CKM_HKDF_DATA,
  ------------------
  |  | 1297|      0|#define CKM_HKDF_DATA 0x0000402bUL
  ------------------
 2205|      0|                                       CKA_DERIVE, kNonPayloadLen + payloadLen,
  ------------------
  |  |  555|      0|#define CKA_DERIVE 0x0000010CUL
  ------------------
 2206|      0|                                       CKF_VERIFY);
  ------------------
  |  | 1358|      0|#define CKF_VERIFY 0x00002000
  ------------------
 2207|      0|    if (!derivedData) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 0]
  ------------------
 2208|      0|        goto loser;
 2209|      0|    }
 2210|       |
 2211|      0|    rv = PK11_ExtractKeyValue(derivedData);
 2212|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2212:9): [True: 0, False: 0]
  ------------------
 2213|      0|        goto loser;
 2214|      0|    }
 2215|       |
 2216|      0|    rawData = PK11_GetKeyData(derivedData);
 2217|      0|    if (!rawData) {
  ------------------
  |  Branch (2217:9): [True: 0, False: 0]
  ------------------
 2218|      0|        goto loser;
 2219|      0|    }
 2220|      0|    PORT_Assert(rawData->len == kNonPayloadLen + payloadLen);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2221|       |
 2222|       |    /* struct {
 2223|       |       HpkeSymmetricCipherSuite cipher_suite; // kdf_id, aead_id
 2224|       |       PRUint8 config_id;
 2225|       |       opaque enc<1..2^16-1>;
 2226|       |       opaque payload<1..2^16-1>;
 2227|       |    } ClientECH; */
 2228|       |
 2229|      0|    rv = sslBuffer_AppendNumber(&greaseBuf, ech_xtn_type_outer, 1);
 2230|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2230:9): [True: 0, False: 0]
  ------------------
 2231|      0|        goto loser;
 2232|      0|    }
 2233|       |    /* Only support SHA256. */
 2234|      0|    rv = sslBuffer_AppendNumber(&greaseBuf, HpkeKdfHkdfSha256, 2);
 2235|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2235:9): [True: 0, False: 0]
  ------------------
 2236|      0|        goto loser;
 2237|      0|    }
 2238|       |
 2239|       |    /* HpkeAeadAes128Gcm = 1, HpkeAeadChaCha20Poly1305 = 3, */
 2240|      0|    aead = (rawData->data[0] & 1) ? HpkeAeadAes128Gcm : HpkeAeadChaCha20Poly1305;
  ------------------
  |  Branch (2240:12): [True: 0, False: 0]
  ------------------
 2241|      0|    rv = sslBuffer_AppendNumber(&greaseBuf, aead, 2);
 2242|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2242:9): [True: 0, False: 0]
  ------------------
 2243|      0|        goto loser;
 2244|      0|    }
 2245|       |
 2246|       |    /* config_id */
 2247|      0|    rv = sslBuffer_AppendNumber(&greaseBuf, rawData->data[1], 1);
 2248|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2248:9): [True: 0, False: 0]
  ------------------
 2249|      0|        goto loser;
 2250|      0|    }
 2251|       |
 2252|       |    /* enc len is fixed 32B for X25519. */
 2253|      0|    rv = sslBuffer_AppendVariable(&greaseBuf, &rawData->data[2], 32, 2);
 2254|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2254:9): [True: 0, False: 0]
  ------------------
 2255|      0|        goto loser;
 2256|      0|    }
 2257|       |
 2258|      0|    rv = sslBuffer_AppendVariable(&greaseBuf, &rawData->data[kNonPayloadLen], payloadLen, 2);
 2259|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2259:9): [True: 0, False: 0]
  ------------------
 2260|      0|        goto loser;
 2261|      0|    }
 2262|       |
 2263|       |    /* Mark ECH as advertised so that we can validate any response.
 2264|       |     * We'll use echHpkeCtx to determine if we sent real or GREASE ECH. */
 2265|      0|    rv = ssl3_EmplaceExtension(ss, buf, ssl_tls13_encrypted_client_hello_xtn,
 2266|      0|                               greaseBuf.buf, greaseBuf.len, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2267|      0|    if (rv != SECSuccess) {
  ------------------
  |  Branch (2267:9): [True: 0, False: 0]
  ------------------
 2268|      0|        goto loser;
 2269|      0|    }
 2270|       |
 2271|       |    /* Stash the GREASE ECH extension - in the case of HRR, CH2 must echo it. */
 2272|      0|    ss->ssl3.hs.greaseEchBuf = greaseBuf;
 2273|       |
 2274|      0|    sslBuffer_Clear(&chInnerXtns);
 2275|      0|    sslBuffer_Clear(&encodedCh);
 2276|      0|    PK11_FreeSymKey(hmacPrk);
 2277|      0|    PK11_FreeSymKey(derivedData);
 2278|      0|    PK11_FreeSlot(slot);
 2279|      0|    return SECSuccess;
 2280|       |
 2281|      0|loser:
 2282|      0|    sslBuffer_Clear(&chInnerXtns);
 2283|      0|    sslBuffer_Clear(&encodedCh);
 2284|      0|    PK11_FreeSymKey(hmacPrk);
 2285|      0|    PK11_FreeSymKey(derivedData);
 2286|      0|    if (slot) {
  ------------------
  |  Branch (2286:9): [True: 0, False: 0]
  ------------------
 2287|      0|        PK11_FreeSlot(slot);
 2288|      0|    }
 2289|      0|    return SECFailure;
 2290|      0|}
tls13_MaybeHandleEchSignal:
 2361|  1.81k|{
 2362|  1.81k|    SECStatus rv;
 2363|  1.81k|    PRUint8 computed[TLS13_ECH_SIGNAL_LEN];
 2364|  1.81k|    const PRUint8 *signal;
 2365|  1.81k|    PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|  1.81k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.81k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.81k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2366|       |
 2367|       |    /* If !echHpkeCtx, we either didn't advertise or sent GREASE ECH. */
 2368|  1.81k|    if (!ss->ssl3.hs.echHpkeCtx) {
  ------------------
  |  Branch (2368:9): [True: 1.81k, False: 0]
  ------------------
 2369|  1.81k|        SSL_TRC(50, ("%d: TLS13[%d]: client only sent GREASE ECH",
  ------------------
  |  |   71|  1.81k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.81k]
  |  |  ------------------
  |  |   72|  1.81k|    ssl_Trace b
  ------------------
 2370|  1.81k|                     SSL_GETPID(), ss->fd));
 2371|  1.81k|        ss->ssl3.hs.preliminaryInfo |= ssl_preinfo_ech;
  ------------------
  |  |  398|  1.81k|#define ssl_preinfo_ech (1U << 4)
  ------------------
 2372|  1.81k|        return SECSuccess;
 2373|  1.81k|    }
 2374|       |
 2375|      0|    PORT_Assert(!IS_DTLS(ss));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2376|       |
 2377|      0|    if (isHrr) {
  ------------------
  |  Branch (2377:9): [True: 0, False: 0]
  ------------------
 2378|      0|        if (ss->xtnData.ech) {
  ------------------
  |  Branch (2378:13): [True: 0, False: 0]
  ------------------
 2379|      0|            signal = ss->xtnData.ech->hrrConfirmation;
 2380|      0|        } else {
 2381|      0|            SSL_TRC(50, ("%d: TLS13[%d]: client did not receive ECH Xtn from Server HRR",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 2382|      0|                         SSL_GETPID(), ss->fd));
 2383|      0|            signal = NULL;
 2384|      0|            ss->ssl3.hs.echAccepted = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 2385|      0|            ss->ssl3.hs.echDecided = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2386|      0|        }
 2387|      0|    } else {
 2388|      0|        signal = &ss->ssl3.hs.server_random[SSL3_RANDOM_LENGTH - TLS13_ECH_SIGNAL_LEN];
  ------------------
  |  |   24|      0|#define SSL3_RANDOM_LENGTH 32
  ------------------
                      signal = &ss->ssl3.hs.server_random[SSL3_RANDOM_LENGTH - TLS13_ECH_SIGNAL_LEN];
  ------------------
  |  |   25|      0|#define TLS13_ECH_SIGNAL_LEN 8
  ------------------
 2389|      0|    }
 2390|       |
 2391|      0|    PORT_Assert(ssl3_ExtensionAdvertised(ss, ssl_tls13_encrypted_client_hello_xtn));
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2392|       |
 2393|       |    /* Check ECH Confirmation for HRR ECH Xtn or ServerHello Random */
 2394|      0|    if (signal) {
  ------------------
  |  Branch (2394:9): [True: 0, False: 0]
  ------------------
 2395|      0|        rv = tls13_ComputeEchSignal(ss, isHrr, sh, shLen, computed);
 2396|      0|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2396:13): [True: 0, False: 0]
  ------------------
 2397|      0|            return SECFailure;
 2398|      0|        }
 2399|      0|        PRINT_BUF(100, (ss, "Server Signal", signal, TLS13_ECH_SIGNAL_LEN));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
 2400|      0|        PRBool new_decision = !NSS_SecureMemcmp(computed, signal, TLS13_ECH_SIGNAL_LEN);
  ------------------
  |  |   25|      0|#define TLS13_ECH_SIGNAL_LEN 8
  ------------------
 2401|       |        /* Server can't change its mind on whether to accept ECH */
 2402|      0|        if (ss->ssl3.hs.echDecided && new_decision != ss->ssl3.hs.echAccepted) {
  ------------------
  |  Branch (2402:13): [True: 0, False: 0]
  |  Branch (2402:39): [True: 0, False: 0]
  ------------------
 2403|      0|            FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_SERVER_HELLO, illegal_parameter);
  ------------------
  |  |  175|      0|    do {                                     \
  |  |  176|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |  167|      0|    do {                                                                           \
  |  |  |  |  168|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |  169|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |  170|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |  171|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  177|      0|        tls13_FatalError(ss, prError, desc); \
  |  |  178|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (178:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2404|      0|            return SECFailure;
 2405|      0|        }
 2406|      0|        ss->ssl3.hs.echAccepted = new_decision;
 2407|      0|        ss->ssl3.hs.echDecided = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 2408|      0|    }
 2409|       |
 2410|      0|    ss->ssl3.hs.preliminaryInfo |= ssl_preinfo_ech;
  ------------------
  |  |  398|      0|#define ssl_preinfo_ech (1U << 4)
  ------------------
 2411|      0|    if (ss->ssl3.hs.echAccepted) {
  ------------------
  |  Branch (2411:9): [True: 0, False: 0]
  ------------------
 2412|      0|        if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (2412:13): [True: 0, False: 0]
  ------------------
 2413|      0|            FATAL_ERROR(ss, SSL_ERROR_RX_MALFORMED_SERVER_HELLO, illegal_parameter);
  ------------------
  |  |  175|      0|    do {                                     \
  |  |  176|      0|        LOG_ERROR(ss, prError);              \
  |  |  ------------------
  |  |  |  |  167|      0|    do {                                                                           \
  |  |  |  |  168|      0|        SSL_TRC(3, ("%d: TLS13[%d]: fatal error %d in %s (%s:%d)",                 \
  |  |  |  |  ------------------
  |  |  |  |  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   72|      0|    ssl_Trace b
  |  |  |  |  ------------------
  |  |  |  |  169|      0|                    SSL_GETPID(), ss->fd, prError, __func__, __FILE__, __LINE__)); \
  |  |  |  |  170|      0|        PORT_SetError(prError);                                                    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  |  |  |  |  ------------------
  |  |  |  |  171|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:14): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  177|      0|        tls13_FatalError(ss, prError, desc); \
  |  |  178|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (178:14): [Folded - Ignored]
  |  |  ------------------
  ------------------
 2414|      0|            return SECFailure;
 2415|      0|        }
 2416|       |        /* Server accepted, but sent an extension which was only advertised in the ClientHelloOuter */
 2417|      0|        if (ss->ssl3.hs.echInvalidExtension) {
  ------------------
  |  Branch (2417:13): [True: 0, False: 0]
  ------------------
 2418|      0|            (void)SSL3_SendAlert(ss, alert_fatal, unsupported_extension);
 2419|      0|            PORT_SetError(SSL_ERROR_RX_UNEXPECTED_EXTENSION);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2420|      0|            return SECFailure;
 2421|      0|        }
 2422|       |
 2423|       |        /* Swap the advertised lists as we've accepted ECH. */
 2424|      0|        PRUint16 *tempArray = ss->xtnData.advertised;
 2425|      0|        PRUint16 tempNum = ss->xtnData.numAdvertised;
 2426|       |
 2427|      0|        ss->xtnData.advertised = ss->xtnData.echAdvertised;
 2428|      0|        ss->xtnData.numAdvertised = ss->xtnData.echNumAdvertised;
 2429|       |
 2430|      0|        ss->xtnData.echAdvertised = tempArray;
 2431|      0|        ss->xtnData.echNumAdvertised = tempNum;
 2432|       |
 2433|       |        /* |enc| must not be included in CH2.ClientECH. */
 2434|      0|        if (ss->ssl3.hs.helloRetry && ss->sec.isServer &&
  ------------------
  |  Branch (2434:13): [True: 0, False: 0]
  |  Branch (2434:39): [True: 0, False: 0]
  ------------------
 2435|      0|            ss->xtnData.ech->senderPubKey.len) {
  ------------------
  |  Branch (2435:13): [True: 0, False: 0]
  ------------------
 2436|      0|            ssl3_ExtSendAlert(ss, alert_fatal, illegal_parameter);
 2437|      0|            PORT_SetError(SSL_ERROR_BAD_2ND_CLIENT_HELLO);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2438|      0|            return SECFailure;
 2439|      0|        }
 2440|      0|        ss->xtnData.negotiated[ss->xtnData.numNegotiated++] = ssl_tls13_encrypted_client_hello_xtn;
 2441|       |
 2442|       |        /* Only overwrite client_random with client_inner_random if CHInner was
 2443|       |         *  succesfully used for handshake (NOT if HRR is received). */
 2444|      0|        if (!isHrr) {
  ------------------
  |  Branch (2444:13): [True: 0, False: 0]
  ------------------
 2445|      0|            PORT_Memcpy(ss->ssl3.hs.client_random, ss->ssl3.hs.client_inner_random, SSL3_RANDOM_LENGTH);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
                          PORT_Memcpy(ss->ssl3.hs.client_random, ss->ssl3.hs.client_inner_random, SSL3_RANDOM_LENGTH);
  ------------------
  |  |   24|      0|#define SSL3_RANDOM_LENGTH 32
  ------------------
 2446|      0|        }
 2447|      0|    }
 2448|       |    /* If rejected, leave echHpkeCtx and echPublicName for rejection paths. */
 2449|      0|    ssl3_CoalesceEchHandshakeHashes(ss);
 2450|      0|    SSL_TRC(3, ("%d: TLS13[%d]: ECH %s accepted by server",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2451|      0|                SSL_GETPID(), ss->fd, ss->ssl3.hs.echAccepted ? "is" : "is not"));
 2452|      0|    return SECSuccess;
 2453|      0|}

tls13_SizeOfKeyShareEntry:
   64|  8.81k|{
   65|       |    /* Size = NamedGroup(2) + length(2) + opaque<?> share */
   66|  8.81k|    PRUint32 size = 2 + 2;
   67|       |
   68|  8.81k|    const SECKEYPublicKey *pubKey = keyPair->keys->pubKey;
   69|  8.81k|    switch (pubKey->keyType) {
   70|  7.93k|        case ecKey:
  ------------------
  |  Branch (70:9): [True: 7.93k, False: 874]
  ------------------
   71|  7.93k|            size += pubKey->u.ec.publicValue.len;
   72|  7.93k|            break;
   73|    874|        case dhKey:
  ------------------
  |  Branch (73:9): [True: 874, False: 7.93k]
  ------------------
   74|    874|            size += pubKey->u.dh.prime.len;
   75|    874|            break;
   76|      0|        default:
  ------------------
  |  Branch (76:9): [True: 0, False: 8.81k]
  ------------------
   77|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   78|      0|            return 0;
   79|  8.81k|    }
   80|       |
   81|  8.81k|    if (keyPair->kemKeys) {
  ------------------
  |  Branch (81:9): [True: 0, False: 8.81k]
  ------------------
   82|      0|        PORT_Assert(!keyPair->kemCt);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   83|      0|        PORT_Assert(keyPair->group->name == ssl_grp_kem_xyber768d00 || keyPair->group->name == ssl_grp_kem_mlkem768x25519);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   84|      0|        pubKey = keyPair->kemKeys->pubKey;
   85|      0|        size += pubKey->u.kyber.publicValue.len;
   86|      0|    }
   87|  8.81k|    if (keyPair->kemCt) {
  ------------------
  |  Branch (87:9): [True: 0, False: 8.81k]
  ------------------
   88|      0|        PORT_Assert(!keyPair->kemKeys);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   89|      0|        PORT_Assert(keyPair->group->name == ssl_grp_kem_xyber768d00 || keyPair->group->name == ssl_grp_kem_mlkem768x25519);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   90|      0|        size += keyPair->kemCt->len;
   91|      0|    }
   92|       |
   93|  8.81k|    return size;
   94|  8.81k|}
tls13_EncodeKeyShareEntry:
  175|  8.81k|{
  176|  8.81k|    SECStatus rv;
  177|  8.81k|    unsigned int size = tls13_SizeOfKeyShareEntry(keyPair);
  178|       |
  179|  8.81k|    rv = sslBuffer_AppendNumber(buf, keyPair->group->name, 2);
  180|  8.81k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (180:9): [True: 0, False: 8.81k]
  ------------------
  181|      0|        return rv;
  182|      0|    }
  183|       |
  184|  8.81k|    rv = sslBuffer_AppendNumber(buf, size - 4, 2);
  185|  8.81k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (185:9): [True: 0, False: 8.81k]
  ------------------
  186|      0|        return rv;
  187|      0|    }
  188|       |
  189|  8.81k|    switch (keyPair->group->name) {
  190|      0|        case ssl_grp_kem_mlkem768x25519:
  ------------------
  |  Branch (190:9): [True: 0, False: 8.81k]
  ------------------
  191|      0|            rv = tls13_WriteMLKEM768X25519KeyExchangeInfo(buf, keyPair);
  192|      0|            break;
  193|      0|        case ssl_grp_kem_xyber768d00:
  ------------------
  |  Branch (193:9): [True: 0, False: 8.81k]
  ------------------
  194|      0|            rv = tls13_WriteXyber768D00KeyExchangeInfo(buf, keyPair);
  195|      0|            break;
  196|  8.81k|        default:
  ------------------
  |  Branch (196:9): [True: 8.81k, False: 0]
  ------------------
  197|  8.81k|            rv = tls13_WriteKeyExchangeInfo(buf, keyPair);
  198|  8.81k|            break;
  199|  8.81k|    }
  200|  8.81k|    return rv;
  201|  8.81k|}
tls13_ClientSendKeyShareXtn:
  206|  10.2k|{
  207|  10.2k|    SECStatus rv;
  208|  10.2k|    PRCList *cursor;
  209|  10.2k|    unsigned int lengthOffset;
  210|       |
  211|  10.2k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (211:9): [True: 1.40k, False: 8.81k]
  ------------------
  212|  1.40k|        return SECSuccess;
  213|  1.40k|    }
  214|       |
  215|       |    /* Optimistically try to send an ECDHE key using the
  216|       |     * preexisting key (in future will be keys) */
  217|  8.81k|    SSL_TRC(3, ("%d: TLS13[%d]: send client key share xtn",
  ------------------
  |  |   71|  8.81k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 8.81k]
  |  |  ------------------
  |  |   72|  8.81k|    ssl_Trace b
  ------------------
  218|  8.81k|                SSL_GETPID(), ss->fd));
  219|       |
  220|       |    /* Save the offset to the length. */
  221|  8.81k|    rv = sslBuffer_Skip(buf, 2, &lengthOffset);
  222|  8.81k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (222:9): [True: 0, False: 8.81k]
  ------------------
  223|      0|        return SECFailure;
  224|      0|    }
  225|       |
  226|  8.81k|    for (cursor = PR_NEXT_LINK(&ss->ephemeralKeyPairs);
  ------------------
  |  |   47|  8.81k|        ((_e)->next)
  ------------------
  227|  17.6k|         cursor != &ss->ephemeralKeyPairs;
  ------------------
  |  Branch (227:10): [True: 8.81k, False: 8.81k]
  ------------------
  228|  8.81k|         cursor = PR_NEXT_LINK(cursor)) {
  ------------------
  |  |   47|  8.81k|        ((_e)->next)
  ------------------
  229|  8.81k|        sslEphemeralKeyPair *keyPair = (sslEphemeralKeyPair *)cursor;
  230|  8.81k|        rv = tls13_EncodeKeyShareEntry(buf, keyPair);
  231|  8.81k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (231:13): [True: 0, False: 8.81k]
  ------------------
  232|      0|            return SECFailure;
  233|      0|        }
  234|  8.81k|    }
  235|       |
  236|       |    /* GREASE KeyShareEntry:
  237|       |     * [The client] MAY also send KeyShareEntry values for a subset of those
  238|       |     * selected in the "key_share" extension.  For each of these, the
  239|       |     * "key_exchange" field MAY be any value [RFC8701, Section 3.1].
  240|       |     *
  241|       |     * By default we do not send KeyShares for every NamedGroup so the
  242|       |     * ServerKeyShare handshake message / additional round-trip is not
  243|       |     * triggered by sending GREASE KeyShareEntries. */
  244|  8.81k|    if (ss->opt.enableGrease) {
  ------------------
  |  Branch (244:9): [True: 4.35k, False: 4.46k]
  ------------------
  245|  4.35k|        rv = sslBuffer_AppendNumber(buf, ss->ssl3.hs.grease->idx[grease_group], 2);
  246|  4.35k|        if (rv != SECSuccess)
  ------------------
  |  Branch (246:13): [True: 0, False: 4.35k]
  ------------------
  247|      0|            return rv;
  248|       |        /* Entry length */
  249|  4.35k|        rv = sslBuffer_AppendNumber(buf, 2, 2);
  250|  4.35k|        if (rv != SECSuccess)
  ------------------
  |  Branch (250:13): [True: 0, False: 4.35k]
  ------------------
  251|      0|            return rv;
  252|       |        /* Entry value */
  253|  4.35k|        rv = sslBuffer_AppendNumber(buf, 0xCD, 2);
  254|  4.35k|        if (rv != SECSuccess)
  ------------------
  |  Branch (254:13): [True: 0, False: 4.35k]
  ------------------
  255|      0|            return rv;
  256|  4.35k|    }
  257|       |
  258|  8.81k|    rv = sslBuffer_InsertLength(buf, lengthOffset, 2);
  259|  8.81k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (259:9): [True: 0, False: 8.81k]
  ------------------
  260|      0|        return SECFailure;
  261|      0|    }
  262|       |
  263|  8.81k|    *added = PR_TRUE;
  ------------------
  |  |  437|  8.81k|#define PR_TRUE 1
  ------------------
  264|  8.81k|    return SECSuccess;
  265|  8.81k|}
tls13_DecodeKeyShareEntry:
  269|    949|{
  270|    949|    SECStatus rv;
  271|    949|    PRUint64 group;
  272|    949|    const sslNamedGroupDef *groupDef;
  273|    949|    TLS13KeyShareEntry *ks = NULL;
  274|    949|    sslReadBuffer share;
  275|       |
  276|    949|    rv = sslRead_ReadNumber(rdr, 2, &group);
  277|    949|    if (rv != SECSuccess) {
  ------------------
  |  Branch (277:9): [True: 2, False: 947]
  ------------------
  278|      2|        goto loser;
  279|      2|    }
  280|    947|    groupDef = ssl_LookupNamedGroup(group);
  281|    947|    rv = sslRead_ReadVariable(rdr, 2, &share);
  282|    947|    if (rv != SECSuccess) {
  ------------------
  |  Branch (282:9): [True: 27, False: 920]
  ------------------
  283|     27|        goto loser;
  284|     27|    }
  285|       |
  286|       |    /* This has to happen here because we want to consume
  287|       |     * the entire entry even if the group is unknown
  288|       |     * or disabled. */
  289|       |    /* If the group is disabled, continue. */
  290|    920|    if (!groupDef) {
  ------------------
  |  Branch (290:9): [True: 3, False: 917]
  ------------------
  291|      3|        return SECSuccess;
  292|      3|    }
  293|       |
  294|    917|    ks = PORT_ZNew(TLS13KeyShareEntry);
  ------------------
  |  |  148|    917|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|    917|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  295|    917|    if (!ks) {
  ------------------
  |  Branch (295:9): [True: 0, False: 917]
  ------------------
  296|      0|        goto loser;
  297|      0|    }
  298|    917|    ks->group = groupDef;
  299|       |
  300|    917|    rv = SECITEM_MakeItem(NULL, &ks->key_exchange,
  301|    917|                          share.buf, share.len);
  302|    917|    if (rv != SECSuccess) {
  ------------------
  |  Branch (302:9): [True: 0, False: 917]
  ------------------
  303|      0|        goto loser;
  304|      0|    }
  305|       |
  306|    917|    *ksp = ks;
  307|    917|    return SECSuccess;
  308|       |
  309|     29|loser:
  310|     29|    tls13_DestroyKeyShareEntry(ks);
  311|       |
  312|     29|    return SECFailure;
  313|    917|}
tls13_ClientHandleKeyShareXtn:
  320|    950|{
  321|    950|    SECStatus rv;
  322|    950|    PORT_Assert(PR_CLIST_IS_EMPTY(&xtnData->remoteKeyShares));
  ------------------
  |  |  120|    950|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    950|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 950, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  323|    950|    TLS13KeyShareEntry *ks = NULL;
  324|       |
  325|    950|    PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|    950|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    950|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 950, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  326|       |
  327|       |    /* The server must not send this extension when negotiating < TLS 1.3. */
  328|    950|    if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|    950|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (328:9): [True: 1, False: 949]
  ------------------
  329|      1|        PORT_SetError(SSL_ERROR_EXTENSION_DISALLOWED_FOR_VERSION);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
  330|      1|        return SECFailure;
  331|      1|    }
  332|       |
  333|    949|    SSL_TRC(3, ("%d: SSL3[%d]: handle key_share extension",
  ------------------
  |  |   71|    949|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 949]
  |  |  ------------------
  |  |   72|    949|    ssl_Trace b
  ------------------
  334|    949|                SSL_GETPID(), ss->fd));
  335|       |
  336|    949|    sslReader rdr = SSL_READER(data->data, data->len);
  ------------------
  |  |   85|    949|    {                    \
  |  |   86|    949|        { b, l }, 0      \
  |  |   87|    949|    }
  ------------------
  337|    949|    rv = tls13_DecodeKeyShareEntry(&rdr, &ks);
  338|    949|    if ((rv != SECSuccess) || !ks) {
  ------------------
  |  Branch (338:9): [True: 29, False: 920]
  |  Branch (338:31): [True: 3, False: 917]
  ------------------
  339|     32|        ssl3_ExtSendAlert(ss, alert_fatal, illegal_parameter);
  340|     32|        PORT_SetError(SSL_ERROR_RX_MALFORMED_KEY_SHARE);
  ------------------
  |  |   65|     32|#define PORT_SetError PORT_SetError_Util
  ------------------
  341|     32|        return SECFailure;
  342|     32|    }
  343|       |
  344|    917|    if (SSL_READER_REMAINING(&rdr)) {
  ------------------
  |  |   91|    917|    ((r)->buf.len - (r)->offset)
  |  |  ------------------
  |  |  |  Branch (91:5): [True: 11, False: 906]
  |  |  ------------------
  ------------------
  345|     11|        tls13_DestroyKeyShareEntry(ks);
  346|     11|        PORT_SetError(SSL_ERROR_RX_MALFORMED_KEY_SHARE);
  ------------------
  |  |   65|     11|#define PORT_SetError PORT_SetError_Util
  ------------------
  347|     11|        return SECFailure;
  348|     11|    }
  349|    906|    PR_APPEND_LINK(&ks->link, &xtnData->remoteKeyShares);
  ------------------
  |  |   57|    917|#define PR_APPEND_LINK(_e,_l) PR_INSERT_BEFORE(_e,_l)
  |  |  ------------------
  |  |  |  |   25|  1.81k|    PR_BEGIN_MACRO       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|    906|#define PR_BEGIN_MACRO  do {
  |  |  |  |  ------------------
  |  |  |  |   26|  1.81k|    (_e)->next = (_l);   \
  |  |  |  |   27|  1.81k|    (_e)->prev = (_l)->prev; \
  |  |  |  |   28|  1.81k|    (_l)->prev->next = (_e); \
  |  |  |  |   29|  1.81k|    (_l)->prev = (_e);   \
  |  |  |  |   30|  1.81k|    PR_END_MACRO
  |  |  |  |  ------------------
  |  |  |  |  |  |  124|    906|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  350|       |
  351|    906|    return SECSuccess;
  352|    917|}
tls13_ClientHandleKeyShareXtnHrr:
  357|    968|{
  358|    968|    SECStatus rv;
  359|    968|    PRUint32 tmp;
  360|    968|    const sslNamedGroupDef *group;
  361|       |
  362|    968|    PORT_Assert(!ss->sec.isServer);
  ------------------
  |  |  120|    968|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    968|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 968, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|    968|    PORT_Assert(ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|    968|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    968|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 968, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|       |
  365|    968|    SSL_TRC(3, ("%d: SSL3[%d]: handle key_share extension in HRR",
  ------------------
  |  |   71|    968|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 968]
  |  |  ------------------
  |  |   72|    968|    ssl_Trace b
  ------------------
  366|    968|                SSL_GETPID(), ss->fd));
  367|       |
  368|    968|    rv = ssl3_ExtConsumeHandshakeNumber(ss, &tmp, 2, &data->data, &data->len);
  369|    968|    if (rv != SECSuccess) {
  ------------------
  |  Branch (369:9): [True: 1, False: 967]
  ------------------
  370|      1|        return SECFailure; /* error code already set */
  371|      1|    }
  372|    967|    if (data->len) {
  ------------------
  |  Branch (372:9): [True: 1, False: 966]
  ------------------
  373|      1|        ssl3_ExtSendAlert(ss, alert_fatal, decode_error);
  374|      1|        PORT_SetError(SSL_ERROR_RX_MALFORMED_HELLO_RETRY_REQUEST);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
  375|      1|        return SECFailure;
  376|      1|    }
  377|       |
  378|    966|    group = ssl_LookupNamedGroup((SSLNamedGroup)tmp);
  379|       |    /* If the group is not enabled, or we already have a share for the
  380|       |     * requested group, abort. */
  381|    966|    if (!ssl_NamedGroupEnabled(ss, group) ||
  ------------------
  |  Branch (381:9): [True: 5, False: 961]
  ------------------
  382|    966|        ssl_HaveEphemeralKeyPair(ss, group)) {
  ------------------
  |  Branch (382:9): [True: 1, False: 960]
  ------------------
  383|      6|        ssl3_ExtSendAlert(ss, alert_fatal, illegal_parameter);
  384|      6|        PORT_SetError(SSL_ERROR_RX_MALFORMED_HELLO_RETRY_REQUEST);
  ------------------
  |  |   65|      6|#define PORT_SetError PORT_SetError_Util
  ------------------
  385|      6|        return SECFailure;
  386|      6|    }
  387|       |
  388|       |    /* Now delete all the key shares per [draft-ietf-tls-tls13 S 4.1.2] */
  389|    960|    ssl_FreeEphemeralKeyPairs(CONST_CAST(sslSocket, ss));
  ------------------
  |  |   96|    960|#define CONST_CAST(T, X) ((T *)(X))
  ------------------
  390|       |
  391|       |    /* And replace with our new share. */
  392|    960|    rv = tls13_AddKeyShare(CONST_CAST(sslSocket, ss), group);
  ------------------
  |  |   96|    960|#define CONST_CAST(T, X) ((T *)(X))
  ------------------
  393|    960|    if (rv != SECSuccess) {
  ------------------
  |  Branch (393:9): [True: 0, False: 960]
  ------------------
  394|      0|        ssl3_ExtSendAlert(ss, alert_fatal, internal_error);
  395|      0|        PORT_SetError(SEC_ERROR_KEYGEN_FAIL);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  396|      0|        return SECFailure;
  397|      0|    }
  398|       |
  399|    960|    return SECSuccess;
  400|    960|}
tls13_ClientSendPreSharedKeyXtn:
  506|  10.2k|{
  507|  10.2k|    const static PRUint8 binder[TLS13_MAX_FINISHED_SIZE] = { 0 };
  508|  10.2k|    unsigned int binderLen;
  509|  10.2k|    unsigned int identityLen = 0;
  510|  10.2k|    const PRUint8 *identity = NULL;
  511|  10.2k|    PRTime age;
  512|  10.2k|    SECStatus rv;
  513|       |
  514|       |    /* Exit early if no PSKs or max version < 1.3. */
  515|  10.2k|    if (PR_CLIST_IS_EMPTY(&ss->ssl3.hs.psks) ||
  ------------------
  |  |   94|  20.4k|    ((_l)->next == (_l))
  |  |  ------------------
  |  |  |  Branch (94:5): [True: 4.77k, False: 5.44k]
  |  |  ------------------
  ------------------
  516|  10.2k|        ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  5.44k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (516:9): [True: 734, False: 4.71k]
  ------------------
  517|  5.50k|        return SECSuccess;
  518|  5.50k|    }
  519|       |
  520|       |    /* ...or if PSK type is resumption, but we're not resuming. */
  521|  4.71k|    sslPsk *psk = (sslPsk *)PR_LIST_HEAD(&ss->ssl3.hs.psks);
  ------------------
  |  |   65|  4.71k|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
  522|  4.71k|    if (psk->type == ssl_psk_resume && !ss->statelessResume) {
  ------------------
  |  Branch (522:9): [True: 0, False: 4.71k]
  |  Branch (522:40): [True: 0, False: 0]
  ------------------
  523|      0|        return SECSuccess;
  524|      0|    }
  525|       |
  526|       |    /* ...or if PSKs are incompatible with negotiated ciphersuites
  527|       |     * (different hash algorithms) on HRR.
  528|       |     *
  529|       |     * In addition, in its updated ClientHello, the client SHOULD NOT offer any
  530|       |     * pre-shared keys associated with a hash other than that of the selected
  531|       |     * cipher suite.  This allows the client to avoid having to compute partial
  532|       |     * hash transcripts for multiple hashes in the second ClientHello
  533|       |     * [RFC8446, Section 4.1.4]. */
  534|  4.71k|    if (ss->ssl3.hs.helloRetry &&
  ------------------
  |  Branch (534:9): [True: 557, False: 4.15k]
  ------------------
  535|  4.71k|        (psk->hash != ss->ssl3.hs.suite_def->prf_hash)) {
  ------------------
  |  Branch (535:9): [True: 247, False: 310]
  ------------------
  536|    247|        return SECSuccess;
  537|    247|    }
  538|       |
  539|       |    /* Save where this extension starts so that if we have to add padding, it
  540|       |     * can be inserted before this extension. */
  541|  4.46k|    PORT_Assert(buf->len >= 4);
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  542|  4.46k|    xtnData->lastXtnOffset = buf->len - 4;
  543|  4.46k|    PORT_Assert(psk->type == ssl_psk_resume || psk->type == ssl_psk_external);
  ------------------
  |  |  120|  4.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.93k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 4.46k]
  |  |  |  |  |  Branch (208:7): [True: 4.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  544|  4.46k|    binderLen = tls13_GetHashSizeForHash(psk->hash);
  545|  4.46k|    if (psk->type == ssl_psk_resume) {
  ------------------
  |  Branch (545:9): [True: 0, False: 4.46k]
  ------------------
  546|       |        /* Send a single ticket identity. */
  547|      0|        NewSessionTicket *session_ticket = &ss->sec.ci.sid->u.ssl3.locked.sessionTicket;
  548|      0|        identityLen = session_ticket->ticket.len;
  549|      0|        identity = session_ticket->ticket.data;
  550|       |
  551|       |        /* Obfuscated age. */
  552|      0|        age = ssl_Time(ss) - session_ticket->received_timestamp;
  553|      0|        age /= PR_USEC_PER_MSEC;
  ------------------
  |  |   30|      0|#define PR_USEC_PER_MSEC    1000L
  ------------------
  554|      0|        age += session_ticket->ticket_age_add;
  555|      0|        PRINT_BUF(50, (ss, "Sending Resumption PSK with identity", identity, identityLen));
  ------------------
  |  |   74|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   75|      0|    ssl_PrintBuf b
  ------------------
  556|  4.46k|    } else if (psk->type == ssl_psk_external) {
  ------------------
  |  Branch (556:16): [True: 4.46k, False: 0]
  ------------------
  557|  4.46k|        identityLen = psk->label.len;
  558|  4.46k|        identity = psk->label.data;
  559|  4.46k|        age = 0;
  560|  4.46k|        PRINT_BUF(50, (ss, "Sending External PSK with label", identity, identityLen));
  ------------------
  |  |   74|  4.46k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 4.46k]
  |  |  ------------------
  |  |   75|  4.46k|    ssl_PrintBuf b
  ------------------
  561|  4.46k|    } else {
  562|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  563|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  564|      0|        return SECFailure;
  565|      0|    }
  566|       |
  567|       |    /* Length is len(identityLen) + identityLen + len(age) */
  568|  4.46k|    rv = sslBuffer_AppendNumber(buf, 2 + identityLen + 4, 2);
  569|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (569:9): [True: 0, False: 4.46k]
  ------------------
  570|      0|        goto loser;
  571|      0|    }
  572|       |
  573|  4.46k|    rv = sslBuffer_AppendVariable(buf, identity,
  574|  4.46k|                                  identityLen, 2);
  575|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (575:9): [True: 0, False: 4.46k]
  ------------------
  576|      0|        goto loser;
  577|      0|    }
  578|       |
  579|  4.46k|    rv = sslBuffer_AppendNumber(buf, age, 4);
  580|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (580:9): [True: 0, False: 4.46k]
  ------------------
  581|      0|        goto loser;
  582|      0|    }
  583|       |
  584|       |    /* Write out the binder list length. */
  585|  4.46k|    rv = sslBuffer_AppendNumber(buf, binderLen + 1, 2);
  586|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (586:9): [True: 0, False: 4.46k]
  ------------------
  587|      0|        goto loser;
  588|      0|    }
  589|       |
  590|       |    /* Write zeroes for the binder for the moment. These
  591|       |     * are overwritten in tls13_WriteExtensionsWithBinder. */
  592|  4.46k|    rv = sslBuffer_AppendVariable(buf, binder, binderLen, 1);
  593|  4.46k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (593:9): [True: 0, False: 4.46k]
  ------------------
  594|      0|        goto loser;
  595|      0|    }
  596|       |
  597|  4.46k|    if (psk->type == ssl_psk_resume) {
  ------------------
  |  Branch (597:9): [True: 0, False: 4.46k]
  ------------------
  598|      0|        xtnData->sentSessionTicketInClientHello = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  599|      0|    }
  600|       |
  601|  4.46k|    *added = PR_TRUE;
  ------------------
  |  |  437|  4.46k|#define PR_TRUE 1
  ------------------
  602|  4.46k|    return SECSuccess;
  603|       |
  604|      0|loser:
  605|      0|    xtnData->ticketTimestampVerified = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  606|      0|    return SECFailure;
  607|  4.46k|}
tls13_ClientHandlePreSharedKeyXtn:
  779|     25|{
  780|     25|    PRUint32 index;
  781|     25|    SECStatus rv;
  782|       |
  783|     25|    SSL_TRC(3, ("%d: SSL3[%d]: handle pre_shared_key extension",
  ------------------
  |  |   71|     25|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 25]
  |  |  ------------------
  |  |   72|     25|    ssl_Trace b
  ------------------
  784|     25|                SSL_GETPID(), ss->fd));
  785|       |
  786|       |    /* The server must not send this extension when negotiating < TLS 1.3. */
  787|     25|    if (ss->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|     25|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (787:9): [True: 1, False: 24]
  ------------------
  788|      1|        PORT_SetError(SSL_ERROR_EXTENSION_DISALLOWED_FOR_VERSION);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
  789|      1|        return SECFailure;
  790|      1|    }
  791|       |
  792|     24|    rv = ssl3_ExtConsumeHandshakeNumber(ss, &index, 2, &data->data, &data->len);
  793|     24|    if (rv != SECSuccess)
  ------------------
  |  Branch (793:9): [True: 1, False: 23]
  ------------------
  794|      1|        return SECFailure;
  795|       |
  796|       |    /* This should be the end of the extension. */
  797|     23|    if (data->len) {
  ------------------
  |  Branch (797:9): [True: 1, False: 22]
  ------------------
  798|      1|        PORT_SetError(SSL_ERROR_MALFORMED_PRE_SHARED_KEY);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
  799|      1|        return SECFailure;
  800|      1|    }
  801|       |
  802|       |    /* We only sent one PSK label so index must be equal to 0 */
  803|     22|    if (index) {
  ------------------
  |  Branch (803:9): [True: 14, False: 8]
  ------------------
  804|     14|        ssl3_ExtSendAlert(ss, alert_fatal, illegal_parameter);
  805|     14|        PORT_SetError(SSL_ERROR_MALFORMED_PRE_SHARED_KEY);
  ------------------
  |  |   65|     14|#define PORT_SetError PORT_SetError_Util
  ------------------
  806|     14|        return SECFailure;
  807|     14|    }
  808|       |
  809|      8|    PORT_Assert(!PR_CLIST_IS_EMPTY(&ss->ssl3.hs.psks));
  ------------------
  |  |  120|      8|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      8|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 8, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  810|      8|    sslPsk *candidate = (sslPsk *)PR_LIST_HEAD(&ss->ssl3.hs.psks);
  ------------------
  |  |   65|      8|#define PR_LIST_HEAD(_l) (_l)->next
  ------------------
  811|       |
  812|       |    /* Check that the server-selected ciphersuite hash and PSK hash match. */
  813|      8|    if (candidate->hash != tls13_GetHashForCipherSuite(ss->ssl3.hs.cipher_suite)) {
  ------------------
  |  Branch (813:9): [True: 1, False: 7]
  ------------------
  814|      1|        ssl3_ExtSendAlert(ss, alert_fatal, illegal_parameter);
  815|      1|        return SECFailure;
  816|      1|    }
  817|       |
  818|       |    /* Keep track of negotiated extensions. */
  819|      7|    xtnData->negotiated[xtnData->numNegotiated++] = ssl_tls13_pre_shared_key_xtn;
  820|      7|    xtnData->selectedPsk = candidate;
  821|       |
  822|      7|    return SECSuccess;
  823|      8|}
tls13_ClientSendEarlyDataXtn:
  831|  10.2k|{
  832|  10.2k|    if (!tls13_ClientAllow0Rtt(ss, ss->sec.ci.sid)) {
  ------------------
  |  Branch (832:9): [True: 10.2k, False: 0]
  ------------------
  833|  10.2k|        return SECSuccess;
  834|  10.2k|    }
  835|       |
  836|      0|    *added = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  837|      0|    return SECSuccess;
  838|  10.2k|}
tls13_ClientSendSupportedVersionsXtn:
  938|  10.2k|{
  939|  10.2k|    PRUint16 version;
  940|  10.2k|    unsigned int lengthOffset;
  941|  10.2k|    SECStatus rv;
  942|       |
  943|  10.2k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (943:9): [True: 1.40k, False: 8.81k]
  ------------------
  944|  1.40k|        return SECSuccess;
  945|  1.40k|    }
  946|       |
  947|  8.81k|    SSL_TRC(3, ("%d: TLS13[%d]: client send supported_versions extension",
  ------------------
  |  |   71|  8.81k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 8.81k]
  |  |  ------------------
  |  |   72|  8.81k|    ssl_Trace b
  ------------------
  948|  8.81k|                SSL_GETPID(), ss->fd));
  949|       |
  950|  8.81k|    rv = sslBuffer_Skip(buf, 1, &lengthOffset);
  951|  8.81k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (951:9): [True: 0, False: 8.81k]
  ------------------
  952|      0|        return SECFailure;
  953|      0|    }
  954|       |
  955|  8.81k|    PORT_Assert(!ss->ssl3.hs.echHpkeCtx || ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|  8.81k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  8.81k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 8.81k, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  956|  32.4k|    for (version = ss->vrange.max; version >= ss->vrange.min; --version) {
  ------------------
  |  Branch (956:36): [True: 23.6k, False: 8.81k]
  ------------------
  957|  23.6k|        PRUint16 wire = tls13_EncodeVersion(version,
  958|  23.6k|                                            ss->protocolVariant);
  959|  23.6k|        rv = sslBuffer_AppendNumber(buf, wire, 2);
  960|  23.6k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (960:13): [True: 0, False: 23.6k]
  ------------------
  961|      0|            return SECFailure;
  962|      0|        }
  963|       |
  964|  23.6k|        if (ss->opt.enableDtls13VersionCompat &&
  ------------------
  |  Branch (964:13): [True: 11.5k, False: 12.0k]
  ------------------
  965|  23.6k|            ss->protocolVariant == ssl_variant_datagram) {
  ------------------
  |  Branch (965:13): [True: 11.5k, False: 0]
  ------------------
  966|  11.5k|            switch (version) {
  967|  3.82k|                case SSL_LIBRARY_VERSION_TLS_1_2:
  ------------------
  |  |   20|  3.82k|#define SSL_LIBRARY_VERSION_TLS_1_2             0x0303
  ------------------
  |  Branch (967:17): [True: 3.82k, False: 7.72k]
  ------------------
  968|  7.20k|                case SSL_LIBRARY_VERSION_TLS_1_1:
  ------------------
  |  |   19|  7.20k|#define SSL_LIBRARY_VERSION_TLS_1_1             0x0302
  ------------------
  |  Branch (968:17): [True: 3.38k, False: 8.16k]
  ------------------
  969|  7.20k|                    rv = sslBuffer_AppendNumber(buf, (PRUint16)version, 2);
  970|  7.20k|                    break;
  971|  4.34k|                default:
  ------------------
  |  Branch (971:17): [True: 4.34k, False: 7.20k]
  ------------------
  972|  4.34k|                    continue;
  973|  11.5k|            }
  974|  7.20k|            if (rv != SECSuccess) {
  ------------------
  |  Branch (974:17): [True: 0, False: 7.20k]
  ------------------
  975|      0|                return SECFailure;
  976|      0|            }
  977|  7.20k|        }
  978|  23.6k|    }
  979|       |
  980|       |    /* GREASE SupportedVersions:
  981|       |     * A client MAY select one or more GREASE version values and advertise them
  982|       |     * in the "supported_versions" extension, if sent [RFC8701, Section 3.1]. */
  983|  8.81k|    if (ss->opt.enableGrease) {
  ------------------
  |  Branch (983:9): [True: 4.35k, False: 4.46k]
  ------------------
  984|  4.35k|        rv = sslBuffer_AppendNumber(buf, ss->ssl3.hs.grease->idx[grease_version], 2);
  985|  4.35k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (985:13): [True: 0, False: 4.35k]
  ------------------
  986|      0|            return SECFailure;
  987|      0|        }
  988|  4.35k|    }
  989|       |
  990|  8.81k|    rv = sslBuffer_InsertLength(buf, lengthOffset, 1);
  991|  8.81k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (991:9): [True: 0, False: 8.81k]
  ------------------
  992|      0|        return SECFailure;
  993|      0|    }
  994|       |
  995|  8.81k|    *added = PR_TRUE;
  ------------------
  |  |  437|  8.81k|#define PR_TRUE 1
  ------------------
  996|  8.81k|    return SECSuccess;
  997|  8.81k|}
tls13_ClientHandleHrrCookie:
 1031|    938|{
 1032|    938|    SECStatus rv;
 1033|       |
 1034|    938|    SSL_TRC(3, ("%d: TLS13[%d]: handle cookie extension",
  ------------------
  |  |   71|    938|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 938]
  |  |  ------------------
  |  |   72|    938|    ssl_Trace b
  ------------------
 1035|    938|                SSL_GETPID(), ss->fd));
 1036|       |
 1037|    938|    PORT_Assert(ss->vrange.max >= SSL_LIBRARY_VERSION_TLS_1_3);
  ------------------
  |  |  120|    938|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    938|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 938, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1038|       |
 1039|       |    /* IMPORTANT: this is only valid while the HelloRetryRequest is still valid. */
 1040|    938|    rv = ssl3_ExtConsumeHandshakeVariable(
 1041|    938|        ss, &CONST_CAST(sslSocket, ss)->ssl3.hs.cookie, 2,
  ------------------
  |  |   96|    938|#define CONST_CAST(T, X) ((T *)(X))
  ------------------
 1042|    938|        &data->data, &data->len);
 1043|    938|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1043:9): [True: 4, False: 934]
  ------------------
 1044|      4|        PORT_SetError(SSL_ERROR_RX_MALFORMED_HELLO_RETRY_REQUEST);
  ------------------
  |  |   65|      4|#define PORT_SetError PORT_SetError_Util
  ------------------
 1045|      4|        return SECFailure;
 1046|      4|    }
 1047|    934|    if (!ss->ssl3.hs.cookie.len || data->len) {
  ------------------
  |  Branch (1047:9): [True: 4, False: 930]
  |  Branch (1047:36): [True: 2, False: 928]
  ------------------
 1048|      6|        ssl3_ExtSendAlert(ss, alert_fatal, decode_error);
 1049|      6|        PORT_SetError(SSL_ERROR_RX_MALFORMED_HELLO_RETRY_REQUEST);
  ------------------
  |  |   65|      6|#define PORT_SetError PORT_SetError_Util
  ------------------
 1050|      6|        return SECFailure;
 1051|      6|    }
 1052|       |
 1053|    928|    return SECSuccess;
 1054|    934|}
tls13_ClientSendHrrCookieXtn:
 1059|  10.2k|{
 1060|  10.2k|    SECStatus rv;
 1061|       |
 1062|  10.2k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3 ||
  ------------------
  |  |   21|  20.4k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1062:9): [True: 1.40k, False: 8.81k]
  ------------------
 1063|  10.2k|        !ss->ssl3.hs.cookie.len) {
  ------------------
  |  Branch (1063:9): [True: 7.73k, False: 1.08k]
  ------------------
 1064|  9.13k|        return SECSuccess;
 1065|  9.13k|    }
 1066|       |
 1067|  1.08k|    SSL_TRC(3, ("%d: TLS13[%d]: send cookie extension", SSL_GETPID(), ss->fd));
  ------------------
  |  |   71|  1.08k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.08k]
  |  |  ------------------
  |  |   72|  1.08k|    ssl_Trace b
  ------------------
 1068|  1.08k|    rv = sslBuffer_AppendVariable(buf, ss->ssl3.hs.cookie.data,
 1069|  1.08k|                                  ss->ssl3.hs.cookie.len, 2);
 1070|  1.08k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1070:9): [True: 0, False: 1.08k]
  ------------------
 1071|      0|        return SECFailure;
 1072|      0|    }
 1073|       |
 1074|  1.08k|    *added = PR_TRUE;
  ------------------
  |  |  437|  1.08k|#define PR_TRUE 1
  ------------------
 1075|  1.08k|    return SECSuccess;
 1076|  1.08k|}
tls13_ClientSendPostHandshakeAuthXtn:
 1113|  10.2k|{
 1114|       |    /* Only one post-handshake message is supported: a single
 1115|       |     * NST immediately following the client Finished. */
 1116|  10.2k|    if (!IS_DTLS(ss)) {
  ------------------
  |  |  892|  10.2k|#define IS_DTLS(ss) (ss->protocolVariant == ssl_variant_datagram)
  ------------------
  |  Branch (1116:9): [True: 0, False: 10.2k]
  ------------------
 1117|      0|        SSL_TRC(3, ("%d: TLS13[%d]: send post_handshake_auth extension",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
 1118|      0|                    SSL_GETPID(), ss->fd));
 1119|      0|        *added = ss->opt.enablePostHandshakeAuth;
 1120|      0|    }
 1121|  10.2k|    return SECSuccess;
 1122|  10.2k|}
tls13_ClientSendPskModesXtn:
 1157|  10.2k|{
 1158|  10.2k|    SECStatus rv;
 1159|       |
 1160|  10.2k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3 ||
  ------------------
  |  |   21|  20.4k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1160:9): [True: 1.40k, False: 8.81k]
  ------------------
 1161|  10.2k|        ss->opt.noCache) {
  ------------------
  |  Branch (1161:9): [True: 4.25k, False: 4.55k]
  ------------------
 1162|  5.66k|        return SECSuccess;
 1163|  5.66k|    }
 1164|       |
 1165|  4.55k|    SSL_TRC(3, ("%d: TLS13[%d]: send psk key exchange modes extension",
  ------------------
  |  |   71|  4.55k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 4.55k]
  |  |  ------------------
  |  |   72|  4.55k|    ssl_Trace b
  ------------------
 1166|  4.55k|                SSL_GETPID(), ss->fd));
 1167|       |
 1168|       |    /* GREASE PskKeyExchangeMode:
 1169|       |     * A client MAY select one or more GREASE PskKeyExchangeMode values and
 1170|       |     * advertise them in the "psk_key_exchange_modes" extension, if sent
 1171|       |     * [RFC8701, Section 3.1]. */
 1172|  4.55k|    if (ss->opt.enableGrease) {
  ------------------
  |  Branch (1172:9): [True: 2.21k, False: 2.34k]
  ------------------
 1173|  2.21k|        rv = sslBuffer_AppendVariable(buf, (PRUint8[]){ tls13_psk_dh_ke, ss->ssl3.hs.grease->pskKem }, 2, 1);
 1174|  2.34k|    } else {
 1175|  2.34k|        rv = sslBuffer_AppendVariable(buf, (PRUint8[]){ tls13_psk_dh_ke }, 1, 1);
 1176|  2.34k|    }
 1177|  4.55k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1177:9): [True: 0, False: 4.55k]
  ------------------
 1178|      0|        return SECFailure;
 1179|      0|    }
 1180|       |
 1181|  4.55k|    *added = PR_TRUE;
  ------------------
  |  |  437|  4.55k|#define PR_TRUE 1
  ------------------
 1182|  4.55k|    return SECSuccess;
 1183|  4.55k|}
tls13_ClientSendDelegatedCredentialsXtn:
 1441|  10.2k|{
 1442|       |    /* Only send the extension if support is enabled and the client can
 1443|       |     * negotiate TLS 1.3. */
 1444|  10.2k|    if (ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3 ||
  ------------------
  |  |   21|  20.4k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1444:9): [True: 1.40k, False: 8.81k]
  ------------------
 1445|  10.2k|        !ss->opt.enableDelegatedCredentials) {
  ------------------
  |  Branch (1445:9): [True: 4.72k, False: 4.08k]
  ------------------
 1446|  6.13k|        return SECSuccess;
 1447|  6.13k|    }
 1448|       |
 1449|       |    /* Filter the schemes that are enabled and acceptable. Save these in
 1450|       |     * the "advertised" list, then encode them to be sent. If we receive
 1451|       |     * a DC in response, validate that it matches one of the advertised
 1452|       |     * schemes. */
 1453|  4.08k|    SSLSignatureScheme filtered[MAX_SIGNATURE_SCHEMES] = { 0 };
 1454|  4.08k|    unsigned int filteredCount = 0;
 1455|  4.08k|    SECStatus rv = ssl3_FilterSigAlgs(ss, ss->vrange.max,
 1456|  4.08k|                                      PR_TRUE /* disableRsae */,
  ------------------
  |  |  437|  4.08k|#define PR_TRUE 1
  ------------------
 1457|  4.08k|                                      PR_FALSE /* forCert */,
  ------------------
  |  |  438|  4.08k|#define PR_FALSE 0
  ------------------
 1458|  4.08k|                                      MAX_SIGNATURE_SCHEMES,
  ------------------
  |  |  250|  4.08k|#define MAX_SIGNATURE_SCHEMES 18
  ------------------
 1459|  4.08k|                                      filtered,
 1460|  4.08k|                                      &filteredCount);
 1461|  4.08k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1461:9): [True: 0, False: 4.08k]
  ------------------
 1462|      0|        return SECFailure;
 1463|      0|    }
 1464|       |
 1465|       |    /* If no schemes available for the DC extension, don't send it. */
 1466|  4.08k|    if (!filteredCount) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 4.08k]
  ------------------
 1467|      0|        return SECSuccess;
 1468|      0|    }
 1469|       |
 1470|  4.08k|    rv = ssl3_EncodeFilteredSigAlgs(ss, filtered, filteredCount,
 1471|  4.08k|                                    PR_FALSE /* GREASE */, buf);
  ------------------
  |  |  438|  4.08k|#define PR_FALSE 0
  ------------------
 1472|  4.08k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1472:9): [True: 0, False: 4.08k]
  ------------------
 1473|      0|        return SECFailure;
 1474|      0|    }
 1475|       |
 1476|  4.08k|    SSLSignatureScheme *dcSchemesAdvertised = PORT_ZNewArray(SSLSignatureScheme,
  ------------------
  |  |  159|  4.08k|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|  4.08k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
 1477|  4.08k|                                                             filteredCount);
 1478|  4.08k|    if (!dcSchemesAdvertised) {
  ------------------
  |  Branch (1478:9): [True: 0, False: 4.08k]
  ------------------
 1479|      0|        return SECFailure;
 1480|      0|    }
 1481|  20.4k|    for (unsigned int i = 0; i < filteredCount; i++) {
  ------------------
  |  Branch (1481:30): [True: 16.3k, False: 4.08k]
  ------------------
 1482|  16.3k|        dcSchemesAdvertised[i] = filtered[i];
 1483|  16.3k|    }
 1484|       |
 1485|  4.08k|    if (xtnData->delegCredSigSchemesAdvertised) {
  ------------------
  |  Branch (1485:9): [True: 0, False: 4.08k]
  ------------------
 1486|      0|        PORT_Free(xtnData->delegCredSigSchemesAdvertised);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1487|      0|    }
 1488|  4.08k|    xtnData->delegCredSigSchemesAdvertised = dcSchemesAdvertised;
 1489|  4.08k|    xtnData->numDelegCredSigSchemesAdvertised = filteredCount;
 1490|  4.08k|    *added = PR_TRUE;
  ------------------
  |  |  437|  4.08k|#define PR_TRUE 1
  ------------------
 1491|  4.08k|    return SECSuccess;
 1492|  4.08k|}
tls13_SendEmptyGreaseXtn:
 1850|  10.2k|{
 1851|  10.2k|    if (!ss->opt.enableGrease ||
  ------------------
  |  Branch (1851:9): [True: 5.16k, False: 5.05k]
  ------------------
 1852|  10.2k|        (!ss->sec.isServer && ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3) ||
  ------------------
  |  |   21|  5.05k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1852:10): [True: 5.05k, False: 0]
  |  Branch (1852:31): [True: 706, False: 4.35k]
  ------------------
 1853|  10.2k|        (ss->sec.isServer && ss->version < SSL_LIBRARY_VERSION_TLS_1_3)) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1853:10): [True: 0, False: 4.35k]
  |  Branch (1853:30): [True: 0, False: 0]
  ------------------
 1854|  5.86k|        return SECSuccess;
 1855|  5.86k|    }
 1856|       |
 1857|  4.35k|    *added = PR_TRUE;
  ------------------
  |  |  437|  4.35k|#define PR_TRUE 1
  ------------------
 1858|  4.35k|    return SECSuccess;
 1859|  10.2k|}
tls13_SendGreaseXtn:
 1865|  10.2k|{
 1866|  10.2k|    if (!ss->opt.enableGrease ||
  ------------------
  |  Branch (1866:9): [True: 5.16k, False: 5.05k]
  ------------------
 1867|  10.2k|        (!ss->sec.isServer && ss->vrange.max < SSL_LIBRARY_VERSION_TLS_1_3) ||
  ------------------
  |  |   21|  5.05k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1867:10): [True: 5.05k, False: 0]
  |  Branch (1867:31): [True: 706, False: 4.35k]
  ------------------
 1868|  10.2k|        (ss->sec.isServer && ss->version < SSL_LIBRARY_VERSION_TLS_1_3)) {
  ------------------
  |  |   21|      0|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1868:10): [True: 0, False: 4.35k]
  |  Branch (1868:30): [True: 0, False: 0]
  ------------------
 1869|  5.86k|        return SECSuccess;
 1870|  5.86k|    }
 1871|       |
 1872|  4.35k|    SECStatus rv = sslBuffer_AppendVariable(buf, (PRUint8[]){ 0x00 }, 1, 2);
 1873|  4.35k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1873:9): [True: 0, False: 4.35k]
  ------------------
 1874|      0|        return SECFailure;
 1875|      0|    }
 1876|       |
 1877|  4.35k|    *added = PR_TRUE;
  ------------------
  |  |  437|  4.35k|#define PR_TRUE 1
  ------------------
 1878|  4.35k|    return SECSuccess;
 1879|  4.35k|}
ssl3_SendCertificateCompressionXtn:
 1885|  10.2k|{
 1886|       |    /* enum {
 1887|       |     *  zlib(1),
 1888|       |     *  brotli(2),
 1889|       |     *  zstd(3),
 1890|       |     *  (65535)
 1891|       |     * } CertificateCompressionAlgorithm;
 1892|       |     *
 1893|       |     * struct {
 1894|       |     *      CertificateCompressionAlgorithm algorithms<2..2^8-2>;
 1895|       |     *  } CertificateCompressionAlgorithms;
 1896|       |     */
 1897|       |
 1898|  10.2k|    SECStatus rv = SECFailure;
 1899|  10.2k|    if (ss->ssl3.cwSpec->version < SSL_LIBRARY_VERSION_TLS_1_3) {
  ------------------
  |  |   21|  10.2k|#define SSL_LIBRARY_VERSION_TLS_1_3             0x0304
  ------------------
  |  Branch (1899:9): [True: 1.40k, False: 8.81k]
  ------------------
 1900|  1.40k|        SSL_TRC(50, ("%d: TLS13[%d]: certificate_compression_algorithm extension requires TLS1.3 and above",
  ------------------
  |  |   71|  1.40k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 1.40k]
  |  |  ------------------
  |  |   72|  1.40k|    ssl_Trace b
  ------------------
 1901|  1.40k|                     SSL_GETPID(), ss->fd));
 1902|  1.40k|        return SECSuccess;
 1903|  1.40k|    }
 1904|       |
 1905|  8.81k|    size_t certificateCompressionAlgorithmsLen = ss->ssl3.supportedCertCompressionAlgorithmsCount;
 1906|  8.81k|    if (certificateCompressionAlgorithmsLen == 0) {
  ------------------
  |  Branch (1906:9): [True: 4.31k, False: 4.49k]
  ------------------
 1907|  4.31k|        SSL_TRC(30, ("%d: TLS13[%d]: %s does not support any certificate compression algorithm",
  ------------------
  |  |   71|  4.31k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 4.31k]
  |  |  ------------------
  |  |   72|  4.31k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1908|  4.31k|                     SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
 1909|  4.31k|        return SECSuccess;
 1910|  4.31k|    }
 1911|       |
 1912|  4.49k|    SSL_TRC(30, ("%d: TLS13[%d]: %s sends certificate_compression_algorithm extension",
  ------------------
  |  |   71|  4.49k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 4.49k]
  |  |  ------------------
  |  |   72|  4.49k|    ssl_Trace b
  |  |  ------------------
  |  |  |  Branch (72:15): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1913|  4.49k|                 SSL_GETPID(), ss->fd, SSL_ROLE(ss)));
 1914|  4.49k|    PORT_Assert(certificateCompressionAlgorithmsLen < (0x1u << 8) - 1);
  ------------------
  |  |  120|  4.49k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  4.49k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 4.49k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1915|       |
 1916|  4.49k|    rv = sslBuffer_AppendNumber(buf, certificateCompressionAlgorithmsLen << 1, 1);
 1917|  4.49k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (1917:9): [True: 0, False: 4.49k]
  ------------------
 1918|      0|        return SECFailure;
 1919|      0|    }
 1920|       |
 1921|  8.99k|    for (size_t i = 0; i < certificateCompressionAlgorithmsLen; i++) {
  ------------------
  |  Branch (1921:24): [True: 4.49k, False: 4.49k]
  ------------------
 1922|  4.49k|        rv = sslBuffer_AppendNumber(buf, ss->ssl3.supportedCertCompressionAlgorithms[i].id, 2);
 1923|  4.49k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (1923:13): [True: 0, False: 4.49k]
  ------------------
 1924|      0|            return SECFailure;
 1925|      0|        }
 1926|  4.49k|    }
 1927|       |
 1928|  4.49k|    xtnData->certificateCompressionAdvertised = PR_TRUE;
  ------------------
  |  |  437|  4.49k|#define PR_TRUE 1
  ------------------
 1929|  4.49k|    *added = PR_TRUE;
  ------------------
  |  |  437|  4.49k|#define PR_TRUE 1
  ------------------
 1930|  4.49k|    return SECSuccess;
 1931|  4.49k|}
tls13exthandle.c:tls13_WriteKeyExchangeInfo:
  152|  8.81k|{
  153|  8.81k|    SECStatus rv;
  154|  8.81k|    const SECKEYPublicKey *pubKey = keyPair->keys->pubKey;
  155|  8.81k|    switch (pubKey->keyType) {
  156|  7.93k|        case ecKey:
  ------------------
  |  Branch (156:9): [True: 7.93k, False: 874]
  ------------------
  157|  7.93k|            rv = sslBuffer_Append(buf, pubKey->u.ec.publicValue.data,
  158|  7.93k|                                  pubKey->u.ec.publicValue.len);
  159|  7.93k|            break;
  160|    874|        case dhKey:
  ------------------
  |  Branch (160:9): [True: 874, False: 7.93k]
  ------------------
  161|    874|            rv = ssl_AppendPaddedDHKeyShare(buf, pubKey, PR_FALSE);
  ------------------
  |  |  438|    874|#define PR_FALSE 0
  ------------------
  162|    874|            break;
  163|      0|        default:
  ------------------
  |  Branch (163:9): [True: 0, False: 8.81k]
  ------------------
  164|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  166|      0|            rv = SECFailure;
  167|      0|            break;
  168|  8.81k|    }
  169|       |
  170|  8.81k|    return rv;
  171|  8.81k|}

tls13_HkdfExtract:
   36|  6.46k|{
   37|  6.46k|    CK_HKDF_PARAMS params;
   38|  6.46k|    SECItem paramsi;
   39|  6.46k|    PK11SymKey *prk;
   40|  6.46k|    static const PRUint8 zeroKeyBuf[HASH_LENGTH_MAX];
   41|  6.46k|    SECItem zeroKeyItem = { siBuffer, CONST_CAST(PRUint8, zeroKeyBuf), kTlsHkdfInfo[baseHash].hashSize };
  ------------------
  |  |   96|  6.46k|#define CONST_CAST(T, X) ((T *)(X))
  ------------------
   42|  6.46k|    PK11SlotInfo *slot = NULL;
   43|  6.46k|    PK11SymKey *newIkm2 = NULL;
   44|  6.46k|    PK11SymKey *newIkm1 = NULL;
   45|  6.46k|    SECStatus rv;
   46|       |
   47|  6.46k|    params.bExtract = CK_TRUE;
  ------------------
  |  |   22|  6.46k|#define CK_TRUE 1
  ------------------
   48|  6.46k|    params.bExpand = CK_FALSE;
  ------------------
  |  |   23|  6.46k|#define CK_FALSE 0
  ------------------
   49|  6.46k|    params.prfHashMechanism = kTlsHkdfInfo[baseHash].pkcs11Mech;
   50|  6.46k|    params.pInfo = NULL;
   51|  6.46k|    params.ulInfoLen = 0UL;
   52|  6.46k|    params.pSalt = NULL;
   53|  6.46k|    params.ulSaltLen = 0UL;
   54|  6.46k|    params.hSaltKey = CK_INVALID_HANDLE;
  ------------------
  |  |   78|  6.46k|#define CK_INVALID_HANDLE 0
  ------------------
   55|       |
   56|  6.46k|    if (!ikm1) {
  ------------------
  |  Branch (56:9): [True: 4.76k, False: 1.69k]
  ------------------
   57|       |        /* PKCS #11 v3.0 has and explict NULL value, which equates to
   58|       |         * a sequence of zeros equal in length to the HMAC. */
   59|  4.76k|        params.ulSaltType = CKF_HKDF_SALT_NULL;
  ------------------
  |  | 2252|  4.76k|#define CKF_HKDF_SALT_NULL 0x00000001UL
  ------------------
   60|  4.76k|    } else {
   61|       |        /* PKCS #11 v3.0 can take the salt as a key handle */
   62|  1.69k|        params.hSaltKey = PK11_GetSymKeyHandle(ikm1);
   63|  1.69k|        params.ulSaltType = CKF_HKDF_SALT_KEY;
  ------------------
  |  | 2254|  1.69k|#define CKF_HKDF_SALT_KEY 0x00000004UL
  ------------------
   64|       |
   65|       |        /* if we have both keys, make sure they are in the same slot */
   66|  1.69k|        if (ikm2) {
  ------------------
  |  Branch (66:13): [True: 846, False: 846]
  ------------------
   67|    846|            rv = PK11_SymKeysToSameSlot(CKM_HKDF_DERIVE,
  ------------------
  |  | 1296|    846|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
   68|    846|                                        CKA_DERIVE, CKA_DERIVE,
  ------------------
  |  |  555|    846|#define CKA_DERIVE 0x0000010CUL
  ------------------
                                                      CKA_DERIVE, CKA_DERIVE,
  ------------------
  |  |  555|    846|#define CKA_DERIVE 0x0000010CUL
  ------------------
   69|    846|                                        ikm2, ikm1, &newIkm2, &newIkm1);
   70|    846|            if (rv != SECSuccess) {
  ------------------
  |  Branch (70:17): [True: 0, False: 846]
  ------------------
   71|      0|                SECItem *salt;
   72|       |                /* couldn't move the keys, try extracting the salt */
   73|      0|                rv = PK11_ExtractKeyValue(ikm1);
   74|      0|                if (rv != SECSuccess)
  ------------------
  |  Branch (74:21): [True: 0, False: 0]
  ------------------
   75|      0|                    return rv;
   76|      0|                salt = PK11_GetKeyData(ikm1);
   77|      0|                if (!salt)
  ------------------
  |  Branch (77:21): [True: 0, False: 0]
  ------------------
   78|      0|                    return SECFailure;
   79|      0|                PORT_Assert(salt->len > 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   80|       |                /* Set up for Salt as Data instead of Salt as key */
   81|      0|                params.pSalt = salt->data;
   82|      0|                params.ulSaltLen = salt->len;
   83|      0|                params.ulSaltType = CKF_HKDF_SALT_DATA;
  ------------------
  |  | 2253|      0|#define CKF_HKDF_SALT_DATA 0x00000002UL
  ------------------
   84|      0|            }
   85|       |            /* use the new keys */
   86|    846|            if (newIkm1) {
  ------------------
  |  Branch (86:17): [True: 840, False: 6]
  ------------------
   87|       |                /* we've moved the key, get the handle for the new key */
   88|    840|                params.hSaltKey = PK11_GetSymKeyHandle(newIkm1);
   89|       |                /* we don't use ikm1 after this, so don't bother setting it */
   90|    840|            }
   91|    846|            if (newIkm2) {
  ------------------
  |  Branch (91:17): [True: 0, False: 846]
  ------------------
   92|       |                /* new ikm2 key, use the new key */
   93|      0|                ikm2 = newIkm2;
   94|      0|            }
   95|    846|        }
   96|  1.69k|    }
   97|  6.46k|    paramsi.data = (unsigned char *)&params;
   98|  6.46k|    paramsi.len = sizeof(params);
   99|       |
  100|  6.46k|    PORT_Assert(kTlsHkdfInfo[baseHash].pkcs11Mech);
  ------------------
  |  |  120|  6.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  6.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  101|  6.46k|    PORT_Assert(kTlsHkdfInfo[baseHash].hashSize);
  ------------------
  |  |  120|  6.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  6.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  102|  6.46k|    PORT_Assert(kTlsHkdfInfo[baseHash].hash == baseHash);
  ------------------
  |  |  120|  6.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  6.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  103|       |
  104|       |    /* A zero ikm2 is a key of hash-length 0s. */
  105|  6.46k|    if (!ikm2) {
  ------------------
  |  Branch (105:9): [True: 1.68k, False: 4.77k]
  ------------------
  106|       |        /* if we have ikm1, put the zero key in the same slot */
  107|  1.68k|        slot = ikm1 ? PK11_GetSlotFromKey(ikm1) : PK11_GetBestSlot(CKM_HKDF_DERIVE, NULL);
  ------------------
  |  | 1296|    840|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
  |  Branch (107:16): [True: 846, False: 840]
  ------------------
  108|  1.68k|        if (!slot) {
  ------------------
  |  Branch (108:13): [True: 0, False: 1.68k]
  ------------------
  109|      0|            return SECFailure;
  110|      0|        }
  111|       |
  112|  1.68k|        newIkm2 = PK11_ImportDataKey(slot, CKM_HKDF_DERIVE, PK11_OriginUnwrap,
  ------------------
  |  | 1296|  1.68k|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
  113|  1.68k|                                     CKA_DERIVE, &zeroKeyItem, NULL);
  ------------------
  |  |  555|  1.68k|#define CKA_DERIVE 0x0000010CUL
  ------------------
  114|  1.68k|        if (!newIkm2) {
  ------------------
  |  Branch (114:13): [True: 0, False: 1.68k]
  ------------------
  115|      0|            return SECFailure;
  116|      0|        }
  117|  1.68k|        ikm2 = newIkm2;
  118|  1.68k|    }
  119|  6.46k|    PORT_Assert(ikm2);
  ------------------
  |  |  120|  6.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  6.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 6.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  120|       |
  121|  6.46k|    PRINT_BUF(50, (NULL, "HKDF Extract: IKM1/Salt", params.pSalt, params.ulSaltLen));
  ------------------
  |  |   74|  6.46k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 6.46k]
  |  |  ------------------
  |  |   75|  6.46k|    ssl_PrintBuf b
  ------------------
  122|  6.46k|    PRINT_KEY(50, (NULL, "HKDF Extract: IKM2", ikm2));
  ------------------
  |  |   77|  6.46k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (77:9): [True: 0, False: 6.46k]
  |  |  ------------------
  |  |   78|  6.46k|    ssl_PrintKey b
  ------------------
  123|       |
  124|  6.46k|    prk = PK11_Derive(ikm2, CKM_HKDF_DERIVE, &paramsi, CKM_HKDF_DERIVE,
  ------------------
  |  | 1296|  6.46k|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
                  prk = PK11_Derive(ikm2, CKM_HKDF_DERIVE, &paramsi, CKM_HKDF_DERIVE,
  ------------------
  |  | 1296|  6.46k|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
  125|  6.46k|                      CKA_DERIVE, 0);
  ------------------
  |  |  555|  6.46k|#define CKA_DERIVE 0x0000010CUL
  ------------------
  126|  6.46k|    PK11_FreeSymKey(newIkm2);
  127|  6.46k|    PK11_FreeSymKey(newIkm1);
  128|  6.46k|    if (slot)
  ------------------
  |  Branch (128:9): [True: 1.68k, False: 4.77k]
  ------------------
  129|  1.68k|        PK11_FreeSlot(slot);
  130|  6.46k|    if (!prk) {
  ------------------
  |  Branch (130:9): [True: 0, False: 6.46k]
  ------------------
  131|      0|        return SECFailure;
  132|      0|    }
  133|       |
  134|  6.46k|    PRINT_KEY(50, (NULL, "HKDF Extract", prk));
  ------------------
  |  |   77|  6.46k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (77:9): [True: 0, False: 6.46k]
  |  |  ------------------
  |  |   78|  6.46k|    ssl_PrintKey b
  ------------------
  135|  6.46k|    *prkp = prk;
  136|       |
  137|  6.46k|    return SECSuccess;
  138|  6.46k|}
tls13_HkdfExpandLabelGeneral:
  147|  14.4k|{
  148|  14.4k|    CK_HKDF_PARAMS params;
  149|  14.4k|    SECItem paramsi = { siBuffer, NULL, 0 };
  150|       |    /* Size of info array needs to be big enough to hold the maximum Prefix,
  151|       |     * Label, plus HandshakeHash. If it's ever to small, the code will abort.
  152|       |     */
  153|  14.4k|    PRUint8 info[256];
  154|  14.4k|    sslBuffer infoBuf = SSL_BUFFER(info);
  ------------------
  |  |   34|  14.4k|#define SSL_BUFFER(b) SSL_BUFFER_FIXED(b, sizeof(b))
  |  |  ------------------
  |  |  |  |   27|  14.4k|    {                               \
  |  |  |  |   28|  14.4k|        b, 0, maxlen, PR_TRUE       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  437|  14.4k|#define PR_TRUE 1
  |  |  |  |  ------------------
  |  |  |  |   29|  14.4k|    }
  |  |  ------------------
  ------------------
  155|  14.4k|    PK11SymKey *derived;
  156|  14.4k|    SECStatus rv;
  157|  14.4k|    const char *kLabelPrefixTls = "tls13 ";
  158|  14.4k|    const char *kLabelPrefixDtls = "dtls13";
  159|  14.4k|    const unsigned int kLabelPrefixLen =
  160|  14.4k|        (variant == ssl_variant_stream) ? strlen(kLabelPrefixTls) : strlen(kLabelPrefixDtls);
  ------------------
  |  Branch (160:9): [True: 0, False: 14.4k]
  ------------------
  161|  14.4k|    const char *kLabelPrefix =
  162|  14.4k|        (variant == ssl_variant_stream) ? kLabelPrefixTls : kLabelPrefixDtls;
  ------------------
  |  Branch (162:9): [True: 0, False: 14.4k]
  ------------------
  163|       |
  164|  14.4k|    PORT_Assert(prk);
  ------------------
  |  |  120|  14.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|  14.4k|    PORT_Assert(keyp);
  ------------------
  |  |  120|  14.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  14.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 14.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|  14.4k|    if ((handshakeHashLen > 255) ||
  ------------------
  |  Branch (166:9): [True: 0, False: 14.4k]
  ------------------
  167|  14.4k|        (handshakeHash == NULL && handshakeHashLen > 0) ||
  ------------------
  |  Branch (167:10): [True: 7.15k, False: 7.31k]
  |  Branch (167:35): [True: 0, False: 7.15k]
  ------------------
  168|  14.4k|        (labelLen + kLabelPrefixLen > 255)) {
  ------------------
  |  Branch (168:9): [True: 0, False: 14.4k]
  ------------------
  169|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  170|      0|        return SECFailure;
  171|      0|    }
  172|       |
  173|       |    /*
  174|       |     *  [draft-ietf-tls-tls13-11] Section 7.1:
  175|       |     *
  176|       |     *  HKDF-Expand-Label(Secret, Label, HashValue, Length) =
  177|       |     *       HKDF-Expand(Secret, HkdfLabel, Length)
  178|       |     *
  179|       |     *  Where HkdfLabel is specified as:
  180|       |     *
  181|       |     *  struct HkdfLabel {
  182|       |     *    uint16 length;
  183|       |     *    opaque label<9..255>;
  184|       |     *    opaque hash_value<0..255>;
  185|       |     *  };
  186|       |     *
  187|       |     *  Where:
  188|       |     *  - HkdfLabel.length is Length
  189|       |     *  - HkdfLabel.hash_value is HashValue.
  190|       |     *  - HkdfLabel.label is "TLS 1.3, " + Label
  191|       |     *
  192|       |     */
  193|  14.4k|    rv = sslBuffer_AppendNumber(&infoBuf, keySize, 2);
  194|  14.4k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (194:9): [True: 0, False: 14.4k]
  ------------------
  195|      0|        return SECFailure;
  196|      0|    }
  197|  14.4k|    rv = sslBuffer_AppendNumber(&infoBuf, labelLen + kLabelPrefixLen, 1);
  198|  14.4k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (198:9): [True: 0, False: 14.4k]
  ------------------
  199|      0|        return SECFailure;
  200|      0|    }
  201|  14.4k|    rv = sslBuffer_Append(&infoBuf, kLabelPrefix, kLabelPrefixLen);
  202|  14.4k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (202:9): [True: 0, False: 14.4k]
  ------------------
  203|      0|        return SECFailure;
  204|      0|    }
  205|  14.4k|    rv = sslBuffer_Append(&infoBuf, label, labelLen);
  206|  14.4k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (206:9): [True: 0, False: 14.4k]
  ------------------
  207|      0|        return SECFailure;
  208|      0|    }
  209|  14.4k|    rv = sslBuffer_AppendVariable(&infoBuf, handshakeHash, handshakeHashLen, 1);
  210|  14.4k|    if (rv != SECSuccess) {
  ------------------
  |  Branch (210:9): [True: 0, False: 14.4k]
  ------------------
  211|      0|        return SECFailure;
  212|      0|    }
  213|       |
  214|  14.4k|    params.bExtract = CK_FALSE;
  ------------------
  |  |   23|  14.4k|#define CK_FALSE 0
  ------------------
  215|  14.4k|    params.bExpand = CK_TRUE;
  ------------------
  |  |   22|  14.4k|#define CK_TRUE 1
  ------------------
  216|  14.4k|    params.prfHashMechanism = kTlsHkdfInfo[baseHash].pkcs11Mech;
  217|  14.4k|    params.pInfo = SSL_BUFFER_BASE(&infoBuf);
  ------------------
  |  |   35|  14.4k|#define SSL_BUFFER_BASE(b) ((b)->buf)
  ------------------
  218|  14.4k|    params.ulInfoLen = SSL_BUFFER_LEN(&infoBuf);
  ------------------
  |  |   36|  14.4k|#define SSL_BUFFER_LEN(b) ((b)->len)
  ------------------
  219|  14.4k|    paramsi.data = (unsigned char *)&params;
  220|  14.4k|    paramsi.len = sizeof(params);
  221|  14.4k|    derived = PK11_DeriveWithFlags(prk, deriveMech,
  222|  14.4k|                                   &paramsi, algorithm,
  223|  14.4k|                                   CKA_DERIVE, keySize,
  ------------------
  |  |  555|  14.4k|#define CKA_DERIVE 0x0000010CUL
  ------------------
  224|  14.4k|                                   CKF_SIGN | CKF_VERIFY);
  ------------------
  |  | 1356|  14.4k|#define CKF_SIGN 0x00000800UL
  ------------------
                                                 CKF_SIGN | CKF_VERIFY);
  ------------------
  |  | 1358|  14.4k|#define CKF_VERIFY 0x00002000
  ------------------
  225|  14.4k|    if (!derived) {
  ------------------
  |  Branch (225:9): [True: 0, False: 14.4k]
  ------------------
  226|      0|        return SECFailure;
  227|      0|    }
  228|       |
  229|  14.4k|    *keyp = derived;
  230|       |
  231|  14.4k|#ifdef TRACE
  232|  14.4k|    if (ssl_trace >= 50) {
  ------------------
  |  Branch (232:9): [True: 0, False: 14.4k]
  ------------------
  233|       |        /* Make sure the label is null terminated. */
  234|      0|        char labelStr[100];
  235|      0|        PORT_Memcpy(labelStr, label, labelLen);
  ------------------
  |  |  180|      0|#define PORT_Memcpy memcpy
  ------------------
  236|      0|        labelStr[labelLen] = 0;
  237|      0|        SSL_TRC(50, ("HKDF Expand: label='tls13 %s',requested length=%d",
  ------------------
  |  |   71|      0|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (71:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   72|      0|    ssl_Trace b
  ------------------
  238|      0|                     labelStr, keySize));
  239|      0|    }
  240|  14.4k|    PRINT_KEY(50, (NULL, "PRK", prk));
  ------------------
  |  |   77|  14.4k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (77:9): [True: 0, False: 14.4k]
  |  |  ------------------
  |  |   78|  14.4k|    ssl_PrintKey b
  ------------------
  241|  14.4k|    PRINT_BUF(50, (NULL, "Hash", handshakeHash, handshakeHashLen));
  ------------------
  |  |   74|  14.4k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 14.4k]
  |  |  ------------------
  |  |   75|  14.4k|    ssl_PrintBuf b
  ------------------
  242|  14.4k|    PRINT_BUF(50, (NULL, "Info", SSL_BUFFER_BASE(&infoBuf),
  ------------------
  |  |   74|  14.4k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (74:9): [True: 0, False: 14.4k]
  |  |  ------------------
  |  |   75|  14.4k|    ssl_PrintBuf b
  ------------------
  243|  14.4k|                   SSL_BUFFER_LEN(&infoBuf)));
  244|  14.4k|    PRINT_KEY(50, (NULL, "Derived key", derived));
  ------------------
  |  |   77|  14.4k|    if (ssl_trace >= (a)) \
  |  |  ------------------
  |  |  |  Branch (77:9): [True: 0, False: 14.4k]
  |  |  ------------------
  |  |   78|  14.4k|    ssl_PrintKey b
  ------------------
  245|  14.4k|#endif
  246|       |
  247|  14.4k|    return SECSuccess;
  248|  14.4k|}
tls13_HkdfExpandLabel:
  256|  13.5k|{
  257|  13.5k|    return tls13_HkdfExpandLabelGeneral(CKM_HKDF_DERIVE, prk, baseHash,
  ------------------
  |  | 1296|  13.5k|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
  258|  13.5k|                                        handshakeHash, handshakeHashLen,
  259|  13.5k|                                        label, labelLen, algorithm, keySize,
  260|  13.5k|                                        variant, keyp);
  261|  13.5k|}
tls13_HkdfExpandLabelRaw:
  269|    897|{
  270|    897|    PK11SymKey *derived = NULL;
  271|    897|    SECItem *rawkey;
  272|    897|    SECStatus rv;
  273|       |
  274|       |    /* the result is not really a key, it's a data object */
  275|    897|    rv = tls13_HkdfExpandLabelGeneral(CKM_HKDF_DATA, prk, baseHash,
  ------------------
  |  | 1297|    897|#define CKM_HKDF_DATA 0x0000402bUL
  ------------------
  276|    897|                                      handshakeHash, handshakeHashLen,
  277|    897|                                      label, labelLen, CKM_HKDF_DERIVE, outputLen,
  ------------------
  |  | 1296|    897|#define CKM_HKDF_DERIVE 0x0000402aUL
  ------------------
  278|    897|                                      variant, &derived);
  279|    897|    if (rv != SECSuccess || !derived) {
  ------------------
  |  Branch (279:9): [True: 0, False: 897]
  |  Branch (279:29): [True: 0, False: 897]
  ------------------
  280|      0|        goto abort;
  281|      0|    }
  282|       |
  283|    897|    rv = PK11_ExtractKeyValue(derived);
  284|    897|    if (rv != SECSuccess) {
  ------------------
  |  Branch (284:9): [True: 0, False: 897]
  ------------------
  285|      0|        goto abort;
  286|      0|    }
  287|       |
  288|    897|    rawkey = PK11_GetKeyData(derived);
  289|    897|    if (!rawkey) {
  ------------------
  |  Branch (289:9): [True: 0, False: 897]
  ------------------
  290|      0|        goto abort;
  291|      0|    }
  292|       |
  293|    897|    PORT_Assert(rawkey->len == outputLen);
  ------------------
  |  |  120|    897|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    897|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 897, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  294|    897|    memcpy(output, rawkey->data, outputLen);
  295|    897|    PK11_FreeSymKey(derived);
  296|       |
  297|    897|    return SECSuccess;
  298|       |
  299|      0|abort:
  300|      0|    if (derived) {
  ------------------
  |  Branch (300:9): [True: 0, False: 0]
  ------------------
  301|      0|        PK11_FreeSymKey(derived);
  302|      0|    }
  303|      0|    PORT_SetError(SSL_ERROR_SYM_KEY_CONTEXT_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  304|      0|    return SECFailure;
  305|    897|}

SSLExp_AddExternalPsk0Rtt:
   21|  4.62k|{
   22|       |
   23|  4.62k|    sslSocket *ss = ssl_FindSocket(fd);
   24|  4.62k|    if (!ss) {
  ------------------
  |  Branch (24:9): [True: 0, False: 4.62k]
  ------------------
   25|      0|        SSL_DBG(("%d: SSL[%d]: bad socket in SSLExp_SetExternalPsk",
  ------------------
  |  |   87|      0|    if (ssl_debug) \
  |  |  ------------------
  |  |  |  Branch (87:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|    ssl_Trace b
  ------------------
   26|      0|                 SSL_GETPID(), fd));
   27|      0|        return SECFailure;
   28|      0|    }
   29|       |
   30|  4.62k|    if (!key || !identity || !identityLen || identityLen > 0xFFFF ||
  ------------------
  |  Branch (30:9): [True: 0, False: 4.62k]
  |  Branch (30:17): [True: 0, False: 4.62k]
  |  Branch (30:30): [True: 0, False: 4.62k]
  |  Branch (30:46): [True: 0, False: 4.62k]
  ------------------
   31|  4.62k|        (hash != ssl_hash_sha256 && hash != ssl_hash_sha384)) {
  ------------------
  |  Branch (31:10): [True: 3.54k, False: 1.08k]
  |  Branch (31:37): [True: 0, False: 3.54k]
  ------------------
   32|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   33|      0|        return SECFailure;
   34|      0|    }
   35|       |
   36|  4.62k|    SECItem label = { siBuffer, CONST_CAST(unsigned char, identity), identityLen };
  ------------------
  |  |   96|  4.62k|#define CONST_CAST(T, X) ((T *)(X))
  ------------------
   37|  4.62k|    sslPsk *psk = tls13_MakePsk(PK11_ReferenceSymKey(key), ssl_psk_external,
   38|  4.62k|                                hash, &label);
   39|  4.62k|    if (!psk) {
  ------------------
  |  Branch (39:9): [True: 0, False: 4.62k]
  ------------------
   40|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   41|      0|        return SECFailure;
   42|      0|    }
   43|  4.62k|    psk->zeroRttSuite = zeroRttSuite;
   44|  4.62k|    psk->maxEarlyData = maxEarlyData;
   45|  4.62k|    SECStatus rv = SECFailure;
   46|       |
   47|  4.62k|    ssl_Get1stHandshakeLock(ss);
  ------------------
  |  | 1390|  4.62k|    {                                                             \
  |  | 1391|  4.62k|        if (!ss->opt.noLocks) {                                   \
  |  |  ------------------
  |  |  |  Branch (1391:13): [True: 4.62k, False: 0]
  |  |  ------------------
  |  | 1392|  4.62k|            PORT_Assert(PZ_InMonitor((ss)->firstHandshakeLock) || \
  |  |  ------------------
  |  |  |  |  120|  4.62k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  9.25k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:7): [True: 0, False: 4.62k]
  |  |  |  |  |  |  |  Branch (208:7): [True: 4.62k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1393|  4.62k|                        !ssl_HaveRecvBufLock(ss));                \
  |  | 1394|  4.62k|            PZ_EnterMonitor((ss)->firstHandshakeLock);            \
  |  |  ------------------
  |  |  |  |  256|  4.62k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1395|  4.62k|        }                                                         \
  |  | 1396|  4.62k|    }
  ------------------
   48|  4.62k|    ssl_GetSSL3HandshakeLock(ss);
  ------------------
  |  | 1407|  4.62k|    {                                                 \
  |  | 1408|  4.62k|        if (!ss->opt.noLocks) {                       \
  |  |  ------------------
  |  |  |  Branch (1408:13): [True: 4.62k, False: 0]
  |  |  ------------------
  |  | 1409|  4.62k|            PORT_Assert(!ssl_HaveXmitBufLock(ss));    \
  |  |  ------------------
  |  |  |  |  120|  4.62k|#define PORT_Assert PR_ASSERT
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  4.62k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (208:6): [True: 4.62k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 1410|  4.62k|            PZ_EnterMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  256|  4.62k|#define PZ_EnterMonitor(m) PR_EnterMonitor((m))
  |  |  ------------------
  |  | 1411|  4.62k|        }                                             \
  |  | 1412|  4.62k|    }
  ------------------
   49|       |
   50|  4.62k|    if (ss->psk) {
  ------------------
  |  Branch (50:9): [True: 0, False: 4.62k]
  ------------------
   51|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   52|      0|        tls13_DestroyPsk(psk);
   53|  4.62k|    } else {
   54|  4.62k|        ss->psk = psk;
   55|  4.62k|        rv = SECSuccess;
   56|  4.62k|        tls13_ResetHandshakePsks(ss, &ss->ssl3.hs.psks);
   57|  4.62k|    }
   58|       |
   59|  4.62k|    ssl_ReleaseSSL3HandshakeLock(ss);
  ------------------
  |  | 1414|  4.62k|    {                                                \
  |  | 1415|  4.62k|        if (!ss->opt.noLocks)                        \
  |  |  ------------------
  |  |  |  Branch (1415:13): [True: 4.62k, False: 0]
  |  |  ------------------
  |  | 1416|  4.62k|            PZ_ExitMonitor((ss)->ssl3HandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  4.62k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1417|  4.62k|    }
  ------------------
   60|  4.62k|    ssl_Release1stHandshakeLock(ss);
  ------------------
  |  | 1398|  4.62k|    {                                                 \
  |  | 1399|  4.62k|        if (!ss->opt.noLocks)                         \
  |  |  ------------------
  |  |  |  Branch (1399:13): [True: 4.62k, False: 0]
  |  |  ------------------
  |  | 1400|  4.62k|            PZ_ExitMonitor((ss)->firstHandshakeLock); \
  |  |  ------------------
  |  |  |  |  257|  4.62k|#define PZ_ExitMonitor(m) PR_ExitMonitor((m))
  |  |  ------------------
  |  | 1401|  4.62k|    }
  ------------------
   61|       |
   62|  4.62k|    return rv;
   63|  4.62k|}
SSLExp_AddExternalPsk:
   68|  4.62k|{
   69|  4.62k|    return SSLExp_AddExternalPsk0Rtt(fd, key, identity, identityLen,
   70|  4.62k|                                     hash, TLS_NULL_WITH_NULL_NULL, 0);
  ------------------
  |  |   76|  4.62k|#define TLS_NULL_WITH_NULL_NULL                 0x0000
  ------------------
   71|  4.62k|}
tls13_DestroyPsk:
  143|  18.1k|{
  144|  18.1k|    if (!psk) {
  ------------------
  |  Branch (144:9): [True: 4.22k, False: 13.8k]
  ------------------
  145|  4.22k|        return;
  146|  4.22k|    }
  147|  13.8k|    if (psk->key) {
  ------------------
  |  Branch (147:9): [True: 9.94k, False: 3.92k]
  ------------------
  148|  9.94k|        PK11_FreeSymKey(psk->key);
  149|  9.94k|        psk->key = NULL;
  150|  9.94k|    }
  151|  13.8k|    if (psk->binderKey) {
  ------------------
  |  Branch (151:9): [True: 3.92k, False: 9.94k]
  ------------------
  152|  3.92k|        PK11_FreeSymKey(psk->binderKey);
  153|  3.92k|        psk->binderKey = NULL;
  154|  3.92k|    }
  155|  13.8k|    SECITEM_ZfreeItem(&psk->label, PR_FALSE);
  ------------------
  |  |  110|  13.8k|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                  SECITEM_ZfreeItem(&psk->label, PR_FALSE);
  ------------------
  |  |  438|  13.8k|#define PR_FALSE 0
  ------------------
  156|  13.8k|    PORT_ZFree(psk, sizeof(*psk));
  ------------------
  |  |   75|  13.8k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  157|  13.8k|}
tls13_DestroyPskList:
  161|  31.1k|{
  162|  31.1k|    PRCList *cur_p;
  163|  40.4k|    while (!PR_CLIST_IS_EMPTY(list)) {
  ------------------
  |  |   94|  40.4k|    ((_l)->next == (_l))
  ------------------
  |  Branch (163:12): [True: 9.25k, False: 31.1k]
  ------------------
  164|  9.25k|        cur_p = PR_LIST_TAIL(list);
  ------------------
  |  |   66|  9.25k|#define PR_LIST_TAIL(_l) (_l)->prev
  ------------------
  165|  9.25k|        PR_REMOVE_LINK(cur_p);
  ------------------
  |  |   72|  9.25k|    PR_BEGIN_MACRO             \
  |  |  ------------------
  |  |  |  |  123|  9.25k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |   73|  9.25k|    (_e)->prev->next = (_e)->next; \
  |  |   74|  9.25k|    (_e)->next->prev = (_e)->prev; \
  |  |   75|  9.25k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  9.25k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|  9.25k|        tls13_DestroyPsk((sslPsk *)cur_p);
  167|  9.25k|    }
  168|  31.1k|}
tls13_MakePsk:
  172|  13.8k|{
  173|  13.8k|    sslPsk *psk = PORT_ZNew(sslPsk);
  ------------------
  |  |  148|  13.8k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  13.8k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  174|  13.8k|    if (!psk) {
  ------------------
  |  Branch (174:9): [True: 0, False: 13.8k]
  ------------------
  175|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  176|      0|        return NULL;
  177|      0|    }
  178|  13.8k|    psk->type = pskType;
  179|  13.8k|    psk->hash = hashType;
  180|  13.8k|    psk->key = key;
  181|       |
  182|       |    /* Label is NULL in the resumption case. */
  183|  13.8k|    if (label) {
  ------------------
  |  Branch (183:9): [True: 13.8k, False: 0]
  ------------------
  184|  13.8k|        PORT_Assert(psk->type != ssl_psk_resume);
  ------------------
  |  |  120|  13.8k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.8k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 13.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  13.8k|        SECStatus rv = SECITEM_CopyItem(NULL, &psk->label, label);
  ------------------
  |  |  106|  13.8k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
  186|  13.8k|        if (rv != SECSuccess) {
  ------------------
  |  Branch (186:13): [True: 0, False: 13.8k]
  ------------------
  187|      0|            PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  188|      0|            tls13_DestroyPsk(psk);
  189|      0|            return NULL;
  190|      0|        }
  191|  13.8k|    }
  192|       |
  193|  13.8k|    return psk;
  194|  13.8k|}
tls13_ResetHandshakePsks:
  200|  13.4k|{
  201|  13.4k|    tls13_DestroyPskList(list);
  202|  13.4k|    PORT_Assert(!ss->xtnData.selectedPsk);
  ------------------
  |  |  120|  13.4k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  13.4k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 13.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  203|  13.4k|    ss->xtnData.selectedPsk = NULL;
  204|  13.4k|    if (ss->psk) {
  ------------------
  |  Branch (204:9): [True: 9.25k, False: 4.22k]
  ------------------
  205|  9.25k|        PORT_Assert(ss->psk->type == ssl_psk_external);
  ------------------
  |  |  120|  9.25k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  9.25k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 9.25k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  206|  9.25k|        PORT_Assert(ss->psk->key);
  ------------------
  |  |  120|  9.25k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  9.25k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 9.25k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|  9.25k|        PORT_Assert(!ss->psk->binderKey);
  ------------------
  |  |  120|  9.25k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  9.25k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 9.25k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  208|       |
  209|  9.25k|        sslPsk *epsk = tls13_MakePsk(PK11_ReferenceSymKey(ss->psk->key),
  210|  9.25k|                                     ss->psk->type, ss->psk->hash, &ss->psk->label);
  211|  9.25k|        if (!epsk) {
  ------------------
  |  Branch (211:13): [True: 0, False: 9.25k]
  ------------------
  212|      0|            return SECFailure;
  213|      0|        }
  214|  9.25k|        epsk->zeroRttSuite = ss->psk->zeroRttSuite;
  215|  9.25k|        epsk->maxEarlyData = ss->psk->maxEarlyData;
  216|  9.25k|        PR_APPEND_LINK(&epsk->link, list);
  ------------------
  |  |   57|  9.25k|#define PR_APPEND_LINK(_e,_l) PR_INSERT_BEFORE(_e,_l)
  |  |  ------------------
  |  |  |  |   25|  9.25k|    PR_BEGIN_MACRO       \
  |  |  |  |  ------------------
  |  |  |  |  |  |  123|  9.25k|#define PR_BEGIN_MACRO  do {
  |  |  |  |  ------------------
  |  |  |  |   26|  9.25k|    (_e)->next = (_l);   \
  |  |  |  |   27|  9.25k|    (_e)->prev = (_l)->prev; \
  |  |  |  |   28|  9.25k|    (_l)->prev->next = (_e); \
  |  |  |  |   29|  9.25k|    (_l)->prev = (_e);   \
  |  |  |  |   30|  9.25k|    PR_END_MACRO
  |  |  |  |  ------------------
  |  |  |  |  |  |  124|  9.25k|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|  9.25k|    }
  218|  13.4k|    return SECSuccess;
  219|  13.4k|}

tls13_ReleaseAntiReplayContext:
   40|  8.85k|{
   41|  8.85k|    if (!ctx) {
  ------------------
  |  Branch (41:9): [True: 8.85k, False: 0]
  ------------------
   42|  8.85k|        return;
   43|  8.85k|    }
   44|      0|    if (PR_ATOMIC_DECREMENT(&ctx->refCount) >= 1) {
  ------------------
  |  |  123|      0|#define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
  ------------------
  |  Branch (44:9): [True: 0, False: 0]
  ------------------
   45|      0|        return;
   46|      0|    }
   47|       |
   48|      0|    if (ctx->lock) {
  ------------------
  |  Branch (48:9): [True: 0, False: 0]
  ------------------
   49|      0|        PZ_DestroyMonitor(ctx->lock);
  ------------------
  |  |  255|      0|#define PZ_DestroyMonitor(m) PR_DestroyMonitor((m))
  ------------------
   50|      0|        ctx->lock = NULL;
   51|      0|    }
   52|      0|    PK11_FreeSymKey(ctx->key);
   53|      0|    ctx->key = NULL;
   54|      0|    sslBloom_Destroy(&ctx->filters[0]);
   55|      0|    sslBloom_Destroy(&ctx->filters[1]);
   56|      0|    PORT_Free(ctx);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
   57|      0|}

tls13_DestroyDelegatedCredential:
  108|  36.7k|{
  109|  36.7k|    if (!dc) {
  ------------------
  |  Branch (109:9): [True: 36.7k, False: 0]
  ------------------
  110|  36.7k|        return;
  111|  36.7k|    }
  112|       |
  113|      0|    SECKEY_DestroySubjectPublicKeyInfo(dc->spki);
  114|      0|    SECITEM_FreeItem(&dc->derSpki, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&dc->derSpki, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  115|      0|    SECITEM_FreeItem(&dc->signature, PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                  SECITEM_FreeItem(&dc->signature, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  116|      0|    PORT_ZFree(dc, sizeof(sslDelegatedCredential));
  ------------------
  |  |   75|      0|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  117|      0|}

DER_SetUInteger:
  130|  7.90k|{
  131|  7.90k|    unsigned char bb[5];
  132|  7.90k|    int len;
  133|       |
  134|  7.90k|    bb[0] = 0;
  135|  7.90k|    bb[1] = (unsigned char)(ui >> 24);
  136|  7.90k|    bb[2] = (unsigned char)(ui >> 16);
  137|  7.90k|    bb[3] = (unsigned char)(ui >> 8);
  138|  7.90k|    bb[4] = (unsigned char)(ui);
  139|       |
  140|       |    /*
  141|       |    ** Small integers are encoded in a single byte. Larger integers
  142|       |    ** require progressively more space.
  143|       |    */
  144|  7.90k|    if (ui > 0x7f) {
  ------------------
  |  Branch (144:9): [True: 0, False: 7.90k]
  ------------------
  145|      0|        if (ui > 0x7fff) {
  ------------------
  |  Branch (145:13): [True: 0, False: 0]
  ------------------
  146|      0|            if (ui > 0x7fffffL) {
  ------------------
  |  Branch (146:17): [True: 0, False: 0]
  ------------------
  147|      0|                if (ui >= 0x80000000L) {
  ------------------
  |  Branch (147:21): [True: 0, False: 0]
  ------------------
  148|      0|                    len = 5;
  149|      0|                } else {
  150|      0|                    len = 4;
  151|      0|                }
  152|      0|            } else {
  153|      0|                len = 3;
  154|      0|            }
  155|      0|        } else {
  156|      0|            len = 2;
  157|      0|        }
  158|  7.90k|    } else {
  159|  7.90k|        len = 1;
  160|  7.90k|    }
  161|       |
  162|  7.90k|    it->data = (unsigned char *)PORT_ArenaAlloc(arena, len);
  ------------------
  |  |   53|  7.90k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  163|  7.90k|    if (it->data == NULL) {
  ------------------
  |  Branch (163:9): [True: 0, False: 7.90k]
  ------------------
  164|      0|        return SECFailure;
  165|      0|    }
  166|       |
  167|  7.90k|    it->len = len;
  168|  7.90k|    PORT_Memcpy(it->data, bb + (sizeof(bb) - len), len);
  ------------------
  |  |  180|  7.90k|#define PORT_Memcpy memcpy
  ------------------
  169|       |
  170|  7.90k|    return SECSuccess;
  171|  7.90k|}
DER_GetInteger_Util:
  179|    813|{
  180|    813|    unsigned long ival;
  181|    813|    PRBool negative;
  182|    813|    unsigned int len = it->len;
  183|    813|    unsigned char *cp = it->data;
  184|    813|    size_t lsize = sizeof(ival);
  185|       |
  186|    813|    PORT_Assert(len);
  ------------------
  |  |  120|    813|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    813|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 813, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|    813|    if (!len) {
  ------------------
  |  Branch (187:9): [True: 0, False: 813]
  ------------------
  188|      0|        PORT_SetError(SEC_ERROR_INPUT_LEN);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  189|      0|        return 0;
  190|      0|    }
  191|       |
  192|    813|    negative = (PRBool)(*cp & 0x80);
  193|    813|    ival = negative ? ~0 : 0;
  ------------------
  |  Branch (193:12): [True: 251, False: 562]
  ------------------
  194|       |
  195|       |    /* Ignore leading zeros/ones. */
  196|    817|    while (len && *cp == (unsigned char)ival) {
  ------------------
  |  Branch (196:12): [True: 813, False: 4]
  |  Branch (196:19): [True: 4, False: 809]
  ------------------
  197|      4|        len--;
  198|      4|        cp++;
  199|      4|    }
  200|       |
  201|       |    /* Check for overflow/underflow. */
  202|    813|    if (len > lsize || (len == lsize && (*cp & 0x80) != negative)) {
  ------------------
  |  Branch (202:9): [True: 0, False: 813]
  |  Branch (202:25): [True: 0, False: 813]
  |  Branch (202:41): [True: 0, False: 0]
  ------------------
  203|      0|        PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  204|      0|        return negative ? LONG_MIN : LONG_MAX;
  ------------------
  |  Branch (204:16): [True: 0, False: 0]
  ------------------
  205|      0|    }
  206|       |
  207|  1.62k|    while (len--) {
  ------------------
  |  Branch (207:12): [True: 809, False: 813]
  ------------------
  208|    809|        ival <<= 8;
  209|    809|        ival |= *cp++;
  210|    809|    }
  211|       |
  212|    813|    return ival;
  213|    813|}

NSS_InitializePRErrorTable:
   37|      1|{
   38|      1|    return (PR_SUCCESS == PR_CallOnce(&once, nss_InitializePRErrorTableOnce))
  ------------------
  |  Branch (38:12): [True: 1, False: 0]
  ------------------
   39|      1|               ? SECSuccess
   40|      1|               : SECFailure;
   41|      1|}
errstrs.c:nss_InitializePRErrorTableOnce:
   29|      1|{
   30|      1|    return PR_ErrorInstallTable(&sec_et);
   31|      1|}

HASH_GetHashTypeByOidTag_Util:
   12|  17.7k|{
   13|  17.7k|    HASH_HashType ht = HASH_AlgNULL;
   14|       |
   15|  17.7k|    switch (hashOid) {
   16|      0|        case SEC_OID_MD2:
  ------------------
  |  Branch (16:9): [True: 0, False: 17.7k]
  ------------------
   17|      0|            ht = HASH_AlgMD2;
   18|      0|            break;
   19|    131|        case SEC_OID_MD5:
  ------------------
  |  Branch (19:9): [True: 131, False: 17.5k]
  ------------------
   20|    131|            ht = HASH_AlgMD5;
   21|    131|            break;
   22|  5.92k|        case SEC_OID_SHA1:
  ------------------
  |  Branch (22:9): [True: 5.92k, False: 11.7k]
  ------------------
   23|  5.92k|            ht = HASH_AlgSHA1;
   24|  5.92k|            break;
   25|      0|        case SEC_OID_SHA224:
  ------------------
  |  Branch (25:9): [True: 0, False: 17.7k]
  ------------------
   26|      0|            ht = HASH_AlgSHA224;
   27|      0|            break;
   28|  6.75k|        case SEC_OID_SHA256:
  ------------------
  |  Branch (28:9): [True: 6.75k, False: 10.9k]
  ------------------
   29|  6.75k|            ht = HASH_AlgSHA256;
   30|  6.75k|            break;
   31|  3.86k|        case SEC_OID_SHA384:
  ------------------
  |  Branch (31:9): [True: 3.86k, False: 13.8k]
  ------------------
   32|  3.86k|            ht = HASH_AlgSHA384;
   33|  3.86k|            break;
   34|  1.04k|        case SEC_OID_SHA512:
  ------------------
  |  Branch (34:9): [True: 1.04k, False: 16.6k]
  ------------------
   35|  1.04k|            ht = HASH_AlgSHA512;
   36|  1.04k|            break;
   37|      0|        case SEC_OID_SHA3_224:
  ------------------
  |  Branch (37:9): [True: 0, False: 17.7k]
  ------------------
   38|      0|            ht = HASH_AlgSHA3_224;
   39|      0|            break;
   40|      0|        case SEC_OID_SHA3_256:
  ------------------
  |  Branch (40:9): [True: 0, False: 17.7k]
  ------------------
   41|      0|            ht = HASH_AlgSHA3_256;
   42|      0|            break;
   43|      0|        case SEC_OID_SHA3_384:
  ------------------
  |  Branch (43:9): [True: 0, False: 17.7k]
  ------------------
   44|      0|            ht = HASH_AlgSHA3_384;
   45|      0|            break;
   46|      0|        case SEC_OID_SHA3_512:
  ------------------
  |  Branch (46:9): [True: 0, False: 17.7k]
  ------------------
   47|      0|            ht = HASH_AlgSHA3_512;
   48|      0|            break;
   49|      0|        default:
  ------------------
  |  Branch (49:9): [True: 0, False: 17.7k]
  ------------------
   50|      0|            PORT_SetError(SEC_ERROR_INVALID_ALGORITHM);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   51|      0|            break;
   52|  17.7k|    }
   53|  17.7k|    return ht;
   54|  17.7k|}

NSSRWLock_New_Util:
   74|  8.85k|{
   75|  8.85k|    NSSRWLock *rwlock;
   76|       |
   77|  8.85k|    rwlock = PR_NEWZAP(NSSRWLock);
  ------------------
  |  |   99|  8.85k|#define PR_NEWZAP(_struct) ((_struct*)PR_Calloc(1, sizeof(_struct)))
  ------------------
   78|  8.85k|    if (rwlock == NULL)
  ------------------
  |  Branch (78:9): [True: 0, False: 8.85k]
  ------------------
   79|      0|        return NULL;
   80|       |
   81|  8.85k|    rwlock->rw_lock = PZ_NewLock(nssILockRWLock);
  ------------------
  |  |  243|  8.85k|#define PZ_NewLock(t) PR_NewLock()
  ------------------
   82|  8.85k|    if (rwlock->rw_lock == NULL) {
  ------------------
  |  Branch (82:9): [True: 0, False: 8.85k]
  ------------------
   83|      0|        goto loser;
   84|      0|    }
   85|  8.85k|    rwlock->rw_reader_waitq = PZ_NewCondVar(rwlock->rw_lock);
  ------------------
  |  |  248|  8.85k|#define PZ_NewCondVar(l) PR_NewCondVar((l))
  ------------------
   86|  8.85k|    if (rwlock->rw_reader_waitq == NULL) {
  ------------------
  |  Branch (86:9): [True: 0, False: 8.85k]
  ------------------
   87|      0|        goto loser;
   88|      0|    }
   89|  8.85k|    rwlock->rw_writer_waitq = PZ_NewCondVar(rwlock->rw_lock);
  ------------------
  |  |  248|  8.85k|#define PZ_NewCondVar(l) PR_NewCondVar((l))
  ------------------
   90|  8.85k|    if (rwlock->rw_writer_waitq == NULL) {
  ------------------
  |  Branch (90:9): [True: 0, False: 8.85k]
  ------------------
   91|      0|        goto loser;
   92|      0|    }
   93|  8.85k|    if (lock_name != NULL) {
  ------------------
  |  Branch (93:9): [True: 3, False: 8.85k]
  ------------------
   94|      3|        rwlock->rw_name = (char *)PR_Malloc((PRUint32)strlen(lock_name) + 1);
   95|      3|        if (rwlock->rw_name == NULL) {
  ------------------
  |  Branch (95:13): [True: 0, False: 3]
  ------------------
   96|      0|            goto loser;
   97|      0|        }
   98|      3|        strcpy(rwlock->rw_name, lock_name);
   99|  8.85k|    } else {
  100|  8.85k|        rwlock->rw_name = NULL;
  101|  8.85k|    }
  102|  8.85k|    rwlock->rw_rank = lock_rank;
  103|  8.85k|    rwlock->rw_waiting_readers = 0;
  104|  8.85k|    rwlock->rw_waiting_writers = 0;
  105|  8.85k|    rwlock->rw_reader_locks = 0;
  106|  8.85k|    rwlock->rw_writer_locks = 0;
  107|       |
  108|  8.85k|    return rwlock;
  109|       |
  110|      0|loser:
  111|      0|    NSSRWLock_Destroy(rwlock);
  ------------------
  |  |   45|      0|#define NSSRWLock_Destroy NSSRWLock_Destroy_Util
  ------------------
  112|      0|    return (NULL);
  113|  8.85k|}
NSSRWLock_Destroy_Util:
  120|  8.85k|{
  121|  8.85k|    PR_ASSERT(rwlock != NULL);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  122|  8.85k|    PR_ASSERT(rwlock->rw_waiting_readers == 0);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  123|  8.85k|    PR_ASSERT(rwlock->rw_writer_locks == 0);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  124|  8.85k|    PR_ASSERT(rwlock->rw_reader_locks == 0);
  ------------------
  |  |  208|  8.85k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 8.85k, False: 0]
  |  |  ------------------
  ------------------
  125|       |
  126|       |    /* XXX Shouldn't we lock the PZLock before destroying this?? */
  127|       |
  128|  8.85k|    if (rwlock->rw_name)
  ------------------
  |  Branch (128:9): [True: 3, False: 8.85k]
  ------------------
  129|      3|        PR_Free(rwlock->rw_name);
  130|  8.85k|    if (rwlock->rw_reader_waitq)
  ------------------
  |  Branch (130:9): [True: 8.85k, False: 0]
  ------------------
  131|  8.85k|        PZ_DestroyCondVar(rwlock->rw_reader_waitq);
  ------------------
  |  |  249|  8.85k|#define PZ_DestroyCondVar(v) PR_DestroyCondVar((v))
  ------------------
  132|  8.85k|    if (rwlock->rw_writer_waitq)
  ------------------
  |  Branch (132:9): [True: 8.85k, False: 0]
  ------------------
  133|  8.85k|        PZ_DestroyCondVar(rwlock->rw_writer_waitq);
  ------------------
  |  |  249|  8.85k|#define PZ_DestroyCondVar(v) PR_DestroyCondVar((v))
  ------------------
  134|  8.85k|    if (rwlock->rw_lock)
  ------------------
  |  Branch (134:9): [True: 8.85k, False: 0]
  ------------------
  135|  8.85k|        PZ_DestroyLock(rwlock->rw_lock);
  ------------------
  |  |  244|  8.85k|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  136|  8.85k|    PR_DELETE(rwlock);
  ------------------
  |  |  110|  8.85k|#define PR_DELETE(_ptr) { PR_Free(_ptr); (_ptr) = NULL; }
  ------------------
  137|  8.85k|}
NSSRWLock_LockRead_Util:
  144|  1.07M|{
  145|  1.07M|    PRThread *me = PR_GetCurrentThread();
  146|       |
  147|  1.07M|    PZ_Lock(rwlock->rw_lock);
  ------------------
  |  |  245|  1.07M|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  148|       |#ifdef NSS_RWLOCK_RANK_ORDER_DEBUG
  149|       |
  150|       |    /*
  151|       |     * assert that rank ordering is not violated; the rank of 'rwlock' should
  152|       |     * be equal to or greater than the highest rank of all the locks held by
  153|       |     * the thread.
  154|       |     */
  155|       |    PR_ASSERT((rwlock->rw_rank == NSS_RWLOCK_RANK_NONE) ||
  156|       |              (rwlock->rw_rank >= nssRWLock_GetThreadRank(me)));
  157|       |#endif
  158|       |    /*
  159|       |     * wait if write-locked or if a writer is waiting; preference for writers
  160|       |     */
  161|  1.07M|    UNTIL((rwlock->rw_owner == me) ||    /* I own it, or        */
  ------------------
  |  |   60|  4.29M|#define UNTIL(x) while (!(x))
  |  |  ------------------
  |  |  |  Branch (60:27): [True: 1.07M, False: 0]
  |  |  |  Branch (60:27): [True: 1.07M, False: 0]
  |  |  |  Branch (60:27): [True: 0, False: 1.07M]
  |  |  ------------------
  ------------------
  162|  1.07M|          ((rwlock->rw_owner == NULL) && /* no-one owns it, and */
  163|  1.07M|           (rwlock->rw_waiting_writers == 0)))
  164|      0|    { /* no-one is waiting to own */
  165|       |
  166|      0|        rwlock->rw_waiting_readers++;
  167|      0|        PZ_WaitCondVar(rwlock->rw_reader_waitq, PR_INTERVAL_NO_TIMEOUT);
  ------------------
  |  |  250|      0|#define PZ_WaitCondVar(v, t) PR_WaitCondVar((v), (t))
  ------------------
  168|      0|        rwlock->rw_waiting_readers--;
  169|      0|    }
  170|  1.07M|    rwlock->rw_reader_locks++; /* Increment read-lock count */
  171|       |
  172|  1.07M|    PZ_Unlock(rwlock->rw_lock);
  ------------------
  |  |  246|  1.07M|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  173|       |
  174|       |#ifdef NSS_RWLOCK_RANK_ORDER_DEBUG
  175|       |    nssRWLock_SetThreadRank(me, rwlock); /* update thread's lock rank */
  176|       |#endif
  177|  1.07M|}
NSSRWLock_UnlockRead_Util:
  183|  1.07M|{
  184|  1.07M|    PZ_Lock(rwlock->rw_lock);
  ------------------
  |  |  245|  1.07M|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  185|       |
  186|  1.07M|    PR_ASSERT(rwlock->rw_reader_locks > 0); /* lock must be read locked */
  ------------------
  |  |  208|  1.07M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 1.07M, False: 0]
  |  |  ------------------
  ------------------
  187|       |
  188|  1.07M|    if ((rwlock->rw_reader_locks > 0) &&    /* caller isn't screwey */
  ------------------
  |  Branch (188:9): [True: 1.07M, False: 0]
  ------------------
  189|  1.07M|        (--rwlock->rw_reader_locks == 0) && /* not read locked any more */
  ------------------
  |  Branch (189:9): [True: 1.06M, False: 8.30k]
  ------------------
  190|  1.07M|        (rwlock->rw_owner == NULL) &&       /* not write locked */
  ------------------
  |  Branch (190:9): [True: 1.06M, False: 0]
  ------------------
  191|  1.07M|        (rwlock->rw_waiting_writers > 0)) { /* someone's waiting. */
  ------------------
  |  Branch (191:9): [True: 0, False: 1.06M]
  ------------------
  192|       |
  193|      0|        PZ_NotifyCondVar(rwlock->rw_writer_waitq); /* wake him up. */
  ------------------
  |  |  251|      0|#define PZ_NotifyCondVar(v) PR_NotifyCondVar((v))
  ------------------
  194|      0|    }
  195|       |
  196|  1.07M|    PZ_Unlock(rwlock->rw_lock);
  ------------------
  |  |  246|  1.07M|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  197|       |
  198|       |#ifdef NSS_RWLOCK_RANK_ORDER_DEBUG
  199|       |    /*
  200|       |     * update thread's lock rank
  201|       |     */
  202|       |    nssRWLock_UnsetThreadRank(me, rwlock);
  203|       |#endif
  204|  1.07M|    return;
  205|  1.07M|}
NSSRWLock_LockWrite_Util:
  212|  32.2k|{
  213|  32.2k|    PRThread *me = PR_GetCurrentThread();
  214|       |
  215|  32.2k|    PZ_Lock(rwlock->rw_lock);
  ------------------
  |  |  245|  32.2k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  216|       |#ifdef NSS_RWLOCK_RANK_ORDER_DEBUG
  217|       |    /*
  218|       |     * assert that rank ordering is not violated; the rank of 'rwlock' should
  219|       |     * be equal to or greater than the highest rank of all the locks held by
  220|       |     * the thread.
  221|       |     */
  222|       |    PR_ASSERT((rwlock->rw_rank == NSS_RWLOCK_RANK_NONE) ||
  223|       |              (rwlock->rw_rank >= nssRWLock_GetThreadRank(me)));
  224|       |#endif
  225|       |    /*
  226|       |     * wait if read locked or write locked.
  227|       |     */
  228|  32.2k|    PR_ASSERT(rwlock->rw_reader_locks >= 0);
  ------------------
  |  |  208|  32.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 32.2k, False: 0]
  |  |  ------------------
  ------------------
  229|  32.2k|    PR_ASSERT(me != NULL);
  ------------------
  |  |  208|  32.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 32.2k, False: 0]
  |  |  ------------------
  ------------------
  230|       |
  231|  32.2k|    UNTIL((rwlock->rw_owner == me) ||    /* I own write lock, or */
  ------------------
  |  |   60|   129k|#define UNTIL(x) while (!(x))
  |  |  ------------------
  |  |  |  Branch (60:27): [True: 32.2k, False: 0]
  |  |  |  Branch (60:27): [True: 32.2k, False: 0]
  |  |  |  Branch (60:27): [True: 2, False: 32.2k]
  |  |  ------------------
  ------------------
  232|  32.2k|          ((rwlock->rw_owner == NULL) && /* no writer   and */
  233|  32.2k|           (rwlock->rw_reader_locks == 0)))
  234|      0|    { /* no readers, either. */
  235|       |
  236|      0|        rwlock->rw_waiting_writers++;
  237|      0|        PZ_WaitCondVar(rwlock->rw_writer_waitq, PR_INTERVAL_NO_TIMEOUT);
  ------------------
  |  |  250|      0|#define PZ_WaitCondVar(v, t) PR_WaitCondVar((v), (t))
  ------------------
  238|      0|        rwlock->rw_waiting_writers--;
  239|      0|        PR_ASSERT(rwlock->rw_reader_locks >= 0);
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  240|      0|    }
  241|       |
  242|  32.2k|    PR_ASSERT(rwlock->rw_reader_locks == 0);
  ------------------
  |  |  208|  32.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 32.2k, False: 0]
  |  |  ------------------
  ------------------
  243|       |    /*
  244|       |     * apply write lock
  245|       |     */
  246|  32.2k|    rwlock->rw_owner = me;
  247|  32.2k|    rwlock->rw_writer_locks++; /* Increment write-lock count */
  248|       |
  249|  32.2k|    PZ_Unlock(rwlock->rw_lock);
  ------------------
  |  |  246|  32.2k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  250|       |
  251|       |#ifdef NSS_RWLOCK_RANK_ORDER_DEBUG
  252|       |    /*
  253|       |     * update thread's lock rank
  254|       |     */
  255|       |    nssRWLock_SetThreadRank(me, rwlock);
  256|       |#endif
  257|  32.2k|}
NSSRWLock_UnlockWrite_Util:
  263|  32.2k|{
  264|  32.2k|    PRThread *me = PR_GetCurrentThread();
  265|       |
  266|  32.2k|    PZ_Lock(rwlock->rw_lock);
  ------------------
  |  |  245|  32.2k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  267|  32.2k|    PR_ASSERT(rwlock->rw_owner == me);      /* lock must be write-locked by me.  */
  ------------------
  |  |  208|  32.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 32.2k, False: 0]
  |  |  ------------------
  ------------------
  268|  32.2k|    PR_ASSERT(rwlock->rw_writer_locks > 0); /* lock must be write locked */
  ------------------
  |  |  208|  32.2k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 32.2k, False: 0]
  |  |  ------------------
  ------------------
  269|       |
  270|  32.2k|    if (rwlock->rw_owner == me &&         /* I own it, and            */
  ------------------
  |  Branch (270:9): [True: 32.2k, False: 0]
  ------------------
  271|  32.2k|        rwlock->rw_writer_locks > 0 &&    /* I own it, and            */
  ------------------
  |  Branch (271:9): [True: 32.2k, False: 0]
  ------------------
  272|  32.2k|        --rwlock->rw_writer_locks == 0) { /* I'm all done with it     */
  ------------------
  |  Branch (272:9): [True: 32.2k, False: 2]
  ------------------
  273|       |
  274|  32.2k|        rwlock->rw_owner = NULL; /* I don't own it any more. */
  275|       |
  276|       |        /* Give preference to waiting writers. */
  277|  32.2k|        if (rwlock->rw_waiting_writers > 0) {
  ------------------
  |  Branch (277:13): [True: 0, False: 32.2k]
  ------------------
  278|      0|            if (rwlock->rw_reader_locks == 0)
  ------------------
  |  Branch (278:17): [True: 0, False: 0]
  ------------------
  279|      0|                PZ_NotifyCondVar(rwlock->rw_writer_waitq);
  ------------------
  |  |  251|      0|#define PZ_NotifyCondVar(v) PR_NotifyCondVar((v))
  ------------------
  280|  32.2k|        } else if (rwlock->rw_waiting_readers > 0) {
  ------------------
  |  Branch (280:20): [True: 0, False: 32.2k]
  ------------------
  281|      0|            PZ_NotifyAllCondVar(rwlock->rw_reader_waitq);
  ------------------
  |  |  252|      0|#define PZ_NotifyAllCondVar(v) PR_NotifyAllCondVar((v))
  ------------------
  282|      0|        }
  283|  32.2k|    }
  284|  32.2k|    PZ_Unlock(rwlock->rw_lock);
  ------------------
  |  |  246|  32.2k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  285|       |
  286|       |#ifdef NSS_RWLOCK_RANK_ORDER_DEBUG
  287|       |    /*
  288|       |     * update thread's lock rank
  289|       |     */
  290|       |    nssRWLock_UnsetThreadRank(me, rwlock);
  291|       |#endif
  292|  32.2k|    return;
  293|  32.2k|}
NSSRWLock_HaveWriteLock_Util:
  298|  20.9k|{
  299|  20.9k|    PRBool ownWriteLock;
  300|  20.9k|    PRThread *me = PR_GetCurrentThread();
  301|       |
  302|       |/* This lock call isn't really necessary.
  303|       | ** If this thread is the owner, that fact cannot change during this call,
  304|       | ** because this thread is in this call.
  305|       | ** If this thread is NOT the owner, the owner could change, but it
  306|       | ** could not become this thread.
  307|       | */
  308|       |#if UNNECESSARY
  309|       |    PZ_Lock(rwlock->rw_lock);
  310|       |#endif
  311|  20.9k|    ownWriteLock = (PRBool)(me == rwlock->rw_owner);
  312|       |#if UNNECESSARY
  313|       |    PZ_Unlock(rwlock->rw_lock);
  314|       |#endif
  315|  20.9k|    return ownWriteLock;
  316|  20.9k|}

_SGN_VerifyPKCS1DigestInfo:
   95|      9|{
   96|      9|    SECOidData *hashOid;
   97|      9|    pkcs1Prefix prefix;
   98|      9|    SECStatus rv;
   99|       |
  100|      9|    if (!digest || !digest->data ||
  ------------------
  |  Branch (100:9): [True: 0, False: 9]
  |  Branch (100:20): [True: 0, False: 9]
  ------------------
  101|      9|        !dataRecoveredFromSignature || !dataRecoveredFromSignature->data) {
  ------------------
  |  Branch (101:9): [True: 0, False: 9]
  |  Branch (101:40): [True: 0, False: 9]
  ------------------
  102|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  103|      0|        return SECFailure;
  104|      0|    }
  105|       |
  106|      9|    hashOid = SECOID_FindOIDByTag(digestAlg);
  ------------------
  |  |  116|      9|#define SECOID_FindOIDByTag SECOID_FindOIDByTag_Util
  ------------------
  107|      9|    if (hashOid == NULL) {
  ------------------
  |  Branch (107:9): [True: 0, False: 9]
  ------------------
  108|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  109|      0|        return SECFailure;
  110|      0|    }
  111|       |
  112|      9|    prefix.data = NULL;
  113|       |
  114|      9|    rv = encodePrefix(hashOid, digest->len, &prefix, PR_TRUE);
  ------------------
  |  |  437|      9|#define PR_TRUE 1
  ------------------
  115|       |
  116|      9|    if (rv == SECSuccess) {
  ------------------
  |  Branch (116:9): [True: 9, False: 0]
  ------------------
  117|       |        /* We don't attempt to avoid timing attacks on these comparisons because
  118|       |         * signature verification is a public key operation, not a private key
  119|       |         * operation.
  120|       |         */
  121|       |
  122|      9|        if (dataRecoveredFromSignature->len != prefix.len + digest->len) {
  ------------------
  |  Branch (122:13): [True: 1, False: 8]
  ------------------
  123|      1|            PRBool lengthMismatch = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  124|       |#ifdef NSS_PKCS1_AllowMissingParameters
  125|       |            if (unsafeAllowMissingParameters) {
  126|       |                if (prefix.data) {
  127|       |                    PORT_Free(prefix.data);
  128|       |                    prefix.data = NULL;
  129|       |                }
  130|       |                rv = encodePrefix(hashOid, digest->len, &prefix, PR_FALSE);
  131|       |                if (rv != SECSuccess ||
  132|       |                    dataRecoveredFromSignature->len == prefix.len + digest->len) {
  133|       |                    lengthMismatch = PR_FALSE;
  134|       |                }
  135|       |            }
  136|       |#endif
  137|      1|            if (lengthMismatch) {
  ------------------
  |  Branch (137:17): [True: 1, False: 0]
  ------------------
  138|      1|                PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      1|#define PORT_SetError PORT_SetError_Util
  ------------------
  139|      1|                rv = SECFailure;
  140|      1|            }
  141|      1|        }
  142|      9|    }
  143|       |
  144|      9|    if (rv == SECSuccess) {
  ------------------
  |  Branch (144:9): [True: 8, False: 1]
  ------------------
  145|      8|        if (memcmp(dataRecoveredFromSignature->data, prefix.data, prefix.len) ||
  ------------------
  |  Branch (145:13): [True: 0, False: 8]
  ------------------
  146|      8|            memcmp(dataRecoveredFromSignature->data + prefix.len, digest->data,
  ------------------
  |  Branch (146:13): [True: 8, False: 0]
  ------------------
  147|      8|                   digest->len)) {
  148|      8|            PORT_SetError(SEC_ERROR_BAD_SIGNATURE);
  ------------------
  |  |   65|      8|#define PORT_SetError PORT_SetError_Util
  ------------------
  149|      8|            rv = SECFailure;
  150|      8|        }
  151|      8|    }
  152|       |
  153|      9|    if (prefix.data) {
  ------------------
  |  Branch (153:9): [True: 9, False: 0]
  ------------------
  154|      9|        PORT_Free(prefix.data);
  ------------------
  |  |   60|      9|#define PORT_Free PORT_Free_Util
  ------------------
  155|      9|    }
  156|       |
  157|      9|    return rv;
  158|      9|}
pkcs1sig.c:encodePrefix:
   26|      9|{
   27|       |    /* with params coding is:
   28|       |     *  Sequence (2 bytes) {
   29|       |     *      Sequence (2 bytes) {
   30|       |     *               Oid (2 bytes)  {
   31|       |     *                   Oid value (derOid->oid.len)
   32|       |     *               }
   33|       |     *               NULL (2 bytes)
   34|       |     *      }
   35|       |     *      OCTECT (2 bytes);
   36|       |     *
   37|       |     * without params coding is:
   38|       |     *  Sequence (2 bytes) {
   39|       |     *      Sequence (2 bytes) {
   40|       |     *               Oid (2 bytes)  {
   41|       |     *                   Oid value (derOid->oid.len)
   42|       |     *               }
   43|       |     *      }
   44|       |     *      OCTECT (2 bytes);
   45|       |     */
   46|       |
   47|      9|    unsigned int innerSeqLen = 2 + hashOid->oid.len;
   48|      9|    unsigned int outerSeqLen = 2 + innerSeqLen + 2 + digestLen;
   49|      9|    unsigned int extra = 0;
   50|       |
   51|      9|    if (withParams) {
  ------------------
  |  Branch (51:9): [True: 9, False: 0]
  ------------------
   52|      9|        innerSeqLen += 2;
   53|      9|        outerSeqLen += 2;
   54|      9|        extra = 2;
   55|      9|    }
   56|       |
   57|      9|    if (innerSeqLen >= 128 ||
  ------------------
  |  Branch (57:9): [True: 0, False: 9]
  ------------------
   58|      9|        outerSeqLen >= 128 ||
  ------------------
  |  Branch (58:9): [True: 0, False: 9]
  ------------------
   59|      9|        (outerSeqLen + 2 - digestLen) >
  ------------------
  |  Branch (59:9): [True: 0, False: 9]
  ------------------
   60|      9|            (MAX_PREFIX_LEN_EXCLUDING_OID + hashOid->oid.len)) {
  ------------------
  |  |   21|      9|#define MAX_PREFIX_LEN_EXCLUDING_OID 10
  ------------------
   61|       |        /* this is actually a library failure, It shouldn't happen */
   62|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   63|      0|        return SECFailure;
   64|      0|    }
   65|       |
   66|      9|    prefix->len = 6 + hashOid->oid.len + extra + 2;
   67|      9|    prefix->data = PORT_Alloc(prefix->len);
  ------------------
  |  |   52|      9|#define PORT_Alloc PORT_Alloc_Util
  ------------------
   68|      9|    if (!prefix->data) {
  ------------------
  |  Branch (68:9): [True: 0, False: 9]
  ------------------
   69|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   70|      0|        return SECFailure;
   71|      0|    }
   72|       |
   73|      9|    prefix->data[0] = SEC_ASN1_SEQUENCE | SEC_ASN1_CONSTRUCTED;
  ------------------
  |  |   92|      9|#define SEC_ASN1_SEQUENCE 0x10
  ------------------
                  prefix->data[0] = SEC_ASN1_SEQUENCE | SEC_ASN1_CONSTRUCTED;
  ------------------
  |  |  117|      9|#define SEC_ASN1_CONSTRUCTED 0x20
  ------------------
   74|      9|    prefix->data[1] = outerSeqLen;
   75|      9|    prefix->data[2] = SEC_ASN1_SEQUENCE | SEC_ASN1_CONSTRUCTED;
  ------------------
  |  |   92|      9|#define SEC_ASN1_SEQUENCE 0x10
  ------------------
                  prefix->data[2] = SEC_ASN1_SEQUENCE | SEC_ASN1_CONSTRUCTED;
  ------------------
  |  |  117|      9|#define SEC_ASN1_CONSTRUCTED 0x20
  ------------------
   76|      9|    prefix->data[3] = innerSeqLen;
   77|      9|    prefix->data[4] = SEC_ASN1_OBJECT_ID;
  ------------------
  |  |   82|      9|#define SEC_ASN1_OBJECT_ID 0x06
  ------------------
   78|      9|    prefix->data[5] = hashOid->oid.len;
   79|      9|    PORT_Memcpy(&prefix->data[6], hashOid->oid.data, hashOid->oid.len);
  ------------------
  |  |  180|      9|#define PORT_Memcpy memcpy
  ------------------
   80|      9|    if (withParams) {
  ------------------
  |  Branch (80:9): [True: 9, False: 0]
  ------------------
   81|      9|        prefix->data[6 + hashOid->oid.len] = SEC_ASN1_NULL;
  ------------------
  |  |   81|      9|#define SEC_ASN1_NULL 0x05
  ------------------
   82|      9|        prefix->data[6 + hashOid->oid.len + 1] = 0;
   83|      9|    }
   84|      9|    prefix->data[6 + hashOid->oid.len + extra] = SEC_ASN1_OCTET_STRING;
  ------------------
  |  |   80|      9|#define SEC_ASN1_OCTET_STRING 0x04
  ------------------
   85|      9|    prefix->data[6 + hashOid->oid.len + extra + 1] = digestLen;
   86|       |
   87|      9|    return SECSuccess;
   88|      9|}

SEC_QuickDERDecodeItem_Util:
  818|  99.1k|{
  819|  99.1k|    SECStatus rv = SECSuccess;
  820|  99.1k|    SECItem newsrc;
  821|       |
  822|  99.1k|    if (!arena || !templateEntry || !src) {
  ------------------
  |  Branch (822:9): [True: 0, False: 99.1k]
  |  Branch (822:19): [True: 0, False: 99.1k]
  |  Branch (822:37): [True: 0, False: 99.1k]
  ------------------
  823|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  824|      0|        rv = SECFailure;
  825|      0|    }
  826|       |
  827|  99.1k|    if (SECSuccess == rv) {
  ------------------
  |  Branch (827:9): [True: 99.1k, False: 0]
  ------------------
  828|  99.1k|        newsrc = *src;
  829|  99.1k|        rv = DecodeItem(dest, templateEntry, &newsrc, arena, PR_TRUE);
  ------------------
  |  |  437|  99.1k|#define PR_TRUE 1
  ------------------
  830|  99.1k|        if (SECSuccess == rv && newsrc.len) {
  ------------------
  |  Branch (830:13): [True: 95.2k, False: 3.87k]
  |  Branch (830:33): [True: 871, False: 94.4k]
  ------------------
  831|    871|            rv = SECFailure;
  832|    871|            PORT_SetError(SEC_ERROR_EXTRA_INPUT);
  ------------------
  |  |   65|    871|#define PORT_SetError PORT_SetError_Util
  ------------------
  833|    871|        }
  834|  99.1k|    }
  835|       |
  836|  99.1k|    return rv;
  837|  99.1k|}
quickder.c:DecodeItem:
  592|   686k|{
  593|   686k|    SECStatus rv = SECSuccess;
  594|   686k|    SECItem temp;
  595|   686k|    SECItem mark = { siBuffer, NULL, 0 };
  596|   686k|    PRBool pop = PR_FALSE;
  ------------------
  |  |  438|   686k|#define PR_FALSE 0
  ------------------
  597|   686k|    PRBool decode = PR_TRUE;
  ------------------
  |  |  437|   686k|#define PR_TRUE 1
  ------------------
  598|   686k|    PRBool save = PR_FALSE;
  ------------------
  |  |  438|   686k|#define PR_FALSE 0
  ------------------
  599|   686k|    unsigned long kind;
  600|   686k|    PRBool match = PR_TRUE;
  ------------------
  |  |  437|   686k|#define PR_TRUE 1
  ------------------
  601|       |
  602|   686k|    PR_ASSERT(src && dest && templateEntry && arena);
  ------------------
  |  |  208|  4.11M|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:7): [True: 686k, False: 0]
  |  |  |  Branch (208:7): [True: 686k, False: 0]
  |  |  |  Branch (208:7): [True: 686k, False: 0]
  |  |  |  Branch (208:7): [True: 686k, False: 0]
  |  |  ------------------
  ------------------
  603|       |#if 0
  604|       |    if (!src || !dest || !templateEntry || !arena)
  605|       |    {
  606|       |        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  607|       |        rv = SECFailure;
  608|       |    }
  609|       |#endif
  610|       |
  611|   686k|    if (SECSuccess == rv) {
  ------------------
  |  Branch (611:9): [True: 686k, False: 0]
  ------------------
  612|       |        /* do the template validation */
  613|   686k|        kind = templateEntry->kind;
  614|   686k|        if (!kind) {
  ------------------
  |  Branch (614:13): [True: 0, False: 686k]
  ------------------
  615|      0|            PORT_SetError(SEC_ERROR_BAD_TEMPLATE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  616|      0|            rv = SECFailure;
  617|      0|        }
  618|   686k|    }
  619|       |
  620|   686k|    if (SECSuccess == rv) {
  ------------------
  |  Branch (620:9): [True: 686k, False: 0]
  ------------------
  621|   686k|#ifdef DEBUG
  622|   686k|        if (kind & SEC_ASN1_DEBUG_BREAK) {
  ------------------
  |  |  160|   686k|#define SEC_ASN1_DEBUG_BREAK 0X400000 /* put this in your template and the \
  ------------------
  |  Branch (622:13): [True: 0, False: 686k]
  ------------------
  623|       |            /* when debugging the decoder or a template that fails to
  624|       |            decode, put SEC_ASN1_DEBUG in the component that gives you
  625|       |            trouble. The decoder will then get to this block and assert.
  626|       |            If you want to debug the rest of the code, you can set a
  627|       |            breakpoint and set dontassert to PR_TRUE, which will let
  628|       |            you skip over the assert and continue the debugging session
  629|       |            past it. */
  630|      0|            PRBool dontassert = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  631|      0|            PR_ASSERT(dontassert); /* set bkpoint here & set dontassert*/
  ------------------
  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  632|      0|        }
  633|   686k|#endif
  634|       |
  635|   686k|        if ((kind & SEC_ASN1_SKIP) ||
  ------------------
  |  |  140|   686k|#define SEC_ASN1_SKIP 0x08000         /* skip a field; only for decoding */
  ------------------
  |  Branch (635:13): [True: 47.1k, False: 639k]
  ------------------
  636|   686k|            (kind & SEC_ASN1_SAVE)) {
  ------------------
  |  |  144|   639k|#define SEC_ASN1_SAVE 0x20000         /* stash away the encoded bytes first; \
  ------------------
  |  Branch (636:13): [True: 21.2k, False: 617k]
  ------------------
  637|       |            /* if skipping or saving this component, don't decode it */
  638|  68.3k|            decode = PR_FALSE;
  ------------------
  |  |  438|  68.3k|#define PR_FALSE 0
  ------------------
  639|  68.3k|        }
  640|       |
  641|   686k|        if (kind & (SEC_ASN1_SAVE | SEC_ASN1_OPTIONAL)) {
  ------------------
  |  |  144|   686k|#define SEC_ASN1_SAVE 0x20000         /* stash away the encoded bytes first; \
  ------------------
                      if (kind & (SEC_ASN1_SAVE | SEC_ASN1_OPTIONAL)) {
  ------------------
  |  |  131|   686k|#define SEC_ASN1_OPTIONAL 0x00100
  ------------------
  |  Branch (641:13): [True: 129k, False: 556k]
  ------------------
  642|       |            /* if saving this component, or if it is optional, we may not want to
  643|       |               move past it, so save the position in case we have to rewind */
  644|   129k|            mark = *src;
  645|   129k|            if (kind & SEC_ASN1_SAVE) {
  ------------------
  |  |  144|   129k|#define SEC_ASN1_SAVE 0x20000         /* stash away the encoded bytes first; \
  ------------------
  |  Branch (645:17): [True: 21.2k, False: 108k]
  ------------------
  646|  21.2k|                save = PR_TRUE;
  ------------------
  |  |  437|  21.2k|#define PR_TRUE 1
  ------------------
  647|  21.2k|                if (0 == (kind & SEC_ASN1_SKIP)) {
  ------------------
  |  |  140|  21.2k|#define SEC_ASN1_SKIP 0x08000         /* skip a field; only for decoding */
  ------------------
  |  Branch (647:21): [True: 21.2k, False: 0]
  ------------------
  648|       |                    /* we will for sure have to rewind when saving this
  649|       |                       component and not skipping it. This is true for all
  650|       |                       legacy uses of SEC_ASN1_SAVE where the following entry
  651|       |                       in the template would causes the same component to be
  652|       |                       processed again */
  653|  21.2k|                    pop = PR_TRUE;
  ------------------
  |  |  437|  21.2k|#define PR_TRUE 1
  ------------------
  654|  21.2k|                }
  655|  21.2k|            }
  656|   129k|        }
  657|       |
  658|   686k|        rv = GetItem(src, &temp, PR_TRUE);
  ------------------
  |  |  437|   686k|#define PR_TRUE 1
  ------------------
  659|   686k|    }
  660|       |
  661|   686k|    if (SECSuccess == rv) {
  ------------------
  |  Branch (661:9): [True: 685k, False: 1.02k]
  ------------------
  662|       |        /* now check if the component matches what we expect in the template */
  663|       |
  664|   685k|        if (PR_TRUE == checkTag)
  ------------------
  |  |  437|   685k|#define PR_TRUE 1
  ------------------
  |  Branch (664:13): [True: 685k, False: 89]
  ------------------
  665|       |
  666|   685k|        {
  667|   685k|            rv = MatchComponentType(templateEntry, &temp, &match, dest);
  668|   685k|        }
  669|       |
  670|   685k|        if ((SECSuccess == rv) && (PR_TRUE != match)) {
  ------------------
  |  |  437|   685k|#define PR_TRUE 1
  ------------------
  |  Branch (670:13): [True: 685k, False: 0]
  |  Branch (670:35): [True: 49.2k, False: 636k]
  ------------------
  671|  49.2k|            if (kind & SEC_ASN1_OPTIONAL) {
  ------------------
  |  |  131|  49.2k|#define SEC_ASN1_OPTIONAL 0x00100
  ------------------
  |  Branch (671:17): [True: 47.1k, False: 2.04k]
  ------------------
  672|       |
  673|       |                /* the optional component is missing. This is not fatal. */
  674|       |                /* Rewind, don't decode, and don't save */
  675|  47.1k|                pop = PR_TRUE;
  ------------------
  |  |  437|  47.1k|#define PR_TRUE 1
  ------------------
  676|  47.1k|                decode = PR_FALSE;
  ------------------
  |  |  438|  47.1k|#define PR_FALSE 0
  ------------------
  677|  47.1k|                save = PR_FALSE;
  ------------------
  |  |  438|  47.1k|#define PR_FALSE 0
  ------------------
  678|  47.1k|            } else {
  679|       |                /* a required component is missing. abort */
  680|  2.04k|                PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|  2.04k|#define PORT_SetError PORT_SetError_Util
  ------------------
  681|  2.04k|                rv = SECFailure;
  682|  2.04k|            }
  683|  49.2k|        }
  684|   685k|    }
  685|       |
  686|   686k|    if ((SECSuccess == rv) && (PR_TRUE == decode)) {
  ------------------
  |  |  437|   683k|#define PR_TRUE 1
  ------------------
  |  Branch (686:9): [True: 683k, False: 3.06k]
  |  Branch (686:31): [True: 567k, False: 115k]
  ------------------
  687|       |        /* the order of processing here is is the tricky part */
  688|       |        /* we start with our special cases */
  689|       |        /* first, check the component class */
  690|   567k|        if (kind & SEC_ASN1_INLINE) {
  ------------------
  |  |  134|   567k|#define SEC_ASN1_INLINE 0x00800
  ------------------
  |  Branch (690:13): [True: 79.2k, False: 488k]
  ------------------
  691|       |            /* decode inline template */
  692|  79.2k|            rv = DecodeInline(dest, templateEntry, &temp, arena, PR_TRUE);
  ------------------
  |  |  437|  79.2k|#define PR_TRUE 1
  ------------------
  693|  79.2k|        }
  694|       |
  695|   488k|        else if (kind & SEC_ASN1_EXPLICIT) {
  ------------------
  |  |  132|   488k|#define SEC_ASN1_EXPLICIT 0x00200
  ------------------
  |  Branch (695:18): [True: 36.7k, False: 451k]
  ------------------
  696|  36.7k|            rv = DecodeExplicit(dest, templateEntry, &temp, arena);
  697|   451k|        } else if ((SEC_ASN1_UNIVERSAL != (kind & SEC_ASN1_CLASS_MASK)) &&
  ------------------
  |  |  120|   451k|#define SEC_ASN1_UNIVERSAL 0x00
  ------------------
                      } else if ((SEC_ASN1_UNIVERSAL != (kind & SEC_ASN1_CLASS_MASK)) &&
  ------------------
  |  |  119|   451k|#define SEC_ASN1_CLASS_MASK 0xc0
  ------------------
  |  Branch (697:20): [True: 89, False: 451k]
  ------------------
  698|       |
  699|   451k|                   (!(kind & SEC_ASN1_EXPLICIT))) {
  ------------------
  |  |  132|     89|#define SEC_ASN1_EXPLICIT 0x00200
  ------------------
  |  Branch (699:20): [True: 89, False: 0]
  ------------------
  700|       |
  701|       |            /* decode implicitly tagged components */
  702|     89|            rv = DecodeImplicit(dest, templateEntry, &temp, arena);
  703|   451k|        } else if (kind & SEC_ASN1_POINTER) {
  ------------------
  |  |  135|   451k|#define SEC_ASN1_POINTER 0x01000
  ------------------
  |  Branch (703:20): [True: 7, False: 451k]
  ------------------
  704|      7|            rv = DecodePointer(dest, templateEntry, &temp, arena, PR_TRUE);
  ------------------
  |  |  437|      7|#define PR_TRUE 1
  ------------------
  705|   451k|        } else if (kind & SEC_ASN1_CHOICE) {
  ------------------
  |  |  153|   451k|#define SEC_ASN1_CHOICE 0x100000      /* pick one from a template */
  ------------------
  |  Branch (705:20): [True: 10.5k, False: 441k]
  ------------------
  706|  10.5k|            rv = DecodeChoice(dest, templateEntry, &temp, arena);
  707|   441k|        } else if (kind & SEC_ASN1_ANY) {
  ------------------
  |  |  133|   441k|#define SEC_ASN1_ANY 0x00400
  ------------------
  |  Branch (707:20): [True: 87.6k, False: 353k]
  ------------------
  708|       |            /* catch-all ANY type, don't decode */
  709|  87.6k|            save = PR_TRUE;
  ------------------
  |  |  437|  87.6k|#define PR_TRUE 1
  ------------------
  710|  87.6k|            if (kind & SEC_ASN1_INNER) {
  ------------------
  |  |  141|  87.6k|#define SEC_ASN1_INNER 0x10000        /* with ANY means capture the      \
  ------------------
  |  Branch (710:17): [True: 0, False: 87.6k]
  ------------------
  711|       |                /* skip the tag and length */
  712|      0|                SECItem newtemp = temp;
  713|      0|                rv = GetItem(&newtemp, &temp, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  714|      0|            }
  715|   353k|        } else if (kind & SEC_ASN1_GROUP) {
  ------------------
  |  |  136|   353k|#define SEC_ASN1_GROUP 0x02000        /* with SET or SEQUENCE means \
  ------------------
  |  Branch (715:20): [True: 26.9k, False: 326k]
  ------------------
  716|  26.9k|            if ((SEC_ASN1_SEQUENCE == (kind & SEC_ASN1_TAGNUM_MASK)) ||
  ------------------
  |  |   92|  26.9k|#define SEC_ASN1_SEQUENCE 0x10
  ------------------
                          if ((SEC_ASN1_SEQUENCE == (kind & SEC_ASN1_TAGNUM_MASK)) ||
  ------------------
  |  |   76|  26.9k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  |  Branch (716:17): [True: 16.0k, False: 10.9k]
  ------------------
  717|  26.9k|                (SEC_ASN1_SET == (kind & SEC_ASN1_TAGNUM_MASK))) {
  ------------------
  |  |   93|  10.9k|#define SEC_ASN1_SET 0x11
  ------------------
                              (SEC_ASN1_SET == (kind & SEC_ASN1_TAGNUM_MASK))) {
  ------------------
  |  |   76|  10.9k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  |  Branch (717:17): [True: 10.9k, False: 0]
  ------------------
  718|  26.9k|                rv = DecodeGroup(dest, templateEntry, &temp, arena);
  719|  26.9k|            } else {
  720|       |                /* a group can only be a SET OF or SEQUENCE OF */
  721|      0|                PORT_SetError(SEC_ERROR_BAD_TEMPLATE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  722|      0|                rv = SECFailure;
  723|      0|            }
  724|   326k|        } else if (SEC_ASN1_SEQUENCE == (kind & SEC_ASN1_TAGNUM_MASK)) {
  ------------------
  |  |   92|   326k|#define SEC_ASN1_SEQUENCE 0x10
  ------------------
                      } else if (SEC_ASN1_SEQUENCE == (kind & SEC_ASN1_TAGNUM_MASK)) {
  ------------------
  |  |   76|   326k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  |  Branch (724:20): [True: 150k, False: 176k]
  ------------------
  725|       |            /* plain SEQUENCE */
  726|   150k|            rv = DecodeSequence(dest, templateEntry, &temp, arena);
  727|   176k|        } else {
  728|       |            /* handle all other types as "save" */
  729|       |            /* we should only get here for primitive universal types */
  730|   176k|            SECItem newtemp = temp;
  731|   176k|            rv = GetItem(&newtemp, &temp, PR_FALSE);
  ------------------
  |  |  438|   176k|#define PR_FALSE 0
  ------------------
  732|   176k|            save = PR_TRUE;
  ------------------
  |  |  437|   176k|#define PR_TRUE 1
  ------------------
  733|   176k|            if ((SECSuccess == rv) &&
  ------------------
  |  Branch (733:17): [True: 176k, False: 0]
  ------------------
  734|   176k|                SEC_ASN1_UNIVERSAL == (kind & SEC_ASN1_CLASS_MASK)) {
  ------------------
  |  |  120|   176k|#define SEC_ASN1_UNIVERSAL 0x00
  ------------------
                              SEC_ASN1_UNIVERSAL == (kind & SEC_ASN1_CLASS_MASK)) {
  ------------------
  |  |  119|   176k|#define SEC_ASN1_CLASS_MASK 0xc0
  ------------------
  |  Branch (734:17): [True: 176k, False: 0]
  ------------------
  735|   176k|                unsigned long tagnum = kind & SEC_ASN1_TAGNUM_MASK;
  ------------------
  |  |   76|   176k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  736|   176k|                if (temp.len == 0 && (tagnum == SEC_ASN1_BOOLEAN ||
  ------------------
  |  |   77|    848|#define SEC_ASN1_BOOLEAN 0x01
  ------------------
  |  Branch (736:21): [True: 424, False: 175k]
  |  Branch (736:39): [True: 3, False: 421]
  ------------------
  737|    424|                                      tagnum == SEC_ASN1_INTEGER ||
  ------------------
  |  |   78|    845|#define SEC_ASN1_INTEGER 0x02
  ------------------
  |  Branch (737:39): [True: 3, False: 418]
  ------------------
  738|    424|                                      tagnum == SEC_ASN1_BIT_STRING ||
  ------------------
  |  |   79|    842|#define SEC_ASN1_BIT_STRING 0x03
  ------------------
  |  Branch (738:39): [True: 284, False: 134]
  ------------------
  739|    424|                                      tagnum == SEC_ASN1_OBJECT_ID ||
  ------------------
  |  |   82|    558|#define SEC_ASN1_OBJECT_ID 0x06
  ------------------
  |  Branch (739:39): [True: 6, False: 128]
  ------------------
  740|    424|                                      tagnum == SEC_ASN1_ENUMERATED ||
  ------------------
  |  |   86|    552|#define SEC_ASN1_ENUMERATED 0x0a
  ------------------
  |  Branch (740:39): [True: 0, False: 128]
  ------------------
  741|    424|                                      tagnum == SEC_ASN1_UTC_TIME ||
  ------------------
  |  |   99|    552|#define SEC_ASN1_UTC_TIME 0x17
  ------------------
  |  Branch (741:39): [True: 2, False: 126]
  ------------------
  742|    424|                                      tagnum == SEC_ASN1_GENERALIZED_TIME)) {
  ------------------
  |  |  100|    126|#define SEC_ASN1_GENERALIZED_TIME 0x18
  ------------------
  |  Branch (742:39): [True: 1, False: 125]
  ------------------
  743|       |                    /* these types MUST have at least one content octet */
  744|    299|                    PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|    299|#define PORT_SetError PORT_SetError_Util
  ------------------
  745|    299|                    rv = SECFailure;
  746|    299|                } else
  747|   175k|                    switch (tagnum) {
  748|       |                        /* special cases of primitive types */
  749|  31.9k|                        case SEC_ASN1_INTEGER: {
  ------------------
  |  |   78|  31.9k|#define SEC_ASN1_INTEGER 0x02
  ------------------
  |  Branch (749:25): [True: 31.9k, False: 143k]
  ------------------
  750|  31.9k|                            SECItem* destItem = (SECItem*)((char*)dest +
  751|  31.9k|                                                           templateEntry->offset);
  752|  31.9k|                            if (destItem && (siUnsignedInteger == destItem->type)) {
  ------------------
  |  Branch (752:33): [True: 31.9k, False: 0]
  |  Branch (752:45): [True: 21.2k, False: 10.7k]
  ------------------
  753|       |                                /* A leading 0 is only allowed when a value
  754|       |                                 * would otherwise be interpreted as negative. */
  755|  21.2k|                                if (temp.len > 1 && temp.data[0] == 0) {
  ------------------
  |  Branch (755:37): [True: 20.6k, False: 591]
  |  Branch (755:53): [True: 6.68k, False: 13.9k]
  ------------------
  756|  6.68k|                                    temp.data++;
  757|  6.68k|                                    temp.len--;
  758|  6.68k|                                    if (!(temp.data[0] & 0x80)) {
  ------------------
  |  Branch (758:41): [True: 8, False: 6.67k]
  ------------------
  759|      8|                                        PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|      8|#define PORT_SetError PORT_SetError_Util
  ------------------
  760|      8|                                        rv = SECFailure;
  761|      8|                                    }
  762|  6.68k|                                }
  763|  21.2k|                            }
  764|  31.9k|                            break;
  765|      0|                        }
  766|       |
  767|  40.0k|                        case SEC_ASN1_BIT_STRING: {
  ------------------
  |  |   79|  40.0k|#define SEC_ASN1_BIT_STRING 0x03
  ------------------
  |  Branch (767:25): [True: 40.0k, False: 135k]
  ------------------
  768|       |                            /* Can't be 8 or more spare bits, or any spare bits
  769|       |                             * if there are no octets. */
  770|  40.0k|                            if (temp.data[0] >= 8 || (temp.data[0] > 0 && temp.len == 1)) {
  ------------------
  |  Branch (770:33): [True: 300, False: 39.7k]
  |  Branch (770:55): [True: 8.35k, False: 31.4k]
  |  Branch (770:75): [True: 165, False: 8.18k]
  ------------------
  771|    465|                                PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|    465|#define PORT_SetError PORT_SetError_Util
  ------------------
  772|    465|                                rv = SECFailure;
  773|    465|                                break;
  774|    465|                            }
  775|       |                            /* change the length in the SECItem to be the number
  776|       |                               of bits */
  777|  39.5k|                            temp.len = (temp.len - 1) * 8 - (temp.data[0] & 0x7);
  778|  39.5k|                            temp.data++;
  779|  39.5k|                            break;
  780|  40.0k|                        }
  781|       |
  782|   103k|                        default: {
  ------------------
  |  Branch (782:25): [True: 103k, False: 72.0k]
  ------------------
  783|   103k|                            break;
  784|  40.0k|                        }
  785|   175k|                    }
  786|   176k|            }
  787|   176k|        }
  788|   567k|    }
  789|       |
  790|   686k|    if ((SECSuccess == rv) && (PR_TRUE == save)) {
  ------------------
  |  |  437|   681k|#define PR_TRUE 1
  ------------------
  |  Branch (790:9): [True: 681k, False: 5.19k]
  |  Branch (790:31): [True: 284k, False: 396k]
  ------------------
  791|   284k|        SECItem* destItem = (SECItem*)((char*)dest + templateEntry->offset);
  792|   284k|        if (destItem) {
  ------------------
  |  Branch (792:13): [True: 284k, False: 0]
  ------------------
  793|       |            /* we leave the type alone in the destination SECItem.
  794|       |               If part of the destination was allocated by the decoder, in
  795|       |               cases of POINTER, SET OF and SEQUENCE OF, then type is set to
  796|       |               siBuffer due to the use of PORT_ArenaZAlloc*/
  797|   284k|            destItem->data = temp.len ? temp.data : NULL;
  ------------------
  |  Branch (797:30): [True: 283k, False: 987]
  ------------------
  798|   284k|            destItem->len = temp.len;
  799|   284k|        } else {
  800|      0|            PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  801|      0|            rv = SECFailure;
  802|      0|        }
  803|   284k|    }
  804|       |
  805|   686k|    if (PR_TRUE == pop) {
  ------------------
  |  |  437|   686k|#define PR_TRUE 1
  ------------------
  |  Branch (805:9): [True: 68.4k, False: 617k]
  ------------------
  806|       |        /* we don't want to move ahead, so restore the position */
  807|  68.4k|        *src = mark;
  808|  68.4k|    }
  809|   686k|    return rv;
  810|   686k|}
quickder.c:GetItem:
  115|  1.11M|{
  116|  1.11M|    if ((!src) || (!dest) || (!src->data && src->len)) {
  ------------------
  |  Branch (116:9): [True: 0, False: 1.11M]
  |  Branch (116:19): [True: 0, False: 1.11M]
  |  Branch (116:31): [True: 9, False: 1.11M]
  |  Branch (116:45): [True: 0, False: 9]
  ------------------
  117|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  118|      0|        return SECFailure;
  119|      0|    }
  120|       |
  121|  1.11M|    if (!src->len) {
  ------------------
  |  Branch (121:9): [True: 26.8k, False: 1.08M]
  ------------------
  122|       |        /* reaching the end of the buffer is not an error */
  123|  26.8k|        dest->data = NULL;
  124|  26.8k|        dest->len = 0;
  125|  26.8k|        return SECSuccess;
  126|  26.8k|    }
  127|       |
  128|  1.08M|    dest->data = definite_length_decoder(src->data, src->len, &dest->len,
  129|  1.08M|                                         includeTag);
  130|  1.08M|    if (dest->data == NULL) {
  ------------------
  |  Branch (130:9): [True: 1.05k, False: 1.08M]
  ------------------
  131|  1.05k|        PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|  1.05k|#define PORT_SetError PORT_SetError_Util
  ------------------
  132|  1.05k|        return SECFailure;
  133|  1.05k|    }
  134|  1.08M|    src->len -= (int)(dest->data - src->data) + dest->len;
  135|  1.08M|    src->data = dest->data + dest->len;
  136|  1.08M|    return SECSuccess;
  137|  1.08M|}
quickder.c:definite_length_decoder:
   22|  1.08M|{
   23|  1.08M|    unsigned char tag;
   24|  1.08M|    unsigned int used_length = 0;
   25|  1.08M|    unsigned int data_length = 0;
   26|  1.08M|    unsigned char length_field_len = 0;
   27|  1.08M|    unsigned char byte;
   28|  1.08M|    unsigned int i;
   29|       |
   30|  1.08M|    if (used_length >= buf_length) {
  ------------------
  |  Branch (30:9): [True: 0, False: 1.08M]
  ------------------
   31|       |        /* Tag field was not found! */
   32|      0|        return NULL;
   33|      0|    }
   34|  1.08M|    tag = buf[used_length++];
   35|       |
   36|  1.08M|    if (tag == 0) {
  ------------------
  |  Branch (36:9): [True: 163, False: 1.08M]
  ------------------
   37|       |        /* End-of-contents octects should not be present in DER because
   38|       |           DER doesn't use the indefinite length form. */
   39|    163|        return NULL;
   40|    163|    }
   41|       |
   42|  1.08M|    if ((tag & 0x1F) == 0x1F) {
  ------------------
  |  Branch (42:9): [True: 33, False: 1.08M]
  ------------------
   43|       |        /* High tag number (a tag number > 30) is not supported */
   44|     33|        return NULL;
   45|     33|    }
   46|       |
   47|  1.08M|    if (used_length >= buf_length) {
  ------------------
  |  Branch (47:9): [True: 12, False: 1.08M]
  ------------------
   48|       |        /* Length field was not found! */
   49|     12|        return NULL;
   50|     12|    }
   51|  1.08M|    byte = buf[used_length++];
   52|       |
   53|  1.08M|    if (!(byte & 0x80)) {
  ------------------
  |  Branch (53:9): [True: 808k, False: 274k]
  ------------------
   54|       |        /* Short form: The high bit is not set. */
   55|   808k|        data_length = byte; /* clarity; we're returning a 32-bit int. */
   56|   808k|    } else {
   57|       |        /* Long form. Extract the field length */
   58|   274k|        length_field_len = byte & 0x7F;
   59|   274k|        if (length_field_len == 0) {
  ------------------
  |  Branch (59:13): [True: 12, False: 274k]
  ------------------
   60|       |            /* DER doesn't use the indefinite length form. */
   61|     12|            return NULL;
   62|     12|        }
   63|       |
   64|   274k|        if (length_field_len > sizeof(data_length)) {
  ------------------
  |  Branch (64:13): [True: 385, False: 274k]
  ------------------
   65|       |            /* We don't support an extended length field  longer than
   66|       |               4 bytes (2^32) */
   67|    385|            return NULL;
   68|    385|        }
   69|       |
   70|   274k|        if (length_field_len > (buf_length - used_length)) {
  ------------------
  |  Branch (70:13): [True: 14, False: 274k]
  ------------------
   71|       |            /* Extended length field was not found */
   72|     14|            return NULL;
   73|     14|        }
   74|       |
   75|       |        /* Iterate across the extended length field */
   76|   718k|        for (i = 0; i < length_field_len; i++) {
  ------------------
  |  Branch (76:21): [True: 443k, False: 274k]
  ------------------
   77|   443k|            byte = buf[used_length++];
   78|   443k|            data_length = (data_length << 8) | byte;
   79|       |
   80|   443k|            if (i == 0) {
  ------------------
  |  Branch (80:17): [True: 274k, False: 169k]
  ------------------
   81|   274k|                PRBool too_long = PR_FALSE;
  ------------------
  |  |  438|   274k|#define PR_FALSE 0
  ------------------
   82|   274k|                if (length_field_len == 1) {
  ------------------
  |  Branch (82:21): [True: 105k, False: 168k]
  ------------------
   83|   105k|                    too_long = ((byte & 0x80) == 0); /* Short form suffices */
   84|   168k|                } else {
   85|   168k|                    too_long = (byte == 0); /* This zero byte can be omitted */
   86|   168k|                }
   87|   274k|                if (too_long) {
  ------------------
  |  Branch (87:21): [True: 15, False: 274k]
  ------------------
   88|       |                    /* The length is longer than needed. */
   89|     15|                    return NULL;
   90|     15|                }
   91|   274k|            }
   92|   443k|        }
   93|   274k|    }
   94|       |
   95|  1.08M|    if ((tag & SEC_ASN1_TAGNUM_MASK) == SEC_ASN1_NULL && data_length != 0) {
  ------------------
  |  |   76|  1.08M|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
                  if ((tag & SEC_ASN1_TAGNUM_MASK) == SEC_ASN1_NULL && data_length != 0) {
  ------------------
  |  |   81|  2.16M|#define SEC_ASN1_NULL 0x05
  ------------------
  |  Branch (95:9): [True: 16.0k, False: 1.06M]
  |  Branch (95:58): [True: 59, False: 15.9k]
  ------------------
   96|       |        /* The DER encoding of NULL has no contents octets */
   97|     59|        return NULL;
   98|     59|    }
   99|       |
  100|  1.08M|    if (data_length > (buf_length - used_length)) {
  ------------------
  |  Branch (100:9): [True: 360, False: 1.08M]
  ------------------
  101|       |        /* The decoded length exceeds the available buffer */
  102|    360|        return NULL;
  103|    360|    }
  104|       |
  105|  1.08M|    if (includeTag) {
  ------------------
  |  Branch (105:9): [True: 692k, False: 390k]
  ------------------
  106|   692k|        data_length += used_length;
  107|   692k|    }
  108|       |
  109|  1.08M|    *out_data_length = data_length;
  110|  1.08M|    return ((unsigned char*)buf + (includeTag ? 0 : used_length));
  ------------------
  |  Branch (110:36): [True: 692k, False: 390k]
  ------------------
  111|  1.08M|}
quickder.c:MatchComponentType:
  144|   695k|{
  145|   695k|    unsigned long kind = 0;
  146|   695k|    unsigned char tag = 0;
  147|       |
  148|   695k|    if ((!item) || (!item->data && item->len) || (!templateEntry) || (!match)) {
  ------------------
  |  Branch (148:9): [True: 0, False: 695k]
  |  Branch (148:21): [True: 26.5k, False: 669k]
  |  Branch (148:36): [True: 0, False: 26.5k]
  |  Branch (148:50): [True: 0, False: 695k]
  |  Branch (148:70): [True: 0, False: 695k]
  ------------------
  149|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  150|      0|        return SECFailure;
  151|      0|    }
  152|       |
  153|   695k|    if (!item->len) {
  ------------------
  |  Branch (153:9): [True: 26.5k, False: 669k]
  ------------------
  154|  26.5k|        *match = PR_FALSE;
  ------------------
  |  |  438|  26.5k|#define PR_FALSE 0
  ------------------
  155|  26.5k|        return SECSuccess;
  156|  26.5k|    }
  157|       |
  158|   669k|    kind = templateEntry->kind;
  159|   669k|    tag = *(unsigned char*)item->data;
  160|       |
  161|   669k|    if (((kind & SEC_ASN1_INLINE) ||
  ------------------
  |  |  134|   669k|#define SEC_ASN1_INLINE 0x00800
  ------------------
  |  Branch (161:10): [True: 79.2k, False: 590k]
  ------------------
  162|   669k|         (kind & SEC_ASN1_POINTER)) &&
  ------------------
  |  |  135|   590k|#define SEC_ASN1_POINTER 0x01000
  ------------------
  |  Branch (162:10): [True: 7, False: 590k]
  ------------------
  163|   669k|        (0 == (kind & SEC_ASN1_TAG_MASK))) {
  ------------------
  |  |   65|  79.2k|#define SEC_ASN1_TAG_MASK 0xff
  ------------------
  |  Branch (163:9): [True: 79.2k, False: 0]
  ------------------
  164|       |        /* These cases are special because the template's "kind" does not
  165|       |           give us the information for the ASN.1 tag of the next item. It can
  166|       |           only be figured out from the subtemplate. */
  167|  79.2k|        if (!(kind & SEC_ASN1_OPTIONAL)) {
  ------------------
  |  |  131|  79.2k|#define SEC_ASN1_OPTIONAL 0x00100
  ------------------
  |  Branch (167:13): [True: 79.2k, False: 0]
  ------------------
  168|       |            /* This is a required component. If there is a type mismatch,
  169|       |               the decoding of the subtemplate will fail, so assume this
  170|       |               is a match at the parent level and let it fail later. This
  171|       |               avoids a redundant check in matching cases */
  172|  79.2k|            *match = PR_TRUE;
  ------------------
  |  |  437|  79.2k|#define PR_TRUE 1
  ------------------
  173|  79.2k|            return SECSuccess;
  174|  79.2k|        } else {
  175|       |            /* optional component. This is the hard case. Now we need to
  176|       |               look at the subtemplate to get the expected kind */
  177|      0|            const SEC_ASN1Template* subTemplate =
  178|      0|                SEC_ASN1GetSubtemplate(templateEntry, dest, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  179|      0|            if (!subTemplate) {
  ------------------
  |  Branch (179:17): [True: 0, False: 0]
  ------------------
  180|      0|                PORT_SetError(SEC_ERROR_BAD_TEMPLATE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  181|      0|                return SECFailure;
  182|      0|            }
  183|      0|            if ((subTemplate->kind & SEC_ASN1_INLINE) ||
  ------------------
  |  |  134|      0|#define SEC_ASN1_INLINE 0x00800
  ------------------
  |  Branch (183:17): [True: 0, False: 0]
  ------------------
  184|      0|                (subTemplate->kind & SEC_ASN1_POINTER)) {
  ------------------
  |  |  135|      0|#define SEC_ASN1_POINTER 0x01000
  ------------------
  |  Branch (184:17): [True: 0, False: 0]
  ------------------
  185|       |                /* disallow nesting SEC_ASN1_POINTER and SEC_ASN1_INLINE,
  186|       |                   otherwise you may get a false positive due to the recursion
  187|       |                   optimization above that always matches the type if the
  188|       |                   component is required . Nesting these should never be
  189|       |                   required, so that no one should miss this ability */
  190|      0|                PORT_SetError(SEC_ERROR_BAD_TEMPLATE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  191|      0|                return SECFailure;
  192|      0|            }
  193|      0|            return MatchComponentType(subTemplate, item, match,
  194|      0|                                      (void*)((char*)dest + templateEntry->offset));
  195|      0|        }
  196|  79.2k|    }
  197|       |
  198|   590k|    if (kind & SEC_ASN1_CHOICE) {
  ------------------
  |  |  153|   590k|#define SEC_ASN1_CHOICE 0x100000      /* pick one from a template */
  ------------------
  |  Branch (198:9): [True: 10.5k, False: 579k]
  ------------------
  199|       |        /* we need to check the component's tag against each choice's tag */
  200|       |        /* XXX it would be nice to save the index of the choice here so that
  201|       |           DecodeChoice wouldn't have to do this again. However, due to the
  202|       |           recursivity of MatchComponentType, we don't know if we are in a
  203|       |           required or optional component, so we can't write anywhere in
  204|       |           the destination within this function */
  205|  10.5k|        unsigned choiceIndex = 1;
  206|  10.5k|        const SEC_ASN1Template* choiceEntry;
  207|  10.6k|        while ((choiceEntry = &templateEntry[choiceIndex++]) && (choiceEntry->kind)) {
  ------------------
  |  Branch (207:16): [True: 10.6k, False: 0]
  |  Branch (207:65): [True: 10.6k, False: 2]
  ------------------
  208|  10.6k|            if ((SECSuccess == MatchComponentType(choiceEntry, item, match,
  ------------------
  |  Branch (208:17): [True: 10.6k, False: 0]
  ------------------
  209|  10.6k|                                                  (void*)((char*)dest + choiceEntry->offset))) &&
  210|  10.6k|                (PR_TRUE == *match)) {
  ------------------
  |  |  437|  10.6k|#define PR_TRUE 1
  ------------------
  |  Branch (210:17): [True: 10.5k, False: 36]
  ------------------
  211|  10.5k|                return SECSuccess;
  212|  10.5k|            }
  213|  10.6k|        }
  214|       |        /* no match, caller must decide if this is BAD DER, or not. */
  215|      2|        *match = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  216|      2|        return SECSuccess;
  217|  10.5k|    }
  218|       |
  219|   579k|    if (kind & SEC_ASN1_ANY) {
  ------------------
  |  |  133|   579k|#define SEC_ASN1_ANY 0x00400
  ------------------
  |  Branch (219:9): [True: 87.6k, False: 491k]
  ------------------
  220|       |        /* SEC_ASN1_ANY always matches */
  221|  87.6k|        *match = PR_TRUE;
  ------------------
  |  |  437|  87.6k|#define PR_TRUE 1
  ------------------
  222|  87.6k|        return SECSuccess;
  223|  87.6k|    }
  224|       |
  225|   491k|    if ((0 == ((unsigned char)kind & SEC_ASN1_TAGNUM_MASK)) &&
  ------------------
  |  |   76|   491k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  |  Branch (225:9): [True: 99.9k, False: 391k]
  ------------------
  226|   491k|        (!(kind & SEC_ASN1_EXPLICIT)) &&
  ------------------
  |  |  132|  99.9k|#define SEC_ASN1_EXPLICIT 0x00200
  ------------------
  |  Branch (226:9): [True: 68.3k, False: 31.5k]
  ------------------
  227|   491k|        (((kind & SEC_ASN1_SAVE) ||
  ------------------
  |  |  144|  68.3k|#define SEC_ASN1_SAVE 0x20000         /* stash away the encoded bytes first; \
  ------------------
  |  Branch (227:11): [True: 21.2k, False: 47.1k]
  ------------------
  228|  68.3k|          (kind & SEC_ASN1_SKIP)) &&
  ------------------
  |  |  140|  47.1k|#define SEC_ASN1_SKIP 0x08000         /* skip a field; only for decoding */
  ------------------
  |  Branch (228:11): [True: 47.1k, False: 29]
  ------------------
  229|  68.3k|         (!(kind & SEC_ASN1_OPTIONAL)))) {
  ------------------
  |  |  131|  68.3k|#define SEC_ASN1_OPTIONAL 0x00100
  ------------------
  |  Branch (229:10): [True: 68.3k, False: 0]
  ------------------
  230|       |        /* when saving or skipping a required component,  a type is not
  231|       |           required in the template. This is for legacy support of
  232|       |           SEC_ASN1_SAVE and SEC_ASN1_SKIP only. XXX I would like to
  233|       |           deprecate these usages and always require a type, as this
  234|       |           disables type checking, and effectively forbids us from
  235|       |           transparently ignoring optional components we aren't aware of */
  236|  68.3k|        *match = PR_TRUE;
  ------------------
  |  |  437|  68.3k|#define PR_TRUE 1
  ------------------
  237|  68.3k|        return SECSuccess;
  238|  68.3k|    }
  239|       |
  240|       |    /* first, do a class check */
  241|   423k|    if ((tag & SEC_ASN1_CLASS_MASK) !=
  ------------------
  |  |  119|   423k|#define SEC_ASN1_CLASS_MASK 0xc0
  ------------------
  |  Branch (241:9): [True: 248, False: 423k]
  ------------------
  242|   423k|        (((unsigned char)kind) & SEC_ASN1_CLASS_MASK)) {
  ------------------
  |  |  119|   423k|#define SEC_ASN1_CLASS_MASK 0xc0
  ------------------
  243|       |        /* this is only to help debugging of the decoder in case of problems */
  244|       |        /* unsigned char tagclass = tag & SEC_ASN1_CLASS_MASK; */
  245|       |        /* unsigned char expectedclass = (unsigned char)kind & SEC_ASN1_CLASS_MASK; */
  246|    248|        *match = PR_FALSE;
  ------------------
  |  |  438|    248|#define PR_FALSE 0
  ------------------
  247|    248|        return SECSuccess;
  248|    248|    }
  249|       |
  250|       |    /* now do a tag check */
  251|   423k|    if (((unsigned char)kind & SEC_ASN1_TAGNUM_MASK) !=
  ------------------
  |  |   76|   423k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  |  Branch (251:9): [True: 22.4k, False: 400k]
  ------------------
  252|   423k|        (tag & SEC_ASN1_TAGNUM_MASK)) {
  ------------------
  |  |   76|   423k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  253|  22.4k|        *match = PR_FALSE;
  ------------------
  |  |  438|  22.4k|#define PR_FALSE 0
  ------------------
  254|  22.4k|        return SECSuccess;
  255|  22.4k|    }
  256|       |
  257|       |    /* now, do a method check. This depends on the class */
  258|   400k|    switch (tag & SEC_ASN1_CLASS_MASK) {
  ------------------
  |  |  119|   400k|#define SEC_ASN1_CLASS_MASK 0xc0
  ------------------
  259|   363k|        case SEC_ASN1_UNIVERSAL:
  ------------------
  |  |  120|   363k|#define SEC_ASN1_UNIVERSAL 0x00
  ------------------
  |  Branch (259:9): [True: 363k, False: 36.8k]
  ------------------
  260|       |            /* For types of the SEC_ASN1_UNIVERSAL class, we know which must be
  261|       |               primitive or constructed based on the tag */
  262|   363k|            switch (tag & SEC_ASN1_TAGNUM_MASK) {
  ------------------
  |  |   76|   363k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  263|   166k|                case SEC_ASN1_SEQUENCE:
  ------------------
  |  |   92|   166k|#define SEC_ASN1_SEQUENCE 0x10
  ------------------
  |  Branch (263:17): [True: 166k, False: 197k]
  ------------------
  264|   177k|                case SEC_ASN1_SET:
  ------------------
  |  |   93|   177k|#define SEC_ASN1_SET 0x11
  ------------------
  |  Branch (264:17): [True: 10.9k, False: 352k]
  ------------------
  265|   177k|                case SEC_ASN1_EMBEDDED_PDV:
  ------------------
  |  |   87|   177k|#define SEC_ASN1_EMBEDDED_PDV 0x0b
  ------------------
  |  Branch (265:17): [True: 0, False: 363k]
  ------------------
  266|       |                    /* this component must be a constructed type */
  267|       |                    /* XXX add any new universal constructed type here */
  268|   177k|                    if (tag & SEC_ASN1_CONSTRUCTED) {
  ------------------
  |  |  117|   177k|#define SEC_ASN1_CONSTRUCTED 0x20
  ------------------
  |  Branch (268:25): [True: 177k, False: 26]
  ------------------
  269|   177k|                        *match = PR_TRUE;
  ------------------
  |  |  437|   177k|#define PR_TRUE 1
  ------------------
  270|   177k|                        return SECSuccess;
  271|   177k|                    }
  272|     26|                    break;
  273|       |
  274|   186k|                default:
  ------------------
  |  Branch (274:17): [True: 186k, False: 177k]
  ------------------
  275|       |                    /* this component must be a primitive type */
  276|   186k|                    if (!(tag & SEC_ASN1_CONSTRUCTED)) {
  ------------------
  |  |  117|   186k|#define SEC_ASN1_CONSTRUCTED 0x20
  ------------------
  |  Branch (276:25): [True: 186k, False: 13]
  ------------------
  277|   186k|                        *match = PR_TRUE;
  ------------------
  |  |  437|   186k|#define PR_TRUE 1
  ------------------
  278|   186k|                        return SECSuccess;
  279|   186k|                    }
  280|     13|                    break;
  281|   363k|            }
  282|     39|            break;
  283|       |
  284|  36.8k|        default:
  ------------------
  |  Branch (284:9): [True: 36.8k, False: 363k]
  ------------------
  285|       |            /* for all other classes, we check the method based on the template */
  286|  36.8k|            if ((unsigned char)(kind & SEC_ASN1_METHOD_MASK) ==
  ------------------
  |  |  115|  36.8k|#define SEC_ASN1_METHOD_MASK 0x20
  ------------------
  |  Branch (286:17): [True: 36.8k, False: 14]
  ------------------
  287|  36.8k|                (tag & SEC_ASN1_METHOD_MASK)) {
  ------------------
  |  |  115|  36.8k|#define SEC_ASN1_METHOD_MASK 0x20
  ------------------
  288|  36.8k|                *match = PR_TRUE;
  ------------------
  |  |  437|  36.8k|#define PR_TRUE 1
  ------------------
  289|  36.8k|                return SECSuccess;
  290|  36.8k|            }
  291|       |            /* method does not match between template and component */
  292|     14|            break;
  293|   400k|    }
  294|       |
  295|     53|    *match = PR_FALSE;
  ------------------
  |  |  438|     53|#define PR_FALSE 0
  ------------------
  296|     53|    return SECSuccess;
  297|   400k|}
quickder.c:DecodeInline:
  402|   116k|{
  403|   116k|    const SEC_ASN1Template* inlineTemplate =
  404|   116k|        SEC_ASN1GetSubtemplate(templateEntry, dest, PR_FALSE);
  ------------------
  |  |  438|   116k|#define PR_FALSE 0
  ------------------
  405|   116k|    return DecodeItem((void*)((char*)dest + templateEntry->offset),
  406|   116k|                      inlineTemplate, src, arena, checkTag);
  407|   116k|}
quickder.c:DecodeExplicit:
  568|  36.7k|{
  569|  36.7k|    SECStatus rv = SECSuccess;
  570|  36.7k|    SECItem subItem;
  571|  36.7k|    SECItem constructed = *src;
  572|       |
  573|  36.7k|    rv = GetItem(&constructed, &subItem, PR_FALSE);
  ------------------
  |  |  438|  36.7k|#define PR_FALSE 0
  ------------------
  574|       |
  575|  36.7k|    if (SECSuccess == rv) {
  ------------------
  |  Branch (575:9): [True: 36.7k, False: 0]
  ------------------
  576|  36.7k|        if (templateEntry->kind & SEC_ASN1_POINTER) {
  ------------------
  |  |  135|  36.7k|#define SEC_ASN1_POINTER 0x01000
  ------------------
  |  Branch (576:13): [True: 0, False: 36.7k]
  ------------------
  577|      0|            rv = DecodePointer(dest, templateEntry, &subItem, arena, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  578|  36.7k|        } else {
  579|  36.7k|            rv = DecodeInline(dest, templateEntry, &subItem, arena, PR_TRUE);
  ------------------
  |  |  437|  36.7k|#define PR_TRUE 1
  ------------------
  580|  36.7k|        }
  581|  36.7k|    }
  582|       |
  583|  36.7k|    return rv;
  584|  36.7k|}
quickder.c:DecodeImplicit:
  434|     89|{
  435|     89|    if (templateEntry->kind & SEC_ASN1_POINTER) {
  ------------------
  |  |  135|     89|#define SEC_ASN1_POINTER 0x01000
  ------------------
  |  Branch (435:9): [True: 0, False: 89]
  ------------------
  436|      0|        return DecodePointer((void*)((char*)dest),
  437|      0|                             templateEntry, src, arena, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  438|     89|    } else {
  439|     89|        return DecodeInline((void*)((char*)dest),
  440|     89|                            templateEntry, src, arena, PR_FALSE);
  ------------------
  |  |  438|     89|#define PR_FALSE 0
  ------------------
  441|     89|    }
  442|     89|}
quickder.c:DecodePointer:
  413|      7|{
  414|      7|    const SEC_ASN1Template* ptrTemplate =
  415|      7|        SEC_ASN1GetSubtemplate(templateEntry, dest, PR_FALSE);
  ------------------
  |  |  438|      7|#define PR_FALSE 0
  ------------------
  416|      7|    if (!ptrTemplate) {
  ------------------
  |  Branch (416:9): [True: 0, False: 7]
  ------------------
  417|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  418|      0|        return SECFailure;
  419|      0|    }
  420|      7|    void* subdata = PORT_ArenaZAlloc(arena, ptrTemplate->size);
  ------------------
  |  |   59|      7|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  421|      7|    *(void**)((char*)dest + templateEntry->offset) = subdata;
  422|      7|    if (subdata) {
  ------------------
  |  Branch (422:9): [True: 7, False: 0]
  ------------------
  423|      7|        return DecodeItem(subdata, ptrTemplate, src, arena, checkTag);
  424|      7|    } else {
  425|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  426|      0|        return SECFailure;
  427|      0|    }
  428|      7|}
quickder.c:DecodeChoice:
  448|  10.5k|{
  449|  10.5k|    SECStatus rv = SECSuccess;
  450|  10.5k|    SECItem choice;
  451|  10.5k|    const SEC_ASN1Template* choiceTemplate = &(templateEntry[1]);
  452|  10.5k|    const SEC_ASN1Template* choiceEntry = NULL;
  453|  10.5k|    unsigned long choiceindex = 0;
  454|       |
  455|       |    /* XXX for a choice component, we should validate the template to make
  456|       |       sure the tags are distinct, in debug builds. This hasn't been
  457|       |       implemented yet */
  458|       |    /* rv = CheckChoiceTemplate(sequenceTemplate); */
  459|       |
  460|       |    /* process it */
  461|  10.6k|    do {
  462|  10.6k|        choice = *src;
  463|  10.6k|        choiceEntry = &choiceTemplate[choiceindex++];
  464|  10.6k|        if (choiceEntry->kind) {
  ------------------
  |  Branch (464:13): [True: 10.6k, False: 3]
  ------------------
  465|  10.6k|            rv = DecodeItem(dest, choiceEntry, &choice, arena, PR_TRUE);
  ------------------
  |  |  437|  10.6k|#define PR_TRUE 1
  ------------------
  466|  10.6k|        }
  467|  10.6k|    } while ((SECFailure == rv) && (choiceEntry->kind));
  ------------------
  |  Branch (467:14): [True: 40, False: 10.5k]
  |  Branch (467:36): [True: 37, False: 3]
  ------------------
  468|       |
  469|  10.5k|    if (SECFailure == rv) {
  ------------------
  |  Branch (469:9): [True: 3, False: 10.5k]
  ------------------
  470|       |        /* the component didn't match any of the choices */
  471|      3|        PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|      3|#define PORT_SetError PORT_SetError_Util
  ------------------
  472|  10.5k|    } else {
  473|       |        /* set the type in the union here */
  474|  10.5k|        int* which = (int*)((char*)dest + templateEntry->offset);
  475|  10.5k|        *which = (int)choiceEntry->size;
  476|  10.5k|    }
  477|       |
  478|       |    /* we should have consumed all the bytes by now */
  479|       |    /* fail if we have not */
  480|  10.5k|    if (SECSuccess == rv && choice.len) {
  ------------------
  |  Branch (480:9): [True: 10.5k, False: 3]
  |  Branch (480:29): [True: 0, False: 10.5k]
  ------------------
  481|       |        /* there is extra data that isn't listed in the template */
  482|      0|        PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  483|      0|        rv = SECFailure;
  484|      0|    }
  485|  10.5k|    return rv;
  486|  10.5k|}
quickder.c:DecodeGroup:
  492|  26.9k|{
  493|  26.9k|    SECStatus rv = SECSuccess;
  494|  26.9k|    SECItem source;
  495|  26.9k|    SECItem group;
  496|  26.9k|    PRUint32 totalEntries = 0;
  497|  26.9k|    PRUint32 entryIndex = 0;
  498|  26.9k|    void** entries = NULL;
  499|       |
  500|  26.9k|    const SEC_ASN1Template* subTemplate =
  501|  26.9k|        SEC_ASN1GetSubtemplate(templateEntry, dest, PR_FALSE);
  ------------------
  |  |  438|  26.9k|#define PR_FALSE 0
  ------------------
  502|       |
  503|  26.9k|    source = *src;
  504|       |
  505|       |    /* get the group */
  506|  26.9k|    if (SECSuccess == rv) {
  ------------------
  |  Branch (506:9): [True: 26.9k, False: 0]
  ------------------
  507|  26.9k|        rv = GetItem(&source, &group, PR_FALSE);
  ------------------
  |  |  438|  26.9k|#define PR_FALSE 0
  ------------------
  508|  26.9k|    }
  509|       |
  510|       |    /* XXX we should check the subtemplate in debug builds */
  511|  26.9k|    if (SECSuccess == rv) {
  ------------------
  |  Branch (511:9): [True: 26.9k, False: 0]
  ------------------
  512|       |        /* first, count the number of entries. Benchmarking showed that this
  513|       |           counting pass is more efficient than trying to allocate entries as
  514|       |           we read the DER, even if allocating many entries at a time
  515|       |        */
  516|  26.9k|        SECItem counter = group;
  517|  34.4k|        do {
  518|  34.4k|            SECItem anitem;
  519|  34.4k|            rv = GetItem(&counter, &anitem, PR_TRUE);
  ------------------
  |  |  437|  34.4k|#define PR_TRUE 1
  ------------------
  520|  34.4k|            if (SECSuccess == rv && (anitem.len)) {
  ------------------
  |  Branch (520:17): [True: 34.3k, False: 30]
  |  Branch (520:37): [True: 34.0k, False: 328]
  ------------------
  521|  34.0k|                totalEntries++;
  522|  34.0k|            }
  523|  34.4k|        } while ((SECSuccess == rv) && (counter.len));
  ------------------
  |  Branch (523:18): [True: 34.3k, False: 30]
  |  Branch (523:40): [True: 7.42k, False: 26.9k]
  ------------------
  524|       |
  525|  26.9k|        if (SECSuccess == rv) {
  ------------------
  |  Branch (525:13): [True: 26.9k, False: 30]
  ------------------
  526|       |            /* allocate room for pointer array and entries */
  527|       |            /* we want to allocate the array even if there is 0 entry */
  528|  26.9k|            entries = (void**)PORT_ArenaZAlloc(arena, sizeof(void*) * (totalEntries + 1) + /* the extra one is for NULL termination */
  ------------------
  |  |   59|  26.9k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  529|  26.9k|                                                          subTemplate->size * totalEntries);
  530|       |
  531|  26.9k|            if (entries) {
  ------------------
  |  Branch (531:17): [True: 26.9k, False: 0]
  ------------------
  532|  26.9k|                entries[totalEntries] = NULL; /* terminate the array */
  533|  26.9k|            } else {
  534|      0|                PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  535|      0|                rv = SECFailure;
  536|      0|            }
  537|  26.9k|            if (SECSuccess == rv) {
  ------------------
  |  Branch (537:17): [True: 26.9k, False: 0]
  ------------------
  538|  26.9k|                void* entriesData = (unsigned char*)entries + (unsigned long)(sizeof(void*) * (totalEntries + 1));
  539|       |                /* and fix the pointers in the array */
  540|  26.9k|                PRUint32 entriesIndex = 0;
  541|  60.7k|                for (entriesIndex = 0; entriesIndex < totalEntries; entriesIndex++) {
  ------------------
  |  Branch (541:40): [True: 33.8k, False: 26.9k]
  ------------------
  542|  33.8k|                    entries[entriesIndex] =
  543|  33.8k|                        (char*)entriesData + (subTemplate->size * entriesIndex);
  544|  33.8k|                }
  545|  26.9k|            }
  546|  26.9k|        }
  547|  26.9k|    }
  548|       |
  549|  26.9k|    if (SECSuccess == rv && totalEntries)
  ------------------
  |  Branch (549:9): [True: 26.9k, False: 30]
  |  Branch (549:29): [True: 26.6k, False: 328]
  ------------------
  550|  32.1k|        do {
  551|  32.1k|            if (!(entryIndex < totalEntries)) {
  ------------------
  |  Branch (551:17): [True: 0, False: 32.1k]
  ------------------
  552|      0|                rv = SECFailure;
  553|      0|                break;
  554|      0|            }
  555|  32.1k|            rv = DecodeItem(entries[entryIndex++], subTemplate, &group, arena, PR_TRUE);
  ------------------
  |  |  437|  32.1k|#define PR_TRUE 1
  ------------------
  556|  32.1k|        } while ((SECSuccess == rv) && (group.len));
  ------------------
  |  Branch (556:18): [True: 32.0k, False: 94]
  |  Branch (556:40): [True: 5.50k, False: 26.5k]
  ------------------
  557|       |    /* we should be at the end of the set by now */
  558|       |    /* save the entries where requested */
  559|      0|    memcpy(((char*)dest + templateEntry->offset), &entries, sizeof(void**));
  560|       |
  561|  26.9k|    return rv;
  562|  26.9k|}
quickder.c:DecodeSequence:
  353|   150k|{
  354|   150k|    SECStatus rv = SECSuccess;
  355|   150k|    SECItem source;
  356|   150k|    SECItem sequence;
  357|   150k|    const SEC_ASN1Template* sequenceTemplate = &(templateEntry[1]);
  358|   150k|    const SEC_ASN1Template* sequenceEntry = NULL;
  359|   150k|    unsigned long seqindex = 0;
  360|       |
  361|   150k|#ifdef DEBUG
  362|       |    /* for a sequence, we need to validate the template. */
  363|   150k|    rv = CheckSequenceTemplate(sequenceTemplate);
  364|   150k|#endif
  365|       |
  366|   150k|    source = *src;
  367|       |
  368|       |    /* get the sequence */
  369|   150k|    if (SECSuccess == rv) {
  ------------------
  |  Branch (369:9): [True: 150k, False: 0]
  ------------------
  370|   150k|        rv = GetItem(&source, &sequence, PR_FALSE);
  ------------------
  |  |  438|   150k|#define PR_FALSE 0
  ------------------
  371|   150k|    }
  372|       |
  373|       |    /* process it */
  374|   150k|    if (SECSuccess == rv)
  ------------------
  |  Branch (374:9): [True: 150k, False: 0]
  ------------------
  375|   577k|        do {
  376|   577k|            sequenceEntry = &sequenceTemplate[seqindex++];
  377|   577k|            if ((sequenceEntry && sequenceEntry->kind) &&
  ------------------
  |  Branch (377:18): [True: 577k, False: 0]
  |  Branch (377:35): [True: 454k, False: 123k]
  ------------------
  378|   577k|                (sequenceEntry->kind != SEC_ASN1_SKIP_REST)) {
  ------------------
  |  |  151|   454k|#define SEC_ASN1_SKIP_REST 0x80000    /* skip all following fields; \
  ------------------
  |  Branch (378:17): [True: 428k, False: 26.2k]
  ------------------
  379|   428k|                rv = DecodeItem(dest, sequenceEntry, &sequence, arena, PR_TRUE);
  ------------------
  |  |  437|   428k|#define PR_TRUE 1
  ------------------
  380|   428k|            }
  381|   577k|        } while ((SECSuccess == rv) &&
  ------------------
  |  Branch (381:18): [True: 577k, False: 817]
  ------------------
  382|   577k|                 (sequenceEntry->kind &&
  ------------------
  |  Branch (382:19): [True: 453k, False: 123k]
  ------------------
  383|   577k|                  sequenceEntry->kind != SEC_ASN1_SKIP_REST));
  ------------------
  |  |  151|   453k|#define SEC_ASN1_SKIP_REST 0x80000    /* skip all following fields; \
  ------------------
  |  Branch (383:19): [True: 427k, False: 26.2k]
  ------------------
  384|       |    /* we should have consumed all the bytes in the sequence by now
  385|       |       unless the caller doesn't care about the rest of the sequence */
  386|   150k|    if (SECSuccess == rv && sequence.len &&
  ------------------
  |  Branch (386:9): [True: 149k, False: 817]
  |  Branch (386:29): [True: 26.2k, False: 123k]
  ------------------
  387|   150k|        sequenceEntry && sequenceEntry->kind != SEC_ASN1_SKIP_REST) {
  ------------------
  |  |  151|  26.2k|#define SEC_ASN1_SKIP_REST 0x80000    /* skip all following fields; \
  ------------------
  |  Branch (387:9): [True: 26.2k, False: 0]
  |  Branch (387:26): [True: 44, False: 26.2k]
  ------------------
  388|       |        /* it isn't 100% clear whether this is a bad DER or a bad template.
  389|       |           The problem is that logically, they don't match - there is extra
  390|       |           data in the DER that the template doesn't know about */
  391|     44|        PORT_SetError(SEC_ERROR_BAD_DER);
  ------------------
  |  |   65|     44|#define PORT_SetError PORT_SetError_Util
  ------------------
  392|     44|        rv = SECFailure;
  393|     44|    }
  394|       |
  395|   150k|    return rv;
  396|   150k|}
quickder.c:CheckSequenceTemplate:
  303|   150k|{
  304|   150k|    SECStatus rv = SECSuccess;
  305|   150k|    const SEC_ASN1Template* sequenceEntry = NULL;
  306|   150k|    unsigned long seqIndex = 0;
  307|   150k|    unsigned long lastEntryIndex = 0;
  308|   150k|    unsigned long ambiguityIndex = 0;
  309|   150k|    PRBool foundAmbiguity = PR_FALSE;
  ------------------
  |  |  438|   150k|#define PR_FALSE 0
  ------------------
  310|       |
  311|   606k|    do {
  312|   606k|        sequenceEntry = &sequenceTemplate[seqIndex++];
  313|   606k|        if (sequenceEntry->kind) {
  ------------------
  |  Branch (313:13): [True: 456k, False: 150k]
  ------------------
  314|       |            /* ensure that we don't have an optional component of SEC_ASN1_ANY
  315|       |               in the middle of the sequence, since we could not handle it */
  316|       |            /* XXX this function needs to dig into the subtemplates to find
  317|       |               the next tag */
  318|   456k|            if ((PR_FALSE == foundAmbiguity) &&
  ------------------
  |  |  438|   456k|#define PR_FALSE 0
  ------------------
  |  Branch (318:17): [True: 456k, False: 0]
  ------------------
  319|   456k|                (sequenceEntry->kind & SEC_ASN1_OPTIONAL) &&
  ------------------
  |  |  131|   456k|#define SEC_ASN1_OPTIONAL 0x00100
  ------------------
  |  Branch (319:17): [True: 108k, False: 347k]
  ------------------
  320|   456k|                (sequenceEntry->kind & SEC_ASN1_ANY)) {
  ------------------
  |  |  133|   108k|#define SEC_ASN1_ANY 0x00400
  ------------------
  |  Branch (320:17): [True: 42.0k, False: 66.8k]
  ------------------
  321|  42.0k|                foundAmbiguity = PR_TRUE;
  ------------------
  |  |  437|  42.0k|#define PR_TRUE 1
  ------------------
  322|  42.0k|                ambiguityIndex = seqIndex - 1;
  323|  42.0k|            }
  324|   456k|        }
  325|   606k|    } while (sequenceEntry->kind);
  ------------------
  |  Branch (325:14): [True: 456k, False: 150k]
  ------------------
  326|       |
  327|   150k|    lastEntryIndex = seqIndex - 2;
  328|       |
  329|   150k|    if (PR_FALSE != foundAmbiguity) {
  ------------------
  |  |  438|   150k|#define PR_FALSE 0
  ------------------
  |  Branch (329:9): [True: 42.0k, False: 108k]
  ------------------
  330|  42.0k|        if (ambiguityIndex < lastEntryIndex) {
  ------------------
  |  Branch (330:13): [True: 0, False: 42.0k]
  ------------------
  331|       |            /* ambiguity can only be tolerated on the last entry */
  332|      0|            PORT_SetError(SEC_ERROR_BAD_TEMPLATE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  333|      0|            rv = SECFailure;
  334|      0|        }
  335|  42.0k|    }
  336|       |
  337|       |    /* XXX also enforce ASN.1 requirement that tags be
  338|       |       distinct for consecutive optional components */
  339|       |
  340|   150k|    return rv;
  341|   150k|}

SECOID_GetAlgorithmTag_Util:
   14|  15.0k|{
   15|  15.0k|    if (id == NULL || id->algorithm.data == NULL)
  ------------------
  |  Branch (15:9): [True: 0, False: 15.0k]
  |  Branch (15:23): [True: 0, False: 15.0k]
  ------------------
   16|      0|        return SEC_OID_UNKNOWN;
   17|       |
   18|  15.0k|    return SECOID_FindOIDTag(&(id->algorithm));
  ------------------
  |  |  117|  15.0k|#define SECOID_FindOIDTag SECOID_FindOIDTag_Util
  ------------------
   19|  15.0k|}

SEC_ASN1EncodeLength:
  397|  1.46k|{
  398|  1.46k|    int lenlen;
  399|       |
  400|  1.46k|    lenlen = SEC_ASN1LengthLength(value);
  ------------------
  |  |  101|  1.46k|#define SEC_ASN1LengthLength SEC_ASN1LengthLength_Util
  ------------------
  401|  1.46k|    if (lenlen == 1) {
  ------------------
  |  Branch (401:9): [True: 1.36k, False: 98]
  ------------------
  402|  1.36k|        buf[0] = value;
  403|  1.36k|    } else {
  404|     98|        int i;
  405|       |
  406|     98|        i = lenlen - 1;
  407|     98|        buf[0] = 0x80 | i;
  408|    196|        while (i) {
  ------------------
  |  Branch (408:16): [True: 98, False: 98]
  ------------------
  409|     98|            buf[i--] = value;
  410|     98|            value >>= 8;
  411|     98|        }
  412|     98|        PORT_Assert(value == 0);
  ------------------
  |  |  120|     98|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     98|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 98, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  413|     98|    }
  414|  1.46k|    return lenlen;
  415|  1.46k|}
SEC_ASN1EncoderUpdate_Util:
 1201|  1.46k|{
 1202|  1.46k|    sec_asn1e_state *state;
 1203|       |
 1204|  1.46k|    if (cx->status == needBytes) {
  ------------------
  |  Branch (1204:9): [True: 0, False: 1.46k]
  ------------------
 1205|      0|        cx->status = keepGoing;
 1206|      0|    }
 1207|       |
 1208|  4.39k|    while (cx->status == keepGoing) {
  ------------------
  |  Branch (1208:12): [True: 4.39k, False: 0]
  ------------------
 1209|  4.39k|        state = cx->current;
 1210|  4.39k|        switch (state->place) {
 1211|  1.46k|            case beforeHeader:
  ------------------
  |  Branch (1211:13): [True: 1.46k, False: 2.93k]
  ------------------
 1212|  1.46k|                sec_asn1e_write_header(state);
 1213|  1.46k|                break;
 1214|  1.46k|            case duringContents:
  ------------------
  |  Branch (1214:13): [True: 1.46k, False: 2.93k]
  ------------------
 1215|  1.46k|                if (cx->from_buf)
  ------------------
  |  Branch (1215:21): [True: 0, False: 1.46k]
  ------------------
 1216|      0|                    sec_asn1e_write_contents_from_buf(state, buf, len);
 1217|  1.46k|                else
 1218|  1.46k|                    sec_asn1e_write_contents(state);
 1219|  1.46k|                break;
 1220|      0|            case duringGroup:
  ------------------
  |  Branch (1220:13): [True: 0, False: 4.39k]
  ------------------
 1221|      0|                sec_asn1e_next_in_group(state);
 1222|      0|                break;
 1223|      0|            case duringSequence:
  ------------------
  |  Branch (1223:13): [True: 0, False: 4.39k]
  ------------------
 1224|      0|                sec_asn1e_next_in_sequence(state);
 1225|      0|                break;
 1226|  1.46k|            case afterContents:
  ------------------
  |  Branch (1226:13): [True: 1.46k, False: 2.93k]
  ------------------
 1227|  1.46k|                sec_asn1e_after_contents(state);
 1228|  1.46k|                break;
 1229|      0|            case afterImplicit:
  ------------------
  |  Branch (1229:13): [True: 0, False: 4.39k]
  ------------------
 1230|      0|            case afterInline:
  ------------------
  |  Branch (1230:13): [True: 0, False: 4.39k]
  ------------------
 1231|      0|            case afterPointer:
  ------------------
  |  Branch (1231:13): [True: 0, False: 4.39k]
  ------------------
 1232|      0|            case afterChoice:
  ------------------
  |  Branch (1232:13): [True: 0, False: 4.39k]
  ------------------
 1233|       |                /*
 1234|       |                 * These states are more documentation than anything.
 1235|       |                 * They just need to force a pop.
 1236|       |                 */
 1237|      0|                PORT_Assert(!state->indefinite);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1238|      0|                state->place = afterContents;
 1239|      0|                break;
 1240|      0|            case notInUse:
  ------------------
  |  Branch (1240:13): [True: 0, False: 4.39k]
  ------------------
 1241|      0|            default:
  ------------------
  |  Branch (1241:13): [True: 0, False: 4.39k]
  ------------------
 1242|       |                /* This is not an error, but rather a plain old BUG! */
 1243|      0|                PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1244|      0|                cx->status = encodeError;
 1245|      0|                break;
 1246|  4.39k|        }
 1247|       |
 1248|  4.39k|        if (cx->status == encodeError)
  ------------------
  |  Branch (1248:13): [True: 0, False: 4.39k]
  ------------------
 1249|      0|            break;
 1250|       |
 1251|       |        /* It might have changed, so we have to update our local copy.  */
 1252|  4.39k|        state = cx->current;
 1253|       |
 1254|       |        /* If it is NULL, we have popped all the way to the top.  */
 1255|  4.39k|        if (state == NULL) {
  ------------------
  |  Branch (1255:13): [True: 1.46k, False: 2.93k]
  ------------------
 1256|  1.46k|            cx->status = allDone;
 1257|  1.46k|            break;
 1258|  1.46k|        }
 1259|  4.39k|    }
 1260|       |
 1261|  1.46k|    if (cx->status == encodeError) {
  ------------------
  |  Branch (1261:9): [True: 0, False: 1.46k]
  ------------------
 1262|      0|        return SECFailure;
 1263|      0|    }
 1264|       |
 1265|  1.46k|    return SECSuccess;
 1266|  1.46k|}
SEC_ASN1EncoderFinish_Util:
 1270|  1.46k|{
 1271|       |    /*
 1272|       |     * XXX anything else that needs to be finished?
 1273|       |     */
 1274|       |
 1275|  1.46k|    PORT_FreeArena(cx->our_pool, PR_FALSE);
  ------------------
  |  |   61|  1.46k|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                  PORT_FreeArena(cx->our_pool, PR_FALSE);
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
 1276|  1.46k|}
SEC_ASN1EncoderStart_Util:
 1281|  1.46k|{
 1282|  1.46k|    PLArenaPool *our_pool;
 1283|  1.46k|    SEC_ASN1EncoderContext *cx;
 1284|       |
 1285|  1.46k|    our_pool = PORT_NewArena(SEC_ASN1_DEFAULT_ARENA_SIZE);
  ------------------
  |  |   63|  1.46k|#define PORT_NewArena PORT_NewArena_Util
  ------------------
                  our_pool = PORT_NewArena(SEC_ASN1_DEFAULT_ARENA_SIZE);
  ------------------
  |  |   60|  1.46k|#define SEC_ASN1_DEFAULT_ARENA_SIZE (2048)
  ------------------
 1286|  1.46k|    if (our_pool == NULL)
  ------------------
  |  Branch (1286:9): [True: 0, False: 1.46k]
  ------------------
 1287|      0|        return NULL;
 1288|       |
 1289|  1.46k|    cx = (SEC_ASN1EncoderContext *)PORT_ArenaZAlloc(our_pool, sizeof(*cx));
  ------------------
  |  |   59|  1.46k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
 1290|  1.46k|    if (cx == NULL) {
  ------------------
  |  Branch (1290:9): [True: 0, False: 1.46k]
  ------------------
 1291|      0|        PORT_FreeArena(our_pool, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(our_pool, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1292|      0|        return NULL;
 1293|      0|    }
 1294|       |
 1295|  1.46k|    cx->our_pool = our_pool;
 1296|  1.46k|    cx->output_proc = output_proc;
 1297|  1.46k|    cx->output_arg = output_arg;
 1298|       |
 1299|  1.46k|    cx->status = keepGoing;
 1300|       |
 1301|  1.46k|    if (sec_asn1e_push_state(cx, theTemplate, src, PR_FALSE) == NULL ||
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
  |  Branch (1301:9): [True: 0, False: 1.46k]
  ------------------
 1302|  1.46k|        sec_asn1e_init_state_based_on_template(cx->current) == NULL) {
  ------------------
  |  Branch (1302:9): [True: 0, False: 1.46k]
  ------------------
 1303|       |        /*
 1304|       |         * Trouble initializing (probably due to failed allocations)
 1305|       |         * requires that we just give up.
 1306|       |         */
 1307|      0|        PORT_FreeArena(our_pool, PR_FALSE);
  ------------------
  |  |   61|      0|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                      PORT_FreeArena(our_pool, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
 1308|      0|        return NULL;
 1309|      0|    }
 1310|       |
 1311|  1.46k|    return cx;
 1312|  1.46k|}
SEC_ASN1Encode_Util:
 1389|  1.46k|{
 1390|  1.46k|    SEC_ASN1EncoderContext *ecx;
 1391|  1.46k|    SECStatus rv;
 1392|       |
 1393|  1.46k|    ecx = SEC_ASN1EncoderStart(src, theTemplate, output_proc, output_arg);
  ------------------
  |  |   98|  1.46k|#define SEC_ASN1EncoderStart SEC_ASN1EncoderStart_Util
  ------------------
 1394|  1.46k|    if (ecx == NULL)
  ------------------
  |  Branch (1394:9): [True: 0, False: 1.46k]
  ------------------
 1395|      0|        return SECFailure;
 1396|       |
 1397|  1.46k|    rv = SEC_ASN1EncoderUpdate(ecx, NULL, 0);
  ------------------
  |  |   99|  1.46k|#define SEC_ASN1EncoderUpdate SEC_ASN1EncoderUpdate_Util
  ------------------
 1398|       |
 1399|  1.46k|    SEC_ASN1EncoderFinish(ecx);
  ------------------
  |  |   94|  1.46k|#define SEC_ASN1EncoderFinish SEC_ASN1EncoderFinish_Util
  ------------------
 1400|  1.46k|    return rv;
 1401|  1.46k|}
SEC_ASN1EncodeItem_Util:
 1487|    733|{
 1488|    733|    unsigned long encoding_length;
 1489|    733|    SECStatus rv;
 1490|       |
 1491|    733|    PORT_Assert(dest == NULL || dest->data == NULL);
  ------------------
  |  |  120|    733|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    733|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 733, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1492|       |
 1493|    733|    encoding_length = 0;
 1494|    733|    rv = SEC_ASN1Encode(src, theTemplate,
  ------------------
  |  |   87|    733|#define SEC_ASN1Encode SEC_ASN1Encode_Util
  ------------------
 1495|    733|                        sec_asn1e_encode_item_count, &encoding_length);
 1496|    733|    if (rv != SECSuccess)
  ------------------
  |  Branch (1496:9): [True: 0, False: 733]
  ------------------
 1497|      0|        return NULL;
 1498|       |
 1499|    733|    dest = sec_asn1e_allocate_item(poolp, dest, encoding_length);
 1500|    733|    if (dest == NULL)
  ------------------
  |  Branch (1500:9): [True: 0, False: 733]
  ------------------
 1501|      0|        return NULL;
 1502|       |
 1503|       |    /* XXX necessary?  This really just checks for a bug in the allocate fn */
 1504|    733|    PORT_Assert(dest->data != NULL);
  ------------------
  |  |  120|    733|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    733|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 733, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1505|    733|    if (dest->data == NULL)
  ------------------
  |  Branch (1505:9): [True: 0, False: 733]
  ------------------
 1506|      0|        return NULL;
 1507|       |
 1508|    733|    dest->len = 0;
 1509|    733|    (void)SEC_ASN1Encode(src, theTemplate, sec_asn1e_encode_item_store, dest);
  ------------------
  |  |   87|    733|#define SEC_ASN1Encode SEC_ASN1Encode_Util
  ------------------
 1510|       |
 1511|    733|    PORT_Assert(encoding_length == dest->len);
  ------------------
  |  |  120|    733|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    733|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 733, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1512|    733|    return dest;
 1513|    733|}
secasn1e.c:sec_asn1e_write_header:
  734|  1.46k|{
  735|  1.46k|    unsigned long contents_length;
  736|  1.46k|    unsigned char tag_number, tag_modifiers;
  737|  1.46k|    sec_asn1e_hdr_encoding hdrException = hdr_normal;
  738|  1.46k|    PRBool indefinite = PR_FALSE;
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
  739|       |
  740|  1.46k|    PORT_Assert(state->place == beforeHeader);
  ------------------
  |  |  120|  1.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  741|       |
  742|  1.46k|    tag_number = state->tag_number;
  743|  1.46k|    tag_modifiers = state->tag_modifiers;
  744|       |
  745|  1.46k|    if (state->underlying_kind == SEC_ASN1_ANY) {
  ------------------
  |  |  133|  1.46k|#define SEC_ASN1_ANY 0x00400
  ------------------
  |  Branch (745:9): [True: 0, False: 1.46k]
  ------------------
  746|      0|        state->place = duringContents;
  747|      0|        return;
  748|      0|    }
  749|       |
  750|  1.46k|    if (state->underlying_kind & SEC_ASN1_CHOICE) {
  ------------------
  |  |  153|  1.46k|#define SEC_ASN1_CHOICE 0x100000      /* pick one from a template */
  ------------------
  |  Branch (750:9): [True: 0, False: 1.46k]
  ------------------
  751|      0|        int indx = sec_asn1e_which_choice(state->src, state->theTemplate);
  752|      0|        if (0 == indx) {
  ------------------
  |  Branch (752:13): [True: 0, False: 0]
  ------------------
  753|       |            /* XXX set an error? "choice not found" */
  754|      0|            state->top->status = encodeError;
  755|      0|            return;
  756|      0|        }
  757|      0|        state->place = afterChoice;
  758|      0|        state = sec_asn1e_push_state(state->top, &state->theTemplate[indx],
  759|      0|                                     (char *)state->src - state->theTemplate->offset,
  760|      0|                                     PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  761|      0|        if (state) {
  ------------------
  |  Branch (761:13): [True: 0, False: 0]
  ------------------
  762|       |            /*
  763|       |             * Do the "before" field notification.
  764|       |             */
  765|      0|            sec_asn1e_notify_before(state->top, state->src, state->depth);
  766|      0|            (void)sec_asn1e_init_state_based_on_template(state);
  767|      0|        }
  768|      0|        return;
  769|      0|    }
  770|       |
  771|       |    /* The !isString test below is apparently intended to ensure that all
  772|       |    ** constructed types receive indefinite length encoding.
  773|       |    */
  774|  1.46k|    indefinite = (PRBool)(state->top->streaming && state->may_stream &&
  ------------------
  |  Branch (774:27): [True: 0, False: 1.46k]
  |  Branch (774:52): [True: 0, False: 0]
  ------------------
  775|  1.46k|                          (state->top->from_buf || !state->is_string));
  ------------------
  |  Branch (775:28): [True: 0, False: 0]
  |  Branch (775:52): [True: 0, False: 0]
  ------------------
  776|       |
  777|       |    /*
  778|       |     * If we are doing a definite-length encoding, first we have to
  779|       |     * walk the data structure to calculate the entire contents length.
  780|       |     * If we are doing an indefinite-length encoding, we still need to
  781|       |     * know if the contents is:
  782|       |     *    optional and to be omitted, or
  783|       |     *    an ANY (header is pre-encoded), or
  784|       |     *    a SAVE or some other kind of template used only by the decoder.
  785|       |     * So, we call this function either way.
  786|       |     */
  787|  1.46k|    contents_length = sec_asn1e_contents_length(state->theTemplate,
  788|  1.46k|                                                state->src,
  789|  1.46k|                                                state->disallowStreaming,
  790|  1.46k|                                                indefinite,
  791|  1.46k|                                                &hdrException);
  792|       |    /*
  793|       |     * We might be told explicitly not to put out a header.
  794|       |     * But it can also be the case, via a pushed subtemplate, that
  795|       |     * sec_asn1e_contents_length could not know that this field is
  796|       |     * really optional.  So check for that explicitly, too.
  797|       |     */
  798|  1.46k|    if (hdrException != hdr_normal ||
  ------------------
  |  Branch (798:9): [True: 0, False: 1.46k]
  ------------------
  799|  1.46k|        (contents_length == 0 && state->optional)) {
  ------------------
  |  Branch (799:10): [True: 0, False: 1.46k]
  |  Branch (799:34): [True: 0, False: 0]
  ------------------
  800|      0|        state->place = afterContents;
  801|      0|        if (state->top->streaming &&
  ------------------
  |  Branch (801:13): [True: 0, False: 0]
  ------------------
  802|      0|            state->may_stream &&
  ------------------
  |  Branch (802:13): [True: 0, False: 0]
  ------------------
  803|      0|            state->top->from_buf) {
  ------------------
  |  Branch (803:13): [True: 0, False: 0]
  ------------------
  804|       |            /* we did not find an optional indefinite string, so we
  805|       |             * don't encode it.  However, if TakeFromBuf is on, we stop
  806|       |             * here anyway to give our caller a chance to intercept at the
  807|       |             * same point where we would stop if the field were present.
  808|       |             */
  809|      0|            state->top->status = needBytes;
  810|      0|        }
  811|      0|        return;
  812|      0|    }
  813|       |
  814|  1.46k|    if (indefinite) {
  ------------------
  |  Branch (814:9): [True: 0, False: 1.46k]
  ------------------
  815|       |        /*
  816|       |         * We need to put out an indefinite-length encoding.
  817|       |         * The only universal types that can be constructed are SETs,
  818|       |         * SEQUENCEs, and strings; so check that it is one of those,
  819|       |         * or that it is not universal (e.g. context-specific).
  820|       |         */
  821|      0|        state->indefinite = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  822|      0|        PORT_Assert((tag_number == SEC_ASN1_SET) || (tag_number == SEC_ASN1_SEQUENCE) || ((tag_modifiers & SEC_ASN1_CLASS_MASK) != 0) || state->is_string);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  823|      0|        tag_modifiers |= SEC_ASN1_CONSTRUCTED;
  ------------------
  |  |  117|      0|#define SEC_ASN1_CONSTRUCTED 0x20
  ------------------
  824|      0|        contents_length = 0;
  825|      0|    }
  826|       |
  827|  1.46k|    sec_asn1e_write_identifier_bytes(state,
  828|  1.46k|                                     (unsigned char)(tag_number | tag_modifiers));
  829|  1.46k|    sec_asn1e_write_length_bytes(state, contents_length, state->indefinite);
  830|       |
  831|  1.46k|    if (contents_length == 0 && !state->indefinite) {
  ------------------
  |  Branch (831:9): [True: 0, False: 1.46k]
  |  Branch (831:33): [True: 0, False: 0]
  ------------------
  832|       |        /*
  833|       |         * If no real contents to encode, then we are done with this field.
  834|       |         */
  835|      0|        state->place = afterContents;
  836|      0|        return;
  837|      0|    }
  838|       |
  839|       |    /*
  840|       |     * An EXPLICIT is nothing but an outer header, which we have already
  841|       |     * written.  Now we need to do the inner header and contents.
  842|       |     */
  843|  1.46k|    if (state->isExplicit) {
  ------------------
  |  Branch (843:9): [True: 0, False: 1.46k]
  ------------------
  844|      0|        const SEC_ASN1Template *subt =
  845|      0|            SEC_ASN1GetSubtemplate(state->theTemplate, state->src, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  846|      0|        state->place = afterContents;
  847|      0|        state = sec_asn1e_push_state(state->top, subt, state->src, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  848|      0|        if (state != NULL) {
  ------------------
  |  Branch (848:13): [True: 0, False: 0]
  ------------------
  849|      0|            (void)sec_asn1e_init_state_based_on_template(state);
  850|      0|        }
  851|      0|        return;
  852|      0|    }
  853|       |
  854|  1.46k|    switch (state->underlying_kind) {
  855|      0|        case SEC_ASN1_SET_OF:
  ------------------
  |  |  167|      0|#define SEC_ASN1_SET_OF (SEC_ASN1_GROUP | SEC_ASN1_SET)
  |  |  ------------------
  |  |  |  |  136|      0|#define SEC_ASN1_GROUP 0x02000        /* with SET or SEQUENCE means \
  |  |  ------------------
  |  |               #define SEC_ASN1_SET_OF (SEC_ASN1_GROUP | SEC_ASN1_SET)
  |  |  ------------------
  |  |  |  |   93|      0|#define SEC_ASN1_SET 0x11
  |  |  ------------------
  ------------------
  |  Branch (855:9): [True: 0, False: 1.46k]
  ------------------
  856|      0|        case SEC_ASN1_SEQUENCE_OF:
  ------------------
  |  |  166|      0|#define SEC_ASN1_SEQUENCE_OF (SEC_ASN1_GROUP | SEC_ASN1_SEQUENCE)
  |  |  ------------------
  |  |  |  |  136|      0|#define SEC_ASN1_GROUP 0x02000        /* with SET or SEQUENCE means \
  |  |  ------------------
  |  |               #define SEC_ASN1_SEQUENCE_OF (SEC_ASN1_GROUP | SEC_ASN1_SEQUENCE)
  |  |  ------------------
  |  |  |  |   92|      0|#define SEC_ASN1_SEQUENCE 0x10
  |  |  ------------------
  ------------------
  |  Branch (856:9): [True: 0, False: 1.46k]
  ------------------
  857|       |            /*
  858|       |             * We need to push a child to handle each member.
  859|       |             */
  860|      0|            {
  861|      0|                void **group;
  862|      0|                const SEC_ASN1Template *subt;
  863|       |
  864|      0|                group = *(void ***)state->src;
  865|      0|                if (group == NULL || *group == NULL) {
  ------------------
  |  Branch (865:21): [True: 0, False: 0]
  |  Branch (865:38): [True: 0, False: 0]
  ------------------
  866|       |                    /*
  867|       |                     * Group is empty; we are done.
  868|       |                     */
  869|      0|                    state->place = afterContents;
  870|      0|                    return;
  871|      0|                }
  872|      0|                state->place = duringGroup;
  873|      0|                subt = SEC_ASN1GetSubtemplate(state->theTemplate, state->src,
  874|      0|                                              PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  875|      0|                state = sec_asn1e_push_state(state->top, subt, *group, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  876|      0|                if (state != NULL) {
  ------------------
  |  Branch (876:21): [True: 0, False: 0]
  ------------------
  877|      0|                    (void)sec_asn1e_init_state_based_on_template(state);
  878|      0|                }
  879|      0|            }
  880|      0|            break;
  881|       |
  882|      0|        case SEC_ASN1_SEQUENCE:
  ------------------
  |  |   92|      0|#define SEC_ASN1_SEQUENCE 0x10
  ------------------
  |  Branch (882:9): [True: 0, False: 1.46k]
  ------------------
  883|      0|        case SEC_ASN1_SET:
  ------------------
  |  |   93|      0|#define SEC_ASN1_SET 0x11
  ------------------
  |  Branch (883:9): [True: 0, False: 1.46k]
  ------------------
  884|       |            /*
  885|       |             * We need to push a child to handle the individual fields.
  886|       |             */
  887|      0|            state->place = duringSequence;
  888|      0|            state = sec_asn1e_push_state(state->top, state->theTemplate + 1,
  889|      0|                                         state->src, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  890|      0|            if (state != NULL) {
  ------------------
  |  Branch (890:17): [True: 0, False: 0]
  ------------------
  891|       |                /*
  892|       |                 * Do the "before" field notification.
  893|       |                 */
  894|      0|                sec_asn1e_notify_before(state->top, state->src, state->depth);
  895|      0|                (void)sec_asn1e_init_state_based_on_template(state);
  896|      0|            }
  897|      0|            break;
  898|       |
  899|  1.46k|        default:
  ------------------
  |  Branch (899:9): [True: 1.46k, False: 0]
  ------------------
  900|       |            /*
  901|       |             * I think we do not need to do anything else.
  902|       |             * XXX Correct?
  903|       |             */
  904|  1.46k|            state->place = duringContents;
  905|  1.46k|            break;
  906|  1.46k|    }
  907|  1.46k|}
secasn1e.c:sec_asn1e_contents_length:
  471|  1.46k|{
  472|  1.46k|    unsigned long encode_kind, underlying_kind;
  473|  1.46k|    PRBool isExplicit, optional, universal, may_stream;
  474|  1.46k|    unsigned long len;
  475|       |
  476|       |    /*
  477|       |     * This function currently calculates the length in all cases
  478|       |     * except the following: when writing out the contents of a
  479|       |     * template that belongs to a state where it was a sub-template
  480|       |     * with the SEC_ASN1_MAY_STREAM bit set and it's parent had the
  481|       |     * optional bit set.  The information that the parent is optional
  482|       |     * and that we should return the length of 0 when that length is
  483|       |     * present since that means the optional field is no longer present.
  484|       |     * So we add the disallowStreaming flag which is passed in when
  485|       |     * writing the contents, but for all recursive calls to
  486|       |     * sec_asn1e_contents_length, we pass PR_FALSE, because this
  487|       |     * function correctly calculates the length for children templates
  488|       |     * from that point on.  Confused yet?  At least you didn't have
  489|       |     * to figure it out.  ;)  -javi
  490|       |     */
  491|  1.46k|    encode_kind = theTemplate->kind;
  492|       |
  493|  1.46k|    universal = ((encode_kind & SEC_ASN1_CLASS_MASK) == SEC_ASN1_UNIVERSAL)
  ------------------
  |  |  119|  1.46k|#define SEC_ASN1_CLASS_MASK 0xc0
  ------------------
                  universal = ((encode_kind & SEC_ASN1_CLASS_MASK) == SEC_ASN1_UNIVERSAL)
  ------------------
  |  |  120|  1.46k|#define SEC_ASN1_UNIVERSAL 0x00
  ------------------
  |  Branch (493:17): [True: 1.46k, False: 0]
  ------------------
  494|  1.46k|                    ? PR_TRUE
  ------------------
  |  |  437|  1.46k|#define PR_TRUE 1
  ------------------
  495|  1.46k|                    : PR_FALSE;
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
  496|       |
  497|  1.46k|    isExplicit = (encode_kind & SEC_ASN1_EXPLICIT) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  132|  1.46k|#define SEC_ASN1_EXPLICIT 0x00200
  ------------------
                  isExplicit = (encode_kind & SEC_ASN1_EXPLICIT) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                  isExplicit = (encode_kind & SEC_ASN1_EXPLICIT) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|  2.93k|#define PR_FALSE 0
  ------------------
  |  Branch (497:18): [True: 0, False: 1.46k]
  ------------------
  498|  1.46k|    encode_kind &= ~SEC_ASN1_EXPLICIT;
  ------------------
  |  |  132|  1.46k|#define SEC_ASN1_EXPLICIT 0x00200
  ------------------
  499|       |
  500|  1.46k|    optional = (encode_kind & SEC_ASN1_OPTIONAL) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  131|  1.46k|#define SEC_ASN1_OPTIONAL 0x00100
  ------------------
                  optional = (encode_kind & SEC_ASN1_OPTIONAL) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                  optional = (encode_kind & SEC_ASN1_OPTIONAL) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|  2.93k|#define PR_FALSE 0
  ------------------
  |  Branch (500:16): [True: 0, False: 1.46k]
  ------------------
  501|  1.46k|    encode_kind &= ~SEC_ASN1_OPTIONAL;
  ------------------
  |  |  131|  1.46k|#define SEC_ASN1_OPTIONAL 0x00100
  ------------------
  502|       |
  503|  1.46k|    PORT_Assert(!(isExplicit && universal)); /* bad templates */
  ------------------
  |  |  120|  1.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 1.46k]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  504|       |
  505|  1.46k|    may_stream = (encode_kind & SEC_ASN1_MAY_STREAM) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  146|  1.46k|#define SEC_ASN1_MAY_STREAM 0x40000   /* field or one of its sub-fields may \
  ------------------
                  may_stream = (encode_kind & SEC_ASN1_MAY_STREAM) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|  1.46k|#define PR_TRUE 1
  ------------------
                  may_stream = (encode_kind & SEC_ASN1_MAY_STREAM) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
  |  Branch (505:18): [True: 1.46k, False: 0]
  ------------------
  506|  1.46k|    encode_kind &= ~SEC_ASN1_MAY_STREAM;
  ------------------
  |  |  146|  1.46k|#define SEC_ASN1_MAY_STREAM 0x40000   /* field or one of its sub-fields may \
  ------------------
  507|       |
  508|       |    /* Just clear this to get it out of the way; we do not need it here */
  509|  1.46k|    encode_kind &= ~SEC_ASN1_DYNAMIC;
  ------------------
  |  |  138|  1.46k|#define SEC_ASN1_DYNAMIC 0x04000      /* subtemplate is found by calling \
  ------------------
  510|       |
  511|  1.46k|    if (encode_kind & SEC_ASN1_NO_STREAM) {
  ------------------
  |  |  154|  1.46k|#define SEC_ASN1_NO_STREAM 0X200000   /* This entry will not stream          \
  ------------------
  |  Branch (511:9): [True: 0, False: 1.46k]
  ------------------
  512|      0|        disallowStreaming = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  513|      0|    }
  514|  1.46k|    encode_kind &= ~SEC_ASN1_NO_STREAM;
  ------------------
  |  |  154|  1.46k|#define SEC_ASN1_NO_STREAM 0X200000   /* This entry will not stream          \
  ------------------
  515|       |
  516|  1.46k|    if (encode_kind & SEC_ASN1_CHOICE) {
  ------------------
  |  |  153|  1.46k|#define SEC_ASN1_CHOICE 0x100000      /* pick one from a template */
  ------------------
  |  Branch (516:9): [True: 0, False: 1.46k]
  ------------------
  517|      0|        void *src2;
  518|      0|        int indx = sec_asn1e_which_choice(src, theTemplate);
  519|      0|        if (0 == indx) {
  ------------------
  |  Branch (519:13): [True: 0, False: 0]
  ------------------
  520|       |            /* XXX set an error? "choice not found" */
  521|       |            /* state->top->status = encodeError; */
  522|      0|            return 0;
  523|      0|        }
  524|       |
  525|      0|        src2 = (void *)((char *)src - theTemplate->offset + theTemplate[indx].offset);
  526|       |
  527|      0|        return sec_asn1e_contents_length(&theTemplate[indx], src2,
  528|      0|                                         disallowStreaming, insideIndefinite,
  529|      0|                                         pHdrException);
  530|      0|    }
  531|       |
  532|  1.46k|    if ((encode_kind & (SEC_ASN1_POINTER | SEC_ASN1_INLINE)) || !universal) {
  ------------------
  |  |  135|  1.46k|#define SEC_ASN1_POINTER 0x01000
  ------------------
                  if ((encode_kind & (SEC_ASN1_POINTER | SEC_ASN1_INLINE)) || !universal) {
  ------------------
  |  |  134|  1.46k|#define SEC_ASN1_INLINE 0x00800
  ------------------
  |  Branch (532:9): [True: 0, False: 1.46k]
  |  Branch (532:65): [True: 0, False: 1.46k]
  ------------------
  533|       |        /* XXX any bits we want to disallow (PORT_Assert against) here? */
  534|      0|        theTemplate = SEC_ASN1GetSubtemplate(theTemplate, src, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  535|      0|        if (encode_kind & SEC_ASN1_POINTER) {
  ------------------
  |  |  135|      0|#define SEC_ASN1_POINTER 0x01000
  ------------------
  |  Branch (535:13): [True: 0, False: 0]
  ------------------
  536|      0|            src = *(void **)src;
  537|      0|            if (src == NULL) {
  ------------------
  |  Branch (537:17): [True: 0, False: 0]
  ------------------
  538|      0|                *pHdrException = optional ? hdr_optional : hdr_normal;
  ------------------
  |  Branch (538:34): [True: 0, False: 0]
  ------------------
  539|      0|                return 0;
  540|      0|            }
  541|      0|        } else if (encode_kind & SEC_ASN1_INLINE) {
  ------------------
  |  |  134|      0|#define SEC_ASN1_INLINE 0x00800
  ------------------
  |  Branch (541:20): [True: 0, False: 0]
  ------------------
  542|       |            /* check that there are no extraneous bits */
  543|      0|            if (optional) {
  ------------------
  |  Branch (543:17): [True: 0, False: 0]
  ------------------
  544|      0|                if (PR_FALSE != SEC_ASN1IsTemplateSimple(theTemplate)) {
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (544:21): [True: 0, False: 0]
  ------------------
  545|       |                    /* we now know that the target is a SECItem*, so we can check
  546|       |                       if the source contains one */
  547|      0|                    SECItem *target = (SECItem *)src;
  548|      0|                    if (!target || !target->data || !target->len) {
  ------------------
  |  Branch (548:25): [True: 0, False: 0]
  |  Branch (548:36): [True: 0, False: 0]
  |  Branch (548:53): [True: 0, False: 0]
  ------------------
  549|       |                        /* no valid data to encode subtemplate */
  550|      0|                        *pHdrException = hdr_optional;
  551|      0|                        return 0;
  552|      0|                    }
  553|      0|                } else {
  554|      0|                    PORT_Assert(0); /* complex templates not handled as inline
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  555|       |                                       optional */
  556|      0|                }
  557|      0|            }
  558|      0|        }
  559|       |
  560|      0|        src = (char *)src + theTemplate->offset;
  561|       |
  562|       |        /* recurse to find the length of the subtemplate */
  563|      0|        len = sec_asn1e_contents_length(theTemplate, src, disallowStreaming,
  564|      0|                                        insideIndefinite, pHdrException);
  565|      0|        if (len == 0 && optional) {
  ------------------
  |  Branch (565:13): [True: 0, False: 0]
  |  Branch (565:25): [True: 0, False: 0]
  ------------------
  566|      0|            *pHdrException = hdr_optional;
  567|      0|        } else if (isExplicit) {
  ------------------
  |  Branch (567:20): [True: 0, False: 0]
  ------------------
  568|      0|            if (*pHdrException == hdr_any) {
  ------------------
  |  Branch (568:17): [True: 0, False: 0]
  ------------------
  569|       |                /* *we* do not want to add in a header,
  570|       |                ** but our caller still does.
  571|       |                */
  572|      0|                *pHdrException = hdr_normal;
  573|      0|            } else if (*pHdrException == hdr_normal) {
  ------------------
  |  Branch (573:24): [True: 0, False: 0]
  ------------------
  574|       |                /* if the inner content exists, our length is
  575|       |                 * len(identifier) + len(length) + len(innercontent)
  576|       |                 * XXX we currently assume len(identifier) == 1;
  577|       |                 * to support a high-tag-number this would need to be smarter.
  578|       |                 */
  579|      0|                len += 1 + SEC_ASN1LengthLength(len);
  ------------------
  |  |  101|      0|#define SEC_ASN1LengthLength SEC_ASN1LengthLength_Util
  ------------------
  580|      0|            }
  581|      0|        }
  582|      0|        return len;
  583|      0|    }
  584|  1.46k|    underlying_kind = encode_kind;
  585|       |
  586|       |    /* This is only used in decoding; it plays no part in encoding.  */
  587|  1.46k|    if (underlying_kind & SEC_ASN1_SAVE) {
  ------------------
  |  |  144|  1.46k|#define SEC_ASN1_SAVE 0x20000         /* stash away the encoded bytes first; \
  ------------------
  |  Branch (587:9): [True: 0, False: 1.46k]
  ------------------
  588|       |        /* check that there are no extraneous bits */
  589|      0|        PORT_Assert(underlying_kind == SEC_ASN1_SAVE);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  590|      0|        *pHdrException = hdr_decoder;
  591|      0|        return 0;
  592|      0|    }
  593|       |
  594|  1.46k|#define UNEXPECTED_FLAGS                                                          \
  595|  1.46k|    (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_INLINE | SEC_ASN1_POINTER | \
  596|  1.46k|     SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_SAVE | SEC_ASN1_SKIP)
  597|       |
  598|       |    /* Having any of these bits is not expected here...  */
  599|  1.46k|    PORT_Assert((underlying_kind & UNEXPECTED_FLAGS) == 0);
  ------------------
  |  |  120|  1.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  600|  1.46k|    underlying_kind &= ~UNEXPECTED_FLAGS;
  ------------------
  |  |  595|  1.46k|    (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_INLINE | SEC_ASN1_POINTER | \
  |  |  ------------------
  |  |  |  |  132|  1.46k|#define SEC_ASN1_EXPLICIT 0x00200
  |  |  ------------------
  |  |                   (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_INLINE | SEC_ASN1_POINTER | \
  |  |  ------------------
  |  |  |  |  131|  1.46k|#define SEC_ASN1_OPTIONAL 0x00100
  |  |  ------------------
  |  |                   (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_INLINE | SEC_ASN1_POINTER | \
  |  |  ------------------
  |  |  |  |  134|  1.46k|#define SEC_ASN1_INLINE 0x00800
  |  |  ------------------
  |  |                   (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_INLINE | SEC_ASN1_POINTER | \
  |  |  ------------------
  |  |  |  |  135|  1.46k|#define SEC_ASN1_POINTER 0x01000
  |  |  ------------------
  |  |  596|  1.46k|     SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_SAVE | SEC_ASN1_SKIP)
  |  |  ------------------
  |  |  |  |  138|  1.46k|#define SEC_ASN1_DYNAMIC 0x04000      /* subtemplate is found by calling \
  |  |  ------------------
  |  |                    SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_SAVE | SEC_ASN1_SKIP)
  |  |  ------------------
  |  |  |  |  146|  1.46k|#define SEC_ASN1_MAY_STREAM 0x40000   /* field or one of its sub-fields may \
  |  |  ------------------
  |  |                    SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_SAVE | SEC_ASN1_SKIP)
  |  |  ------------------
  |  |  |  |  144|  1.46k|#define SEC_ASN1_SAVE 0x20000         /* stash away the encoded bytes first; \
  |  |  ------------------
  |  |                    SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_SAVE | SEC_ASN1_SKIP)
  |  |  ------------------
  |  |  |  |  140|  1.46k|#define SEC_ASN1_SKIP 0x08000         /* skip a field; only for decoding */
  |  |  ------------------
  ------------------
  601|  1.46k|#undef UNEXPECTED_FLAGS
  602|       |
  603|  1.46k|    if (underlying_kind & SEC_ASN1_CHOICE) {
  ------------------
  |  |  153|  1.46k|#define SEC_ASN1_CHOICE 0x100000      /* pick one from a template */
  ------------------
  |  Branch (603:9): [True: 0, False: 1.46k]
  ------------------
  604|      0|        void *src2;
  605|      0|        int indx = sec_asn1e_which_choice(src, theTemplate);
  606|      0|        if (0 == indx) {
  ------------------
  |  Branch (606:13): [True: 0, False: 0]
  ------------------
  607|       |            /* XXX set an error? "choice not found" */
  608|       |            /* state->top->status = encodeError; */
  609|      0|            return 0;
  610|      0|        }
  611|       |
  612|      0|        src2 = (void *)((char *)src - theTemplate->offset + theTemplate[indx].offset);
  613|      0|        len = sec_asn1e_contents_length(&theTemplate[indx], src2,
  614|      0|                                        disallowStreaming, insideIndefinite,
  615|      0|                                        pHdrException);
  616|  1.46k|    } else {
  617|  1.46k|        switch (underlying_kind) {
  618|      0|            case SEC_ASN1_SEQUENCE_OF:
  ------------------
  |  |  166|      0|#define SEC_ASN1_SEQUENCE_OF (SEC_ASN1_GROUP | SEC_ASN1_SEQUENCE)
  |  |  ------------------
  |  |  |  |  136|      0|#define SEC_ASN1_GROUP 0x02000        /* with SET or SEQUENCE means \
  |  |  ------------------
  |  |               #define SEC_ASN1_SEQUENCE_OF (SEC_ASN1_GROUP | SEC_ASN1_SEQUENCE)
  |  |  ------------------
  |  |  |  |   92|      0|#define SEC_ASN1_SEQUENCE 0x10
  |  |  ------------------
  ------------------
  |  Branch (618:13): [True: 0, False: 1.46k]
  ------------------
  619|      0|            case SEC_ASN1_SET_OF: {
  ------------------
  |  |  167|      0|#define SEC_ASN1_SET_OF (SEC_ASN1_GROUP | SEC_ASN1_SET)
  |  |  ------------------
  |  |  |  |  136|      0|#define SEC_ASN1_GROUP 0x02000        /* with SET or SEQUENCE means \
  |  |  ------------------
  |  |               #define SEC_ASN1_SET_OF (SEC_ASN1_GROUP | SEC_ASN1_SET)
  |  |  ------------------
  |  |  |  |   93|      0|#define SEC_ASN1_SET 0x11
  |  |  ------------------
  ------------------
  |  Branch (619:13): [True: 0, False: 1.46k]
  ------------------
  620|      0|                const SEC_ASN1Template *tmpt;
  621|      0|                void *sub_src;
  622|      0|                unsigned long sub_len;
  623|      0|                void **group;
  624|       |
  625|      0|                len = 0;
  626|       |
  627|      0|                group = *(void ***)src;
  628|      0|                if (group == NULL)
  ------------------
  |  Branch (628:21): [True: 0, False: 0]
  ------------------
  629|      0|                    break;
  630|       |
  631|      0|                tmpt = SEC_ASN1GetSubtemplate(theTemplate, src, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  632|       |
  633|      0|                for (; *group != NULL; group++) {
  ------------------
  |  Branch (633:24): [True: 0, False: 0]
  ------------------
  634|      0|                    sub_src = (char *)(*group) + tmpt->offset;
  635|      0|                    sub_len = sec_asn1e_contents_length(tmpt, sub_src,
  636|      0|                                                        disallowStreaming,
  637|      0|                                                        insideIndefinite,
  638|      0|                                                        pHdrException);
  639|      0|                    len += sub_len;
  640|       |                    /*
  641|       |                     * XXX The 1 below is the presumed length of the identifier;
  642|       |                     * to support a high-tag-number this would need to be smarter.
  643|       |                     */
  644|      0|                    if (*pHdrException == hdr_normal)
  ------------------
  |  Branch (644:25): [True: 0, False: 0]
  ------------------
  645|      0|                        len += 1 + SEC_ASN1LengthLength(sub_len);
  ------------------
  |  |  101|      0|#define SEC_ASN1LengthLength SEC_ASN1LengthLength_Util
  ------------------
  646|      0|                }
  647|      0|            } break;
  648|       |
  649|      0|            case SEC_ASN1_SEQUENCE:
  ------------------
  |  |   92|      0|#define SEC_ASN1_SEQUENCE 0x10
  ------------------
  |  Branch (649:13): [True: 0, False: 1.46k]
  ------------------
  650|      0|            case SEC_ASN1_SET: {
  ------------------
  |  |   93|      0|#define SEC_ASN1_SET 0x11
  ------------------
  |  Branch (650:13): [True: 0, False: 1.46k]
  ------------------
  651|      0|                const SEC_ASN1Template *tmpt;
  652|      0|                void *sub_src;
  653|      0|                unsigned long sub_len;
  654|       |
  655|      0|                len = 0;
  656|      0|                for (tmpt = theTemplate + 1; tmpt->kind; tmpt++) {
  ------------------
  |  Branch (656:46): [True: 0, False: 0]
  ------------------
  657|      0|                    sub_src = (char *)src + tmpt->offset;
  658|      0|                    sub_len = sec_asn1e_contents_length(tmpt, sub_src,
  659|      0|                                                        disallowStreaming,
  660|      0|                                                        insideIndefinite,
  661|      0|                                                        pHdrException);
  662|      0|                    len += sub_len;
  663|       |                    /*
  664|       |                     * XXX The 1 below is the presumed length of the identifier;
  665|       |                     * to support a high-tag-number this would need to be smarter.
  666|       |                     */
  667|      0|                    if (*pHdrException == hdr_normal)
  ------------------
  |  Branch (667:25): [True: 0, False: 0]
  ------------------
  668|      0|                        len += 1 + SEC_ASN1LengthLength(sub_len);
  ------------------
  |  |  101|      0|#define SEC_ASN1LengthLength SEC_ASN1LengthLength_Util
  ------------------
  669|      0|                }
  670|      0|            } break;
  671|       |
  672|      0|            case SEC_ASN1_BIT_STRING:
  ------------------
  |  |   79|      0|#define SEC_ASN1_BIT_STRING 0x03
  ------------------
  |  Branch (672:13): [True: 0, False: 1.46k]
  ------------------
  673|       |                /* convert bit length to byte */
  674|      0|                len = (((SECItem *)src)->len + 7) >> 3;
  675|       |                /* bit string contents involve an extra octet */
  676|      0|                if (len)
  ------------------
  |  Branch (676:21): [True: 0, False: 0]
  ------------------
  677|      0|                    len++;
  678|      0|                break;
  679|       |
  680|      0|            case SEC_ASN1_INTEGER:
  ------------------
  |  |   78|      0|#define SEC_ASN1_INTEGER 0x02
  ------------------
  |  Branch (680:13): [True: 0, False: 1.46k]
  ------------------
  681|       |                /* ASN.1 INTEGERs are signed.
  682|       |                 * If the source is an unsigned integer, the encoder will need
  683|       |                 * to handle the conversion here.
  684|       |                 */
  685|      0|                {
  686|      0|                    unsigned char *buf = ((SECItem *)src)->data;
  687|      0|                    SECItemType integerType = ((SECItem *)src)->type;
  688|      0|                    len = ((SECItem *)src)->len;
  689|      0|                    while (len > 0) {
  ------------------
  |  Branch (689:28): [True: 0, False: 0]
  ------------------
  690|      0|                        if (*buf != 0) {
  ------------------
  |  Branch (690:29): [True: 0, False: 0]
  ------------------
  691|      0|                            if (*buf & 0x80 && integerType == siUnsignedInteger) {
  ------------------
  |  Branch (691:33): [True: 0, False: 0]
  |  Branch (691:48): [True: 0, False: 0]
  ------------------
  692|      0|                                len++; /* leading zero needed to make number signed */
  693|      0|                            }
  694|      0|                            break; /* reached beginning of number */
  695|      0|                        }
  696|      0|                        if (len == 1) {
  ------------------
  |  Branch (696:29): [True: 0, False: 0]
  ------------------
  697|      0|                            break; /* the number 0 */
  698|      0|                        }
  699|      0|                        if (buf[1] & 0x80) {
  ------------------
  |  Branch (699:29): [True: 0, False: 0]
  ------------------
  700|      0|                            break; /* leading zero already present */
  701|      0|                        }
  702|       |                        /* extraneous leading zero, keep going */
  703|      0|                        buf++;
  704|      0|                        len--;
  705|      0|                    }
  706|      0|                }
  707|      0|                break;
  708|       |
  709|  1.46k|            default:
  ------------------
  |  Branch (709:13): [True: 1.46k, False: 0]
  ------------------
  710|  1.46k|                len = ((SECItem *)src)->len;
  711|  1.46k|                break;
  712|  1.46k|        } /* end switch */
  713|       |
  714|  1.46k|#ifndef WHAT_PROBLEM_DOES_THIS_SOLVE
  715|       |        /* if we're streaming, we may have a secitem w/len 0 as placeholder */
  716|  1.46k|        if (!len && insideIndefinite && may_stream && !disallowStreaming) {
  ------------------
  |  Branch (716:13): [True: 0, False: 1.46k]
  |  Branch (716:21): [True: 0, False: 0]
  |  Branch (716:41): [True: 0, False: 0]
  |  Branch (716:55): [True: 0, False: 0]
  ------------------
  717|      0|            len = 1;
  718|      0|        }
  719|  1.46k|#endif
  720|  1.46k|    } /* end else */
  721|       |
  722|  1.46k|    if (len == 0 && optional)
  ------------------
  |  Branch (722:9): [True: 0, False: 1.46k]
  |  Branch (722:21): [True: 0, False: 0]
  ------------------
  723|      0|        *pHdrException = hdr_optional;
  724|  1.46k|    else if (underlying_kind == SEC_ASN1_ANY)
  ------------------
  |  |  133|  1.46k|#define SEC_ASN1_ANY 0x00400
  ------------------
  |  Branch (724:14): [True: 0, False: 1.46k]
  ------------------
  725|      0|        *pHdrException = hdr_any;
  726|  1.46k|    else
  727|  1.46k|        *pHdrException = hdr_normal;
  728|       |
  729|  1.46k|    return len;
  730|  1.46k|}
secasn1e.c:sec_asn1e_write_identifier_bytes:
  388|  1.46k|{
  389|  1.46k|    char byte;
  390|       |
  391|  1.46k|    byte = (char)value;
  392|  1.46k|    sec_asn1e_write_part(state, &byte, 1, SEC_ASN1_Identifier);
  393|  1.46k|}
secasn1e.c:sec_asn1e_write_part:
  374|  4.39k|{
  375|  4.39k|    SEC_ASN1EncoderContext *cx;
  376|       |
  377|  4.39k|    cx = state->top;
  378|  4.39k|    (*cx->output_proc)(cx->output_arg, buf, len, state->depth, part);
  379|  4.39k|}
secasn1e.c:sec_asn1e_write_length_bytes:
  420|  1.46k|{
  421|  1.46k|    int lenlen;
  422|  1.46k|    unsigned char buf[sizeof(unsigned long) + 1];
  423|       |
  424|  1.46k|    if (indefinite) {
  ------------------
  |  Branch (424:9): [True: 0, False: 1.46k]
  ------------------
  425|      0|        PORT_Assert(value == 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  426|      0|        buf[0] = 0x80;
  427|      0|        lenlen = 1;
  428|  1.46k|    } else {
  429|  1.46k|        lenlen = SEC_ASN1EncodeLength(buf, value);
  430|  1.46k|    }
  431|       |
  432|  1.46k|    sec_asn1e_write_part(state, (char *)buf, lenlen, SEC_ASN1_Length);
  433|  1.46k|}
secasn1e.c:sec_asn1e_write_contents_bytes:
  438|  1.46k|{
  439|  1.46k|    sec_asn1e_write_part(state, buf, len, SEC_ASN1_Contents);
  440|  1.46k|}
secasn1e.c:sec_asn1e_write_contents:
  981|  1.46k|{
  982|  1.46k|    unsigned long len = 0;
  983|       |
  984|  1.46k|    PORT_Assert(state->place == duringContents);
  ------------------
  |  |  120|  1.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  985|       |
  986|  1.46k|    switch (state->underlying_kind) {
  987|      0|        case SEC_ASN1_SET:
  ------------------
  |  |   93|      0|#define SEC_ASN1_SET 0x11
  ------------------
  |  Branch (987:9): [True: 0, False: 1.46k]
  ------------------
  988|      0|        case SEC_ASN1_SEQUENCE:
  ------------------
  |  |   92|      0|#define SEC_ASN1_SEQUENCE 0x10
  ------------------
  |  Branch (988:9): [True: 0, False: 1.46k]
  ------------------
  989|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  990|      0|            break;
  991|       |
  992|      0|        case SEC_ASN1_BIT_STRING: {
  ------------------
  |  |   79|      0|#define SEC_ASN1_BIT_STRING 0x03
  ------------------
  |  Branch (992:9): [True: 0, False: 1.46k]
  ------------------
  993|      0|            SECItem *item;
  994|      0|            char rem;
  995|       |
  996|      0|            item = (SECItem *)state->src;
  997|      0|            len = (item->len + 7) >> 3;
  998|      0|            rem = (unsigned char)((len << 3) - item->len); /* remaining bits */
  999|      0|            sec_asn1e_write_contents_bytes(state, &rem, 1);
 1000|      0|            sec_asn1e_write_contents_bytes(state, (char *)item->data, len);
 1001|      0|        } break;
 1002|       |
 1003|      0|        case SEC_ASN1_BMP_STRING:
  ------------------
  |  |  106|      0|#define SEC_ASN1_BMP_STRING 0x1e
  ------------------
  |  Branch (1003:9): [True: 0, False: 1.46k]
  ------------------
 1004|       |            /* The number of bytes must be divisable by 2 */
 1005|      0|            if ((((SECItem *)state->src)->len) % 2) {
  ------------------
  |  Branch (1005:17): [True: 0, False: 0]
  ------------------
 1006|      0|                SEC_ASN1EncoderContext *cx;
 1007|       |
 1008|      0|                cx = state->top;
 1009|      0|                cx->status = encodeError;
 1010|      0|                break;
 1011|      0|            }
 1012|       |            /* otherwise, fall through to write the content */
 1013|      0|            goto process_string;
 1014|       |
 1015|      0|        case SEC_ASN1_UNIVERSAL_STRING:
  ------------------
  |  |  104|      0|#define SEC_ASN1_UNIVERSAL_STRING 0x1c
  ------------------
  |  Branch (1015:9): [True: 0, False: 1.46k]
  ------------------
 1016|       |            /* The number of bytes must be divisable by 4 */
 1017|      0|            if ((((SECItem *)state->src)->len) % 4) {
  ------------------
  |  Branch (1017:17): [True: 0, False: 0]
  ------------------
 1018|      0|                SEC_ASN1EncoderContext *cx;
 1019|       |
 1020|      0|                cx = state->top;
 1021|      0|                cx->status = encodeError;
 1022|      0|                break;
 1023|      0|            }
 1024|       |            /* otherwise, fall through to write the content */
 1025|      0|            goto process_string;
 1026|       |
 1027|      0|        case SEC_ASN1_INTEGER:
  ------------------
  |  |   78|      0|#define SEC_ASN1_INTEGER 0x02
  ------------------
  |  Branch (1027:9): [True: 0, False: 1.46k]
  ------------------
 1028|       |            /* ASN.1 INTEGERs are signed.  If the source is an unsigned
 1029|       |             * integer, the encoder will need to handle the conversion here.
 1030|       |             */
 1031|      0|            {
 1032|      0|                unsigned int blen;
 1033|      0|                unsigned char *buf;
 1034|      0|                SECItemType integerType;
 1035|      0|                blen = ((SECItem *)state->src)->len;
 1036|      0|                buf = ((SECItem *)state->src)->data;
 1037|      0|                integerType = ((SECItem *)state->src)->type;
 1038|      0|                while (blen > 0) {
  ------------------
  |  Branch (1038:24): [True: 0, False: 0]
  ------------------
 1039|      0|                    if (*buf & 0x80 && integerType == siUnsignedInteger) {
  ------------------
  |  Branch (1039:25): [True: 0, False: 0]
  |  Branch (1039:40): [True: 0, False: 0]
  ------------------
 1040|      0|                        char zero = 0; /* write a leading 0 */
 1041|      0|                        sec_asn1e_write_contents_bytes(state, &zero, 1);
 1042|       |                        /* and then the remaining buffer */
 1043|      0|                        sec_asn1e_write_contents_bytes(state,
 1044|      0|                                                       (char *)buf, blen);
 1045|      0|                        break;
 1046|      0|                    }
 1047|       |                    /* Check three possibilities:
 1048|       |                     * 1.  No leading zeros, msb of MSB is not 1;
 1049|       |                     * 2.  The number is zero itself;
 1050|       |                     * 3.  Encoding a signed integer with a leading zero,
 1051|       |                     *     keep the zero so that the number is positive.
 1052|       |                     */
 1053|      0|                    if (*buf != 0 ||
  ------------------
  |  Branch (1053:25): [True: 0, False: 0]
  ------------------
 1054|      0|                        blen == 1 ||
  ------------------
  |  Branch (1054:25): [True: 0, False: 0]
  ------------------
 1055|      0|                        (buf[1] & 0x80 && integerType != siUnsignedInteger)) {
  ------------------
  |  Branch (1055:26): [True: 0, False: 0]
  |  Branch (1055:43): [True: 0, False: 0]
  ------------------
 1056|      0|                        sec_asn1e_write_contents_bytes(state,
 1057|      0|                                                       (char *)buf, blen);
 1058|      0|                        break;
 1059|      0|                    }
 1060|       |                    /* byte is 0, continue */
 1061|      0|                    buf++;
 1062|      0|                    blen--;
 1063|      0|                }
 1064|      0|            }
 1065|       |            /* done with this content */
 1066|      0|            break;
 1067|       |
 1068|      0|        process_string:
 1069|  1.46k|        default: {
  ------------------
  |  Branch (1069:9): [True: 1.46k, False: 0]
  ------------------
 1070|  1.46k|            SECItem *item;
 1071|       |
 1072|  1.46k|            item = (SECItem *)state->src;
 1073|  1.46k|            sec_asn1e_write_contents_bytes(state, (char *)item->data,
 1074|  1.46k|                                           item->len);
 1075|  1.46k|        } break;
 1076|  1.46k|    }
 1077|  1.46k|    state->place = afterContents;
 1078|  1.46k|}
secasn1e.c:sec_asn1e_scrub_state:
  130|  1.46k|{
  131|       |    /*
  132|       |     * Some default "scrubbing".
  133|       |     * XXX right set of initializations?
  134|       |     */
  135|  1.46k|    state->place = beforeHeader;
  136|  1.46k|    state->indefinite = PR_FALSE;
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
  137|  1.46k|}
secasn1e.c:sec_asn1e_after_contents:
 1174|  1.46k|{
 1175|  1.46k|    PORT_Assert(state->place == afterContents);
  ------------------
  |  |  120|  1.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1176|       |
 1177|  1.46k|    if (state->indefinite)
  ------------------
  |  Branch (1177:9): [True: 0, False: 1.46k]
  ------------------
 1178|      0|        sec_asn1e_write_end_of_contents_bytes(state);
 1179|       |
 1180|       |    /*
 1181|       |     * Just make my parent be the current state.  It will then clean
 1182|       |     * up after me and free me (or reuse me).
 1183|       |     */
 1184|  1.46k|    state->top->current = state->parent;
 1185|  1.46k|}
secasn1e.c:sec_asn1e_push_state:
   94|  1.46k|{
   95|  1.46k|    sec_asn1e_state *state, *new_state;
   96|       |
   97|  1.46k|    if (theTemplate == NULL) {
  ------------------
  |  Branch (97:9): [True: 0, False: 1.46k]
  ------------------
   98|      0|        cx->status = encodeError;
   99|      0|        return NULL;
  100|      0|    }
  101|       |
  102|  1.46k|    state = cx->current;
  103|  1.46k|    new_state = (sec_asn1e_state *)PORT_ArenaZAlloc(cx->our_pool,
  ------------------
  |  |   59|  1.46k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  104|  1.46k|                                                    sizeof(*new_state));
  105|  1.46k|    if (new_state == NULL) {
  ------------------
  |  Branch (105:9): [True: 0, False: 1.46k]
  ------------------
  106|      0|        cx->status = encodeError;
  107|      0|        return NULL;
  108|      0|    }
  109|       |
  110|  1.46k|    new_state->top = cx;
  111|  1.46k|    new_state->parent = state;
  112|  1.46k|    new_state->theTemplate = theTemplate;
  113|  1.46k|    new_state->place = notInUse;
  114|  1.46k|    if (src != NULL)
  ------------------
  |  Branch (114:9): [True: 1.46k, False: 0]
  ------------------
  115|  1.46k|        new_state->src = (char *)src + theTemplate->offset;
  116|       |
  117|  1.46k|    if (state != NULL) {
  ------------------
  |  Branch (117:9): [True: 0, False: 1.46k]
  ------------------
  118|      0|        new_state->depth = state->depth;
  119|      0|        if (new_depth)
  ------------------
  |  Branch (119:13): [True: 0, False: 0]
  ------------------
  120|      0|            new_state->depth++;
  121|      0|        state->child = new_state;
  122|      0|    }
  123|       |
  124|  1.46k|    cx->current = new_state;
  125|  1.46k|    return new_state;
  126|  1.46k|}
secasn1e.c:sec_asn1e_init_state_based_on_template:
  163|  1.46k|{
  164|  1.46k|    PRBool isExplicit, is_string, may_stream, optional, universal;
  165|  1.46k|    PRBool disallowStreaming;
  166|  1.46k|    unsigned char tag_modifiers;
  167|  1.46k|    unsigned long encode_kind, under_kind;
  168|  1.46k|    unsigned long tag_number;
  169|  1.46k|    PRBool isInline = PR_FALSE;
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
  170|       |
  171|  1.46k|    encode_kind = state->theTemplate->kind;
  172|       |
  173|  1.46k|    universal = ((encode_kind & SEC_ASN1_CLASS_MASK) == SEC_ASN1_UNIVERSAL)
  ------------------
  |  |  119|  1.46k|#define SEC_ASN1_CLASS_MASK 0xc0
  ------------------
                  universal = ((encode_kind & SEC_ASN1_CLASS_MASK) == SEC_ASN1_UNIVERSAL)
  ------------------
  |  |  120|  1.46k|#define SEC_ASN1_UNIVERSAL 0x00
  ------------------
  |  Branch (173:17): [True: 1.46k, False: 0]
  ------------------
  174|  1.46k|                    ? PR_TRUE
  ------------------
  |  |  437|  1.46k|#define PR_TRUE 1
  ------------------
  175|  1.46k|                    : PR_FALSE;
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
  176|       |
  177|  1.46k|    isExplicit = (encode_kind & SEC_ASN1_EXPLICIT) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  132|  1.46k|#define SEC_ASN1_EXPLICIT 0x00200
  ------------------
                  isExplicit = (encode_kind & SEC_ASN1_EXPLICIT) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                  isExplicit = (encode_kind & SEC_ASN1_EXPLICIT) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|  2.93k|#define PR_FALSE 0
  ------------------
  |  Branch (177:18): [True: 0, False: 1.46k]
  ------------------
  178|  1.46k|    encode_kind &= ~SEC_ASN1_EXPLICIT;
  ------------------
  |  |  132|  1.46k|#define SEC_ASN1_EXPLICIT 0x00200
  ------------------
  179|       |
  180|  1.46k|    optional = (encode_kind & SEC_ASN1_OPTIONAL) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  131|  1.46k|#define SEC_ASN1_OPTIONAL 0x00100
  ------------------
                  optional = (encode_kind & SEC_ASN1_OPTIONAL) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                  optional = (encode_kind & SEC_ASN1_OPTIONAL) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|  2.93k|#define PR_FALSE 0
  ------------------
  |  Branch (180:16): [True: 0, False: 1.46k]
  ------------------
  181|  1.46k|    encode_kind &= ~SEC_ASN1_OPTIONAL;
  ------------------
  |  |  131|  1.46k|#define SEC_ASN1_OPTIONAL 0x00100
  ------------------
  182|       |
  183|  1.46k|    PORT_Assert(!(isExplicit && universal)); /* bad templates */
  ------------------
  |  |  120|  1.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 0, False: 1.46k]
  |  |  |  |  |  Branch (208:7): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  184|       |
  185|  1.46k|    may_stream = (encode_kind & SEC_ASN1_MAY_STREAM) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  146|  1.46k|#define SEC_ASN1_MAY_STREAM 0x40000   /* field or one of its sub-fields may \
  ------------------
                  may_stream = (encode_kind & SEC_ASN1_MAY_STREAM) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|  1.46k|#define PR_TRUE 1
  ------------------
                  may_stream = (encode_kind & SEC_ASN1_MAY_STREAM) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
  |  Branch (185:18): [True: 1.46k, False: 0]
  ------------------
  186|  1.46k|    encode_kind &= ~SEC_ASN1_MAY_STREAM;
  ------------------
  |  |  146|  1.46k|#define SEC_ASN1_MAY_STREAM 0x40000   /* field or one of its sub-fields may \
  ------------------
  187|       |
  188|  1.46k|    disallowStreaming = (encode_kind & SEC_ASN1_NO_STREAM) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  154|  1.46k|#define SEC_ASN1_NO_STREAM 0X200000   /* This entry will not stream          \
  ------------------
                  disallowStreaming = (encode_kind & SEC_ASN1_NO_STREAM) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                  disallowStreaming = (encode_kind & SEC_ASN1_NO_STREAM) ? PR_TRUE : PR_FALSE;
  ------------------
  |  |  438|  2.93k|#define PR_FALSE 0
  ------------------
  |  Branch (188:25): [True: 0, False: 1.46k]
  ------------------
  189|  1.46k|    encode_kind &= ~SEC_ASN1_NO_STREAM;
  ------------------
  |  |  154|  1.46k|#define SEC_ASN1_NO_STREAM 0X200000   /* This entry will not stream          \
  ------------------
  190|       |
  191|       |    /* Just clear this to get it out of the way; we do not need it here */
  192|  1.46k|    encode_kind &= ~SEC_ASN1_DYNAMIC;
  ------------------
  |  |  138|  1.46k|#define SEC_ASN1_DYNAMIC 0x04000      /* subtemplate is found by calling \
  ------------------
  193|       |
  194|  1.46k|    if (encode_kind & SEC_ASN1_CHOICE) {
  ------------------
  |  |  153|  1.46k|#define SEC_ASN1_CHOICE 0x100000      /* pick one from a template */
  ------------------
  |  Branch (194:9): [True: 0, False: 1.46k]
  ------------------
  195|      0|        under_kind = SEC_ASN1_CHOICE;
  ------------------
  |  |  153|      0|#define SEC_ASN1_CHOICE 0x100000      /* pick one from a template */
  ------------------
  196|  1.46k|    } else if ((encode_kind & (SEC_ASN1_POINTER | SEC_ASN1_INLINE)) ||
  ------------------
  |  |  135|  1.46k|#define SEC_ASN1_POINTER 0x01000
  ------------------
                  } else if ((encode_kind & (SEC_ASN1_POINTER | SEC_ASN1_INLINE)) ||
  ------------------
  |  |  134|  1.46k|#define SEC_ASN1_INLINE 0x00800
  ------------------
  |  Branch (196:16): [True: 0, False: 1.46k]
  ------------------
  197|  1.46k|               (!universal && !isExplicit)) {
  ------------------
  |  Branch (197:17): [True: 0, False: 1.46k]
  |  Branch (197:31): [True: 0, False: 0]
  ------------------
  198|      0|        const SEC_ASN1Template *subt;
  199|      0|        void *src = NULL;
  200|       |
  201|      0|        PORT_Assert((encode_kind & (SEC_ASN1_ANY | SEC_ASN1_SKIP)) == 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|       |
  203|      0|        sec_asn1e_scrub_state(state);
  204|       |
  205|      0|        if (encode_kind & SEC_ASN1_POINTER) {
  ------------------
  |  |  135|      0|#define SEC_ASN1_POINTER 0x01000
  ------------------
  |  Branch (205:13): [True: 0, False: 0]
  ------------------
  206|      0|            src = *(void **)state->src;
  207|      0|            state->place = afterPointer;
  208|       |
  209|      0|            if (src == NULL) {
  ------------------
  |  Branch (209:17): [True: 0, False: 0]
  ------------------
  210|       |                /*
  211|       |                 * If this is optional, but NULL, then the field does
  212|       |                 * not need to be encoded.  In this case we are done;
  213|       |                 * we do not want to push a subtemplate.
  214|       |                 */
  215|      0|                if (optional)
  ------------------
  |  Branch (215:21): [True: 0, False: 0]
  ------------------
  216|      0|                    return state;
  217|       |
  218|       |                /*
  219|       |                 * XXX this is an error; need to figure out
  220|       |                 * how to handle this
  221|       |                 */
  222|      0|            }
  223|      0|        } else {
  224|      0|            src = state->src;
  225|      0|            if (encode_kind & SEC_ASN1_INLINE) {
  ------------------
  |  |  134|      0|#define SEC_ASN1_INLINE 0x00800
  ------------------
  |  Branch (225:17): [True: 0, False: 0]
  ------------------
  226|       |                /* check that there are no extraneous bits */
  227|       |                /* PORT_Assert (encode_kind == SEC_ASN1_INLINE && !optional); */
  228|      0|                state->place = afterInline;
  229|      0|                isInline = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  230|      0|            } else {
  231|       |                /*
  232|       |                 * Save the tag modifiers and tag number here before moving
  233|       |                 * on to the next state in case this is a member of a
  234|       |                 * SEQUENCE OF
  235|       |                 */
  236|      0|                state->tag_modifiers = (unsigned char)(encode_kind & (SEC_ASN1_TAG_MASK & ~SEC_ASN1_TAGNUM_MASK));
  ------------------
  |  |   65|      0|#define SEC_ASN1_TAG_MASK 0xff
  ------------------
                              state->tag_modifiers = (unsigned char)(encode_kind & (SEC_ASN1_TAG_MASK & ~SEC_ASN1_TAGNUM_MASK));
  ------------------
  |  |   76|      0|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  237|      0|                state->tag_number = (unsigned char)(encode_kind & SEC_ASN1_TAGNUM_MASK);
  ------------------
  |  |   76|      0|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  238|       |
  239|      0|                state->place = afterImplicit;
  240|      0|                state->optional = optional;
  241|      0|            }
  242|      0|        }
  243|       |
  244|      0|        subt = SEC_ASN1GetSubtemplate(state->theTemplate, state->src, PR_TRUE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  245|      0|        if (isInline && optional) {
  ------------------
  |  Branch (245:13): [True: 0, False: 0]
  |  Branch (245:25): [True: 0, False: 0]
  ------------------
  246|       |            /* we only handle a very limited set of optional inline cases at
  247|       |               this time */
  248|      0|            if (PR_FALSE != SEC_ASN1IsTemplateSimple(subt)) {
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (248:17): [True: 0, False: 0]
  ------------------
  249|       |                /* we now know that the target is a SECItem*, so we can check
  250|       |                   if the source contains one */
  251|      0|                SECItem *target = (SECItem *)state->src;
  252|      0|                if (!target || !target->data || !target->len) {
  ------------------
  |  Branch (252:21): [True: 0, False: 0]
  |  Branch (252:32): [True: 0, False: 0]
  |  Branch (252:49): [True: 0, False: 0]
  ------------------
  253|       |                    /* no valid data to encode subtemplate */
  254|      0|                    return state;
  255|      0|                }
  256|      0|            } else {
  257|      0|                PORT_Assert(0); /* complex templates are not handled as
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  258|       |                                   inline optional */
  259|      0|            }
  260|      0|        }
  261|      0|        state = sec_asn1e_push_state(state->top, subt, src, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  262|      0|        if (state == NULL)
  ------------------
  |  Branch (262:13): [True: 0, False: 0]
  ------------------
  263|      0|            return state;
  264|       |
  265|      0|        if (universal) {
  ------------------
  |  Branch (265:13): [True: 0, False: 0]
  ------------------
  266|       |            /*
  267|       |             * This is a POINTER or INLINE; just init based on that
  268|       |             * and we are done.
  269|       |             */
  270|      0|            return sec_asn1e_init_state_based_on_template(state);
  271|      0|        }
  272|       |
  273|       |        /*
  274|       |         * This is an implicit, non-universal (meaning, application-private
  275|       |         * or context-specific) field.  This results in a "magic" tag but
  276|       |         * encoding based on the underlying type.  We pushed a new state
  277|       |         * that is based on the subtemplate (the underlying type), but
  278|       |         * now we will sort of alias it to give it some of our properties
  279|       |         * (tag, optional status, etc.).
  280|       |         *
  281|       |         * NB: ALL the following flags in the subtemplate are disallowed
  282|       |         *     and/or ignored: EXPLICIT, OPTIONAL, INNER, INLINE, POINTER.
  283|       |         */
  284|       |
  285|      0|        under_kind = state->theTemplate->kind;
  286|      0|        if ((under_kind & SEC_ASN1_MAY_STREAM) && !disallowStreaming) {
  ------------------
  |  |  146|      0|#define SEC_ASN1_MAY_STREAM 0x40000   /* field or one of its sub-fields may \
  ------------------
  |  Branch (286:13): [True: 0, False: 0]
  |  Branch (286:51): [True: 0, False: 0]
  ------------------
  287|      0|            may_stream = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  288|      0|        }
  289|      0|        under_kind &= ~(SEC_ASN1_MAY_STREAM | SEC_ASN1_DYNAMIC);
  ------------------
  |  |  146|      0|#define SEC_ASN1_MAY_STREAM 0x40000   /* field or one of its sub-fields may \
  ------------------
                      under_kind &= ~(SEC_ASN1_MAY_STREAM | SEC_ASN1_DYNAMIC);
  ------------------
  |  |  138|      0|#define SEC_ASN1_DYNAMIC 0x04000      /* subtemplate is found by calling \
  ------------------
  290|  1.46k|    } else {
  291|  1.46k|        under_kind = encode_kind;
  292|  1.46k|    }
  293|       |
  294|       |/*
  295|       | * Sanity check that there are no unwanted bits marked in under_kind.
  296|       | * These bits were either removed above (after we recorded them) or
  297|       | * they simply should not be found (signalling a bad/broken template).
  298|       | * XXX is this the right set of bits to test here? (i.e. need to add
  299|       | * or remove any?)
  300|       | */
  301|  1.46k|#define UNEXPECTED_FLAGS                                                      \
  302|  1.46k|    (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_SKIP | SEC_ASN1_INNER | \
  303|  1.46k|     SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_INLINE | SEC_ASN1_POINTER)
  304|       |
  305|  1.46k|    PORT_Assert((under_kind & UNEXPECTED_FLAGS) == 0);
  ------------------
  |  |  120|  1.46k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  1.46k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1.46k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|  1.46k|    under_kind &= ~UNEXPECTED_FLAGS;
  ------------------
  |  |  302|  1.46k|    (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_SKIP | SEC_ASN1_INNER | \
  |  |  ------------------
  |  |  |  |  132|  1.46k|#define SEC_ASN1_EXPLICIT 0x00200
  |  |  ------------------
  |  |                   (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_SKIP | SEC_ASN1_INNER | \
  |  |  ------------------
  |  |  |  |  131|  1.46k|#define SEC_ASN1_OPTIONAL 0x00100
  |  |  ------------------
  |  |                   (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_SKIP | SEC_ASN1_INNER | \
  |  |  ------------------
  |  |  |  |  140|  1.46k|#define SEC_ASN1_SKIP 0x08000         /* skip a field; only for decoding */
  |  |  ------------------
  |  |                   (SEC_ASN1_EXPLICIT | SEC_ASN1_OPTIONAL | SEC_ASN1_SKIP | SEC_ASN1_INNER | \
  |  |  ------------------
  |  |  |  |  141|  1.46k|#define SEC_ASN1_INNER 0x10000        /* with ANY means capture the      \
  |  |  ------------------
  |  |  303|  1.46k|     SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_INLINE | SEC_ASN1_POINTER)
  |  |  ------------------
  |  |  |  |  138|  1.46k|#define SEC_ASN1_DYNAMIC 0x04000      /* subtemplate is found by calling \
  |  |  ------------------
  |  |                    SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_INLINE | SEC_ASN1_POINTER)
  |  |  ------------------
  |  |  |  |  146|  1.46k|#define SEC_ASN1_MAY_STREAM 0x40000   /* field or one of its sub-fields may \
  |  |  ------------------
  |  |                    SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_INLINE | SEC_ASN1_POINTER)
  |  |  ------------------
  |  |  |  |  134|  1.46k|#define SEC_ASN1_INLINE 0x00800
  |  |  ------------------
  |  |                    SEC_ASN1_DYNAMIC | SEC_ASN1_MAY_STREAM | SEC_ASN1_INLINE | SEC_ASN1_POINTER)
  |  |  ------------------
  |  |  |  |  135|  1.46k|#define SEC_ASN1_POINTER 0x01000
  |  |  ------------------
  ------------------
  307|  1.46k|#undef UNEXPECTED_FLAGS
  308|       |
  309|  1.46k|    if (encode_kind & SEC_ASN1_ANY) {
  ------------------
  |  |  133|  1.46k|#define SEC_ASN1_ANY 0x00400
  ------------------
  |  Branch (309:9): [True: 0, False: 1.46k]
  ------------------
  310|      0|        PORT_Assert(encode_kind == under_kind);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|      0|        tag_modifiers = 0;
  312|      0|        tag_number = 0;
  313|      0|        is_string = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  314|  1.46k|    } else {
  315|  1.46k|        tag_modifiers = (unsigned char)(encode_kind & (SEC_ASN1_TAG_MASK & ~SEC_ASN1_TAGNUM_MASK));
  ------------------
  |  |   65|  1.46k|#define SEC_ASN1_TAG_MASK 0xff
  ------------------
                      tag_modifiers = (unsigned char)(encode_kind & (SEC_ASN1_TAG_MASK & ~SEC_ASN1_TAGNUM_MASK));
  ------------------
  |  |   76|  1.46k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  316|       |        /*
  317|       |         * XXX This assumes only single-octet identifiers.  To handle
  318|       |         * the HIGH TAG form we would need to do some more work, especially
  319|       |         * in how to specify them in the template, because right now we
  320|       |         * do not provide a way to specify more *tag* bits in encode_kind.
  321|       |         */
  322|  1.46k|        tag_number = encode_kind & SEC_ASN1_TAGNUM_MASK;
  ------------------
  |  |   76|  1.46k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  323|       |
  324|  1.46k|        is_string = PR_FALSE;
  ------------------
  |  |  438|  1.46k|#define PR_FALSE 0
  ------------------
  325|  1.46k|        switch (under_kind & SEC_ASN1_TAGNUM_MASK) {
  ------------------
  |  |   76|  1.46k|#define SEC_ASN1_TAGNUM_MASK 0x1f
  ------------------
  |  Branch (325:17): [True: 0, False: 1.46k]
  ------------------
  326|      0|            case SEC_ASN1_SET:
  ------------------
  |  |   93|      0|#define SEC_ASN1_SET 0x11
  ------------------
  |  Branch (326:13): [True: 0, False: 1.46k]
  ------------------
  327|       |                /*
  328|       |                 * XXX A plain old SET (as opposed to a SET OF) is not implemented.
  329|       |                 * If it ever is, remove this assert...
  330|       |                 */
  331|      0|                PORT_Assert((under_kind & SEC_ASN1_GROUP) != 0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  332|       |            /* fallthru */
  333|      0|            case SEC_ASN1_SEQUENCE:
  ------------------
  |  |   92|      0|#define SEC_ASN1_SEQUENCE 0x10
  ------------------
  |  Branch (333:13): [True: 0, False: 1.46k]
  ------------------
  334|      0|                tag_modifiers |= SEC_ASN1_CONSTRUCTED;
  ------------------
  |  |  117|      0|#define SEC_ASN1_CONSTRUCTED 0x20
  ------------------
  335|      0|                break;
  336|      0|            case SEC_ASN1_BIT_STRING:
  ------------------
  |  |   79|      0|#define SEC_ASN1_BIT_STRING 0x03
  ------------------
  |  Branch (336:13): [True: 0, False: 1.46k]
  ------------------
  337|      0|            case SEC_ASN1_BMP_STRING:
  ------------------
  |  |  106|      0|#define SEC_ASN1_BMP_STRING 0x1e
  ------------------
  |  Branch (337:13): [True: 0, False: 1.46k]
  ------------------
  338|      0|            case SEC_ASN1_GENERALIZED_TIME:
  ------------------
  |  |  100|      0|#define SEC_ASN1_GENERALIZED_TIME 0x18
  ------------------
  |  Branch (338:13): [True: 0, False: 1.46k]
  ------------------
  339|      0|            case SEC_ASN1_IA5_STRING:
  ------------------
  |  |   98|      0|#define SEC_ASN1_IA5_STRING 0x16
  ------------------
  |  Branch (339:13): [True: 0, False: 1.46k]
  ------------------
  340|  1.46k|            case SEC_ASN1_OCTET_STRING:
  ------------------
  |  |   80|  1.46k|#define SEC_ASN1_OCTET_STRING 0x04
  ------------------
  |  Branch (340:13): [True: 1.46k, False: 0]
  ------------------
  341|  1.46k|            case SEC_ASN1_PRINTABLE_STRING:
  ------------------
  |  |   95|  1.46k|#define SEC_ASN1_PRINTABLE_STRING 0x13
  ------------------
  |  Branch (341:13): [True: 0, False: 1.46k]
  ------------------
  342|  1.46k|            case SEC_ASN1_T61_STRING:
  ------------------
  |  |   96|  1.46k|#define SEC_ASN1_T61_STRING 0x14
  ------------------
  |  Branch (342:13): [True: 0, False: 1.46k]
  ------------------
  343|  1.46k|            case SEC_ASN1_UNIVERSAL_STRING:
  ------------------
  |  |  104|  1.46k|#define SEC_ASN1_UNIVERSAL_STRING 0x1c
  ------------------
  |  Branch (343:13): [True: 0, False: 1.46k]
  ------------------
  344|  1.46k|            case SEC_ASN1_UTC_TIME:
  ------------------
  |  |   99|  1.46k|#define SEC_ASN1_UTC_TIME 0x17
  ------------------
  |  Branch (344:13): [True: 0, False: 1.46k]
  ------------------
  345|  1.46k|            case SEC_ASN1_UTF8_STRING:
  ------------------
  |  |   88|  1.46k|#define SEC_ASN1_UTF8_STRING 0x0c
  ------------------
  |  Branch (345:13): [True: 0, False: 1.46k]
  ------------------
  346|  1.46k|            case SEC_ASN1_VISIBLE_STRING:
  ------------------
  |  |  102|  1.46k|#define SEC_ASN1_VISIBLE_STRING 0x1a
  ------------------
  |  Branch (346:13): [True: 0, False: 1.46k]
  ------------------
  347|       |                /*
  348|       |                 * We do not yet know if we will be constructing the string,
  349|       |                 * so we have to wait to do this final tag modification.
  350|       |                 */
  351|  1.46k|                is_string = PR_TRUE;
  ------------------
  |  |  437|  1.46k|#define PR_TRUE 1
  ------------------
  352|  1.46k|                break;
  353|  1.46k|        }
  354|  1.46k|    }
  355|       |
  356|  1.46k|    state->tag_modifiers = tag_modifiers;
  357|  1.46k|    state->tag_number = (unsigned char)tag_number;
  358|  1.46k|    state->underlying_kind = under_kind;
  359|  1.46k|    state->isExplicit = isExplicit;
  360|  1.46k|    state->may_stream = may_stream;
  361|  1.46k|    state->is_string = is_string;
  362|  1.46k|    state->optional = optional;
  363|  1.46k|    state->disallowStreaming = disallowStreaming;
  364|       |
  365|  1.46k|    sec_asn1e_scrub_state(state);
  366|       |
  367|  1.46k|    return state;
  368|  1.46k|}
secasn1e.c:sec_asn1e_encode_item_count:
 1410|  2.19k|{
 1411|  2.19k|    unsigned long *count;
 1412|       |
 1413|  2.19k|    count = (unsigned long *)arg;
 1414|  2.19k|    PORT_Assert(count != NULL);
  ------------------
  |  |  120|  2.19k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.19k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2.19k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1415|       |
 1416|  2.19k|    *count += len;
 1417|  2.19k|}
secasn1e.c:sec_asn1e_allocate_item:
 1444|    733|{
 1445|    733|    if (poolp != NULL) {
  ------------------
  |  Branch (1445:9): [True: 0, False: 733]
  ------------------
 1446|      0|        void *release;
 1447|       |
 1448|      0|        release = PORT_ArenaMark(poolp);
  ------------------
  |  |   55|      0|#define PORT_ArenaMark PORT_ArenaMark_Util
  ------------------
 1449|      0|        if (dest == NULL)
  ------------------
  |  Branch (1449:13): [True: 0, False: 0]
  ------------------
 1450|      0|            dest = (SECItem *)PORT_ArenaAlloc(poolp, sizeof(SECItem));
  ------------------
  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
 1451|      0|        if (dest != NULL) {
  ------------------
  |  Branch (1451:13): [True: 0, False: 0]
  ------------------
 1452|      0|            dest->data = (unsigned char *)PORT_ArenaAlloc(poolp, len);
  ------------------
  |  |   53|      0|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
 1453|      0|            if (dest->data == NULL) {
  ------------------
  |  Branch (1453:17): [True: 0, False: 0]
  ------------------
 1454|      0|                dest = NULL;
 1455|      0|            }
 1456|      0|        }
 1457|      0|        if (dest == NULL) {
  ------------------
  |  Branch (1457:13): [True: 0, False: 0]
  ------------------
 1458|       |            /* one or both allocations failed; release everything */
 1459|      0|            PORT_ArenaRelease(poolp, release);
  ------------------
  |  |   56|      0|#define PORT_ArenaRelease PORT_ArenaRelease_Util
  ------------------
 1460|      0|        } else {
 1461|       |            /* everything okay; unmark the arena */
 1462|      0|            PORT_ArenaUnmark(poolp, release);
  ------------------
  |  |   58|      0|#define PORT_ArenaUnmark PORT_ArenaUnmark_Util
  ------------------
 1463|      0|        }
 1464|    733|    } else {
 1465|    733|        SECItem *indest;
 1466|       |
 1467|    733|        indest = dest;
 1468|    733|        if (dest == NULL)
  ------------------
  |  Branch (1468:13): [True: 733, False: 0]
  ------------------
 1469|    733|            dest = (SECItem *)PORT_Alloc(sizeof(SECItem));
  ------------------
  |  |   52|    733|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1470|    733|        if (dest != NULL) {
  ------------------
  |  Branch (1470:13): [True: 733, False: 0]
  ------------------
 1471|    733|            dest->type = siBuffer;
 1472|    733|            dest->data = (unsigned char *)PORT_Alloc(len);
  ------------------
  |  |   52|    733|#define PORT_Alloc PORT_Alloc_Util
  ------------------
 1473|    733|            if (dest->data == NULL) {
  ------------------
  |  Branch (1473:17): [True: 0, False: 733]
  ------------------
 1474|      0|                if (indest == NULL)
  ------------------
  |  Branch (1474:21): [True: 0, False: 0]
  ------------------
 1475|      0|                    PORT_Free(dest);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 1476|      0|                dest = NULL;
 1477|      0|            }
 1478|    733|        }
 1479|    733|    }
 1480|       |
 1481|    733|    return dest;
 1482|    733|}
secasn1e.c:sec_asn1e_encode_item_store:
 1423|  2.19k|{
 1424|  2.19k|    SECItem *dest;
 1425|       |
 1426|  2.19k|    dest = (SECItem *)arg;
 1427|  2.19k|    PORT_Assert(dest != NULL);
  ------------------
  |  |  120|  2.19k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  2.19k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 2.19k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1428|       |
 1429|  2.19k|    if (len > 0) {
  ------------------
  |  Branch (1429:9): [True: 2.19k, False: 0]
  ------------------
 1430|  2.19k|        PORT_Memcpy(dest->data + dest->len, buf, len);
  ------------------
  |  |  180|  2.19k|#define PORT_Memcpy memcpy
  ------------------
 1431|  2.19k|        dest->len += len;
 1432|  2.19k|    }
 1433|  2.19k|}

SEC_ASN1LengthLength_Util:
   21|  1.46k|{
   22|  1.46k|    int lenlen = 1;
   23|       |
   24|  1.46k|    if (len > 0x7f) {
  ------------------
  |  Branch (24:9): [True: 98, False: 1.36k]
  ------------------
   25|     98|        do {
   26|     98|            lenlen++;
   27|     98|            len >>= 8;
   28|     98|        } while (len);
  ------------------
  |  Branch (28:18): [True: 0, False: 98]
  ------------------
   29|     98|    }
   30|       |
   31|  1.46k|    return lenlen;
   32|  1.46k|}
SEC_ASN1GetSubtemplate:
   53|   143k|{
   54|   143k|    const SEC_ASN1Template *subt = NULL;
   55|       |
   56|   143k|    PORT_Assert(theTemplate->sub != NULL);
  ------------------
  |  |  120|   143k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   143k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 143k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   57|   143k|    if (theTemplate->sub != NULL) {
  ------------------
  |  Branch (57:9): [True: 143k, False: 0]
  ------------------
   58|   143k|        if (theTemplate->kind & SEC_ASN1_DYNAMIC) {
  ------------------
  |  |  138|   143k|#define SEC_ASN1_DYNAMIC 0x04000      /* subtemplate is found by calling \
  ------------------
  |  Branch (58:13): [True: 0, False: 143k]
  ------------------
   59|      0|            SEC_ASN1TemplateChooserPtr chooserp;
   60|       |
   61|      0|            chooserp = *(SEC_ASN1TemplateChooserPtr *)theTemplate->sub;
   62|      0|            if (chooserp) {
  ------------------
  |  Branch (62:17): [True: 0, False: 0]
  ------------------
   63|      0|                if (thing != NULL)
  ------------------
  |  Branch (63:21): [True: 0, False: 0]
  ------------------
   64|      0|                    thing = (char *)thing - theTemplate->offset;
   65|      0|                subt = (*chooserp)(thing, encoding);
   66|      0|            }
   67|   143k|        } else {
   68|   143k|            subt = (SEC_ASN1Template *)theTemplate->sub;
   69|   143k|        }
   70|   143k|    }
   71|   143k|    return subt;
   72|   143k|}

SECITEM_AllocItem_Util:
   16|   161k|{
   17|   161k|    SECItem *result = NULL;
   18|   161k|    void *mark = NULL;
   19|       |
   20|   161k|    if (arena != NULL) {
  ------------------
  |  Branch (20:9): [True: 112k, False: 49.8k]
  ------------------
   21|   112k|        mark = PORT_ArenaMark(arena);
  ------------------
  |  |   55|   112k|#define PORT_ArenaMark PORT_ArenaMark_Util
  ------------------
   22|   112k|    }
   23|       |
   24|   161k|    if (item == NULL) {
  ------------------
  |  Branch (24:9): [True: 20.5k, False: 141k]
  ------------------
   25|  20.5k|        if (arena != NULL) {
  ------------------
  |  Branch (25:13): [True: 1.20k, False: 19.3k]
  ------------------
   26|  1.20k|            result = PORT_ArenaZAlloc(arena, sizeof(SECItem));
  ------------------
  |  |   59|  1.20k|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
   27|  19.3k|        } else {
   28|  19.3k|            result = PORT_ZAlloc(sizeof(SECItem));
  ------------------
  |  |   72|  19.3k|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
   29|  19.3k|        }
   30|  20.5k|        if (result == NULL) {
  ------------------
  |  Branch (30:13): [True: 0, False: 20.5k]
  ------------------
   31|      0|            goto loser;
   32|      0|        }
   33|   141k|    } else {
   34|   141k|        PORT_Assert(item->data == NULL);
  ------------------
  |  |  120|   141k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   141k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 141k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   35|   141k|        result = item;
   36|   141k|    }
   37|       |
   38|   161k|    result->len = len;
   39|   161k|    if (len) {
  ------------------
  |  Branch (39:9): [True: 161k, False: 96]
  ------------------
   40|   161k|        if (arena != NULL) {
  ------------------
  |  Branch (40:13): [True: 112k, False: 49.7k]
  ------------------
   41|   112k|            result->data = PORT_ArenaAlloc(arena, len);
  ------------------
  |  |   53|   112k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
   42|   112k|        } else {
   43|  49.7k|            result->data = PORT_Alloc(len);
  ------------------
  |  |   52|  49.7k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
   44|  49.7k|        }
   45|   161k|        if (result->data == NULL) {
  ------------------
  |  Branch (45:13): [True: 0, False: 161k]
  ------------------
   46|      0|            goto loser;
   47|      0|        }
   48|   161k|    } else {
   49|     96|        result->data = NULL;
   50|     96|    }
   51|       |
   52|   161k|    if (mark) {
  ------------------
  |  Branch (52:9): [True: 112k, False: 49.8k]
  ------------------
   53|   112k|        PORT_ArenaUnmark(arena, mark);
  ------------------
  |  |   58|   112k|#define PORT_ArenaUnmark PORT_ArenaUnmark_Util
  ------------------
   54|   112k|    }
   55|   161k|    return (result);
   56|       |
   57|      0|loser:
   58|      0|    if (arena != NULL) {
  ------------------
  |  Branch (58:9): [True: 0, False: 0]
  ------------------
   59|      0|        if (mark) {
  ------------------
  |  Branch (59:13): [True: 0, False: 0]
  ------------------
   60|      0|            PORT_ArenaRelease(arena, mark);
  ------------------
  |  |   56|      0|#define PORT_ArenaRelease PORT_ArenaRelease_Util
  ------------------
   61|      0|        }
   62|      0|        if (item != NULL) {
  ------------------
  |  Branch (62:13): [True: 0, False: 0]
  ------------------
   63|      0|            item->data = NULL;
   64|      0|            item->len = 0;
   65|      0|        }
   66|      0|    } else {
   67|      0|        if (result != NULL) {
  ------------------
  |  Branch (67:13): [True: 0, False: 0]
  ------------------
   68|      0|            SECITEM_FreeItem(result, (item == NULL) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  108|      0|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                          SECITEM_FreeItem(result, (item == NULL) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
                          SECITEM_FreeItem(result, (item == NULL) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  |  Branch (68:38): [True: 0, False: 0]
  ------------------
   69|      0|        }
   70|       |        /*
   71|       |         * If item is not NULL, the above has set item->data and
   72|       |         * item->len to 0.
   73|       |         */
   74|      0|    }
   75|      0|    return (NULL);
   76|   161k|}
SECITEM_MakeItem:
   81|  1.05k|{
   82|  1.05k|    SECItem it = { siBuffer, (unsigned char *)data, len };
   83|       |
   84|  1.05k|    return SECITEM_CopyItem(arena, dest, &it);
  ------------------
  |  |  106|  1.05k|#define SECITEM_CopyItem SECITEM_CopyItem_Util
  ------------------
   85|  1.05k|}
SECITEM_CompareItem_Util:
  189|  85.0k|{
  190|  85.0k|    unsigned m;
  191|  85.0k|    int rv;
  192|       |
  193|  85.0k|    if (a == b)
  ------------------
  |  Branch (193:9): [True: 0, False: 85.0k]
  ------------------
  194|      0|        return SECEqual;
  195|  85.0k|    if (!a || !a->len || !a->data)
  ------------------
  |  Branch (195:9): [True: 0, False: 85.0k]
  |  Branch (195:15): [True: 0, False: 85.0k]
  |  Branch (195:26): [True: 0, False: 85.0k]
  ------------------
  196|      0|        return (!b || !b->len || !b->data) ? SECEqual : SECLessThan;
  ------------------
  |  Branch (196:17): [True: 0, False: 0]
  |  Branch (196:23): [True: 0, False: 0]
  |  Branch (196:34): [True: 0, False: 0]
  ------------------
  197|  85.0k|    if (!b || !b->len || !b->data)
  ------------------
  |  Branch (197:9): [True: 0, False: 85.0k]
  |  Branch (197:15): [True: 0, False: 85.0k]
  |  Branch (197:26): [True: 0, False: 85.0k]
  ------------------
  198|      0|        return SECGreaterThan;
  199|       |
  200|  85.0k|    m = ((a->len < b->len) ? a->len : b->len);
  ------------------
  |  Branch (200:10): [True: 492, False: 84.5k]
  ------------------
  201|       |
  202|  85.0k|    rv = PORT_Memcmp(a->data, b->data, m);
  ------------------
  |  |  179|  85.0k|#define PORT_Memcmp memcmp
  ------------------
  203|  85.0k|    if (rv) {
  ------------------
  |  Branch (203:9): [True: 74.3k, False: 10.7k]
  ------------------
  204|  74.3k|        return rv < 0 ? SECLessThan : SECGreaterThan;
  ------------------
  |  Branch (204:16): [True: 28.1k, False: 46.1k]
  ------------------
  205|  74.3k|    }
  206|  10.7k|    if (a->len < b->len) {
  ------------------
  |  Branch (206:9): [True: 21, False: 10.7k]
  ------------------
  207|     21|        return SECLessThan;
  208|     21|    }
  209|  10.7k|    if (a->len == b->len) {
  ------------------
  |  Branch (209:9): [True: 10.6k, False: 61]
  ------------------
  210|  10.6k|        return SECEqual;
  211|  10.6k|    }
  212|     61|    return SECGreaterThan;
  213|  10.7k|}
SECITEM_ItemsAreEqual_Util:
  217|  70.5k|{
  218|  70.5k|    if (a->len != b->len)
  ------------------
  |  Branch (218:9): [True: 3.62k, False: 66.8k]
  ------------------
  219|  3.62k|        return PR_FALSE;
  ------------------
  |  |  438|  3.62k|#define PR_FALSE 0
  ------------------
  220|  66.8k|    if (!a->len)
  ------------------
  |  Branch (220:9): [True: 40, False: 66.8k]
  ------------------
  221|     40|        return PR_TRUE;
  ------------------
  |  |  437|     40|#define PR_TRUE 1
  ------------------
  222|  66.8k|    if (!a->data || !b->data) {
  ------------------
  |  Branch (222:9): [True: 0, False: 66.8k]
  |  Branch (222:21): [True: 0, False: 66.8k]
  ------------------
  223|       |        /* avoid null pointer crash. */
  224|      0|        return (PRBool)(a->data == b->data);
  225|      0|    }
  226|  66.8k|    return (PRBool)!PORT_Memcmp(a->data, b->data, a->len);
  ------------------
  |  |  179|  66.8k|#define PORT_Memcmp memcmp
  ------------------
  227|  66.8k|}
SECITEM_DupItem_Util:
  231|  15.9k|{
  232|  15.9k|    return SECITEM_ArenaDupItem(NULL, from);
  ------------------
  |  |  104|  15.9k|#define SECITEM_ArenaDupItem SECITEM_ArenaDupItem_Util
  ------------------
  233|  15.9k|}
SECITEM_ArenaDupItem_Util:
  237|  17.1k|{
  238|  17.1k|    SECItem *to;
  239|       |
  240|  17.1k|    if (from == NULL) {
  ------------------
  |  Branch (240:9): [True: 0, False: 17.1k]
  ------------------
  241|      0|        return NULL;
  242|      0|    }
  243|       |
  244|  17.1k|    to = SECITEM_AllocItem(arena, NULL, from->len);
  ------------------
  |  |  103|  17.1k|#define SECITEM_AllocItem SECITEM_AllocItem_Util
  ------------------
  245|  17.1k|    if (to == NULL) {
  ------------------
  |  Branch (245:9): [True: 0, False: 17.1k]
  ------------------
  246|      0|        return NULL;
  247|      0|    }
  248|       |
  249|  17.1k|    to->type = from->type;
  250|  17.1k|    if (to->len) {
  ------------------
  |  Branch (250:9): [True: 17.0k, False: 96]
  ------------------
  251|  17.0k|        PORT_Memcpy(to->data, from->data, to->len);
  ------------------
  |  |  180|  17.0k|#define PORT_Memcpy memcpy
  ------------------
  252|  17.0k|    }
  253|       |
  254|  17.1k|    return to;
  255|  17.1k|}
SECITEM_CopyItem_Util:
  259|   119k|{
  260|   119k|    to->type = from->type;
  261|   119k|    if (from->data && from->len) {
  ------------------
  |  Branch (261:9): [True: 111k, False: 7.91k]
  |  Branch (261:23): [True: 111k, False: 4]
  ------------------
  262|   111k|        if (arena) {
  ------------------
  |  Branch (262:13): [True: 84.4k, False: 26.8k]
  ------------------
  263|  84.4k|            to->data = (unsigned char *)PORT_ArenaAlloc(arena, from->len);
  ------------------
  |  |   53|  84.4k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  264|  84.4k|        } else {
  265|  26.8k|            to->data = (unsigned char *)PORT_Alloc(from->len);
  ------------------
  |  |   52|  26.8k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  266|  26.8k|        }
  267|       |
  268|   111k|        if (!to->data) {
  ------------------
  |  Branch (268:13): [True: 0, False: 111k]
  ------------------
  269|      0|            return SECFailure;
  270|      0|        }
  271|   111k|        PORT_Memcpy(to->data, from->data, from->len);
  ------------------
  |  |  180|   111k|#define PORT_Memcpy memcpy
  ------------------
  272|   111k|        to->len = from->len;
  273|   111k|    } else {
  274|       |        /*
  275|       |         * If from->data is NULL but from->len is nonzero, this function
  276|       |         * will succeed.  Is this right?
  277|       |         */
  278|  7.92k|        to->data = 0;
  279|  7.92k|        to->len = 0;
  280|  7.92k|    }
  281|   119k|    return SECSuccess;
  282|   119k|}
SECITEM_FreeItem_Util:
  286|   233k|{
  287|   233k|    if (zap) {
  ------------------
  |  Branch (287:9): [True: 224k, False: 9.19k]
  ------------------
  288|   224k|        PORT_Free(zap->data);
  ------------------
  |  |   60|   224k|#define PORT_Free PORT_Free_Util
  ------------------
  289|   224k|        zap->data = 0;
  290|   224k|        zap->len = 0;
  291|   224k|        if (freeit) {
  ------------------
  |  Branch (291:13): [True: 28.9k, False: 195k]
  ------------------
  292|  28.9k|            PORT_Free(zap);
  ------------------
  |  |   60|  28.9k|#define PORT_Free PORT_Free_Util
  ------------------
  293|  28.9k|        }
  294|   224k|    }
  295|   233k|}
SECITEM_ZfreeItem_Util:
  299|  41.7k|{
  300|  41.7k|    if (zap) {
  ------------------
  |  Branch (300:9): [True: 41.7k, False: 0]
  ------------------
  301|  41.7k|        PORT_ZFree(zap->data, zap->len);
  ------------------
  |  |   75|  41.7k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  302|  41.7k|        zap->data = 0;
  303|  41.7k|        zap->len = 0;
  304|  41.7k|        if (freeit) {
  ------------------
  |  Branch (304:13): [True: 1.64k, False: 40.0k]
  ------------------
  305|  1.64k|            PORT_ZFree(zap, sizeof(SECItem));
  ------------------
  |  |   75|  1.64k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  306|  1.64k|        }
  307|  41.7k|    }
  308|  41.7k|}
SECITEM_Hash:
  319|  77.1k|{
  320|  77.1k|    const SECItem *item = (const SECItem *)key;
  321|  77.1k|    PLHashNumber rv = 0;
  322|       |
  323|  77.1k|    PRUint8 *data = (PRUint8 *)item->data;
  324|  77.1k|    PRUint32 i;
  325|  77.1k|    PRUint8 *rvc = (PRUint8 *)&rv;
  326|       |
  327|   623k|    for (i = 0; i < item->len; i++) {
  ------------------
  |  Branch (327:17): [True: 546k, False: 77.1k]
  ------------------
  328|   546k|        rvc[i % sizeof(rv)] ^= *data;
  329|   546k|        data++;
  330|   546k|    }
  331|       |
  332|  77.1k|    return rv;
  333|  77.1k|}
SECITEM_HashCompare:
  343|  61.6k|{
  344|  61.6k|    const SECItem *i1 = (const SECItem *)k1;
  345|  61.6k|    const SECItem *i2 = (const SECItem *)k2;
  346|       |
  347|  61.6k|    return SECITEM_ItemsAreEqual(i1, i2);
  ------------------
  |  |  109|  61.6k|#define SECITEM_ItemsAreEqual SECITEM_ItemsAreEqual_Util
  ------------------
  348|  61.6k|}
SECITEM_AllocArray:
  352|      8|{
  353|      8|    SECItemArray *result = NULL;
  354|      8|    void *mark = NULL;
  355|       |
  356|      8|    if (array != NULL && array->items != NULL) {
  ------------------
  |  Branch (356:9): [True: 8, False: 0]
  |  Branch (356:26): [True: 0, False: 8]
  ------------------
  357|      0|        PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  358|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  359|      0|        return NULL;
  360|      0|    }
  361|       |
  362|      8|    if (arena != NULL) {
  ------------------
  |  Branch (362:9): [True: 0, False: 8]
  ------------------
  363|      0|        mark = PORT_ArenaMark(arena);
  ------------------
  |  |   55|      0|#define PORT_ArenaMark PORT_ArenaMark_Util
  ------------------
  364|      0|    }
  365|       |
  366|      8|    if (array == NULL) {
  ------------------
  |  Branch (366:9): [True: 0, False: 8]
  ------------------
  367|      0|        if (arena != NULL) {
  ------------------
  |  Branch (367:13): [True: 0, False: 0]
  ------------------
  368|      0|            result = PORT_ArenaZAlloc(arena, sizeof(SECItemArray));
  ------------------
  |  |   59|      0|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  ------------------
  369|      0|        } else {
  370|      0|            result = PORT_ZAlloc(sizeof(SECItemArray));
  ------------------
  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  371|      0|        }
  372|      0|        if (result == NULL) {
  ------------------
  |  Branch (372:13): [True: 0, False: 0]
  ------------------
  373|      0|            goto loser;
  374|      0|        }
  375|      8|    } else {
  376|      8|        result = array;
  377|      8|    }
  378|       |
  379|      8|    result->len = len;
  380|      8|    if (len) {
  ------------------
  |  Branch (380:9): [True: 8, False: 0]
  ------------------
  381|      8|        if (arena != NULL) {
  ------------------
  |  Branch (381:13): [True: 0, False: 8]
  ------------------
  382|      0|            result->items = PORT_ArenaZNewArray(arena, SECItem, len);
  ------------------
  |  |  163|      0|    (type *)PORT_ArenaZAlloc(poolp, sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   59|      0|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  |  |  ------------------
  ------------------
  383|      8|        } else {
  384|      8|            result->items = PORT_ZNewArray(SECItem, len);
  ------------------
  |  |  159|      8|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|      8|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  385|      8|        }
  386|      8|        if (result->items == NULL) {
  ------------------
  |  Branch (386:13): [True: 0, False: 8]
  ------------------
  387|      0|            goto loser;
  388|      0|        }
  389|      8|    } else {
  390|      0|        result->items = NULL;
  391|      0|    }
  392|       |
  393|      8|    if (mark) {
  ------------------
  |  Branch (393:9): [True: 0, False: 8]
  ------------------
  394|      0|        PORT_ArenaUnmark(arena, mark);
  ------------------
  |  |   58|      0|#define PORT_ArenaUnmark PORT_ArenaUnmark_Util
  ------------------
  395|      0|    }
  396|      8|    return result;
  397|       |
  398|      0|loser:
  399|      0|    if (arena != NULL) {
  ------------------
  |  Branch (399:9): [True: 0, False: 0]
  ------------------
  400|      0|        if (mark) {
  ------------------
  |  Branch (400:13): [True: 0, False: 0]
  ------------------
  401|      0|            PORT_ArenaRelease(arena, mark);
  ------------------
  |  |   56|      0|#define PORT_ArenaRelease PORT_ArenaRelease_Util
  ------------------
  402|      0|        }
  403|      0|    } else {
  404|      0|        if (result != NULL && array == NULL) {
  ------------------
  |  Branch (404:13): [True: 0, False: 0]
  |  Branch (404:31): [True: 0, False: 0]
  ------------------
  405|      0|            PORT_Free(result);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  406|      0|        }
  407|      0|    }
  408|      0|    if (array != NULL) {
  ------------------
  |  Branch (408:9): [True: 0, False: 0]
  ------------------
  409|      0|        array->items = NULL;
  410|      0|        array->len = 0;
  411|      0|    }
  412|      0|    return NULL;
  413|      8|}
SECITEM_FreeArray:
  444|      8|{
  445|      8|    secitem_FreeArray(array, PR_FALSE, freeit);
  ------------------
  |  |  438|      8|#define PR_FALSE 0
  ------------------
  446|      8|}
secitem.c:secitem_FreeArray:
  417|      8|{
  418|      8|    unsigned int i;
  419|       |
  420|      8|    if (!array || !array->len || !array->items)
  ------------------
  |  Branch (420:9): [True: 0, False: 8]
  |  Branch (420:19): [True: 0, False: 8]
  |  Branch (420:34): [True: 0, False: 8]
  ------------------
  421|      0|        return;
  422|       |
  423|     16|    for (i = 0; i < array->len; ++i) {
  ------------------
  |  Branch (423:17): [True: 8, False: 8]
  ------------------
  424|      8|        SECItem *item = &array->items[i];
  425|       |
  426|      8|        if (item->data) {
  ------------------
  |  Branch (426:13): [True: 8, False: 0]
  ------------------
  427|      8|            if (zero_items) {
  ------------------
  |  Branch (427:17): [True: 0, False: 8]
  ------------------
  428|      0|                SECITEM_ZfreeItem(item, PR_FALSE);
  ------------------
  |  |  110|      0|#define SECITEM_ZfreeItem SECITEM_ZfreeItem_Util
  ------------------
                              SECITEM_ZfreeItem(item, PR_FALSE);
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  429|      8|            } else {
  430|      8|                SECITEM_FreeItem(item, PR_FALSE);
  ------------------
  |  |  108|      8|#define SECITEM_FreeItem SECITEM_FreeItem_Util
  ------------------
                              SECITEM_FreeItem(item, PR_FALSE);
  ------------------
  |  |  438|      8|#define PR_FALSE 0
  ------------------
  431|      8|            }
  432|      8|        }
  433|      8|    }
  434|      8|    PORT_Free(array->items);
  ------------------
  |  |   60|      8|#define PORT_Free PORT_Free_Util
  ------------------
  435|      8|    array->items = NULL;
  436|      8|    array->len = 0;
  437|       |
  438|      8|    if (freeit)
  ------------------
  |  Branch (438:9): [True: 0, False: 8]
  ------------------
  439|      0|        PORT_Free(array);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  440|      8|}

SECOID_Init:
 2167|      2|{
 2168|      2|    PLHashEntry *entry;
 2169|      2|    const SECOidData *oid;
 2170|      2|    SECOidTag i;
 2171|      2|    char *envVal;
 2172|       |
 2173|      2|#define NSS_VERSION_VARIABLE __nss_util_version
 2174|      2|#include "verref.h"
  ------------------
  |  |    1|       |/* This Source Code Form is subject to the terms of the Mozilla Public
  |  |    2|       | * License, v. 2.0. If a copy of the MPL was not distributed with this
  |  |    3|       | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  |  |    4|       |
  |  |    5|       |/* This header is used inline in a function to ensure that a version string
  |  |    6|       | * symbol is linked in and not optimized out. A volatile reference is added to
  |  |    7|       | * the variable identified by NSS_VERSION_VARIABLE.
  |  |    8|       | *
  |  |    9|       | * Use this as follows:
  |  |   10|       | *
  |  |   11|       | * #define NSS_VERSION_VARIABLE __nss_ssl_version
  |  |   12|       | * #include "verref.h"
  |  |   13|       | */
  |  |   14|       |
  |  |   15|       |/* Suppress unused variable warnings. */
  |  |   16|       |#ifdef _MSC_VER
  |  |   17|       |#pragma warning(push)
  |  |   18|       |#pragma warning(disable : 4101)
  |  |   19|       |#endif
  |  |   20|       |/* This works for both gcc and clang */
  |  |   21|      2|#if defined(__GNUC__) && !defined(NSS_NO_GCC48)
  |  |   22|      2|#pragma GCC diagnostic push
  |  |   23|      2|#pragma GCC diagnostic ignored "-Wunused-variable"
  |  |   24|      2|#endif
  |  |   25|       |
  |  |   26|       |#ifndef NSS_VERSION_VARIABLE
  |  |   27|       |#error NSS_VERSION_VARIABLE must be set before including "verref.h"
  |  |   28|       |#endif
  |  |   29|      2|{
  |  |   30|      2|    extern const char NSS_VERSION_VARIABLE[];
  |  |   31|      2|#if defined(__GNUC__) || defined(__clang__)
  |  |   32|      2|    __attribute__((unused))
  |  |   33|      2|#endif
  |  |   34|      2|    volatile const char _nss_version_c = NSS_VERSION_VARIABLE[0];
  |  |  ------------------
  |  |  |  | 2173|      2|#define NSS_VERSION_VARIABLE __nss_util_version
  |  |  ------------------
  |  |   35|      2|}
  |  |   36|      2|#undef NSS_VERSION_VARIABLE
  |  |   37|       |
  |  |   38|       |#ifdef _MSC_VER
  |  |   39|       |#pragma warning(pop)
  |  |   40|       |#endif
  |  |   41|      2|#if defined(__GNUC__) && !defined(NSS_NO_GCC48)
  |  |   42|      2|#pragma GCC diagnostic pop
  |  |   43|      2|#endif
  ------------------
 2175|       |
 2176|      2|    if (oidhash) {
  ------------------
  |  Branch (2176:9): [True: 1, False: 1]
  ------------------
 2177|      1|        return SECSuccess; /* already initialized */
 2178|      1|    }
 2179|       |
 2180|       |    /* xyber768d00 must be enabled explicitly */
 2181|      1|    xOids[SEC_OID_XYBER768D00].notPolicyFlags = NSS_USE_ALG_IN_SSL_KX;
  ------------------
  |  |  572|      1|#define NSS_USE_ALG_IN_SSL_KX 0x00000004           /* used in SSL key exchange */
  ------------------
 2182|       |
 2183|      1|    if (!PR_GetEnvSecure("NSS_ALLOW_WEAK_SIGNATURE_ALG")) {
  ------------------
  |  Branch (2183:9): [True: 1, False: 0]
  ------------------
 2184|       |        /* initialize any policy flags that are disabled by default */
 2185|      1|        xOids[SEC_OID_MD2].notPolicyFlags = ~NSS_USE_ALG_IN_PKCS12_DECRYPT;
  ------------------
  |  |  576|      1|#define NSS_USE_ALG_IN_PKCS12_DECRYPT 0x00000040   /* used to decrypt pkcs12 */
  ------------------
 2186|      1|        xOids[SEC_OID_MD4].notPolicyFlags = ~NSS_USE_ALG_IN_PKCS12_DECRYPT;
  ------------------
  |  |  576|      1|#define NSS_USE_ALG_IN_PKCS12_DECRYPT 0x00000040   /* used to decrypt pkcs12 */
  ------------------
 2187|      1|        xOids[SEC_OID_MD5].notPolicyFlags = ~NSS_USE_ALG_IN_PKCS12_DECRYPT;
  ------------------
  |  |  576|      1|#define NSS_USE_ALG_IN_PKCS12_DECRYPT 0x00000040   /* used to decrypt pkcs12 */
  ------------------
 2188|      1|        xOids[SEC_OID_PKCS1_MD2_WITH_RSA_ENCRYPTION].notPolicyFlags = ~0;
 2189|      1|        xOids[SEC_OID_PKCS1_MD4_WITH_RSA_ENCRYPTION].notPolicyFlags = ~0;
 2190|      1|        xOids[SEC_OID_PKCS1_MD5_WITH_RSA_ENCRYPTION].notPolicyFlags = ~0;
 2191|      1|        xOids[SEC_OID_PKCS5_PBE_WITH_MD2_AND_DES_CBC].notPolicyFlags = ~NSS_USE_ALG_IN_PKCS12_DECRYPT;
  ------------------
  |  |  576|      1|#define NSS_USE_ALG_IN_PKCS12_DECRYPT 0x00000040   /* used to decrypt pkcs12 */
  ------------------
 2192|      1|        xOids[SEC_OID_PKCS5_PBE_WITH_MD5_AND_DES_CBC].notPolicyFlags = ~NSS_USE_ALG_IN_PKCS12_DECRYPT;
  ------------------
  |  |  576|      1|#define NSS_USE_ALG_IN_PKCS12_DECRYPT 0x00000040   /* used to decrypt pkcs12 */
  ------------------
 2193|      1|    }
 2194|       |
 2195|       |    /* turn off NSS_USE_POLICY_IN_SSL by default */
 2196|      1|    xOids[SEC_OID_APPLY_SSL_POLICY].notPolicyFlags = NSS_USE_POLICY_IN_SSL;
  ------------------
  |  |  574|      1|#define NSS_USE_POLICY_IN_SSL 0x00000010           /* enable policy in SSL protocol */
  ------------------
 2197|       |    /* turn off TLS REQUIRE EMS by default */
 2198|      1|    xOids[SEC_OID_TLS_REQUIRE_EMS].notPolicyFlags = ~0;
 2199|       |
 2200|      1|    envVal = PR_GetEnvSecure("NSS_HASH_ALG_SUPPORT");
 2201|      1|    if (envVal)
  ------------------
  |  Branch (2201:9): [True: 0, False: 1]
  ------------------
 2202|      0|        handleHashAlgSupport(envVal);
 2203|       |
 2204|      1|    if (secoid_InitDynOidData() != SECSuccess) {
  ------------------
  |  Branch (2204:9): [True: 0, False: 1]
  ------------------
 2205|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2206|      0|        PORT_Assert(0); /* this function should never fail */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2207|      0|        return SECFailure;
 2208|      0|    }
 2209|       |
 2210|      1|    oidhash = PL_NewHashTable(0, SECITEM_Hash, SECITEM_HashCompare,
 2211|      1|                              PL_CompareValues, NULL, NULL);
 2212|      1|    oidmechhash = PL_NewHashTable(0, secoid_HashNumber, PL_CompareValues,
 2213|      1|                                  PL_CompareValues, NULL, NULL);
 2214|       |
 2215|      1|    if (!oidhash || !oidmechhash) {
  ------------------
  |  Branch (2215:9): [True: 0, False: 1]
  |  Branch (2215:21): [True: 0, False: 1]
  ------------------
 2216|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2217|      0|        PORT_Assert(0); /*This function should never fail. */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2218|      0|        return (SECFailure);
 2219|      0|    }
 2220|       |
 2221|    392|    for (i = 0; i < SEC_OID_TOTAL; i++) {
  ------------------
  |  Branch (2221:17): [True: 391, False: 1]
  ------------------
 2222|    391|        oid = &oids[i];
 2223|    391|        PORT_Assert(oid->offset == i);
  ------------------
  |  |  120|    391|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    391|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 391, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2224|    391|        entry = PL_HashTableAdd(oidhash, &oid->oid, (void *)oid);
 2225|       |
 2226|    391|        if (entry == NULL) {
  ------------------
  |  Branch (2226:13): [True: 0, False: 391]
  ------------------
 2227|      0|            PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2228|      0|            PORT_Assert(0); /*This function should never fail. */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2229|      0|            return (SECFailure);
 2230|      0|        }
 2231|       |
 2232|    391|        if (oid->mechanism != CKM_INVALID_MECHANISM) {
  ------------------
  |  |  155|    391|#define CKM_INVALID_MECHANISM 0xffffffffUL
  ------------------
  |  Branch (2232:13): [True: 108, False: 283]
  ------------------
 2233|    108|            entry = PL_HashTableAdd(oidmechhash,
 2234|    108|                                    (void *)(uintptr_t)oid->mechanism, (void *)oid);
 2235|    108|            if (entry == NULL) {
  ------------------
  |  Branch (2235:17): [True: 0, False: 108]
  ------------------
 2236|      0|                PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2237|      0|                PORT_Assert(0); /* This function should never fail. */
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2238|      0|                return (SECFailure);
 2239|      0|            }
 2240|    108|        }
 2241|    391|    }
 2242|       |
 2243|      1|    PORT_Assert(i == SEC_OID_TOTAL);
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      1|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2244|       |    /* finally, clear S/MIME from the policy oids. If no one turns on any
 2245|       |     * S/MIME policies after this, then S/MIME will enable the traditional
 2246|       |     * algs when it initializes */
 2247|      1|    (void)NSS_SetAlgorithmPolicyAll(0, NSS_USE_ALG_IN_SMIME);
  ------------------
  |  |  597|      1|#define NSS_USE_ALG_IN_SMIME (NSS_USE_ALG_IN_SMIME_LEGACY | \
  |  |  ------------------
  |  |  |  |  578|      1|#define NSS_USE_ALG_IN_SMIME_LEGACY 0x00000100     /* used to decrypt smime */
  |  |  ------------------
  |  |  598|      1|                              NSS_USE_ALG_IN_SMIME_ENCRYPT)
  |  |  ------------------
  |  |  |  |  579|      1|#define NSS_USE_ALG_IN_SMIME_ENCRYPT 0x00000200    /* used to decrypt smime */
  |  |  ------------------
  ------------------
 2248|       |
 2249|      1|    return (SECSuccess);
 2250|      1|}
SECOID_FindOIDByMechanism:
 2254|    992|{
 2255|    992|    SECOidData *ret;
 2256|       |
 2257|    992|    PR_ASSERT(oidmechhash != NULL);
  ------------------
  |  |  208|    992|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 992, False: 0]
  |  |  ------------------
  ------------------
 2258|    992|    if (oidmechhash == NULL && SECOID_Init() != SECSuccess) {
  ------------------
  |  Branch (2258:9): [True: 0, False: 992]
  |  Branch (2258:32): [True: 0, False: 0]
  ------------------
 2259|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2260|      0|        return NULL;
 2261|      0|    }
 2262|       |
 2263|    992|    ret = PL_HashTableLookupConst(oidmechhash, (void *)(uintptr_t)mechanism);
 2264|    992|    if (ret == NULL) {
  ------------------
  |  Branch (2264:9): [True: 0, False: 992]
  ------------------
 2265|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2266|      0|    }
 2267|       |
 2268|    992|    return (ret);
 2269|    992|}
SECOID_FindOID_Util:
 2273|  76.7k|{
 2274|  76.7k|    SECOidData *ret;
 2275|       |
 2276|  76.7k|    PR_ASSERT(oidhash != NULL);
  ------------------
  |  |  208|  76.7k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  ------------------
  |  |  |  Branch (208:6): [True: 76.7k, False: 0]
  |  |  ------------------
  ------------------
 2277|  76.7k|    if (oidhash == NULL && SECOID_Init() != SECSuccess) {
  ------------------
  |  Branch (2277:9): [True: 0, False: 76.7k]
  |  Branch (2277:28): [True: 0, False: 0]
  ------------------
 2278|      0|        PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2279|      0|        return NULL;
 2280|      0|    }
 2281|       |
 2282|  76.7k|    if ((oid == NULL) || (oid->data == NULL)) {
  ------------------
  |  Branch (2282:9): [True: 0, False: 76.7k]
  |  Branch (2282:26): [True: 0, False: 76.7k]
  ------------------
 2283|      0|        PORT_SetError(SEC_ERROR_UNRECOGNIZED_OID);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2284|      0|        return NULL;
 2285|      0|    }
 2286|       |
 2287|  76.7k|    ret = PL_HashTableLookupConst(oidhash, oid);
 2288|  76.7k|    if (ret == NULL) {
  ------------------
  |  Branch (2288:9): [True: 15.3k, False: 61.4k]
  ------------------
 2289|  15.3k|        ret = secoid_FindDynamic(oid);
 2290|  15.3k|        if (ret == NULL) {
  ------------------
  |  Branch (2290:13): [True: 15.3k, False: 0]
  ------------------
 2291|  15.3k|            PORT_SetError(SEC_ERROR_UNRECOGNIZED_OID);
  ------------------
  |  |   65|  15.3k|#define PORT_SetError PORT_SetError_Util
  ------------------
 2292|  15.3k|        }
 2293|  15.3k|    }
 2294|  76.7k|    return (ret);
 2295|  76.7k|}
SECOID_FindOIDTag_Util:
 2299|  49.8k|{
 2300|  49.8k|    SECOidData *oiddata;
 2301|       |
 2302|  49.8k|    oiddata = SECOID_FindOID(oid);
  ------------------
  |  |  115|  49.8k|#define SECOID_FindOID SECOID_FindOID_Util
  ------------------
 2303|  49.8k|    if (oiddata == NULL) {
  ------------------
  |  Branch (2303:9): [True: 297, False: 49.5k]
  ------------------
 2304|    297|        return SEC_OID_UNKNOWN;
 2305|    297|    }
 2306|       |
 2307|  49.5k|    return oiddata->offset;
 2308|  49.8k|}
SECOID_FindOIDByTag_Util:
 2313|  88.1k|{
 2314|  88.1k|    if (tagnum >= SEC_OID_TOTAL) {
  ------------------
  |  Branch (2314:9): [True: 0, False: 88.1k]
  ------------------
 2315|      0|        return (SECOidData *)secoid_FindDynamicByTag(tagnum);
 2316|      0|    }
 2317|       |
 2318|  88.1k|    PORT_Assert((unsigned int)tagnum < SEC_OID_TOTAL);
  ------------------
  |  |  120|  88.1k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  88.1k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 88.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2319|  88.1k|    return (SECOidData *)(&oids[tagnum]);
 2320|  88.1k|}
SECOID_KnownCertExtenOID:
 2324|     53|{
 2325|     53|    SECOidData *oidData;
 2326|       |
 2327|     53|    oidData = SECOID_FindOID(extenOid);
  ------------------
  |  |  115|     53|#define SECOID_FindOID SECOID_FindOID_Util
  ------------------
 2328|     53|    if (oidData == (SECOidData *)NULL)
  ------------------
  |  Branch (2328:9): [True: 5, False: 48]
  ------------------
 2329|      5|        return (PR_FALSE);
  ------------------
  |  |  438|      5|#define PR_FALSE 0
  ------------------
 2330|     48|    return ((oidData->supportedExtension == SUPPORTED_CERT_EXTENSION) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  437|     47|#define PR_TRUE 1
  ------------------
                  return ((oidData->supportedExtension == SUPPORTED_CERT_EXTENSION) ? PR_TRUE : PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  |  Branch (2330:13): [True: 47, False: 1]
  ------------------
 2331|     53|}
SECOID_GetTotalTags:
 2347|      1|{
 2348|      1|    SECOidTag total;
 2349|       |
 2350|       |    /* get the lock to make sure we don't catch and inconsistant value
 2351|       |     * for dynOidEntriesUsed. */
 2352|      1|    NSSRWLock_LockRead(dynOidLock);
  ------------------
  |  |   47|      1|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  ------------------
 2353|      1|    total = SEC_OID_TOTAL + dynOidEntriesUsed;
 2354|      1|    NSSRWLock_UnlockRead(dynOidLock);
  ------------------
  |  |   50|      1|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  ------------------
 2355|      1|    return total;
 2356|      1|}
NSS_GetAlgorithmPolicy:
 2383|   824k|{
 2384|   824k|    privXOid *pxo = secoid_FindXOidByTag(tag);
 2385|   824k|    if (!pxo)
  ------------------
  |  Branch (2385:9): [True: 0, False: 824k]
  ------------------
 2386|      0|        return SECFailure;
 2387|   824k|    if (!pValue) {
  ------------------
  |  Branch (2387:9): [True: 0, False: 824k]
  ------------------
 2388|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2389|      0|        return SECFailure;
 2390|      0|    }
 2391|   824k|    *pValue = ~(pxo->notPolicyFlags);
 2392|   824k|    return SECSuccess;
 2393|   824k|}
NSS_SetAlgorithmPolicy:
 2403|    391|{
 2404|    391|    privXOid *pxo = secoid_FindXOidByTag(tag);
 2405|    391|    PRUint32 policyFlags;
 2406|    391|    if (!pxo)
  ------------------
  |  Branch (2406:9): [True: 0, False: 391]
  ------------------
 2407|      0|        return SECFailure;
 2408|       |
 2409|    391|    if (nss_policy_locked) {
  ------------------
  |  Branch (2409:9): [True: 0, False: 391]
  ------------------
 2410|      0|        PORT_SetError(SEC_ERROR_POLICY_LOCKED);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
 2411|      0|        return SECFailure;
 2412|      0|    }
 2413|       |    /* The stored policy flags are the ones complement of the flags as
 2414|       |     * seen by the user.  This is not atomic, but these changes should
 2415|       |     * be done rarely, e.g. at initialization time.
 2416|       |     */
 2417|    391|    policyFlags = ~(pxo->notPolicyFlags);
 2418|    391|    policyFlags = (policyFlags & ~clearBits) | setBits;
 2419|    391|    pxo->notPolicyFlags = ~policyFlags;
 2420|    391|    return SECSuccess;
 2421|    391|}
NSS_SetAlgorithmPolicyAll:
 2426|      1|{
 2427|      1|    SECOidTag tag;
 2428|       |    /* call this once,not once per loop */
 2429|      1|    SECOidTag lastTag = SECOID_GetTotalTags();
 2430|       |
 2431|    392|    for (tag = SEC_OID_UNKNOWN; tag < lastTag; tag++) {
  ------------------
  |  Branch (2431:33): [True: 391, False: 1]
  ------------------
 2432|    391|        SECStatus rv = NSS_SetAlgorithmPolicy(tag, setBits, clearBits);
 2433|       |        /* there are only 2 reasons SetAlgorithmPolicy can fail:
 2434|       |         *  1) we passed an invalid tag, or 2) policy is locked.
 2435|       |         *  The first case should not happen because we are only looping
 2436|       |         *  through known good tags. In the second case, we will always fail,
 2437|       |         *  so there is no point continuing our loop */
 2438|    391|        if (rv != SECSuccess) {
  ------------------
  |  Branch (2438:13): [True: 0, False: 391]
  ------------------
 2439|      0|            return rv;
 2440|      0|        }
 2441|    391|    }
 2442|      1|    return SECSuccess;
 2443|      1|}
SECOID_Shutdown:
 2521|      2|{
 2522|      2|    if (oidhash) {
  ------------------
  |  Branch (2522:9): [True: 1, False: 1]
  ------------------
 2523|      1|        PL_HashTableDestroy(oidhash);
 2524|      1|        oidhash = NULL;
 2525|      1|    }
 2526|      2|    if (oidmechhash) {
  ------------------
  |  Branch (2526:9): [True: 1, False: 1]
  ------------------
 2527|      1|        PL_HashTableDestroy(oidmechhash);
 2528|      1|        oidmechhash = NULL;
 2529|      1|    }
 2530|       |    /* Have to handle the case where the lock was created, but
 2531|       |    ** the pool wasn't.
 2532|       |    ** I'm not going to attempt to create the lock, just to protect
 2533|       |    ** the destruction of data that probably isn't initialized anyway.
 2534|       |    */
 2535|      2|    if (dynOidLock) {
  ------------------
  |  Branch (2535:9): [True: 1, False: 1]
  ------------------
 2536|      1|        SKIP_AFTER_FORK(NSSRWLock_LockWrite(dynOidLock));
  ------------------
  |  | 2513|      1|    if (!parentForkedAfterC_Initialize) \
  |  |  ------------------
  |  |  |  Branch (2513:9): [True: 1, False: 0]
  |  |  ------------------
  |  | 2514|      1|    x
  ------------------
 2537|      1|        if (dynOidHash) {
  ------------------
  |  Branch (2537:13): [True: 0, False: 1]
  ------------------
 2538|      0|            PL_HashTableDestroy(dynOidHash);
 2539|      0|            dynOidHash = NULL;
 2540|      0|        }
 2541|      1|        if (dynOidPool) {
  ------------------
  |  Branch (2541:13): [True: 1, False: 0]
  ------------------
 2542|      1|            PORT_FreeArena(dynOidPool, PR_FALSE);
  ------------------
  |  |   61|      1|#define PORT_FreeArena PORT_FreeArena_Util
  ------------------
                          PORT_FreeArena(dynOidPool, PR_FALSE);
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
 2543|      1|            dynOidPool = NULL;
 2544|      1|        }
 2545|      1|        if (dynOidTable) {
  ------------------
  |  Branch (2545:13): [True: 0, False: 1]
  ------------------
 2546|      0|            PORT_Free(dynOidTable);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
 2547|      0|            dynOidTable = NULL;
 2548|      0|        }
 2549|      1|        dynOidEntriesAllocated = 0;
 2550|      1|        dynOidEntriesUsed = 0;
 2551|       |
 2552|      1|        SKIP_AFTER_FORK(NSSRWLock_UnlockWrite(dynOidLock));
  ------------------
  |  | 2513|      1|    if (!parentForkedAfterC_Initialize) \
  |  |  ------------------
  |  |  |  Branch (2513:9): [True: 1, False: 0]
  |  |  ------------------
  |  | 2514|      1|    x
  ------------------
 2553|      1|        SKIP_AFTER_FORK(NSSRWLock_Destroy(dynOidLock));
  ------------------
  |  | 2513|      1|    if (!parentForkedAfterC_Initialize) \
  |  |  ------------------
  |  |  |  Branch (2513:9): [True: 1, False: 0]
  |  |  ------------------
  |  | 2514|      1|    x
  ------------------
 2554|      1|        dynOidLock = NULL;
 2555|      1|    } else {
 2556|       |        /* Since dynOidLock doesn't exist, then all the data it protects
 2557|       |        ** should be uninitialized.  We'll check that (in DEBUG builds),
 2558|       |        ** and then make sure it is so, in case NSS is reinitialized.
 2559|       |        */
 2560|      1|        PORT_Assert(!dynOidHash && !dynOidPool && !dynOidTable &&
  ------------------
  |  |  120|      1|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      8|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2561|      1|                    !dynOidEntriesAllocated && !dynOidEntriesUsed);
 2562|      1|        dynOidHash = NULL;
 2563|      1|        dynOidPool = NULL;
 2564|      1|        dynOidTable = NULL;
 2565|      1|        dynOidEntriesAllocated = 0;
 2566|      1|        dynOidEntriesUsed = 0;
 2567|      1|    }
 2568|       |    /* we are trashing the old policy state now, also reenable changing
 2569|       |     * the policy as well */
 2570|      2|    nss_policy_locked = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 2571|      2|    memset(xOids, 0, sizeof xOids);
 2572|      2|    return SECSuccess;
 2573|      2|}
UTIL_SetForkState:
 2577|      2|{
 2578|      2|    parentForkedAfterC_Initialize = forked;
 2579|      2|}
secoid.c:secoid_InitDynOidData:
 1949|      1|{
 1950|      1|    SECStatus rv = SECSuccess;
 1951|       |
 1952|      1|    dynOidLock = NSSRWLock_New(1, "dynamic OID data");
  ------------------
  |  |   49|      1|#define NSSRWLock_New NSSRWLock_New_Util
  ------------------
 1953|      1|    if (!dynOidLock) {
  ------------------
  |  Branch (1953:9): [True: 0, False: 1]
  ------------------
 1954|      0|        return SECFailure; /* Error code should already be set. */
 1955|      0|    }
 1956|      1|    dynOidPool = PORT_NewArena(2048);
  ------------------
  |  |   63|      1|#define PORT_NewArena PORT_NewArena_Util
  ------------------
 1957|      1|    if (!dynOidPool) {
  ------------------
  |  Branch (1957:9): [True: 0, False: 1]
  ------------------
 1958|      0|        rv = SECFailure /* Error code should already be set. */;
 1959|      0|    }
 1960|      1|    return rv;
 1961|      1|}
secoid.c:secoid_HashNumber:
 2128|  1.10k|{
 2129|  1.10k|    return (PLHashNumber)((char *)key - (char *)NULL);
 2130|  1.10k|}
secoid.c:secoid_FindDynamic:
 1988|  15.3k|{
 1989|  15.3k|    SECOidData *ret = NULL;
 1990|       |
 1991|  15.3k|    NSSRWLock_LockRead(dynOidLock);
  ------------------
  |  |   47|  15.3k|#define NSSRWLock_LockRead NSSRWLock_LockRead_Util
  ------------------
 1992|  15.3k|    if (dynOidHash) {
  ------------------
  |  Branch (1992:9): [True: 0, False: 15.3k]
  ------------------
 1993|      0|        ret = (SECOidData *)PL_HashTableLookup(dynOidHash, key);
 1994|      0|    }
 1995|  15.3k|    NSSRWLock_UnlockRead(dynOidLock);
  ------------------
  |  |   50|  15.3k|#define NSSRWLock_UnlockRead NSSRWLock_UnlockRead_Util
  ------------------
 1996|  15.3k|    if (ret == NULL) {
  ------------------
  |  Branch (1996:9): [True: 15.3k, False: 0]
  ------------------
 1997|  15.3k|        PORT_SetError(SEC_ERROR_UNRECOGNIZED_OID);
  ------------------
  |  |   65|  15.3k|#define PORT_SetError PORT_SetError_Util
  ------------------
 1998|  15.3k|    }
 1999|  15.3k|    return ret;
 2000|  15.3k|}
secoid.c:secoid_FindXOidByTag:
 2366|   824k|{
 2367|   824k|    if (tagnum >= SEC_OID_TOTAL) {
  ------------------
  |  Branch (2367:9): [True: 0, False: 824k]
  ------------------
 2368|      0|        dynXOid *dxo = secoid_FindDynamicByTag(tagnum);
 2369|      0|        return (dxo ? &dxo->priv : NULL);
  ------------------
  |  Branch (2369:17): [True: 0, False: 0]
  ------------------
 2370|      0|    }
 2371|       |
 2372|   824k|    PORT_Assert((unsigned int)tagnum < SEC_OID_TOTAL);
  ------------------
  |  |  120|   824k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|   824k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 824k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2373|   824k|    return &xOids[tagnum];
 2374|   824k|}

PORT_Alloc_Util:
   82|   713k|{
   83|   713k|    void *rv = NULL;
   84|       |
   85|   713k|    if (bytes <= MAX_SIZE) {
  ------------------
  |  |   78|   713k|#define MAX_SIZE (PR_UINT32_MAX >> 1)
  |  |  ------------------
  |  |  |  |  302|   713k|#define PR_UINT32_MAX PR_UINT32(4294967295)
  |  |  |  |  ------------------
  |  |  |  |  |  |  282|   713k|#define PR_UINT32(x) x ## U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (85:9): [True: 713k, False: 0]
  ------------------
   86|       |        /* Always allocate a non-zero amount of bytes */
   87|   713k|        rv = PR_Malloc(bytes ? bytes : 1);
  ------------------
  |  Branch (87:24): [True: 712k, False: 408]
  ------------------
   88|   713k|    }
   89|   713k|    if (!rv) {
  ------------------
  |  Branch (89:9): [True: 0, False: 713k]
  ------------------
   90|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
   91|      0|    }
   92|   713k|    return rv;
   93|   713k|}
PORT_Realloc_Util:
   97|  1.05k|{
   98|  1.05k|    void *rv = NULL;
   99|       |
  100|  1.05k|    if (bytes <= MAX_SIZE) {
  ------------------
  |  |   78|  1.05k|#define MAX_SIZE (PR_UINT32_MAX >> 1)
  |  |  ------------------
  |  |  |  |  302|  1.05k|#define PR_UINT32_MAX PR_UINT32(4294967295)
  |  |  |  |  ------------------
  |  |  |  |  |  |  282|  1.05k|#define PR_UINT32(x) x ## U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (100:9): [True: 1.05k, False: 0]
  ------------------
  101|  1.05k|        rv = PR_Realloc(oldptr, bytes);
  102|  1.05k|    }
  103|  1.05k|    if (!rv) {
  ------------------
  |  Branch (103:9): [True: 0, False: 1.05k]
  ------------------
  104|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  105|      0|    }
  106|  1.05k|    return rv;
  107|  1.05k|}
PORT_ZAlloc_Util:
  111|   443k|{
  112|   443k|    void *rv = NULL;
  113|       |
  114|   443k|    if (bytes <= MAX_SIZE) {
  ------------------
  |  |   78|   443k|#define MAX_SIZE (PR_UINT32_MAX >> 1)
  |  |  ------------------
  |  |  |  |  302|   443k|#define PR_UINT32_MAX PR_UINT32(4294967295)
  |  |  |  |  ------------------
  |  |  |  |  |  |  282|   443k|#define PR_UINT32(x) x ## U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (114:9): [True: 443k, False: 0]
  ------------------
  115|       |        /* Always allocate a non-zero amount of bytes */
  116|   443k|        rv = PR_Calloc(1, bytes ? bytes : 1);
  ------------------
  |  Branch (116:27): [True: 443k, False: 0]
  ------------------
  117|   443k|    }
  118|   443k|    if (!rv) {
  ------------------
  |  Branch (118:9): [True: 0, False: 443k]
  ------------------
  119|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  120|      0|    }
  121|   443k|    return rv;
  122|   443k|}
PORT_ZAllocAligned_Util:
  127|  3.00k|{
  128|  3.00k|    size_t x = alignment - 1;
  129|       |
  130|       |    /* This only works if alignment is a power of 2. */
  131|  3.00k|    if ((alignment == 0) || (alignment & (alignment - 1))) {
  ------------------
  |  Branch (131:9): [True: 0, False: 3.00k]
  |  Branch (131:29): [True: 0, False: 3.00k]
  ------------------
  132|      0|        PORT_SetError(SEC_ERROR_INVALID_ARGS);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  133|      0|        return NULL;
  134|      0|    }
  135|       |
  136|  3.00k|    if (!mem) {
  ------------------
  |  Branch (136:9): [True: 0, False: 3.00k]
  ------------------
  137|      0|        return NULL;
  138|      0|    }
  139|       |
  140|       |    /* Always allocate a non-zero amount of bytes */
  141|  3.00k|    *mem = PORT_ZAlloc((bytes ? bytes : 1) + x);
  ------------------
  |  |   72|  3.00k|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  |  Branch (141:25): [True: 3.00k, False: 0]
  ------------------
  142|  3.00k|    if (!*mem) {
  ------------------
  |  Branch (142:9): [True: 0, False: 3.00k]
  ------------------
  143|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  144|      0|        return NULL;
  145|      0|    }
  146|       |
  147|  3.00k|    return (void *)(((uintptr_t)*mem + x) & ~(uintptr_t)x);
  148|  3.00k|}
PORT_ZAllocAlignedOffset_Util:
  152|  3.00k|{
  153|  3.00k|    PORT_Assert(offset < size);
  ------------------
  |  |  120|  3.00k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.00k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.00k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  154|  3.00k|    if (offset > size) {
  ------------------
  |  Branch (154:9): [True: 0, False: 3.00k]
  ------------------
  155|      0|        return NULL;
  156|      0|    }
  157|       |
  158|  3.00k|    void *mem = NULL;
  159|  3.00k|    void *v = PORT_ZAllocAligned(size, alignment, &mem);
  ------------------
  |  |   73|  3.00k|#define PORT_ZAllocAligned PORT_ZAllocAligned_Util
  ------------------
  160|  3.00k|    if (!v) {
  ------------------
  |  Branch (160:9): [True: 0, False: 3.00k]
  ------------------
  161|      0|        return NULL;
  162|      0|    }
  163|       |
  164|  3.00k|    PORT_Assert(mem);
  ------------------
  |  |  120|  3.00k|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|  3.00k|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 3.00k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  165|  3.00k|    *((void **)((uintptr_t)v + offset)) = mem;
  166|  3.00k|    return v;
  167|  3.00k|}
PORT_Free_Util:
  171|  1.28M|{
  172|  1.28M|    if (ptr) {
  ------------------
  |  Branch (172:9): [True: 905k, False: 375k]
  ------------------
  173|   905k|        PR_Free(ptr);
  174|   905k|    }
  175|  1.28M|}
PORT_ZFree_Util:
  179|   268k|{
  180|   268k|    if (ptr) {
  ------------------
  |  Branch (180:9): [True: 251k, False: 17.4k]
  ------------------
  181|   251k|        memset(ptr, 0, len);
  182|   251k|        PR_Free(ptr);
  183|   251k|    }
  184|   268k|}
PORT_Strdup_Util:
  188|  34.4k|{
  189|  34.4k|    size_t len = PORT_Strlen(str) + 1;
  ------------------
  |  |  190|  34.4k|#define PORT_Strlen(s) strlen(s)
  ------------------
  190|  34.4k|    char *newstr;
  191|       |
  192|  34.4k|    newstr = (char *)PORT_Alloc(len);
  ------------------
  |  |   52|  34.4k|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  193|  34.4k|    if (newstr) {
  ------------------
  |  Branch (193:9): [True: 34.4k, False: 0]
  ------------------
  194|  34.4k|        PORT_Memcpy(newstr, str, len);
  ------------------
  |  |  180|  34.4k|#define PORT_Memcpy memcpy
  ------------------
  195|  34.4k|    }
  196|  34.4k|    return newstr;
  197|  34.4k|}
PORT_SetError_Util:
  201|   194k|{
  202|   194k|    PR_SetError(value, 0);
  203|   194k|    return;
  204|   194k|}
PORT_GetError_Util:
  208|  20.7k|{
  209|  20.7k|    return (PR_GetError());
  210|  20.7k|}
PORT_SafeZero:
  214|  14.4k|{
  215|       |    /* there are cases where the compiler optimizes away our attempt to clear
  216|       |     * out our stack variables. There are multiple solutions for this problem,
  217|       |     * but they aren't universally accepted on all platforms. This attempts
  218|       |     * to select the best solution available given our os, compilier, and
  219|       |     * libc */
  220|       |#ifdef __STDC_LIB_EXT1__
  221|       |    /* if the os implements C11 annex K, use memset_s */
  222|       |    memset_s(p, n, 0, n);
  223|       |#else
  224|       |    /* _DEFAULT_SORUCE  == BSD source in GCC based environments
  225|       |     * if other environmens support explicit_bzero, their defines
  226|       |     * should be added here */
  227|  14.4k|#if (defined(_DEFAULT_SOURCE) || defined(_BSD_SOURCE)) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 25))
  228|  14.4k|    explicit_bzero(p, n);
  229|       |#else
  230|       |#ifdef XP_WIN
  231|       |    /* windows has a secure zero funtion */
  232|       |    SecureZeroMemory(p, n);
  233|       |#else
  234|       |    /* if the os doesn't support one of the above, but does support
  235|       |     * memset_explicit, you can add the definition for memset with the
  236|       |     * appropriate define check here */
  237|       |    /* define an explicitly implementated Safe zero if the OS
  238|       |     * doesn't provide one */
  239|       |    if (p != NULL) {
  240|       |        volatile unsigned char *__vl = (unsigned char *)p;
  241|       |        size_t __nl = n;
  242|       |        while (__nl--)
  243|       |            *__vl++ = 0;
  244|       |    }
  245|       |#endif /* no windows SecureZeroMemory */
  246|       |#endif /* no explicit_bzero */
  247|  14.4k|#endif /* no memset_s */
  248|  14.4k|}
PORT_NewArena_Util:
  300|  95.0k|{
  301|  95.0k|    PORTArenaPool *pool;
  302|       |
  303|  95.0k|    if (chunksize > MAX_SIZE) {
  ------------------
  |  |   78|  95.0k|#define MAX_SIZE (PR_UINT32_MAX >> 1)
  |  |  ------------------
  |  |  |  |  302|  95.0k|#define PR_UINT32_MAX PR_UINT32(4294967295)
  |  |  |  |  ------------------
  |  |  |  |  |  |  282|  95.0k|#define PR_UINT32(x) x ## U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (303:9): [True: 0, False: 95.0k]
  ------------------
  304|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  305|      0|        return NULL;
  306|      0|    }
  307|  95.0k|    pool = PORT_ZNew(PORTArenaPool);
  ------------------
  |  |  148|  95.0k|#define PORT_ZNew(type) (type *)PORT_ZAlloc(sizeof(type))
  |  |  ------------------
  |  |  |  |   72|  95.0k|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  308|  95.0k|    if (!pool) {
  ------------------
  |  Branch (308:9): [True: 0, False: 95.0k]
  ------------------
  309|      0|        return NULL;
  310|      0|    }
  311|  95.0k|    pool->magic = ARENAPOOL_MAGIC;
  ------------------
  |  |   51|  95.0k|#define ARENAPOOL_MAGIC 0xB8AC9BDF
  ------------------
  312|  95.0k|    pool->lock = PZ_NewLock(nssILockArena);
  ------------------
  |  |  243|  95.0k|#define PZ_NewLock(t) PR_NewLock()
  ------------------
  313|  95.0k|    if (!pool->lock) {
  ------------------
  |  Branch (313:9): [True: 0, False: 95.0k]
  ------------------
  314|      0|        PORT_Free(pool);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  315|      0|        return NULL;
  316|      0|    }
  317|  95.0k|    PL_InitArenaPool(&pool->arena, "security", chunksize, sizeof(double));
  318|  95.0k|    return (&pool->arena);
  319|  95.0k|}
PORT_InitCheapArena:
  323|  60.7k|{
  324|  60.7k|    pool->magic = CHEAP_ARENAPOOL_MAGIC;
  ------------------
  |  |   53|  60.7k|#define CHEAP_ARENAPOOL_MAGIC 0x3F16BB09
  ------------------
  325|  60.7k|    PL_InitArenaPool(&pool->arena, "security", chunksize, sizeof(double));
  326|  60.7k|}
PORT_ArenaAlloc_Util:
  330|   417k|{
  331|   417k|    void *p = NULL;
  332|       |
  333|   417k|    PORTArenaPool *pool = (PORTArenaPool *)arena;
  334|       |
  335|   417k|    if (size <= 0) {
  ------------------
  |  Branch (335:9): [True: 24, False: 417k]
  ------------------
  336|     24|        size = 1;
  337|     24|    }
  338|       |
  339|   417k|    if (size > MAX_SIZE) {
  ------------------
  |  |   78|   417k|#define MAX_SIZE (PR_UINT32_MAX >> 1)
  |  |  ------------------
  |  |  |  |  302|   417k|#define PR_UINT32_MAX PR_UINT32(4294967295)
  |  |  |  |  ------------------
  |  |  |  |  |  |  282|   417k|#define PR_UINT32(x) x ## U
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (339:9): [True: 0, False: 417k]
  ------------------
  340|       |        /* you lose. */
  341|      0|    } else
  342|       |        /* Is it one of ours?  Assume so and check the magic */
  343|   417k|        if (ARENAPOOL_MAGIC == pool->magic) {
  ------------------
  |  |   51|   417k|#define ARENAPOOL_MAGIC 0xB8AC9BDF
  ------------------
  |  Branch (343:13): [True: 406k, False: 10.7k]
  ------------------
  344|   406k|            PZ_Lock(pool->lock);
  ------------------
  |  |  245|   406k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  345|   406k|#ifdef THREADMARK
  346|       |            /* Most likely one of ours.  Is there a thread id? */
  347|   406k|            if (pool->marking_thread &&
  ------------------
  |  Branch (347:17): [True: 150k, False: 255k]
  ------------------
  348|   406k|                pool->marking_thread != PR_GetCurrentThread()) {
  ------------------
  |  Branch (348:17): [True: 0, False: 150k]
  ------------------
  349|       |                /* Another thread holds a mark in this arena */
  350|      0|                PZ_Unlock(pool->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  351|      0|                PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  352|      0|                PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  353|      0|                return NULL;
  354|      0|            } /* tid != null */
  355|   406k|#endif        /* THREADMARK */
  356|   406k|            PL_ARENA_ALLOCATE(p, arena, size);
  ------------------
  |  |  150|   813k|    PR_BEGIN_MACRO \
  |  |  ------------------
  |  |  |  |  123|   406k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  151|   813k|        PLArena *_a = (pool)->current; \
  |  |  152|   813k|        PRUint32 _nb = PL_ARENA_ALIGN(pool, (PRUint32)nb); \
  |  |  ------------------
  |  |  |  |  146|   406k|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  |  |  ------------------
  |  |  153|   813k|        PRUword _p = _a->avail; \
  |  |  154|   813k|        if (_nb < (PRUint32)nb) { \
  |  |  ------------------
  |  |  |  Branch (154:13): [True: 0, False: 406k]
  |  |  ------------------
  |  |  155|      0|            _p = 0; \
  |  |  156|   406k|        } else if (_nb > (_a->limit - _a->avail)) { \
  |  |  ------------------
  |  |  |  Branch (156:20): [True: 82.4k, False: 324k]
  |  |  ------------------
  |  |  157|  82.4k|            _p = (PRUword)PL_ArenaAllocate(pool, _nb); \
  |  |  158|   324k|        } else { \
  |  |  159|   324k|            _a->avail += _nb; \
  |  |  160|   324k|        } \
  |  |  161|   813k|        p = (void *)_p; \
  |  |  162|   813k|        if (p) { \
  |  |  ------------------
  |  |  |  Branch (162:13): [True: 406k, False: 0]
  |  |  ------------------
  |  |  163|   406k|            PL_MAKE_MEM_UNDEFINED(p, (PRUint32)nb); \
  |  |  164|   406k|            PL_ArenaCountAllocation(pool, (PRUint32)nb); \
  |  |  165|   406k|        } \
  |  |  166|   813k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|   406k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  357|   406k|            PZ_Unlock(pool->lock);
  ------------------
  |  |  246|   406k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  358|   406k|        } else {
  359|  10.7k|            PL_ARENA_ALLOCATE(p, arena, size);
  ------------------
  |  |  150|  10.7k|    PR_BEGIN_MACRO \
  |  |  ------------------
  |  |  |  |  123|  10.7k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  151|  10.7k|        PLArena *_a = (pool)->current; \
  |  |  152|  10.7k|        PRUint32 _nb = PL_ARENA_ALIGN(pool, (PRUint32)nb); \
  |  |  ------------------
  |  |  |  |  146|  10.7k|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  |  |  ------------------
  |  |  153|  10.7k|        PRUword _p = _a->avail; \
  |  |  154|  10.7k|        if (_nb < (PRUint32)nb) { \
  |  |  ------------------
  |  |  |  Branch (154:13): [True: 0, False: 10.7k]
  |  |  ------------------
  |  |  155|      0|            _p = 0; \
  |  |  156|  10.7k|        } else if (_nb > (_a->limit - _a->avail)) { \
  |  |  ------------------
  |  |  |  Branch (156:20): [True: 7.59k, False: 3.11k]
  |  |  ------------------
  |  |  157|  7.59k|            _p = (PRUword)PL_ArenaAllocate(pool, _nb); \
  |  |  158|  7.59k|        } else { \
  |  |  159|  3.11k|            _a->avail += _nb; \
  |  |  160|  3.11k|        } \
  |  |  161|  10.7k|        p = (void *)_p; \
  |  |  162|  10.7k|        if (p) { \
  |  |  ------------------
  |  |  |  Branch (162:13): [True: 10.7k, False: 0]
  |  |  ------------------
  |  |  163|  10.7k|            PL_MAKE_MEM_UNDEFINED(p, (PRUint32)nb); \
  |  |  164|  10.7k|            PL_ArenaCountAllocation(pool, (PRUint32)nb); \
  |  |  165|  10.7k|        } \
  |  |  166|  10.7k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|  10.7k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  360|  10.7k|        }
  361|       |
  362|   417k|    if (!p) {
  ------------------
  |  Branch (362:9): [True: 0, False: 417k]
  ------------------
  363|      0|        PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  364|      0|    }
  365|       |
  366|   417k|    return (p);
  367|   417k|}
PORT_ArenaZAlloc_Util:
  371|   104k|{
  372|   104k|    void *p;
  373|       |
  374|   104k|    if (size <= 0)
  ------------------
  |  Branch (374:9): [True: 96, False: 104k]
  ------------------
  375|     96|        size = 1;
  376|       |
  377|   104k|    p = PORT_ArenaAlloc(arena, size);
  ------------------
  |  |   53|   104k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  378|       |
  379|   104k|    if (p) {
  ------------------
  |  Branch (379:9): [True: 104k, False: 0]
  ------------------
  380|   104k|        PORT_Memset(p, 0, size);
  ------------------
  |  |  182|   104k|#define PORT_Memset memset
  ------------------
  381|   104k|    }
  382|       |
  383|   104k|    return (p);
  384|   104k|}
PORT_FreeArena_Util:
  401|  95.0k|{
  402|  95.0k|    PORTArenaPool *pool = (PORTArenaPool *)arena;
  403|  95.0k|    PRLock *lock = (PRLock *)0;
  404|  95.0k|    size_t len = sizeof *arena;
  405|       |
  406|  95.0k|    if (!pool)
  ------------------
  |  Branch (406:9): [True: 0, False: 95.0k]
  ------------------
  407|      0|        return;
  408|  95.0k|    if (ARENAPOOL_MAGIC == pool->magic) {
  ------------------
  |  |   51|  95.0k|#define ARENAPOOL_MAGIC 0xB8AC9BDF
  ------------------
  |  Branch (408:9): [True: 95.0k, False: 0]
  ------------------
  409|  95.0k|        len = sizeof *pool;
  410|  95.0k|        lock = pool->lock;
  411|  95.0k|        PZ_Lock(lock);
  ------------------
  |  |  245|  95.0k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  412|  95.0k|    }
  413|  95.0k|    if (zero) {
  ------------------
  |  Branch (413:9): [True: 50.4k, False: 44.5k]
  ------------------
  414|  50.4k|        PL_ClearArenaPool(arena, 0);
  415|  50.4k|    }
  416|  95.0k|    (void)PR_CallOnce(&setupUseFreeListOnce, &SetupUseFreeList);
  417|  95.0k|    if (useFreeList) {
  ------------------
  |  Branch (417:9): [True: 95.0k, False: 0]
  ------------------
  418|  95.0k|        PL_FreeArenaPool(arena);
  419|  95.0k|    } else {
  420|      0|        PL_FinishArenaPool(arena);
  421|      0|    }
  422|  95.0k|    PORT_ZFree(arena, len);
  ------------------
  |  |   75|  95.0k|#define PORT_ZFree PORT_ZFree_Util
  ------------------
  423|  95.0k|    if (lock) {
  ------------------
  |  Branch (423:9): [True: 95.0k, False: 0]
  ------------------
  424|  95.0k|        PZ_Unlock(lock);
  ------------------
  |  |  246|  95.0k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  425|  95.0k|        PZ_DestroyLock(lock);
  ------------------
  |  |  244|  95.0k|#define PZ_DestroyLock(k) PR_DestroyLock((k))
  ------------------
  426|  95.0k|    }
  427|  95.0k|}
PORT_DestroyCheapArena:
  431|  60.7k|{
  432|  60.7k|    (void)PR_CallOnce(&setupUseFreeListOnce, &SetupUseFreeList);
  433|  60.7k|    if (useFreeList) {
  ------------------
  |  Branch (433:9): [True: 60.7k, False: 0]
  ------------------
  434|  60.7k|        PL_FreeArenaPool(&pool->arena);
  435|  60.7k|    } else {
  436|      0|        PL_FinishArenaPool(&pool->arena);
  437|      0|    }
  438|  60.7k|}
PORT_ArenaMark_Util:
  465|   121k|{
  466|   121k|    void *result;
  467|       |
  468|   121k|    PORTArenaPool *pool = (PORTArenaPool *)arena;
  469|   121k|    if (ARENAPOOL_MAGIC == pool->magic) {
  ------------------
  |  |   51|   121k|#define ARENAPOOL_MAGIC 0xB8AC9BDF
  ------------------
  |  Branch (469:9): [True: 120k, False: 414]
  ------------------
  470|   120k|        PZ_Lock(pool->lock);
  ------------------
  |  |  245|   120k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  471|   120k|#ifdef THREADMARK
  472|   120k|        {
  473|   120k|            threadmark_mark *tm, **pw;
  474|   120k|            PRThread *currentThread = PR_GetCurrentThread();
  475|       |
  476|   120k|            if (!pool->marking_thread) {
  ------------------
  |  Branch (476:17): [True: 120k, False: 0]
  ------------------
  477|       |                /* First mark */
  478|   120k|                pool->marking_thread = currentThread;
  479|   120k|            } else if (currentThread != pool->marking_thread) {
  ------------------
  |  Branch (479:24): [True: 0, False: 0]
  ------------------
  480|      0|                PZ_Unlock(pool->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  481|      0|                PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  482|      0|                PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|      0|                return NULL;
  484|      0|            }
  485|       |
  486|   120k|            result = PL_ARENA_MARK(arena);
  ------------------
  |  |  187|   120k|#define PL_ARENA_MARK(pool) ((void *) (pool)->current->avail)
  ------------------
  487|   120k|            PL_ARENA_ALLOCATE(tm, arena, sizeof(threadmark_mark));
  ------------------
  |  |  150|   120k|    PR_BEGIN_MACRO \
  |  |  ------------------
  |  |  |  |  123|   120k|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  151|   120k|        PLArena *_a = (pool)->current; \
  |  |  152|   120k|        PRUint32 _nb = PL_ARENA_ALIGN(pool, (PRUint32)nb); \
  |  |  ------------------
  |  |  |  |  146|   120k|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  |  |  ------------------
  |  |  153|   120k|        PRUword _p = _a->avail; \
  |  |  154|   120k|        if (_nb < (PRUint32)nb) { \
  |  |  ------------------
  |  |  |  Branch (154:13): [True: 0, False: 120k]
  |  |  ------------------
  |  |  155|      0|            _p = 0; \
  |  |  156|   120k|        } else if (_nb > (_a->limit - _a->avail)) { \
  |  |  ------------------
  |  |  |  Branch (156:20): [True: 1.30k, False: 119k]
  |  |  ------------------
  |  |  157|  1.30k|            _p = (PRUword)PL_ArenaAllocate(pool, _nb); \
  |  |  158|   119k|        } else { \
  |  |  159|   119k|            _a->avail += _nb; \
  |  |  160|   119k|        } \
  |  |  161|   120k|        p = (void *)_p; \
  |  |  162|   120k|        if (p) { \
  |  |  ------------------
  |  |  |  Branch (162:13): [True: 120k, False: 0]
  |  |  ------------------
  |  |  163|   120k|            PL_MAKE_MEM_UNDEFINED(p, (PRUint32)nb); \
  |  |  164|   120k|            PL_ArenaCountAllocation(pool, (PRUint32)nb); \
  |  |  165|   120k|        } \
  |  |  166|   120k|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|   120k|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  488|   120k|            if (!tm) {
  ------------------
  |  Branch (488:17): [True: 0, False: 120k]
  ------------------
  489|      0|                PZ_Unlock(pool->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  490|      0|                PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  491|      0|                return NULL;
  492|      0|            }
  493|       |
  494|   120k|            tm->mark = result;
  495|   120k|            tm->next = (threadmark_mark *)NULL;
  496|       |
  497|   120k|            pw = &pool->first_mark;
  498|   120k|            while (*pw) {
  ------------------
  |  Branch (498:20): [True: 0, False: 120k]
  ------------------
  499|      0|                pw = &(*pw)->next;
  500|      0|            }
  501|       |
  502|   120k|            *pw = tm;
  503|   120k|        }
  504|       |#else  /* THREADMARK */
  505|       |        result = PL_ARENA_MARK(arena);
  506|       |#endif /* THREADMARK */
  507|   120k|        PZ_Unlock(pool->lock);
  ------------------
  |  |  246|   120k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  508|   120k|    } else {
  509|       |        /* a "pure" NSPR arena */
  510|    414|        result = PL_ARENA_MARK(arena);
  ------------------
  |  |  187|    414|#define PL_ARENA_MARK(pool) ((void *) (pool)->current->avail)
  ------------------
  511|    414|    }
  512|   121k|    return result;
  513|   121k|}
PORT_ArenaRelease_Util:
  617|     52|{
  618|     52|    port_ArenaRelease(arena, mark, PR_FALSE);
  ------------------
  |  |  438|     52|#define PR_FALSE 0
  ------------------
  619|     52|}
PORT_ArenaUnmark_Util:
  632|   121k|{
  633|   121k|#ifdef THREADMARK
  634|   121k|    PORTArenaPool *pool = (PORTArenaPool *)arena;
  635|   121k|    if (ARENAPOOL_MAGIC == pool->magic) {
  ------------------
  |  |   51|   121k|#define ARENAPOOL_MAGIC 0xB8AC9BDF
  ------------------
  |  Branch (635:9): [True: 120k, False: 414]
  ------------------
  636|   120k|        threadmark_mark **pw;
  637|       |
  638|   120k|        PZ_Lock(pool->lock);
  ------------------
  |  |  245|   120k|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  639|       |
  640|   120k|        if (PR_GetCurrentThread() != pool->marking_thread) {
  ------------------
  |  Branch (640:13): [True: 0, False: 120k]
  ------------------
  641|      0|            PZ_Unlock(pool->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  642|      0|            PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  643|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  644|      0|            return /* no error indication available */;
  645|      0|        }
  646|       |
  647|   120k|        pw = &pool->first_mark;
  648|   120k|        while (((threadmark_mark *)NULL != *pw) && (mark != (*pw)->mark)) {
  ------------------
  |  Branch (648:16): [True: 120k, False: 0]
  |  Branch (648:52): [True: 0, False: 120k]
  ------------------
  649|      0|            pw = &(*pw)->next;
  650|      0|        }
  651|       |
  652|   120k|        if ((threadmark_mark *)NULL == *pw) {
  ------------------
  |  Branch (652:13): [True: 0, False: 120k]
  ------------------
  653|       |            /* bad mark */
  654|      0|            PZ_Unlock(pool->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  655|      0|            PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  656|      0|            PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  657|      0|            return /* no error indication available */;
  658|      0|        }
  659|       |
  660|   120k|        *pw = (threadmark_mark *)NULL;
  661|       |
  662|   120k|        if (!pool->first_mark) {
  ------------------
  |  Branch (662:13): [True: 120k, False: 0]
  ------------------
  663|   120k|            pool->marking_thread = (PRThread *)NULL;
  664|   120k|        }
  665|       |
  666|   120k|        PZ_Unlock(pool->lock);
  ------------------
  |  |  246|   120k|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  667|   120k|    }
  668|   121k|#endif /* THREADMARK */
  669|   121k|}
PORT_ArenaStrdup_Util:
  673|  10.3k|{
  674|  10.3k|    int len = PORT_Strlen(str) + 1;
  ------------------
  |  |  190|  10.3k|#define PORT_Strlen(s) strlen(s)
  ------------------
  675|  10.3k|    char *newstr;
  676|       |
  677|  10.3k|    newstr = (char *)PORT_ArenaAlloc(arena, len);
  ------------------
  |  |   53|  10.3k|#define PORT_ArenaAlloc PORT_ArenaAlloc_Util
  ------------------
  678|  10.3k|    if (newstr) {
  ------------------
  |  Branch (678:9): [True: 10.3k, False: 0]
  ------------------
  679|  10.3k|        PORT_Memcpy(newstr, str, len);
  ------------------
  |  |  180|  10.3k|#define PORT_Memcpy memcpy
  ------------------
  680|  10.3k|    }
  681|  10.3k|    return newstr;
  682|  10.3k|}
PORT_UCS4_UTF8Conversion:
  717|    135|{
  718|    135|    if (!ucs4Utf8ConvertFunc) {
  ------------------
  |  Branch (718:9): [True: 135, False: 0]
  ------------------
  719|    135|        return sec_port_ucs4_utf8_conversion_function(toUnicode,
  720|    135|                                                      inBuf, inBufLen, outBuf, maxOutBufLen, outBufLen);
  721|    135|    }
  722|       |
  723|      0|    return (*ucs4Utf8ConvertFunc)(toUnicode, inBuf, inBufLen, outBuf,
  724|      0|                                  maxOutBufLen, outBufLen);
  725|    135|}
PORT_UCS2_UTF8Conversion_Util:
  731|    135|{
  732|    135|    if (!ucs2Utf8ConvertFunc) {
  ------------------
  |  Branch (732:9): [True: 135, False: 0]
  ------------------
  733|    135|        return sec_port_ucs2_utf8_conversion_function(toUnicode,
  734|    135|                                                      inBuf, inBufLen, outBuf, maxOutBufLen, outBufLen);
  735|    135|    }
  736|       |
  737|      0|    return (*ucs2Utf8ConvertFunc)(toUnicode, inBuf, inBufLen, outBuf,
  738|      0|                                  maxOutBufLen, outBufLen);
  739|    135|}
PORT_ISO88591_UTF8Conversion:
  745|    113|{
  746|    113|    return sec_port_iso88591_utf8_conversion_function(inBuf, inBufLen,
  747|    113|                                                      outBuf, maxOutBufLen, outBufLen);
  748|    113|}
NSS_SecureMemcmp:
  811|  92.9k|{
  812|  92.9k|    const unsigned char *a = (const unsigned char *)ia;
  813|  92.9k|    const unsigned char *b = (const unsigned char *)ib;
  814|  92.9k|    int r = 0;
  815|       |
  816|  3.06M|    for (size_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (816:24): [True: 2.96M, False: 92.9k]
  ------------------
  817|  2.96M|        r |= a[i] ^ b[i];
  818|  2.96M|    }
  819|       |
  820|       |    /* 0 <= r < 256, so -r has bit 8 set when r != 0 */
  821|  92.9k|    return 1 & (-r >> 8);
  822|  92.9k|}
NSS_SecureMemcmpZero:
  830|  7.73k|{
  831|  7.73k|    const unsigned char *a = (const unsigned char *)mem;
  832|  7.73k|    int r = 0;
  833|       |
  834|   255k|    for (size_t i = 0; i < n; ++i) {
  ------------------
  |  Branch (834:24): [True: 247k, False: 7.73k]
  ------------------
  835|   247k|        r |= a[i];
  836|   247k|    }
  837|       |
  838|       |    /* 0 <= r < 256, so -r has bit 8 set when r != 0 */
  839|  7.73k|    return 1 & (-r >> 8);
  840|  7.73k|}
NSS_GetSystemFIPSEnabled:
  925|      2|{
  926|       |/* if FIPS is disabled in NSS, always return FALSE, even if the environment
  927|       | * variable is set, or the system is in FIPS mode */
  928|       |#ifndef NSS_FIPS_DISABLED
  929|       |    const char *env;
  930|       |
  931|       |    /* The environment variable is active for all platforms */
  932|       |    env = PR_GetEnvSecure("NSS_FIPS");
  933|       |    /* we generally accept y, Y, 1, FIPS, TRUE, and ON as turning on FIPS
  934|       |     * mode. Anything else is considered 'off' */
  935|       |    if (env && (*env == 'y' || *env == '1' || *env == 'Y' ||
  936|       |                (PORT_Strcasecmp(env, "fips") == 0) ||
  937|       |                (PORT_Strcasecmp(env, "true") == 0) ||
  938|       |                (PORT_Strcasecmp(env, "on") == 0))) {
  939|       |        return PR_TRUE;
  940|       |    }
  941|       |
  942|       |/* currently only Linux has a system FIPS indicator. Add others here
  943|       | * as they become available/known */
  944|       |#ifdef LINUX
  945|       |    {
  946|       |        FILE *f;
  947|       |        char d;
  948|       |        size_t size;
  949|       |        f = fopen("/proc/sys/crypto/fips_enabled", "r");
  950|       |        if (!f)
  951|       |            return PR_FALSE;
  952|       |
  953|       |        size = fread(&d, 1, 1, f);
  954|       |        fclose(f);
  955|       |        if (size != 1)
  956|       |            return PR_FALSE;
  957|       |        if (d == '1')
  958|       |            return PR_TRUE;
  959|       |    }
  960|       |#endif /* LINUX */
  961|       |#endif /* NSS_FIPS_DISABLED == 0 */
  962|      2|    return PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  963|      2|}
secport.c:SetupUseFreeList:
  391|      1|{
  392|      1|    useFreeList = (PR_GetEnvSecure("NSS_DISABLE_ARENA_FREE_LIST") == NULL);
  393|      1|    return PR_SUCCESS;
  394|      1|}
secport.c:port_ArenaRelease:
  561|     52|{
  562|     52|    PORTArenaPool *pool = (PORTArenaPool *)arena;
  563|     52|    if (ARENAPOOL_MAGIC == pool->magic) {
  ------------------
  |  |   51|     52|#define ARENAPOOL_MAGIC 0xB8AC9BDF
  ------------------
  |  Branch (563:9): [True: 52, False: 0]
  ------------------
  564|     52|        PZ_Lock(pool->lock);
  ------------------
  |  |  245|     52|#define PZ_Lock(k) PR_Lock((k))
  ------------------
  565|     52|#ifdef THREADMARK
  566|     52|        {
  567|     52|            threadmark_mark **pw;
  568|       |
  569|     52|            if (PR_GetCurrentThread() != pool->marking_thread) {
  ------------------
  |  Branch (569:17): [True: 0, False: 52]
  ------------------
  570|      0|                PZ_Unlock(pool->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  571|      0|                PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  572|      0|                PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  573|      0|                return /* no error indication available */;
  574|      0|            }
  575|       |
  576|     52|            pw = &pool->first_mark;
  577|     52|            while (*pw && (mark != (*pw)->mark)) {
  ------------------
  |  Branch (577:20): [True: 52, False: 0]
  |  Branch (577:27): [True: 0, False: 52]
  ------------------
  578|      0|                pw = &(*pw)->next;
  579|      0|            }
  580|       |
  581|     52|            if (!*pw) {
  ------------------
  |  Branch (581:17): [True: 0, False: 52]
  ------------------
  582|       |                /* bad mark */
  583|      0|                PZ_Unlock(pool->lock);
  ------------------
  |  |  246|      0|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  584|      0|                PORT_SetError(SEC_ERROR_NO_MEMORY);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  585|      0|                PORT_Assert(0);
  ------------------
  |  |  120|      0|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  586|      0|                return /* no error indication available */;
  587|      0|            }
  588|       |
  589|     52|            *pw = (threadmark_mark *)NULL;
  590|       |
  591|     52|            if (zero) {
  ------------------
  |  Branch (591:17): [True: 0, False: 52]
  ------------------
  592|      0|                port_ArenaZeroAfterMark(arena, mark);
  593|      0|            }
  594|     52|            PL_ARENA_RELEASE(arena, mark);
  ------------------
  |  |  210|     52|    PR_BEGIN_MACRO \
  |  |  ------------------
  |  |  |  |  123|     52|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  211|     52|        char *_m = (char *)(mark); \
  |  |  212|     52|        PLArena *_a = (pool)->current; \
  |  |  213|     52|        if (PR_UPTRDIFF(_m, _a->base) <= PR_UPTRDIFF(_a->avail, _a->base)) { \
  |  |  ------------------
  |  |  |  |  188|     52|#define PR_UPTRDIFF(p,q) ((PRUword)(p) - (PRUword)(q))
  |  |  ------------------
  |  |                       if (PR_UPTRDIFF(_m, _a->base) <= PR_UPTRDIFF(_a->avail, _a->base)) { \
  |  |  ------------------
  |  |  |  |  188|     52|#define PR_UPTRDIFF(p,q) ((PRUword)(p) - (PRUword)(q))
  |  |  ------------------
  |  |  |  Branch (213:13): [True: 34, False: 18]
  |  |  ------------------
  |  |  214|     34|            _a->avail = (PRUword)PL_ARENA_ALIGN(pool, _m); \
  |  |  ------------------
  |  |  |  |  146|     34|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  |  |  ------------------
  |  |  215|     34|            PL_CLEAR_UNUSED(_a); \
  |  |  ------------------
  |  |  |  |  198|     34|#define PL_CLEAR_UNUSED(a) PL_CLEAR_UNUSED_PATTERN((a), PL_FREE_PATTERN)
  |  |  |  |  ------------------
  |  |  |  |  |  |  191|     34|    PR_BEGIN_MACRO \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|     34|#define PR_BEGIN_MACRO  do {
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|     34|        PR_ASSERT((a)->avail <= (a)->limit); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|     34|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (208:6): [True: 34, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|     34|        PL_MAKE_MEM_UNDEFINED((void*)(a)->avail, (a)->limit - (a)->avail); \
  |  |  |  |  |  |  194|     34|        memset((void*)(a)->avail, (pattern), (a)->limit - (a)->avail); \
  |  |  |  |  |  |  195|     34|    PR_END_MACRO
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  124|     34|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  216|     34|            PL_MAKE_MEM_NOACCESS((void*)_a->avail, _a->limit - _a->avail); \
  |  |  217|     34|            PL_ArenaCountRetract(pool, _m); \
  |  |  218|     34|        } else { \
  |  |  219|     18|            PL_ArenaRelease(pool, _m); \
  |  |  220|     18|        } \
  |  |  221|     52|        PL_ArenaCountRelease(pool, _m); \
  |  |  222|     52|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|     52|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  595|       |
  596|     52|            if (!pool->first_mark) {
  ------------------
  |  Branch (596:17): [True: 52, False: 0]
  ------------------
  597|     52|                pool->marking_thread = (PRThread *)NULL;
  598|     52|            }
  599|     52|        }
  600|       |#else  /* THREADMARK */
  601|       |        if (zero) {
  602|       |            port_ArenaZeroAfterMark(arena, mark);
  603|       |        }
  604|       |        PL_ARENA_RELEASE(arena, mark);
  605|       |#endif /* THREADMARK */
  606|     52|        PZ_Unlock(pool->lock);
  ------------------
  |  |  246|     52|#define PZ_Unlock(k) PR_Unlock((k))
  ------------------
  607|     52|    } else {
  608|      0|        if (zero) {
  ------------------
  |  Branch (608:13): [True: 0, False: 0]
  ------------------
  609|      0|            port_ArenaZeroAfterMark(arena, mark);
  610|      0|        }
  611|      0|        PL_ARENA_RELEASE(arena, mark);
  ------------------
  |  |  210|      0|    PR_BEGIN_MACRO \
  |  |  ------------------
  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  ------------------
  |  |  211|      0|        char *_m = (char *)(mark); \
  |  |  212|      0|        PLArena *_a = (pool)->current; \
  |  |  213|      0|        if (PR_UPTRDIFF(_m, _a->base) <= PR_UPTRDIFF(_a->avail, _a->base)) { \
  |  |  ------------------
  |  |  |  |  188|      0|#define PR_UPTRDIFF(p,q) ((PRUword)(p) - (PRUword)(q))
  |  |  ------------------
  |  |                       if (PR_UPTRDIFF(_m, _a->base) <= PR_UPTRDIFF(_a->avail, _a->base)) { \
  |  |  ------------------
  |  |  |  |  188|      0|#define PR_UPTRDIFF(p,q) ((PRUword)(p) - (PRUword)(q))
  |  |  ------------------
  |  |  |  Branch (213:13): [True: 0, False: 0]
  |  |  ------------------
  |  |  214|      0|            _a->avail = (PRUword)PL_ARENA_ALIGN(pool, _m); \
  |  |  ------------------
  |  |  |  |  146|      0|#define PL_ARENA_ALIGN(pool, n) (((PRUword)(n) + (pool)->mask) & ~(pool)->mask)
  |  |  ------------------
  |  |  215|      0|            PL_CLEAR_UNUSED(_a); \
  |  |  ------------------
  |  |  |  |  198|      0|#define PL_CLEAR_UNUSED(a) PL_CLEAR_UNUSED_PATTERN((a), PL_FREE_PATTERN)
  |  |  |  |  ------------------
  |  |  |  |  |  |  191|      0|    PR_BEGIN_MACRO \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  123|      0|#define PR_BEGIN_MACRO  do {
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  192|      0|        PR_ASSERT((a)->avail <= (a)->limit); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|      0|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (208:6): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  193|      0|        PL_MAKE_MEM_UNDEFINED((void*)(a)->avail, (a)->limit - (a)->avail); \
  |  |  |  |  |  |  194|      0|        memset((void*)(a)->avail, (pattern), (a)->limit - (a)->avail); \
  |  |  |  |  |  |  195|      0|    PR_END_MACRO
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  216|      0|            PL_MAKE_MEM_NOACCESS((void*)_a->avail, _a->limit - _a->avail); \
  |  |  217|      0|            PL_ArenaCountRetract(pool, _m); \
  |  |  218|      0|        } else { \
  |  |  219|      0|            PL_ArenaRelease(pool, _m); \
  |  |  220|      0|        } \
  |  |  221|      0|        PL_ArenaCountRelease(pool, _m); \
  |  |  222|      0|    PR_END_MACRO
  |  |  ------------------
  |  |  |  |  124|      0|#define PR_END_MACRO    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (124:34): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  612|      0|    }
  613|     52|}

sec_port_ucs4_utf8_conversion_function:
  132|    135|{
  133|    135|    PORT_Assert((unsigned int *)NULL != outBufLen);
  ------------------
  |  |  120|    135|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    135|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 135, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  134|       |
  135|    135|    if (toUnicode) {
  ------------------
  |  Branch (135:9): [True: 0, False: 135]
  ------------------
  136|      0|        unsigned int i, len = 0;
  137|       |
  138|      0|        for (i = 0; i < inBufLen;) {
  ------------------
  |  Branch (138:21): [True: 0, False: 0]
  ------------------
  139|      0|            if ((inBuf[i] & 0x80) == 0x00)
  ------------------
  |  Branch (139:17): [True: 0, False: 0]
  ------------------
  140|      0|                i += 1;
  141|      0|            else if ((inBuf[i] & 0xE0) == 0xC0)
  ------------------
  |  Branch (141:22): [True: 0, False: 0]
  ------------------
  142|      0|                i += 2;
  143|      0|            else if ((inBuf[i] & 0xF0) == 0xE0)
  ------------------
  |  Branch (143:22): [True: 0, False: 0]
  ------------------
  144|      0|                i += 3;
  145|      0|            else if ((inBuf[i] & 0xF8) == 0xF0)
  ------------------
  |  Branch (145:22): [True: 0, False: 0]
  ------------------
  146|      0|                i += 4;
  147|      0|            else
  148|      0|                return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  149|       |
  150|      0|            len += 4;
  151|      0|        }
  152|       |
  153|      0|        if (len > maxOutBufLen) {
  ------------------
  |  Branch (153:13): [True: 0, False: 0]
  ------------------
  154|      0|            *outBufLen = len;
  155|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  156|      0|        }
  157|       |
  158|      0|        len = 0;
  159|       |
  160|      0|        for (i = 0; i < inBufLen;) {
  ------------------
  |  Branch (160:21): [True: 0, False: 0]
  ------------------
  161|      0|            PRUint32 ucs4 = sec_port_read_utf8(&i, inBuf, inBufLen);
  162|       |
  163|      0|            if (ucs4 == BAD_UTF8)
  ------------------
  |  |   63|      0|#define BAD_UTF8 ((PRUint32)-1)
  ------------------
  |  Branch (163:17): [True: 0, False: 0]
  ------------------
  164|      0|                return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  165|       |
  166|      0|            outBuf[len + L_0] = 0x00;
  ------------------
  |  |   56|      0|#define L_0 0
  ------------------
  167|      0|            outBuf[len + L_1] = (unsigned char)(ucs4 >> 16);
  ------------------
  |  |   57|      0|#define L_1 1
  ------------------
  168|      0|            outBuf[len + L_2] = (unsigned char)(ucs4 >> 8);
  ------------------
  |  |   58|      0|#define L_2 2
  ------------------
  169|      0|            outBuf[len + L_3] = (unsigned char)ucs4;
  ------------------
  |  |   59|      0|#define L_3 3
  ------------------
  170|       |
  171|      0|            len += 4;
  172|      0|        }
  173|       |
  174|      0|        *outBufLen = len;
  175|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  176|    135|    } else {
  177|    135|        unsigned int i, len = 0;
  178|    135|        PORT_Assert((inBufLen % 4) == 0);
  ------------------
  |  |  120|    135|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    135|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 135, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  179|    135|        if ((inBufLen % 4) != 0) {
  ------------------
  |  Branch (179:13): [True: 0, False: 135]
  ------------------
  180|      0|            *outBufLen = 0;
  181|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  182|      0|        }
  183|       |
  184|    216|        for (i = 0; i < inBufLen; i += 4) {
  ------------------
  |  Branch (184:21): [True: 115, False: 101]
  ------------------
  185|    115|            if ((inBuf[i + L_0] > 0x00) || (inBuf[i + L_1] > 0x10)) {
  ------------------
  |  |   56|    115|#define L_0 0
  ------------------
                          if ((inBuf[i + L_0] > 0x00) || (inBuf[i + L_1] > 0x10)) {
  ------------------
  |  |   57|     90|#define L_1 1
  ------------------
  |  Branch (185:17): [True: 25, False: 90]
  |  Branch (185:44): [True: 9, False: 81]
  ------------------
  186|     34|                *outBufLen = 0;
  187|     34|                return PR_FALSE;
  ------------------
  |  |  438|     34|#define PR_FALSE 0
  ------------------
  188|     81|            } else if (inBuf[i + L_1] >= 0x01)
  ------------------
  |  |   57|     81|#define L_1 1
  ------------------
  |  Branch (188:24): [True: 20, False: 61]
  ------------------
  189|     20|                len += 4;
  190|     61|            else if (inBuf[i + L_2] >= 0x08)
  ------------------
  |  |   58|     61|#define L_2 2
  ------------------
  |  Branch (190:22): [True: 20, False: 41]
  ------------------
  191|     20|                len += 3;
  192|     41|            else if ((inBuf[i + L_2] > 0x00) || (inBuf[i + L_3] >= 0x80))
  ------------------
  |  |   58|     41|#define L_2 2
  ------------------
                          else if ((inBuf[i + L_2] > 0x00) || (inBuf[i + L_3] >= 0x80))
  ------------------
  |  |   59|     29|#define L_3 3
  ------------------
  |  Branch (192:22): [True: 12, False: 29]
  |  Branch (192:49): [True: 14, False: 15]
  ------------------
  193|     26|                len += 2;
  194|     15|            else
  195|     15|                len += 1;
  196|    115|        }
  197|       |
  198|    101|        if (len > maxOutBufLen) {
  ------------------
  |  Branch (198:13): [True: 0, False: 101]
  ------------------
  199|      0|            *outBufLen = len;
  200|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  201|      0|        }
  202|       |
  203|    101|        len = 0;
  204|       |
  205|    177|        for (i = 0; i < inBufLen; i += 4) {
  ------------------
  |  Branch (205:21): [True: 76, False: 101]
  ------------------
  206|     76|            if (inBuf[i + L_1] >= 0x01) {
  ------------------
  |  |   57|     76|#define L_1 1
  ------------------
  |  Branch (206:17): [True: 18, False: 58]
  ------------------
  207|       |                /* 0001 0000-001F FFFF -> 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
  208|       |                /* 00000000 000abcde fghijklm nopqrstu ->
  209|       |                   11110abc 10defghi 10jklmno 10pqrstu */
  210|       |
  211|     18|                outBuf[len + 0] = 0xF0 | ((inBuf[i + L_1] & 0x1C) >> 2);
  ------------------
  |  |   57|     18|#define L_1 1
  ------------------
  212|     18|                outBuf[len + 1] = 0x80 | ((inBuf[i + L_1] & 0x03) << 4) | ((inBuf[i + L_2] & 0xF0) >> 4);
  ------------------
  |  |   57|     18|#define L_1 1
  ------------------
                              outBuf[len + 1] = 0x80 | ((inBuf[i + L_1] & 0x03) << 4) | ((inBuf[i + L_2] & 0xF0) >> 4);
  ------------------
  |  |   58|     18|#define L_2 2
  ------------------
  213|     18|                outBuf[len + 2] = 0x80 | ((inBuf[i + L_2] & 0x0F) << 2) | ((inBuf[i + L_3] & 0xC0) >> 6);
  ------------------
  |  |   58|     18|#define L_2 2
  ------------------
                              outBuf[len + 2] = 0x80 | ((inBuf[i + L_2] & 0x0F) << 2) | ((inBuf[i + L_3] & 0xC0) >> 6);
  ------------------
  |  |   59|     18|#define L_3 3
  ------------------
  214|     18|                outBuf[len + 3] = 0x80 | ((inBuf[i + L_3] & 0x3F) >> 0);
  ------------------
  |  |   59|     18|#define L_3 3
  ------------------
  215|       |
  216|     18|                len += 4;
  217|     58|            } else if (inBuf[i + L_2] >= 0x08) {
  ------------------
  |  |   58|     58|#define L_2 2
  ------------------
  |  Branch (217:24): [True: 19, False: 39]
  ------------------
  218|       |                /* 0000 0800-0000 FFFF -> 1110xxxx 10xxxxxx 10xxxxxx */
  219|       |                /* 00000000 00000000 abcdefgh ijklmnop ->
  220|       |                   1110abcd 10efghij 10klmnop */
  221|       |
  222|     19|                outBuf[len + 0] = 0xE0 | ((inBuf[i + L_2] & 0xF0) >> 4);
  ------------------
  |  |   58|     19|#define L_2 2
  ------------------
  223|     19|                outBuf[len + 1] = 0x80 | ((inBuf[i + L_2] & 0x0F) << 2) | ((inBuf[i + L_3] & 0xC0) >> 6);
  ------------------
  |  |   58|     19|#define L_2 2
  ------------------
                              outBuf[len + 1] = 0x80 | ((inBuf[i + L_2] & 0x0F) << 2) | ((inBuf[i + L_3] & 0xC0) >> 6);
  ------------------
  |  |   59|     19|#define L_3 3
  ------------------
  224|     19|                outBuf[len + 2] = 0x80 | ((inBuf[i + L_3] & 0x3F) >> 0);
  ------------------
  |  |   59|     19|#define L_3 3
  ------------------
  225|       |
  226|     19|                len += 3;
  227|     39|            } else if ((inBuf[i + L_2] > 0x00) || (inBuf[i + L_3] >= 0x80)) {
  ------------------
  |  |   58|     39|#define L_2 2
  ------------------
                          } else if ((inBuf[i + L_2] > 0x00) || (inBuf[i + L_3] >= 0x80)) {
  ------------------
  |  |   59|     27|#define L_3 3
  ------------------
  |  Branch (227:24): [True: 12, False: 27]
  |  Branch (227:51): [True: 13, False: 14]
  ------------------
  228|       |                /* 0000 0080-0000 07FF -> 110xxxxx 10xxxxxx */
  229|       |                /* 00000000 00000000 00000abc defghijk ->
  230|       |                   110abcde 10fghijk */
  231|       |
  232|     25|                outBuf[len + 0] = 0xC0 | ((inBuf[i + L_2] & 0x07) << 2) | ((inBuf[i + L_3] & 0xC0) >> 6);
  ------------------
  |  |   58|     25|#define L_2 2
  ------------------
                              outBuf[len + 0] = 0xC0 | ((inBuf[i + L_2] & 0x07) << 2) | ((inBuf[i + L_3] & 0xC0) >> 6);
  ------------------
  |  |   59|     25|#define L_3 3
  ------------------
  233|     25|                outBuf[len + 1] = 0x80 | ((inBuf[i + L_3] & 0x3F) >> 0);
  ------------------
  |  |   59|     25|#define L_3 3
  ------------------
  234|       |
  235|     25|                len += 2;
  236|     25|            } else {
  237|       |                /* 0000 0000-0000 007F -> 0xxxxxx */
  238|       |                /* 00000000 00000000 00000000 0abcdefg ->
  239|       |                   0abcdefg */
  240|       |
  241|     14|                outBuf[len + 0] = (inBuf[i + L_3] & 0x7F);
  ------------------
  |  |   59|     14|#define L_3 3
  ------------------
  242|       |
  243|     14|                len += 1;
  244|     14|            }
  245|     76|        }
  246|       |
  247|    101|        *outBufLen = len;
  248|    101|        return PR_TRUE;
  ------------------
  |  |  437|    101|#define PR_TRUE 1
  ------------------
  249|    101|    }
  250|    135|}
sec_port_ucs2_utf8_conversion_function:
  260|    135|{
  261|    135|    PORT_Assert((unsigned int *)NULL != outBufLen);
  ------------------
  |  |  120|    135|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    135|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 135, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|       |
  263|    135|    if (toUnicode) {
  ------------------
  |  Branch (263:9): [True: 0, False: 135]
  ------------------
  264|      0|        unsigned int i, len = 0;
  265|       |
  266|      0|        for (i = 0; i < inBufLen;) {
  ------------------
  |  Branch (266:21): [True: 0, False: 0]
  ------------------
  267|      0|            if ((inBuf[i] & 0x80) == 0x00) {
  ------------------
  |  Branch (267:17): [True: 0, False: 0]
  ------------------
  268|      0|                i += 1;
  269|      0|                len += 2;
  270|      0|            } else if ((inBuf[i] & 0xE0) == 0xC0) {
  ------------------
  |  Branch (270:24): [True: 0, False: 0]
  ------------------
  271|      0|                i += 2;
  272|      0|                len += 2;
  273|      0|            } else if ((inBuf[i] & 0xF0) == 0xE0) {
  ------------------
  |  Branch (273:24): [True: 0, False: 0]
  ------------------
  274|      0|                i += 3;
  275|      0|                len += 2;
  276|      0|            } else if ((inBuf[i] & 0xF8) == 0xF0) {
  ------------------
  |  Branch (276:24): [True: 0, False: 0]
  ------------------
  277|      0|                i += 4;
  278|      0|                len += 4;
  279|      0|            } else
  280|      0|                return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  281|      0|        }
  282|       |
  283|      0|        if (len > maxOutBufLen) {
  ------------------
  |  Branch (283:13): [True: 0, False: 0]
  ------------------
  284|      0|            *outBufLen = len;
  285|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  286|      0|        }
  287|       |
  288|      0|        len = 0;
  289|       |
  290|      0|        for (i = 0; i < inBufLen;) {
  ------------------
  |  Branch (290:21): [True: 0, False: 0]
  ------------------
  291|      0|            PRUint32 ucs4 = sec_port_read_utf8(&i, inBuf, inBufLen);
  292|       |
  293|      0|            if (ucs4 == BAD_UTF8)
  ------------------
  |  |   63|      0|#define BAD_UTF8 ((PRUint32)-1)
  ------------------
  |  Branch (293:17): [True: 0, False: 0]
  ------------------
  294|      0|                return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  295|       |
  296|      0|            if (ucs4 < 0x10000) {
  ------------------
  |  Branch (296:17): [True: 0, False: 0]
  ------------------
  297|      0|                outBuf[len + H_0] = (unsigned char)(ucs4 >> 8);
  ------------------
  |  |   60|      0|#define H_0 0
  ------------------
  298|      0|                outBuf[len + H_1] = (unsigned char)ucs4;
  ------------------
  |  |   61|      0|#define H_1 1
  ------------------
  299|      0|                len += 2;
  300|      0|            } else {
  301|      0|                ucs4 -= 0x10000;
  302|      0|                outBuf[len + 0 + H_0] = (unsigned char)(0xD8 | ((ucs4 >> 18) & 0x3));
  ------------------
  |  |   60|      0|#define H_0 0
  ------------------
  303|      0|                outBuf[len + 0 + H_1] = (unsigned char)(ucs4 >> 10);
  ------------------
  |  |   61|      0|#define H_1 1
  ------------------
  304|      0|                outBuf[len + 2 + H_0] = (unsigned char)(0xDC | ((ucs4 >> 8) & 0x3));
  ------------------
  |  |   60|      0|#define H_0 0
  ------------------
  305|      0|                outBuf[len + 2 + H_1] = (unsigned char)ucs4;
  ------------------
  |  |   61|      0|#define H_1 1
  ------------------
  306|      0|                len += 4;
  307|      0|            }
  308|      0|        }
  309|       |
  310|      0|        *outBufLen = len;
  311|      0|        return PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  312|    135|    } else {
  313|    135|        unsigned int i, len = 0;
  314|    135|        PORT_Assert((inBufLen % 2) == 0);
  ------------------
  |  |  120|    135|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    135|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 135, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  315|    135|        if ((inBufLen % 2) != 0) {
  ------------------
  |  Branch (315:13): [True: 0, False: 135]
  ------------------
  316|      0|            *outBufLen = 0;
  317|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  318|      0|        }
  319|       |
  320|    583|        for (i = 0; i < inBufLen; i += 2) {
  ------------------
  |  Branch (320:21): [True: 491, False: 92]
  ------------------
  321|    491|            if ((inBuf[i + H_0] == 0x00) && ((inBuf[i + H_1] & 0x80) == 0x00))
  ------------------
  |  |   60|    491|#define H_0 0
  ------------------
                          if ((inBuf[i + H_0] == 0x00) && ((inBuf[i + H_1] & 0x80) == 0x00))
  ------------------
  |  |   61|     84|#define H_1 1
  ------------------
  |  Branch (321:17): [True: 84, False: 407]
  |  Branch (321:45): [True: 57, False: 27]
  ------------------
  322|     57|                len += 1;
  323|    434|            else if (inBuf[i + H_0] < 0x08)
  ------------------
  |  |   60|    434|#define H_0 0
  ------------------
  |  Branch (323:22): [True: 47, False: 387]
  ------------------
  324|     47|                len += 2;
  325|    387|            else if (((inBuf[i + H_0] & 0xFC) == 0xD8)) {
  ------------------
  |  |   60|    387|#define H_0 0
  ------------------
  |  Branch (325:22): [True: 57, False: 330]
  ------------------
  326|     57|                if (((inBufLen - i) > 2) && ((inBuf[i + 2 + H_0] & 0xFC) == 0xDC)) {
  ------------------
  |  |   60|     24|#define H_0 0
  ------------------
  |  Branch (326:21): [True: 24, False: 33]
  |  Branch (326:45): [True: 17, False: 7]
  ------------------
  327|     17|                    i += 2;
  328|     17|                    len += 4;
  329|     40|                } else {
  330|     40|                    return PR_FALSE;
  ------------------
  |  |  438|     40|#define PR_FALSE 0
  ------------------
  331|     40|                }
  332|    330|            } else if ((inBuf[i + H_0] & 0xFC) == 0xDC) {
  ------------------
  |  |   60|    330|#define H_0 0
  ------------------
  |  Branch (332:24): [True: 3, False: 327]
  ------------------
  333|      3|                return PR_FALSE;
  ------------------
  |  |  438|      3|#define PR_FALSE 0
  ------------------
  334|    327|            } else {
  335|    327|                len += 3;
  336|    327|            }
  337|    491|        }
  338|       |
  339|     92|        if (len > maxOutBufLen) {
  ------------------
  |  Branch (339:13): [True: 0, False: 92]
  ------------------
  340|      0|            *outBufLen = len;
  341|      0|            return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  342|      0|        }
  343|       |
  344|     92|        len = 0;
  345|       |
  346|    432|        for (i = 0; i < inBufLen; i += 2) {
  ------------------
  |  Branch (346:21): [True: 340, False: 92]
  ------------------
  347|    340|            if ((inBuf[i + H_0] == 0x00) && ((inBuf[i + H_1] & 0x80) == 0x00)) {
  ------------------
  |  |   60|    340|#define H_0 0
  ------------------
                          if ((inBuf[i + H_0] == 0x00) && ((inBuf[i + H_1] & 0x80) == 0x00)) {
  ------------------
  |  |   61|     81|#define H_1 1
  ------------------
  |  Branch (347:17): [True: 81, False: 259]
  |  Branch (347:45): [True: 56, False: 25]
  ------------------
  348|       |                /* 0000-007F -> 0xxxxxx */
  349|       |                /* 00000000 0abcdefg -> 0abcdefg */
  350|       |
  351|     56|                outBuf[len] = inBuf[i + H_1] & 0x7F;
  ------------------
  |  |   61|     56|#define H_1 1
  ------------------
  352|       |
  353|     56|                len += 1;
  354|    284|            } else if (inBuf[i + H_0] < 0x08) {
  ------------------
  |  |   60|    284|#define H_0 0
  ------------------
  |  Branch (354:24): [True: 45, False: 239]
  ------------------
  355|       |                /* 0080-07FF -> 110xxxxx 10xxxxxx */
  356|       |                /* 00000abc defghijk -> 110abcde 10fghijk */
  357|       |
  358|     45|                outBuf[len + 0] = 0xC0 | ((inBuf[i + H_0] & 0x07) << 2) | ((inBuf[i + H_1] & 0xC0) >> 6);
  ------------------
  |  |   60|     45|#define H_0 0
  ------------------
                              outBuf[len + 0] = 0xC0 | ((inBuf[i + H_0] & 0x07) << 2) | ((inBuf[i + H_1] & 0xC0) >> 6);
  ------------------
  |  |   61|     45|#define H_1 1
  ------------------
  359|     45|                outBuf[len + 1] = 0x80 | ((inBuf[i + H_1] & 0x3F) >> 0);
  ------------------
  |  |   61|     45|#define H_1 1
  ------------------
  360|       |
  361|     45|                len += 2;
  362|    239|            } else if ((inBuf[i + H_0] & 0xFC) == 0xD8) {
  ------------------
  |  |   60|    239|#define H_0 0
  ------------------
  |  Branch (362:24): [True: 13, False: 226]
  ------------------
  363|     13|                int abcde, BCDE;
  364|       |
  365|     13|                PORT_Assert(((inBufLen - i) > 2) && ((inBuf[i + 2 + H_0] & 0xFC) == 0xDC));
  ------------------
  |  |  120|     13|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     26|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:7): [True: 13, False: 0]
  |  |  |  |  |  Branch (208:7): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  366|       |
  367|       |                /* D800-DBFF DC00-DFFF -> 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */
  368|       |                /* 110110BC DEfghijk 110111lm nopqrstu ->
  369|       |                   { Let abcde = BCDE + 1 }
  370|       |                   11110abc 10defghi 10jklmno 10pqrstu */
  371|       |
  372|     13|                BCDE = ((inBuf[i + H_0] & 0x03) << 2) | ((inBuf[i + H_1] & 0xC0) >> 6);
  ------------------
  |  |   60|     13|#define H_0 0
  ------------------
                              BCDE = ((inBuf[i + H_0] & 0x03) << 2) | ((inBuf[i + H_1] & 0xC0) >> 6);
  ------------------
  |  |   61|     13|#define H_1 1
  ------------------
  373|     13|                abcde = BCDE + 1;
  374|       |
  375|     13|                outBuf[len + 0] = 0xF0 | ((abcde & 0x1C) >> 2);
  376|     13|                outBuf[len + 1] = 0x80 | ((abcde & 0x03) << 4) | ((inBuf[i + 0 + H_1] & 0x3C) >> 2);
  ------------------
  |  |   61|     13|#define H_1 1
  ------------------
  377|     13|                outBuf[len + 2] = 0x80 | ((inBuf[i + 0 + H_1] & 0x03) << 4) | ((inBuf[i + 2 + H_0] & 0x03) << 2) | ((inBuf[i + 2 + H_1] & 0xC0) >> 6);
  ------------------
  |  |   61|     13|#define H_1 1
  ------------------
                              outBuf[len + 2] = 0x80 | ((inBuf[i + 0 + H_1] & 0x03) << 4) | ((inBuf[i + 2 + H_0] & 0x03) << 2) | ((inBuf[i + 2 + H_1] & 0xC0) >> 6);
  ------------------
  |  |   60|     13|#define H_0 0
  ------------------
                              outBuf[len + 2] = 0x80 | ((inBuf[i + 0 + H_1] & 0x03) << 4) | ((inBuf[i + 2 + H_0] & 0x03) << 2) | ((inBuf[i + 2 + H_1] & 0xC0) >> 6);
  ------------------
  |  |   61|     13|#define H_1 1
  ------------------
  378|     13|                outBuf[len + 3] = 0x80 | ((inBuf[i + 2 + H_1] & 0x3F) >> 0);
  ------------------
  |  |   61|     13|#define H_1 1
  ------------------
  379|       |
  380|     13|                i += 2;
  381|     13|                len += 4;
  382|    226|            } else {
  383|       |                /* 0800-FFFF -> 1110xxxx 10xxxxxx 10xxxxxx */
  384|       |                /* abcdefgh ijklmnop -> 1110abcd 10efghij 10klmnop */
  385|       |
  386|    226|                outBuf[len + 0] = 0xE0 | ((inBuf[i + H_0] & 0xF0) >> 4);
  ------------------
  |  |   60|    226|#define H_0 0
  ------------------
  387|    226|                outBuf[len + 1] = 0x80 | ((inBuf[i + H_0] & 0x0F) << 2) | ((inBuf[i + H_1] & 0xC0) >> 6);
  ------------------
  |  |   60|    226|#define H_0 0
  ------------------
                              outBuf[len + 1] = 0x80 | ((inBuf[i + H_0] & 0x0F) << 2) | ((inBuf[i + H_1] & 0xC0) >> 6);
  ------------------
  |  |   61|    226|#define H_1 1
  ------------------
  388|    226|                outBuf[len + 2] = 0x80 | ((inBuf[i + H_1] & 0x3F) >> 0);
  ------------------
  |  |   61|    226|#define H_1 1
  ------------------
  389|       |
  390|    226|                len += 3;
  391|    226|            }
  392|    340|        }
  393|       |
  394|     92|        *outBufLen = len;
  395|     92|        return PR_TRUE;
  ------------------
  |  |  437|     92|#define PR_TRUE 1
  ------------------
  396|     92|    }
  397|    135|}
sec_port_iso88591_utf8_conversion_function:
  406|    113|{
  407|    113|    unsigned int i, len = 0;
  408|       |
  409|    113|    PORT_Assert((unsigned int *)NULL != outBufLen);
  ------------------
  |  |  120|    113|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|    113|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 113, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  410|       |
  411|    755|    for (i = 0; i < inBufLen; i++) {
  ------------------
  |  Branch (411:17): [True: 642, False: 113]
  ------------------
  412|    642|        if ((inBuf[i] & 0x80) == 0x00)
  ------------------
  |  Branch (412:13): [True: 470, False: 172]
  ------------------
  413|    470|            len += 1;
  414|    172|        else
  415|    172|            len += 2;
  416|    642|    }
  417|       |
  418|    113|    if (len > maxOutBufLen) {
  ------------------
  |  Branch (418:9): [True: 0, False: 113]
  ------------------
  419|      0|        *outBufLen = len;
  420|      0|        return PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  421|      0|    }
  422|       |
  423|    113|    len = 0;
  424|       |
  425|    755|    for (i = 0; i < inBufLen; i++) {
  ------------------
  |  Branch (425:17): [True: 642, False: 113]
  ------------------
  426|    642|        if ((inBuf[i] & 0x80) == 0x00) {
  ------------------
  |  Branch (426:13): [True: 470, False: 172]
  ------------------
  427|       |            /* 00-7F -> 0xxxxxxx */
  428|       |            /* 0abcdefg -> 0abcdefg */
  429|       |
  430|    470|            outBuf[len] = inBuf[i];
  431|    470|            len += 1;
  432|    470|        } else {
  433|       |            /* 80-FF <- 110xxxxx 10xxxxxx */
  434|       |            /* 00000000 abcdefgh -> 110000ab 10cdefgh */
  435|       |
  436|    172|            outBuf[len + 0] = 0xC0 | ((inBuf[i] & 0xC0) >> 6);
  437|    172|            outBuf[len + 1] = 0x80 | ((inBuf[i] & 0x3F) >> 0);
  438|       |
  439|    172|            len += 2;
  440|    172|        }
  441|    642|    }
  442|       |
  443|    113|    *outBufLen = len;
  444|    113|    return PR_TRUE;
  ------------------
  |  |  437|    113|#define PR_TRUE 1
  ------------------
  445|    113|}

NSSUTIL_DoModuleDBFunction:
  899|      2|{
  900|      2|    char *secmod = NULL;
  901|      2|    char *appName = NULL;
  902|      2|    char *filename = NULL;
  903|      2|    NSSDBType dbType = NSS_DB_TYPE_NONE;
  904|      2|    PRBool rw;
  905|      2|    static char *success = "Success";
  906|      2|    char **rvstr = NULL;
  907|       |
  908|      2|    secmod = _NSSUTIL_GetSecmodName(parameters, &dbType, &appName,
  909|      2|                                    &filename, &rw);
  910|      2|    if ((dbType == NSS_DB_TYPE_LEGACY) ||
  ------------------
  |  Branch (910:9): [True: 0, False: 2]
  ------------------
  911|      2|        (dbType == NSS_DB_TYPE_MULTIACCESS)) {
  ------------------
  |  Branch (911:9): [True: 0, False: 2]
  ------------------
  912|       |        /* we can't handle the old database, only softoken can */
  913|      0|        PORT_SetError(SEC_ERROR_LEGACY_DATABASE);
  ------------------
  |  |   65|      0|#define PORT_SetError PORT_SetError_Util
  ------------------
  914|      0|        rvstr = NULL;
  915|      0|        goto done;
  916|      0|    }
  917|       |
  918|      2|    switch (function) {
  ------------------
  |  Branch (918:13): [True: 0, False: 2]
  ------------------
  919|      1|        case SECMOD_MODULE_DB_FUNCTION_FIND:
  ------------------
  |  |  557|      1|#define SECMOD_MODULE_DB_FUNCTION_FIND 0
  ------------------
  |  Branch (919:9): [True: 1, False: 1]
  ------------------
  920|      1|            rvstr = nssutil_ReadSecmodDB(appName, filename,
  921|      1|                                         secmod, (char *)parameters, rw);
  922|      1|            break;
  923|      0|        case SECMOD_MODULE_DB_FUNCTION_ADD:
  ------------------
  |  |  558|      0|#define SECMOD_MODULE_DB_FUNCTION_ADD 1
  ------------------
  |  Branch (923:9): [True: 0, False: 2]
  ------------------
  924|      0|            rvstr = (nssutil_AddSecmodDBEntry(appName, filename,
  ------------------
  |  Branch (924:21): [True: 0, False: 0]
  ------------------
  925|      0|                                              secmod, (char *)args, rw) == SECSuccess)
  926|      0|                        ? &success
  927|      0|                        : NULL;
  928|      0|            break;
  929|      0|        case SECMOD_MODULE_DB_FUNCTION_DEL:
  ------------------
  |  |  559|      0|#define SECMOD_MODULE_DB_FUNCTION_DEL 2
  ------------------
  |  Branch (929:9): [True: 0, False: 2]
  ------------------
  930|      0|            rvstr = (nssutil_DeleteSecmodDBEntry(appName, filename,
  ------------------
  |  Branch (930:21): [True: 0, False: 0]
  ------------------
  931|      0|                                                 secmod, (char *)args, rw) == SECSuccess)
  932|      0|                        ? &success
  933|      0|                        : NULL;
  934|      0|            break;
  935|      1|        case SECMOD_MODULE_DB_FUNCTION_RELEASE:
  ------------------
  |  |  560|      1|#define SECMOD_MODULE_DB_FUNCTION_RELEASE 3
  ------------------
  |  Branch (935:9): [True: 1, False: 1]
  ------------------
  936|      1|            rvstr = (nssutil_ReleaseSecmodDBData(appName, filename,
  ------------------
  |  Branch (936:21): [True: 1, False: 0]
  ------------------
  937|      1|                                                 secmod, (char **)args, rw) == SECSuccess)
  938|      1|                        ? &success
  939|      1|                        : NULL;
  940|      1|            break;
  941|      2|    }
  942|      2|done:
  943|      2|    if (secmod)
  ------------------
  |  Branch (943:9): [True: 0, False: 2]
  ------------------
  944|      0|        PR_smprintf_free(secmod);
  945|      2|    if (appName)
  ------------------
  |  Branch (945:9): [True: 0, False: 2]
  ------------------
  946|      0|        PORT_Free(appName);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  947|      2|    if (filename)
  ------------------
  |  Branch (947:9): [True: 0, False: 2]
  ------------------
  948|      0|        PORT_Free(filename);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  949|      2|    return rvstr;
  950|      2|}
utilmod.c:nssutil_ReadSecmodDB:
  375|      1|{
  376|      1|    FILE *fd = NULL;
  377|      1|    char **moduleList = NULL;
  378|      1|    int moduleCount = 1;
  379|      1|    int useCount = SECMOD_STEP;
  ------------------
  |  |  294|      1|#define SECMOD_STEP 10
  ------------------
  380|      1|    char line[MAX_LINE_LENGTH];
  381|      1|    PRBool internal = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  382|      1|    PRBool skipParams = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  383|      1|    char *moduleString = NULL;
  384|      1|    char *paramsValue = NULL;
  385|      1|    PRBool failed = PR_TRUE;
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  386|       |
  387|      1|    moduleList = (char **)PORT_ZAlloc(useCount * sizeof(char *));
  ------------------
  |  |   72|      1|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  388|      1|    if (moduleList == NULL)
  ------------------
  |  Branch (388:9): [True: 0, False: 1]
  ------------------
  389|      0|        return NULL;
  390|       |
  391|      1|    if (dbname == NULL) {
  ------------------
  |  Branch (391:9): [True: 1, False: 0]
  ------------------
  392|      1|        goto return_default;
  393|      1|    }
  394|       |
  395|       |    /* do we really want to use streams here */
  396|      0|    fd = os_fopen(dbname, "r");
  ------------------
  |  |  215|      0|#define os_fopen fopen
  ------------------
  397|      0|    if (fd == NULL)
  ------------------
  |  Branch (397:9): [True: 0, False: 0]
  ------------------
  398|      0|        goto done;
  399|       |
  400|       |    /*
  401|       |     * the following loop takes line separated config lines and collapses
  402|       |     * the lines to a single string, escaping and quoting as necessary.
  403|       |     */
  404|       |    /* loop state variables */
  405|      0|    moduleString = NULL;   /* current concatenated string */
  406|      0|    internal = PR_FALSE;   /* is this an internal module */
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  407|      0|    skipParams = PR_FALSE; /* did we find an override parameter block*/
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  408|      0|    paramsValue = NULL;    /* the current parameter block value */
  409|      0|    do {
  410|      0|        int len;
  411|       |
  412|      0|        if (fgets(line, sizeof(line), fd) == NULL) {
  ------------------
  |  Branch (412:13): [True: 0, False: 0]
  ------------------
  413|      0|            goto endloop;
  414|      0|        }
  415|       |
  416|       |        /* remove the ending newline */
  417|      0|        len = PORT_Strlen(line);
  ------------------
  |  |  190|      0|#define PORT_Strlen(s) strlen(s)
  ------------------
  418|      0|        if (len >= 2 && line[len - 2] == '\r' && line[len - 1] == '\n') {
  ------------------
  |  Branch (418:13): [True: 0, False: 0]
  |  Branch (418:25): [True: 0, False: 0]
  |  Branch (418:50): [True: 0, False: 0]
  ------------------
  419|      0|            len = len - 2;
  420|      0|            line[len] = 0;
  421|      0|        } else if (len && (line[len - 1] == '\n' || line[len - 1] == '\r')) {
  ------------------
  |  Branch (421:20): [True: 0, False: 0]
  |  Branch (421:28): [True: 0, False: 0]
  |  Branch (421:53): [True: 0, False: 0]
  ------------------
  422|      0|            len--;
  423|      0|            line[len] = 0;
  424|      0|        }
  425|      0|        if (*line == '#') {
  ------------------
  |  Branch (425:13): [True: 0, False: 0]
  ------------------
  426|      0|            continue;
  427|      0|        }
  428|      0|        if (*line != 0) {
  ------------------
  |  Branch (428:13): [True: 0, False: 0]
  ------------------
  429|       |            /*
  430|       |             * The PKCS #11 group standard assumes blocks of strings
  431|       |             * separated by new lines, clumped by new lines. Internally
  432|       |             * we take strings separated by spaces, so we may need to escape
  433|       |             * certain spaces.
  434|       |             */
  435|      0|            char *value = PORT_Strchr(line, '=');
  ------------------
  |  |  186|      0|#define PORT_Strchr strchr
  ------------------
  436|       |
  437|       |            /* there is no value, write out the stanza as is */
  438|      0|            if (value == NULL || value[1] == 0) {
  ------------------
  |  Branch (438:17): [True: 0, False: 0]
  |  Branch (438:34): [True: 0, False: 0]
  ------------------
  439|      0|                if (moduleString) {
  ------------------
  |  Branch (439:21): [True: 0, False: 0]
  ------------------
  440|      0|                    moduleString = nssutil_DupnCat(moduleString, " ", 1);
  441|      0|                    if (moduleString == NULL)
  ------------------
  |  Branch (441:25): [True: 0, False: 0]
  ------------------
  442|      0|                        goto loser;
  443|      0|                }
  444|      0|                moduleString = nssutil_DupCat(moduleString, line);
  445|      0|                if (moduleString == NULL)
  ------------------
  |  Branch (445:21): [True: 0, False: 0]
  ------------------
  446|      0|                    goto loser;
  447|       |                /* value is already quoted, just write it out */
  448|      0|            } else if (value[1] == '"') {
  ------------------
  |  Branch (448:24): [True: 0, False: 0]
  ------------------
  449|      0|                if (moduleString) {
  ------------------
  |  Branch (449:21): [True: 0, False: 0]
  ------------------
  450|      0|                    moduleString = nssutil_DupnCat(moduleString, " ", 1);
  451|      0|                    if (moduleString == NULL)
  ------------------
  |  Branch (451:25): [True: 0, False: 0]
  ------------------
  452|      0|                        goto loser;
  453|      0|                }
  454|      0|                moduleString = nssutil_DupCat(moduleString, line);
  455|      0|                if (moduleString == NULL)
  ------------------
  |  Branch (455:21): [True: 0, False: 0]
  ------------------
  456|      0|                    goto loser;
  457|       |                /* we have an override parameter section, remember that
  458|       |                 * we found this (see following comment about why this
  459|       |                 * is necessary). */
  460|      0|                if (PORT_Strncasecmp(line, "parameters", 10) == 0) {
  ------------------
  |  |  191|      0|#define PORT_Strncasecmp PL_strncasecmp
  ------------------
  |  Branch (460:21): [True: 0, False: 0]
  ------------------
  461|      0|                    skipParams = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  462|      0|                }
  463|       |                /*
  464|       |                 * The internal token always overrides it's parameter block
  465|       |                 * from the passed in parameters, so wait until then end
  466|       |                 * before we include the parameter block in case we need to
  467|       |                 * override it. NOTE: if the parameter block is quoted with ("),
  468|       |                 * this override does not happen. This allows you to override
  469|       |                 * the application's parameter configuration.
  470|       |                 *
  471|       |                 * parameter block state is controlled by the following variables:
  472|       |                 *  skipParams - Bool : set to true of we have an override param
  473|       |                 *    block (all other blocks, either implicit or explicit are
  474|       |                 *    ignored).
  475|       |                 *  paramsValue - char * : pointer to the current param block. In
  476|       |                 *    the absence of overrides, paramsValue is set to the first
  477|       |                 *    parameter block we find. All subsequent blocks are ignored.
  478|       |                 *    When we find an internal token, the application passed
  479|       |                 *    parameters take precident.
  480|       |                 */
  481|      0|            } else if (PORT_Strncasecmp(line, "parameters", 10) == 0) {
  ------------------
  |  |  191|      0|#define PORT_Strncasecmp PL_strncasecmp
  ------------------
  |  Branch (481:24): [True: 0, False: 0]
  ------------------
  482|       |                /* already have parameters */
  483|      0|                if (paramsValue) {
  ------------------
  |  Branch (483:21): [True: 0, False: 0]
  ------------------
  484|      0|                    continue;
  485|      0|                }
  486|      0|                paramsValue = NSSUTIL_Quote(&value[1], '"');
  487|      0|                if (paramsValue == NULL)
  ------------------
  |  Branch (487:21): [True: 0, False: 0]
  ------------------
  488|      0|                    goto loser;
  489|      0|                continue;
  490|      0|            } else {
  491|       |                /* may need to quote */
  492|      0|                char *newLine;
  493|      0|                if (moduleString) {
  ------------------
  |  Branch (493:21): [True: 0, False: 0]
  ------------------
  494|      0|                    moduleString = nssutil_DupnCat(moduleString, " ", 1);
  495|      0|                    if (moduleString == NULL)
  ------------------
  |  Branch (495:25): [True: 0, False: 0]
  ------------------
  496|      0|                        goto loser;
  497|      0|                }
  498|      0|                moduleString = nssutil_DupnCat(moduleString, line, value - line + 1);
  499|      0|                if (moduleString == NULL)
  ------------------
  |  Branch (499:21): [True: 0, False: 0]
  ------------------
  500|      0|                    goto loser;
  501|      0|                newLine = NSSUTIL_Quote(&value[1], '"');
  502|      0|                if (newLine == NULL)
  ------------------
  |  Branch (502:21): [True: 0, False: 0]
  ------------------
  503|      0|                    goto loser;
  504|      0|                moduleString = nssutil_DupCat(moduleString, newLine);
  505|      0|                PORT_Free(newLine);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  506|      0|                if (moduleString == NULL)
  ------------------
  |  Branch (506:21): [True: 0, False: 0]
  ------------------
  507|      0|                    goto loser;
  508|      0|            }
  509|       |
  510|       |            /* check to see if it's internal? */
  511|      0|            if (PORT_Strncasecmp(line, "NSS=", 4) == 0) {
  ------------------
  |  |  191|      0|#define PORT_Strncasecmp PL_strncasecmp
  ------------------
  |  Branch (511:17): [True: 0, False: 0]
  ------------------
  512|       |                /* This should be case insensitive! reviewers make
  513|       |                 * me fix it if it's not */
  514|      0|                if (PORT_Strstr(line, "internal")) {
  ------------------
  |  |  196|      0|#define PORT_Strstr strstr
  ------------------
  |  Branch (514:21): [True: 0, False: 0]
  ------------------
  515|      0|                    internal = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  516|       |                    /* override the parameters */
  517|      0|                    if (paramsValue) {
  ------------------
  |  Branch (517:25): [True: 0, False: 0]
  ------------------
  518|      0|                        PORT_Free(paramsValue);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  519|      0|                    }
  520|      0|                    paramsValue = NSSUTIL_Quote(params, '"');
  521|      0|                }
  522|      0|            }
  523|      0|            continue;
  524|      0|        }
  525|      0|        if ((moduleString == NULL) || (*moduleString == 0)) {
  ------------------
  |  Branch (525:13): [True: 0, False: 0]
  |  Branch (525:39): [True: 0, False: 0]
  ------------------
  526|      0|            continue;
  527|      0|        }
  528|       |
  529|      0|    endloop:
  530|       |        /*
  531|       |         * if we are here, we have found a complete stanza. Now write out
  532|       |         * any param section we may have found.
  533|       |         */
  534|      0|        if (paramsValue) {
  ------------------
  |  Branch (534:13): [True: 0, False: 0]
  ------------------
  535|       |            /* we had an override */
  536|      0|            if (!skipParams) {
  ------------------
  |  Branch (536:17): [True: 0, False: 0]
  ------------------
  537|      0|                moduleString = nssutil_DupnCat(moduleString, " parameters=", 12);
  538|      0|                if (moduleString == NULL)
  ------------------
  |  Branch (538:21): [True: 0, False: 0]
  ------------------
  539|      0|                    goto loser;
  540|      0|                moduleString = nssutil_DupCat(moduleString, paramsValue);
  541|      0|                if (moduleString == NULL)
  ------------------
  |  Branch (541:21): [True: 0, False: 0]
  ------------------
  542|      0|                    goto loser;
  543|      0|            }
  544|      0|            PORT_Free(paramsValue);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  545|      0|            paramsValue = NULL;
  546|      0|        }
  547|       |
  548|      0|        if ((moduleCount + 1) >= useCount) {
  ------------------
  |  Branch (548:13): [True: 0, False: 0]
  ------------------
  549|      0|            SECStatus rv;
  550|      0|            rv = nssutil_growList(&moduleList, &useCount, moduleCount + 1);
  551|      0|            if (rv != SECSuccess) {
  ------------------
  |  Branch (551:17): [True: 0, False: 0]
  ------------------
  552|      0|                goto loser;
  553|      0|            }
  554|      0|        }
  555|       |
  556|      0|        if (internal) {
  ------------------
  |  Branch (556:13): [True: 0, False: 0]
  ------------------
  557|      0|            moduleList[0] = moduleString;
  558|      0|        } else {
  559|      0|            moduleList[moduleCount] = moduleString;
  560|      0|            moduleCount++;
  561|      0|        }
  562|      0|        moduleString = NULL;
  563|      0|        internal = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  564|      0|        skipParams = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  565|      0|    } while (!feof(fd));
  ------------------
  |  Branch (565:14): [True: 0, False: 0]
  ------------------
  566|       |
  567|      0|    if (moduleString) {
  ------------------
  |  Branch (567:9): [True: 0, False: 0]
  ------------------
  568|      0|        PORT_Free(moduleString);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  569|      0|        moduleString = NULL;
  570|      0|    }
  571|      0|done:
  572|       |#ifndef NSS_DISABLE_DBM
  573|       |    /* if we couldn't open a pkcs11 database, look for the old one */
  574|       |    if (fd == NULL) {
  575|       |        char *olddbname = _NSSUTIL_GetOldSecmodName(dbname, filename);
  576|       |        PRStatus status;
  577|       |
  578|       |        /* couldn't get the old name */
  579|       |        if (!olddbname) {
  580|       |            goto bail;
  581|       |        }
  582|       |
  583|       |        /* old one exists */
  584|       |        status = _NSSUTIL_Access(olddbname, PR_ACCESS_EXISTS);
  585|       |        if (status == PR_SUCCESS) {
  586|       |            PR_smprintf_free(olddbname);
  587|       |            PORT_ZFree(moduleList, useCount * sizeof(char *));
  588|       |            PORT_SetError(SEC_ERROR_LEGACY_DATABASE);
  589|       |            return NULL;
  590|       |        }
  591|       |
  592|       |    bail:
  593|       |        if (olddbname) {
  594|       |            PR_smprintf_free(olddbname);
  595|       |        }
  596|       |    }
  597|       |#endif // NSS_DISABLE_DBM
  598|       |
  599|      1|return_default:
  600|       |
  601|      1|    if (!moduleList[0]) {
  ------------------
  |  Branch (601:9): [True: 1, False: 0]
  ------------------
  602|      1|        char *newParams;
  603|      1|        moduleString = PORT_Strdup(NSSUTIL_DEFAULT_INTERNAL_INIT1);
  ------------------
  |  |   69|      1|#define PORT_Strdup PORT_Strdup_Util
  ------------------
                      moduleString = PORT_Strdup(NSSUTIL_DEFAULT_INTERNAL_INIT1);
  ------------------
  |  |   40|      1|    "library= name=\"NSS Internal PKCS #11 Module\" parameters="
  ------------------
  604|      1|        newParams = NSSUTIL_Quote(params, '"');
  605|      1|        if (newParams == NULL)
  ------------------
  |  Branch (605:13): [True: 0, False: 1]
  ------------------
  606|      0|            goto loser;
  607|      1|        moduleString = nssutil_DupCat(moduleString, newParams);
  608|      1|        PORT_Free(newParams);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  609|      1|        if (moduleString == NULL)
  ------------------
  |  Branch (609:13): [True: 0, False: 1]
  ------------------
  610|      0|            goto loser;
  611|      1|        moduleString = nssutil_DupCat(moduleString,
  612|      1|                                      NSSUTIL_DEFAULT_INTERNAL_INIT2);
  ------------------
  |  |   42|      1|    " NSS=\"Flags=internal,critical trustOrder=75 cipherOrder=100 slotParams=(1={"
  ------------------
  613|      1|        if (moduleString == NULL)
  ------------------
  |  Branch (613:13): [True: 0, False: 1]
  ------------------
  614|      0|            goto loser;
  615|      1|        moduleString = nssutil_DupCat(moduleString,
  616|      1|                                      NSSUTIL_DEFAULT_SFTKN_FLAGS);
  ------------------
  |  |   46|      1|    "slotFlags=[ECC,RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512]"
  ------------------
  617|      1|        if (moduleString == NULL)
  ------------------
  |  Branch (617:13): [True: 0, False: 1]
  ------------------
  618|      0|            goto loser;
  619|      1|        moduleString = nssutil_DupCat(moduleString,
  620|      1|                                      NSSUTIL_DEFAULT_INTERNAL_INIT3);
  ------------------
  |  |   44|      1|    " askpw=any timeout=30})\""
  ------------------
  621|      1|        if (moduleString == NULL)
  ------------------
  |  Branch (621:13): [True: 0, False: 1]
  ------------------
  622|      0|            goto loser;
  623|      1|        moduleList[0] = moduleString;
  624|      1|        moduleString = NULL;
  625|      1|    }
  626|      1|    failed = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  627|       |
  628|      1|loser:
  629|       |    /*
  630|       |     * cleanup
  631|       |     */
  632|       |    /* deal with trust cert db here */
  633|      1|    if (moduleString) {
  ------------------
  |  Branch (633:9): [True: 0, False: 1]
  ------------------
  634|      0|        PORT_Free(moduleString);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  635|      0|        moduleString = NULL;
  636|      0|    }
  637|      1|    if (paramsValue) {
  ------------------
  |  Branch (637:9): [True: 0, False: 1]
  ------------------
  638|      0|        PORT_Free(paramsValue);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  639|      0|        paramsValue = NULL;
  640|      0|    }
  641|      1|    if (failed || (moduleList[0] == NULL)) {
  ------------------
  |  Branch (641:9): [True: 0, False: 1]
  |  Branch (641:19): [True: 0, False: 1]
  ------------------
  642|       |        /* This is wrong! FIXME */
  643|      0|        nssutil_releaseSpecList(moduleList);
  644|      0|        moduleList = NULL;
  645|      0|        failed = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  646|      0|    }
  647|      1|    if (fd != NULL) {
  ------------------
  |  Branch (647:9): [True: 0, False: 1]
  ------------------
  648|      0|        fclose(fd);
  649|      1|    } else if (!failed && rw) {
  ------------------
  |  Branch (649:16): [True: 1, False: 0]
  |  Branch (649:27): [True: 0, False: 1]
  ------------------
  650|       |        /* update our internal module */
  651|      0|        nssutil_AddSecmodDBEntry(appName, filename, dbname, moduleList[0], rw);
  652|      0|    }
  653|      1|    return moduleList;
  654|      1|}
utilmod.c:nssutil_DupnCat:
  255|      4|{
  256|      4|    int baseStringLen = baseString ? PORT_Strlen(baseString) : 0;
  ------------------
  |  |  190|      4|#define PORT_Strlen(s) strlen(s)
  ------------------
  |  Branch (256:25): [True: 4, False: 0]
  ------------------
  257|      4|    int len = baseStringLen + 1;
  258|      4|    char *newString;
  259|       |
  260|      4|    len += str_len;
  261|      4|    newString = (char *)PORT_Realloc(baseString, len);
  ------------------
  |  |   64|      4|#define PORT_Realloc PORT_Realloc_Util
  ------------------
  262|      4|    if (newString == NULL) {
  ------------------
  |  Branch (262:9): [True: 0, False: 4]
  ------------------
  263|      0|        PORT_Free(baseString);
  ------------------
  |  |   60|      0|#define PORT_Free PORT_Free_Util
  ------------------
  264|      0|        return NULL;
  265|      0|    }
  266|      4|    PORT_Memcpy(&newString[baseStringLen], str, str_len);
  ------------------
  |  |  180|      4|#define PORT_Memcpy memcpy
  ------------------
  267|      4|    newString[len - 1] = 0;
  268|      4|    return newString;
  269|      4|}
utilmod.c:nssutil_DupCat:
  275|      4|{
  276|      4|    return nssutil_DupnCat(baseString, str, PORT_Strlen(str));
  ------------------
  |  |  190|      4|#define PORT_Strlen(s) strlen(s)
  ------------------
  277|      4|}
utilmod.c:nssutil_releaseSpecList:
  283|      1|{
  284|      1|    if (moduleSpecList) {
  ------------------
  |  Branch (284:9): [True: 1, False: 0]
  ------------------
  285|      1|        char **index;
  286|      2|        for (index = moduleSpecList; *index; index++) {
  ------------------
  |  Branch (286:38): [True: 1, False: 1]
  ------------------
  287|      1|            PORT_Free(*index);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  288|      1|        }
  289|      1|        PORT_Free(moduleSpecList);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  290|      1|    }
  291|      1|    return SECSuccess;
  292|      1|}
utilmod.c:nssutil_ReleaseSecmodDBData:
  660|      1|{
  661|      1|    if (moduleSpecList) {
  ------------------
  |  Branch (661:9): [True: 1, False: 0]
  ------------------
  662|      1|        nssutil_releaseSpecList(moduleSpecList);
  663|      1|    }
  664|      1|    return SECSuccess;
  665|      1|}

NSSUTIL_ArgGetPair:
   20|     90|{
   21|     90|    switch (c) {
   22|     75|        case '\'':
  ------------------
  |  Branch (22:9): [True: 75, False: 15]
  ------------------
   23|     75|            return c;
   24|      6|        case '\"':
  ------------------
  |  Branch (24:9): [True: 6, False: 84]
  ------------------
   25|      6|            return c;
   26|      0|        case '<':
  ------------------
  |  Branch (26:9): [True: 0, False: 90]
  ------------------
   27|      0|            return '>';
   28|      2|        case '{':
  ------------------
  |  Branch (28:9): [True: 2, False: 88]
  ------------------
   29|      2|            return '}';
   30|      5|        case '[':
  ------------------
  |  Branch (30:9): [True: 5, False: 85]
  ------------------
   31|      5|            return ']';
   32|      2|        case '(':
  ------------------
  |  Branch (32:9): [True: 2, False: 88]
  ------------------
   33|      2|            return ')';
   34|      0|        default:
  ------------------
  |  Branch (34:9): [True: 0, False: 90]
  ------------------
   35|      0|            break;
   36|     90|    }
   37|      0|    return ' ';
   38|     90|}
NSSUTIL_ArgIsBlank:
   42|  3.36k|{
   43|  3.36k|    return isspace((unsigned char)c);
   44|  3.36k|}
NSSUTIL_ArgIsEscape:
   48|  6.98k|{
   49|  6.98k|    return c == '\\';
   50|  6.98k|}
NSSUTIL_ArgIsQuote:
   54|    219|{
   55|    219|    switch (c) {
   56|     86|        case '\'':
  ------------------
  |  Branch (56:9): [True: 86, False: 133]
  ------------------
   57|     98|        case '\"':
  ------------------
  |  Branch (57:9): [True: 12, False: 207]
  ------------------
   58|     98|        case '<':
  ------------------
  |  Branch (58:9): [True: 0, False: 219]
  ------------------
   59|    101|        case '{': /* } end curly to keep vi bracket matching working */
  ------------------
  |  Branch (59:9): [True: 3, False: 216]
  ------------------
   60|    104|        case '(': /* ) */
  ------------------
  |  Branch (60:9): [True: 3, False: 216]
  ------------------
   61|    110|        case '[': /* ] */
  ------------------
  |  Branch (61:9): [True: 6, False: 213]
  ------------------
   62|    110|            return PR_TRUE;
  ------------------
  |  |  437|    110|#define PR_TRUE 1
  ------------------
   63|    109|        default:
  ------------------
  |  Branch (63:9): [True: 109, False: 110]
  ------------------
   64|    109|            break;
   65|    219|    }
   66|    109|    return PR_FALSE;
  ------------------
  |  |  438|    109|#define PR_FALSE 0
  ------------------
   67|    219|}
NSSUTIL_ArgStrip:
   71|    121|{
   72|    205|    while (*c && NSSUTIL_ArgIsBlank(*c))
  ------------------
  |  Branch (72:12): [True: 191, False: 14]
  |  Branch (72:18): [True: 84, False: 107]
  ------------------
   73|     84|        c++;
   74|    121|    return c;
   75|    121|}
NSSUTIL_ArgFindEnd:
   83|    155|{
   84|    155|    char endChar = ' ';
   85|    155|    PRBool lastEscape = PR_FALSE;
  ------------------
  |  |  438|    155|#define PR_FALSE 0
  ------------------
   86|       |
   87|    155|    if (NSSUTIL_ArgIsQuote(*string)) {
  ------------------
  |  Branch (87:9): [True: 90, False: 65]
  ------------------
   88|     90|        endChar = NSSUTIL_ArgGetPair(*string);
   89|     90|        string++;
   90|     90|    }
   91|       |
   92|  4.10k|    for (; *string; string++) {
  ------------------
  |  Branch (92:12): [True: 4.08k, False: 22]
  ------------------
   93|  4.08k|        if (lastEscape) {
  ------------------
  |  Branch (93:13): [True: 0, False: 4.08k]
  ------------------
   94|      0|            lastEscape = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
   95|      0|            continue;
   96|      0|        }
   97|  4.08k|        if (NSSUTIL_ArgIsEscape(*string) && !lastEscape) {
  ------------------
  |  Branch (97:13): [True: 0, False: 4.08k]
  |  Branch (97:45): [True: 0, False: 0]
  ------------------
   98|      0|            lastEscape = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
   99|      0|            continue;
  100|      0|        }
  101|  4.08k|        if ((endChar == ' ') && NSSUTIL_ArgIsBlank(*string))
  ------------------
  |  Branch (101:13): [True: 2.37k, False: 1.70k]
  |  Branch (101:33): [True: 43, False: 2.33k]
  ------------------
  102|     43|            break;
  103|  4.04k|        if (*string == endChar) {
  ------------------
  |  Branch (103:13): [True: 90, False: 3.95k]
  ------------------
  104|     90|            break;
  105|     90|        }
  106|  4.04k|    }
  107|       |
  108|    155|    return string;
  109|    155|}
NSSUTIL_ArgFetchValue:
  117|     65|{
  118|     65|    const char *end = NSSUTIL_ArgFindEnd(string);
  119|     65|    char *retString, *copyString;
  120|     65|    PRBool lastEscape = PR_FALSE;
  ------------------
  |  |  438|     65|#define PR_FALSE 0
  ------------------
  121|     65|    int len;
  122|       |
  123|     65|    len = end - string;
  124|     65|    if (len == 0) {
  ------------------
  |  Branch (124:9): [True: 1, False: 64]
  ------------------
  125|      1|        *pcount = 0;
  126|      1|        return NULL;
  127|      1|    }
  128|       |
  129|     64|    copyString = retString = (char *)PORT_Alloc(len + 1);
  ------------------
  |  |   52|     64|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  130|       |
  131|     64|    if (*end)
  ------------------
  |  Branch (131:9): [True: 48, False: 16]
  ------------------
  132|     48|        len++;
  133|     64|    *pcount = len;
  134|     64|    if (retString == NULL)
  ------------------
  |  Branch (134:9): [True: 0, False: 64]
  ------------------
  135|      0|        return NULL;
  136|       |
  137|     64|    if (NSSUTIL_ArgIsQuote(*string))
  ------------------
  |  Branch (137:9): [True: 20, False: 44]
  ------------------
  138|     20|        string++;
  139|  2.96k|    for (; string < end; string++) {
  ------------------
  |  Branch (139:12): [True: 2.90k, False: 64]
  ------------------
  140|  2.90k|        if (NSSUTIL_ArgIsEscape(*string) && !lastEscape) {
  ------------------
  |  Branch (140:13): [True: 0, False: 2.90k]
  |  Branch (140:45): [True: 0, False: 0]
  ------------------
  141|      0|            lastEscape = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  142|      0|            continue;
  143|      0|        }
  144|  2.90k|        lastEscape = PR_FALSE;
  ------------------
  |  |  438|  2.90k|#define PR_FALSE 0
  ------------------
  145|  2.90k|        *copyString++ = *string;
  146|  2.90k|    }
  147|     64|    *copyString = 0;
  148|     64|    return retString;
  149|     64|}
NSSUTIL_ArgSkipParameter:
  156|     90|{
  157|     90|    const char *end;
  158|       |    /* look for the end of the <name>= */
  159|    885|    for (; *string; string++) {
  ------------------
  |  Branch (159:12): [True: 885, False: 0]
  ------------------
  160|    885|        if (*string == '=') {
  ------------------
  |  Branch (160:13): [True: 90, False: 795]
  ------------------
  161|     90|            string++;
  162|     90|            break;
  163|     90|        }
  164|    795|        if (NSSUTIL_ArgIsBlank(*string))
  ------------------
  |  Branch (164:13): [True: 0, False: 795]
  ------------------
  165|      0|            return (string);
  166|    795|    }
  167|       |
  168|     90|    end = NSSUTIL_ArgFindEnd(string);
  169|     90|    if (*end)
  ------------------
  |  Branch (169:9): [True: 84, False: 6]
  ------------------
  170|     84|        end++;
  171|     90|    return end;
  172|     90|}
NSSUTIL_ArgGetParamValue:
  179|     52|{
  180|     52|    char searchValue[256];
  181|     52|    size_t paramLen = strlen(paramName);
  182|     52|    char *returnValue = NULL;
  183|     52|    int next;
  184|       |
  185|     52|    if ((parameters == NULL) || (*parameters == 0))
  ------------------
  |  Branch (185:9): [True: 0, False: 52]
  |  Branch (185:33): [True: 0, False: 52]
  ------------------
  186|      0|        return NULL;
  187|       |
  188|     52|    PORT_Assert(paramLen + 2 < sizeof(searchValue));
  ------------------
  |  |  120|     52|#define PORT_Assert PR_ASSERT
  |  |  ------------------
  |  |  |  |  208|     52|    ((_expr)?((void)0):PR_Assert(# _expr,__FILE__,__LINE__))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (208:6): [True: 52, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|       |
  190|     52|    PORT_Strcpy(searchValue, paramName);
  ------------------
  |  |  189|     52|#define PORT_Strcpy strcpy
  ------------------
  191|     52|    PORT_Strcat(searchValue, "=");
  ------------------
  |  |  185|     52|#define PORT_Strcat strcat
  ------------------
  192|    123|    while (*parameters) {
  ------------------
  |  Branch (192:12): [True: 116, False: 7]
  ------------------
  193|    116|        if (PORT_Strncasecmp(parameters, searchValue, paramLen + 1) == 0) {
  ------------------
  |  |  191|    116|#define PORT_Strncasecmp PL_strncasecmp
  ------------------
  |  Branch (193:13): [True: 45, False: 71]
  ------------------
  194|     45|            parameters += paramLen + 1;
  195|     45|            returnValue = NSSUTIL_ArgFetchValue(parameters, &next);
  196|     45|            break;
  197|     71|        } else {
  198|     71|            parameters = NSSUTIL_ArgSkipParameter(parameters);
  199|     71|        }
  200|     71|        parameters = NSSUTIL_ArgStrip(parameters);
  201|     71|    }
  202|     52|    return returnValue;
  203|     52|}
NSSUTIL_ArgNextFlag:
  210|    137|{
  211|  1.32k|    for (; *flags; flags++) {
  ------------------
  |  Branch (211:12): [True: 1.30k, False: 23]
  ------------------
  212|  1.30k|        if (*flags == ',') {
  ------------------
  |  Branch (212:13): [True: 114, False: 1.18k]
  ------------------
  213|    114|            flags++;
  214|    114|            break;
  215|    114|        }
  216|  1.30k|    }
  217|    137|    return flags;
  218|    137|}
NSSUTIL_ArgHasFlag:
  225|     41|{
  226|     41|    char *flags;
  227|     41|    const char *index;
  228|     41|    int len = strlen(flag);
  229|     41|    PRBool found = PR_FALSE;
  ------------------
  |  |  438|     41|#define PR_FALSE 0
  ------------------
  230|       |
  231|     41|    flags = NSSUTIL_ArgGetParamValue(label, parameters);
  232|     41|    if (flags == NULL)
  ------------------
  |  Branch (232:9): [True: 2, False: 39]
  ------------------
  233|      2|        return PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
  234|       |
  235|    158|    for (index = flags; *index; index = NSSUTIL_ArgNextFlag(index)) {
  ------------------
  |  Branch (235:25): [True: 136, False: 22]
  ------------------
  236|    136|        if (PORT_Strncasecmp(index, flag, len) == 0) {
  ------------------
  |  |  191|    136|#define PORT_Strncasecmp PL_strncasecmp
  ------------------
  |  Branch (236:13): [True: 17, False: 119]
  ------------------
  237|     17|            found = PR_TRUE;
  ------------------
  |  |  437|     17|#define PR_TRUE 1
  ------------------
  238|     17|            break;
  239|     17|        }
  240|    136|    }
  241|     39|    PORT_Free(flags);
  ------------------
  |  |   60|     39|#define PORT_Free PORT_Free_Util
  ------------------
  242|     39|    return found;
  243|     41|}
NSSUTIL_ArgDecodeNumber:
  250|      4|{
  251|      4|    int radix = 10;
  252|      4|    unsigned long value = 0;
  253|      4|    long retValue = 0;
  254|      4|    int sign = 1;
  255|      4|    int digit;
  256|       |
  257|      4|    if (num == NULL)
  ------------------
  |  Branch (257:9): [True: 0, False: 4]
  ------------------
  258|      0|        return retValue;
  259|       |
  260|      4|    num = NSSUTIL_ArgStrip(num);
  261|       |
  262|      4|    if (*num == '-') {
  ------------------
  |  Branch (262:9): [True: 0, False: 4]
  ------------------
  263|      0|        sign = -1;
  264|      0|        num++;
  265|      0|    }
  266|       |
  267|      4|    if (*num == '0') {
  ------------------
  |  Branch (267:9): [True: 0, False: 4]
  ------------------
  268|      0|        radix = 8;
  269|      0|        num++;
  270|      0|        if ((*num == 'x') || (*num == 'X')) {
  ------------------
  |  Branch (270:13): [True: 0, False: 0]
  |  Branch (270:30): [True: 0, False: 0]
  ------------------
  271|      0|            radix = 16;
  272|      0|            num++;
  273|      0|        }
  274|      0|    }
  275|       |
  276|     12|    for (; *num; num++) {
  ------------------
  |  Branch (276:12): [True: 8, False: 4]
  ------------------
  277|      8|        if (isdigit((unsigned char)*num)) {
  278|      8|            digit = *num - '0';
  279|      8|        } else if ((*num >= 'a') && (*num <= 'f')) {
  ------------------
  |  Branch (279:20): [True: 0, False: 0]
  |  Branch (279:37): [True: 0, False: 0]
  ------------------
  280|      0|            digit = *num - 'a' + 10;
  281|      0|        } else if ((*num >= 'A') && (*num <= 'F')) {
  ------------------
  |  Branch (281:20): [True: 0, False: 0]
  |  Branch (281:37): [True: 0, False: 0]
  ------------------
  282|      0|            digit = *num - 'A' + 10;
  283|      0|        } else {
  284|      0|            break;
  285|      0|        }
  286|      8|        if (digit >= radix)
  ------------------
  |  Branch (286:13): [True: 0, False: 8]
  ------------------
  287|      0|            break;
  288|      8|        value = value * radix + digit;
  289|      8|    }
  290|       |
  291|      4|    retValue = ((int)value) * sign;
  292|      4|    return retValue;
  293|      4|}
NSSUTIL_ArgGetLabel:
  301|      1|{
  302|      1|    char *name = NULL;
  303|      1|    const char *string;
  304|      1|    int len;
  305|       |
  306|       |    /* look for the end of the <label>= */
  307|      2|    for (string = inString; *string; string++) {
  ------------------
  |  Branch (307:29): [True: 2, False: 0]
  ------------------
  308|      2|        if (*string == '=') {
  ------------------
  |  Branch (308:13): [True: 1, False: 1]
  ------------------
  309|      1|            break;
  310|      1|        }
  311|      1|        if (NSSUTIL_ArgIsBlank(*string))
  ------------------
  |  Branch (311:13): [True: 0, False: 1]
  ------------------
  312|      0|            break;
  313|      1|    }
  314|       |
  315|      1|    len = string - inString;
  316|       |
  317|      1|    *next = len;
  318|      1|    if (*string == '=')
  ------------------
  |  Branch (318:9): [True: 1, False: 0]
  ------------------
  319|      1|        (*next) += 1;
  320|      1|    if (len > 0) {
  ------------------
  |  Branch (320:9): [True: 1, False: 0]
  ------------------
  321|      1|        name = PORT_Alloc(len + 1);
  ------------------
  |  |   52|      1|#define PORT_Alloc PORT_Alloc_Util
  ------------------
  322|      1|        PORT_Strncpy(name, inString, len);
  ------------------
  |  |  194|      1|#define PORT_Strncpy strncpy
  ------------------
  323|      1|        name[len] = 0;
  324|      1|    }
  325|      1|    return name;
  326|      1|}
NSSUTIL_ArgReadLong:
  334|      5|{
  335|      5|    char *value;
  336|      5|    long retValue;
  337|      5|    if (isdefault)
  ------------------
  |  Branch (337:9): [True: 0, False: 5]
  ------------------
  338|      0|        *isdefault = PR_FALSE;
  ------------------
  |  |  438|      0|#define PR_FALSE 0
  ------------------
  339|       |
  340|      5|    value = NSSUTIL_ArgGetParamValue(label, params);
  341|      5|    if (value == NULL) {
  ------------------
  |  Branch (341:9): [True: 2, False: 3]
  ------------------
  342|      2|        if (isdefault)
  ------------------
  |  Branch (342:13): [True: 0, False: 2]
  ------------------
  343|      0|            *isdefault = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  344|      2|        return defValue;
  345|      2|    }
  346|      3|    retValue = NSSUTIL_ArgDecodeNumber(value);
  347|      3|    if (value)
  ------------------
  |  Branch (347:9): [True: 3, False: 0]
  ------------------
  348|      3|        PORT_Free(value);
  ------------------
  |  |   60|      3|#define PORT_Free PORT_Free_Util
  ------------------
  349|       |
  350|      3|    return retValue;
  351|      5|}
NSSUTIL_Quote:
  421|      1|{
  422|      1|    return nssutil_escapeQuotes(string, quote, PR_TRUE);
  ------------------
  |  |  437|      1|#define PR_TRUE 1
  ------------------
  423|      1|}
NSSUTIL_DoubleEscape:
  445|      9|{
  446|      9|    char *round1 = NULL;
  447|      9|    char *retValue = NULL;
  448|      9|    if (string == NULL) {
  ------------------
  |  Branch (448:9): [True: 0, False: 9]
  ------------------
  449|      0|        goto done;
  450|      0|    }
  451|      9|    round1 = nssutil_escapeQuotes(string, quote1, PR_FALSE);
  ------------------
  |  |  438|      9|#define PR_FALSE 0
  ------------------
  452|      9|    if (round1) {
  ------------------
  |  Branch (452:9): [True: 9, False: 0]
  ------------------
  453|      9|        retValue = nssutil_escapeQuotes(round1, quote2, PR_FALSE);
  ------------------
  |  |  438|      9|#define PR_FALSE 0
  ------------------
  454|      9|        PORT_Free(round1);
  ------------------
  |  |   60|      9|#define PORT_Free PORT_Free_Util
  ------------------
  455|      9|    }
  456|       |
  457|      9|done:
  458|      9|    if (retValue == NULL) {
  ------------------
  |  Branch (458:9): [True: 0, False: 9]
  ------------------
  459|      0|        retValue = PORT_Strdup("");
  ------------------
  |  |   69|      0|#define PORT_Strdup PORT_Strdup_Util
  ------------------
  460|      0|    }
  461|      9|    return retValue;
  462|      9|}
NSSUTIL_ArgParseSlotFlags:
  621|      1|{
  622|      1|    char *flags;
  623|      1|    const char *index;
  624|      1|    unsigned long retValue = 0;
  625|      1|    int i;
  626|      1|    PRBool all = PR_FALSE;
  ------------------
  |  |  438|      1|#define PR_FALSE 0
  ------------------
  627|       |
  628|      1|    flags = NSSUTIL_ArgGetParamValue(label, params);
  629|      1|    if (flags == NULL)
  ------------------
  |  Branch (629:9): [True: 0, False: 1]
  ------------------
  630|      0|        return 0;
  631|       |
  632|      1|    if (PORT_Strcasecmp(flags, "all") == 0)
  ------------------
  |  |  184|      1|#define PORT_Strcasecmp PL_strcasecmp
  ------------------
  |  Branch (632:9): [True: 0, False: 1]
  ------------------
  633|      0|        all = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
  634|       |
  635|     19|    for (index = flags; *index; index = NSSUTIL_ArgNextFlag(index)) {
  ------------------
  |  Branch (635:25): [True: 18, False: 1]
  ------------------
  636|    414|        for (i = 0; i < nssutil_argSlotFlagTableSize; i++) {
  ------------------
  |  Branch (636:21): [True: 396, False: 18]
  ------------------
  637|    396|            if (all ||
  ------------------
  |  Branch (637:17): [True: 0, False: 396]
  ------------------
  638|    396|                (PORT_Strncasecmp(index, nssutil_argSlotFlagTable[i].name,
  ------------------
  |  |  191|    396|#define PORT_Strncasecmp PL_strncasecmp
  ------------------
  |  Branch (638:17): [True: 18, False: 378]
  ------------------
  639|    396|                                  nssutil_argSlotFlagTable[i].len) == 0)) {
  640|     18|                retValue |= nssutil_argSlotFlagTable[i].value;
  641|     18|            }
  642|    396|        }
  643|     18|    }
  644|      1|    PORT_Free(flags);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  645|      1|    return retValue;
  646|      1|}
NSSUTIL_ArgParseSlotInfo:
  681|      2|{
  682|      2|    const char *slotIndex;
  683|      2|    struct NSSUTILPreSlotInfoStr *slotInfo = NULL;
  684|      2|    int i = 0, count = 0, next;
  685|       |
  686|      2|    *retCount = 0;
  687|      2|    if ((slotParams == NULL) || (*slotParams == 0))
  ------------------
  |  Branch (687:9): [True: 1, False: 1]
  |  Branch (687:33): [True: 0, False: 1]
  ------------------
  688|      1|        return NULL;
  689|       |
  690|       |    /* first count the number of slots */
  691|      2|    for (slotIndex = NSSUTIL_ArgStrip(slotParams); *slotIndex;
  ------------------
  |  Branch (691:52): [True: 1, False: 1]
  ------------------
  692|      1|         slotIndex = NSSUTIL_ArgStrip(NSSUTIL_ArgSkipParameter(slotIndex))) {
  693|      1|        count++;
  694|      1|    }
  695|       |
  696|       |    /* get the data structures */
  697|      1|    if (arena) {
  ------------------
  |  Branch (697:9): [True: 1, False: 0]
  ------------------
  698|      1|        slotInfo = PORT_ArenaZNewArray(arena,
  ------------------
  |  |  163|      1|    (type *)PORT_ArenaZAlloc(poolp, sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   59|      1|#define PORT_ArenaZAlloc PORT_ArenaZAlloc_Util
  |  |  ------------------
  ------------------
  699|      1|                                       struct NSSUTILPreSlotInfoStr, count);
  700|      1|    } else {
  701|      0|        slotInfo = PORT_ZNewArray(struct NSSUTILPreSlotInfoStr, count);
  ------------------
  |  |  159|      0|    (type *)PORT_ZAlloc(sizeof(type) * (num))
  |  |  ------------------
  |  |  |  |   72|      0|#define PORT_ZAlloc PORT_ZAlloc_Util
  |  |  ------------------
  ------------------
  702|      0|    }
  703|      1|    if (slotInfo == NULL)
  ------------------
  |  Branch (703:9): [True: 0, False: 1]
  ------------------
  704|      0|        return NULL;
  705|       |
  706|      1|    for (slotIndex = NSSUTIL_ArgStrip(slotParams), i = 0;
  707|      2|         *slotIndex && i < count;) {
  ------------------
  |  Branch (707:10): [True: 1, False: 1]
  |  Branch (707:24): [True: 1, False: 0]
  ------------------
  708|      1|        char *name;
  709|      1|        name = NSSUTIL_ArgGetLabel(slotIndex, &next);
  710|      1|        slotIndex += next;
  711|       |
  712|      1|        if (!NSSUTIL_ArgIsBlank(*slotIndex)) {
  ------------------
  |  Branch (712:13): [True: 1, False: 0]
  ------------------
  713|      1|            char *args = NSSUTIL_ArgFetchValue(slotIndex, &next);
  714|      1|            slotIndex += next;
  715|      1|            if (args) {
  ------------------
  |  Branch (715:17): [True: 1, False: 0]
  ------------------
  716|      1|                nssutil_argDecodeSingleSlotInfo(name, args, &slotInfo[i]);
  717|      1|                i++;
  718|      1|                PORT_Free(args);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  719|      1|            }
  720|      1|        }
  721|      1|        if (name)
  ------------------
  |  Branch (721:13): [True: 1, False: 0]
  ------------------
  722|      1|            PORT_Free(name);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  723|      1|        slotIndex = NSSUTIL_ArgStrip(slotIndex);
  724|      1|    }
  725|      1|    *retCount = i;
  726|      1|    return slotInfo;
  727|      1|}
NSSUTIL_ArgParseModuleSpecEx:
  836|      2|{
  837|      2|    int next;
  838|      2|    modulespec = NSSUTIL_ArgStrip(modulespec);
  839|       |
  840|      2|    *lib = *mod = *parameters = *nss = *config = 0;
  841|       |
  842|      9|    while (*modulespec) {
  ------------------
  |  Branch (842:12): [True: 7, False: 2]
  ------------------
  843|      7|        NSSUTIL_HANDLE_STRING_ARG(modulespec, *lib, "library=", ;)
  ------------------
  |  |   21|      7|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      7|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 1, False: 6]
  |  |  ------------------
  |  |   22|      1|        param += sizeof(value) - 1;                               \
  |  |   23|      1|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 1]
  |  |  ------------------
  |  |   24|      1|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      1|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      1|        param += next;                                            \
  |  |   27|      1|        command;                                                  \
  |  |   28|      1|    } else
  ------------------
  844|      6|        NSSUTIL_HANDLE_STRING_ARG(modulespec, *mod, "name=", ;)
  ------------------
  |  |   21|      6|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      6|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 2, False: 4]
  |  |  ------------------
  |  |   22|      2|        param += sizeof(value) - 1;                               \
  |  |   23|      2|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      2|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      2|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      2|        param += next;                                            \
  |  |   27|      2|        command;                                                  \
  |  |   28|      2|    } else
  ------------------
  845|      4|        NSSUTIL_HANDLE_STRING_ARG(modulespec, *parameters, "parameters=", ;)
  ------------------
  |  |   21|      4|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      4|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 2, False: 2]
  |  |  ------------------
  |  |   22|      2|        param += sizeof(value) - 1;                               \
  |  |   23|      2|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      2|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      2|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      2|        param += next;                                            \
  |  |   27|      2|        command;                                                  \
  |  |   28|      2|    } else
  ------------------
  846|      2|        NSSUTIL_HANDLE_STRING_ARG(modulespec, *nss, "nss=", ;)
  ------------------
  |  |   21|      2|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      2|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 2, False: 0]
  |  |  ------------------
  |  |   22|      2|        param += sizeof(value) - 1;                               \
  |  |   23|      2|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      2|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      2|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      2|        param += next;                                            \
  |  |   27|      2|        command;                                                  \
  |  |   28|      2|    } else
  ------------------
  847|      0|        NSSUTIL_HANDLE_STRING_ARG(modulespec, *config, "config=", ;)
  ------------------
  |  |   21|      0|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|      0|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   22|      0|        param += sizeof(value) - 1;                               \
  |  |   23|      0|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 0]
  |  |  ------------------
  |  |   24|      0|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      0|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      0|        param += next;                                            \
  |  |   27|      0|        command;                                                  \
  |  |   28|      0|    } else
  ------------------
  848|      0|        NSSUTIL_HANDLE_FINAL_ARG(modulespec)
  ------------------
  |  |   31|      0|    {                                            \
  |  |   32|      0|        param = NSSUTIL_ArgSkipParameter(param); \
  |  |   33|      0|    }                                            \
  |  |   34|      7|    param = NSSUTIL_ArgStrip(param);
  ------------------
  849|      7|    }
  850|      2|    return SECSuccess;
  851|      2|}
NSSUTIL_ArgParseCipherFlags:
 1008|      2|{
 1009|      2|    newCiphers[0] = newCiphers[1] = 0;
 1010|      2|    if ((cipherList == NULL) || (*cipherList == 0))
  ------------------
  |  Branch (1010:9): [True: 2, False: 0]
  |  Branch (1010:33): [True: 0, False: 0]
  ------------------
 1011|      2|        return;
 1012|       |
 1013|      0|    for (; *cipherList; cipherList = NSSUTIL_ArgNextFlag(cipherList)) {
  ------------------
  |  Branch (1013:12): [True: 0, False: 0]
  ------------------
 1014|      0|        if (PORT_Strncasecmp(cipherList, NSSUTIL_ARG_FORTEZZA_FLAG,
  ------------------
  |  |  191|      0|#define PORT_Strncasecmp PL_strncasecmp
  ------------------
                      if (PORT_Strncasecmp(cipherList, NSSUTIL_ARG_FORTEZZA_FLAG,
  ------------------
  |  | 1002|      0|#define NSSUTIL_ARG_FORTEZZA_FLAG "FORTEZZA"
  ------------------
  |  Branch (1014:13): [True: 0, False: 0]
  ------------------
 1015|      0|                             sizeof(NSSUTIL_ARG_FORTEZZA_FLAG) - 1) == 0) {
  ------------------
  |  | 1002|      0|#define NSSUTIL_ARG_FORTEZZA_FLAG "FORTEZZA"
  ------------------
 1016|      0|            newCiphers[0] |= SECMOD_FORTEZZA_FLAG;
  ------------------
  |  |   18|      0|#define SECMOD_FORTEZZA_FLAG 0x00000040L
  ------------------
 1017|      0|        }
 1018|       |
 1019|       |        /* add additional flags here as necessary */
 1020|       |        /* direct bit mapping escape */
 1021|      0|        if (*cipherList == 0) {
  ------------------
  |  Branch (1021:13): [True: 0, False: 0]
  ------------------
 1022|      0|            if (cipherList[1] == 'l') {
  ------------------
  |  Branch (1022:17): [True: 0, False: 0]
  ------------------
 1023|      0|                newCiphers[1] |= atoi(&cipherList[2]);
 1024|      0|            } else {
 1025|      0|                newCiphers[0] |= atoi(&cipherList[2]);
 1026|      0|            }
 1027|      0|        }
 1028|      0|    }
 1029|      0|}
_NSSUTIL_EvaluateConfigDir:
 1196|      2|{
 1197|      2|    NSSDBType dbType;
 1198|      2|    PRBool checkEnvDefaultDB = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 1199|      2|    *appName = NULL;
 1200|       |    /* force the default */
 1201|      2|    dbType = NSS_DB_TYPE_SQL;
 1202|      2|    if (configdir == NULL) {
  ------------------
  |  Branch (1202:9): [True: 0, False: 2]
  ------------------
 1203|      0|        checkEnvDefaultDB = PR_TRUE;
  ------------------
  |  |  437|      0|#define PR_TRUE 1
  ------------------
 1204|      2|    } else if (PORT_Strncmp(configdir, MULTIACCESS, sizeof(MULTIACCESS) - 1) == 0) {
  ------------------
  |  |  193|      2|#define PORT_Strncmp strncmp
  ------------------
                  } else if (PORT_Strncmp(configdir, MULTIACCESS, sizeof(MULTIACCESS) - 1) == 0) {
  ------------------
  |  | 1191|      2|#define MULTIACCESS "multiaccess:"
  ------------------
                  } else if (PORT_Strncmp(configdir, MULTIACCESS, sizeof(MULTIACCESS) - 1) == 0) {
  ------------------
  |  | 1191|      2|#define MULTIACCESS "multiaccess:"
  ------------------
  |  Branch (1204:16): [True: 0, False: 2]
  ------------------
 1205|      0|        char *cdir;
 1206|      0|        dbType = NSS_DB_TYPE_MULTIACCESS;
 1207|       |
 1208|      0|        *appName = PORT_Strdup(configdir + sizeof(MULTIACCESS) - 1);
  ------------------
  |  |   69|      0|#define PORT_Strdup PORT_Strdup_Util
  ------------------
                      *appName = PORT_Strdup(configdir + sizeof(MULTIACCESS) - 1);
  ------------------
  |  | 1191|      0|#define MULTIACCESS "multiaccess:"
  ------------------
 1209|      0|        if (*appName == NULL) {
  ------------------
  |  Branch (1209:13): [True: 0, False: 0]
  ------------------
 1210|      0|            return configdir;
 1211|      0|        }
 1212|      0|        cdir = *appName;
 1213|      0|        while (*cdir && *cdir != ':') {
  ------------------
  |  Branch (1213:16): [True: 0, False: 0]
  |  Branch (1213:25): [True: 0, False: 0]
  ------------------
 1214|      0|            cdir++;
 1215|      0|        }
 1216|      0|        if (*cdir == ':') {
  ------------------
  |  Branch (1216:13): [True: 0, False: 0]
  ------------------
 1217|      0|            *cdir = 0;
 1218|      0|            cdir++;
 1219|      0|        }
 1220|      0|        configdir = cdir;
 1221|      2|    } else if (PORT_Strncmp(configdir, SQLDB, sizeof(SQLDB) - 1) == 0) {
  ------------------
  |  |  193|      2|#define PORT_Strncmp strncmp
  ------------------
                  } else if (PORT_Strncmp(configdir, SQLDB, sizeof(SQLDB) - 1) == 0) {
  ------------------
  |  | 1188|      2|#define SQLDB "sql:"
  ------------------
                  } else if (PORT_Strncmp(configdir, SQLDB, sizeof(SQLDB) - 1) == 0) {
  ------------------
  |  | 1188|      2|#define SQLDB "sql:"
  ------------------
  |  Branch (1221:16): [True: 0, False: 2]
  ------------------
 1222|      0|        dbType = NSS_DB_TYPE_SQL;
 1223|      0|        configdir = configdir + sizeof(SQLDB) - 1;
  ------------------
  |  | 1188|      0|#define SQLDB "sql:"
  ------------------
 1224|      2|    } else if (PORT_Strncmp(configdir, EXTERNDB, sizeof(EXTERNDB) - 1) == 0) {
  ------------------
  |  |  193|      2|#define PORT_Strncmp strncmp
  ------------------
                  } else if (PORT_Strncmp(configdir, EXTERNDB, sizeof(EXTERNDB) - 1) == 0) {
  ------------------
  |  | 1189|      2|#define EXTERNDB "extern:"
  ------------------
                  } else if (PORT_Strncmp(configdir, EXTERNDB, sizeof(EXTERNDB) - 1) == 0) {
  ------------------
  |  | 1189|      2|#define EXTERNDB "extern:"
  ------------------
  |  Branch (1224:16): [True: 0, False: 2]
  ------------------
 1225|      0|        dbType = NSS_DB_TYPE_EXTERN;
 1226|      0|        configdir = configdir + sizeof(EXTERNDB) - 1;
  ------------------
  |  | 1189|      0|#define EXTERNDB "extern:"
  ------------------
 1227|      2|    } else if (PORT_Strncmp(configdir, LEGACY, sizeof(LEGACY) - 1) == 0) {
  ------------------
  |  |  193|      2|#define PORT_Strncmp strncmp
  ------------------
                  } else if (PORT_Strncmp(configdir, LEGACY, sizeof(LEGACY) - 1) == 0) {
  ------------------
  |  | 1190|      2|#define LEGACY "dbm:"
  ------------------
                  } else if (PORT_Strncmp(configdir, LEGACY, sizeof(LEGACY) - 1) == 0) {
  ------------------
  |  | 1190|      2|#define LEGACY "dbm:"
  ------------------
  |  Branch (1227:16): [True: 0, False: 2]
  ------------------
 1228|      0|        dbType = NSS_DB_TYPE_LEGACY;
 1229|      0|        configdir = configdir + sizeof(LEGACY) - 1;
  ------------------
  |  | 1190|      0|#define LEGACY "dbm:"
  ------------------
 1230|      2|    } else {
 1231|      2|        checkEnvDefaultDB = PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 1232|      2|    }
 1233|       |
 1234|       |    /* look up the default from the environment */
 1235|      2|    if (checkEnvDefaultDB) {
  ------------------
  |  Branch (1235:9): [True: 2, False: 0]
  ------------------
 1236|      2|        char *defaultType = PR_GetEnvSecure("NSS_DEFAULT_DB_TYPE");
 1237|      2|        if (defaultType != NULL) {
  ------------------
  |  Branch (1237:13): [True: 0, False: 2]
  ------------------
 1238|      0|            if (PORT_Strncmp(defaultType, SQLDB, sizeof(SQLDB) - 2) == 0) {
  ------------------
  |  |  193|      0|#define PORT_Strncmp strncmp
  ------------------
                          if (PORT_Strncmp(defaultType, SQLDB, sizeof(SQLDB) - 2) == 0) {
  ------------------
  |  | 1188|      0|#define SQLDB "sql:"
  ------------------
                          if (PORT_Strncmp(defaultType, SQLDB, sizeof(SQLDB) - 2) == 0) {
  ------------------
  |  | 1188|      0|#define SQLDB "sql:"
  ------------------
  |  Branch (1238:17): [True: 0, False: 0]
  ------------------
 1239|      0|                dbType = NSS_DB_TYPE_SQL;
 1240|      0|            } else if (PORT_Strncmp(defaultType, EXTERNDB, sizeof(EXTERNDB) - 2) == 0) {
  ------------------
  |  |  193|      0|#define PORT_Strncmp strncmp
  ------------------
                          } else if (PORT_Strncmp(defaultType, EXTERNDB, sizeof(EXTERNDB) - 2) == 0) {
  ------------------
  |  | 1189|      0|#define EXTERNDB "extern:"
  ------------------
                          } else if (PORT_Strncmp(defaultType, EXTERNDB, sizeof(EXTERNDB) - 2) == 0) {
  ------------------
  |  | 1189|      0|#define EXTERNDB "extern:"
  ------------------
  |  Branch (1240:24): [True: 0, False: 0]
  ------------------
 1241|      0|                dbType = NSS_DB_TYPE_EXTERN;
 1242|      0|            } else if (PORT_Strncmp(defaultType, LEGACY, sizeof(LEGACY) - 2) == 0) {
  ------------------
  |  |  193|      0|#define PORT_Strncmp strncmp
  ------------------
                          } else if (PORT_Strncmp(defaultType, LEGACY, sizeof(LEGACY) - 2) == 0) {
  ------------------
  |  | 1190|      0|#define LEGACY "dbm:"
  ------------------
                          } else if (PORT_Strncmp(defaultType, LEGACY, sizeof(LEGACY) - 2) == 0) {
  ------------------
  |  | 1190|      0|#define LEGACY "dbm:"
  ------------------
  |  Branch (1242:24): [True: 0, False: 0]
  ------------------
 1243|      0|                dbType = NSS_DB_TYPE_LEGACY;
 1244|      0|            }
 1245|      0|        }
 1246|      2|    }
 1247|       |    /* if the caller has already set a type, don't change it */
 1248|      2|    if (*pdbType == NSS_DB_TYPE_NONE) {
  ------------------
  |  Branch (1248:9): [True: 2, False: 0]
  ------------------
 1249|      2|        *pdbType = dbType;
 1250|      2|    }
 1251|      2|    return configdir;
 1252|      2|}
_NSSUTIL_GetSecmodName:
 1257|      2|{
 1258|      2|    int next;
 1259|      2|    char *configdir = NULL;
 1260|      2|    char *secmodName = NULL;
 1261|      2|    char *value = NULL;
 1262|      2|    const char *save_params = param;
 1263|      2|    const char *lconfigdir;
 1264|      2|    PRBool noModDB = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 1265|      2|    param = NSSUTIL_ArgStrip(param);
 1266|       |
 1267|     22|    while (*param) {
  ------------------
  |  Branch (1267:12): [True: 20, False: 2]
  ------------------
 1268|     20|        NSSUTIL_HANDLE_STRING_ARG(param, configdir, "configDir=", ;)
  ------------------
  |  |   21|     20|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|     20|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 2, False: 18]
  |  |  ------------------
  |  |   22|      2|        param += sizeof(value) - 1;                               \
  |  |   23|      2|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      2|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      2|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      2|        param += next;                                            \
  |  |   27|      2|        command;                                                  \
  |  |   28|      2|    } else
  ------------------
 1269|     18|        NSSUTIL_HANDLE_STRING_ARG(param, secmodName, "secmod=", ;)
  ------------------
  |  |   21|     18|    if (PORT_Strncasecmp(param, value, sizeof(value) - 1) == 0) { \
  |  |  ------------------
  |  |  |  |  191|     18|#define PORT_Strncasecmp PL_strncasecmp
  |  |  ------------------
  |  |  |  Branch (21:9): [True: 2, False: 16]
  |  |  ------------------
  |  |   22|      2|        param += sizeof(value) - 1;                               \
  |  |   23|      2|        if (target)                                               \
  |  |  ------------------
  |  |  |  Branch (23:13): [True: 0, False: 2]
  |  |  ------------------
  |  |   24|      2|            PORT_Free(target);                                    \
  |  |  ------------------
  |  |  |  |   60|      0|#define PORT_Free PORT_Free_Util
  |  |  ------------------
  |  |   25|      2|        target = NSSUTIL_ArgFetchValue(param, &next);             \
  |  |   26|      2|        param += next;                                            \
  |  |   27|      2|        command;                                                  \
  |  |   28|      2|    } else
  ------------------
 1270|     16|        NSSUTIL_HANDLE_FINAL_ARG(param)
  ------------------
  |  |   31|     16|    {                                            \
  |  |   32|     16|        param = NSSUTIL_ArgSkipParameter(param); \
  |  |   33|     16|    }                                            \
  |  |   34|     20|    param = NSSUTIL_ArgStrip(param);
  ------------------
 1271|     20|    }
 1272|       |
 1273|      2|    *rw = PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 1274|      2|    if (NSSUTIL_ArgHasFlag("flags", "readOnly", save_params)) {
  ------------------
  |  Branch (1274:9): [True: 2, False: 0]
  ------------------
 1275|      2|        *rw = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 1276|      2|    }
 1277|       |
 1278|      2|    if (!secmodName || *secmodName == '\0') {
  ------------------
  |  Branch (1278:9): [True: 0, False: 2]
  |  Branch (1278:24): [True: 2, False: 0]
  ------------------
 1279|      2|        if (secmodName)
  ------------------
  |  Branch (1279:13): [True: 2, False: 0]
  ------------------
 1280|      2|            PORT_Free(secmodName);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 1281|      2|        secmodName = PORT_Strdup(SECMOD_DB);
  ------------------
  |  |   69|      2|#define PORT_Strdup PORT_Strdup_Util
  ------------------
                      secmodName = PORT_Strdup(SECMOD_DB);
  ------------------
  |  | 1192|      2|#define SECMOD_DB "secmod.db"
  ------------------
 1282|      2|    }
 1283|       |
 1284|      2|    *filename = secmodName;
 1285|      2|    lconfigdir = _NSSUTIL_EvaluateConfigDir(configdir, dbType, appName);
 1286|       |
 1287|      2|    if (NSSUTIL_ArgHasFlag("flags", "noModDB", save_params)) {
  ------------------
  |  Branch (1287:9): [True: 2, False: 0]
  ------------------
 1288|       |        /* there isn't a module db, don't load the legacy support */
 1289|      2|        noModDB = PR_TRUE;
  ------------------
  |  |  437|      2|#define PR_TRUE 1
  ------------------
 1290|      2|        *dbType = NSS_DB_TYPE_SQL;
 1291|      2|        PORT_Free(*filename);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 1292|      2|        *filename = NULL;
 1293|      2|        *rw = PR_FALSE;
  ------------------
  |  |  438|      2|#define PR_FALSE 0
  ------------------
 1294|      2|    }
 1295|       |
 1296|       |    /* only use the renamed secmod for legacy databases */
 1297|      2|    if ((*dbType != NSS_DB_TYPE_LEGACY) &&
  ------------------
  |  Branch (1297:9): [True: 2, False: 0]
  ------------------
 1298|      2|        (*dbType != NSS_DB_TYPE_MULTIACCESS) &&
  ------------------
  |  Branch (1298:9): [True: 2, False: 0]
  ------------------
 1299|      2|        !NSSUTIL_ArgHasFlag("flags", "forceSecmodChoice", save_params)) {
  ------------------
  |  Branch (1299:9): [True: 2, False: 0]
  ------------------
 1300|      2|        secmodName = "pkcs11.txt";
 1301|      2|    }
 1302|       |
 1303|      2|    if (noModDB) {
  ------------------
  |  Branch (1303:9): [True: 2, False: 0]
  ------------------
 1304|      2|        value = NULL;
 1305|      2|    } else if (lconfigdir && lconfigdir[0] != '\0') {
  ------------------
  |  Branch (1305:16): [True: 0, False: 0]
  |  Branch (1305:30): [True: 0, False: 0]
  ------------------
 1306|      0|        value = PR_smprintf("%s" NSSUTIL_PATH_SEPARATOR "%s",
 1307|      0|                            lconfigdir, secmodName);
 1308|      0|    } else {
 1309|      0|        value = PR_smprintf("%s", secmodName);
 1310|      0|    }
 1311|      2|    if (configdir)
  ------------------
  |  Branch (1311:9): [True: 2, False: 0]
  ------------------
 1312|      2|        PORT_Free(configdir);
  ------------------
  |  |   60|      2|#define PORT_Free PORT_Free_Util
  ------------------
 1313|      2|    return value;
 1314|      2|}
utilpars.c:nssutil_escapeQuotesSize:
  359|     19|{
  360|     19|    int escapes = 0, size = 0;
  361|     19|    const char *src;
  362|       |
  363|     19|    size = addquotes ? 2 : 0;
  ------------------
  |  Branch (363:12): [True: 1, False: 18]
  ------------------
  364|    215|    for (src = string; *src; src++) {
  ------------------
  |  Branch (364:24): [True: 196, False: 19]
  ------------------
  365|    196|        if ((*src == quote) || (*src == '\\'))
  ------------------
  |  Branch (365:13): [True: 0, False: 196]
  |  Branch (365:32): [True: 0, False: 196]
  ------------------
  366|      0|            escapes++;
  367|    196|        size++;
  368|    196|    }
  369|     19|    return size + escapes + 1;
  370|     19|}
utilpars.c:nssutil_escapeQuotes:
  374|     19|{
  375|     19|    char *newString = 0;
  376|     19|    int size = 0;
  377|     19|    const char *src;
  378|     19|    char *dest;
  379|       |
  380|     19|    size = nssutil_escapeQuotesSize(string, quote, addquotes);
  381|       |
  382|     19|    dest = newString = PORT_ZAlloc(size);
  ------------------
  |  |   72|     19|#define PORT_ZAlloc PORT_ZAlloc_Util
  ------------------
  383|     19|    if (newString == NULL) {
  ------------------
  |  Branch (383:9): [True: 0, False: 19]
  ------------------
  384|      0|        return NULL;
  385|      0|    }
  386|       |
  387|     19|    if (addquotes)
  ------------------
  |  Branch (387:9): [True: 1, False: 18]
  ------------------
  388|      1|        *dest++ = quote;
  389|    215|    for (src = string; *src; src++, dest++) {
  ------------------
  |  Branch (389:24): [True: 196, False: 19]
  ------------------
  390|    196|        if ((*src == '\\') || (*src == quote)) {
  ------------------
  |  Branch (390:13): [True: 0, False: 196]
  |  Branch (390:31): [True: 0, False: 196]
  ------------------
  391|      0|            *dest++ = '\\';
  392|      0|        }
  393|    196|        *dest = *src;
  394|    196|    }
  395|     19|    if (addquotes)
  ------------------
  |  Branch (395:9): [True: 1, False: 18]
  ------------------
  396|      1|        *dest = quote;
  397|       |
  398|     19|    return newString;
  399|     19|}
utilpars.c:nssutil_argDecodeSingleSlotInfo:
  652|      1|{
  653|      1|    char *askpw;
  654|       |
  655|      1|    slotInfo->slotID = NSSUTIL_ArgDecodeNumber(name);
  656|      1|    slotInfo->defaultFlags = NSSUTIL_ArgParseSlotFlags("slotFlags", params);
  657|      1|    slotInfo->timeout = NSSUTIL_ArgReadLong("timeout", params, 0, NULL);
  658|       |
  659|      1|    askpw = NSSUTIL_ArgGetParamValue("askpw", params);
  660|      1|    slotInfo->askpw = 0;
  661|       |
  662|      1|    if (askpw) {
  ------------------
  |  Branch (662:9): [True: 1, False: 0]
  ------------------
  663|      1|        if (PORT_Strcasecmp(askpw, "every") == 0) {
  ------------------
  |  |  184|      1|#define PORT_Strcasecmp PL_strcasecmp
  ------------------
  |  Branch (663:13): [True: 0, False: 1]
  ------------------
  664|      0|            slotInfo->askpw = -1;
  665|      1|        } else if (PORT_Strcasecmp(askpw, "timeout") == 0) {
  ------------------
  |  |  184|      1|#define PORT_Strcasecmp PL_strcasecmp
  ------------------
  |  Branch (665:20): [True: 0, False: 1]
  ------------------
  666|      0|            slotInfo->askpw = 1;
  667|      0|        }
  668|      1|        PORT_Free(askpw);
  ------------------
  |  |   60|      1|#define PORT_Free PORT_Free_Util
  ------------------
  669|      1|        slotInfo->defaultFlags |= PK11_OWN_PW_DEFAULTS;
  ------------------
  |  |   36|      1|#define PK11_OWN_PW_DEFAULTS 0x20000000L
  ------------------
  670|      1|    }
  671|      1|    slotInfo->hasRootCerts = NSSUTIL_ArgHasFlag("rootFlags", "hasRootCerts",
  672|      1|                                                params);
  673|      1|    slotInfo->hasRootTrust = NSSUTIL_ArgHasFlag("rootFlags", "hasRootTrust",
  674|      1|                                                params);
  675|      1|}

